diff --git a/food-open/.project b/food-open/.project new file mode 100644 index 0000000..8f00824 --- /dev/null +++ b/food-open/.project @@ -0,0 +1,17 @@ + + + food-open + + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + + diff --git a/food-open/.settings/org.eclipse.core.resources.prefs b/food-open/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..99f26c0 --- /dev/null +++ b/food-open/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/food-open/.settings/org.eclipse.m2e.core.prefs b/food-open/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..f897a7f --- /dev/null +++ b/food-open/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/food-open/food-open-api/.classpath b/food-open/food-open-api/.classpath new file mode 100644 index 0000000..772acef --- /dev/null +++ b/food-open/food-open-api/.classpath @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/food-open/food-open-api/.project b/food-open/food-open-api/.project new file mode 100644 index 0000000..c353976 --- /dev/null +++ b/food-open/food-open-api/.project @@ -0,0 +1,23 @@ + + + food-open-api + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/food-open/food-open-api/.settings/org.eclipse.core.resources.prefs b/food-open/food-open-api/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..aedbd31 --- /dev/null +++ b/food-open/food-open-api/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,6 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/main/resources=UTF-8 +encoding//src/test/java=UTF-8 +encoding/=UTF-8 +encoding/lib=UTF-8 diff --git a/food-open/food-open-api/.settings/org.eclipse.jdt.core.prefs b/food-open/food-open-api/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..2f5cc74 --- /dev/null +++ b/food-open/food-open-api/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/food-open/food-open-api/.settings/org.eclipse.m2e.core.prefs b/food-open/food-open-api/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..f897a7f --- /dev/null +++ b/food-open/food-open-api/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/food-open/food-open-api/assembly.xml b/food-open/food-open-api/assembly.xml new file mode 100644 index 0000000..a23177b --- /dev/null +++ b/food-open/food-open-api/assembly.xml @@ -0,0 +1,50 @@ + + + package + + dir + zip + + true + + + src/main/bin + bin + + + src/main/resources + conf + + application.properties + erp.properties + logback.xml + + + + src/main/conf + conf + + + src/main/logs + logs + + + src/main/lib + lib + + + src/main/temp + temp + + + + + ${project.build.directory}/${artifactId}-${version}.jar + lib + ${artifactId}-${version}.jar + + + \ No newline at end of file diff --git a/food-open/food-open-api/food-open-api.iml b/food-open/food-open-api/food-open-api.iml new file mode 100644 index 0000000..0688d6c --- /dev/null +++ b/food-open/food-open-api/food-open-api.iml @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/lib/open-core-1.0.0.jar b/food-open/food-open-api/lib/open-core-1.0.0.jar new file mode 100644 index 0000000..8625869 Binary files /dev/null and b/food-open/food-open-api/lib/open-core-1.0.0.jar differ diff --git a/food-open/food-open-api/lib/qiniu-logging-plugin-logback-1.0.1.jar b/food-open/food-open-api/lib/qiniu-logging-plugin-logback-1.0.1.jar new file mode 100644 index 0000000..2c7da6d Binary files /dev/null and b/food-open/food-open-api/lib/qiniu-logging-plugin-logback-1.0.1.jar differ diff --git a/food-open/food-open-api/lib/qiniu-pandora-sdk-2.1.0.jar b/food-open/food-open-api/lib/qiniu-pandora-sdk-2.1.0.jar new file mode 100644 index 0000000..ef61313 Binary files /dev/null and b/food-open/food-open-api/lib/qiniu-pandora-sdk-2.1.0.jar differ diff --git a/food-open/food-open-api/pom.xml b/food-open/food-open-api/pom.xml new file mode 100644 index 0000000..e06fa09 --- /dev/null +++ b/food-open/food-open-api/pom.xml @@ -0,0 +1,296 @@ + + + 4.0.0 + + com.jwsaas + food-open + 2.0.0 + + food-open-api + + food-open-api + http://maven.apache.org + + + UTF-8 + 1.5.19.RELEASE + 2.5.0 + + 1.2.0 + 1.4.9 + 1.59 + 3.1.0 + + + + + + + org.springframework.boot + spring-boot-dependencies + ${spring.boot.version} + pom + import + + + org.springframework.data + spring-data-releasetrain + Fowler-SR2 + import + pom + + + + + + + com.jwsaas + food-api + + + com.jwsaas + common-utils + + + commons-logging + commons-logging + + + + + com.jwsaas + common-dubbo + + + commons-logging + commons-logging + + + dubbo + com.alibaba + + + netty + io.netty + + + + + com.alibaba + dubbo + 2.6.5 + + + netty + org.jboss.netty + + + + + com.jwsaas.open + open-core + 1.0.0 + system + ${basedir}/lib/open-core-1.0.0.jar + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-freemarker + + + org.springframework.boot + spring-boot-starter-test + test + + + + com.alibaba + fastjson + + + + org.redisson + redisson + + + + io.projectreactor.spring + reactor-spring-context + + + org.apache.commons + commons-lang3 + + + commons-io + commons-io + + + org.apache.httpcomponents + httpclient + + + org.apache.httpcomponents + httpmime + + + net.sourceforge.pinyin4j + pinyin4j + ${pinyin4j.version} + + + + org.springframework.boot + spring-boot-starter-amqp + + + + org.eclipse.paho + org.eclipse.paho.client.mqttv3 + ${mqttv3.version} + + + com.thoughtworks.xstream + xstream + ${xstream.version} + + + + com.fasterxml.jackson.core + jackson-core + + + com.fasterxml.jackson.core + jackson-databind + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + + + com.fasterxml.jackson.dataformat + jackson-dataformat-yaml + + + com.fasterxml.jackson.core + jackson-annotations + + + org.bouncycastle + bcprov-jdk15on + ${bcprov.jdk15o.version} + + + dom4j + dom4j + 1.6.1 + + + + javax.servlet + javax.servlet-api + ${servlet.api.version} + provided + + + com.qiniu + qiniu-logging-plugin-logback + 1.0.1 + system + ${basedir}/lib/qiniu-logging-plugin-logback-1.0.1.jar + + + com.qiniu + qiniu-pandora-sdk + 2.1.0 + system + ${basedir}/lib/qiniu-pandora-sdk-2.1.0.jar + + + com.squareup.okhttp3 + okhttp + 3.3.1 + + + + com.google.code.gson + gson + 2.6.2 + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + 2.5.6 + + + + repackage + + + + + + maven-assembly-plugin + + false + + assembly.xml + + + + + make-assembly + package + + single + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + application.properties + logback.xml + + + + + + + + + ${basedir}/lib + BOOT-INF/lib/ + + **/*.jar + + + + src/main/resources + BOOT-INF/classes/ + + application.properties + logback.xml + + + + + + + + diff --git a/food-open/food-open-api/readme/history.txt b/food-open/food-open-api/readme/history.txt new file mode 100644 index 0000000..28d33c5 --- /dev/null +++ b/food-open/food-open-api/readme/history.txt @@ -0,0 +1,10 @@ +2018-04-16 +************更新记录************ +优化修复: +1)xxx; + + +新增功能: +1)交班信息上传时增加支付方式明细信息; +2)xxx; + diff --git a/food-open/food-open-api/readme/运行方式.txt b/food-open/food-open-api/readme/运行方式.txt new file mode 100644 index 0000000..6ad5475 --- /dev/null +++ b/food-open/food-open-api/readme/运行方式.txt @@ -0,0 +1,21 @@ +1.com.boduo.Application中的main方法直接运行。适用于开发模式 +2.打包运行。适用于安装部署。 +注: + + + + ${basedir}/src/lib + BOOT-INF/lib/ + + **/*.jar + + + + + src/main/resources + BOOT-INF/classes/ + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/src/main/bin/install.bat b/food-open/food-open-api/src/main/bin/install.bat new file mode 100644 index 0000000..046a68c --- /dev/null +++ b/food-open/food-open-api/src/main/bin/install.bat @@ -0,0 +1,140 @@ +@echo off +setlocal + +rem +rem Copyright (c) 1999, 2016 Tanuki Software, Ltd. +rem http://www.tanukisoftware.com +rem All rights reserved. +rem +rem This software is the proprietary information of Tanuki Software. +rem You shall use it only in accordance with the terms of the +rem license agreement you entered into with Tanuki Software. +rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html +rem +rem Java Service Wrapper general passthrough startup script. +rem + +rem ----------------------------------------------------------------------------- +rem These settings can be modified to fit the needs of your application +rem Optimized for use with version 3.5.28 of the Wrapper. + +rem The base name for the Wrapper binary. +set _WRAPPER_BASE=wrapper + +rem The directory where the Wrapper binary (.exe) file is located. It can be +rem either an absolute or a relative path. If the path contains any special +rem characters, please make sure to quote the variable. +set _WRAPPER_DIR= + +rem The name and location of the Wrapper configuration file. This will be used +rem if the user does not specify a configuration file as the first parameter to +rem this script. +set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf" + +rem Makes it possible to override the Wrapper configuration file by specifying it +rem as the first parameter. +rem set _WRAPPER_CONF_OVERRIDE=true + +rem _PASS_THROUGH tells the script to pass all parameters through to the JVM +rem as is. +rem If _WRAPPER_CONF_OVERRIDE is specified then all parameters will be passed. +rem If not set then all parameters starting with the second will be passed. +set _PASS_THROUGH=true + +rem Do not modify anything beyond this point +rem ----------------------------------------------------------------------------- + +rem +rem Resolve the real path of the wrapper.exe +rem For non NT systems, the _REALPATH and _WRAPPER_CONF values +rem can be hard-coded below and the following test removed. +rem +if "%OS%"=="Windows_NT" goto nt +echo This script only works with NT-based versions of Windows. +goto :eof + +:nt +rem Find the application home. +rem if no path path specified do the default action +IF not DEFINED _WRAPPER_DIR goto dir_undefined +set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%" +if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\" +rem check if absolute path +if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path +if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path +rem everythig else means relative path +set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%" +goto pathfound + +:dir_undefined +rem Use a relative path to the wrapper %~dp0 is location of current script under NT +set _REALPATH="%~dp0" +goto pathfound +:absolute_path +rem Use an absolute path to the wrapper +set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%" + +:pathfound +rem +rem Decide on the specific Wrapper binary to use (See delta-pack) +rem +if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe" +goto search +:amd64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe" +goto search +:ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe" +goto search +:search +set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%" +if exist %_WRAPPER_EXE% goto conf +set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe" +if exist %_WRAPPER_EXE% goto conf +echo Unable to locate a Wrapper executable using any of the following names: +echo %_WRAPPER_L_EXE% +echo %_WRAPPER_EXE% +pause +goto :eof + +rem +rem Find the wrapper.conf +rem +:conf +if [%_WRAPPER_CONF_OVERRIDE%]==[true] ( + set _WRAPPER_CONF="%~f1" + if not [%_WRAPPER_CONF%]==[""] ( + shift + goto :startup + ) +) +set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%" + +rem +rem Start the Wrapper +rem +:startup +if not [%_PASS_THROUGH%]==[true] ( + if not [%1]==[] ( + echo WARNING: Extra arguments will be ignored. Please check usage in the batch file. + ) +) + +rem Collect the application parameters +:parameters +set _PARAMETERS=%_PARAMETERS% %1 +shift +if not [%1]==[] goto :parameters + +if not [%_PASS_THROUGH%]==[true] ( + %_WRAPPER_EXE% -i %_WRAPPER_CONF% +) else ( + %_WRAPPER_EXE% -i %_WRAPPER_CONF% -- %_PARAMETERS% +) +if not errorlevel 1 goto :eof +pause + + diff --git a/food-open/food-open-api/src/main/bin/middleware b/food-open/food-open-api/src/main/bin/middleware new file mode 100644 index 0000000..3f3ad3f --- /dev/null +++ b/food-open/food-open-api/src/main/bin/middleware @@ -0,0 +1,2162 @@ +#! /bin/sh + +# +# Copyright (c) 1999, 2016 Tanuki Software, Ltd. +# http://www.tanukisoftware.com +# All rights reserved. +# +# This software is the proprietary information of Tanuki Software. +# You shall use it only in accordance with the terms of the +# license agreement you entered into with Tanuki Software. +# http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html +# +# Java Service Wrapper sh script. Suitable for starting and stopping +# wrapped Java applications on UNIX platforms. +# + +#----------------------------------------------------------------------------- +# These settings can be modified to fit the needs of your application +# Optimized for use with version 3.5.28 of the Wrapper. + +#******************************************************************** +# NOTE - This script has been modified to run the TestWrapper sample +# application and should NOT be used as a base for your own +# applications. All of the documentation assumes that you are +# working from the default source script: +# WRAPPER_HOME/src/bin/sh.script.in +#******************************************************************** + +# IMPORTANT - Please always stop and uninstall an application before making +# any changes to this file. Failure to do so could remove the +# script's ability to control the application. + +# Initialization block for the install_initd and remove_initd scripts used by +# SUSE linux, CentOS and RHEL distributions. +# Note: From CentOS 6, make sure the BEGIN INIT INFO section is before any line +# of code otherwise the service won't be displayed in the Service +# Configuration GUI. +### BEGIN INIT INFO +# Provides: wrapper +# Required-Start: $local_fs $network $syslog +# Should-Start: +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Wrapper Sample Application +# Description: Wrapper Sample Application Description +### END INIT INFO + +# Application +APP_NAME="Food-2.0 Open Api" +APP_LONG_NAME="Food-2.0 Open Api Application" + +# If uncommented (and set to false), APP_NAME and APP_LONG_NAME will no longer +# be passed to the wrapper. See documentation for details. +#APP_NAME_PASS_TO_WRAPPER=false + +# Wrapper +WRAPPER_CMD="./wrapper" +WRAPPER_CONF="../conf/wrapper.conf" + +# Priority at which to run the wrapper. See "man nice" for valid priorities. +# nice is only used if a priority is specified. +PRIORITY= + +# Location of the pid file. +PIDDIR="." + +# PIDFILE_CHECK_PID tells the script to double check whether the pid in the pid +# file actually exists and belongs to this application. When not set, only +# check the pid, but not what it is. This is only needed when multiple +# applications need to share the same pid file. +PIDFILE_CHECK_PID=true + +# FIXED_COMMAND tells the script to use a hard coded action rather than +# expecting the first parameter of the command line to be the command. +# By default the command will will be expected to be the first parameter. +#FIXED_COMMAND=console + +# PASS_THROUGH tells the script to pass all arguments through to the JVM +# as is. If FIXED_COMMAND is specified then all arguments will be passed. +# If not set then all arguments starting with the second will be passed. +PASS_THROUGH=true + +# If uncommented, causes the Wrapper to be shutdown using an anchor file. +# When launched with the 'start' command, it will also ignore all INT and +# TERM signals. +#IGNORE_SIGNALS=true + +# Wrapper will start the JVM asynchronously. Your application may have some +# initialization tasks and it may be desirable to wait a few seconds +# before returning. For example, to delay the invocation of following +# startup scripts. Setting WAIT_AFTER_STARTUP to a positive number will +# cause the start command to delay for the indicated period of time +# (in seconds). +# +WAIT_AFTER_STARTUP=0 + +# If set, wait for the wrapper to report that the daemon has started +WAIT_FOR_STARTED_STATUS=true +WAIT_FOR_STARTED_TIMEOUT=120 + +# If set, the status, start_msg and stop_msg commands will print out detailed +# state information on the Wrapper and Java processes. +#DETAIL_STATUS=true + +# If set, the 'pause' and 'resume' commands will be enabled. These make it +# possible to pause the JVM or Java application without completely stopping +# the Wrapper. See the wrapper.pausable and wrapper.pausable.stop_jvm +# properties for more information. +#PAUSABLE=true + +# If specified, the Wrapper will be run as the specified user. +# IMPORTANT - Make sure that the user has the required privileges to write +# the PID file and wrapper.log files. Failure to be able to write the log +# file will cause the Wrapper to exit without any way to write out an error +# message. +# NOTE - This will set the user which is used to run the Wrapper as well as +# the JVM and is not useful in situations where a privileged resource or +# port needs to be allocated prior to the user being changed. +#RUN_AS_USER= + +# Set the full path to the 'su' command (substitute user). +# NOTE - In case 'su' is not in the PATH, you can set the absolute path here, +# for example: +# SU_BIN=/bin/su +# NOTE - For Red Hat, the script will use '/sbin/runuser' if it is present and +# ignore the value of SU_BIN. +SU_BIN=su + +# Set option for 'su'. +# In case the user set in RUN_AS_USER has no bash set, the 'su' command will fail. +# The workaround for GNU/Linux system is to specify which bash to use with +# the '-s' option. +#SU_OPTS="-s /bin/bash" + +# Set the full path to the 'id' command. +# For example: +# ID_BIN=/usr/bin/id +ID_BIN=id + +# By default we show a detailed usage block. Uncomment to show brief usage. +#BRIEF_USAGE=true + +# OS service management tool: flag for using Upstart when installing (rather than init.d rc.d) +USE_UPSTART= + +# OS service management tool: flag for using systemd when installing +USE_SYSTEMD= + +# When installing on Mac OSX platforms, the following domain will be used to +# prefix the plist file name. +PLIST_DOMAIN=org.tanukisoftware.wrapper + +# When installing on Mac OSX platforms, this parameter controls whether the daemon +# is to be kept continuously running or to let demand and conditions control the +# invocation. +MACOSX_KEEP_RUNNING="false" + +# The following two lines are used by the chkconfig command. Change as is +# appropriate for your application. They should remain commented. +# chkconfig: 2345 20 80 +# description: Test Wrapper Sample Application + +# Set run level to use when installing the application to start and stop on +# system startup and shutdown. It is important that the application always +# be uninstalled before making any changes to the run levels. +# It is also possible to specify different run levels based on the individual +# platform. When doing so this script will look for defined run levels in +# the following order: +# 1) "RUN_LEVEL_S_$DIST_OS" or "RUN_LEVEL_K_$DIST_OS", where "$DIST_OS" is +# the value of DIST_OS. "RUN_LEVEL_S_solaris=20" for example. +# 2) RUN_LEVEL_S or RUN_LEVEL_K, to specify specify start or stop run levels. +# 3) RUN_LEVEL, to specify a general run level. +RUN_LEVEL=20 + +# Do not modify anything beyond this point +#----------------------------------------------------------------------------- + +# check if we are running under Cygwin terminal. +# Note: on some OS's (for example Solaris, MacOS), -o is not a valid parameter +# and it shows an error message. We redirect stderr to null so the error message +# doesn't show up. +CYGWIN=`uname -o 2>/dev/null` +if [ "$CYGWIN" = "Cygwin" ] +then + eval echo `gettext 'This script is not compatible with Cygwin. Please use the Wrapper batch files to control the Wrapper.'` + exit 1 +fi + +if [ -n "$FIXED_COMMAND" ] +then + COMMAND="$FIXED_COMMAND" +else + COMMAND="$1" +fi + +# check if there is a parameter "sysd" +SYSD= +if [ $# -gt 1 ] ; then + if [ $2 = "sysd" ] ; then + SYSD=1 + fi +fi + +# default location for the service file +SYSTEMD_SERVICE_FILE="/etc/systemd/system/$APP_NAME.service" + +# Required for HP-UX Startup +if [ `uname -s` = "HP-UX" -o `uname -s` = "HP-UX64" ] ; then + PATH=$PATH:/usr/bin +fi + +# Get the fully qualified path to the script +case $0 in + /*) + SCRIPT="$0" + ;; + *) + PWD=`pwd` + SCRIPT="$PWD/$0" + ;; +esac + +# Resolve the true real path without any sym links. +CHANGED=true +while [ "X$CHANGED" != "X" ] +do + # Change spaces to ":" so the tokens can be parsed. + SAFESCRIPT=`echo $SCRIPT | sed -e 's; ;:;g'` + # Get the real path to this script, resolving any symbolic links + TOKENS=`echo $SAFESCRIPT | sed -e 's;/; ;g'` + REALPATH= + for C in $TOKENS; do + # Change any ":" in the token back to a space. + C=`echo $C | sed -e 's;:; ;g'` + REALPATH="$REALPATH/$C" + # If REALPATH is a sym link, resolve it. Loop for nested links. + while [ -h "$REALPATH" ] ; do + LS="`ls -ld "$REALPATH"`" + LINK="`expr "$LS" : '.*-> \(.*\)$'`" + if expr "$LINK" : '/.*' > /dev/null; then + # LINK is absolute. + REALPATH="$LINK" + else + # LINK is relative. + REALPATH="`dirname "$REALPATH"`""/$LINK" + fi + done + done + + if [ "$REALPATH" = "$SCRIPT" ] + then + CHANGED="" + else + SCRIPT="$REALPATH" + fi +done + +# Get the location of the script. +REALDIR=`dirname "$REALPATH"` +# Normalize the path +REALDIR=`cd "${REALDIR}"; pwd` + +# If the PIDDIR is relative, set its value relative to the full REALPATH to avoid problems if +# the working directory is later changed. +FIRST_CHAR=`echo $PIDDIR | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + PIDDIR=$REALDIR/$PIDDIR +fi +# Same test for WRAPPER_CMD +FIRST_CHAR=`echo $WRAPPER_CMD | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CMD=$REALDIR/$WRAPPER_CMD +fi +# Same test for WRAPPER_CONF +FIRST_CHAR=`echo $WRAPPER_CONF | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CONF=$REALDIR/$WRAPPER_CONF +fi + +# Process ID +ANCHORFILE="$PIDDIR/$APP_NAME.anchor" +COMMANDFILE="$PIDDIR/$APP_NAME.command" +STATUSFILE="$PIDDIR/$APP_NAME.status" +JAVASTATUSFILE="$PIDDIR/$APP_NAME.java.status" +PIDFILE="$PIDDIR/$APP_NAME.pid" +LOCKDIR="/var/lock/subsys" +LOCKFILE="$LOCKDIR/$APP_NAME" +pid="" + +# Resolve the location of the 'ps' command +PS_BIN="/usr/ucb/ps" + if [ ! -x "$PS_BIN" ] + then + PS_BIN="/usr/bin/ps" + if [ ! -x "$PS_BIN" ] + then + PS_BIN="/bin/ps" + if [ ! -x "$PS_BIN" ] + then + eval echo `gettext 'Unable to locate "ps".'` + eval echo `gettext 'Please report this message along with the location of the command on your system.'` + exit 1 + fi + fi + fi + +TR_BIN="/usr/bin/tr" +if [ ! -x "$TR_BIN" ] +then + TR_BIN="/bin/tr" + if [ ! -x "$TR_BIN" ] + then + eval echo `gettext 'Unable to locate "tr".'` + eval echo `gettext 'Please report this message along with the location of the command on your system.'` + exit 1 + fi +fi +# Resolve the os +DIST_OS=`uname -s | $TR_BIN "[A-Z]" "[a-z]" | $TR_BIN -d ' '` +case "$DIST_OS" in + 'sunos') + DIST_OS="solaris" + ;; + 'hp-ux' | 'hp-ux64') + # HP-UX needs the XPG4 version of ps (for -o args) + DIST_OS="hpux" + UNIX95="" + export UNIX95 + ;; + 'darwin') + DIST_OS="macosx" + ;; + 'unix_sv') + DIST_OS="unixware" + ;; + 'os/390') + DIST_OS="zos" + ;; +esac + +# Compare Versions $1<$2=0, $1==$2=1, $1>$2=2 +compareVersions () { + if [ "$1" = "$2" ] + then + return 1 + else + local i=1 + while true + do + local v1=`echo "$1" | cut -d '.' -f $i` + local v2=`echo "$2" | cut -d '.' -f $i` + if [ "X$v1" = "X" ] + then + if [ "X$v2" = "X" ] + then + return 1 + fi + v1="0" + elif [ "X$v2" = "X" ] + then + v2="0" + fi + if [ $v1 -lt $v2 ] + then + return 0 + elif [ $v1 -gt $v2 ] + then + return 2 + fi + i=`expr $i + 1` + done + fi +} + +# Resolve the architecture +if [ "$DIST_OS" = "macosx" ] +then + OS_VER=`sw_vers | grep 'ProductVersion:' | grep -o '[0-9]*\.[0-9]*\.[0-9]*\|[0-9]*\.[0-9]*'` + DIST_ARCH="universal" + compareVersions "$OS_VER" "10.5.0" + if [[ $? < 1 ]] + then + DIST_BITS="32" + KEY_KEEP_ALIVE="OnDemand" + else + # Note: "OnDemand" has been deprecated and replaced from Mac OS X 10.5 by "KeepAlive" + KEY_KEEP_ALIVE="KeepAlive" + + if [ "X`/usr/sbin/sysctl -n hw.cpu64bit_capable`" = "X1" ] + then + DIST_BITS="64" + else + DIST_BITS="32" + fi + fi + APP_PLIST_BASE=${PLIST_DOMAIN}.${APP_NAME} + APP_PLIST=${APP_PLIST_BASE}.plist +else + if [ "$DIST_OS" = "linux" ] + then + DIST_ARCH= + else + DIST_ARCH=`uname -p 2>/dev/null | $TR_BIN "[A-Z]" "[a-z]" | $TR_BIN -d ' '` + fi + if [ "X$DIST_ARCH" = "X" ] + then + DIST_ARCH="unknown" + fi + if [ "$DIST_ARCH" = "unknown" ] + then + DIST_ARCH=`uname -m 2>/dev/null | $TR_BIN "[A-Z]" "[a-z]" | $TR_BIN -d ' '` + fi + case "$DIST_ARCH" in + 'athlon' | 'i386' | 'i486' | 'i586' | 'i686') + DIST_ARCH="x86" + if [ "${DIST_OS}" = "solaris" ] ; then + DIST_BITS=`isainfo -b` + else + DIST_BITS="32" + fi + ;; + 'amd64' | 'x86_64') + DIST_ARCH="x86" + DIST_BITS="64" + ;; + 'ia32') + DIST_ARCH="ia" + DIST_BITS="32" + ;; + 'ia64' | 'ia64n' | 'ia64w') + DIST_ARCH="ia" + DIST_BITS="64" + ;; + 'ip27') + DIST_ARCH="mips" + DIST_BITS="32" + ;; + 'power' | 'powerpc' | 'power_pc' | 'ppc64') + if [ "${DIST_ARCH}" = "ppc64" ] ; then + DIST_BITS="64" + else + DIST_BITS="32" + fi + DIST_ARCH="ppc" + if [ "${DIST_OS}" = "aix" ] ; then + if [ `getconf KERNEL_BITMODE` -eq 64 ]; then + DIST_BITS="64" + else + DIST_BITS="32" + fi + fi + ;; + 'pa_risc' | 'pa-risc') + DIST_ARCH="parisc" + if [ `getconf KERNEL_BITS` -eq 64 ]; then + DIST_BITS="64" + else + DIST_BITS="32" + fi + ;; + 'sun4u' | 'sparcv9' | 'sparc') + DIST_ARCH="sparc" + DIST_BITS=`isainfo -b` + ;; + '9000/800' | '9000/785') + DIST_ARCH="parisc" + if [ `getconf KERNEL_BITS` -eq 64 ]; then + DIST_BITS="64" + else + DIST_BITS="32" + fi + ;; + '2064' | '2066' | '2084' | '2086' | '2094' | '2096' | '2097' | '2098' | '2817') + DIST_ARCH="390" + DIST_BITS="64" + ;; + armv*) + if [ -z "`readelf -A /proc/self/exe | grep Tag_ABI_VFP_args`" ] ; then + DIST_ARCH="armel" + DIST_BITS="32" + else + DIST_ARCH="armhf" + DIST_BITS="32" + fi + ;; + esac +fi + +# OSX always places Java in the same location so we can reliably set JAVA_HOME +if [ "$DIST_OS" = "macosx" ] +then + if [ -z "$JAVA_HOME" ]; then + if [ -x /usr/libexec/java_home ]; then + JAVA_HOME=`/usr/libexec/java_home`; export JAVA_HOME + else + JAVA_HOME="/Library/Java/Home"; export JAVA_HOME + fi + fi +fi + +# Test Echo +ECHOTEST=`echo -n "x"` +if [ "$ECHOTEST" = "x" ] +then + ECHOOPT="-n " + ECHOOPTC="" +else + ECHOOPT="" + ECHOOPTC="\c" +fi + + +gettext() { + "$WRAPPER_CMD" --translate "$1" "$WRAPPER_CONF" 2>/dev/null + if [ $? != 0 ] ; then + echo "$1" + fi +} + +outputFile() { + if [ -f "$1" ] + then + eval echo `gettext ' $1 Found but not executable.'`; + else + echo " $1" + fi +} + +# Decide on the wrapper binary to use. +# If the bits of the OS could be detected, we will try to look for the +# binary with the correct bits value. If it doesn't exist, fall back +# and look for the 32-bit binary. If that doesn't exist either then +# look for the default. +WRAPPER_TEST_CMD="" +if [ -f "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-$DIST_BITS" ] +then + WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-$DIST_BITS" + if [ ! -x "$WRAPPER_TEST_CMD" ] + then + chmod +x "$WRAPPER_TEST_CMD" 2>/dev/null + fi + if [ -x "$WRAPPER_TEST_CMD" ] + then + WRAPPER_CMD="$WRAPPER_TEST_CMD" + else + outputFile "$WRAPPER_TEST_CMD" + WRAPPER_TEST_CMD="" + fi +fi +if [ -f "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" -a -z "$WRAPPER_TEST_CMD" ] +then + WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" + if [ ! -x "$WRAPPER_TEST_CMD" ] + then + chmod +x "$WRAPPER_TEST_CMD" 2>/dev/null + fi + if [ -x "$WRAPPER_TEST_CMD" ] + then + WRAPPER_CMD="$WRAPPER_TEST_CMD" + else + outputFile "$WRAPPER_TEST_CMD" + WRAPPER_TEST_CMD="" + fi +fi +if [ -f "$WRAPPER_CMD" -a -z "$WRAPPER_TEST_CMD" ] +then + WRAPPER_TEST_CMD="$WRAPPER_CMD" + if [ ! -x "$WRAPPER_TEST_CMD" ] + then + chmod +x "$WRAPPER_TEST_CMD" 2>/dev/null + fi + if [ -x "$WRAPPER_TEST_CMD" ] + then + WRAPPER_CMD="$WRAPPER_TEST_CMD" + else + outputFile "$WRAPPER_TEST_CMD" + WRAPPER_TEST_CMD="" + fi +fi +if [ -z "$WRAPPER_TEST_CMD" ] +then + eval echo `gettext 'Unable to locate any of the following binaries:'` + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-$DIST_BITS" + if [ ! "$DIST_BITS" = "32" ] + then + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" + fi + outputFile "$WRAPPER_CMD" + + exit 1 +fi + + +# Build the nice clause +if [ "X$PRIORITY" = "X" ] +then + CMDNICE="" +else + CMDNICE="nice -$PRIORITY" +fi + +# Build the anchor file clause. +if [ "X$IGNORE_SIGNALS" = "X" ] +then + ANCHORPROP= + IGNOREPROP= +else + ANCHORPROP=wrapper.anchorfile=\"$ANCHORFILE\" + IGNOREPROP=wrapper.ignore_signals=TRUE +fi + +# Build the status file clause. +if [ "X$DETAIL_STATUS$WAIT_FOR_STARTED_STATUS" = "X" ] +then + STATUSPROP= +else + STATUSPROP="wrapper.statusfile=\"$STATUSFILE\" wrapper.java.statusfile=\"$JAVASTATUSFILE\"" +fi + +# Build the command file clause. +if [ -n "$PAUSABLE" ] +then + COMMANDPROP="wrapper.commandfile=\"$COMMANDFILE\" wrapper.pausable=TRUE" +else + COMMANDPROP= +fi + +if [ ! -n "$WAIT_FOR_STARTED_STATUS" ] +then + WAIT_FOR_STARTED_STATUS=true +fi + +if [ $WAIT_FOR_STARTED_STATUS = true ] ; then + DETAIL_STATUS=true +fi + + +# Build the lock file clause. Only create a lock file if the lock directory exists on this platform. +LOCKPROP= +if [ -d $LOCKDIR ] +then + if [ -w $LOCKDIR ] + then + LOCKPROP=wrapper.lockfile=\"$LOCKFILE\" + fi +fi + +# Build app name clause +if [ ! -n "$APP_NAME_PASS_TO_WRAPPER" ] +then + APP_NAME_PASS_TO_WRAPPER=true +fi +if [ $APP_NAME_PASS_TO_WRAPPER = false ] +then + APPNAMEPROP= +else + APPNAMEPROP="wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\"" +fi + +# Decide on run levels. +RUN_LEVEL_S_DIST_OS_TMP=`eval "echo \$\{RUN_LEVEL_S_${DIST_OS}\}"` +RUN_LEVEL_S_DIST_OS=`eval "echo ${RUN_LEVEL_S_DIST_OS_TMP}"` +if [ "X${RUN_LEVEL_S_DIST_OS}" != "X" ] ; then + APP_RUN_LEVEL_S=${RUN_LEVEL_S_DIST_OS} +elif [ "X$RUN_LEVEL_S" != "X" ] ; then + APP_RUN_LEVEL_S=$RUN_LEVEL_S +else + APP_RUN_LEVEL_S=$RUN_LEVEL +fi +APP_RUN_LEVEL_S_CHECK=`echo "$APP_RUN_LEVEL_S" | sed "s/[(0-9)*]/0/g"` +if [ "X${APP_RUN_LEVEL_S_CHECK}" != "X00" ] ; then + eval echo `gettext 'Run level \"${APP_RUN_LEVEL_S}\" must be numeric and have a length of two \(00-99\).'` + exit 1; +fi +RUN_LEVEL_K_DIST_OS_TMP=`eval "echo \$\{RUN_LEVEL_K_${DIST_OS}\}"` +RUN_LEVEL_K_DIST_OS=`eval "echo ${RUN_LEVEL_K_DIST_OS_TMP}"` +if [ "X${RUN_LEVEL_K_DIST_OS}" != "X" ] ; then + APP_RUN_LEVEL_K=${RUN_LEVEL_K_DIST_OS} +elif [ "X$RUN_LEVEL_K" != "X" ] ; then + APP_RUN_LEVEL_K=$RUN_LEVEL_K +else + APP_RUN_LEVEL_K=$RUN_LEVEL +fi +APP_RUN_LEVEL_K_CHECK=`echo "$APP_RUN_LEVEL_K" | sed "s/[(0-9)*]/0/g"` +if [ "X${APP_RUN_LEVEL_K_CHECK}" != "X00" ] ; then + eval echo `gettext 'Run level \"${APP_RUN_LEVEL_K}\" must be numeric and have a length of two \(00-99\).'` + exit 1; +fi + +prepAdditionalParams() { + ADDITIONAL_PARA="" + if [ ! -n "$PASS_THROUGH" ] + then + PASS_THROUGH=false + fi + if [ $PASS_THROUGH = true ] ; then + ADDITIONAL_PARA="--" + while [ -n "$1" ] ; do + ADDITIONAL_PARA="$ADDITIONAL_PARA \"$1\"" + shift + done + elif [ -n "$1" ] ; then + eval echo `gettext "WARNING: Extra arguments will be ignored. Please run \'$0 help\' for usage."` + fi +} + +checkUser() { + # $1 touchLock flag + # $2.. [command] args + + # Check the configured user. If necessary rerun this script as the desired user. + if [ "X$RUN_AS_USER" != "X" ] + then + # Resolve the location of the 'id' command + ID_BIN="/usr/xpg4/bin/id" + if [ ! -x "$ID_BIN" ] + then + ID_BIN="/usr/bin/id" + if [ ! -x "$ID_BIN" ] + then + eval echo `gettext 'Unable to locate "id".'` + eval echo `gettext 'Please report this message along with the location of the command on your system.'` + exit 1 + fi + fi + + if [ "`$ID_BIN -u -n`" = "$RUN_AS_USER" ] + then + # Already running as the configured user. Avoid password prompts by not calling su. + RUN_AS_USER="" + fi + fi + if [ "X$RUN_AS_USER" != "X" ] + then + if [ "`$ID_BIN -u -n "$RUN_AS_USER" 2>/dev/null`" != "$RUN_AS_USER" ] + then + eval echo `gettext 'User $RUN_AS_USER does not exist.'` + exit 1 + fi + + # If LOCKPROP and $RUN_AS_USER are defined then the new user will most likely not be + # able to create the lock file. The Wrapper will be able to update this file once it + # is created but will not be able to delete it on shutdown. If $1 is set then + # the lock file should be created for the current command + if [ "X$LOCKPROP" != "X" ] + then + if [ "X$1" != "X" ] + then + # Resolve the primary group + RUN_AS_GROUP=`groups $RUN_AS_USER | awk '{print $3}' | tail -1` + if [ "X$RUN_AS_GROUP" = "X" ] + then + RUN_AS_GROUP=$RUN_AS_USER + fi + touch $LOCKFILE + chown $RUN_AS_USER:$RUN_AS_GROUP $LOCKFILE + fi + fi + + # Still want to change users, recurse. This means that the user will only be + # prompted for a password once. Variables shifted by 1 + shift + + # Wrap the parameters so they can be passed. + ADDITIONAL_PARA="" + while [ -n "$1" ] ; do + if [ "$1" = 'installstart' ] ; then + # At this point the service is already installed. When we will fork the process we only need to start the service. + ADDITIONAL_PARA="$ADDITIONAL_PARA \"start\"" + else + ADDITIONAL_PARA="$ADDITIONAL_PARA \"$1\"" + fi + shift + done + + # Use "runuser" if this exists. + # runuser should be used on RedHat in preference to su. + if test -f "/sbin/runuser" + then + /sbin/runuser - $RUN_AS_USER -c "\"$REALPATH\" $ADDITIONAL_PARA" + else + $SU_BIN - $RUN_AS_USER -c "\"$REALPATH\" $ADDITIONAL_PARA" $SU_OPTS + fi + RUN_AS_USER_EXITCODE=$? + + # we check if the previous command has failed + if [ $RUN_AS_USER_EXITCODE -ne 0 ] + then + if [ $RUN_AS_USER_EXITCODE -eq 1 ] + then + checkForkCommand + else + eval echo `gettext 'Error executing the requested command with user \"$RUN_AS_USER\" \(error code $RUN_AS_USER_EXITCODE\).'` + echo "" + fi + fi + + # Now that we are the original user again, we may need to clean up the lock file. + if [ "X$LOCKPROP" != "X" ] + then + getpid + if [ "X$pid" = "X" ] + then + # Wrapper is not running so make sure the lock file is deleted. + if [ -f "$LOCKFILE" ] + then + rm "$LOCKFILE" + fi + fi + fi + + exit $RUN_AS_USER_EXITCODE + fi +} + +# Try to fork by executing a simple command. +# With this function, we want to make sure we are able to fork. +checkForkCommand() { + + if test -f "/sbin/runuser" + then + /sbin/runuser - $RUN_AS_USER -c "ls \"$REALPATH\"" > /dev/null 2>&1 & + else + $SU_BIN - $RUN_AS_USER -c "ls \"$REALPATH\"" $SU_OPTS > /dev/null 2>&1 & + fi + CHECK_EXITCODE=$? + + if [ $CHECK_EXITCODE -ne 0 ] + then + # clearly a problem with forking + eval echo `gettext 'Error: unable to create fork process.'` + eval echo `gettext 'Advice:'` + eval echo `gettext 'One possible cause of failure is when the user \(\"$RUN_AS_USER\"\) has no shell.'` + eval echo `gettext 'In this case, two solutions are available by editing the script file:'` + eval echo `gettext '1. Use \"SU_OPTS\" to set the shell for the user.'` + eval echo `gettext '2. Use a OS service management tool (only available on some platforms).'` + echo "" + fi +} + +getpid() { + pid="" + if [ -f "$PIDFILE" ] + then + if [ -r "$PIDFILE" ] + then + pid=`cat "$PIDFILE"` + if [ "X$pid" != "X" ] + then + if [ "X$PIDFILE_CHECK_PID" != "X" ] + then + # It is possible that 'a' process with the pid exists but that it is not the + # correct process. This can happen in a number of cases, but the most + # common is during system startup after an unclean shutdown. + # The ps statement below looks for the specific wrapper command running as + # the pid. If it is not found then the pid file is considered to be stale. + case "$DIST_OS" in + 'freebsd') + pidtest=`$PS_BIN -p $pid -o args | tail -1` + if [ "X$pidtest" = "XCOMMAND" ] + then + pidtest="" + fi + ;; + 'macosx') + pidtest=`$PS_BIN -ww -p $pid -o command | grep -F "$WRAPPER_CMD" | tail -1` + ;; + 'solaris') + if [ -f "/usr/bin/pargs" ] + then + pidtest=`pargs $pid | fgrep "$WRAPPER_CMD" | tail -1` + else + case "$PS_BIN" in + '/usr/ucb/ps') + pidtest=`$PS_BIN -auxww $pid | fgrep "$WRAPPER_CMD" | tail -1` + ;; + '/usr/bin/ps') + TRUNCATED_CMD=`$PS_BIN -o comm -p $pid | tail -1` + COUNT=`echo $TRUNCATED_CMD | wc -m` + COUNT=`echo ${COUNT}` + COUNT=`expr $COUNT - 1` + TRUNCATED_CMD=`echo $WRAPPER_CMD | cut -c1-$COUNT` + pidtest=`$PS_BIN -o comm -p $pid | fgrep "$TRUNCATED_CMD" | tail -1` + ;; + '/bin/ps') + TRUNCATED_CMD=`$PS_BIN -o comm -p $pid | tail -1` + COUNT=`echo $TRUNCATED_CMD | wc -m` + COUNT=`echo ${COUNT}` + COUNT=`expr $COUNT - 1` + TRUNCATED_CMD=`echo $WRAPPER_CMD | cut -c1-$COUNT` + pidtest=`$PS_BIN -o comm -p $pid | fgrep "$TRUNCATED_CMD" | tail -1` + ;; + *) + echo "Unsupported ps command $PS_BIN" + exit 1 + ;; + esac + fi + ;; + 'hpux') + pidtest=`$PS_BIN -p $pid -x -o args | grep -F "$WRAPPER_CMD" | tail -1` + ;; + 'zos') + TRUNCATED_CMD=`$PS_BIN -p $pid -o args | tail -1` + COUNT=`echo $TRUNCATED_CMD | wc -m` + COUNT=`echo ${COUNT}` + COUNT=`expr $COUNT - 1` + TRUNCATED_CMD=`echo $WRAPPER_CMD | cut -c1-$COUNT` + pidtest=`$PS_BIN -p $pid -o args | grep -F "$TRUNCATED_CMD" | tail -1` + ;; + *) + pidtest=`$PS_BIN -p $pid -o args | grep -F "$WRAPPER_CMD" | tail -1` + ;; + esac + else + # Check to see whether the pid exists as a running process, but in this mode, don't check what that pid is. + case "$DIST_OS" in + 'solaris') + case "$PS_BIN" in + '/usr/ucb/ps') + pidtest=`$PS_BIN $pid | grep "$pid" | awk '{print $1}' | tail -1` + ;; + '/usr/bin/ps') + pidtest=`$PS_BIN -p $pid -o pid | grep "$pid" | tail -1` + ;; + '/bin/ps') + pidtest=`$PS_BIN -p $pid -o pid | grep "$pid" | tail -1` + ;; + *) + echo "Unsupported ps command $PS_BIN" + exit 1 + ;; + esac + ;; + *) + pidtest=`$PS_BIN -p $pid -o pid | grep "$pid" | tail -1` + ;; + esac + fi + + if [ "X$pidtest" = "X" ] + then + # This is a stale pid file. + rm -f "$PIDFILE" + eval echo `gettext 'Removed stale pid file: $PIDFILE'` + pid="" + fi + fi + else + eval echo `gettext 'Cannot read $PIDFILE.'` + exit 1 + fi + fi +} + +getstatus() { + STATUS= + if [ -f "$STATUSFILE" ] + then + if [ -r "$STATUSFILE" ] + then + STATUS=`cat "$STATUSFILE"` + fi + fi + if [ "X$STATUS" = "X" ] + then + STATUS="Unknown" + fi + + JAVASTATUS= + if [ -f "$JAVASTATUSFILE" ] + then + if [ -r "$JAVASTATUSFILE" ] + then + JAVASTATUS=`cat "$JAVASTATUSFILE"` + fi + fi + if [ "X$JAVASTATUS" = "X" ] + then + JAVASTATUS="Unknown" + fi +} + +testpid() { + case "$DIST_OS" in + 'solaris') + case "$PS_BIN" in + '/usr/ucb/ps') + pid=`$PS_BIN $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` + ;; + '/usr/bin/ps') + pid=`$PS_BIN -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` + ;; + '/bin/ps') + pid=`$PS_BIN -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` + ;; + *) + echo "Unsupported ps command $PS_BIN" + exit 1 + ;; + esac + ;; + *) + pid=`$PS_BIN -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` 2>/dev/null + ;; + esac + if [ "X$pid" = "X" ] + then + # Process is gone so remove the pid file. + rm -f "$PIDFILE" + pid="" + fi +} + +launchdtrap() { + stopit + exit +} + +waitforwrapperstop() { + getpid + while [ "X$pid" != "X" ] ; do + sleep 1 + getpid + done +} + +launchinternal() { + getpid + trap launchdtrap TERM + if [ "X$pid" = "X" ] + then + prepAdditionalParams "$@" + + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.daemonize=TRUE $APPNAMEPROP $ANCHORPROP $IGNOREPROP $STATUSPROP $COMMANDPROP $LOCKPROP wrapper.script.version=3.5.28 $ADDITIONAL_PARA" + eval $COMMAND_LINE + else + eval echo `gettext '$APP_LONG_NAME is already running.'` + exit 1 + fi + # launchd expects that this script stay up and running so we need to do our own monitoring of the Wrapper process. + if [ $WAIT_FOR_STARTED_STATUS = true ] + then + waitforwrapperstop + fi +} + +console() { + eval echo `gettext 'Running $APP_LONG_NAME...'` + getpid + if [ "X$pid" = "X" ] + then + trap '' 3 + + prepAdditionalParams "$@" + + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" $APPNAMEPROP $ANCHORPROP $STATUSPROP $COMMANDPROP $LOCKPROP wrapper.script.version=3.5.28 $ADDITIONAL_PARA" + eval $COMMAND_LINE + else + eval echo `gettext '$APP_LONG_NAME is already running.'` + exit 1 + fi +} + +waitforjavastartup() { + getstatus + eval echo $ECHOOPT `gettext 'Waiting for $APP_LONG_NAME...$ECHOOPTC'` + + # Wait until the timeout or we have something besides Unknown. + counter=15 + while [ "$JAVASTATUS" = "Unknown" -a $counter -gt 0 -a -n "$JAVASTATUS" ] ; do + echo $ECHOOPT".$ECHOOPTC" + sleep 1 + getstatus + counter=`expr $counter - 1` + done + + if [ -n "$WAIT_FOR_STARTED_TIMEOUT" ] ; then + counter=$WAIT_FOR_STARTED_TIMEOUT + else + counter=120 + fi + while [ "$JAVASTATUS" != "STARTED" -a "$JAVASTATUS" != "Unknown" -a $counter -gt 0 -a -n "$JAVASTATUS" ] ; do + echo $ECHOOPT".$ECHOOPTC" + sleep 1 + getstatus + counter=`expr $counter - 1` + done + echo "" +} + +startwait() { + if [ $WAIT_FOR_STARTED_STATUS = true ] + then + waitforjavastartup + fi + # Sleep for a few seconds to allow for intialization if required + # then test to make sure we're still running. + # + i=0 + while [ $i -lt $WAIT_AFTER_STARTUP ] + do + sleep 1 + echo $ECHOOPT".$ECHOOPTC" + i=`expr $i + 1` + done + if [ $WAIT_AFTER_STARTUP -gt 0 -o $WAIT_FOR_STARTED_STATUS = true ] + then + getpid + if [ "X$pid" = "X" ] + then + eval echo `gettext ' WARNING: $APP_LONG_NAME may have failed to start.'` + exit 1 + else + eval echo `gettext ' running: PID:$pid'` + fi + else + echo "" + fi +} + +mustBeRootOrExit() { + if [ `id | sed 's/^uid=//;s/(.*$//'` != "0" ] ; then + eval echo `gettext 'Must be root to perform this action.'` + exit 1 + fi +} + + +macosxStart() { + # The daemon has been installed. + eval echo `gettext 'Starting $APP_LONG_NAME. Detected Mac OSX and installed launchd daemon.'` + mustBeRootOrExit + + getpid + if [ "X$pid" != "X" ] ; then + eval echo `gettext '$APP_LONG_NAME is already running.'` + exit 1 + fi + + # If the daemon was just installed, it may not be loaded. + LOADED_PLIST=`launchctl list | grep ${APP_PLIST_BASE}` + if [ "X${LOADED_PLIST}" = "X" ] ; then + launchctl load /Library/LaunchDaemons/${APP_PLIST} + fi + # If launchd is set to run the daemon already at Load, we don't need to call start + getpid + if [ "X$pid" = "X" ] ; then + launchctl start ${APP_PLIST_BASE} + fi + + startwait +} + +macosxStop() { + # The daemon should be running. + eval echo `gettext 'Stopping $APP_LONG_NAME...'` + mustBeRootOrExit + + getpid + if [ "X$pid" = "X" ] ; then + eval echo `gettext '$APP_LONG_NAME is not running.'` + exit 1 + else + if [ "$MACOSX_KEEP_RUNNING" = "true" ] ; then + echo "" + eval echo `gettext 'Daemon is set to be kept continuously running and it will be automatically restarted.'` + eval echo `gettext 'To stop the daemon you need to uninstall it.'` + eval echo `gettext 'If you want to use the \"stop\" argument, you need to find MACOSX_KEEP_RUNNING'` + eval echo `gettext 'at the beginning of the script file and set it to \"false\".'` + echo "" + fi + launchctl stop ${APP_PLIST_BASE} + fi +} + +macosxRestart() { + # The daemon should be running. + eval echo `gettext 'Restarting $APP_LONG_NAME...'` + mustBeRootOrExit + + getpid + if [ "X$pid" = "X" ] ; then + eval echo `gettext '$APP_LONG_NAME is not running.'` + exit 1 + else + if [ "$MACOSX_KEEP_RUNNING" = "true" ] ; then + # by stopping it, launchd will automatically restart it + launchctl stop ${APP_PLIST_BASE} + else + launchctl unload "/Library/LaunchDaemons/${APP_PLIST}" + sleep 1 + launchctl load "/Library/LaunchDaemons/${APP_PLIST}" + fi + fi + + startwait +} + +upstartstart() { + # The daemon has been installed. + eval echo `gettext 'Starting $APP_LONG_NAME. Detected Linux and installed upstart.'` + mustBeRootOrExit + + getpid + if [ "X$pid" != "X" ] ; then + eval echo `gettext '$APP_LONG_NAME is already running.'` + exit 1 + fi + + /sbin/start ${APP_NAME} + + startwait +} + +upstartStop() { + # The daemon has been installed. + eval echo `gettext 'Stopping $APP_LONG_NAME...'` + mustBeRootOrExit + + getpid + if [ "X$pid" = "X" ] ; then + eval echo `gettext '$APP_LONG_NAME is not running.'` + exit 1 + fi + + /sbin/stop ${APP_NAME} +} + +upstartRestart() { + # The daemon has been installed. + eval echo `gettext 'Restarting $APP_LONG_NAME...'` + mustBeRootOrExit + + getpid + if [ "X$pid" = "X" ] ; then + eval echo `gettext '$APP_LONG_NAME is not running.'` + exit 1 + fi + + /sbin/restart ${APP_NAME} + + startwait +} + +systemdInstall() { + eval echo `gettext ' Installing the $APP_LONG_NAME daemon using systemd...'` + if [ -f "${REALDIR}/${APP_NAME}.service" ] ; then + eval echo `gettext ' a custom service file ${APP_NAME}.service found'` + cp "${REALDIR}/${APP_NAME}.service" "${SYSTEMD_SERVICE_FILE}" + else + eval echo `gettext ' creating default service file...'` + echo "[Unit]" > "${SYSTEMD_SERVICE_FILE}" + echo "Description=${APP_LONG_NAME}" >> "${SYSTEMD_SERVICE_FILE}" + echo "After=syslog.target" >> "${SYSTEMD_SERVICE_FILE}" + echo "" >> "${SYSTEMD_SERVICE_FILE}" + echo "[Service]" >> "${SYSTEMD_SERVICE_FILE}" + echo "Type=forking" >> "${SYSTEMD_SERVICE_FILE}" + echo "ExecStart=${REALPATH} start sysd" >> "${SYSTEMD_SERVICE_FILE}" + echo "ExecStop=${REALPATH} stop sysd" >> "${SYSTEMD_SERVICE_FILE}" + if [ "X${RUN_AS_USER}" != "X" ] ; then + echo "User=${RUN_AS_USER}" >> "${SYSTEMD_SERVICE_FILE}" + fi + echo "" >> "${SYSTEMD_SERVICE_FILE}" + echo "[Install]" >> "${SYSTEMD_SERVICE_FILE}" + echo "WantedBy=multi-user.target" >> "${SYSTEMD_SERVICE_FILE}" + + systemctl daemon-reload + systemctl enable "${APP_NAME}" + fi +} + +systemdStart() { + # check if the service file is present + if [ -f "${SYSTEMD_SERVICE_FILE}" ] ; then + eval echo `gettext 'Reading file ${SYSTEMD_SERVICE_FILE}'` + else + eval echo `gettext 'No service file detected. Did you install the service?'` + exit 1 + fi + + systemctl start $APP_NAME + if [ $? -ne 0 ] ; then + eval echo `gettext 'Failed to start service $APP_NAME'` + exit 1 + fi + + startwait +} + +systemdStop() { + systemctl stop $APP_NAME + if [ $? -ne 0 ] ; then + eval echo `gettext 'Failed to stop service $APP_NAME'` + exit 1 + fi +} + +systemdRestart() { + systemctl restart $APP_NAME + if [ $? -ne 0 ] ; then + eval echo `gettext 'Failed to restart service $APP_NAME'` + exit 1 + fi + + startwait +} + +systemdRemove() { + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon from systemd...'` + systemctl disable $APP_NAME + rm "/etc/systemd/system/${APP_NAME}.service" + systemctl daemon-reload +} + +srcInstall() { + if [ "X$RUN_AS_USER" = "X" ] ; then + USERID="0" + else + USERID=`$ID_BIN -u "$RUN_AS_USER"` + if [ $? -ne 0 ] ; then + eval echo `gettext 'Failed to get user id for $RUN_AS_USER'` + exit 1 + fi + fi + /usr/bin/mkssys -s "$APP_NAME" -p "$REALPATH" -a "launchdinternal" -u "$USERID" -f 9 -n 15 -S + /usr/sbin/mkitab "$APP_NAME":2:once:"/usr/bin/startsrc -s \"${APP_NAME}\" >/dev/console 2>&1" +} + +srcStart() { + startsrc -s "${APP_NAME}" + if [ $? -ne 0 ] ; then + eval echo `gettext 'Failed to start service $APP_NAME'` + exit 1 + fi + + startwait +} + +srcStop() { + stopsrc -s "${APP_NAME}" + if [ $? -ne 0 ] ; then + eval echo `gettext 'Failed to stop service $APP_NAME'` + exit 1 + fi +} + +srcRestart() { + srcStop + srcStart +} + +start() { + eval echo `gettext 'Starting $APP_LONG_NAME...'` + getpid + if [ "X$pid" = "X" ] + then + prepAdditionalParams "$@" + + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.daemonize=TRUE $APPNAMEPROP $ANCHORPROP $IGNOREPROP $STATUSPROP $COMMANDPROP $LOCKPROP wrapper.script.version=3.5.28 $ADDITIONAL_PARA" + eval $COMMAND_LINE + else + eval echo `gettext '$APP_LONG_NAME is already running.'` + exit 1 + fi + + startwait +} + +stopit() { + # $1 exit if down flag + + eval echo `gettext 'Stopping $APP_LONG_NAME...'` + getpid + if [ "X$pid" = "X" ] + then + eval echo `gettext '$APP_LONG_NAME was not running.'` + if [ "X$1" = "X1" ] + then + exit 1 + fi + else + if [ "X$IGNORE_SIGNALS" = "X" ] + then + # Running so try to stop it. + kill $pid + if [ $? -ne 0 ] + then + # An explanation for the failure should have been given + eval echo `gettext 'Unable to stop $APP_LONG_NAME.'` + exit 1 + fi + else + rm -f "$ANCHORFILE" + if [ -f "$ANCHORFILE" ] + then + # An explanation for the failure should have been given + eval echo `gettext 'Unable to stop $APP_LONG_NAME.'` + exit 1 + fi + fi + + # We can not predict how long it will take for the wrapper to + # actually stop as it depends on settings in wrapper.conf. + # Loop until it does. + savepid=$pid + CNT=0 + TOTCNT=0 + while [ "X$pid" != "X" ] + do + # Show a waiting message every 5 seconds. + if [ "$CNT" -lt "5" ] + then + CNT=`expr $CNT + 1` + else + eval echo `gettext 'Waiting for $APP_LONG_NAME to exit...'` + CNT=0 + fi + TOTCNT=`expr $TOTCNT + 1` + + sleep 1 + + testpid + done + + pid=$savepid + testpid + if [ "X$pid" != "X" ] + then + eval echo `gettext 'Failed to stop $APP_LONG_NAME.'` + exit 1 + else + eval echo `gettext 'Stopped $APP_LONG_NAME.'` + fi + fi +} + +pause() { + eval echo `gettext 'Pausing $APP_LONG_NAME.'` +} + +resume() { + eval echo `gettext 'Resuming $APP_LONG_NAME.'` +} + +status() { + getpid + if [ "X$pid" = "X" ] + then + eval echo `gettext '$APP_LONG_NAME is not running.'` + exit 1 + else + if [ "X$DETAIL_STATUS" = "X" ] + then + eval echo `gettext '$APP_LONG_NAME is running: PID:$pid'` + else + getstatus + eval echo `gettext '$APP_LONG_NAME is running: PID:$pid, Wrapper:$STATUS, Java:$JAVASTATUS'` + fi + exit 0 + fi +} + +# Make sure APP_NAME is less than 14 characters, otherwise in AIX, the command +# "lsitab" will fail +validateAppNameLength() { + if [ ${#APP_NAME} -gt 14 ] ; then + eval echo `gettext ' APP_NAME (${APP_NAME}) must be less than 14 characters long'` + exit 1 + fi +} + +installUpstart() { + eval echo `gettext ' Installing the $APP_LONG_NAME daemon using upstart..'` + if [ -f "${REALDIR}/${APP_NAME}.install" ] ; then + eval echo `gettext ' a custom upstart conf file ${APP_NAME}.install found'` + cp "${REALDIR}/${APP_NAME}.install" "/etc/init/${APP_NAME}.conf" + else + eval echo `gettext ' creating default upstart conf file..'` + echo "# ${APP_NAME} - ${APP_LONG_NAME}" > "/etc/init/${APP_NAME}.conf" + echo "description \"${APP_LONG_NAME}\"" >> "/etc/init/${APP_NAME}.conf" + echo "author \"Tanuki Software Ltd. \"" >> "/etc/init/${APP_NAME}.conf" + echo "start on runlevel [2345]" >> "/etc/init/${APP_NAME}.conf" + echo "stop on runlevel [!2345]" >> "/etc/init/${APP_NAME}.conf" + echo "env LANG=${LANG}" >> "/etc/init/${APP_NAME}.conf" + echo "exec \"${REALPATH}\" upstartinternal" >> "/etc/init/${APP_NAME}.conf" + fi +} + +installdaemon() { + mustBeRootOrExit + + APP_NAME_LOWER=`echo "$APP_NAME" | $TR_BIN "[A-Z]" "[a-z]"` + if [ "$DIST_OS" = "solaris" ] ; then + eval echo `gettext 'Detected Solaris:'` + if [ -f "/etc/init.d/$APP_NAME" -o -L "/etc/init.d/$APP_NAME" ] ; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed.'` + if [ "$COMMAND" != 'installstart' ] ; then + exit 1 + fi + else + eval echo `gettext ' Installing the $APP_LONG_NAME daemon..'` + ln -s "$REALPATH" "/etc/init.d/$APP_NAME" + for i in `ls "/etc/rc3.d/K"??"$APP_NAME_LOWER" "/etc/rc3.d/S"??"$APP_NAME_LOWER" 2>/dev/null` ; do + eval echo `gettext ' Removing unexpected file before proceeding: $i'` + rm -f $i + done + ln -s "/etc/init.d/$APP_NAME" "/etc/rc3.d/K${APP_RUN_LEVEL_K}$APP_NAME_LOWER" + ln -s "/etc/init.d/$APP_NAME" "/etc/rc3.d/S${APP_RUN_LEVEL_S}$APP_NAME_LOWER" + fi + elif [ "$DIST_OS" = "linux" ] ; then + if [ -f /etc/redhat-release -o -f /etc/redhat_version -o -f /etc/fedora-release ] ; then + eval echo `gettext 'Detected RHEL or Fedora:'` + if [ -f "/etc/init.d/$APP_NAME" -o -L "/etc/init.d/$APP_NAME" -o -f "/etc/init/${APP_NAME}.conf" ] ; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed.'` + if [ "$COMMAND" != 'installstart' ] ; then + exit 1 + fi + elif [ -n "$USE_SYSTEMD" -a -d "/etc/systemd" ] ; then + systemdInstall + else + if [ -n "$USE_UPSTART" -a -d "/etc/init" ] ; then + installUpstart + else + eval echo `gettext ' Installing the $APP_LONG_NAME daemon..'` + ln -s "$REALPATH" "/etc/init.d/$APP_NAME" + /sbin/chkconfig --add "$APP_NAME" + /sbin/chkconfig "$APP_NAME" on + fi + fi + elif [ -f /etc/SuSE-release ] ; then + eval echo `gettext 'Detected SuSE or SLES:'` + if [ -f "/etc/init.d/$APP_NAME" -o -L "/etc/init.d/$APP_NAME" ] ; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed.'` + if [ "$COMMAND" != 'installstart' ] ; then + exit 1 + fi + elif [ -n "$USE_SYSTEMD" -a -d "/etc/systemd" ] ; then + systemdInstall + else + eval echo `gettext ' Installing the $APP_LONG_NAME daemon..'` + ln -s "$REALPATH" "/etc/init.d/$APP_NAME" + insserv "/etc/init.d/$APP_NAME" + fi + elif [ -f /etc/lsb-release -o -f /etc/debian_version -o -f /etc/debian_release ] ; then + eval echo `gettext 'Detected Ubuntu or Debian:'` + if [ -f "/etc/init.d/$APP_NAME" -o -L "/etc/init.d/$APP_NAME" -o -f "/etc/init/${APP_NAME}.conf" ] ; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed.'` + if [ "$COMMAND" != 'installstart' ] ; then + exit 1 + fi + else + if [ -n "$USE_SYSTEMD" -a -d "/etc/systemd" ] ; then + systemdInstall + elif [ -n "$USE_UPSTART" -a -d "/etc/init" ] ; then + installUpstart + else + eval echo `gettext ' Installing the $APP_LONG_NAME daemon using init.d..'` + ln -s "$REALPATH" "/etc/init.d/$APP_NAME" + update-rc.d "$APP_NAME" defaults + fi + fi + else + eval echo `gettext 'Detected Linux:'` + if [ -f "/etc/init.d/$APP_NAME" -o -L "/etc/init.d/$APP_NAME" ] ; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed.'` + if [ "$COMMAND" != 'installstart' ] ; then + exit 1 + fi + else + eval echo `gettext ' Installing the $APP_LONG_NAME daemon..'` + ln -s "$REALPATH" /etc/init.d/$APP_NAME + for i in `ls "/etc/rc3.d/K"??"$APP_NAME_LOWER" "/etc/rc5.d/K"??"$APP_NAME_LOWER" "/etc/rc3.d/S"??"$APP_NAME_LOWER" "/etc/rc5.d/S"??"$APP_NAME_LOWER" 2>/dev/null` ; do + eval echo `gettext ' Removing unexpected file before proceeding: $i'` + rm -f $i + done + ln -s "/etc/init.d/$APP_NAME" "/etc/rc3.d/K${APP_RUN_LEVEL_K}$APP_NAME_LOWER" + ln -s "/etc/init.d/$APP_NAME" "/etc/rc3.d/S${APP_RUN_LEVEL_S}$APP_NAME_LOWER" + ln -s "/etc/init.d/$APP_NAME" "/etc/rc5.d/S${APP_RUN_LEVEL_S}$APP_NAME_LOWER" + ln -s "/etc/init.d/$APP_NAME" "/etc/rc5.d/K${APP_RUN_LEVEL_K}$APP_NAME_LOWER" + fi + fi + elif [ "$DIST_OS" = "hpux" ] ; then + eval echo `gettext 'Detected HP-UX:'` + if [ -f "/sbin/init.d/$APP_NAME" -o -L "/sbin/init.d/$APP_NAME" ] ; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed.'` + if [ "$COMMAND" != 'installstart' ] ; then + exit 1 + fi + else + eval echo `gettext ' Installing the $APP_LONG_NAME daemon..'` + ln -s "$REALPATH" "/sbin/init.d/$APP_NAME" + for i in `ls "/sbin/rc3.d/K"??"$APP_NAME_LOWER" "/sbin/rc3.d/S"??"$APP_NAME_LOWER" 2>/dev/null` ; do + eval echo `gettext ' Removing unexpected file before proceeding: $i'` + rm -f $i + done + ln -s "/sbin/init.d/$APP_NAME" "/sbin/rc3.d/K${APP_RUN_LEVEL_K}$APP_NAME_LOWER" + ln -s "/sbin/init.d/$APP_NAME" "/sbin/rc3.d/S${APP_RUN_LEVEL_S}$APP_NAME_LOWER" + fi + elif [ "$DIST_OS" = "aix" ] ; then + eval echo `gettext 'Detected AIX:'` + validateAppNameLength + if [ -f "/etc/rc.d/init.d/$APP_NAME" ] ; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed as rc.d script.'` + if [ "$COMMAND" != 'installstart' ] ; then + exit 1 + fi + elif [ -n "`/usr/sbin/lsitab $APP_NAME`" -a -n "`/usr/bin/lssrc -S -s $APP_NAME`" ] ; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed as SRC service.'` + if [ "$COMMAND" != 'installstart' ] ; then + exit 1 + fi + else + eval echo `gettext ' Installing the $APP_LONG_NAME daemon..'` + if [ -n "`/usr/sbin/lsitab install_assist`" ] ; then + eval echo `gettext ' The task /usr/sbin/install_assist was found in the inittab, this might cause problems for all subsequent tasks to launch at this process is known to block the init task. Please make sure this task is not needed anymore and remove/deactivate it.'` + fi + for i in `ls "/etc/rc.d/rc2.d/K"??"$APP_NAME_LOWER" "/etc/rc.d/rc2.d/S"??"$APP_NAME_LOWER" 2>/dev/null` ; do + eval echo `gettext ' Removing unexpected file before proceeding: $i'` + rm -f $i + done + srcInstall + fi + elif [ "$DIST_OS" = "freebsd" ] ; then + eval echo `gettext 'Detected FreeBSD:'` + if [ -f "/etc/rc.d/$APP_NAME" -o -L "/etc/rc.d/$APP_NAME" ] ; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed.'` + if [ "$COMMAND" != 'installstart' ] ; then + exit 1 + fi + else + eval echo `gettext ' Installing the $APP_LONG_NAME daemon..'` + sed -i .bak "/${APP_NAME}_enable=\"YES\"/d" /etc/rc.conf + if [ -f "${REALDIR}/${APP_NAME}.install" ] ; then + ln -s "${REALDIR}/${APP_NAME}.install" "/etc/rc.d/$APP_NAME" + else + echo '#!/bin/sh' > "/etc/rc.d/$APP_NAME" + echo "#" >> "/etc/rc.d/$APP_NAME" + echo "# PROVIDE: $APP_NAME" >> "/etc/rc.d/$APP_NAME" + echo "# REQUIRE: NETWORKING" >> "/etc/rc.d/$APP_NAME" + echo "# KEYWORD: shutdown" >> "/etc/rc.d/$APP_NAME" + echo ". /etc/rc.subr" >> "/etc/rc.d/$APP_NAME" + echo "name=\"$APP_NAME\"" >> "/etc/rc.d/$APP_NAME" + echo "rcvar=\`set_rcvar\`" >> "/etc/rc.d/$APP_NAME" + echo "command=\"${REALPATH}\"" >> "/etc/rc.d/$APP_NAME" + echo 'start_cmd="${name}_start"' >> "/etc/rc.d/$APP_NAME" + echo 'load_rc_config $name' >> "/etc/rc.d/$APP_NAME" + echo 'status_cmd="${name}_status"' >> "/etc/rc.d/$APP_NAME" + echo 'stop_cmd="${name}_stop"' >> "/etc/rc.d/$APP_NAME" + echo "${APP_NAME}_status() {" >> "/etc/rc.d/$APP_NAME" + echo '${command} status' >> "/etc/rc.d/$APP_NAME" + echo '}' >> "/etc/rc.d/$APP_NAME" + echo "${APP_NAME}_stop() {" >> "/etc/rc.d/$APP_NAME" + echo '${command} stop' >> "/etc/rc.d/$APP_NAME" + echo '}' >> "/etc/rc.d/$APP_NAME" + echo "${APP_NAME}_start() {" >> "/etc/rc.d/$APP_NAME" + echo '${command} start' >> "/etc/rc.d/$APP_NAME" + echo '}' >> "/etc/rc.d/$APP_NAME" + echo 'run_rc_command "$1"' >> "/etc/rc.d/$APP_NAME" + fi + echo "${APP_NAME}_enable=\"YES\"" >> /etc/rc.conf + chmod 555 "/etc/rc.d/$APP_NAME" + fi + elif [ "$DIST_OS" = "macosx" ] ; then + eval echo `gettext 'Detected Mac OSX:'` + if [ -f "/Library/LaunchDaemons/${APP_PLIST}" -o -L "/Library/LaunchDaemons/${APP_PLIST}" ] ; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed.'` + if [ "$COMMAND" != 'installstart' ] ; then + exit 1 + fi + else + eval echo `gettext ' Installing the $APP_LONG_NAME daemon..'` + if [ -f "${REALDIR}/${APP_PLIST}" ] ; then + ln -s "${REALDIR}/${APP_PLIST}" "/Library/LaunchDaemons/${APP_PLIST}" + else + echo "" > "/Library/LaunchDaemons/${APP_PLIST}" + echo "> "/Library/LaunchDaemons/${APP_PLIST}" + echo "\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">" >> "/Library/LaunchDaemons/${APP_PLIST}" + echo "" >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " " >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " Label" >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " ${APP_PLIST_BASE}" >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " ProgramArguments" >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " " >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " ${REALPATH}" >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " launchdinternal" >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " " >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " ${KEY_KEEP_ALIVE}" >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " <${MACOSX_KEEP_RUNNING}/>" >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " RunAtLoad" >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " " >> "/Library/LaunchDaemons/${APP_PLIST}" + if [ "X$RUN_AS_USER" != "X" ] ; then + echo " UserName" >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " ${RUN_AS_USER}" >> "/Library/LaunchDaemons/${APP_PLIST}" + fi + echo " " >> "/Library/LaunchDaemons/${APP_PLIST}" + echo "" >> "/Library/LaunchDaemons/${APP_PLIST}" + fi + chmod 555 "/Library/LaunchDaemons/${APP_PLIST}" + fi + elif [ "$DIST_OS" = "zos" ] ; then + eval echo `gettext 'Detected z/OS:'` + if [ -f /etc/rc.bak ] ; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed.'` + if [ "$COMMAND" != 'installstart' ] ; then + exit 1 + fi + else + eval echo `gettext ' Installing the $APP_LONG_NAME daemon..'` + cp /etc/rc /etc/rc.bak + sed "s:echo /etc/rc script executed, \`date\`::g" /etc/rc.bak > /etc/rc + echo "_BPX_JOBNAME='${APP_NAME}' \"${REALDIR}/${APP_NAME}\" start" >>/etc/rc + echo '/etc/rc script executed, `date`' >>/etc/rc + fi + else + eval echo `gettext 'Install not currently supported for $DIST_OS'` + exit 1 + fi +} + +startdaemon() { + if [ "$DIST_OS" = "macosx" ] ; then + if [ ! -f "/Library/LaunchDaemons/${APP_PLIST}" ] ; then + eval echo `gettext 'The $APP_LONG_NAME daemon is not currently installed.'` + else + macosxStart + fi + elif [ "$DIST_OS" = "linux" -a -f "/etc/init/${APP_NAME}.conf" ] ; then + upstartstart + elif [ "$DIST_OS" = "linux" -a -n "$USE_SYSTEMD" -a -z "$SYSD" ] ; then + systemdStart + elif [ "$DIST_OS" = "aix" ] && [ -n "`/usr/bin/lssrc -S -s $APP_NAME`" ] ; then + srcStart + else + if [ -n "$SYSD" ] ; then + shift + fi + + checkUser touchlock "$@" + if [ ! -n "$FIXED_COMMAND" ] ; then + shift + fi + start "$@" + fi +} + +removedaemon() { + mustBeRootOrExit + + APP_NAME_LOWER=`echo "$APP_NAME" | $TR_BIN "[A-Z]" "[a-z]"` + if [ "$DIST_OS" = "solaris" ] ; then + eval echo `gettext 'Detected Solaris:'` + if [ -f "/etc/init.d/$APP_NAME" -o -L "/etc/init.d/$APP_NAME" ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon...'` + for i in `ls "/etc/rc3.d/K"??"$APP_NAME_LOWER" "/etc/rc3.d/S"??"$APP_NAME_LOWER" "/etc/init.d/$APP_NAME" 2>/dev/null` ; do + rm -f $i + done + else + eval echo `gettext ' The $APP_LONG_NAME daemon is not currently installed.'` + exit 1 + fi + elif [ "$DIST_OS" = "linux" ] ; then + if [ -f /etc/redhat-release -o -f /etc/redhat_version -o -f /etc/fedora-release ] ; then + eval echo `gettext 'Detected RHEL or Fedora:'` + if [ -f "/etc/init.d/$APP_NAME" -o -L "/etc/init.d/$APP_NAME" ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon...'` + /sbin/chkconfig "$APP_NAME" off + /sbin/chkconfig --del "$APP_NAME" + rm -f "/etc/init.d/$APP_NAME" + elif [ -n "$USE_SYSTEMD" -a -f "${SYSTEMD_SERVICE_FILE}" ] ; then + systemdRemove + elif [ -f "/etc/init/${APP_NAME}.conf" ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon from upstart...'` + rm "/etc/init/${APP_NAME}.conf" + else + eval echo `gettext ' The $APP_LONG_NAME daemon is not currently installed.'` + exit 1 + fi + elif [ -f /etc/SuSE-release ] ; then + eval echo `gettext 'Detected SuSE or SLES:'` + if [ -f "/etc/init.d/$APP_NAME" -o -L "/etc/init.d/$APP_NAME" ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon...'` + insserv -r "/etc/init.d/$APP_NAME" + rm -f "/etc/init.d/$APP_NAME" + elif [ -n "$USE_SYSTEMD" -a -f "${SYSTEMD_SERVICE_FILE}" ] ; then + systemdRemove + else + eval echo `gettext ' The $APP_LONG_NAME daemon is not currently installed.'` + exit 1 + fi + elif [ -f /etc/lsb-release -o -f /etc/debian_version -o -f /etc/debian_release ] ; then + eval echo `gettext 'Detected Ubuntu or Debian:'` + if [ -f "/etc/init.d/$APP_NAME" -o -L "/etc/init.d/$APP_NAME" ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon from init.d...'` + update-rc.d -f "$APP_NAME" remove + rm -f "/etc/init.d/$APP_NAME" + elif [ -n "$USE_SYSTEMD" -a -f "${SYSTEMD_SERVICE_FILE}" ] ; then + systemdRemove + elif [ -f "/etc/init/${APP_NAME}.conf" ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon from upstart...'` + rm "/etc/init/${APP_NAME}.conf" + else + eval echo `gettext ' The $APP_LONG_NAME daemon is not currently installed.'` + exit 1 + fi + else + eval echo `gettext 'Detected Linux:'` + if [ -f "/etc/init.d/$APP_NAME" -o -L "/etc/init.d/$APP_NAME" ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon...'` + for i in `ls "/etc/rc3.d/K"??"$APP_NAME_LOWER" "/etc/rc5.d/K"??"$APP_NAME_LOWER" "/etc/rc3.d/S"??"$APP_NAME_LOWER" "/etc/rc5.d/S"??"$APP_NAME_LOWER" "/etc/init.d/$APP_NAME" 2>/dev/null` ; do + rm -f $i + done + else + eval echo `gettext ' The $APP_LONG_NAME daemon is not currently installed.'` + exit 1 + fi + fi + elif [ "$DIST_OS" = "hpux" ] ; then + eval echo `gettext 'Detected HP-UX:'` + if [ -f "/sbin/init.d/$APP_NAME" -o -L "/sbin/init.d/$APP_NAME" ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon...'` + for i in `ls "/sbin/rc3.d/K"??"$APP_NAME_LOWER" "/sbin/rc3.d/S"??"$APP_NAME_LOWER" "/sbin/init.d/$APP_NAME" 2>/dev/null` ; do + rm -f $i + done + else + eval echo `gettext ' The $APP_LONG_NAME daemon is not currently installed.'` + exit 1 + fi + elif [ "$DIST_OS" = "aix" ] ; then + eval echo `gettext 'Detected AIX:'` + validateAppNameLength + if [ -f "/etc/rc.d/init.d/$APP_NAME" -o -L "/etc/rc.d/init.d/$APP_NAME" -o -n "`/usr/sbin/lsitab $APP_NAME`" -o -n "`/usr/bin/lssrc -S -s $APP_NAME`" ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon...'` + if [ -f "/etc/rc.d/init.d/$APP_NAME" -o -L "/etc/rc.d/init.d/$APP_NAME" ] ; then + for i in `ls "/etc/rc.d/rc2.d/K"??"$APP_NAME_LOWER" "/etc/rc.d/rc2.d/S"??"$APP_NAME_LOWER" "/etc/rc.d/init.d/$APP_NAME" 2>/dev/null` ; do + rm -f $i + done + fi + if [ -n "`/usr/sbin/lsitab $APP_NAME`" -o -n "`/usr/bin/lssrc -S -s $APP_NAME`" ] ; then + /usr/sbin/rmitab $APP_NAME + /usr/bin/rmssys -s $APP_NAME + fi + else + eval echo `gettext ' The $APP_LONG_NAME daemon is not currently installed.'` + exit 1 + fi + elif [ "$DIST_OS" = "freebsd" ] ; then + eval echo `gettext 'Detected FreeBSD:'` + if [ -f "/etc/rc.d/$APP_NAME" -o -L "/etc/rc.d/$APP_NAME" ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon...'` + for i in "/etc/rc.d/$APP_NAME" + do + rm -f $i + done + sed -i .bak "/${APP_NAME}_enable=\"YES\"/d" /etc/rc.conf + else + eval echo `gettext ' The $APP_LONG_NAME daemon is not currently installed.'` + exit 1 + fi + elif [ "$DIST_OS" = "macosx" ] ; then + eval echo `gettext 'Detected Mac OSX:'` + if [ -f "/Library/LaunchDaemons/${APP_PLIST}" -o -L "/Library/LaunchDaemons/${APP_PLIST}" ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon...'` + # Make sure the plist is installed + LOADED_PLIST=`launchctl list | grep ${APP_PLIST_BASE}` + if [ "X${LOADED_PLIST}" != "X" ] ; then + launchctl unload "/Library/LaunchDaemons/${APP_PLIST}" + fi + rm -f "/Library/LaunchDaemons/${APP_PLIST}" + else + eval echo `gettext ' The $APP_LONG_NAME daemon is not currently installed.'` + exit 1 + fi + elif [ "$DIST_OS" = "zos" ] ; then + eval echo `gettext 'Detected z/OS:'` + if [ -f /etc/rc.bak ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon...'` + cp /etc/rc /etc/rc.bak + sed "s/_BPX_JOBNAME=\'APP_NAME\'.*//g" /etc/rc.bak > /etc/rc + rm /etc/rc.bak + else + eval echo `gettext ' The $APP_LONG_NAME daemon is not currently installed.'` + exit 1 + fi + else + eval echo `gettext 'Remove not currently supported for $DIST_OS'` + exit 1 + fi +} + +dump() { + eval echo `gettext 'Dumping $APP_LONG_NAME...'` + getpid + if [ "X$pid" = "X" ] + then + eval echo `gettext '$APP_LONG_NAME was not running.'` + else + kill -3 $pid + + if [ $? -ne 0 ] + then + eval echo `gettext 'Failed to dump $APP_LONG_NAME.'` + exit 1 + else + eval echo `gettext 'Dumped $APP_LONG_NAME.'` + fi + fi +} + +# Used by HP-UX init scripts. +startmsg() { + getpid + if [ "X$pid" = "X" ] + then + eval echo `gettext 'Starting $APP_LONG_NAME... Wrapper:Stopped'` + else + if [ "X$DETAIL_STATUS" = "X" ] + then + eval echo `gettext 'Starting $APP_LONG_NAME... Wrapper:Running'` + else + getstatus + eval echo `gettext 'Starting $APP_LONG_NAME... Wrapper:$STATUS, Java:$JAVASTATUS'` + fi + fi +} + +# Used by HP-UX init scripts. +stopmsg() { + getpid + if [ "X$pid" = "X" ] + then + eval echo `gettext 'Stopping $APP_LONG_NAME... Wrapper:Stopped'` + else + if [ "X$DETAIL_STATUS" = "X" ] + then + eval echo `gettext 'Stopping $APP_LONG_NAME... Wrapper:Running'` + else + getstatus + eval echo `gettext 'Stopping $APP_LONG_NAME... Wrapper:$STATUS, Java:$JAVASTATUS'` + fi + fi +} + +showUsage() { + # $1 bad command + + if [ -n "$1" ] + then + eval echo `gettext 'Unexpected command: $1'` + echo ""; + fi + + eval MSG=`gettext 'Usage: '` + if [ -n "$FIXED_COMMAND" ] ; then + if [ -n "$PASS_THROUGH" ] ; then + echo "${MSG} $0 {JavaAppArgs}" + else + echo "${MSG} $0" + fi + else + if [ -n "$PAUSABLE" ] ; then + if [ -n "$PASS_THROUGH" ] ; then + echo "${MSG} $0 [ console {JavaAppArgs} | start {JavaAppArgs} | stop | restart {JavaAppArgs} | condrestart {JavaAppArgs} | pause | resume | status | install | installstart | remove | dump ]" + else + echo "${MSG} $0 [ console | start | stop | restart | condrestart | pause | resume | status | install | installstart | remove | dump ]" + fi + else + if [ -n "$PASS_THROUGH" ] ; then + echo "${MSG} $0 [ console {JavaAppArgs} | start {JavaAppArgs} | stop | restart {JavaAppArgs} | condrestart {JavaAppArgs} | status | install | installstart | remove | dump ]" + else + echo "${MSG} $0 [ console | start | stop | restart | condrestart | status | install | installstart | remove | dump ]" + fi + fi + fi + + if [ ! -n "$BRIEF_USAGE" ] + then + echo ""; + if [ ! -n "$FIXED_COMMAND" ] ; then + echo "`gettext 'Commands:'`" + echo "`gettext ' console Launch in the current console.'`" + echo "`gettext ' start Start in the background as a daemon process.'`" + echo "`gettext ' stop Stop if running as a daemon or in another console.'`" + echo "`gettext ' restart Stop if running and then start.'`" + echo "`gettext ' condrestart Restart only if already running.'`" + if [ -n "$PAUSABLE" ] ; then + echo "`gettext ' pause Pause if running.'`" + echo "`gettext ' resume Resume if paused.'`" + fi + echo "`gettext ' status Query the current status.'`" + echo "`gettext ' install Install to start automatically when system boots.'`" + echo "`gettext ' installstart Install and start running as a daemon process.'`" + echo "`gettext ' remove Uninstall.'`" + echo "`gettext ' dump Request a Java thread dump if running.'`" + echo ""; + fi + if [ -n "$PASS_THROUGH" ] ; then + echo "`gettext 'JavaAppArgs: Zero or more arguments which will be passed to the Java application.'`" + echo ""; + fi + fi + + exit 1 +} + +docommand() { + case "$COMMAND" in + 'console') + checkUser touchlock "$@" + if [ ! -n "$FIXED_COMMAND" ] ; then + shift + fi + console "$@" + ;; + + 'start') + startdaemon "$@" + ;; + + 'stop') + if [ "$DIST_OS" = "macosx" -a -f "/Library/LaunchDaemons/${APP_PLIST}" ] ; then + macosxStop + elif [ "$DIST_OS" = "linux" -a -f "/etc/init/${APP_NAME}.conf" ] ; then + upstartStop + elif [ "$DIST_OS" = "linux" -a -n "$USE_SYSTEMD" -a -z "$SYSD" ] ; then + systemdStop + elif [ "$DIST_OS" = "aix" ] && [ "`/usr/bin/lssrc -S -s $APP_NAME`" ] ; then + srcStop + else + checkUser "" "$COMMAND" + stopit "0" + fi + ;; + + 'restart') + if [ "$DIST_OS" = "macosx" ] ; then + if [ ! -f "/Library/LaunchDaemons/${APP_PLIST}" ] ; then + eval echo `gettext '$APP_NAME was not installed.'` + else + macosxRestart + fi + elif [ "$DIST_OS" = "linux" -a -f "/etc/init/${APP_NAME}.conf" ] ; then + upstartRestart + elif [ "$DIST_OS" = "linux" -a -n "$USE_SYSTEMD" -a -z "$SYSD" ] ; then + systemdRestart + elif [ "$DIST_OS" = "aix" ] && [ "`/usr/bin/lssrc -S -s $APP_NAME`" ] ; then + srcRestart + else + if [ -n "$SMF" ] ; then + shift + fi + checkUser touchlock "$COMMAND" + if [ ! -n "$FIXED_COMMAND" ] ; then + shift + fi + stopit "0" + start "$@" + fi + ;; + + 'condrestart') + checkUser touchlock "$COMMAND" + if [ ! -n "$FIXED_COMMAND" ] ; then + shift + fi + stopit "1" + start "$@" + ;; + + 'pause') + if [ -n "$PAUSABLE" ] + then + pause + else + showUsage "$COMMAND" + fi + ;; + + 'resume') + if [ -n "$PAUSABLE" ] + then + resume + else + showUsage "$COMMAND" + fi + ;; + + 'status') + status + ;; + + 'install') + installdaemon "$@" + ;; + + 'installstart') + installdaemon "$@" + startdaemon "$@" + ;; + + 'remove') + removedaemon + ;; + + 'dump') + checkUser "" "$COMMAND" + dump + ;; + + 'start_msg') + # Internal command called by launchd on HP-UX. + checkUser "" "$COMMAND" + startmsg + ;; + + 'stop_msg') + # Internal command called by launchd on HP-UX. + checkUser "" "$COMMAND" + stopmsg + ;; + + 'launchdinternal' | 'upstartinternal') + if [ ! "$DIST_OS" = "macosx" -o ! -f "/Library/LaunchDaemons/${APP_PLIST}" ] ; then + checkUser touchlock "$@" + fi + # Internal command called by launchd on Max OSX. + # We do not want to call checkUser here as it is handled in the launchd plist file. Doing it here would confuse launchd. + if [ ! -n "$FIXED_COMMAND" ] ; then + shift + fi + launchinternal "$@" + ;; + + *) + showUsage "$COMMAND" + ;; + esac +} + +docommand "$@" + +exit 0 diff --git a/food-open/food-open-api/src/main/bin/pause.bat b/food-open/food-open-api/src/main/bin/pause.bat new file mode 100644 index 0000000..65a2166 --- /dev/null +++ b/food-open/food-open-api/src/main/bin/pause.bat @@ -0,0 +1,135 @@ +@echo off +setlocal + +rem +rem Copyright (c) 1999, 2016 Tanuki Software, Ltd. +rem http://www.tanukisoftware.com +rem All rights reserved. +rem +rem This software is the proprietary information of Tanuki Software. +rem You shall use it only in accordance with the terms of the +rem license agreement you entered into with Tanuki Software. +rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html +rem +rem Java Service Wrapper general startup script. +rem + +rem ----------------------------------------------------------------------------- +rem These settings can be modified to fit the needs of your application +rem Optimized for use with version 3.5.28 of the Wrapper. + +rem The base name for the Wrapper binary. +set _WRAPPER_BASE=wrapper + +rem The directory where the Wrapper binary (.exe) file is located. It can be +rem either an absolute or a relative path. If the path contains any special +rem characters, please make sure to quote the variable. +set _WRAPPER_DIR= + +rem The name and location of the Wrapper configuration file. This will be used +rem if the user does not specify a configuration file as the first parameter to +rem this script. +set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf" + +rem Makes it possible to override the Wrapper configuration file by specifying it +rem as the first parameter. +rem set _WRAPPER_CONF_OVERRIDE=true + +rem Note that it is only possible to pass parameters through to the JVM when +rem installing the service, or when running in a console. + +rem Do not modify anything beyond this point +rem ----------------------------------------------------------------------------- + +rem +rem Resolve the real path of the wrapper.exe +rem For non NT systems, the _REALPATH and _WRAPPER_CONF values +rem can be hard-coded below and the following test removed. +rem +if "%OS%"=="Windows_NT" goto nt +echo This script only works with NT-based versions of Windows. +goto :eof + +:nt +rem Find the application home. +rem if no path path specified do the default action +IF not DEFINED _WRAPPER_DIR goto dir_undefined +set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%" +if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\" +rem check if absolute path +if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path +if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path +rem everythig else means relative path +set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%" +goto pathfound + +:dir_undefined +rem Use a relative path to the wrapper %~dp0 is location of current script under NT +set _REALPATH="%~dp0" +goto pathfound +:absolute_path +rem Use an absolute path to the wrapper +set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%" + +:pathfound +rem +rem Decide on the specific Wrapper binary to use (See delta-pack) +rem +if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe" +goto search +:amd64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe" +goto search +:ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe" +goto search +:search +set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%" +if exist %_WRAPPER_EXE% goto conf +set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe" +if exist %_WRAPPER_EXE% goto conf +echo Unable to locate a Wrapper executable using any of the following names: +echo %_WRAPPER_L_EXE% +echo %_WRAPPER_EXE% +pause +goto :eof + +rem +rem Find the wrapper.conf +rem +:conf +if [%_WRAPPER_CONF_OVERRIDE%]==[true] ( + set _WRAPPER_CONF="%~f1" + if not [%_WRAPPER_CONF%]==[""] ( + shift + goto :startup + ) +) +set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%" + +rem +rem Start the Wrapper +rem +:startup +if not [%_PASS_THROUGH%]==[true] ( + if not [%1]==[] ( + echo WARNING: Extra arguments will be ignored. Please check usage in the batch file. + ) +) + +rem Collect the application parameters +:parameters +set _PARAMETERS=%_PARAMETERS% %1 +shift +if not [%1]==[] goto :parameters + +if not [%_PASS_THROUGH%]==[true] ( + %_WRAPPER_EXE% -a %_WRAPPER_CONF% +) else ( + %_WRAPPER_EXE% -a %_WRAPPER_CONF% -- %_PARAMETERS% +) +if not errorlevel 1 goto :eof +pause diff --git a/food-open/food-open-api/src/main/bin/query.bat b/food-open/food-open-api/src/main/bin/query.bat new file mode 100644 index 0000000..5638a44 --- /dev/null +++ b/food-open/food-open-api/src/main/bin/query.bat @@ -0,0 +1,135 @@ +@echo off +setlocal + +rem +rem Copyright (c) 1999, 2016 Tanuki Software, Ltd. +rem http://www.tanukisoftware.com +rem All rights reserved. +rem +rem This software is the proprietary information of Tanuki Software. +rem You shall use it only in accordance with the terms of the +rem license agreement you entered into with Tanuki Software. +rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html +rem +rem Java Service Wrapper general startup script. +rem + +rem ----------------------------------------------------------------------------- +rem These settings can be modified to fit the needs of your application +rem Optimized for use with version 3.5.28 of the Wrapper. + +rem The base name for the Wrapper binary. +set _WRAPPER_BASE=wrapper + +rem The directory where the Wrapper binary (.exe) file is located. It can be +rem either an absolute or a relative path. If the path contains any special +rem characters, please make sure to quote the variable. +set _WRAPPER_DIR= + +rem The name and location of the Wrapper configuration file. This will be used +rem if the user does not specify a configuration file as the first parameter to +rem this script. +set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf" + +rem Makes it possible to override the Wrapper configuration file by specifying it +rem as the first parameter. +rem set _WRAPPER_CONF_OVERRIDE=true + +rem Note that it is only possible to pass parameters through to the JVM when +rem installing the service, or when running in a console. + +rem Do not modify anything beyond this point +rem ----------------------------------------------------------------------------- + +rem +rem Resolve the real path of the wrapper.exe +rem For non NT systems, the _REALPATH and _WRAPPER_CONF values +rem can be hard-coded below and the following test removed. +rem +if "%OS%"=="Windows_NT" goto nt +echo This script only works with NT-based versions of Windows. +goto :eof + +:nt +rem Find the application home. +rem if no path path specified do the default action +IF not DEFINED _WRAPPER_DIR goto dir_undefined +set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%" +if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\" +rem check if absolute path +if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path +if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path +rem everythig else means relative path +set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%" +goto pathfound + +:dir_undefined +rem Use a relative path to the wrapper %~dp0 is location of current script under NT +set _REALPATH="%~dp0" +goto pathfound +:absolute_path +rem Use an absolute path to the wrapper +set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%" + +:pathfound +rem +rem Decide on the specific Wrapper binary to use (See delta-pack) +rem +if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe" +goto search +:amd64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe" +goto search +:ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe" +goto search +:search +set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%" +if exist %_WRAPPER_EXE% goto conf +set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe" +if exist %_WRAPPER_EXE% goto conf +echo Unable to locate a Wrapper executable using any of the following names: +echo %_WRAPPER_L_EXE% +echo %_WRAPPER_EXE% +pause +goto :eof + +rem +rem Find the wrapper.conf +rem +:conf +if [%_WRAPPER_CONF_OVERRIDE%]==[true] ( + set _WRAPPER_CONF="%~f1" + if not [%_WRAPPER_CONF%]==[""] ( + shift + goto :startup + ) +) +set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%" + +rem +rem Start the Wrapper +rem +:startup +if not [%_PASS_THROUGH%]==[true] ( + if not [%1]==[] ( + echo WARNING: Extra arguments will be ignored. Please check usage in the batch file. + ) +) + +rem Collect the application parameters +:parameters +set _PARAMETERS=%_PARAMETERS% %1 +shift +if not [%1]==[] goto :parameters + +if not [%_PASS_THROUGH%]==[true] ( + %_WRAPPER_EXE% -q %_WRAPPER_CONF% +) else ( + %_WRAPPER_EXE% -q %_WRAPPER_CONF% -- %_PARAMETERS% +) +if not errorlevel 1 goto :eof +pause diff --git a/food-open/food-open-api/src/main/bin/resume.bat b/food-open/food-open-api/src/main/bin/resume.bat new file mode 100644 index 0000000..8b4d6ea --- /dev/null +++ b/food-open/food-open-api/src/main/bin/resume.bat @@ -0,0 +1,135 @@ +@echo off +setlocal + +rem +rem Copyright (c) 1999, 2016 Tanuki Software, Ltd. +rem http://www.tanukisoftware.com +rem All rights reserved. +rem +rem This software is the proprietary information of Tanuki Software. +rem You shall use it only in accordance with the terms of the +rem license agreement you entered into with Tanuki Software. +rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html +rem +rem Java Service Wrapper general startup script. +rem + +rem ----------------------------------------------------------------------------- +rem These settings can be modified to fit the needs of your application +rem Optimized for use with version 3.5.28 of the Wrapper. + +rem The base name for the Wrapper binary. +set _WRAPPER_BASE=wrapper + +rem The directory where the Wrapper binary (.exe) file is located. It can be +rem either an absolute or a relative path. If the path contains any special +rem characters, please make sure to quote the variable. +set _WRAPPER_DIR= + +rem The name and location of the Wrapper configuration file. This will be used +rem if the user does not specify a configuration file as the first parameter to +rem this script. +set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf" + +rem Makes it possible to override the Wrapper configuration file by specifying it +rem as the first parameter. +rem set _WRAPPER_CONF_OVERRIDE=true + +rem Note that it is only possible to pass parameters through to the JVM when +rem installing the service, or when running in a console. + +rem Do not modify anything beyond this point +rem ----------------------------------------------------------------------------- + +rem +rem Resolve the real path of the wrapper.exe +rem For non NT systems, the _REALPATH and _WRAPPER_CONF values +rem can be hard-coded below and the following test removed. +rem +if "%OS%"=="Windows_NT" goto nt +echo This script only works with NT-based versions of Windows. +goto :eof + +:nt +rem Find the application home. +rem if no path path specified do the default action +IF not DEFINED _WRAPPER_DIR goto dir_undefined +set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%" +if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\" +rem check if absolute path +if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path +if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path +rem everythig else means relative path +set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%" +goto pathfound + +:dir_undefined +rem Use a relative path to the wrapper %~dp0 is location of current script under NT +set _REALPATH="%~dp0" +goto pathfound +:absolute_path +rem Use an absolute path to the wrapper +set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%" + +:pathfound +rem +rem Decide on the specific Wrapper binary to use (See delta-pack) +rem +if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe" +goto search +:amd64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe" +goto search +:ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe" +goto search +:search +set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%" +if exist %_WRAPPER_EXE% goto conf +set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe" +if exist %_WRAPPER_EXE% goto conf +echo Unable to locate a Wrapper executable using any of the following names: +echo %_WRAPPER_L_EXE% +echo %_WRAPPER_EXE% +pause +goto :eof + +rem +rem Find the wrapper.conf +rem +:conf +if [%_WRAPPER_CONF_OVERRIDE%]==[true] ( + set _WRAPPER_CONF="%~f1" + if not [%_WRAPPER_CONF%]==[""] ( + shift + goto :startup + ) +) +set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%" + +rem +rem Start the Wrapper +rem +:startup +if not [%_PASS_THROUGH%]==[true] ( + if not [%1]==[] ( + echo WARNING: Extra arguments will be ignored. Please check usage in the batch file. + ) +) + +rem Collect the application parameters +:parameters +set _PARAMETERS=%_PARAMETERS% %1 +shift +if not [%1]==[] goto :parameters + +if not [%_PASS_THROUGH%]==[true] ( + %_WRAPPER_EXE% -e %_WRAPPER_CONF% +) else ( + %_WRAPPER_EXE% -e %_WRAPPER_CONF% -- %_PARAMETERS% +) +if not errorlevel 1 goto :eof +pause diff --git a/food-open/food-open-api/src/main/bin/run.bat b/food-open/food-open-api/src/main/bin/run.bat new file mode 100644 index 0000000..8672708 --- /dev/null +++ b/food-open/food-open-api/src/main/bin/run.bat @@ -0,0 +1,156 @@ +@echo off +setlocal + +rem +rem Copyright (c) 1999, 2016 Tanuki Software, Ltd. +rem http://www.tanukisoftware.com +rem All rights reserved. +rem +rem This software is the proprietary information of Tanuki Software. +rem You shall use it only in accordance with the terms of the +rem license agreement you entered into with Tanuki Software. +rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html +rem +rem Java Service Wrapper general passthrough startup script. +rem + +rem ----------------------------------------------------------------------------- +rem These settings can be modified to fit the needs of your application +rem Optimized for use with version 3.5.28 of the Wrapper. +rem +rem ******************************************************************** +rem NOTE - This script has been modified to run the TestWrapper sample +rem application and should NOT be used as a base for your own +rem applications. All of the documentation assumes that you are +rem working from the default source script: +rem WRAPPER_HOME/src/bin/App.bat.in +rem ******************************************************************** +rem +rem ******************************************************************** +rem NOTE - This script has been modified to run the TestWrapper sample +rem application and should NOT be used as a base for your own +rem applications. All of the documentation assumes that you are +rem working from the default source script: +rem WRAPPER_HOME/src/bin/App.bat.in +rem ******************************************************************** + +rem The base name for the Wrapper binary. +set _WRAPPER_BASE=wrapper + +rem The directory where the Wrapper binary (.exe) file is located. It can be +rem either an absolute or a relative path. If the path contains any special +rem characters, please make sure to quote the variable. +set _WRAPPER_DIR= + +rem The name and location of the Wrapper configuration file. This will be used +rem if the user does not specify a configuration file as the first parameter to +rem this script. +set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf" + +rem Makes it possible to override the Wrapper configuration file by specifying it +rem as the first parameter. +rem set _WRAPPER_CONF_OVERRIDE=true + +rem _PASS_THROUGH tells the script to pass all parameters through to the JVM +rem as is. +rem If _WRAPPER_CONF_OVERRIDE is specified then all parameters will be passed. +rem If not set then all parameters starting with the second will be passed. +set _PASS_THROUGH=true + +rem Do not modify anything beyond this point +rem ----------------------------------------------------------------------------- + +rem +rem Resolve the real path of the wrapper.exe +rem For non NT systems, the _REALPATH and _WRAPPER_CONF values +rem can be hard-coded below and the following test removed. +rem +if "%OS%"=="Windows_NT" goto nt +echo This script only works with NT-based versions of Windows. +goto :eof + +:nt +rem Find the application home. +rem if no path path specified do the default action +IF not DEFINED _WRAPPER_DIR goto dir_undefined +set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%" +if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\" +rem check if absolute path +if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path +if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path +rem everythig else means relative path +set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%" +goto pathfound + +:dir_undefined +rem Use a relative path to the wrapper %~dp0 is location of current script under NT +set _REALPATH="%~dp0" +goto pathfound +:absolute_path +rem Use an absolute path to the wrapper +set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%" + +:pathfound +rem +rem Decide on the specific Wrapper binary to use (See delta-pack) +rem +if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe" +goto search +:amd64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe" +goto search +:ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe" +goto search +:search +set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%" +if exist %_WRAPPER_EXE% goto conf +set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe" +if exist %_WRAPPER_EXE% goto conf +echo Unable to locate a Wrapper executable using any of the following names: +echo %_WRAPPER_L_EXE% +echo %_WRAPPER_EXE% +pause +goto :eof + +rem +rem Find the wrapper.conf +rem +:conf +if [%_WRAPPER_CONF_OVERRIDE%]==[true] ( + set _WRAPPER_CONF="%~f1" + if not [%_WRAPPER_CONF%]==[""] ( + shift + goto :startup + ) +) +set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%" + +rem +rem Start the Wrapper +rem +:startup +if not [%_PASS_THROUGH%]==[true] ( + if not [%1]==[] ( + echo WARNING: Extra arguments will be ignored. Please check usage in the batch file. + ) +) + +rem Collect the application parameters +:parameters +set _PARAMETERS=%_PARAMETERS% %1 +shift +if not [%1]==[] goto :parameters + +if not [%_PASS_THROUGH%]==[true] ( + %_WRAPPER_EXE% -c %_WRAPPER_CONF% +) else ( + %_WRAPPER_EXE% -c %_WRAPPER_CONF% -- %_PARAMETERS% +) +if not errorlevel 1 goto :eof +pause + + diff --git a/food-open/food-open-api/src/main/bin/start.bat b/food-open/food-open-api/src/main/bin/start.bat new file mode 100644 index 0000000..d7d5e85 --- /dev/null +++ b/food-open/food-open-api/src/main/bin/start.bat @@ -0,0 +1,135 @@ +@echo off +setlocal + +rem +rem Copyright (c) 1999, 2016 Tanuki Software, Ltd. +rem http://www.tanukisoftware.com +rem All rights reserved. +rem +rem This software is the proprietary information of Tanuki Software. +rem You shall use it only in accordance with the terms of the +rem license agreement you entered into with Tanuki Software. +rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html +rem +rem Java Service Wrapper general startup script. +rem + +rem ----------------------------------------------------------------------------- +rem These settings can be modified to fit the needs of your application +rem Optimized for use with version 3.5.28 of the Wrapper. + +rem The base name for the Wrapper binary. +set _WRAPPER_BASE=wrapper + +rem The directory where the Wrapper binary (.exe) file is located. It can be +rem either an absolute or a relative path. If the path contains any special +rem characters, please make sure to quote the variable. +set _WRAPPER_DIR= + +rem The name and location of the Wrapper configuration file. This will be used +rem if the user does not specify a configuration file as the first parameter to +rem this script. +set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf" + +rem Makes it possible to override the Wrapper configuration file by specifying it +rem as the first parameter. +rem set _WRAPPER_CONF_OVERRIDE=true + +rem Note that it is only possible to pass parameters through to the JVM when +rem installing the service, or when running in a console. + +rem Do not modify anything beyond this point +rem ----------------------------------------------------------------------------- + +rem +rem Resolve the real path of the wrapper.exe +rem For non NT systems, the _REALPATH and _WRAPPER_CONF values +rem can be hard-coded below and the following test removed. +rem +if "%OS%"=="Windows_NT" goto nt +echo This script only works with NT-based versions of Windows. +goto :eof + +:nt +rem Find the application home. +rem if no path path specified do the default action +IF not DEFINED _WRAPPER_DIR goto dir_undefined +set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%" +if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\" +rem check if absolute path +if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path +if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path +rem everythig else means relative path +set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%" +goto pathfound + +:dir_undefined +rem Use a relative path to the wrapper %~dp0 is location of current script under NT +set _REALPATH="%~dp0" +goto pathfound +:absolute_path +rem Use an absolute path to the wrapper +set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%" + +:pathfound +rem +rem Decide on the specific Wrapper binary to use (See delta-pack) +rem +if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe" +goto search +:amd64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe" +goto search +:ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe" +goto search +:search +set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%" +if exist %_WRAPPER_EXE% goto conf +set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe" +if exist %_WRAPPER_EXE% goto conf +echo Unable to locate a Wrapper executable using any of the following names: +echo %_WRAPPER_L_EXE% +echo %_WRAPPER_EXE% +pause +goto :eof + +rem +rem Find the wrapper.conf +rem +:conf +if [%_WRAPPER_CONF_OVERRIDE%]==[true] ( + set _WRAPPER_CONF="%~f1" + if not [%_WRAPPER_CONF%]==[""] ( + shift + goto :startup + ) +) +set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%" + +rem +rem Start the Wrapper +rem +:startup +if not [%_PASS_THROUGH%]==[true] ( + if not [%1]==[] ( + echo WARNING: Extra arguments will be ignored. Please check usage in the batch file. + ) +) + +rem Collect the application parameters +:parameters +set _PARAMETERS=%_PARAMETERS% %1 +shift +if not [%1]==[] goto :parameters + +if not [%_PASS_THROUGH%]==[true] ( + %_WRAPPER_EXE% -t %_WRAPPER_CONF% +) else ( + %_WRAPPER_EXE% -t %_WRAPPER_CONF% -- %_PARAMETERS% +) +if not errorlevel 1 goto :eof +pause diff --git a/food-open/food-open-api/src/main/bin/stop.bat b/food-open/food-open-api/src/main/bin/stop.bat new file mode 100644 index 0000000..49d717c --- /dev/null +++ b/food-open/food-open-api/src/main/bin/stop.bat @@ -0,0 +1,135 @@ +@echo off +setlocal + +rem +rem Copyright (c) 1999, 2016 Tanuki Software, Ltd. +rem http://www.tanukisoftware.com +rem All rights reserved. +rem +rem This software is the proprietary information of Tanuki Software. +rem You shall use it only in accordance with the terms of the +rem license agreement you entered into with Tanuki Software. +rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html +rem +rem Java Service Wrapper general startup script. +rem + +rem ----------------------------------------------------------------------------- +rem These settings can be modified to fit the needs of your application +rem Optimized for use with version 3.5.28 of the Wrapper. + +rem The base name for the Wrapper binary. +set _WRAPPER_BASE=wrapper + +rem The directory where the Wrapper binary (.exe) file is located. It can be +rem either an absolute or a relative path. If the path contains any special +rem characters, please make sure to quote the variable. +set _WRAPPER_DIR= + +rem The name and location of the Wrapper configuration file. This will be used +rem if the user does not specify a configuration file as the first parameter to +rem this script. +set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf" + +rem Makes it possible to override the Wrapper configuration file by specifying it +rem as the first parameter. +rem set _WRAPPER_CONF_OVERRIDE=true + +rem Note that it is only possible to pass parameters through to the JVM when +rem installing the service, or when running in a console. + +rem Do not modify anything beyond this point +rem ----------------------------------------------------------------------------- + +rem +rem Resolve the real path of the wrapper.exe +rem For non NT systems, the _REALPATH and _WRAPPER_CONF values +rem can be hard-coded below and the following test removed. +rem +if "%OS%"=="Windows_NT" goto nt +echo This script only works with NT-based versions of Windows. +goto :eof + +:nt +rem Find the application home. +rem if no path path specified do the default action +IF not DEFINED _WRAPPER_DIR goto dir_undefined +set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%" +if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\" +rem check if absolute path +if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path +if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path +rem everythig else means relative path +set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%" +goto pathfound + +:dir_undefined +rem Use a relative path to the wrapper %~dp0 is location of current script under NT +set _REALPATH="%~dp0" +goto pathfound +:absolute_path +rem Use an absolute path to the wrapper +set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%" + +:pathfound +rem +rem Decide on the specific Wrapper binary to use (See delta-pack) +rem +if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe" +goto search +:amd64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe" +goto search +:ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe" +goto search +:search +set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%" +if exist %_WRAPPER_EXE% goto conf +set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe" +if exist %_WRAPPER_EXE% goto conf +echo Unable to locate a Wrapper executable using any of the following names: +echo %_WRAPPER_L_EXE% +echo %_WRAPPER_EXE% +pause +goto :eof + +rem +rem Find the wrapper.conf +rem +:conf +if [%_WRAPPER_CONF_OVERRIDE%]==[true] ( + set _WRAPPER_CONF="%~f1" + if not [%_WRAPPER_CONF%]==[""] ( + shift + goto :startup + ) +) +set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%" + +rem +rem Start the Wrapper +rem +:startup +if not [%_PASS_THROUGH%]==[true] ( + if not [%1]==[] ( + echo WARNING: Extra arguments will be ignored. Please check usage in the batch file. + ) +) + +rem Collect the application parameters +:parameters +set _PARAMETERS=%_PARAMETERS% %1 +shift +if not [%1]==[] goto :parameters + +if not [%_PASS_THROUGH%]==[true] ( + %_WRAPPER_EXE% -p %_WRAPPER_CONF% +) else ( + %_WRAPPER_EXE% -p %_WRAPPER_CONF% -- %_PARAMETERS% +) +if not errorlevel 1 goto :eof +pause diff --git a/food-open/food-open-api/src/main/bin/uninstall.bat b/food-open/food-open-api/src/main/bin/uninstall.bat new file mode 100644 index 0000000..6ee6d07 --- /dev/null +++ b/food-open/food-open-api/src/main/bin/uninstall.bat @@ -0,0 +1,135 @@ +@echo off +setlocal + +rem +rem Copyright (c) 1999, 2016 Tanuki Software, Ltd. +rem http://www.tanukisoftware.com +rem All rights reserved. +rem +rem This software is the proprietary information of Tanuki Software. +rem You shall use it only in accordance with the terms of the +rem license agreement you entered into with Tanuki Software. +rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html +rem +rem Java Service Wrapper general startup script. +rem + +rem ----------------------------------------------------------------------------- +rem These settings can be modified to fit the needs of your application +rem Optimized for use with version 3.5.28 of the Wrapper. + +rem The base name for the Wrapper binary. +set _WRAPPER_BASE=wrapper + +rem The directory where the Wrapper binary (.exe) file is located. It can be +rem either an absolute or a relative path. If the path contains any special +rem characters, please make sure to quote the variable. +set _WRAPPER_DIR= + +rem The name and location of the Wrapper configuration file. This will be used +rem if the user does not specify a configuration file as the first parameter to +rem this script. +set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf" + +rem Makes it possible to override the Wrapper configuration file by specifying it +rem as the first parameter. +rem set _WRAPPER_CONF_OVERRIDE=true + +rem Note that it is only possible to pass parameters through to the JVM when +rem installing the service, or when running in a console. + +rem Do not modify anything beyond this point +rem ----------------------------------------------------------------------------- + +rem +rem Resolve the real path of the wrapper.exe +rem For non NT systems, the _REALPATH and _WRAPPER_CONF values +rem can be hard-coded below and the following test removed. +rem +if "%OS%"=="Windows_NT" goto nt +echo This script only works with NT-based versions of Windows. +goto :eof + +:nt +rem Find the application home. +rem if no path path specified do the default action +IF not DEFINED _WRAPPER_DIR goto dir_undefined +set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%" +if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\" +rem check if absolute path +if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path +if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path +rem everythig else means relative path +set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%" +goto pathfound + +:dir_undefined +rem Use a relative path to the wrapper %~dp0 is location of current script under NT +set _REALPATH="%~dp0" +goto pathfound +:absolute_path +rem Use an absolute path to the wrapper +set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%" + +:pathfound +rem +rem Decide on the specific Wrapper binary to use (See delta-pack) +rem +if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe" +goto search +:amd64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe" +goto search +:ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe" +goto search +:search +set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%" +if exist %_WRAPPER_EXE% goto conf +set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe" +if exist %_WRAPPER_EXE% goto conf +echo Unable to locate a Wrapper executable using any of the following names: +echo %_WRAPPER_L_EXE% +echo %_WRAPPER_EXE% +pause +goto :eof + +rem +rem Find the wrapper.conf +rem +:conf +if [%_WRAPPER_CONF_OVERRIDE%]==[true] ( + set _WRAPPER_CONF="%~f1" + if not [%_WRAPPER_CONF%]==[""] ( + shift + goto :startup + ) +) +set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%" + +rem +rem Start the Wrapper +rem +:startup +if not [%_PASS_THROUGH%]==[true] ( + if not [%1]==[] ( + echo WARNING: Extra arguments will be ignored. Please check usage in the batch file. + ) +) + +rem Collect the application parameters +:parameters +set _PARAMETERS=%_PARAMETERS% %1 +shift +if not [%1]==[] goto :parameters + +if not [%_PASS_THROUGH%]==[true] ( + %_WRAPPER_EXE% -r %_WRAPPER_CONF% +) else ( + %_WRAPPER_EXE% -r %_WRAPPER_CONF% -- %_PARAMETERS% +) +if not errorlevel 1 goto :eof +pause diff --git a/food-open/food-open-api/src/main/bin/wrapper-linux-x86-32 b/food-open/food-open-api/src/main/bin/wrapper-linux-x86-32 new file mode 100644 index 0000000..ff3509f Binary files /dev/null and b/food-open/food-open-api/src/main/bin/wrapper-linux-x86-32 differ diff --git a/food-open/food-open-api/src/main/bin/wrapper-linux-x86-64 b/food-open/food-open-api/src/main/bin/wrapper-linux-x86-64 new file mode 100644 index 0000000..e72b0e0 Binary files /dev/null and b/food-open/food-open-api/src/main/bin/wrapper-linux-x86-64 differ diff --git a/food-open/food-open-api/src/main/bin/wrapper-macosx-universal-32 b/food-open/food-open-api/src/main/bin/wrapper-macosx-universal-32 new file mode 100644 index 0000000..9a36a5c Binary files /dev/null and b/food-open/food-open-api/src/main/bin/wrapper-macosx-universal-32 differ diff --git a/food-open/food-open-api/src/main/bin/wrapper-macosx-universal-64 b/food-open/food-open-api/src/main/bin/wrapper-macosx-universal-64 new file mode 100644 index 0000000..6587d2c Binary files /dev/null and b/food-open/food-open-api/src/main/bin/wrapper-macosx-universal-64 differ diff --git a/food-open/food-open-api/src/main/bin/wrapper-windows-x86-32.exe b/food-open/food-open-api/src/main/bin/wrapper-windows-x86-32.exe new file mode 100644 index 0000000..9762dbf Binary files /dev/null and b/food-open/food-open-api/src/main/bin/wrapper-windows-x86-32.exe differ diff --git a/food-open/food-open-api/src/main/bin/wrapper-windows-x86-64.exe b/food-open/food-open-api/src/main/bin/wrapper-windows-x86-64.exe new file mode 100644 index 0000000..122ec17 Binary files /dev/null and b/food-open/food-open-api/src/main/bin/wrapper-windows-x86-64.exe differ diff --git a/food-open/food-open-api/src/main/conf/wrapper.conf b/food-open/food-open-api/src/main/conf/wrapper.conf new file mode 100644 index 0000000..e249441 --- /dev/null +++ b/food-open/food-open-api/src/main/conf/wrapper.conf @@ -0,0 +1,60 @@ +encoding=UTF-8 +wrapper.lang=zh_CN +#using the system default JDK environment variable +wrapper.java.command=java +#set.JAVA_HOME=/home/jdk1.8.0_65 +#wrapper.java.command=%JAVA_HOME%/bin/java +wrapper.java.command.loglevel=INFO + +wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp +wrapper.java.classpath.1=./ +wrapper.java.classpath.2=../conf/ +wrapper.java.classpath.3=../lib/*.jar + +wrapper.java.library.path.1=../lib + +wrapper.java.additional.auto_bits=TRUE +#set the default parameters +wrapper.java.additional.1=-Xms512m +wrapper.java.additional.2=-Xmx1024m +wrapper.java.additional.3=-XX:PermSize=256m +wrapper.java.additional.4=-XX:MaxPermSize=512m +wrapper.java.additional.5=-Djava.net.preferIPv4Stack=true +wrapper.java.additional.6=-Dsun.lang.ClassLoader.allowArraySyntax=true + +# Initial Java Heap Size (in MB) +wrapper.java.initmemory=128 +# Maximum Java Heap Size (in MB) +wrapper.java.maxmemory=512 + +# Application parameters. Add parameters as needed starting from 1 +wrapper.app.parameter.1=org.springframework.boot.loader.JarLauncher +wrapper.app.parameter.2=--spring.config.location=../conf/application.properties +wrapper.app.parameter.3=--logging.config=../conf/logback.xml +wrapper.app.parameter.4=--logging.path=../logs + +wrapper.filter.trigger.1=java.lang.OutOfMemoryError +wrapper.filter.action.1=RESTART + +wrapper.console.format=PM +wrapper.console.loglevel=INFO + +wrapper.logfile=../logs/server_YYYYMMDD.log +wrapper.logfile.rollmode=DATE +wrapper.logfile.format=LPTM +wrapper.logfile.loglevel=INFO +wrapper.logfile.maxsize=0 +wrapper.logfile.maxfiles=0 +wrapper.syslog.loglevel=NONE + +wrapper.ignore_sequence_gaps=TRUE +wrapper.pidfile.strict=TRUE + +wrapper.console.title=Food-2.0 Open Api Application + +wrapper.name=food2_open_api +wrapper.displayname=Food-2.0 Open Api Application +wrapper.description=Food-2.0 Open Api Application +wrapper.ntservice.dependency.1= +wrapper.ntservice.starttype=AUTO_START +wrapper.ntservice.interactive=false diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/Application.java b/food-open/food-open-api/src/main/java/com/jwsaas/Application.java new file mode 100644 index 0000000..e96659d --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/Application.java @@ -0,0 +1,19 @@ +package com.jwsaas; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.web.servlet.ServletComponentScan; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.ImportResource; + +@ComponentScan(basePackages = "com.jwsaas") +@ServletComponentScan(basePackages = "com.jwsaas.servlet") +@ImportResource(locations = { "classpath*:META-INF/spring/spring-*.xml" }) +@SpringBootApplication +public class Application { + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/Constant.java b/food-open/food-open-api/src/main/java/com/jwsaas/Constant.java new file mode 100644 index 0000000..cd99c67 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/Constant.java @@ -0,0 +1,30 @@ +package com.jwsaas; + +public class Constant { + + /** + * 系统默认数据源标识 + */ + public static final String DEFAULT_DB_SIGN = "10001"; + + /** + * 系统默认创建人 + */ + public static final String CREATE_USER = "OpenApi"; + + /** + * 系统默认redis前缀 + */ + public static final String DEFAULT_REDIS_PREFIX = "food20OpenApi"; + + /** + * 公共部分标识(shared) + */ + public static final String SHARED_SIGN = "shared"; + + /** + * 餐饮项目标识(food2) + */ + public static final String FOOD_SIGN = "food2"; + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/Global.java b/food-open/food-open-api/src/main/java/com/jwsaas/Global.java new file mode 100644 index 0000000..d8f9a80 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/Global.java @@ -0,0 +1,8 @@ +package com.jwsaas; + +public class Global { + + public static final String APP_SIGN = "food"; + + public static final String DATA_LIMIT = "30000"; +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/AskTicketMoneyListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/AskTicketMoneyListRequest.java new file mode 100644 index 0000000..f25fe43 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/AskTicketMoneyListRequest.java @@ -0,0 +1,23 @@ +package com.jwsaas.api.boduo.erp.request; + +import com.jwsaas.api.request.AbstractRequest; + +import javax.validation.constraints.NotNull; + +/** + * @Author:CHL + * @Date:Create in 2018/04/02 + * @Description: 在erp中获取要货单金额信息 + */ +public class AskTicketMoneyListRequest extends AbstractRequest { + @NotNull + private String ticketId; + public String getTicketId() { + return ticketId; + } + + public void setTicketId(String ticketId) { + this.ticketId = ticketId; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/CreateDispatchTicketRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/CreateDispatchTicketRequest.java new file mode 100644 index 0000000..57b778e --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/CreateDispatchTicketRequest.java @@ -0,0 +1,81 @@ +package com.jwsaas.api.boduo.erp.request; + + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +import javax.validation.constraints.NotNull; + +/** + * Created by Administrator on 2019\9\25 0025. + */ +public class CreateDispatchTicketRequest extends AbstractRequest { + + @NotNull + private String storeErpNo;//要货门店,定制erp门店编号; + + @IgnoreSign + private Double logisticsFee;//物流费用 + + @IgnoreSign + private Double orderMoney;//原料费用; + + @IgnoreSign + private Double otherFee;//其他费用; + + @IgnoreSign + private String description;//备注; + + @IgnoreSign + @NotNull + private String materialInfo;//要货信息; + + + public String getStoreErpNo() { + return storeErpNo; + } + + public void setStoreErpNo(String storeErpNo) { + this.storeErpNo = storeErpNo; + } + + public Double getLogisticsFee() { + return logisticsFee; + } + + public void setLogisticsFee(Double logisticsFee) { + this.logisticsFee = logisticsFee; + } + + public Double getOrderMoney() { + return orderMoney; + } + + public void setOrderMoney(Double orderMoney) { + this.orderMoney = orderMoney; + } + + public Double getOtherFee() { + return otherFee; + } + + public void setOtherFee(Double otherFee) { + this.otherFee = otherFee; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getMaterialInfo() { + return materialInfo; + } + + public void setMaterialInfo(String materialInfo) { + this.materialInfo = materialInfo; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/DeliveryModeListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/DeliveryModeListRequest.java new file mode 100644 index 0000000..35d40a3 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/DeliveryModeListRequest.java @@ -0,0 +1,14 @@ +package com.jwsaas.api.boduo.erp.request; + +import com.jwsaas.api.request.AbstractRequest; + +import javax.validation.constraints.NotNull; + +/** + * @Author:CHL + * @Date:Create in 2018/3/30 + * @Description: erp中配送方式 + */ +public class DeliveryModeListRequest extends AbstractRequest { + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/DishToErpSyncRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/DishToErpSyncRequest.java new file mode 100644 index 0000000..7bf3f44 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/DishToErpSyncRequest.java @@ -0,0 +1,23 @@ +package com.jwsaas.api.boduo.erp.request; + +import com.jwsaas.api.request.AbstractRequest; + +import javax.validation.constraints.NotNull; + +/** + * @Author:CHL + * @Date:Create in 2018/4/28 + * @Description: pos中的数据向 erp中同步调用的接口 + */ +public class DishToErpSyncRequest extends AbstractRequest { + @NotNull + private String dishJson; //菜品json + + public String getDishJson() { + return dishJson; + } + + public void setDishJson(String dishJson) { + this.dishJson = dishJson; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/ErpProductRatioRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/ErpProductRatioRequest.java new file mode 100644 index 0000000..986e46d --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/ErpProductRatioRequest.java @@ -0,0 +1,8 @@ +package com.jwsaas.api.boduo.erp.request; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ErpProductRatioRequest extends StoreBaseRequest { + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/ErpProductRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/ErpProductRequest.java new file mode 100644 index 0000000..dc01347 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/ErpProductRequest.java @@ -0,0 +1,9 @@ +package com.jwsaas.api.boduo.erp.request; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ErpProductRequest extends StoreBaseRequest{ + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/ErpProductSpecRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/ErpProductSpecRequest.java new file mode 100644 index 0000000..bcce600 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/ErpProductSpecRequest.java @@ -0,0 +1,8 @@ +package com.jwsaas.api.boduo.erp.request; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ErpProductSpecRequest extends StoreBaseRequest{ + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/ErpStoreAskMaterialRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/ErpStoreAskMaterialRequest.java new file mode 100644 index 0000000..8eaa242 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/ErpStoreAskMaterialRequest.java @@ -0,0 +1,34 @@ +package com.jwsaas.api.boduo.erp.request; + +import com.jwsaas.api.request.AbstractRequest; + +import javax.validation.constraints.NotNull; + +/** + * @Author:CHL + * @Date:Create in 2018/4/27 + * @Description: erp中门店允许要货物料发生变化同步至pos + */ +public class ErpStoreAskMaterialRequest extends AbstractRequest { + + @NotNull + private String customerNo; //erp客户编号 + @NotNull + private String matePriceJson ; //erp中新物料编号与价格 + + public String getCustomerNo() { + return customerNo; + } + + public void setCustomerNo(String customerNo) { + this.customerNo = customerNo; + } + + public String getMatePriceJson() { + return matePriceJson; + } + + public void setMatePriceJson(String matePriceJson) { + this.matePriceJson = matePriceJson; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/ErpToPosMaterialSyncRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/ErpToPosMaterialSyncRequest.java new file mode 100644 index 0000000..9198079 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/ErpToPosMaterialSyncRequest.java @@ -0,0 +1,63 @@ +package com.jwsaas.api.boduo.erp.request; + +import com.jwsaas.api.request.AbstractRequest; + +import javax.validation.constraints.NotNull; + +/** + * @Author:CHL + * @Date:Create in 2018/4/28 + * @Description: erp 中的数据向 pos中同步调用的接口 + */ +public class ErpToPosMaterialSyncRequest extends AbstractRequest { + @NotNull + private String cInvCode; //物料编号 + @NotNull + private String cInvName; //物料名称 + @NotNull + private String cInvStd; //物料规格 + @NotNull + private String cInvCCode; //分类编号 + @NotNull + private String cComUnitCode; //主计量单位编码 + + public String getcInvCode() { + return cInvCode; + } + + public void setcInvCode(String cInvCode) { + this.cInvCode = cInvCode; + } + + public String getcInvName() { + return cInvName; + } + + public void setcInvName(String cInvName) { + this.cInvName = cInvName; + } + + public String getcInvStd() { + return cInvStd; + } + + public void setcInvStd(String cInvStd) { + this.cInvStd = cInvStd; + } + + public String getcInvCCode() { + return cInvCCode; + } + + public void setcInvCCode(String cInvCCode) { + this.cInvCCode = cInvCCode; + } + + public String getcComUnitCode() { + return cComUnitCode; + } + + public void setcComUnitCode(String cComUnitCode) { + this.cComUnitCode = cComUnitCode; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/MaterialDetailRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/MaterialDetailRequest.java new file mode 100644 index 0000000..cee6e34 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/MaterialDetailRequest.java @@ -0,0 +1,23 @@ +package com.jwsaas.api.boduo.erp.request; + +import com.jwsaas.api.request.AbstractRequest; + +import javax.validation.constraints.NotNull; + +/** + * @Author:CHL + * @Date:Create in 2018/3/22 + * @Description: 物料信息返回对象 + */ +public class MaterialDetailRequest extends AbstractRequest { + @NotNull + private String storeId; + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/MaterialToErpSyncRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/MaterialToErpSyncRequest.java new file mode 100644 index 0000000..2a11a0a --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/MaterialToErpSyncRequest.java @@ -0,0 +1,23 @@ +package com.jwsaas.api.boduo.erp.request; + +import com.jwsaas.api.request.AbstractRequest; + +import javax.validation.constraints.NotNull; + +/** + * @Author:CHL + * @Date:Create in 2018/4/28 + * @Description: erp 中的数据向 pos中同步调用的接口 + */ +public class MaterialToErpSyncRequest extends AbstractRequest { + @NotNull + private String matreialJson; //原料json + + public String getMatreialJson() { + return matreialJson; + } + + public void setMatreialJson(String matreialJson) { + this.matreialJson = matreialJson; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/MaterialTypeRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/MaterialTypeRequest.java new file mode 100644 index 0000000..41dd321 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/MaterialTypeRequest.java @@ -0,0 +1,12 @@ +package com.jwsaas.api.boduo.erp.request; + +import com.jwsaas.api.request.AbstractRequest; + +/** + * @Author:CHL + * @Date:Create in 2018/3/23 + * @Description: 物料分类信息返回对象 + */ +public class MaterialTypeRequest extends AbstractRequest { + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/MaterialUnitRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/MaterialUnitRequest.java new file mode 100644 index 0000000..29324b6 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/MaterialUnitRequest.java @@ -0,0 +1,14 @@ +package com.jwsaas.api.boduo.erp.request; + +import com.jwsaas.api.request.AbstractRequest; + +import javax.validation.constraints.NotNull; + +/** + * @Author:CHL + * @Date:Create in 2018/3/23 + * @Description: 物料单位信息返回对象 + */ +public class MaterialUnitRequest extends AbstractRequest { + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/PayMoneyTicketRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/PayMoneyTicketRequest.java new file mode 100644 index 0000000..572cd9b --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/PayMoneyTicketRequest.java @@ -0,0 +1,60 @@ +package com.jwsaas.api.boduo.erp.request; + +import com.jwsaas.api.request.AbstractRequest; + +import javax.validation.constraints.NotNull; + +/** + * @Author:CHL + * @Date:Create in 2018/04/02 + * @Description: 调用erp中确认扣款接口 + */ +public class PayMoneyTicketRequest extends AbstractRequest { + @NotNull + private String askGoodsTicket; + @NotNull + private Integer isHaveT6Blance; //是否使用余额度 + private Integer deliveryMode; //配送标识 + private String payType; //付款方式 + private Integer isAskGoods; //是否要货 + + public String getAskGoodsTicket() { + return askGoodsTicket; + } + + public void setAskGoodsTicket(String askGoodsTicket) { + this.askGoodsTicket = askGoodsTicket; + } + + public Integer getIsHaveT6Blance() { + return isHaveT6Blance; + } + + public void setIsHaveT6Blance(Integer isHaveT6Blance) { + this.isHaveT6Blance = isHaveT6Blance; + } + + public Integer getDeliveryMode() { + return deliveryMode; + } + + public void setDeliveryMode(Integer deliveryMode) { + this.deliveryMode = deliveryMode; + } + + public String getPayType() { + return payType; + } + + public void setPayType(String payType) { + this.payType = payType; + } + + public Integer getIsAskGoods() { + return isAskGoods; + } + + public void setIsAskGoods(Integer isAskGoods) { + this.isAskGoods = isAskGoods; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/StoreAskMaterialSyncRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/StoreAskMaterialSyncRequest.java new file mode 100644 index 0000000..fd1b0a6 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/StoreAskMaterialSyncRequest.java @@ -0,0 +1,23 @@ +package com.jwsaas.api.boduo.erp.request; + +import com.jwsaas.api.request.AbstractRequest; + +import javax.validation.constraints.NotNull; + +/** + * @Author:CHL + * @Date:Create in 2018/3/30 + * @Description: erp中门店允许要货物料同步 + */ +public class StoreAskMaterialSyncRequest extends AbstractRequest { + @NotNull + private String storeId; + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/SyncMaterialRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/SyncMaterialRequest.java new file mode 100644 index 0000000..7adea89 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/SyncMaterialRequest.java @@ -0,0 +1,22 @@ +package com.jwsaas.api.boduo.erp.request; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class SyncMaterialRequest extends AbstractRequest { + + @NotNull + @IgnoreSign + private String material;// 原料JSON + + public String getMaterial() { + return material; + } + + public void setMaterial(String material) { + this.material = material; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/SyncMaterialTypeRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/SyncMaterialTypeRequest.java new file mode 100644 index 0000000..bb87118 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/SyncMaterialTypeRequest.java @@ -0,0 +1,22 @@ +package com.jwsaas.api.boduo.erp.request; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class SyncMaterialTypeRequest extends AbstractRequest { + + @NotNull + @IgnoreSign + private String materialType;// 原料分类JSON + + public String getMaterialType() { + return materialType; + } + + public void setMaterialType(String materialType) { + this.materialType = materialType; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/SyncMaterialUnitRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/SyncMaterialUnitRequest.java new file mode 100644 index 0000000..8624e56 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/SyncMaterialUnitRequest.java @@ -0,0 +1,22 @@ +package com.jwsaas.api.boduo.erp.request; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class SyncMaterialUnitRequest extends AbstractRequest { + + @NotNull + @IgnoreSign + private String materialUnit;// 原料单位JSON + + public String getMaterialUnit() { + return materialUnit; + } + + public void setMaterialUnit(String materialUnit) { + this.materialUnit = materialUnit; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/V1PosDishToV2Request.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/V1PosDishToV2Request.java new file mode 100644 index 0000000..c0a914e --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/request/V1PosDishToV2Request.java @@ -0,0 +1,33 @@ +package com.jwsaas.api.boduo.erp.request; + +import com.jwsaas.api.request.AbstractRequest; + +import javax.validation.constraints.NotNull; + +/** + * @Author:CHL + * @Date:Create in 2018/5/16 + * @Description:v1系统的数据向v2数据对象 + */ +public class V1PosDishToV2Request extends AbstractRequest { + @NotNull + private String storeNos; //升级的门店编号 + @NotNull + private String v1TenantId; //v1门店编号 + + public String getStoreNos() { + return storeNos; + } + + public void setStoreNos(String storeNos) { + this.storeNos = storeNos; + } + + public String getV1TenantId() { + return v1TenantId; + } + + public void setV1TenantId(String v1TenantId) { + this.v1TenantId = v1TenantId; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/response/AskTicketMoneyListResponse.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/response/AskTicketMoneyListResponse.java new file mode 100644 index 0000000..e78c2f8 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/response/AskTicketMoneyListResponse.java @@ -0,0 +1,117 @@ +package com.jwsaas.api.boduo.erp.response; + +/** + * @Author:CHL + * @Date:Create in 2018/04/02 + * @Description: 在erp中获取要货单金额 返回数据 + */ +public class AskTicketMoneyListResponse { + private int status; + private String message; + private String errCode; + private String errMessage; + private Double sumMaterialMoney; //原料金额 + private Double storeBalance; // 账户余额 + private Double storeRebate; //返利 + private Double useRebate; //能用的返利 + private Double usualFreight; //常温运费 + private Double coldFreight; //冷链运费 + private Double askSumMoney; //要货总金额 + private String description; // 备注 + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public String getErrCode() { + return errCode; + } + + public void setErrCode(String errCode) { + this.errCode = errCode; + } + + public String getErrMessage() { + return errMessage; + } + + public void setErrMessage(String errMessage) { + this.errMessage = errMessage; + } + + public Double getSumMaterialMoney() { + return sumMaterialMoney; + } + + public void setSumMaterialMoney(Double sumMaterialMoney) { + this.sumMaterialMoney = sumMaterialMoney; + } + + public Double getStoreBalance() { + return storeBalance; + } + + public void setStoreBalance(Double storeBalance) { + this.storeBalance = storeBalance; + } + + public Double getStoreRebate() { + return storeRebate; + } + + public void setStoreRebate(Double storeRebate) { + this.storeRebate = storeRebate; + } + + public Double getUseRebate() { + return useRebate; + } + + public void setUseRebate(Double useRebate) { + this.useRebate = useRebate; + } + + public Double getUsualFreight() { + return usualFreight; + } + + public void setUsualFreight(Double usualFreight) { + this.usualFreight = usualFreight; + } + + public Double getColdFreight() { + return coldFreight; + } + + public void setColdFreight(Double coldFreight) { + this.coldFreight = coldFreight; + } + + public Double getAskSumMoney() { + return askSumMoney; + } + + public void setAskSumMoney(Double askSumMoney) { + this.askSumMoney = askSumMoney; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/response/DeliveryModeListResponse.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/response/DeliveryModeListResponse.java new file mode 100644 index 0000000..57ceace --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/response/DeliveryModeListResponse.java @@ -0,0 +1,58 @@ +package com.jwsaas.api.boduo.erp.response; + +import com.alibaba.fastjson.JSONArray; + +/** + * @Author:CHL + * @Date:Create in 2018/3/23 + * @Description: 原料信息 + */ +public class DeliveryModeListResponse { + private int status; + + private String message; + + private String errCode; + + private String errMessage; + private JSONArray list; //配送方式集合 + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public String getErrCode() { + return errCode; + } + + public void setErrCode(String errCode) { + this.errCode = errCode; + } + + public String getErrMessage() { + return errMessage; + } + + public void setErrMessage(String errMessage) { + this.errMessage = errMessage; + } + public JSONArray getList() { + return list; + } + + public void setList(JSONArray list) { + this.list = list; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/response/MaterialDetailResponse.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/response/MaterialDetailResponse.java new file mode 100644 index 0000000..0c8f359 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/response/MaterialDetailResponse.java @@ -0,0 +1,57 @@ +package com.jwsaas.api.boduo.erp.response; + +/** + * @Author:CHL + * @Date:Create in 2018/3/23 + * @Description: 原料信息 + */ +public class MaterialDetailResponse { + private int status; + + private String message; + + private String errCode; + + private String errMessage; + private Integer count; //返回的执行记录数 + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public String getErrCode() { + return errCode; + } + + public void setErrCode(String errCode) { + this.errCode = errCode; + } + + public String getErrMessage() { + return errMessage; + } + + public void setErrMessage(String errMessage) { + this.errMessage = errMessage; + } + + public Integer getCount() { + return count; + } + + public void setCount(Integer count) { + this.count = count; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/response/MaterialTypeResponse.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/response/MaterialTypeResponse.java new file mode 100644 index 0000000..065b6ee --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/response/MaterialTypeResponse.java @@ -0,0 +1,57 @@ +package com.jwsaas.api.boduo.erp.response; + +/** + * @Author:CHL + * @Date:Create in 2018/3/23 + * @Description: 原料数据类型 + */ +public class MaterialTypeResponse { + private int status; + + private String message; + + private String errCode; + + private String errMessage; + private Integer count; //返回的执行记录数 + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public String getErrCode() { + return errCode; + } + + public void setErrCode(String errCode) { + this.errCode = errCode; + } + + public String getErrMessage() { + return errMessage; + } + + public void setErrMessage(String errMessage) { + this.errMessage = errMessage; + } + + public Integer getCount() { + return count; + } + + public void setCount(Integer count) { + this.count = count; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/response/MaterialUnitResponse.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/response/MaterialUnitResponse.java new file mode 100644 index 0000000..f9c8e39 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/response/MaterialUnitResponse.java @@ -0,0 +1,57 @@ +package com.jwsaas.api.boduo.erp.response; + +/** + * @Author:CHL + * @Date:Create in 2018/3/23 + * @Description: + */ +public class MaterialUnitResponse { + private int status; + + private String message; + + private String errCode; + + private String errMessage; + private Integer count; //返回的执行记录数 + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public String getErrCode() { + return errCode; + } + + public void setErrCode(String errCode) { + this.errCode = errCode; + } + + public String getErrMessage() { + return errMessage; + } + + public void setErrMessage(String errMessage) { + this.errMessage = errMessage; + } + + public Integer getCount() { + return count; + } + + public void setCount(Integer count) { + this.count = count; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/response/PayMoneyTicketResponse.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/response/PayMoneyTicketResponse.java new file mode 100644 index 0000000..3c30c81 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/response/PayMoneyTicketResponse.java @@ -0,0 +1,54 @@ +package com.jwsaas.api.boduo.erp.response; + +/** + * @Author:CHL + * @Date:Create in 2018/04/02 + * @Description: 在erp中确认扣款 返回数据 + */ +public class PayMoneyTicketResponse { + private String status; + private String message; + private Double storeBalance; //账户余额 + private Double storeRebate; // 返利金额 + private Double payMoney; //要货扣除的金额 + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public Double getStoreBalance() { + return storeBalance; + } + + public void setStoreBalance(Double storeBalance) { + this.storeBalance = storeBalance; + } + + public Double getStoreRebate() { + return storeRebate; + } + + public void setStoreRebate(Double storeRebate) { + this.storeRebate = storeRebate; + } + + public Double getPayMoney() { + return payMoney; + } + + public void setPayMoney(Double payMoney) { + this.payMoney = payMoney; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/response/StoreAskMaterialSyncResponse.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/response/StoreAskMaterialSyncResponse.java new file mode 100644 index 0000000..113b68a --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/response/StoreAskMaterialSyncResponse.java @@ -0,0 +1,57 @@ +package com.jwsaas.api.boduo.erp.response; + +/** + * @Author:CHL + * @Date:Create in 2018/3/23 + * @Description: + */ +public class StoreAskMaterialSyncResponse { + private int status; + + private String message; + + private String errCode; + + private String errMessage; + private Integer count; //返回的执行记录数 + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public String getErrCode() { + return errCode; + } + + public void setErrCode(String errCode) { + this.errCode = errCode; + } + + public String getErrMessage() { + return errMessage; + } + + public void setErrMessage(String errMessage) { + this.errMessage = errMessage; + } + + public Integer getCount() { + return count; + } + + public void setCount(Integer count) { + this.count = count; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/AskGoodsTicketErpService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/AskGoodsTicketErpService.java new file mode 100644 index 0000000..7210090 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/AskGoodsTicketErpService.java @@ -0,0 +1,34 @@ +package com.jwsaas.api.boduo.erp.service; + +import com.jwsaas.api.boduo.erp.request.AskTicketMoneyListRequest; +import com.jwsaas.api.boduo.erp.request.CreateDispatchTicketRequest; +import com.jwsaas.api.boduo.erp.request.PayMoneyTicketRequest; +import com.jwsaas.api.service.WopService; + +/** + * @Author:CHL + * @Date:Create in 2018/3/30 + * @Description: 获取erp要货单接口功能 + */ +public interface AskGoodsTicketErpService extends WopService { + /** + * 查获erp中要货单扣款信息 + * @param request + * @return + */ + Object getErpAskTicketMoneyList(AskTicketMoneyListRequest request); + + /*** + * 为此要货单买单,执行扣款 + * @param request + * @return + */ + Object doErpPayMoneyTicket(PayMoneyTicketRequest request); + + /** + * 定制erp对接要货接口; + * @param request + * @return + */ + Object createDispatchTicket(CreateDispatchTicketRequest request); +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/DeliveryModeListService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/DeliveryModeListService.java new file mode 100644 index 0000000..d88b2c4 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/DeliveryModeListService.java @@ -0,0 +1,13 @@ +package com.jwsaas.api.boduo.erp.service; + +import com.jwsaas.api.boduo.erp.request.DeliveryModeListRequest; +import com.jwsaas.api.service.WopService; + +/** + * @Author:CHL + * @Date:Create in 2018/3/30 + * @Description: 获取erp中配送方式 + */ +public interface DeliveryModeListService extends WopService { + Object getDeliveryModeList(DeliveryModeListRequest request); +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/ErpToPosDataService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/ErpToPosDataService.java new file mode 100644 index 0000000..25d9ef1 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/ErpToPosDataService.java @@ -0,0 +1,14 @@ +package com.jwsaas.api.boduo.erp.service; + +import com.jwsaas.api.boduo.erp.request.ErpToPosMaterialSyncRequest; +import com.jwsaas.api.service.WopService; + +/** + * @Author:CHL + * @Date:Create in 2018/4/28 + * @Description: erp 中的数据向 pos中同步调用的接口 + */ +public interface ErpToPosDataService extends WopService { + + Object saveMaterialDetail(ErpToPosMaterialSyncRequest request); +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/MaterialDetailService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/MaterialDetailService.java new file mode 100644 index 0000000..6611654 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/MaterialDetailService.java @@ -0,0 +1,21 @@ +package com.jwsaas.api.boduo.erp.service; + +import com.jwsaas.api.boduo.erp.request.MaterialDetailRequest; +import com.jwsaas.api.boduo.erp.request.SyncMaterialRequest; +import com.jwsaas.api.service.WopService; + +/** + * @Author:CHL + * @Date:Create in 2018/3/22 + * @Description: 获取物料信息 + */ +public interface MaterialDetailService extends WopService { + Object getMaterialDetailTea(MaterialDetailRequest request); + + /** + * ERP同步原料资料 + * @param request + * @return + */ + Object syncMaterial(SyncMaterialRequest request); +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/MaterialTypeService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/MaterialTypeService.java new file mode 100644 index 0000000..2e0270f --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/MaterialTypeService.java @@ -0,0 +1,22 @@ +package com.jwsaas.api.boduo.erp.service; + +import com.jwsaas.api.boduo.erp.request.MaterialTypeRequest; +import com.jwsaas.api.boduo.erp.request.SyncMaterialTypeRequest; +import com.jwsaas.api.service.WopService; + +/** + * @Author:CHL + * @Date:Create in 2018/3/23 + * @Description: 从erp中获取物料分类 + */ +public interface MaterialTypeService extends WopService { + + Object getMaterialTypeTea(MaterialTypeRequest request); + + /** + * ERP同步原料分类 + * @param request + * @return + */ + Object syncMaterialType(SyncMaterialTypeRequest request); +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/MaterialUnitService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/MaterialUnitService.java new file mode 100644 index 0000000..348a1db --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/MaterialUnitService.java @@ -0,0 +1,24 @@ +package com.jwsaas.api.boduo.erp.service; + +import com.jwsaas.api.boduo.erp.request.MaterialUnitRequest; +import com.jwsaas.api.boduo.erp.request.SyncMaterialUnitRequest; +import com.jwsaas.api.service.WopService; + +/** + * @Author:CHL + * @Date:Create in 2018/3/23 + * @Description: 从erp中获取物料单位 + */ +public interface MaterialUnitService extends WopService { + + Object getMaterialUnitTea(MaterialUnitRequest request); + + + + /** + * ERP同步原料单位 + * @param request + * @return + */ + Object syncMaterialUnit(SyncMaterialUnitRequest request); +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/PosToErpDataService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/PosToErpDataService.java new file mode 100644 index 0000000..e1dbfb8 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/PosToErpDataService.java @@ -0,0 +1,71 @@ +package com.jwsaas.api.boduo.erp.service; + +import com.jwsaas.api.boduo.erp.request.DishToErpSyncRequest; +import com.jwsaas.api.boduo.erp.request.ErpProductRatioRequest; +import com.jwsaas.api.boduo.erp.request.ErpProductRequest; +import com.jwsaas.api.boduo.erp.request.ErpProductSpecRequest; +import com.jwsaas.api.boduo.erp.request.MaterialToErpSyncRequest; +import com.jwsaas.api.request.product.ProductRatioRequest; +import com.jwsaas.api.request.product.ProductRequest; +import com.jwsaas.api.request.product.ProductSpecRequest; +import com.jwsaas.api.service.WopService; + +/** + * @Author:CHL + * @Date:Create in 2018/4/28 + * @Description: pos中的数据向 erp 中同步调用的接口 + */ +public interface PosToErpDataService extends WopService { + + Object saveDishSyncErpDetail(DishToErpSyncRequest request); + Object saveMaterialSyncErpDetail(MaterialToErpSyncRequest request); + + +// /** +// * 原料资料 +// * +// * @param request +// * @return +// */ +// Object erpProductList(ErpProductRequest request); +// +// /** +// * 原料规格资料 +// * +// * @param request +// * @return +// */ +// Object erpProductSpec(ErpProductSpecRequest request); +// +// /** +// * 原料库存系数 +// * +// * @param request +// * @return +// */ +// Object erpProductRatio(ErpProductRatioRequest request); + + /** + * 商品资料 + * + * @param request + * @return + */ + Object boduoProductList(ProductRequest request); + + /** + * 商品规格资料 + * + * @param request + * @return + */ + Object boduoProductSpec(ProductSpecRequest request); + + /** + * 商品套菜明细资料 + * + * @param request + * @return + */ + Object boduoProductRatio(ProductRatioRequest request); +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/StoreAskMaterialSyncService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/StoreAskMaterialSyncService.java new file mode 100644 index 0000000..a04e1b7 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/StoreAskMaterialSyncService.java @@ -0,0 +1,15 @@ +package com.jwsaas.api.boduo.erp.service; + +import com.jwsaas.api.boduo.erp.request.ErpStoreAskMaterialRequest; +import com.jwsaas.api.boduo.erp.request.StoreAskMaterialSyncRequest; +import com.jwsaas.api.service.WopService; + +/** + * @Author:CHL + * @Date:Create in 2018/3/30 + * @Description: 从erp中获取门店允许要货的原料信息 + */ +public interface StoreAskMaterialSyncService extends WopService { + Object getAskMaterialSync(StoreAskMaterialSyncRequest request); + Object getErpStoreAskMaterial(ErpStoreAskMaterialRequest request); +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/V1PosToV2PosDataService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/V1PosToV2PosDataService.java new file mode 100644 index 0000000..4abb4a6 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/V1PosToV2PosDataService.java @@ -0,0 +1,14 @@ +package com.jwsaas.api.boduo.erp.service; + +import com.jwsaas.api.boduo.erp.request.V1PosDishToV2Request; +import com.jwsaas.api.service.WopService; + +/** + * @Author:CHL + * @Date:Create in 2018/05/16 + * @Description: v1系统的数据向v2一次性同步接口 + */ +public interface V1PosToV2PosDataService extends WopService { + + Object saveV1PosDishToV2Detail(V1PosDishToV2Request request); +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/impl/AskGoodsTicketErpServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/impl/AskGoodsTicketErpServiceImpl.java new file mode 100644 index 0000000..5f46bc8 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/impl/AskGoodsTicketErpServiceImpl.java @@ -0,0 +1,601 @@ +package com.jwsaas.api.boduo.erp.service.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.jwsaas.api.boduo.erp.request.AskTicketMoneyListRequest; +import com.jwsaas.api.boduo.erp.request.CreateDispatchTicketRequest; +import com.jwsaas.api.boduo.erp.request.PayMoneyTicketRequest; +import com.jwsaas.api.boduo.erp.service.AskGoodsTicketErpService; +import com.jwsaas.api.entity.pos.MaterialInfo; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.service.impl.ErpBaseServiceImpl; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.cache.data.ProductUnitCache; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.*; +import com.jwsaas.http.HttpTool; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.service.food.*; +import com.jwsaas.utils.AppKeyUtil; +import com.jwsaas.utils.DateUtils; +import com.jwsaas.utils.PropertiesUtil; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.http.HttpResponse; + +import javax.annotation.Resource; +import java.util.*; + +/** + * @Author:CHL + * @Date:Create in 2018/3/30 + * @Description:获取erp要货单接口功能 + */ + +@ServiceMethodBean(version = "1.0") +public class AskGoodsTicketErpServiceImpl extends ErpBaseServiceImpl implements AskGoodsTicketErpService { + private static final long serialVersionUID = -345096567692034978L; + @Resource + private com.jwsaas.service.food.AskGoodsTicketService askGoodsTicketService; + @Resource + private com.jwsaas.service.food.AskGoodsDetailService askGoodsDetailService; + @Resource + private com.jwsaas.service.food.StoreService storeService; + @Resource + private com.jwsaas.service.food.ProductUnitService productUnitService; + @Resource + private DispatchTicketService dispatchTicketService; + @Resource + private ProductRatioService productRatioService; + @Resource + private ProductSpecService productSpecService; + @Resource + private StorageService storageService; + @Resource + private ProductUnitCache productUnitCache; + + + + @ServiceMethod(method = "erp.trial.operation.money", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "查获erp中要货单扣款信息") + @Override + public Object getErpAskTicketMoneyList(AskTicketMoneyListRequest request) { + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String ticketId = request.getTicketId(); + String info = "erp.ask.ticket.modey.list-->getErpAskTicketMoneyList 接口从erp中要货单扣款信息"; + logger.info(info+"企业号:{}",tenantId); + CommonDataResponse response = null; +// AskTicketMoneyListResponse response = null; + try { +// response = new AskTicketMoneyListResponse(); + response = new CommonDataResponse(); + AskGoodsTicket ticket = this.askGoodsTicketService.get(tenantId,ticketId); + + String deliveryMode = ticket.getDeliveryMode(); //配送方式 + String storeId = ticket.getStoreId(); //门店ID + + if(ticket == null){ + response.setErrCode("error"); + response.setMessage("获取要货单信息不存在,审核失败"); + return response; + } + /* if(ticket.getErpToExamine()!=null && ticket.getErpToExamine()==1){ + response.setErrCode("error"); + response.setMessage("要获单已在erp中存在,请作废该单据重新要货"); + return response; + }*/ + if(ticket.getStatus() == 3 || ticket.getStatus()==4 ){ + response.setErrCode("error"); + response.setMessage("要货单为配送状态或者为已收货状态,请重新生成要货单"); + return response; + } + Store dbs = this.storeService.get(tenantId,storeId); + + String storeNo=dbs.getExt1(); + if(StringUtils.isEmpty(storeNo)){ + response.setErrCode("error"); + response.setMessage("门店属性扩展信息没有设置,请在后台设置对应erp中的客户编号"); + } + ticket.setStoreNo(storeNo); + List agdList = this.askGoodsDetailService.findList(tenantId,"ticketId",ticketId); + + // 开放接口签名 + Map paramMap = new HashMap<>(20); + List ignoreSignParams = new ArrayList(); + // 系统级参数 + paramMap.put("appKey", PropertiesUtil.getValue(fileName, "open.api.appKey")); //开发者必须事先通过申请获取appKey/secret后,才能进行应用的开发 + paramMap.put("method", "common.returnChargeConfirmInfo"); //方法名称 + paramMap.put("v", PropertiesUtil.getValue(fileName, "open.api.version")); //服务方法的版本号 + paramMap.put("format", PropertiesUtil.getValue(fileName, "open.api.format"));//报文的格式,支持XML和JSON,默认JSON + paramMap.put("locale", PropertiesUtil.getValue(fileName, "open.api.locale")); //本地化类型,默认zh_CN + paramMap.put("timestamp", String.valueOf(System.currentTimeMillis()));//时间戳,自1970-01-01 00:00:00.000起的毫秒数 + paramMap.put("client", PropertiesUtil.getValue(fileName, "open.api.client"));//客户端类型 + // 业务参数 + + String askgoodsJson = buildAskGoodsTicket(ticket); + String askgoodDetailJson = buildAskGoodsDetail(tenantId,agdList); + paramMap.put("goodsJson",askgoodsJson); + paramMap.put("goodsDetailsJson",askgoodDetailJson); + paramMap.put("deliveryMode",deliveryMode); + // 参数签名 + String signValue = this.sign(paramMap, ignoreSignParams,PropertiesUtil.getValue(fileName,"open.api.secret")); + paramMap.put("sign",signValue); //签名串,请求参数的签名,服务平台通过它验证请求数据的合法性 + String url=PropertiesUtil.getValue(fileName,"open.api.url"); + long startTime = System.currentTimeMillis(); + final HttpResponse hr = HttpTool.url(url).form(paramMap).post(); + long endTime = System.currentTimeMillis(); + logger.info("执行时间:{}",endTime-startTime); + final String content = HttpTool.getResponseAsString(hr); + + logger.debug("调用erp接口 common.returnChargeConfirmInfo 返回的数据如下:{}",content); + + if(this.isSuccessful(content)){ + JSONObject object = JSON.parseObject(content); + String state = object.getString("state"); + if(StringUtils.equals("1",state)){ + Double sumMaterialMoney = Double.parseDouble(object.get("sumMaterialMoney")+""); //原料金额 + Double storeBalance= Double.parseDouble(object.get("storeBalance")+""); // 账户余额 + Double storeRebate= Double.parseDouble(object.get("storeRebate")+""); //返利 + Double useRebate= Double.parseDouble(object.get("useRebate")+""); //能用的返利 + Double usualFreight= Double.parseDouble(object.get("usualFreight")+""); //常温运费 + Double coldFreight= Double.parseDouble(object.get("coldFreight")+""); //冷链运费 + Double askSumMoney= Double.parseDouble(object.get("askSumMoney")+""); //要货总金额 + String description= object.get("message")+""; // 备注 + + Map data = new HashMap<>(); + data.put("sumMaterialMoney",sumMaterialMoney); + data.put("storeBalance",storeBalance); + data.put("storeRebate",storeRebate); + data.put("useRebate",useRebate); + data.put("usualFreight",usualFreight); + data.put("coldFreight",coldFreight); + data.put("askSumMoney",askSumMoney); + data.put("description",description); + response.setStatus(1); + response.setMessage("获取数据成功" + description); + response.setData(data); + //更新调用过erp接口后 单据的标识 + ticket.setErpToExamine(1); + this.askGoodsTicketService.update(tenantId,ticket); + }else{ + String description= object.get("message")+""; // 备注 + response.setErrCode("error"); + response.setMessage("调用erp接口失败,接口返回信息:" + description); + logger.info(content); + } + + }else{ + response.setErrCode("error"); + response.setMessage("操作失败"); + } + } catch (Exception e) { + e.printStackTrace(); + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + /** + * 构建erp中要货单的明细信息 + * @param agdList + * @return + */ + private String buildAskGoodsDetail(String tenantId,List agdList) throws Exception { + List> listMap = new ArrayList<>(); + for(AskGoodsDetail ad:agdList){ + Map map = new HashMap<>(); + map.put("id",ad.getId()); + map.put("ticketId",ad.getTicketId()); + map.put("materialId",ad.getProductId()); + map.put("materialName",ad.getProductName()); + map.put("materialNo",ad.getProductNo()); + map.put("spec",ad.getSpecName()); + String packUnitId = ad.getPackUnitId(); + map.put("stockUnit",packUnitId); + ProductUnit pu = getProductUnitDB(tenantId,packUnitId); + if(pu!=null){ + map.put("stockUnitName",pu.getNo()); + } + map.put("stockAmount",ad.getPackUnitAmount()); + String dispatchUnitId = ad.getDispatchUnitId(); + map.put("purchaseUnit",dispatchUnitId); + pu = getProductUnitDB(tenantId,dispatchUnitId); + if(pu != null){ + map.put("purchaseUnitName",pu.getNo()); + } + map.put("amount",ad.getAmount()); + map.put("description",ad.getDescription()); + map.put("price",ad.getPrice()); + map.put("mmoney",ad.getMoney()); + map.put("mWeight",0.0); + map.put("mwMoney",0.0); + map.put("freightCoefficient",0.0); + listMap.add(map); + } + + return JSON.toJSONString(listMap); + } + + private ProductUnit getProductUnitDB(String tenantId,String id) throws Exception{ + ProductUnit pu = this.productUnitService.get(tenantId,id); + return pu; + } + + /** + * 构建erp中要货单的单据信息 + * @param ticket + * @return + */ + private String buildAskGoodsTicket(AskGoodsTicket ticket) { + Map map = new HashMap<>(); + map.put("id",ticket.getId()); + map.put("no",ticket.getNo()); + map.put("storeId",ticket.getStoreId()); + map.put("storeNo",ticket.getStoreNo()); + map.put("storeName",ticket.getStoreName()); + map.put("effateDate",ticket.getSetDate()); + map.put("description",ticket.getDescription()); + map.put("status",ticket.getStatus()); + map.put("setMan",ticket.getSetMan()); + map.put("setDate",ticket.getSetDate()); + map.put("checkMan",ticket.getCheckMan()); + map.put("checkDate",ticket.getCheckDate()); + map.put("materialMoney",ticket.getTotalMoney()); + map.put("materialCost",0.0); + map.put("deliveryMode",ticket.getDeliveryMode()); + map.put("deliveryModeDesc",ticket.getDeliveryModeDesc()); + return JSON.toJSONString(map); + } + + + @ServiceMethod(method = "erp.pay.money.ticket", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "为此要货单买单,执行扣款") + @Override + public Object doErpPayMoneyTicket(PayMoneyTicketRequest request) { + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + + String askGoodsTicket = request.getAskGoodsTicket(); + Integer isHaveT6Blance = request.getIsHaveT6Blance(); + String payType = request.getPayType(); + Integer isAskGoods = request.getIsAskGoods(); + CommonDataResponse response = new CommonDataResponse(); + List atList = null; + try { + Criteria c = new Criteria(); + c.add(Restrictions.eq("no", askGoodsTicket)); + atList = this.askGoodsTicketService.getList(tenantId, c); + for (AskGoodsTicket at : atList) { + if(at.getStatus()==1){ + response.setErrCode("error"); + response.setMessage("订单已扣款,等待总部发货"); + return response; + } + if(at.getStatus()==2){ + response.setErrCode("error"); + response.setMessage("订单已作废,请重新生成要货单"); + return response; + } + if(at.getStatus()==3){ + response.setErrCode("error"); + response.setMessage("订单已配送,请重新生成要货单"); + return response; + } + if(at.getStatus()==4){ + response.setErrCode("error"); + response.setMessage("订单已收货,请重新生成要货单"); + return response; + } + } + } catch (Exception e) { + e.printStackTrace(); + } + + + + // 开放接口签名 + Map paramMap = new HashMap<>(20); + List ignoreSignParams = new ArrayList(); + // 系统级参数 + paramMap.put("appKey", PropertiesUtil.getValue(fileName, "open.api.appKey")); //开发者必须事先通过申请获取appKey/secret后,才能进行应用的开发 + paramMap.put("method", "tea.ask.pay.money"); //方法名称 + paramMap.put("v", PropertiesUtil.getValue(fileName, "open.api.version")); //服务方法的版本号 + paramMap.put("format", PropertiesUtil.getValue(fileName, "open.api.format"));//报文的格式,支持XML和JSON,默认JSON + paramMap.put("locale", PropertiesUtil.getValue(fileName, "open.api.locale")); //本地化类型,默认zh_CN + paramMap.put("timestamp", String.valueOf(System.currentTimeMillis()));//时间戳,自1970-01-01 00:00:00.000起的毫秒数 + paramMap.put("client", PropertiesUtil.getValue(fileName, "open.api.client"));//客户端类型 + // 业务参数 + paramMap.put("askGoodsTicket",askGoodsTicket); //要货单号 + paramMap.put("isHaveT6Blance",isHaveT6Blance); //是否使用erp 余额 + paramMap.put("payType",payType); //付款方式 + paramMap.put("isAskGoods",isAskGoods); //是否确认要货 + // 参数签名 + String signValue = this.sign(paramMap, ignoreSignParams,PropertiesUtil.getValue(fileName,"open.api.secret")); + paramMap.put("sign",signValue); //签名串,请求参数的签名,服务平台通过它验证请求数据的合法性 + String url=PropertiesUtil.getValue(fileName,"open.api.url"); + long startTime = System.currentTimeMillis(); + final HttpResponse hr = HttpTool.url(url).form(paramMap).post(); + long endTime = System.currentTimeMillis(); + logger.info("执行时间:{}",endTime-startTime); + final String content = HttpTool.getResponseAsString(hr); + + logger.debug("调用erp接口tea.ask.pay.money 返回的数据如下:{}",content); + + if(StringUtils.isEmpty(content)|| content.length()==0 || !this.isSuccessful(content)){ + response.setErrCode("error"); + response.setMessage("调用erp接口失败,请联系督导协助处理"); + + }else{ + JSONObject object = JSON.parseObject(content); + String state = object.getString("state"); + if(StringUtils.equals("1",state)){ + //账户余额 storeBalance 、返利金额 storeRebate、要货扣除的金额 payMoney + Double storeBalance = object.getDouble("storeBalance"); + Double storeRebate = object.getDouble("storeRebate"); + Double payMoney = object.getDouble("payMoney"); + Map data = new HashMap<>(); + data.put("storeBalance",storeBalance); + data.put("storeRebate",storeRebate); + data.put("payMoney",payMoney); + response.setStatus(1); + response.setMessage("调用erp接口扣款成功"+object.getString("message")); + response.setData(data); + //获取执行扣款数据成功后的操作 + //NO.1 更新要货单的状态 + try { + for(AskGoodsTicket atn :atList){ + atn.setStatus(2); //更新要货单状态为已审核状态 + String ticketId = atn.getId(); + Criteria cc = new Criteria(); + cc.add(Restrictions.eq("ticketId",ticketId)); + List adListn = this.askGoodsDetailService.getList(tenantId,cc); + AskGoodsTicketLog atlog = new AskGoodsTicketLog(); + atlog.setTenantId(tenantId); + atlog.setCreateUser("erp_pos"); + atlog.setCreateDate(new Date()); + atlog.setType(3); + atlog.setStatus(2); + atlog.setPayStatus(0); + atlog.setDescription("erp扣款成功,更新要货单状态"); + this.askGoodsTicketService.updateAskGoodsTicket(tenantId,atn,adListn,atlog); + } + } catch (Exception e) { + e.printStackTrace(); + } + }else{ + response.setErrCode("error"); + String description= object.get("message")+""; // 备注 + response.setMessage("调用erp接口 扣款失败:"+description); + return response; + } + } + return response; + } + + @ServiceMethod(method = "erp.store.material.dispatch", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "定制erp生成配送单") + @Override + public Object createDispatchTicket(CreateDispatchTicketRequest request) { + String info = "定制erp生成配送单"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String storeErpNo = request.getStoreErpNo(); + Double logisticsFee = request.getLogisticsFee() == null ? 0.0 : request.getLogisticsFee(); + Double orderMoney = request.getOrderMoney() == null ? 0.0 : request.getOrderMoney();; + Double otherFee = request.getOtherFee() == null ? 0.0 : request.getOtherFee();; + String description = request.getDescription(); + String materialInfo = request.getMaterialInfo(); + + CommonDataResponse response = null; + try{ + response = new CommonDataResponse(); + + if(StringUtils.isEmpty(storeErpNo)){ + response.setStatus(0); + response.setErrCode("error"); + response.setMessage("门店编号不能为空!"); + return response; + } + + if(StringUtils.isEmpty(materialInfo)){ + response.setStatus(0); + response.setErrCode("error"); + response.setMessage("要货信息不能空!"); + return response; + } + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("ext1",storeErpNo)); + criteria.add(Restrictions.eq("deleteFlag",0)); + criteria.add(Restrictions.eq("authFlag",1)); + List stores = storeService.getList(tenantId,criteria); + if(CollectionUtils.isEmpty(stores) || stores.size() > 1 ){ + response.setStatus(0); + response.setErrCode("error"); + response.setMessage("门店信息错误!"); + return response; + } + Store store = stores.get(0); + DispatchTicket ticket = new DispatchTicket(); + ticket.setTenantId(tenantId); + ticket.setStoreId(store.getId()); + ticket.setNo("BE"+DateUtils.getCurrDatetime()); + ticket.setStatus(0); + ticket.setDescription(description); + ticket.setSetDate(new Date()); + ticket.setSetMan("boduo-api"); + ticket.setAddress(store.getAddress()); + ticket.setLinkMan(store.getManager()); + ticket.setLinkTelephone(store.getMobile()); + ticket.setLogisticsFee(logisticsFee); + ticket.setOrderMoney(orderMoney); + ticket.setOtherFee(otherFee); + ticket.setCreateDate(new Date()); + ticket.setCreateUser("boduo-api"); + + DispatchTicketLog log = new DispatchTicketLog(); + log.setTenantId(tenantId); + log.setType(0); + log.setStatus(0); + log.setDescription("定制erp生成配送单,门店ErpNo:"+storeErpNo); + log.setCreateUser("api"); + log.setCreateDate(new Date()); + + JSONArray jsons = new JSONArray().parseArray(materialInfo); + criteria = new Criteria(); + criteria.add(Restrictions.limit("0","15000")); + criteria.add(Restrictions.order("createDate","desc")); + List ratios = productRatioService.getList(tenantId,criteria); + Map ratioMap = new HashMap<>(); + for(ProductRatio ratio : ratios){ + ratioMap.put(ratio.getProductId(),ratio); + } + Map unitMap = productUnitCache.getAllMap(tenantId); + List storageList = storageService.getList(tenantId,new Criteria()); + if(CollectionUtils.isEmpty(storageList)){ + response.setStatus(0); + response.setErrCode("error"); + response.setMessage("未查询到总部仓库信息!"); + return response; + } + Storage storage = storageList.get(0); + criteria = new Criteria(); + criteria.add(Restrictions.eq("p.deleteFlag", 0)); + criteria.add(Restrictions.eq("ps.deleteFlag", 0)); + criteria.add(Restrictions.eq("p.selfFlag", 0)); + criteria.add(Restrictions.eq("p.stockFlag",1)); + criteria.add(Restrictions.eq("p.type",10)); + criteria.add(Restrictions.order("p.createDate","desc")); + criteria.add(Restrictions.limit("0","15000")); + List productSpecList = productSpecService.getListWithProduct(tenantId,criteria); + Map productSpecMap = new HashMap<>(); + for(ProductSpec spec : productSpecList){ + productSpecMap.put(spec.getProductNo(),spec); + } + + Double totalAmount = 0.0; + List details = new ArrayList<>(); + + for(Object jsonStr : jsons){ + MaterialInfo mater = new MaterialInfo((JSONObject)jsonStr); + String productNo = mater.getProductNo(); + if(StringUtils.isEmpty(productNo)){ + response.setStatus(0); + response.setErrCode("error"); + response.setMessage("商品编号不能为空"); + return response; + } + Double amount = mater.getAmount(); + if(amount == null){ + response.setStatus(0); + response.setErrCode("error"); + response.setMessage("商品数量不能为空"); + return response; + } + Double price = mater.getPrice() == null ? 0.0 : mater.getPrice(); + DispatchTicketDetail detail = new DispatchTicketDetail(); + detail.setTenantId(tenantId); + detail.setDispatchNo(ticket.getNo()); + detail.setStorageId(storage.getId()); + detail.setStorageName(storage.getName()); + ProductSpec spec = productSpecMap.get(mater.getProductNo()); + if(spec == null) { + criteria = new Criteria(); + criteria.add(Restrictions.eq("p.deleteFlag", 0)); + criteria.add(Restrictions.eq("ps.deleteFlag", 0)); + criteria.add(Restrictions.eq("p.selfFlag", 0)); + criteria.add(Restrictions.eq("p.stockFlag",1)); + criteria.add(Restrictions.eq("p.type",10)); + criteria.add(Restrictions.eq("p.no",mater.getProductNo())); + List maters = productSpecService.getListWithProduct(tenantId,criteria); + if(CollectionUtils.isNotEmpty(maters)){ + spec = maters.get(0); + }else{ + response.setStatus(0); + response.setErrCode("error"); + response.setMessage("未查询到("+mater.getProductNo()+")的商品"); + return response; + } + } + detail.setProductId(spec.getProductId()); + detail.setProductNo(spec.getProductNo()); + detail.setProductName(spec.getProductName()); + detail.setProductDescription(spec.getProductDescription()); + detail.setSpecId(spec.getId()); + detail.setSpecName(spec.getName()); + detail.setAskgoodsAmount(amount); + detail.setDispatchAmount(amount); + String dispatchUnitId = null; + if(ratioMap.get(detail.getProductId()) == null || StringUtils.isEmpty(ratioMap.get(detail.getProductId()).getDispatchUnitId())){ + response.setStatus(0); + response.setErrCode("error"); + response.setMessage("未查询到商品("+productNo+")的单位"); + return response; + } + dispatchUnitId = ratioMap.get(detail.getProductId()).getDispatchUnitId(); + String dispatchUnitName = unitMap.get(dispatchUnitId).getName(); + detail.setDispatchUnitId(dispatchUnitId); + detail.setDispatchUnitName(dispatchUnitName); + String packUnitId = ""; + if(ratioMap.get(detail.getProductId()) == null || StringUtils.isEmpty(ratioMap.get(detail.getProductId()).getPackUnitId())){ + response.setStatus(0); + response.setErrCode("error"); + response.setMessage("未查询到商品("+productNo+")的单位"); + return response; + } + packUnitId = ratioMap.get(detail.getProductId()).getPackUnitId(); + String packUnitName = unitMap.get(packUnitId).getName(); + detail.setPackUnitId(packUnitId); + detail.setPackUnitName(packUnitName); + detail.setPrice(price); + detail.setMoney(price*amount); + totalAmount += detail.getMoney(); + detail.setDescription(mater.getDescription()); + detail.setDpScale(ratioMap.get(detail.getProductId()).getDpScale()); + detail.setCreateDate(new Date()); + detail.setCreateUser("boduo-api"); + details.add(detail); + } + ticket.setOrderMoney(totalAmount); + ticket.setMoney(ticket.getOrderMoney() + logisticsFee+otherFee); + + ticket = dispatchTicketService.saveTicket(tenantId,ticket,details,log); + if(ticket != null && StringUtils.isNotEmpty(ticket.getId())){ + ReceiveGoodsTicket receiveGoodsTicket = dispatchTicketService.saveStoreReceiveGoodsTicketByAutoCheck(tenantId,ticket.getId()); + if(receiveGoodsTicket != null ){ + response.setStatus(1); + response.setMessage("保存成功"); + }else{ + response.setStatus(0); + response.setMessage("自动验收入库失败"); + } + }else{ + response.setStatus(0); + response.setMessage("生成配送单失败"); + } + return response; + }catch (Exception e){ + logger.error(info + ",发生异常", e); + response.setStatus(0); + response.setErrCode("error"); + response.setMessage("定制erp生成配送单,失败"); + return response; + } + + + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/impl/DeliveryModeListServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/impl/DeliveryModeListServiceImpl.java new file mode 100644 index 0000000..572d9d0 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/impl/DeliveryModeListServiceImpl.java @@ -0,0 +1,94 @@ +package com.jwsaas.api.boduo.erp.service.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.jwsaas.api.boduo.erp.request.DeliveryModeListRequest; +import com.jwsaas.api.boduo.erp.response.DeliveryModeListResponse; +import com.jwsaas.api.boduo.erp.service.DeliveryModeListService; +import com.jwsaas.api.service.impl.ErpBaseServiceImpl; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.http.HttpTool; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.utils.AppKeyUtil; +import com.jwsaas.utils.PropertiesUtil; +import org.apache.http.HttpResponse; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @Author:CHL + * @Date:Create in 2018/3/22 + * @Description:获取物料信息实现类 + */ + +@ServiceMethodBean(version = "1.0") +public class DeliveryModeListServiceImpl extends ErpBaseServiceImpl implements DeliveryModeListService { + private static final long serialVersionUID = -345096567692034912L; + + + @ServiceMethod(method = "erp.deliver.mode.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "从erp中获取配送方式") + @Override + public Object getDeliveryModeList(DeliveryModeListRequest request) { + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String info = "erp.deliver.mode.list-->getDeliveryModeList 接口获取erp中获取配送方式"; + logger.info(info+"企业号:{}",tenantId); + DeliveryModeListResponse response = null; + try { + response = new DeliveryModeListResponse(); + + // 开放接口签名 + Map paramMap = new HashMap<>(20); + List ignoreSignParams = new ArrayList(); + // 系统级参数 + paramMap.put("appKey", PropertiesUtil.getValue(fileName, "open.api.appKey")); //开发者必须事先通过申请获取appKey/secret后,才能进行应用的开发 + paramMap.put("method", "dspway.dspway"); //方法名称 + paramMap.put("v", PropertiesUtil.getValue(fileName, "open.api.version")); //服务方法的版本号 + paramMap.put("format", PropertiesUtil.getValue(fileName, "open.api.format"));//报文的格式,支持XML和JSON,默认JSON + paramMap.put("locale", PropertiesUtil.getValue(fileName, "open.api.locale")); //本地化类型,默认zh_CN + paramMap.put("timestamp", String.valueOf(System.currentTimeMillis()));//时间戳,自1970-01-01 00:00:00.000起的毫秒数 + paramMap.put("client", PropertiesUtil.getValue(fileName, "open.api.client"));//客户端类型 + // 业务参数 + // 参数签名 + String signValue = this.sign(paramMap, ignoreSignParams,PropertiesUtil.getValue(fileName,"open.api.secret")); + paramMap.put("sign",signValue); //签名串,请求参数的签名,服务平台通过它验证请求数据的合法性 + String url=PropertiesUtil.getValue(fileName,"open.api.url"); + long startTime = System.currentTimeMillis(); + final HttpResponse hr = HttpTool.url(url).form(paramMap).post(); + long endTime = System.currentTimeMillis(); + logger.info("执行时间:{}",endTime-startTime); + final String content = HttpTool.getResponseAsString(hr); + + logger.debug("调用erp接口返回的数据如下:{}",content); + + if(this.isSuccessful(content)){ + JSONObject object = JSON.parseObject(content); + JSONArray ja = object.getJSONArray("list"); + response.setStatus(1); + response.setMessage("操作成功"); + response.setList(ja); + }else{ + response.setErrCode("error"); + response.setMessage("操作失败"); + response.setList(new JSONArray()); + } + } catch (Exception e) { + e.printStackTrace(); + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/impl/ErpToPosDataServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/impl/ErpToPosDataServiceImpl.java new file mode 100644 index 0000000..580f048 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/impl/ErpToPosDataServiceImpl.java @@ -0,0 +1,159 @@ +package com.jwsaas.api.boduo.erp.service.impl; + +import com.alibaba.dubbo.common.utils.CollectionUtils; +import com.alibaba.fastjson.JSON; +import com.jwsaas.api.boduo.erp.request.ErpToPosMaterialSyncRequest; +import com.jwsaas.api.boduo.erp.service.ErpToPosDataService; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.service.impl.ErpBaseServiceImpl; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.Product; +import com.jwsaas.entity.food.ProductSpec; +import com.jwsaas.entity.food.ProductType; +import com.jwsaas.entity.food.ProductUnit; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.util.Pinyin4jUtil; +import com.jwsaas.utils.AppKeyUtil; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @Author:CHL + * @Date:Create in 2018/4/28 + * @Description: erp 中的数据向 pos中同步调用的接口 + */ + +@ServiceMethodBean(version = "1.0") +public class ErpToPosDataServiceImpl extends ErpBaseServiceImpl implements ErpToPosDataService { + private static final long serialVersionUID = -345096567692034912L; + @Resource + private com.jwsaas.service.food.ProductService productService; + @Resource + private com.jwsaas.service.food.ProductTypeService productTypeService; + @Resource + private com.jwsaas.service.food.ProductUnitService productUnitService; + + /** + * 保存原料数据接口 + * @param request + * @return + */ + @ServiceMethod(method = "erp.material.to.pos.product", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "接收erp中原料数据持久化到pos后台接口") + @Override + public Object saveMaterialDetail(ErpToPosMaterialSyncRequest request) { + + String appKey = request.getWopRequestContext().getAppKey(); + //NO.1 获取应用参数 + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String info = "erp.material.to.pos.product-->saveMaterialDetail 接收erp中原料数据持久化到pos后台接口"; + logger.info(info+"企业号:{}",tenantId); + CommonDataResponse response = null; + try { + String cInvCode = request.getcInvCode(); // 物料编号 + String cInvName = request.getcInvName(); // 物料名称 + String cInvStd = request.getcInvStd(); // 物料规格 + String cInvCCode = request.getcInvCCode(); // 分类编号 + String cComUnitCode = request.getcComUnitCode(); // 主计量单位编码 + + response = new CommonDataResponse(); + //NO.2 持久化对象 + Product p = writeDataToDB(tenantId,cInvCode,cInvName,cInvStd,cInvCCode,cComUnitCode); + Map map = new HashMap<>(); + map.put("productId",p.getId()); + map.put("productName",p.getName()); + response.setStatus(1); + response.setMessage("物料信息同步成功"); + response.setData(map); + } catch (Exception e) { + e.printStackTrace(); + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + private Product writeDataToDB(String tenantId, String cInvCode,String cInvName, + String cInvStd, String cInvCCode,String cComUnitCode ) throws Exception { + // NO.1构建对象 + Product p = new Product(); + p.setTenantId(tenantId); + p.setType(10); //原料 + p.setCreateUser("erp_pos"); + p.setNo(cInvCode); + p.setName(cInvName); + p.setSpec(cInvStd); //规格 + p.setSpell(Pinyin4jUtil.getPinYinHeadChar(cInvName).toUpperCase()); + p.setStopFlag(0); //是否信用 + p.setLyRate(0.00); //联营扣率 + p.setStockFlag(1); // 管理库存 + p.setPromotionFlag(1); //允许促销 + p.setGiveFlag(1); //允许赠送 + p.setMebDiscountFlag(0); //会员折上折 + p.setSuitFlag(0); // 套餐 + p.setSaleTax(0.00); //销项税 + p.setPurchaseTax(17.00); //进项税 + p.setPointValue(0.0); //积分值 + p.setPointType(0); //积分类型 + p.setLabelPrintFlag(0); //打印标签 + p.setCurrentFlag(0); //是否可议价 + p.setWeighFlag(0); //是否需要称重 + p.setTapleFlag(0); //是否主食 + p.setDiscountFlag(0); //可折扣 + p.setCommissionValue(0.00); //提成值 + p.setCommissionType(0); //提成方式 + + Criteria c = new Criteria(); + c.add(Restrictions.eq("no",cInvCCode)); + List ptList = this.productTypeService.getList(tenantId,c); + if(CollectionUtils.isNotEmpty(ptList)){ + String typeId = ptList.get(0).getId(); + p.setTypeId(typeId); + } + + c = new Criteria(); + c.add(Restrictions.eq("no",cComUnitCode)); + List puList = this.productUnitService.getList(tenantId,c); + if(CollectionUtils.isNotEmpty(puList)){ + String unitId = puList.get(0).getId(); + p.setUnitId(unitId); //单位 + }else{ + logger.info("原料单位在pos中不存在:{}", cComUnitCode); + } + + logger.debug("持久化对象数据如下:{}",JSON.toJSONString(p)); + //持久化操作 + + List specList = new ArrayList<>(); + // 不启用规格 + ProductSpec productSpec = new ProductSpec(); + productSpec.setTenantId(tenantId); + productSpec.setNo("0"); + productSpec.setName(p.getSpec()); + productSpec.setPrice(0D); + productSpec.setMemberPrice(0D); + productSpec.setMinPrice( 0D); + productSpec.setCostPrice( 0D); + productSpec.setOtherPrice( 0D); + productSpec.setPurchasePrice(0D); + productSpec.setDispatchPrice(0D); + productSpec.setMaterialRate(100D); + productSpec.setCreateUser("erp_pos"); + productSpec.setIsdefault(0); + specList.add(productSpec); + return this.productService.saveWithSpec(tenantId,p,specList); + } + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/impl/MateriaTypeServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/impl/MateriaTypeServiceImpl.java new file mode 100644 index 0000000..b5b756a --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/impl/MateriaTypeServiceImpl.java @@ -0,0 +1,362 @@ +package com.jwsaas.api.boduo.erp.service.impl; + +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import org.apache.http.HttpResponse; + +import com.alibaba.dubbo.common.utils.CollectionUtils; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.jwsaas.api.boduo.erp.request.MaterialTypeRequest; +import com.jwsaas.api.boduo.erp.request.SyncMaterialTypeRequest; +import com.jwsaas.api.boduo.erp.response.MaterialTypeResponse; +import com.jwsaas.api.boduo.erp.service.MaterialTypeService; +import com.jwsaas.api.entity.pos.MaterialTypeEntity; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.service.impl.ErpBaseServiceImpl; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.ProductType; +import com.jwsaas.http.HttpTool; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.utils.AppKeyUtil; +import com.jwsaas.utils.PropertiesUtil; + +/** + * @Author:CHL + * @Date:Create in 2018/3/22 + * @Description:获取物料信息实现类 + */ + +@ServiceMethodBean(version = "1.0") +public class MateriaTypeServiceImpl extends ErpBaseServiceImpl implements MaterialTypeService { + private static final long serialVersionUID = -345096567692034912L; + + @Resource + private com.jwsaas.service.food.ProductTypeService productTypeService; + + @ServiceMethod(method = "erp.material.type", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "从erp中获取原料分类接口") + @Override + public Object getMaterialTypeTea(MaterialTypeRequest request) { + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String info = "erp.material.type 接口获取erp中原料分类"; + + MaterialTypeResponse response = null; + try { + response = new MaterialTypeResponse(); + // 开放接口签名 + Map paramMap = new HashMap<>(20); + List ignoreSignParams = new ArrayList(); + // 系统级参数 + paramMap.put("appKey", PropertiesUtil.getValue(fileName, "open.api.appKey")); // 开发者必须事先通过申请获取appKey/secret后,才能进行应用的开发 + paramMap.put("method", "inventoryClass.findAll"); // 方法名称 + paramMap.put("v", PropertiesUtil.getValue(fileName, "open.api.version")); // 服务方法的版本号 + paramMap.put("format", PropertiesUtil.getValue(fileName, "open.api.format"));// 报文的格式,支持XML和JSON,默认JSON + paramMap.put("locale", PropertiesUtil.getValue(fileName, "open.api.locale")); // 本地化类型,默认zh_CN + paramMap.put("timestamp", String.valueOf(System.currentTimeMillis()));// 时间戳,自1970-01-01 + // 00:00:00.000起的毫秒数 + paramMap.put("client", PropertiesUtil.getValue(fileName, "open.api.client"));// 客户端类型 + // 业务参数 + // 参数签名 + String signValue = this.sign(paramMap, ignoreSignParams, PropertiesUtil.getValue(fileName, "open.api.secret")); + paramMap.put("sign", signValue); // 签名串,请求参数的签名,服务平台通过它验证请求数据的合法性 + String url = PropertiesUtil.getValue(fileName, "open.api.url"); + long startTime = System.currentTimeMillis(); + final HttpResponse hr = HttpTool.url(url).form(paramMap).post(); + long endTime = System.currentTimeMillis(); + logger.info("执行时间:{}", endTime - startTime); + final String content = HttpTool.getResponseAsString(hr); + + logger.debug("调用erp接口返回的数据如下:{}", content); + int resoultCount = 0; + if (isSuccessful(content)) { + JSONObject object = JSON.parseObject(content); + JSONArray ja = object.getJSONArray("data"); + resoultCount = ja.size(); + for (int i = 0; i < ja.size(); i++) { + JSONObject jo = ja.getJSONObject(i); + String cInvCCode = jo.getString("cInvCCode"); // 分类编号 + String cInvCName = jo.getString("cInvCName"); // 分类名称 + String bInvCEnd = jo.getString("bInvCEnd"); // 父级分类编号 + String bInvCName = jo.getString("bInvCName"); + // 父级分类名称 + /* + * if (bInvCEnd.length()==1 && cInvCCode.length()==1){ + * //1级菜单 logger.warn("分类编号:{},分类名称:{},父级分类编号:{},父级分类名称:{}", + * cInvCCode,cInvCName,bInvCEnd,bInvCName); //向数据库同步 + * writeDataToDB(tenantId,cInvCCode,cInvCName,bInvCEnd, + * bInvCName,resoultCount,1); + * + * }else + */ if (bInvCEnd.length() == 1 && cInvCCode.length() == 2) { + // 2级菜单 + logger.warn("分类编号:{},分类名称:{},父级分类编号:{},父级分类名称:{}", cInvCCode, cInvCName, bInvCEnd, bInvCName); + // 向数据库中同步操作 + writeDataToDB(tenantId, cInvCCode, cInvCName, bInvCEnd, bInvCName, resoultCount, 1); + } + } + for (int i = 0; i < ja.size(); i++) { + JSONObject jo = ja.getJSONObject(i); + String cInvCCode = jo.getString("cInvCCode"); // 分类编号 + String cInvCName = jo.getString("cInvCName"); // 分类名称 + String bInvCEnd = jo.getString("bInvCEnd"); // 父级分类编号 + String bInvCName = jo.getString("bInvCName"); // 父级分类名称 + + if (bInvCEnd.length() == 2) { + // 3级菜单 + logger.debug("分类编号:{},分类名称:{},父级分类编号:{},父级分类名称:{}", cInvCCode, cInvCName, bInvCEnd, bInvCName); + writeDataToDB(tenantId, cInvCCode, cInvCName, bInvCEnd, bInvCName, resoultCount, 2); + } + + } + for (int i = 0; i < ja.size(); i++) { + JSONObject jo = ja.getJSONObject(i); + String cInvCCode = jo.getString("cInvCCode"); // 分类编号 + String cInvCName = jo.getString("cInvCName"); // 分类名称 + String bInvCEnd = jo.getString("bInvCEnd"); // 父级分类编号 + String bInvCName = jo.getString("bInvCName"); // 父级分类名称 + + if (bInvCEnd.length() == 4) { + // 4级菜单 + logger.debug("分类编号:{},分类名称:{},父级分类编号:{},父级分类名称:{}", cInvCCode, cInvCName, bInvCEnd, bInvCName); + writeDataToDB(tenantId, cInvCCode, cInvCName, bInvCEnd, bInvCName, resoultCount, 3); + } + } + } + + response.setStatus(1); + response.setMessage("操作成功"); + response.setCount(resoultCount); + + } catch (Exception e) { + e.printStackTrace(); + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + private void writeDataToDB(String tenantId, String cInvCCode, String cInvCName, String bInvCEnd, String bInvCName, Integer resoultCount, int leaf) throws Exception { + // NO.1 检测编号是否存在 + Criteria c = new Criteria(); + c.add(Restrictions.eq("no", cInvCCode)); + List ptList = productTypeService.getList(tenantId, c); + if (CollectionUtils.isNotEmpty(ptList)) { + resoultCount--; + } else { + ProductType pt = new ProductType(); + pt.setTenantId(tenantId); + if (leaf != 1) { + c = new Criteria(); + c.add(Restrictions.eq("no", bInvCEnd)); + List parentPTList = productTypeService.getList(tenantId, c); + if (CollectionUtils.isNotEmpty(parentPTList)) { + + ProductType parentPT = parentPTList.get(0); + pt.setParentId(parentPT.getId()); + } + + } + pt.setNo(cInvCCode); + pt.setName(cInvCName); + pt.setColor("#3f758a"); + pt.setDeleteFlag(0); + pt.setSign("3"); + pt.setCreateDate(new Date()); + pt.setCreateUser("erp_pos"); + + this.productTypeService.save(tenantId, pt); + } + } + + @ServiceMethod(method = "sync.material.type", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "同步原料分类") + @Override + public Object syncMaterialType(SyncMaterialTypeRequest request) { + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String materialType = request.getMaterialType(); + String info = "sync.material.type 同步原料分类"; + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + // 存储一级分类 + List updateOneList = new ArrayList<>(); + List saveOneList = new ArrayList<>(); + // 存储二级分类 + List updateTwoList = new ArrayList<>(); + List saveTwoList = new ArrayList<>(); + // 存储三级分类 + List updateThreeList = new ArrayList<>(); + List saveThreeList = new ArrayList<>(); + Date nowDate = new Date(); + if (materialType != null && !"".equals(materialType)) { + JSONArray jsonUnits = new JSONArray().parseArray(materialType); + // 原料编号分级 + List oneMaterialType = new ArrayList<>(); + List twoMaterialType = new ArrayList<>(); + List threeMaterialType = new ArrayList<>(); + for (int i = 0; i < jsonUnits.size(); i++) { + MaterialTypeEntity materialTypeEntity = new MaterialTypeEntity(jsonUnits.getJSONObject(i)); + if (materialTypeEntity.getNo().length() == 2) { + oneMaterialType.add(materialTypeEntity); + } else if (materialTypeEntity.getNo().length() == 4) { + twoMaterialType.add(materialTypeEntity); + } else { + threeMaterialType.add(materialTypeEntity); + } + } + // 先处理一级分类 + for (MaterialTypeEntity materialTypeEntity : oneMaterialType) { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantId", tenantId)); + criteria.add(Restrictions.eq("no", materialTypeEntity.getNo())); + criteria.add(Restrictions.eq("sign", "3")); + List typeList = productTypeService.getList(tenantId, criteria); + if (typeList != null && typeList.size() > 0) { + ProductType productType = typeList.get(0); + productType.setNo(materialTypeEntity.getNo()); + productType.setName(materialTypeEntity.getName()); + productType.setModifyUser("sync"); + productType.setModifyDate(nowDate); + updateOneList.add(productType); + } else { + ProductType productType = new ProductType(); + productType.setTenantId(tenantId); + productType.setNo(materialTypeEntity.getNo()); + productType.setName(materialTypeEntity.getName()); + productType.setColor("#3f758a"); + productType.setDeleteFlag(0); + productType.setSign("3"); + productType.setCreateUser("sync"); + productType.setCreateDate(nowDate); + saveOneList.add(productType); + } + } + productTypeService.updateProductTypeBatch(tenantId, updateOneList, saveOneList); + // 处理二级分类 + for (MaterialTypeEntity materialTypeEntity : twoMaterialType) { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantId", tenantId)); + criteria.add(Restrictions.eq("no", materialTypeEntity.getNo())); + criteria.add(Restrictions.eq("sign", "3")); + List typeList = productTypeService.getList(tenantId, criteria); + if (typeList != null && typeList.size() > 0) { + ProductType productType = typeList.get(0); + productType.setNo(materialTypeEntity.getNo()); + productType.setName(materialTypeEntity.getName()); + // 获取上级类别 + criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantId", tenantId)); + criteria.add(Restrictions.eq("no", materialTypeEntity.getParentNo())); + criteria.add(Restrictions.eq("sign", "3")); + typeList = productTypeService.getList(tenantId, criteria); + if (typeList != null && typeList.size() > 0) { + ProductType productParentType = typeList.get(0); + productType.setParentId(productParentType.getId()); + } + productType.setModifyUser("sync"); + productType.setModifyDate(nowDate); + updateTwoList.add(productType); + } else { + ProductType productType = new ProductType(); + productType.setTenantId(tenantId); + productType.setNo(materialTypeEntity.getNo()); + productType.setName(materialTypeEntity.getName()); + // 获取上级类别 + criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantId", tenantId)); + criteria.add(Restrictions.eq("no", materialTypeEntity.getParentNo())); + criteria.add(Restrictions.eq("sign", "3")); + typeList = productTypeService.getList(tenantId, criteria); + if (typeList != null && typeList.size() > 0) { + ProductType productParentType = typeList.get(0); + productType.setParentId(productParentType.getId()); + } + productType.setColor("#3f758a"); + productType.setDeleteFlag(0); + productType.setSign("3"); + productType.setCreateUser("sync"); + productType.setCreateDate(nowDate); + saveTwoList.add(productType); + } + } + productTypeService.updateProductTypeBatch(tenantId, updateTwoList, saveTwoList); + + //处理3级分类 + for (MaterialTypeEntity materialTypeEntity : threeMaterialType) { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantId", tenantId)); + criteria.add(Restrictions.eq("no", materialTypeEntity.getNo())); + criteria.add(Restrictions.eq("sign", "3")); + List typeList = productTypeService.getList(tenantId, criteria); + if (typeList != null && typeList.size() > 0) { + ProductType productType = typeList.get(0); + productType.setNo(materialTypeEntity.getNo()); + productType.setName(materialTypeEntity.getName()); + // 获取上级类别 + criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantId", tenantId)); + criteria.add(Restrictions.eq("no", materialTypeEntity.getParentNo())); + criteria.add(Restrictions.eq("sign", "3")); + typeList = productTypeService.getList(tenantId, criteria); + if (typeList != null && typeList.size() > 0) { + ProductType productParentType = typeList.get(0); + productType.setParentId(productParentType.getId()); + } + productType.setModifyUser("sync"); + productType.setModifyDate(nowDate); + updateThreeList.add(productType); + } else { + ProductType productType = new ProductType(); + productType.setTenantId(tenantId); + productType.setNo(materialTypeEntity.getNo()); + productType.setName(materialTypeEntity.getName()); + // 获取上级类别 + criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantId", tenantId)); + criteria.add(Restrictions.eq("no", materialTypeEntity.getParentNo())); + criteria.add(Restrictions.eq("sign", "3")); + typeList = productTypeService.getList(tenantId, criteria); + if (typeList != null && typeList.size() > 0) { + ProductType productParentType = typeList.get(0); + productType.setParentId(productParentType.getId()); + } + productType.setColor("#3f758a"); + productType.setDeleteFlag(0); + productType.setSign("3"); + productType.setCreateUser("sync"); + productType.setCreateDate(nowDate); + saveThreeList.add(productType); + } + } + productTypeService.updateProductTypeBatch(tenantId, updateThreeList, saveThreeList); + } + response.setStatus(1); + response.setMessage("原料分类同步成功"); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/impl/MateriaUnitServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/impl/MateriaUnitServiceImpl.java new file mode 100644 index 0000000..54e4356 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/impl/MateriaUnitServiceImpl.java @@ -0,0 +1,183 @@ +package com.jwsaas.api.boduo.erp.service.impl; + +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import org.apache.http.HttpResponse; + +import com.alibaba.dubbo.common.utils.CollectionUtils; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.jwsaas.api.boduo.erp.request.MaterialUnitRequest; +import com.jwsaas.api.boduo.erp.request.SyncMaterialUnitRequest; +import com.jwsaas.api.boduo.erp.response.MaterialUnitResponse; +import com.jwsaas.api.boduo.erp.service.MaterialUnitService; +import com.jwsaas.api.entity.pos.MaterialUnitEntity; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.service.impl.ErpBaseServiceImpl; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.ProductUnit; +import com.jwsaas.http.HttpTool; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.utils.AppKeyUtil; +import com.jwsaas.utils.PropertiesUtil; + +/** + * @Author:CHL + * @Date:Create in 2018/3/22 + * @Description:获取物料信息实现类 + */ + +@ServiceMethodBean(version = "1.0") +public class MateriaUnitServiceImpl extends ErpBaseServiceImpl implements MaterialUnitService { + private static final long serialVersionUID = -345096567692034912L; + + @Resource + private com.jwsaas.service.food.ProductUnitService productUnitService; + + @ServiceMethod(method = "erp.material.unit", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "从erp中获取原料单位接口") + @Override + public Object getMaterialUnitTea(MaterialUnitRequest request) { + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String info = "erp.material.unit 接口获取erp中原料单位"; + + MaterialUnitResponse response = null; + try { + response = new MaterialUnitResponse(); + // 开放接口签名 + Map paramMap = new HashMap<>(20); + List ignoreSignParams = new ArrayList(); + // 系统级参数 + paramMap.put("appKey", PropertiesUtil.getValue(fileName, "open.api.appKey")); // 开发者必须事先通过申请获取appKey/secret后,才能进行应用的开发 + paramMap.put("method", "common.getListComputationUnit"); // 方法名称 + paramMap.put("v", PropertiesUtil.getValue(fileName, "open.api.version")); // 服务方法的版本号 + paramMap.put("format", PropertiesUtil.getValue(fileName, "open.api.format"));// 报文的格式,支持XML和JSON,默认JSON + paramMap.put("locale", PropertiesUtil.getValue(fileName, "open.api.locale")); // 本地化类型,默认zh_CN + paramMap.put("timestamp", String.valueOf(System.currentTimeMillis()));// 时间戳,自1970-01-01 + // 00:00:00.000起的毫秒数 + paramMap.put("client", PropertiesUtil.getValue(fileName, "open.api.client"));// 客户端类型 + // 业务参数 + // 参数签名 + String signValue = this.sign(paramMap, ignoreSignParams, PropertiesUtil.getValue(fileName, "open.api.secret")); + paramMap.put("sign", signValue); // 签名串,请求参数的签名,服务平台通过它验证请求数据的合法性 + String url = PropertiesUtil.getValue(fileName, "open.api.url"); + long startTime = System.currentTimeMillis(); + final HttpResponse hr = HttpTool.url(url).form(paramMap).post(); + long endTime = System.currentTimeMillis(); + logger.info("执行时间:{}", endTime - startTime); + final String content = HttpTool.getResponseAsString(hr); + int resoultCount = 0; + if (this.isSuccessful(content)) { + JSONObject object = JSON.parseObject(content); + JSONArray ja = object.getJSONArray("oocaTList"); + resoultCount = ja.size(); + + for (int i = 0; i < ja.size(); i++) { + JSONObject jo = ja.getJSONObject(i); + // {"oocaTList":[{"cComunitCode":"BAG","cComUnitName":"袋、包","cGroupCode":"","iChangRate":"","iProportion":"","iNumber":"","cGroupName":"","iGroupType":""}]} + String no = jo.getString("cComunitCode"); + Criteria c = new Criteria(); + c.add(Restrictions.eq("no", no)); + List puList = this.productUnitService.getList(tenantId, c); + // 如果有就跳过这条数据 + if (CollectionUtils.isNotEmpty(puList)) { + resoultCount--; + continue; + } + String name = jo.getString("cComUnitName"); + ProductUnit mu = new ProductUnit(); + mu.setTenantId(tenantId); + mu.setNo(no); + mu.setName(name); + mu.setDeleteFlag(0); + mu.setNoType(2); + mu.setCreateUser("erp_pos"); + + this.productUnitService.save(tenantId, mu); + } + + } + + response.setStatus(1); + response.setMessage("操作成功"); + response.setCount(resoultCount); + + } catch (Exception e) { + e.printStackTrace(); + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "sync.material.unit", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "同步原料单位") + @Override + public Object syncMaterialUnit(SyncMaterialUnitRequest request) { + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String materialUnit = request.getMaterialUnit(); + String info = "sync.material.unit 同步原料单位"; + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + List updateList = new ArrayList<>(); + List saveList = new ArrayList<>(); + Date nowDate = new Date(); + if (materialUnit != null && !"".equals(materialUnit)) { + JSONArray jsonUnits = new JSONArray().parseArray(materialUnit); + for (int i = 0; i < jsonUnits.size(); i++) { + // 前台资源 + MaterialUnitEntity materialUnitEntity = new MaterialUnitEntity(jsonUnits.getJSONObject(i)); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantId", tenantId)); + criteria.add(Restrictions.eq("no", materialUnitEntity.getNo())); + List unitList = productUnitService.getList(tenantId, criteria); + if (unitList != null && unitList.size() > 0) { + ProductUnit productUnit = unitList.get(0); + productUnit.setNo(materialUnitEntity.getNo()); + productUnit.setName(materialUnitEntity.getName()); + productUnit.setModifyUser("sync"); + productUnit.setModifyDate(nowDate); + updateList.add(productUnit); + } else { + ProductUnit productUnit = new ProductUnit(); + productUnit.setTenantId(tenantId); + productUnit.setNo(materialUnitEntity.getNo()); + productUnit.setName(materialUnitEntity.getName()); + productUnit.setDeleteFlag(0); + productUnit.setNoType(1); + productUnit.setCreateUser("sync"); + productUnit.setCreateDate(nowDate); + saveList.add(productUnit); + } + } + } + productUnitService.updateProductUnitBatch(tenantId, updateList, saveList); + response.setStatus(1); + response.setMessage("原料单位同步成功"); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/impl/MaterialDetailServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/impl/MaterialDetailServiceImpl.java new file mode 100644 index 0000000..80559aa --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/impl/MaterialDetailServiceImpl.java @@ -0,0 +1,489 @@ +package com.jwsaas.api.boduo.erp.service.impl; + +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import org.apache.http.HttpResponse; + +import com.alibaba.dubbo.common.utils.CollectionUtils; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.jwsaas.api.boduo.erp.request.MaterialDetailRequest; +import com.jwsaas.api.boduo.erp.request.SyncMaterialRequest; +import com.jwsaas.api.boduo.erp.response.MaterialDetailResponse; +import com.jwsaas.api.boduo.erp.service.MaterialDetailService; +import com.jwsaas.api.entity.pos.MaterialEntity; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.service.impl.ErpBaseServiceImpl; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.Product; +import com.jwsaas.entity.food.ProductRatio; +import com.jwsaas.entity.food.ProductSpec; +import com.jwsaas.entity.food.ProductType; +import com.jwsaas.entity.food.ProductUnit; +import com.jwsaas.http.HttpTool; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.util.Pinyin4jUtil; +import com.jwsaas.utils.AppKeyUtil; +import com.jwsaas.utils.PropertiesUtil; + +/** + * @Author:CHL + * @Date:Create in 2018/3/22 + * @Description:获取物料信息实现类 + */ + +@ServiceMethodBean(version = "1.0") +public class MaterialDetailServiceImpl extends ErpBaseServiceImpl implements MaterialDetailService { + private static final long serialVersionUID = -345096567692034912L; + + @Resource + private com.jwsaas.service.food.StoreService storeService; + @Resource + private com.jwsaas.service.food.ProductService productService; + @Resource + private com.jwsaas.service.food.ProductTypeService productTypeService; + @Resource + private com.jwsaas.service.food.ProductUnitService productUnitService; + @Resource + private com.jwsaas.service.food.ProductSpecService productSpecService; + @Resource + private com.jwsaas.service.food.ProductRatioService productRatioService; + + @ServiceMethod(method = "erp.material.detail", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "从erp中获取原料信息接口") + @Override + public Object getMaterialDetailTea(MaterialDetailRequest request) { + /**** + * 原料信息 在product集合里type=10 + */ + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); // 门店ID + String info = "erp.material.detail 接口获取erp中原料信息"; + + MaterialDetailResponse response = null; + try { + response = new MaterialDetailResponse(); + + // 开放接口签名 + Map paramMap = new HashMap<>(20); + List ignoreSignParams = new ArrayList(); + // 系统级参数 + paramMap.put("appKey", PropertiesUtil.getValue(fileName, "open.api.appKey")); // 开发者必须事先通过申请获取appKey/secret后,才能进行应用的开发 + paramMap.put("method", "inventory.getInventories"); // 方法名称 + paramMap.put("v", PropertiesUtil.getValue(fileName, "open.api.version")); // 服务方法的版本号 + paramMap.put("format", PropertiesUtil.getValue(fileName, "open.api.format"));// 报文的格式,支持XML和JSON,默认JSON + paramMap.put("locale", PropertiesUtil.getValue(fileName, "open.api.locale")); // 本地化类型,默认zh_CN + paramMap.put("timestamp", String.valueOf(System.currentTimeMillis()));// 时间戳,自1970-01-01 + // 00:00:00.000起的毫秒数 + paramMap.put("client", PropertiesUtil.getValue(fileName, "open.api.client"));// 客户端类型 + // 业务参数 + // 参数签名 + String signValue = this.sign(paramMap, ignoreSignParams, PropertiesUtil.getValue(fileName, "open.api.secret")); + paramMap.put("sign", signValue); // 签名串,请求参数的签名,服务平台通过它验证请求数据的合法性 + String url = PropertiesUtil.getValue(fileName, "open.api.url"); + long startTime = System.currentTimeMillis(); + final HttpResponse hr = HttpTool.url(url).form(paramMap).post(); + long endTime = System.currentTimeMillis(); + logger.info("执行时间:{}", endTime - startTime); + final String content = HttpTool.getResponseAsString(hr); + + logger.info("调用erp接口返回的数据如下:{}", content); + int resoultCount = 0; + if (this.isSuccessful(content)) { + JSONObject object = JSON.parseObject(content); + /** + * {"inventory":[{"cInvCode":"110100007","cInvName":"干玫瑰花(代用茶)", + * "cInvStd":"1*10KG","cInvCCode":"1101008", + * "iGroupType":0,"cGroupCode":"KG","cComUnitCode":"KG", + * "cSAComUnitCode":"KG","cPUComUnitCode":"KG","cSTComUnitCode": + * "KG", + * "cCAComUnitCode":"KG","cInvDefine14":"","cInvUnitPrice":0.0, + * "cInvSL":"0.0","imaaud017":"1","cwhCode":"0.0"}]} + **/ + JSONArray ja = object.getJSONArray("inventory"); + resoultCount = ja.size(); + + // 便利erp中获取物料信息持久化到数据库中 + writeDataToDB(tenantId, ja); + } + response.setStatus(1); + response.setMessage("操作成功"); + response.setCount(resoultCount); + + } catch (Exception e) { + e.printStackTrace(); + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + + return response; + } + + /*** + * 持久化操作 + * + * @param tenantId + * @param ja + */ + private void writeDataToDB(String tenantId, JSONArray ja) throws Exception { + for (int i = 0; i < ja.size(); i++) { + JSONObject jo = ja.getJSONObject(i); + String cInvCode = jo.getString("cInvCode"); // 物料编号 + String cInvName = jo.getString("cInvName"); // 物料名称 + String cInvStd = jo.getString("cInvStd"); // 物料规格 + String cInvCCode = jo.getString("cInvCCode"); // 分类编号 + String cComUnitCode = jo.getString("cComUnitCode"); // 主计量单位编码 + // NO.1构建对象 + Product p = new Product(); + p.setTenantId(tenantId); + p.setType(10); // 原料 + p.setCreateUser("erp_pos"); + p.setNo(cInvCode); + p.setName(cInvName); + p.setSpec(cInvStd); // 规格 + p.setSpell(Pinyin4jUtil.getPinYinHeadChar(cInvName).toUpperCase()); + p.setStopFlag(0); // 是否信用 + p.setLyRate(0.00); // 联营扣率 + p.setStockFlag(1); // 管理库存 + p.setPromotionFlag(1); // 允许促销 + p.setGiveFlag(1); // 允许赠送 + p.setMebDiscountFlag(0); // 会员折上折 + p.setSuitFlag(0); // 套餐 + p.setSaleTax(0.00); // 销项税 + p.setPurchaseTax(17.00); // 进项税 + p.setPointValue(0.0); // 积分值 + p.setPointType(0); // 积分类型 + p.setLabelPrintFlag(0); // 打印标签 + p.setCurrentFlag(0); // 是否可议价 + p.setWeighFlag(0); // 是否需要称重 + p.setTapleFlag(0); // 是否主食 + p.setDiscountFlag(0); // 可折扣 + p.setCommissionValue(0.00); // 提成值 + p.setCommissionType(0); // 提成方式 + + Criteria c = new Criteria(); + c.add(Restrictions.eq("no", cInvCCode)); + List ptList = this.productTypeService.getList(tenantId, c); + if (CollectionUtils.isNotEmpty(ptList)) { + String typeId = ptList.get(0).getId(); + p.setTypeId(typeId); + } + + c = new Criteria(); + c.add(Restrictions.eq("no", cComUnitCode)); + List puList = this.productUnitService.getList(tenantId, c); + if (CollectionUtils.isNotEmpty(puList)) { + String unitId = puList.get(0).getId(); + p.setUnitId(unitId); // 单位 + } else { + logger.error("持久化失败对象数据如下:{}", JSON.toJSONString(jo)); + continue; + } + + logger.debug("持久化对象数据如下:{}", JSON.toJSONString(p)); + // 持久化操作 + + List specList = new ArrayList<>(); + // 不启用规格 + ProductSpec productSpec = new ProductSpec(); + productSpec.setTenantId(tenantId); + productSpec.setNo("0"); + productSpec.setName(p.getSpec()); + productSpec.setPrice(0D); + productSpec.setMemberPrice(0D); + productSpec.setMinPrice(0D); + productSpec.setCostPrice(0D); + productSpec.setOtherPrice(0D); + productSpec.setPurchasePrice(0D); + productSpec.setDispatchPrice(0D); + productSpec.setMaterialRate(100D); + productSpec.setCreateUser("erp_pos"); + productSpec.setIsdefault(0); + specList.add(productSpec); + this.productService.saveWithSpec(tenantId, p, specList); + } + } + + private Map getCustomerNoByStoreId(String tenantId, String storeId) throws Exception { + String sql = "select * from cy_erp_store_mapping where storeId='" + storeId + "'"; + Map maps = this.storeService.selectOne(tenantId, sql); + return maps; + } + + @ServiceMethod(method = "sync.material", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "同步原料") + @Override + public Object syncMaterial(SyncMaterialRequest request) { + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String material = request.getMaterial(); + String info = "sync.material.unit 同步原料单位"; + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + List updateList = new ArrayList<>(); + List updateSpecList = new ArrayList<>(); + List updateRatioList = new ArrayList<>(); + + List saveList = new ArrayList<>(); + List saveSpecList = new ArrayList<>(); + List saveRatioList = new ArrayList<>(); + Date nowDate = new Date(); + if (material != null && !"".equals(material)) { + JSONArray jsonUnits = new JSONArray().parseArray(material); + if (jsonUnits.size() > 200) { + response.setStatus(0); + response.setMessage("一次最多同步200条原料信息,请重新同步"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage("一次最多同步200条原料信息,请重新同步"); + return response; + } + // 第一步加载系统的所有单位 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantId", tenantId)); + List unitList = productUnitService.getList(tenantId, criteria); + Map unitMap = new HashMap<>(); + for (ProductUnit productUnit : unitList) { + unitMap.put(productUnit.getName(), productUnit); + } + // 第二部加载系统的所有分类 + criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantId", tenantId)); + criteria.add(Restrictions.eq("sign", "3")); + Map typeMap = new HashMap<>(); + List typeList = productTypeService.getList(tenantId, criteria); + for (ProductType productType : typeList) { + typeMap.put(productType.getNo(), productType); + } + + criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantId", tenantId)); + criteria.add(Restrictions.eq("deleteFlag",0)); + criteria.add(Restrictions.eq("stockFlag",1)); + criteria.add(Restrictions.eq("type",10)); + criteria.add(Restrictions.order("createDate","desc")); + criteria.add(Restrictions.limit("0","5000")); + List productList = productService.getList(tenantId, criteria); + Map productMap = new HashMap<>(); + if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(productList)){ + for(Product product : productList){ + productMap.put(product.getNo(),product); + } + } + + // 第三部组装同步数据 + for (int i = 0; i < jsonUnits.size(); i++) { + // 前台资源 + MaterialEntity materialEntity = new MaterialEntity(jsonUnits.getJSONObject(i)); + Product product = null; + if(productMap.containsKey(materialEntity.getNo())){ + product = productMap.get(materialEntity.getNo()); + }else{ + criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantId", tenantId)); + criteria.add(Restrictions.eq("deleteFlag",0)); + criteria.add(Restrictions.eq("stockFlag",1)); + criteria.add(Restrictions.eq("no", materialEntity.getNo())); + List list = productService.getList(tenantId, criteria); + if (list != null && list.size() > 0) { + product = list.get(0); + } + } + if (product != null) { + //Product product = list.get(0); + // 封装原料属性 + product.setNo(materialEntity.getNo()); + product.setName(materialEntity.getName()); + product.setSpec(materialEntity.getSpec()); + ProductType productType = typeMap.get(materialEntity.getTypeNo());// 分类属性 + if (productType != null) { + product.setTypeId(productType.getId()); + product.setTypePath(productType.getPath()); + } + ProductUnit productUnit = unitMap.get(materialEntity.getPackUnit());// 单位属性 + if (productUnit != null) { + product.setUnitId(productUnit.getId()); + }else{ + response.setStatus(0); + response.setMessage("未查询到商品("+product.getName()+")的单位,请先同步商品单位"); + return response; + } + product.setModifyDate(nowDate); + product.setModifyUser("sync"); + updateList.add(product); + // 封装规格属性 + criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantId", tenantId)); + criteria.add(Restrictions.eq("productId", product.getId())); + List specList = productSpecService.getList(tenantId, criteria); + if (specList != null && specList.size() > 0) { + ProductSpec productSpec = specList.get(0); + productSpec.setName(materialEntity.getSpec()); + productSpec.setCostPrice(materialEntity.getCostPrice()); + productSpec.setModifyDate(nowDate); + productSpec.setModifyUser("sync"); + updateSpecList.add(productSpec); + } + // 封装商品系数属性 + criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantId", tenantId)); + criteria.add(Restrictions.eq("productId", product.getId())); + List ratioList = productRatioService.getList(tenantId, criteria); + if (ratioList != null && ratioList.size() > 0) { + ProductRatio productRatio = ratioList.get(0); + ProductUnit dispatch = unitMap.get(materialEntity.getDispatchUnit());// 单位属性 + if (dispatch != null) { + productRatio.setDispatchUnitId(dispatch.getId()); + }else{ + response.setStatus(0); + response.setMessage("未查询到商品("+product.getName()+")的配送单位,请先同步商品单位"); + return response; + } + ProductUnit purchase = unitMap.get(materialEntity.getPurchaseUnit());// 单位属性 + if (purchase != null) { + productRatio.setPurchaseUnitId(purchase.getId()); + }else{ + response.setStatus(0); + response.setMessage("未查询到商品("+product.getName()+")的采购单位,请先同步商品单位"); + return response; + } + ProductUnit pack = unitMap.get(materialEntity.getPackUnit());// 单位属性 + if (pack != null) { + productRatio.setPackUnitId(pack.getId()); + productRatio.setSalesUnitId(pack.getId()); + }else{ + response.setStatus(0); + response.setMessage("未查询到商品("+product.getName()+")的门店库存单位,请先同步商品单位"); + return response; + } + productRatio.setModifyDate(nowDate); + productRatio.setModifyUser("sync"); + updateRatioList.add(productRatio); + } + } else { + // 封装原料属性 + product = new Product(); + product.setTenantId(tenantId); + ProductType productType = typeMap.get(materialEntity.getTypeNo());// 分类属性 + if (productType != null) { + product.setTypeId(productType.getId()); + product.setTypePath(productType.getPath()); + } + product.setNo(materialEntity.getNo()); + product.setName(materialEntity.getName()); + product.setSpell(Pinyin4jUtil.getPinYinHeadChar(materialEntity.getName()).toUpperCase()); + product.setShortName(materialEntity.getName()); + product.setSpec(materialEntity.getSpec()); // 规格 + ProductUnit productUnit = unitMap.get(materialEntity.getPackUnit());// 单位属性 + if (productUnit != null) { + product.setUnitId(productUnit.getId()); + }else{ + response.setStatus(0); + response.setMessage("未查询到商品("+product.getName()+")的单位,请先同步商品单位"); + return response; + } + product.setCommissionType(0); + product.setCommissionValue(0.00); + product.setDiscountFlag(0); // 可折扣 + product.setTapleFlag(0); // 是否主食 + product.setWeighFlag(0); // 是否需要称重 + product.setCurrentFlag(0); // 是否可议价 + product.setLabelPrintFlag(0); // 打印标签 + product.setSuitFlag(0); // 打印标签 + product.setMebDiscountFlag(0); // 会员折上折 + product.setGiveFlag(0); // 允许赠送 + product.setPromotionFlag(1); // 允许促销 + product.setType(10); // 原料 + product.setStockFlag(1); // 管理库存 + product.setStopFlag(0); // 是否停用 + product.setPointValue(0.0); // 积分值 + product.setPointType(0); // 积分类型 + product.setPurchaseTax(0.00); // 进项税 + product.setSaleTax(0.00); // 销项税 + product.setLyRate(0.00); // 联营扣率 + product.setDeleteFlag(0);// 是否删除 + product.setNoType(1);// 是否自动编号 + product.setZcFlag(0);// 是否允许自采 + product.setSelfFlag(0);// 是否自建商品 + product.setCreateUser("sync"); + product.setCreateDate(nowDate); + saveList.add(product); + // 封装规格属性 + ProductSpec productSpec = new ProductSpec(); + productSpec.setTenantId(tenantId); + productSpec.setNo("0"); + productSpec.setName(materialEntity.getSpec()); + productSpec.setCostPrice(materialEntity.getCostPrice()); + productSpec.setIsdefault(1); + productSpec.setDeleteFlag(0); + productSpec.setCreateUser("sync"); + productSpec.setCreateDate(nowDate); + saveSpecList.add(productSpec); + // 封装商品系数属性 + ProductRatio productRatio = new ProductRatio(); + productRatio.setTenantId(tenantId); + productRatio.setPdScale(1.00); + productRatio.setDpScale(1.00); + productRatio.setPsScale(1.00); + productRatio.setMaxStock(9999.00); + productRatio.setMinStock(0.00); + ProductUnit dispatch = unitMap.get(materialEntity.getDispatchUnit());// 单位属性 + if (dispatch != null) { + productRatio.setDispatchUnitId(dispatch.getId()); + }else{ + response.setStatus(0); + response.setMessage("未查询到商品("+product.getName()+")的配送单位,请先同步商品单位"); + return response; + } + ProductUnit purchase = unitMap.get(materialEntity.getPurchaseUnit());// 单位属性 + if (purchase != null) { + productRatio.setPurchaseUnitId(purchase.getId()); + }else{ + response.setStatus(0); + response.setMessage("未查询到商品("+product.getName()+")的采购单位,请先同步商品单位"); + return response; + } + ProductUnit pack = unitMap.get(materialEntity.getPackUnit());// 单位属性 + if (pack != null) { + productRatio.setPackUnitId(pack.getId()); + productRatio.setSalesUnitId(pack.getId()); + }else{ + response.setStatus(0); + response.setMessage("未查询到商品("+product.getName()+")的门店库存单位,请先同步商品单位"); + return response; + } + productRatio.setCreateUser("sync"); + productRatio.setCreateDate(nowDate); + saveRatioList.add(productRatio); + } + } + productService.updateProductBatch(tenantId, updateList, updateSpecList, updateRatioList, saveList, saveSpecList, saveRatioList); + } + response.setStatus(1); + response.setMessage("原料同步成功"); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/impl/PosToErpDataServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/impl/PosToErpDataServiceImpl.java new file mode 100644 index 0000000..c3e102e --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/impl/PosToErpDataServiceImpl.java @@ -0,0 +1,921 @@ +package com.jwsaas.api.boduo.erp.service.impl; + +import java.util.*; + +import javax.annotation.Resource; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.http.HttpResponse; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.jwsaas.api.boduo.erp.request.DishToErpSyncRequest; +import com.jwsaas.api.boduo.erp.request.MaterialToErpSyncRequest; +import com.jwsaas.api.boduo.erp.service.PosToErpDataService; +import com.jwsaas.api.request.product.ProductRatioRequest; +import com.jwsaas.api.request.product.ProductRequest; +import com.jwsaas.api.request.product.ProductSpecRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.response.mode.CommonPagerResponse; +import com.jwsaas.api.service.impl.ErpBaseServiceImpl; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.Product; +import com.jwsaas.entity.food.ProductRatio; +import com.jwsaas.entity.food.ProductSpec; +import com.jwsaas.entity.food.Store; +import com.jwsaas.http.HttpTool; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.pager.Pager; +import com.jwsaas.utils.AppKeyUtil; +import com.jwsaas.utils.PropertiesUtil; + +/** + * @Author:CHL + * @Date:Create in 2018/4/28 + * @Description: pos 中的数据向 erp中同步调用的接口 + */ + +@ServiceMethodBean(version = "1.0") +public class PosToErpDataServiceImpl extends ErpBaseServiceImpl implements PosToErpDataService { + private static final long serialVersionUID = -345096567692034912L; + @Resource + private com.jwsaas.service.food.ProductService productService; + @Resource + private com.jwsaas.service.food.ProductSpecService productSpecService; + + @Resource + private com.jwsaas.service.food.StoreService storeService; + + @Resource + private com.jwsaas.service.food.ProductRatioService productRatioService; + + /** + * 保存菜品向erp中同步 + * + * @param request + * @return + */ + + @ServiceMethod(method = "pos.save.dish.to.erp", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "pos中保存菜品向erp中同步接口") + @Override + public Object saveDishSyncErpDetail(DishToErpSyncRequest request) { + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String info = "pos.save.dish.to.erp-->saveDishSyncErpDetail pos中保存菜品向erp中同步接口"; + logger.info(info + "企业号:{}", tenantId); + CommonDataResponse response = new CommonDataResponse(); + // 菜品集合对像 + String dishJson = request.getDishJson(); + List ignoreSignParams = new ArrayList<>(); + // 开放接口签名 + Map paramMap = new HashMap<>(20); + // 系统级参数 + paramMap.put("appKey", PropertiesUtil.getValue(fileName, "open.api.appKey")); // 开发者必须事先通过申请获取appKey/secret后,才能进行应用的开发 + paramMap.put("method", "common.saveFinishProductInfo"); // 方法名称 + paramMap.put("v", PropertiesUtil.getValue(fileName, "open.api.version")); // 服务方法的版本号 + paramMap.put("format", PropertiesUtil.getValue(fileName, "open.api.format"));// 报文的格式,支持XML和JSON,默认JSON + paramMap.put("locale", PropertiesUtil.getValue(fileName, "open.api.locale")); // 本地化类型,默认zh_CN + paramMap.put("timestamp", String.valueOf(System.currentTimeMillis()));// 时间戳,自1970-01-01 + // 00:00:00.000起的毫秒数 + paramMap.put("client", PropertiesUtil.getValue(fileName, "open.api.client"));// 客户端类型 + // 业务参数 + logger.debug("调用接品 common.saveFinishProductInfo 传的参数如下:{}", dishJson); + paramMap.put("materialDetailJson", dishJson); + // 不需要签名的参数 + // 参数签名 + String signValue = this.sign(paramMap, ignoreSignParams, PropertiesUtil.getValue(fileName, "open.api.secret")); + paramMap.put("sign", signValue); // 签名串,请求参数的签名,服务平台通过它验证请求数据的合法性 + String url = PropertiesUtil.getValue(fileName, "open.api.url"); + long startTime = System.currentTimeMillis(); + final HttpResponse hr = HttpTool.url(url).form(paramMap).post(); + long endTime = System.currentTimeMillis(); + logger.info("执行时间:{}", endTime - startTime); + final String content = HttpTool.getResponseAsString(hr); + logger.debug("调用erp接口返回的数据如下:{}", content); + + // 返回数据成功 + if (isSuccessful(content)) { + JSONObject object = JSON.parseObject(content); + String state = object.getString("state"); + String msg = object.getString("msg"); + + // 当返回状态为1 标识操作成功 + if (StringUtils.equals("1", state)) { + List psIds = new ArrayList<>(); + JSONArray jarray = JSON.parseArray(dishJson); + for (int i = 0; i < jarray.size(); i++) { + JSONObject jo = jarray.getJSONObject(i); + String specId = jo.getString("id"); + psIds.add(specId); + } + // 根据菜单规格修改是否同步标识 + Criteria c = new Criteria(); + c.add(Restrictions.in("id", psIds)); + List dsList = null; + try { + dsList = this.productSpecService.getList(tenantId, c); + for (ProductSpec ps : dsList) { + ps.setErpSyncStatus(1); // 是否同步到erp默认不同步 + this.productSpecService.update(tenantId, ps); + } + } catch (Exception e) { + e.printStackTrace(); + } + response.setStatus(1); + response.setMessage("操作成功!"); + Map map = new HashMap<>(); + map.put("state", state); + map.put("msg", msg); + response.setData(map); + } else { + response.setErrCode("error"); + response.setErrMessage("调用erp接口返回错误信息如下:" + msg); + } // end if + } else { + response.setErrCode("error"); + response.setErrMessage("调用erp接口出错"); + } + + return response; + } + + /** + * 保存物料向erp中同步 + * + * @param request + * @return + */ + @ServiceMethod(method = "pos.save.material.to.erp", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "pos中保存原料向erp中同步接口") + @Override + public Object saveMaterialSyncErpDetail(MaterialToErpSyncRequest request) { + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String info = "pos.save.material.to.erp-->saveMaterialSyncErpDetail pos中保存原料向erp中同步接口"; + logger.info(info + "企业号:{}", tenantId); + String materialJson = request.getMatreialJson(); // 获取调用原料接口传的数据 + CommonDataResponse response = new CommonDataResponse(); + List ignoreSignParams = new ArrayList<>(); + // 开放接口签名 + Map paramMap = new HashMap<>(20); + // 系统级参数 + paramMap.put("appKey", PropertiesUtil.getValue(fileName, "open.api.appKey")); // 开发者必须事先通过申请获取appKey/secret后,才能进行应用的开发 + paramMap.put("method", "common.saveOutsourceProducts"); // 方法名称 + paramMap.put("v", PropertiesUtil.getValue(fileName, "open.api.version")); // 服务方法的版本号 + paramMap.put("format", PropertiesUtil.getValue(fileName, "open.api.format"));// 报文的格式,支持XML和JSON,默认JSON + paramMap.put("locale", PropertiesUtil.getValue(fileName, "open.api.locale")); // 本地化类型,默认zh_CN + paramMap.put("timestamp", String.valueOf(System.currentTimeMillis()));// 时间戳,自1970-01-01 + // 00:00:00.000起的毫秒数 + paramMap.put("client", PropertiesUtil.getValue(fileName, "open.api.client"));// 客户端类型 + // 业务参数 + paramMap.put("materialDetailJson", materialJson); + // 不需要签名的参数 + // 参数签名 + String signValue = this.sign(paramMap, ignoreSignParams, PropertiesUtil.getValue(fileName, "open.api.secret")); + paramMap.put("sign", signValue); // 签名串,请求参数的签名,服务平台通过它验证请求数据的合法性 + String url = PropertiesUtil.getValue(fileName, "open.api.url"); + + try { + long startTime = System.currentTimeMillis(); + final HttpResponse hr = HttpTool.url(url).form(paramMap).post(); + long endTime = System.currentTimeMillis(); + logger.info("执行时间:{}", endTime - startTime); + final String content = HttpTool.getResponseAsString(hr); + logger.debug("门店自采物料同步至erp的结果为:{}", content); + // 返回数据成功 + if (isSuccessful(content)) { + JSONObject object = JSON.parseObject(content); + String state = object.getString("state"); + String msg = object.getString("msg"); + // 当返回状态为1 标识操作成功 + if (StringUtils.equals("1", state)) { + JSONObject mdJson = JSON.parseObject(materialJson); + + String materialNo = mdJson.getString("materialNo"); + + Criteria c = new Criteria(); + c.add(Restrictions.eq("no", materialNo)); + c.add(Restrictions.eq("type", 10)); + List mdList = this.productService.getList(tenantId, c); + + if (CollectionUtils.isNotEmpty(mdList)) { + Product p = mdList.get(0); + p.setErpSyncFlag(1); // 是否同步到erp默认不同步 + this.productService.update(tenantId, p); + } + response.setStatus(1); + response.setMessage("操作成功!"); + } else { + response.setErrCode("error"); + response.setErrMessage("调用erp接口返回错误信息如下:" + msg); + + } // end if + } else { + response.setErrCode("error"); + response.setErrMessage("调用erp接口出错"); + } + } catch (Exception e) { + e.printStackTrace(); + } + + return response; + } + + @ServiceMethod(method = "boduo.product.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "商品列表(分页)") + @Override + public Object boduoProductList(ProductRequest request) { + String info = "商品列表(分页)"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + Store store = storeService.get(tenantId, request.getStoreId()); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + pager = productService.getPagerByStoreId(tenantId, request.getStoreId(), pager); + Set productIdSet = new HashSet<>(); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (Product product : source) { + if(productIdSet.contains(product.getId())){ + //System.out.println("此商品Id 重复 01 >>>>>>>>> "+product.getId()); + continue; + } + productIdSet.add(product.getId()); + + Map map = new HashMap<>(); + map.put("tenantId", product.getTenantId()); + map.put("id", product.getId()); + map.put("brandId", product.getBrandId()); + map.put("typeId", product.getTypeId()); + map.put("typePath", product.getTypePath()); + map.put("no", product.getNo()); + map.put("name", product.getName()); + map.put("spell", product.getSpell()); + map.put("assistNo", product.getAssistNo()); + map.put("barCode", product.getBarCode()); + map.put("otherNo", product.getOtherNo()); + map.put("shortName", product.getShortName()); + map.put("english", product.getEnglish()); + map.put("unitId", product.getUnitId()); + map.put("description", product.getDescription()); + map.put("commissionType", product.getCommissionType()); + map.put("commissionValue", doubleFormat(product.getCommissionType())); + map.put("discountFlag", product.getDiscountFlag()); + map.put("tapleFlag", product.getTapleFlag()); + map.put("weighFlag", product.getWeighFlag()); + map.put("currentFlag", product.getCurrentFlag()); + map.put("labelPrintFlag", product.getLabelPrintFlag()); + map.put("suitFlag", product.getSuitFlag()); + map.put("mebDiscountFlag", product.getMebDiscountFlag()); + map.put("giveFlag", product.getGiveFlag()); + map.put("promotionFlag", product.getPromotionFlag()); + map.put("type", product.getType()); + map.put("stockFlag", product.getStockFlag()); + map.put("pointType", product.getPointType()); + map.put("pointValue", doubleFormat(product.getPointValue())); + map.put("purchaseTax", doubleFormat(product.getPurchaseTax())); + map.put("saleTax", doubleFormat(product.getSaleTax())); + map.put("lyRate", doubleFormat(product.getLyRate())); + map.put("groupName", product.getGroupName()); + map.put("picture", product.getPicture()); + map.put("stopFlag", product.getStopFlag()); + map.put("price", product.getPrice()); + map.put("memberPrice", doubleFormat(product.getMemberPrice())); + map.put("otherPrice", doubleFormat(product.getOtherPrice())); + map.put("costPrice", doubleFormat(product.getCostPrice())); + map.put("purchasePrice", doubleFormat(product.getPurchasePrice())); + map.put("dispatchPrice", doubleFormat(product.getDispatchPrice())); + map.put("minPrice", doubleFormat(product.getMinPrice())); + map.put("specCount", product.getSpecCount() == null ? 1 : product.getSpecCount()); + map.put("kdsFlag", product.getKdsFlag()); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + if (pageNumber == 1 && store.getExt1() != null && !"".equals(store.getExt1())) { + // 第一步获取直营外购 + List> zyList = new ArrayList<>(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.like("typePath", "812862922350006272,812862924627513344")); + criteria.add(Restrictions.eq("deleteFlag", 0)); + List productList = productService.getList(tenantId, criteria); + if (productList != null && productList.size() > 0) { + for (Product product : productList) { + if(productIdSet.contains(product.getId())){ + //System.out.println("此商品Id 重复 02 >>>>>>>>> "+product.getId()); + continue; + } + productIdSet.add(product.getId()); + + Map map = new HashMap<>(); + map.put("tenantId", product.getTenantId()); + map.put("id", product.getId()); + map.put("brandId", product.getBrandId()); + map.put("typeId", product.getTypeId()); + map.put("typePath", product.getTypePath()); + map.put("no", product.getNo()); + map.put("name", product.getName()); + map.put("spell", product.getSpell()); + map.put("assistNo", product.getAssistNo()); + map.put("barCode", product.getBarCode()); + map.put("otherNo", product.getOtherNo()); + map.put("shortName", product.getShortName()); + map.put("english", product.getEnglish()); + map.put("unitId", product.getUnitId()); + map.put("description", product.getDescription()); + map.put("commissionType", product.getCommissionType()); + map.put("commissionValue", doubleFormat(product.getCommissionType())); + map.put("discountFlag", product.getDiscountFlag()); + map.put("tapleFlag", product.getTapleFlag()); + map.put("weighFlag", product.getWeighFlag()); + map.put("currentFlag", product.getCurrentFlag()); + map.put("labelPrintFlag", product.getLabelPrintFlag()); + map.put("suitFlag", product.getSuitFlag()); + map.put("mebDiscountFlag", product.getMebDiscountFlag()); + map.put("giveFlag", product.getGiveFlag()); + map.put("promotionFlag", product.getPromotionFlag()); + map.put("type", product.getType()); + map.put("stockFlag", product.getStockFlag()); + map.put("pointType", product.getPointType()); + map.put("pointValue", doubleFormat(product.getPointValue())); + map.put("purchaseTax", doubleFormat(product.getPurchaseTax())); + map.put("saleTax", doubleFormat(product.getSaleTax())); + map.put("lyRate", doubleFormat(product.getLyRate())); + map.put("groupName", product.getGroupName()); + map.put("picture", product.getPicture()); + map.put("stopFlag", product.getStopFlag()); + map.put("price", product.getPrice()); + map.put("memberPrice", doubleFormat(product.getMemberPrice())); + map.put("otherPrice", doubleFormat(product.getOtherPrice())); + map.put("costPrice", doubleFormat(product.getCostPrice())); + map.put("purchasePrice", doubleFormat(product.getPurchasePrice())); + map.put("dispatchPrice", doubleFormat(product.getDispatchPrice())); + map.put("minPrice", doubleFormat(product.getMinPrice())); + map.put("specCount", product.getSpecCount() == null ? 1 : product.getSpecCount()); + map.put("kdsFlag", product.getKdsFlag()); + zyList.add(map); + } + if (CollectionUtils.isNotEmpty(zyList)) { + list.addAll(zyList); + } + } + // 第二部获取要货原料 + try { + List> materialList = new ArrayList<>(); + // 开放接口签名 + Map paramMap = new HashMap<>(20); + List ignoreSignParams = new ArrayList(); + // 系统级参数 + paramMap.put("appKey", PropertiesUtil.getValue(fileName, "open.api.appKey")); // 开发者必须事先通过申请获取appKey/secret后,才能进行应用的开发 + paramMap.put("method", "common.getCustomerToPriceInfo"); // 方法名称 + paramMap.put("v", PropertiesUtil.getValue(fileName, "open.api.version")); // 服务方法的版本号 + paramMap.put("format", PropertiesUtil.getValue(fileName, "open.api.format"));// 报文的格式,支持XML和JSON,默认JSON + paramMap.put("locale", PropertiesUtil.getValue(fileName, "open.api.locale")); // 本地化类型,默认zh_CN + paramMap.put("timestamp", String.valueOf(System.currentTimeMillis()));// 时间戳,自1970-01-01 + paramMap.put("client", PropertiesUtil.getValue(fileName, "open.api.client"));// 客户端类型 + // 业务参数 + paramMap.put("cCusCode", store.getExt1()); + // 参数签名 + String signValue = this.sign(paramMap, ignoreSignParams, PropertiesUtil.getValue(fileName, "open.api.secret")); + paramMap.put("sign", signValue); // 签名串,请求参数的签名,服务平台通过它验证请求数据的合法性 + String url = PropertiesUtil.getValue(fileName, "open.api.url"); + long startTime = System.currentTimeMillis(); + final HttpResponse hr = HttpTool.url(url).form(paramMap).post(); + long endTime = System.currentTimeMillis(); + logger.info("执行时间:{}", endTime - startTime); + final String content = HttpTool.getResponseAsString(hr); + + logger.debug("调用erp接口返回的数据如下:{}", content); + + if (this.isSuccessful(content)) { + JSONObject object = JSON.parseObject(content); + JSONArray ja = object.getJSONArray("imaap"); + List nos = new ArrayList<>(); + Map noMap = new HashMap<>(); + for (int i = 0; i < ja.size(); i++) { + JSONObject jobject = ja.getJSONObject(i); + String materialNo = jobject.getString("imaa001"); + Double materialPrice = jobject.getDouble("imaa157"); + nos.add(materialNo); + noMap.put(materialNo, materialPrice); + } + if (nos != null && nos.size() > 0) { + criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantId", tenantId)); + criteria.add(Restrictions.eq("type", 10)); + criteria.add(Restrictions.in("no", nos)); + List source = productService.getList(tenantId, criteria); + for (Product product : source) { + if(productIdSet.contains(product.getId())){ + //System.out.println("此商品Id 重复 03 >>>>>>>>> "+product.getId()); + continue; + } + productIdSet.add(product.getId()); + + Map map = new HashMap<>(); + map.put("tenantId", product.getTenantId()); + map.put("id", product.getId()); + map.put("brandId", product.getBrandId()); + map.put("typeId", product.getTypeId()); + map.put("typePath", product.getTypePath()); + map.put("no", product.getNo()); + map.put("name", product.getName()); + map.put("spell", product.getSpell()); + map.put("assistNo", product.getAssistNo()); + map.put("barCode", product.getBarCode()); + map.put("otherNo", product.getOtherNo()); + map.put("shortName", product.getShortName()); + map.put("english", product.getEnglish()); + map.put("unitId", product.getUnitId()); + map.put("description", product.getDescription()); + map.put("commissionType", product.getCommissionType()); + map.put("commissionValue", doubleFormat(product.getCommissionType())); + map.put("discountFlag", product.getDiscountFlag()); + map.put("tapleFlag", product.getTapleFlag()); + map.put("weighFlag", product.getWeighFlag()); + map.put("currentFlag", product.getCurrentFlag()); + map.put("labelPrintFlag", product.getLabelPrintFlag()); + map.put("suitFlag", product.getSuitFlag()); + map.put("mebDiscountFlag", product.getMebDiscountFlag()); + map.put("giveFlag", product.getGiveFlag()); + map.put("promotionFlag", product.getPromotionFlag()); + map.put("type", product.getType()); + map.put("stockFlag", product.getStockFlag()); + map.put("pointType", product.getPointType()); + map.put("pointValue", doubleFormat(product.getPointValue())); + map.put("purchaseTax", doubleFormat(product.getPurchaseTax())); + map.put("saleTax", doubleFormat(product.getSaleTax())); + map.put("lyRate", doubleFormat(product.getLyRate())); + map.put("groupName", product.getGroupName()); + map.put("picture", product.getPicture()); + map.put("stopFlag", product.getStopFlag()); + map.put("price", product.getPrice()); + map.put("memberPrice", doubleFormat(product.getMemberPrice())); + map.put("otherPrice", doubleFormat(product.getOtherPrice())); + map.put("costPrice", doubleFormat(product.getCostPrice())); + map.put("purchasePrice", doubleFormat(product.getPurchasePrice())); + map.put("dispatchPrice", doubleFormat(noMap.get(product.getNo()))); + map.put("minPrice", doubleFormat(product.getMinPrice())); + map.put("specCount", product.getSpecCount() == null ? 1 : product.getSpecCount()); + map.put("kdsFlag", product.getKdsFlag()); + materialList.add(map); + } + } + if (CollectionUtils.isNotEmpty(materialList)) { + list.addAll(materialList); + } + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + } + } + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "boduo.product.spec", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "商品规格列表(分页)") + @Override + public Object boduoProductSpec(ProductSpecRequest request) { + String info = "商品规格列表(分页)"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + Store store = storeService.get(tenantId, request.getStoreId()); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + //pager = productSpecService.getPagerByStoreIdProduct(tenantId, request.getStoreId(), pager); + pager = productSpecService.getPagerByStoreId(tenantId, request.getStoreId(), pager); + Criteria criterias = new Criteria(); + criterias.add(Restrictions.eq("deleteFlag",1)); + List products = productService.getList(tenantId,criterias); + Set productIdSet = new HashSet<>(); + if(CollectionUtils.isNotEmpty(products)){ + for(Product p : products){ + if(!productIdSet.contains(p.getId())) { + productIdSet.add(p.getId()); + } + } + } + Set specIdsSets = new HashSet<>(); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (ProductSpec productSpec : source) { + if(specIdsSets.contains(productSpec.getId())){ + //System.out.println("此规格商品重复 01 >>>>>>>>> "+productSpec.getId()); + continue; + } + if(productIdSet.contains(productSpec.getProductId())){ + //System.out.println("此商品已删除 01 >>>>>>>>> "+productSpec.getProductId()); + continue; + } + specIdsSets.add(productSpec.getId()); + + Map map = new HashMap<>(); + map.put("tenantId", productSpec.getTenantId()); + map.put("id", productSpec.getId()); + map.put("productId", productSpec.getProductId()); + map.put("no", productSpec.getNo()); + map.put("name", productSpec.getName()); + map.put("price", doubleFormat(productSpec.getPrice())); + map.put("memberPrice", doubleFormat(productSpec.getMemberPrice())); + map.put("minPrice", doubleFormat(productSpec.getMinPrice())); + map.put("otherPrice", doubleFormat(productSpec.getOtherPrice())); + map.put("costPrice", doubleFormat(productSpec.getCostPrice())); + map.put("purchasePrice", doubleFormat(productSpec.getPurchasePrice())); + map.put("dispatchPrice", doubleFormat(productSpec.getDispatchPrice())); + map.put("materialRate", doubleFormat(productSpec.getMaterialRate())); + map.put("isdefault", productSpec.getIsdefault()); + map.put("deleteFlag", productSpec.getDeleteFlag()); + map.put("thUseLevel", doubleFormat(productSpec.getThUseLevel()));//理论万元用量 + map.put("realThUseLevel", doubleFormat(productSpec.getRealThUseLevel()));//实际万元用量 + map.put("cost", doubleFormat(productSpec.getCost()));//单项成本 + + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + if (pageNumber == 1 && store.getExt1() != null && !"".equals(store.getExt1())) { + // 第一步获取直营外购 + List> zyList = new ArrayList<>(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.like("typePath", "812862922350006272,812862924627513344")); + criteria.add(Restrictions.eq("deleteFlag", 0)); + List productList = productService.getList(tenantId, criteria); + if (productList != null && productList.size() > 0) { + List productIds = new ArrayList<>(); + for (Product product : productList) { + productIds.add(product.getId()); + } + if (productIds != null && productIds.size() > 0) { + criteria = new Criteria(); + criteria.add(Restrictions.in("productId", productIds)); + List specList = productSpecService.getList(tenantId, criteria); + if (specList != null && specList.size() > 0) { + for (ProductSpec productSpec : specList) { + if(specIdsSets.contains(productSpec.getId())){ + //System.out.println("此规格商品重复 02 >>>>>>>>> "+productSpec.getId()); + continue; + } + if(productIdSet.contains(productSpec.getProductId())){ + //System.out.println("此商品已删除 02 >>>>>>>>> "+productSpec.getProductId()); + continue; + } + specIdsSets.add(productSpec.getId()); + + Map map = new HashMap<>(); + map.put("tenantId", productSpec.getTenantId()); + map.put("id", productSpec.getId()); + map.put("productId", productSpec.getProductId()); + map.put("no", productSpec.getNo()); + map.put("name", productSpec.getName()); + map.put("price", doubleFormat(productSpec.getPrice())); + map.put("memberPrice", doubleFormat(productSpec.getMemberPrice())); + map.put("minPrice", doubleFormat(productSpec.getMinPrice())); + map.put("otherPrice", doubleFormat(productSpec.getOtherPrice())); + map.put("costPrice", doubleFormat(productSpec.getCostPrice())); + map.put("purchasePrice", doubleFormat(productSpec.getPurchasePrice())); + map.put("dispatchPrice", doubleFormat(productSpec.getDispatchPrice())); + map.put("materialRate", doubleFormat(productSpec.getMaterialRate())); + map.put("isdefault", productSpec.getIsdefault()); + map.put("deleteFlag", productSpec.getDeleteFlag()); + map.put("thUseLevel", doubleFormat(productSpec.getThUseLevel()));//理论万元用量 + map.put("realThUseLevel", doubleFormat(productSpec.getRealThUseLevel()));//实际万元用量 + map.put("cost", doubleFormat(productSpec.getCost()));//单项成本 + zyList.add(map); + } + } + } + if (CollectionUtils.isNotEmpty(zyList)) { + list.addAll(zyList); + } + } + try { + // 第二部获取原料资料 + List> materialList = new ArrayList<>(); + // 开放接口签名 + Map paramMap = new HashMap<>(20); + List ignoreSignParams = new ArrayList(); + // 系统级参数 + paramMap.put("appKey", PropertiesUtil.getValue(fileName, "open.api.appKey")); // 开发者必须事先通过申请获取appKey/secret后,才能进行应用的开发 + paramMap.put("method", "common.getCustomerToPriceInfo"); // 方法名称 + paramMap.put("v", PropertiesUtil.getValue(fileName, "open.api.version")); // 服务方法的版本号 + paramMap.put("format", PropertiesUtil.getValue(fileName, "open.api.format"));// 报文的格式,支持XML和JSON,默认JSON + paramMap.put("locale", PropertiesUtil.getValue(fileName, "open.api.locale")); // 本地化类型,默认zh_CN + paramMap.put("timestamp", String.valueOf(System.currentTimeMillis()));// 时间戳,自1970-01-01 + paramMap.put("client", PropertiesUtil.getValue(fileName, "open.api.client"));// 客户端类型 + // 业务参数 + paramMap.put("cCusCode", store.getExt1()); + // 参数签名 + String signValue = this.sign(paramMap, ignoreSignParams, PropertiesUtil.getValue(fileName, "open.api.secret")); + paramMap.put("sign", signValue); // 签名串,请求参数的签名,服务平台通过它验证请求数据的合法性 + String url = PropertiesUtil.getValue(fileName, "open.api.url"); + long startTime = System.currentTimeMillis(); + final HttpResponse hr = HttpTool.url(url).form(paramMap).post(); + long endTime = System.currentTimeMillis(); + logger.info("执行时间:{}", endTime - startTime); + final String content = HttpTool.getResponseAsString(hr); + + logger.debug("调用erp接口返回的数据如下:{}", content); + if (this.isSuccessful(content)) { + JSONObject object = JSON.parseObject(content); + JSONArray ja = object.getJSONArray("imaap"); + List nos = new ArrayList<>(); + Map noMap = new HashMap<>(); + for (int i = 0; i < ja.size(); i++) { + JSONObject jobject = ja.getJSONObject(i); + String materialNo = jobject.getString("imaa001"); + Double materialPrice = jobject.getDouble("imaa157"); + nos.add(materialNo); + noMap.put(materialNo, materialPrice); + } + if (nos != null && nos.size() > 0) { + criteria = new Criteria(); + criteria.add(Restrictions.eq("p.tenantId", tenantId)); + criteria.add(Restrictions.eq("p.type", 10)); + criteria.add(Restrictions.in("p.no", nos)); + List source = productSpecService.getListWithProduct(tenantId, criteria); + for (ProductSpec productSpec : source) { + if(specIdsSets.contains(productSpec.getId())){ + //System.out.println("此规格商品重复 03 >>>>>>>>> "+productSpec.getId()); + continue; + } + if(productIdSet.contains(productSpec.getProductId())){ + //System.out.println("此商品已删除 03 >>>>>>>>> "+productSpec.getProductId()); + continue; + } + specIdsSets.add(productSpec.getId()); + + Map map = new HashMap<>(); + map.put("tenantId", productSpec.getTenantId()); + map.put("id", productSpec.getId()); + map.put("productId", productSpec.getProductId()); + map.put("no", productSpec.getNo()); + map.put("name", productSpec.getName()); + map.put("price", doubleFormat(productSpec.getPrice())); + map.put("memberPrice", doubleFormat(productSpec.getMemberPrice())); + map.put("minPrice", doubleFormat(productSpec.getMinPrice())); + map.put("otherPrice", doubleFormat(productSpec.getOtherPrice())); + map.put("costPrice", doubleFormat(productSpec.getCostPrice())); + map.put("purchasePrice", doubleFormat(productSpec.getPurchasePrice())); + map.put("dispatchPrice", doubleFormat(noMap.get(productSpec.getProductNo()))); + map.put("materialRate", doubleFormat(productSpec.getMaterialRate())); + map.put("isdefault", productSpec.getIsdefault()); + map.put("deleteFlag", productSpec.getDeleteFlag()); + map.put("thUseLevel", doubleFormat(productSpec.getThUseLevel()));//理论万元用量 + map.put("realThUseLevel", doubleFormat(productSpec.getRealThUseLevel()));//实际万元用量 + map.put("cost", doubleFormat(productSpec.getCost()));//单项成本 + materialList.add(map); + } + } + if (CollectionUtils.isNotEmpty(materialList)) { + list.addAll(materialList); + } + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + } + } + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "boduo.product.ratio", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "商品库存系统(分页)") + @Override + public Object boduoProductRatio(ProductRatioRequest request) { + String info = "商品库存系统(分页)"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + Store store = storeService.get(tenantId, request.getStoreId()); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + //pager = productRatioService.getPagerByStoreIdProduct(tenantId, request.getStoreId(), pager); + pager = productRatioService.getPagerByStoreId(tenantId, request.getStoreId(), pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (ProductRatio productRatio : source) { + Map map = new HashMap<>(); + map.put("tenantId", productRatio.getTenantId()); + map.put("id", productRatio.getId()); + map.put("productId", productRatio.getProductId()); + map.put("dispatchUnitId", productRatio.getDispatchUnitId()); + map.put("purchaseUnitId", productRatio.getPurchaseUnitId()); + map.put("pdScale", doubleFormat(productRatio.getPdScale())); + map.put("packUnitId", productRatio.getPackUnitId()); + map.put("dpScale", doubleFormat(productRatio.getDpScale())); + map.put("salesUnitId", productRatio.getSalesUnitId()); + map.put("psScale", doubleFormat(productRatio.getPsScale())); + map.put("maxStock", doubleFormat(productRatio.getMaxStock())); + map.put("minStock", doubleFormat(productRatio.getMinStock())); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + if (pageNumber == 1 && store.getExt1() != null && !"".equals(store.getExt1())) { + // 第一步获取直营外购 + List> zyList = new ArrayList<>(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.like("typePath", "812862922350006272,812862924627513344")); + criteria.add(Restrictions.eq("deleteFlag", 0)); + List productList = productService.getList(tenantId, criteria); + if (productList != null && productList.size() > 0) { + List productIds = new ArrayList<>(); + for (Product product : productList) { + productIds.add(product.getId()); + } + if (productIds != null && productIds.size() > 0) { + criteria = new Criteria(); + criteria.add(Restrictions.in("productId", productIds)); + List ratioList = productRatioService.getList(tenantId, criteria); + if (ratioList != null && ratioList.size() > 0) { + for (ProductRatio productRatio : ratioList) { + Map map = new HashMap<>(); + map.put("tenantId", productRatio.getTenantId()); + map.put("id", productRatio.getId()); + map.put("productId", productRatio.getProductId()); + map.put("dispatchUnitId", productRatio.getDispatchUnitId()); + map.put("purchaseUnitId", productRatio.getPurchaseUnitId()); + map.put("pdScale", doubleFormat(productRatio.getPdScale())); + map.put("packUnitId", productRatio.getPackUnitId()); + map.put("dpScale", doubleFormat(productRatio.getDpScale())); + map.put("salesUnitId", productRatio.getSalesUnitId()); + map.put("psScale", doubleFormat(productRatio.getPsScale())); + map.put("maxStock", doubleFormat(productRatio.getMaxStock())); + map.put("minStock", doubleFormat(productRatio.getMinStock())); + zyList.add(map); + } + } + } + if (CollectionUtils.isNotEmpty(zyList)) { + list.addAll(zyList); + } + } + try { + // 第二部获取原料资料 + List> materialList = new ArrayList<>(); + // 开放接口签名 + Map paramMap = new HashMap<>(20); + List ignoreSignParams = new ArrayList(); + // 系统级参数 + paramMap.put("appKey", PropertiesUtil.getValue(fileName, "open.api.appKey")); // 开发者必须事先通过申请获取appKey/secret后,才能进行应用的开发 + paramMap.put("method", "common.getCustomerToPriceInfo"); // 方法名称 + paramMap.put("v", PropertiesUtil.getValue(fileName, "open.api.version")); // 服务方法的版本号 + paramMap.put("format", PropertiesUtil.getValue(fileName, "open.api.format"));// 报文的格式,支持XML和JSON,默认JSON + paramMap.put("locale", PropertiesUtil.getValue(fileName, "open.api.locale")); // 本地化类型,默认zh_CN + paramMap.put("timestamp", String.valueOf(System.currentTimeMillis()));// 时间戳,自1970-01-01 + paramMap.put("client", PropertiesUtil.getValue(fileName, "open.api.client"));// 客户端类型 + // 业务参数 + paramMap.put("cCusCode", store.getExt1()); + // 参数签名 + String signValue = this.sign(paramMap, ignoreSignParams, PropertiesUtil.getValue(fileName, "open.api.secret")); + paramMap.put("sign", signValue); // 签名串,请求参数的签名,服务平台通过它验证请求数据的合法性 + String url = PropertiesUtil.getValue(fileName, "open.api.url"); + long startTime = System.currentTimeMillis(); + final HttpResponse hr = HttpTool.url(url).form(paramMap).post(); + long endTime = System.currentTimeMillis(); + logger.info("执行时间:{}", endTime - startTime); + final String content = HttpTool.getResponseAsString(hr); + + if (this.isSuccessful(content)) { + JSONObject object = JSON.parseObject(content); + JSONArray ja = object.getJSONArray("imaap"); + List nos = new ArrayList<>(); + Map noMap = new HashMap<>(); + for (int i = 0; i < ja.size(); i++) { + JSONObject jobject = ja.getJSONObject(i); + String materialNo = jobject.getString("imaa001"); + Double materialPrice = jobject.getDouble("imaa157"); + nos.add(materialNo); + noMap.put(materialNo, materialPrice); + } + if (nos != null && nos.size() > 0) { + criteria = new Criteria(); + criteria.add(Restrictions.eq("p.tenantId", tenantId)); + criteria.add(Restrictions.eq("p.type", 10)); + criteria.add(Restrictions.in("p.no", nos)); + List source = productRatioService.getListWithProduct(tenantId, criteria, false); + for (ProductRatio productRatio : source) { + Map map = new HashMap<>(); + map.put("tenantId", productRatio.getTenantId()); + map.put("id", productRatio.getId()); + map.put("productId", productRatio.getProductId()); + map.put("dispatchUnitId", productRatio.getDispatchUnitId()); + map.put("purchaseUnitId", productRatio.getPurchaseUnitId()); + map.put("pdScale", doubleFormat(productRatio.getPdScale())); + map.put("packUnitId", productRatio.getPackUnitId()); + map.put("dpScale", doubleFormat(productRatio.getDpScale())); + map.put("salesUnitId", productRatio.getSalesUnitId()); + map.put("psScale", doubleFormat(productRatio.getPsScale())); + map.put("maxStock", doubleFormat(productRatio.getMaxStock())); + map.put("minStock", doubleFormat(productRatio.getMinStock())); + materialList.add(map); + } + } + if (CollectionUtils.isNotEmpty(materialList)) { + list.addAll(materialList); + } + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + } + } + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/impl/StoreAskMaterialSyncServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/impl/StoreAskMaterialSyncServiceImpl.java new file mode 100644 index 0000000..9793f4e --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/boduo/erp/service/impl/StoreAskMaterialSyncServiceImpl.java @@ -0,0 +1,233 @@ +package com.jwsaas.api.boduo.erp.service.impl; + +import com.alibaba.dubbo.common.utils.CollectionUtils; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.jwsaas.api.boduo.erp.request.ErpStoreAskMaterialRequest; +import com.jwsaas.api.boduo.erp.request.StoreAskMaterialSyncRequest; +import com.jwsaas.api.boduo.erp.response.DeliveryModeListResponse; +import com.jwsaas.api.boduo.erp.response.StoreAskMaterialSyncResponse; +import com.jwsaas.api.boduo.erp.service.StoreAskMaterialSyncService; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.service.impl.ErpBaseServiceImpl; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.Product; +import com.jwsaas.entity.food.ProductSpec; +import com.jwsaas.entity.food.Store; +import com.jwsaas.entity.food.StoreProduct; +import com.jwsaas.http.HttpTool; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.util.StringUtils; +import com.jwsaas.utils.AppKeyUtil; +import com.jwsaas.utils.PropertiesUtil; +import org.apache.http.HttpResponse; + +import javax.annotation.Resource; +import java.util.*; + +/** + * @Author:CHL + * @Date:Create in 2018/3/22 + * @Description:获取门店允许要货物料信息 + */ + +@ServiceMethodBean(version = "1.0") +public class StoreAskMaterialSyncServiceImpl extends ErpBaseServiceImpl implements StoreAskMaterialSyncService { + private static final long serialVersionUID = -345096567692034912L; + + @Resource + private com.jwsaas.service.food.StoreService storeService; + @Resource + private com.jwsaas.service.food.ProductService productService; + @Resource + private com.jwsaas.service.food.ProductSpecService productSpecService; + @Resource + private com.jwsaas.service.food.StoreProductService storeProductService; + + //接口获取erp中获取门店允许要货的物料信息 + @ServiceMethod(method = "erp.store.ask.material.sync", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "从erp中获取门店允许要货的物料信息") + @Override + public Object getAskMaterialSync(StoreAskMaterialSyncRequest request) { + String appKey = request.getWopRequestContext().getAppKey(); + //NO.1 获取应用参数 + + String storeId = request.getStoreId(); //门店ID + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String info = "erp.store.ask.material.sync-->getAskMaterialSync 接口获取erp中获取门店允许要货的物料信息"; + logger.info(info+"企业号:{}",tenantId); + StoreAskMaterialSyncResponse response = null; + try { + response = new StoreAskMaterialSyncResponse(); + String cCusCode = ""; + Store s = this.storeService.get(tenantId,storeId); + if(s==null){ + response.setErrCode("error"); + response.setMessage("操作失败"); + response.setCount(0); + return response; + } + cCusCode = s.getExt1(); // 扩展信息 + if(StringUtils.isEmpty(cCusCode)){ + response.setErrCode("error"); + response.setMessage("请先编辑门店信息中的扩展信息,对应erp中的客户编号"); + response.setCount(0); + return response; + } + // 开放接口签名 + Map paramMap = new HashMap<>(20); + List ignoreSignParams = new ArrayList(); + // 系统级参数 + paramMap.put("appKey", PropertiesUtil.getValue(fileName, "open.api.appKey")); //开发者必须事先通过申请获取appKey/secret后,才能进行应用的开发 + paramMap.put("method", "common.getCustomerToPriceInfo"); //方法名称 + paramMap.put("v", PropertiesUtil.getValue(fileName, "open.api.version")); //服务方法的版本号 + paramMap.put("format", PropertiesUtil.getValue(fileName, "open.api.format"));//报文的格式,支持XML和JSON,默认JSON + paramMap.put("locale", PropertiesUtil.getValue(fileName, "open.api.locale")); //本地化类型,默认zh_CN + paramMap.put("timestamp", String.valueOf(System.currentTimeMillis()));//时间戳,自1970-01-01 00:00:00.000起的毫秒数 + paramMap.put("client", PropertiesUtil.getValue(fileName, "open.api.client"));//客户端类型 + // 业务参数 + paramMap.put("cCusCode",cCusCode); + // 参数签名 + String signValue = this.sign(paramMap, ignoreSignParams,PropertiesUtil.getValue(fileName,"open.api.secret")); + paramMap.put("sign",signValue); //签名串,请求参数的签名,服务平台通过它验证请求数据的合法性 + String url=PropertiesUtil.getValue(fileName,"open.api.url"); + long startTime = System.currentTimeMillis(); + final HttpResponse hr = HttpTool.url(url).form(paramMap).post(); + long endTime = System.currentTimeMillis(); + logger.info("执行时间:{}",endTime-startTime); + final String content = HttpTool.getResponseAsString(hr); + + logger.debug("调用erp接口返回的数据如下:{}",content); + + if(this.isSuccessful(content)){ + JSONObject object = JSON.parseObject(content); + JSONArray ja = object.getJSONArray("imaap"); + for (int i =0 ;i common.getCustomerToPriceInfo获取门店原料信息失败"); + response.setCount(0); + } + } catch (Exception e) { + e.printStackTrace(); + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + private void writeDataToDB(String tenantId, String materialNo, Double materialPrice,String storeId) throws Exception { + Criteria c = new Criteria(); + c.add(Restrictions.eq("no",materialNo)); + c.add(Restrictions.eq("type",10)); + List pList = this.productService.getList(tenantId,c); + for(Product p :pList){ + String pId = p.getId(); + c = new Criteria(); + c.add(Restrictions.eq("storeId",storeId)); + c.add(Restrictions.eq("productId",pId)); + List spList = this.storeProductService.getList(tenantId,c); + if(CollectionUtils.isNotEmpty(spList)){ + logger.warn("门店允许要货原料ID:{}",pId); + break; + } + String pTypeId = p.getTypeId(); + String pTypePatch = p.getTypePath(); + String pUnitId = p.getUnitId(); + c = new Criteria(); + c.add(Restrictions.eq("productId",pId)); + List psList = this.productSpecService.getList(tenantId,c); + if(CollectionUtils.isNotEmpty(psList)) { + ProductSpec ps = psList.get(0); + + StoreProduct sp = new StoreProduct(); + sp.setTenantId(tenantId); + sp.setStoreId(storeId); + sp.setProductId(pId); + sp.setSpecId(ps.getId()); + sp.setProductUnitId(pUnitId); + sp.setTypeId(pTypeId); + sp.setTypePath(pTypePatch); + sp.setPrice(0.0); + sp.setMinPrice(0.0); + sp.setMemberPrice(0.0); + sp.setOtherPrice(0.0); + sp.setCostPrice(0.0); + sp.setPurchasePrice(0.0); + sp.setDispatchPrice(materialPrice); + sp.setCreateUser("erp_pos"); + sp.setCreateDate(new Date()); + + StoreProduct spdb = this.storeProductService.save(tenantId,sp); + + logger.debug("持久化数据如下:{}",JSON.toJSONString(spdb)); + } + } + } + + //erp当门店要货物料发生改变后向pos这边推送的数据接口 + @ServiceMethod(method = "erp.save.store.ask.material", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "erp门店要货物料发生改变后向pos这边推送的数据接口") + @Override + public Object getErpStoreAskMaterial(ErpStoreAskMaterialRequest request) { + String appKey = request.getWopRequestContext().getAppKey(); + //NO.1 获取应用参数 + String customerNo = request.getCustomerNo(); //门店erp编号信息 + String materialPrices = request.getMatePriceJson(); //门店物料与价格的对应map格式的json + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String info = "erp.save.store.ask.material-->getErpStoreAskMaterial erp当门店要货物料发生改变后向pos这边推送的数据接口"; + logger.info(info+"企业号:{}",tenantId); + StoreAskMaterialSyncResponse response = null; + try { + response= new StoreAskMaterialSyncResponse(); + Criteria c = new Criteria(); + c.add(Restrictions.eq("ext1",customerNo)); + List storeList = this.storeService.getList(tenantId,c); + if(CollectionUtils.isEmpty(storeList)){ + response.setErrCode("error"); + response.setErrMessage("没有查询到客户编号为:"+customerNo+"指定的门店"); + } + Store s = storeList.get(0); + + JSONArray ja = JSONArray.parseArray(materialPrices); + for (int i =0 ;isaveV1PosDishToV2Detail 接口从v1门店销售数据同步到v2"; + logger.info(info+"企业号:{}",tenantId); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + String storeNoAr [] = StringUtils.split(storeNos,","); + //NO.2 遍历每个升级的门店编号 + int hasNotStore =0; // 不存在的门店 + int syncStore=0; // 已同步的门店 + int syncDishCount=0; //同步数据条数 + + for(String storeNo:storeNoAr){ + //NO.3 获取门店信息 + Criteria c = new Criteria(); + c.add(Restrictions.eq("no",storeNo)); + List storeList = this.storeService.getList(tenantId,c); + if(CollectionUtils.isEmpty(storeList)){ + hasNotStore++; + logger.info("此门店:{}在v2系统中不存在",storeNo); + continue; + } + + Store s = storeList.get(0); + String storeId = s.getId(); + + String thirdNo = s.getThirdNo(); // v1门店编号 + if (StringUtils.isEmpty(thirdNo)) { + logger.debug("v2门店信息里没有设置第三方编号"); + continue; + } + //NO.4 获取门店销售商品信息 + c= new Criteria(); + c.add(Restrictions.eq("csp.storeId",storeId)); + //销售的商品类型 + c.add(Restrictions.eq("cp.type",0)); + + List storeProductList = this.storeProductService.getSyncStoreDishList(tenantId,c); + + if(CollectionUtils.isNotEmpty(storeProductList)){ + syncStore++; + logger.debug("此门店:{}在v2系统中不存在",storeNo); + continue; + } + + //NO.5 调用数据同步接口 + List ignoreSignParams = new ArrayList<>(); + // 开放接口签名 + Map paramMap = new HashMap<>(20); + int pageNumber = 1; + paramMap.put("appKey", "00001"); //开发者必须事先通过申请获取appKey/secret后,才能进行应用的开发 + paramMap.put("method","sync.store.dish"); //方法名称 + paramMap.put("v","1.0"); //服务方法的版本号 + paramMap.put("format","json");//报文的格式,支持XML和JSON,默认JSON + paramMap.put("locale","zh_CN"); //本地化类型,默认zh_CN + paramMap.put("timestamp",String.valueOf(System.currentTimeMillis()));//时间戳,自1970-01-01 00:00:00.000起的毫秒数 + paramMap.put("client","weixin");//客户端类型 + // 业务参数 + paramMap.put("tenantId",v1tenantId); + paramMap.put("storeNo",thirdNo); + ignoreSignParams.add("storeNo"); + // 参数签名 + String signValue = this.sign(paramMap, ignoreSignParams,"abcdeabcdeabcdeabcdeabcde"); + paramMap.put("sign",signValue); //签名串,请求参数的签名,服务平台通过它验证请求数据的合法性 + paramMap.put("pageNumber",pageNumber); + paramMap.put("pageSize",20); + String url="http://s1.boduogroup.com:8088/open-web/api"; + long startTime = System.currentTimeMillis(); + final HttpResponse hr = HttpTool.url(url).form(paramMap).post(); + long endTime = System.currentTimeMillis(); + logger.info("执行时间:{}",endTime-startTime); + final String content = HttpTool.getResponseAsString(hr); + logger.debug("调用接口返回的数据如下:{}",content); + + if(!isSuccessful(content)){ + response.setErrCode("error"); + response.setErrMessage("获取门店要销售商品同步接口失败"); + return response; + } + + JSONObject jo = JSON.parseObject(content); //把返回的数据转成json + //返回数据的状态 + Integer status = jo.getInteger("status"); + String message = jo.getString("message"); + if(status!=1 ){ + message = jo.getString("errMessage"); + response.setErrCode("error"); + response.setErrMessage("获取门店要销售商品同步接口失败" + message); + return response; + } + Integer pageCount = jo.getInteger("pageCount");// 总页数 + List products = new ArrayList<>(); + while(pageNumber<=pageCount){ + JSONArray obja = jo.getJSONArray("list"); + if(CollectionUtils.isEmpty(obja)){ + response.setErrCode("error"); + response.setErrMessage("没有查询到数据,同步失败"); + return response; + } + for(int ii =0;ii map = (Map) obja.get(ii); + //v1同步过来的菜品信息 + String v1dishNo = map.get("dishNo")+""; //菜品编号 + String v1specName = map.get("specName")+""; //规格名称 + Double v1price = Double.parseDouble(map.get("price")== null?"0":map.get("price")+""); //门店价格 + Double v1MemberPrice = Double.parseDouble(map.get("memberPrice")== null?"0":map.get("memberPrice")+""); //门店会员价格 + //根据销售商品的编号规格查询商品 + List specMap = getProductSpecByDishNoSpecName(tenantId,v1dishNo,v1specName); + if(CollectionUtils.isEmpty(specMap)){ + continue; + } + + StoreProduct product = new StoreProduct(); + product.setTenantId(tenantId); + product.setCreateDate(new Date()); + product.setCreateUser("sync_pos"); + product.setStoreId(s.getId()); + ProductSpec spec = specMap.get(0); + product.setProductId(spec.getProductId()); + product.setSpecId(spec.getId()); + product.setProductUnitId(spec.getUnitId()); + product.setTypeId(spec.getTypeId()); + product.setTypePath(spec.getTypePath()); + /* product.setPrice(spec.getPrice()); + product.setMemberPrice(spec.getMemberPrice());*/ + //这点有点吭取的是门店获取的价格 + product.setPrice(v1price); + product.setMemberPrice(v1MemberPrice); + products.add(product); + } + + pageNumber++; + paramMap.put("pageNumber",pageNumber); + paramMap.put("pageSize",20); + final HttpResponse hr1 = HttpTool.url(url).form(paramMap).post(); + logger.info("执行时间:{}",endTime-startTime); + final String content1 = HttpTool.getResponseAsString(hr1); + jo = JSON.parseObject(content1); + } + + if(CollectionUtils.isNotEmpty(products)){ + storeProductService.save(tenantId,products); + syncDishCount +=products.size(); + } + + } + + //NO.6 构建返回数据并返回 + Map map = new HashMap<>(); + map.put("hasNotStore",hasNotStore); // 不存在的门店 + map.put("syncStore",syncStore); // 已同步的门店 + map.put("syncDishCount",syncDishCount);//同步数据条数 + response.setStatus(0); + response.setMessage("同步成功"); + response.setData(map); + } catch (Exception e) { + e.printStackTrace(); + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + + private List getProductSpecByDishNoSpecName(String tenantId,String dishNo,String specName){ + String info = "根据商品编号与规格名称获取信息"; + logger.debug(info); + List list = new ArrayList<>(); + try { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("cp.tenantId",tenantId)); + criteria.add(Restrictions.eq("cp.type",0)); + criteria.add(Restrictions.eq("cp.deleteFlag",0)); + criteria.add(Restrictions.eq("cp.`no`",dishNo)); + criteria.add(Restrictions.eq("cps.name",specName)); + list = this.productSpecService.getProductSpecByDishNoSpecName(tenantId,criteria); + + }catch (Exception e){ + logger.error(info + "时,发生异常", e); + } + return list; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/pos/MaterialEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/pos/MaterialEntity.java new file mode 100644 index 0000000..49f8f04 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/pos/MaterialEntity.java @@ -0,0 +1,118 @@ +package com.jwsaas.api.entity.pos; + +import java.io.Serializable; + +import com.alibaba.fastjson.JSONObject; + +public class MaterialEntity implements Serializable { + + /** + * + */ + private static final long serialVersionUID = -3489356718972226084L; + + private String no;// erp原料编号 + + private String name;// erp原料名称 + + private String spec;// erp原料规格名称 + + private String typeNo;// erp原料分类编号 + + private String purchaseUnit;// erp采购单位编号 + + private String dispatchUnit;// erp配送单位编号 + + private String packUnit;// erp销售单位编号 + + private double costPrice;// erp原料价格 + + + public MaterialEntity() { + + } + + public MaterialEntity(JSONObject json) { + if (json.containsKey("no")) + no = json.getString("no");// erp分类编号 + if (json.containsKey("name")) + name = json.getString("name");// erp分类名称 + if (json.containsKey("spec")) + spec = json.getString("spec");// erp原料规格名称 + if (json.containsKey("typeNo")) + typeNo = json.getString("typeNo");// erp原料分类编号 + if (json.containsKey("purchaseUnit")) + purchaseUnit = json.getString("purchaseUnit");// erp采购单位编号 + if (json.containsKey("dispatchUnit")) + dispatchUnit = json.getString("dispatchUnit");// erp配送单位编号 + if (json.containsKey("packUnit")) + packUnit = json.getString("packUnit");// erp销售单位编号 + if (json.containsKey("costPrice")) + costPrice = json.getDoubleValue("costPrice");// erp原料价格 + } + + public String getNo() { + return no; + } + + public void setNo(String no) { + this.no = no; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getSpec() { + return spec; + } + + public void setSpec(String spec) { + this.spec = spec; + } + + public String getTypeNo() { + return typeNo; + } + + public void setTypeNo(String typeNo) { + this.typeNo = typeNo; + } + + public void setCostPrice(double costPrice) { + this.costPrice = costPrice; + } + + public String getPurchaseUnit() { + return purchaseUnit; + } + + public void setPurchaseUnit(String purchaseUnit) { + this.purchaseUnit = purchaseUnit; + } + + public String getDispatchUnit() { + return dispatchUnit; + } + + public void setDispatchUnit(String dispatchUnit) { + this.dispatchUnit = dispatchUnit; + } + + public String getPackUnit() { + return packUnit; + } + + public void setPackUnit(String packUnit) { + this.packUnit = packUnit; + } + + public double getCostPrice() { + return costPrice; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/pos/MaterialInfo.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/pos/MaterialInfo.java new file mode 100644 index 0000000..0c9f2e3 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/pos/MaterialInfo.java @@ -0,0 +1,66 @@ +package com.jwsaas.api.entity.pos; + +import com.alibaba.fastjson.JSONObject; + +import java.io.Serializable; + +/** + * Created by Administrator on 2019\9\25 0025. + */ +public class MaterialInfo implements Serializable { + + private static final long serialVersionUID = 6716085843120385605L; + + private String productNo; + private Double amount; + private Double price; + private String description; + + + public MaterialInfo() { + } + + + public MaterialInfo(JSONObject json) { + if (json.containsKey("productNo")) + productNo = json.getString("productNo"); + if (json.containsKey("amount")) + amount = json.getDouble("amount"); + if (json.containsKey("price")) + price = json.getDouble("price"); + if (json.containsKey("description")) + description = json.getString("description"); + } + + public String getProductNo() { + return productNo; + } + + public void setProductNo(String productNo) { + this.productNo = productNo; + } + + public Double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + + public Double getPrice() { + return price; + } + + public void setPrice(Double price) { + this.price = price; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/pos/MaterialTypeEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/pos/MaterialTypeEntity.java new file mode 100644 index 0000000..43da335 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/pos/MaterialTypeEntity.java @@ -0,0 +1,56 @@ +package com.jwsaas.api.entity.pos; + +import java.io.Serializable; + +import com.alibaba.fastjson.JSONObject; + +public class MaterialTypeEntity implements Serializable { + + /** + * + */ + private static final long serialVersionUID = -3489356718972226084L; + + private String no;// erp分类编号 + + private String name;// erp分类名称 + + private String parentNo;// 父分类编号 + + public MaterialTypeEntity() { + + } + + public MaterialTypeEntity(JSONObject json) { + if (json.containsKey("no")) + no = json.getString("no");// erp分类编号 + if (json.containsKey("name")) + name = json.getString("name");// erp分类名称 + if (json.containsKey("parentNo")) + parentNo = json.getString("parentNo");// erp父分类编号 + } + + public String getNo() { + return no; + } + + public void setNo(String no) { + this.no = no; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getParentNo() { + return parentNo; + } + + public void setParentNo(String parentNo) { + this.parentNo = parentNo; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/pos/MaterialUnitEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/pos/MaterialUnitEntity.java new file mode 100644 index 0000000..7aef277 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/pos/MaterialUnitEntity.java @@ -0,0 +1,45 @@ +package com.jwsaas.api.entity.pos; + +import java.io.Serializable; + +import com.alibaba.fastjson.JSONObject; + +public class MaterialUnitEntity implements Serializable { + + /** + * + */ + private static final long serialVersionUID = -8436955093744482319L; + + private String no;// erp单位编号 + + private String name;// erp单位名称 + + public MaterialUnitEntity() { + + } + + public MaterialUnitEntity(JSONObject json) { + if (json.containsKey("no")) + no = json.getString("no");// erp单位编号 + if (json.containsKey("name")) + name = json.getString("name");// erp单位名称 + } + + public String getNo() { + return no; + } + + public void setNo(String no) { + this.no = no; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/pos/PosSetConfigEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/pos/PosSetConfigEntity.java new file mode 100644 index 0000000..25f6c35 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/pos/PosSetConfigEntity.java @@ -0,0 +1,67 @@ +package com.jwsaas.api.entity.pos; + +import java.io.Serializable; + +import com.alibaba.fastjson.JSONObject; + +public class PosSetConfigEntity implements Serializable { + + private static final long serialVersionUID = 6085891294284274775L; + + private String id;//前台ID + + private String group;//资源组 + + private String keys;//设置键 + + private String values;//设置值 + + + public PosSetConfigEntity() { + + } + + public PosSetConfigEntity(JSONObject json) { + if (json.containsKey("id")) + id = json.getString("id");// 前台ID + if (json.containsKey("group")) + group = json.getString("group");// 资源组 + if (json.containsKey("keys")) + keys = json.getString("keys");// 设置键 + if (json.containsKey("values")) + values = json.getString("values");// 设置值 + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getGroup() { + return group; + } + + public void setGroup(String group) { + this.group = group; + } + + public String getKeys() { + return keys; + } + + public void setKeys(String keys) { + this.keys = keys; + } + + public String getValues() { + return values; + } + + public void setValues(String values) { + this.values = values; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/pos/PosSetModuleEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/pos/PosSetModuleEntity.java new file mode 100644 index 0000000..ab5fb70 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/pos/PosSetModuleEntity.java @@ -0,0 +1,218 @@ +package com.jwsaas.api.entity.pos; + +import java.io.Serializable; + +import com.alibaba.fastjson.JSONObject; + +public class PosSetModuleEntity implements Serializable { + + private static final long serialVersionUID = -8017286920671469828L; + + private String id;// 前台ID + + private String area;// 区域 + + private String parentId;// 父功能 + + private String name;// 名称 + + private String alias;// 显示名称 + + private String keycode;// 资源code + + private String keydata;// 资源值 + + private String color1;// 字体颜色 + + private String color2;// 背景色 + + private String color3;// 选中色 + + private String fontSize;// 字体类型 + + private String shortcut;// 按钮快捷键 + + private Integer orderNo;// 显示顺序 + + private String icon;// 图片 + + private String resourceId;// 资源ID + + private Integer enable;// 是否启用 + + private Integer layout;// 布局类型 + + public PosSetModuleEntity() { + + } + public PosSetModuleEntity(JSONObject json) { + if (json.containsKey("id")) + id = json.getString("id");// 前台ID + if (json.containsKey("area")) + area = json.getString("area");// 区域 + if (json.containsKey("parentId")) + parentId = json.getString("parentId");// 父功能 + if (json.containsKey("name")) + name = json.getString("name");// 名称 + if (json.containsKey("alias")) + alias = json.getString("alias");// 显示名称 + if (json.containsKey("keycode")) + keycode = json.getString("keycode");// 资源code + if (json.containsKey("keydata")) + keydata = json.getString("keydata");// 资源值 + if (json.containsKey("color1")) + color1 = json.getString("color1");// 字体颜色 + if (json.containsKey("color2")) + color2 = json.getString("color2");// 背景色 + if (json.containsKey("color3")) + color3 = json.getString("color3");// 选中色 + if (json.containsKey("fontSize")) + fontSize = json.getString("fontSize");// 字体类型 + if (json.containsKey("shortcut")) + shortcut = json.getString("shortcut");// 按钮快捷键 + if (json.containsKey("orderNo")) + orderNo = json.getInteger("orderNo");// 显示顺序 + if (json.containsKey("icon")) + icon = json.getString("icon");// 图片 + if (json.containsKey("resourceId")) + resourceId = json.getString("resourceId");// 资源ID + if (json.containsKey("enable")) + enable = json.getInteger("enable");// 是否启用 + if (json.containsKey("layout")) + layout = json.getInteger("layout");// 布局 + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getArea() { + return area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getParentId() { + return parentId; + } + + public void setParentId(String parentId) { + this.parentId = parentId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getAlias() { + return alias; + } + + public void setAlias(String alias) { + this.alias = alias; + } + + public String getKeycode() { + return keycode; + } + + public void setKeycode(String keycode) { + this.keycode = keycode; + } + + public String getKeydata() { + return keydata; + } + + public void setKeydata(String keydata) { + this.keydata = keydata; + } + + public String getColor1() { + return color1; + } + + public void setColor1(String color1) { + this.color1 = color1; + } + + public String getColor2() { + return color2; + } + + public void setColor2(String color2) { + this.color2 = color2; + } + + public String getColor3() { + return color3; + } + + public void setColor3(String color3) { + this.color3 = color3; + } + + public String getFontSize() { + return fontSize; + } + + public void setFontSize(String fontSize) { + this.fontSize = fontSize; + } + + public String getShortcut() { + return shortcut; + } + + public void setShortcut(String shortcut) { + this.shortcut = shortcut; + } + + public Integer getOrderNo() { + return orderNo; + } + + public void setOrderNo(Integer orderNo) { + this.orderNo = orderNo; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public String getResourceId() { + return resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public Integer getEnable() { + return enable; + } + + public void setEnable(Integer enable) { + this.enable = enable; + } + public Integer getLayout() { + return layout; + } + public void setLayout(Integer layout) { + this.layout = layout; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/pos/PosSetResourcesEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/pos/PosSetResourcesEntity.java new file mode 100644 index 0000000..bebf1d0 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/pos/PosSetResourcesEntity.java @@ -0,0 +1,101 @@ +package com.jwsaas.api.entity.pos; + +import java.io.Serializable; + +import com.alibaba.fastjson.JSONObject; + +public class PosSetResourcesEntity implements Serializable { + + private static final long serialVersionUID = -206051758024485058L; + + private String id;// 前台ID + + private String group;// 资源组 + + private String name;// 资源名称 + + private String keycode;// 资源code + + private String keydata;// 资源值 + + private Integer enable;// 是否启用 + + private String permission;// 权限 + + public PosSetResourcesEntity() { + + } + + public PosSetResourcesEntity(JSONObject json) { + if (json.containsKey("id")) + id = json.getString("id");// 前台ID + if (json.containsKey("group")) + group = json.getString("group");// 资源组 + if (json.containsKey("name")) + name = json.getString("name");// 资源名称 + if (json.containsKey("keycode")) + keycode = json.getString("keycode");// 资源code + if (json.containsKey("keydata")) + keydata = json.getString("keydata");// 资源值 + if (json.containsKey("enable")) + enable = json.getInteger("enable");// 是否启用 + if (json.containsKey("permission")) + permission = json.getString("permission");// 权限 + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getGroup() { + return group; + } + + public void setGroup(String group) { + this.group = group; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getKeycode() { + return keycode; + } + + public void setKeycode(String keycode) { + this.keycode = keycode; + } + + public String getKeydata() { + return keydata; + } + + public void setKeydata(String keydata) { + this.keydata = keydata; + } + + public Integer getEnable() { + return enable; + } + + public void setEnable(Integer enable) { + this.enable = enable; + } + + public String getPermission() { + return permission; + } + + public void setPermission(String permission) { + this.permission = permission; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/pos/PosSetShortcutEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/pos/PosSetShortcutEntity.java new file mode 100644 index 0000000..94442fb --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/pos/PosSetShortcutEntity.java @@ -0,0 +1,211 @@ +package com.jwsaas.api.entity.pos; + +import java.io.Serializable; + +import com.alibaba.fastjson.JSONObject; + +public class PosSetShortcutEntity implements Serializable { + + private static final long serialVersionUID = 5716394299819347574L; + + private String id;// 前台ID + + private String area;// 区域 + + private String parentId;// 父功能 + + private String name;// 名称 + + private String alias;// 显示名称 + + private String keycode;// 资源code + + private String keydata;// 资源值 + + private String color1;// 字体颜色 + + private String color2;// 背景色 + + private String color3;// 选中色 + + private String fontSize;// 字体类型 + + private String shortcut;// 按钮快捷键 + + private Integer orderNo;// 显示顺序 + + private String icon;// 图片 + + private String resourceId;// 资源ID + + private Integer enable;// 是否启用 + + + public PosSetShortcutEntity() { + + } + + public PosSetShortcutEntity(JSONObject json) { + if (json.containsKey("id")) + id = json.getString("id");// 前台ID + if (json.containsKey("area")) + area = json.getString("area");// 区域 + if (json.containsKey("parentId")) + parentId = json.getString("parentId");// 父功能 + if (json.containsKey("name")) + name = json.getString("name");// 名称 + if (json.containsKey("alias")) + alias = json.getString("alias");// 显示名称 + if (json.containsKey("keycode")) + keycode = json.getString("keycode");// 资源code + if (json.containsKey("keydata")) + keydata = json.getString("keydata");// 资源值 + if (json.containsKey("color1")) + color1 = json.getString("color1");// 字体颜色 + if (json.containsKey("color2")) + color2 = json.getString("color2");// 背景色 + if (json.containsKey("color3")) + color3 = json.getString("color3");// 选中色 + if (json.containsKey("fontSize")) + fontSize = json.getString("fontSize");// 字体类型 + if (json.containsKey("shortcut")) + shortcut = json.getString("shortcut");// 按钮快捷键 + if (json.containsKey("orderNo")) + orderNo = json.getInteger("orderNo");// 显示顺序 + if (json.containsKey("icon")) + icon = json.getString("icon");// 图片 + if (json.containsKey("resourceId")) + resourceId = json.getString("resourceId");// 资源ID + if (json.containsKey("enable")) + enable = json.getInteger("enable");// 是否启用 + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getArea() { + return area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getParentId() { + return parentId; + } + + public void setParentId(String parentId) { + this.parentId = parentId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getAlias() { + return alias; + } + + public void setAlias(String alias) { + this.alias = alias; + } + + public String getKeycode() { + return keycode; + } + + public void setKeycode(String keycode) { + this.keycode = keycode; + } + + public String getKeydata() { + return keydata; + } + + public void setKeydata(String keydata) { + this.keydata = keydata; + } + + public String getColor1() { + return color1; + } + + public void setColor1(String color1) { + this.color1 = color1; + } + + public String getColor2() { + return color2; + } + + public void setColor2(String color2) { + this.color2 = color2; + } + + public String getColor3() { + return color3; + } + + public void setColor3(String color3) { + this.color3 = color3; + } + + public String getFontSize() { + return fontSize; + } + + public void setFontSize(String fontSize) { + this.fontSize = fontSize; + } + + public String getShortcut() { + return shortcut; + } + + public void setShortcut(String shortcut) { + this.shortcut = shortcut; + } + + public Integer getOrderNo() { + return orderNo; + } + + public void setOrderNo(Integer orderNo) { + this.orderNo = orderNo; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public String getResourceId() { + return resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public Integer getEnable() { + return enable; + } + + public void setEnable(Integer enable) { + this.enable = enable; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/program/AuthAccessToken.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/program/AuthAccessToken.java new file mode 100644 index 0000000..a9f21ed --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/program/AuthAccessToken.java @@ -0,0 +1,55 @@ +package com.jwsaas.api.entity.program; + +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class AuthAccessToken implements Serializable { + + private static final long serialVersionUID = 6560614925168568249L; + + @JsonProperty(value = "access_token") + private String accessToken;// 获取到的凭证 + + @JsonProperty(value = "expires_in") + private int expiresIn;// 凭证有效时间,单位:秒。目前是7200秒之内的值。 + + @JsonProperty(value = "errcode") + private String errCode;// 错误码 + + @JsonProperty(value = "errmsg") + private String errMsg;// 错误信息 + + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } + + public int getExpiresIn() { + return expiresIn; + } + + public void setExpiresIn(int expiresIn) { + this.expiresIn = expiresIn; + } + + public String getErrCode() { + return errCode; + } + + public void setErrCode(String errCode) { + this.errCode = errCode; + } + + public String getErrMsg() { + return errMsg; + } + + public void setErrMsg(String errMsg) { + this.errMsg = errMsg; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/program/ProgramStoreBusinessTicketDeliverEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/program/ProgramStoreBusinessTicketDeliverEntity.java new file mode 100644 index 0000000..2566b63 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/program/ProgramStoreBusinessTicketDeliverEntity.java @@ -0,0 +1,114 @@ +package com.jwsaas.api.entity.program; + +import java.io.Serializable; + +import com.alibaba.fastjson.JSONObject; + +public class ProgramStoreBusinessTicketDeliverEntity implements Serializable { + + private static final long serialVersionUID = -8814873938456114399L; + + private String clientId;//前台系统ID + + private String orderTel;//订餐电话 + + private String name;//订餐姓名 + + private String address;//订餐地址 + + private Double latitude;//纬度 + + private Double longitude;//经度 + + private Integer deliverType;//配送类型 + + private Double deliverFee;//配送费 + + + public ProgramStoreBusinessTicketDeliverEntity() { + + } + + public ProgramStoreBusinessTicketDeliverEntity(JSONObject json) { + if (json.containsKey("id")) + clientId = json.getString("id");// 前台系统ID + if (json.containsKey("orderTel")) + orderTel = json.getString("orderTel");// 订餐电话 + if (json.containsKey("name")) + name = json.getString("name");// 订餐姓名 + if (json.containsKey("address")) + address = json.getString("address");// 订餐地址 + if (json.containsKey("latitude")) + latitude = json.getDouble("latitude");// 纬度 + if (json.containsKey("longitude")) + longitude = json.getDouble("longitude");// 经度 + if (json.containsKey("deliverType")) + deliverType = json.getInteger("deliverType");// 配送类型 + if (json.containsKey("deliverFee")) + deliverFee = json.getDouble("deliverFee");// 配送费 + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getOrderTel() { + return orderTel; + } + + public void setOrderTel(String orderTel) { + this.orderTel = orderTel; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public Double getLatitude() { + return latitude; + } + + public void setLatitude(Double latitude) { + this.latitude = latitude; + } + + public Double getLongitude() { + return longitude; + } + + public void setLongitude(Double longitude) { + this.longitude = longitude; + } + + public Integer getDeliverType() { + return deliverType; + } + + public void setDeliverType(Integer deliverType) { + this.deliverType = deliverType; + } + + public Double getDeliverFee() { + return deliverFee; + } + + public void setDeliverFee(Double deliverFee) { + this.deliverFee = deliverFee; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/program/ProgramStoreBusinessTicketEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/program/ProgramStoreBusinessTicketEntity.java new file mode 100644 index 0000000..c357645 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/program/ProgramStoreBusinessTicketEntity.java @@ -0,0 +1,481 @@ +package com.jwsaas.api.entity.program; + +import java.io.Serializable; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; + +public class ProgramStoreBusinessTicketEntity implements Serializable { + + private static final long serialVersionUID = 1085851564382180511L; + + private String clientId;// 前台系统ID + + private String memberId;// 会员ID + + private String openId;// 会员openId + + private Integer sourceType;// 来源类型 + + private String touxiang;// 头像 + + private String memberName;// 会员姓名 + + private String no;// 单据编号 + + private String mobile;// 手机号 + + private String storeId;// 门店ID + + private String storeNo;// 门店编号 + + private String storeName;// 门店名称 + + private Date saleDate;// 销售时间 + + private String tableNo;// 餐桌号 + + private String tableName;// 桌台名称 + + private Integer people;// 人数 + + private Integer busMode;// 营业模式 + + private String reserveTime;// 预定时间 + + private Double deliverFee;// 配送费 + + private Double packageFee;// 餐盒费 + + private Double amount;// 消费金额 + + private Double discount;// 优惠率 + + private Double discountTotal;// 优惠额 + + private Double receivable;// 应收金额 + + private Double maling;// 抹零金额 + + private Double paid;// 实收金额 + + private String noOrg;// 原单号 + + private String backCause;// 退单原因 + + private String seqNo;// 当日流水号 + + private String weather;// 天气 + + private String weeker;// 星期 + + private String ext2;// 扩展信息2 + + private Double deductionRate;//扣率; + + private Double chargeBack;//扣款; + + private List ticketInfo;// 主单优惠信息 + + private List orderProduct;// 门店产品销售记录 + + private ProgramStoreBusinessTicketDeliverEntity ticketDeliver;// 门店配送信息 + + public ProgramStoreBusinessTicketEntity() { + + } + + public ProgramStoreBusinessTicketEntity(JSONObject json) { + if (json.containsKey("id")) + clientId = json.getString("id");// 前台系统ID + if (json.containsKey("memberId")) + memberId = json.getString("memberId");// 会员ID + if (json.containsKey("openId")) + openId = json.getString("openId");// 会员openId + if (json.containsKey("sourceType")) + sourceType = json.getInteger("sourceType");// 订单来源 + if (json.containsKey("touxiang")) + touxiang = json.getString("touxiang");// 会员头像 + if (json.containsKey("memberName")) + memberName = json.getString("memberName");// 会员名称 + if (json.containsKey("mobile")) + mobile = json.getString("mobile");// 会员手机号 + if (json.containsKey("storeId")) + storeId = json.getString("storeId");// 门店ID + if (json.containsKey("storeNo")) + storeNo = json.getString("storeNo");// 门店编号 + if (json.containsKey("storeName")) + storeName = json.getString("storeName");// 门店名称 + if (json.containsKey("saleDate")) { + try { + saleDate = json.getDate("saleDate");// 销售时间 + } catch (Exception e) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + // 将字符串形式的时间转化为Date类型的时间 + try { + Date date = sdf.parse("2000-01-01 00:00:00"); + saleDate = date; + } catch (ParseException e1) { + e1.printStackTrace(); + } + } + } + if (json.containsKey("tableNo")) + tableNo = json.getString("tableNo");// 餐桌号 + if (json.containsKey("tableName")) + tableName = json.getString("tableName");// 餐桌号 + if (json.containsKey("people")) + people = json.getInteger("people");// 人数 + if (json.containsKey("busMode")) + busMode = json.getInteger("busMode");// 营业模式 + if (json.containsKey("reserveTime")) + reserveTime = json.getString("reserveTime");// 预定时间 + if (json.containsKey("deliverFee")) + deliverFee = json.getDouble("deliverFee");// 配送费 + if (json.containsKey("packageFee")) + packageFee = json.getDouble("packageFee");// 餐盒费 + if (json.containsKey("amount")) + amount = json.getDouble("amount");// 消费金额 + if (json.containsKey("discount")) + discount = json.getDouble("discount");// 优惠率 + if (json.containsKey("discountTotal")) + discountTotal = json.getDouble("discountTotal");// 优惠额 + if (json.containsKey("receivable")) + receivable = json.getDouble("receivable");// 应收金额 + if (json.containsKey("maling")) + maling = json.getDouble("maling");// 抹零金额 + if (json.containsKey("paid")) + paid = json.getDouble("paid");// 抹零金额 + if (json.containsKey("noOrg")) + noOrg = json.getString("noOrg");// 原单号 + if (json.containsKey("backCause")) + backCause = json.getString("backCause");// 退单原因 + if (json.containsKey("weather")) + weather = json.getString("weather");// 天气 + if (json.containsKey("weeker")) + weeker = json.getString("weeker");// 星期 + if (json.containsKey("ext2")) + ext2 = json.getString("ext2");// 订单备注 + if (json.containsKey("deductionRate")) + deductionRate = json.getDouble("deductionRate");// 订单备注 + if (json.containsKey("chargeBack")) + chargeBack = json.getDouble("chargeBack");// 订单备注 + + if (json.containsKey("ticket_info")) { + JSONArray ticket_info = json.getJSONArray("ticket_info"); + ticketInfo = new ArrayList<>(); + for (int i = 0; i < ticket_info.size(); i++) { + JSONObject infoObject = ticket_info.getJSONObject(i); + ProgramStoreBusinessTicketInfoEntity entity = new ProgramStoreBusinessTicketInfoEntity(infoObject); + ticketInfo.add(entity); + } + } + if (json.containsKey("order_product")) { + JSONArray order_product = json.getJSONArray("order_product"); + orderProduct = new ArrayList<>(); + for (int i = 0; i < order_product.size(); i++) { + JSONObject productObject = order_product.getJSONObject(i); + ProgramStoreOrderProductEntity entity = new ProgramStoreOrderProductEntity(productObject); + orderProduct.add(entity); + } + } + if (json.containsKey("ticket_deliver")) { + JSONObject ticket_deliver = json.getJSONObject("ticket_deliver"); + ticketDeliver = new ProgramStoreBusinessTicketDeliverEntity(ticket_deliver); + } + } + + public Double getDeductionRate() { + return deductionRate; + } + + public void setDeductionRate(Double deductionRate) { + this.deductionRate = deductionRate; + } + + public Double getChargeBack() { + return chargeBack; + } + + public void setChargeBack(Double chargeBack) { + this.chargeBack = chargeBack; + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getMemberId() { + return memberId; + } + + public void setMemberId(String memberId) { + this.memberId = memberId; + } + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public Integer getSourceType() { + return sourceType; + } + + public void setSourceType(Integer sourceType) { + this.sourceType = sourceType; + } + + public String getTouxiang() { + return touxiang; + } + + public void setTouxiang(String touxiang) { + this.touxiang = touxiang; + } + + public String getMemberName() { + return memberName; + } + + public void setMemberName(String memberName) { + this.memberName = memberName; + } + + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public String getNo() { + return no; + } + + public void setNo(String no) { + this.no = no; + } + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getStoreNo() { + return storeNo; + } + + public void setStoreNo(String storeNo) { + this.storeNo = storeNo; + } + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + + public Date getSaleDate() { + return saleDate; + } + + public void setSaleDate(Date saleDate) { + this.saleDate = saleDate; + } + + public String getTableNo() { + return tableNo; + } + + public void setTableNo(String tableNo) { + this.tableNo = tableNo; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public Integer getPeople() { + return people; + } + + public void setPeople(Integer people) { + this.people = people; + } + + public Integer getBusMode() { + return busMode; + } + + public void setBusMode(Integer busMode) { + this.busMode = busMode; + } + + public String getReserveTime() { + return reserveTime; + } + + public void setReserveTime(String reserveTime) { + this.reserveTime = reserveTime; + } + + public Double getDeliverFee() { + return deliverFee; + } + + public void setDeliverFee(Double deliverFee) { + this.deliverFee = deliverFee; + } + + public Double getPackageFee() { + return packageFee; + } + + public void setPackageFee(Double packageFee) { + this.packageFee = packageFee; + } + + public Double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + + public Double getDiscount() { + return discount; + } + + public void setDiscount(Double discount) { + this.discount = discount; + } + + public Double getDiscountTotal() { + return discountTotal; + } + + public void setDiscountTotal(Double discountTotal) { + this.discountTotal = discountTotal; + } + + public Double getReceivable() { + return receivable; + } + + public void setReceivable(Double receivable) { + this.receivable = receivable; + } + + public Double getMaling() { + return maling; + } + + public void setMaling(Double maling) { + this.maling = maling; + } + + public Double getPaid() { + return paid; + } + + public void setPaid(Double paid) { + this.paid = paid; + } + + public String getNoOrg() { + return noOrg; + } + + public void setNoOrg(String noOrg) { + this.noOrg = noOrg; + } + + public String getBackCause() { + return backCause; + } + + public void setBackCause(String backCause) { + this.backCause = backCause; + } + + public String getSeqNo() { + return seqNo; + } + + public void setSeqNo(String seqNo) { + this.seqNo = seqNo; + } + + public String getWeather() { + return weather; + } + + public void setWeather(String weather) { + this.weather = weather; + } + + public String getWeeker() { + return weeker; + } + + public void setWeeker(String weeker) { + this.weeker = weeker; + } + + public String getExt2() { + return ext2; + } + + public void setExt2(String ext2) { + this.ext2 = ext2; + } + + public List getTicketInfo() { + return ticketInfo; + } + + public void setTicketInfo(List ticketInfo) { + this.ticketInfo = ticketInfo; + } + + public List getOrderProduct() { + return orderProduct; + } + + public void setOrderProduct(List orderProduct) { + this.orderProduct = orderProduct; + } + + public ProgramStoreBusinessTicketDeliverEntity getTicketDeliver() { + return ticketDeliver; + } + + public void setTicketDeliver(ProgramStoreBusinessTicketDeliverEntity ticketDeliver) { + this.ticketDeliver = ticketDeliver; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/program/ProgramStoreBusinessTicketInfoEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/program/ProgramStoreBusinessTicketInfoEntity.java new file mode 100644 index 0000000..94f6bf4 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/program/ProgramStoreBusinessTicketInfoEntity.java @@ -0,0 +1,68 @@ +package com.jwsaas.api.entity.program; + +import java.io.Serializable; +import java.util.Date; + +import com.alibaba.fastjson.JSONObject; + +public class ProgramStoreBusinessTicketInfoEntity implements Serializable { + + private static final long serialVersionUID = 6648200477753958681L; + + private String clientId;//前台系统ID + + private Integer type;//优惠类型 + + private String info;//优惠说明 + + private Double discountMoney;//优惠金额 + + + public ProgramStoreBusinessTicketInfoEntity() { + + } + + public ProgramStoreBusinessTicketInfoEntity(JSONObject json) { + if (json.containsKey("id")) + clientId = json.getString("id");// 前台系统ID + if (json.containsKey("type")) + type = json.getInteger("type");// 优惠类型 + if (json.containsKey("info")) + info = json.getString("info");// 优惠说明 + if (json.containsKey("discountMoney")) + discountMoney = json.getDouble("discountMoney");// 优惠金额 + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } + + public Double getDiscountMoney() { + return discountMoney; + } + + public void setDiscountMoney(Double discountMoney) { + this.discountMoney = discountMoney; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/program/ProgramStoreBusinessTicketSycnEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/program/ProgramStoreBusinessTicketSycnEntity.java new file mode 100644 index 0000000..c7a335f --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/program/ProgramStoreBusinessTicketSycnEntity.java @@ -0,0 +1,481 @@ +package com.jwsaas.api.entity.program; + +import java.io.Serializable; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; + +public class ProgramStoreBusinessTicketSycnEntity implements Serializable { + + private static final long serialVersionUID = 1085851564382180511L; + + private String clientId;// 前台系统ID + + private String memberId;// 会员ID + + private String openId;// 会员openId + + private Integer sourceType;// 来源类型 + + private String touxiang;// 头像 + + private String memberName;// 会员姓名 + + private String no;// 单据编号 + + private String mobile;// 手机号 + + private String storeId;// 门店ID + + private String storeNo;// 门店编号 + + private String storeName;// 门店名称 + + private Date saleDate;// 销售时间 + + private String tableNo;// 餐桌号 + + private String tableName;// 桌台名称 + + private Integer people;// 人数 + + private Integer busMode;// 营业模式 + + private String reserveTime;// 预定时间 + + private Double deliverFee;// 配送费 + + private Double packageFee;// 餐盒费 + + private Double amount;// 消费金额 + + private Double discount;// 优惠率 + + private Double discountTotal;// 优惠额 + + private Double receivable;// 应收金额 + + private Double maling;// 抹零金额 + + private Double paid;// 实收金额 + + private String noOrg;// 原单号 + + private String backCause;// 退单原因 + + private String seqNo;// 当日流水号 + + private String weather;// 天气 + + private String weeker;// 星期 + + private String ext2;// 扩展信息2 + + private List ticketInfo;// 主单优惠信息 + + private List orderProduct;// 门店产品销售记录 + + private ProgramStoreBusinessTicketDeliverEntity ticketDeliver;// 门店配送信息 + + private List orderPay;// 产品支付信息 + + public ProgramStoreBusinessTicketSycnEntity() { + + } + + public ProgramStoreBusinessTicketSycnEntity(JSONObject json) { + if (json.containsKey("id")) + clientId = json.getString("id");// 前台系统ID + if (json.containsKey("memberId")) + memberId = json.getString("memberId");// 会员ID + if (json.containsKey("openId")) + openId = json.getString("openId");// 会员openId + if (json.containsKey("sourceType")) + sourceType = json.getInteger("sourceType");// 订单来源 + if (json.containsKey("touxiang")) + touxiang = json.getString("touxiang");// 会员头像 + if (json.containsKey("memberName")) + memberName = json.getString("memberName");// 会员名称 + if (json.containsKey("no")) + no = json.getString("no");// 订单编号 + if (json.containsKey("mobile")) + mobile = json.getString("mobile");// 会员手机号 + if (json.containsKey("storeId")) + storeId = json.getString("storeId");// 门店ID + if (json.containsKey("storeNo")) + storeNo = json.getString("storeNo");// 门店编号 + if (json.containsKey("storeName")) + storeName = json.getString("storeName");// 门店名称 + if (json.containsKey("saleDate")) { + try { + saleDate = json.getDate("saleDate");// 销售时间 + } catch (Exception e) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + // 将字符串形式的时间转化为Date类型的时间 + try { + Date date = sdf.parse("2000-01-01 00:00:00"); + saleDate = date; + } catch (ParseException e1) { + e1.printStackTrace(); + } + } + } + if (json.containsKey("tableNo")) + tableNo = json.getString("tableNo");// 餐桌号 + if (json.containsKey("tableName")) + tableName = json.getString("tableName");// 餐桌号 + if (json.containsKey("people")) + people = json.getInteger("people");// 人数 + if (json.containsKey("busMode")) + busMode = json.getInteger("busMode");// 营业模式 + if (json.containsKey("reserveTime")) + reserveTime = json.getString("reserveTime");// 预定时间 + if (json.containsKey("deliverFee")) + deliverFee = json.getDouble("deliverFee");// 配送费 + if (json.containsKey("packageFee")) + packageFee = json.getDouble("packageFee");// 餐盒费 + if (json.containsKey("amount")) + amount = json.getDouble("amount");// 消费金额 + if (json.containsKey("discount")) + discount = json.getDouble("discount");// 优惠率 + if (json.containsKey("discountTotal")) + discountTotal = json.getDouble("discountTotal");// 优惠额 + if (json.containsKey("receivable")) + receivable = json.getDouble("receivable");// 应收金额 + if (json.containsKey("maling")) + maling = json.getDouble("maling");// 抹零金额 + if (json.containsKey("paid")) + paid = json.getDouble("paid");// 抹零金额 + if (json.containsKey("noOrg")) + noOrg = json.getString("noOrg");// 原单号 + if (json.containsKey("backCause")) + backCause = json.getString("backCause");// 退单原因 + if (json.containsKey("weather")) + weather = json.getString("weather");// 天气 + if (json.containsKey("seqNo")) + seqNo = json.getString("seqNo");// 取餐号 + if (json.containsKey("weeker")) + weeker = json.getString("weeker");// 星期 + if (json.containsKey("ext2")) + ext2 = json.getString("ext2");// 订单备注 + + if (json.containsKey("ticket_info")) { + JSONArray ticket_info = json.getJSONArray("ticket_info"); + ticketInfo = new ArrayList<>(); + for (int i = 0; i < ticket_info.size(); i++) { + JSONObject infoObject = ticket_info.getJSONObject(i); + ProgramStoreBusinessTicketInfoEntity entity = new ProgramStoreBusinessTicketInfoEntity(infoObject); + ticketInfo.add(entity); + } + } + if (json.containsKey("order_product")) { + JSONArray order_product = json.getJSONArray("order_product"); + orderProduct = new ArrayList<>(); + for (int i = 0; i < order_product.size(); i++) { + JSONObject productObject = order_product.getJSONObject(i); + ProgramStoreOrderProductEntity entity = new ProgramStoreOrderProductEntity(productObject); + orderProduct.add(entity); + } + } + if (json.containsKey("ticket_deliver")) { + JSONObject ticket_deliver = json.getJSONObject("ticket_deliver"); + ticketDeliver = new ProgramStoreBusinessTicketDeliverEntity(ticket_deliver); + } + if (json.containsKey("order_pay")) { + JSONArray order_pay = json.getJSONArray("order_pay"); + orderPay = new ArrayList<>(); + for (int i = 0; i < order_pay.size(); i++) { + JSONObject productObject = order_pay.getJSONObject(i); + ProgramStorePayEntity entity = new ProgramStorePayEntity(productObject); + orderPay.add(entity); + } + } + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getMemberId() { + return memberId; + } + + public void setMemberId(String memberId) { + this.memberId = memberId; + } + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public Integer getSourceType() { + return sourceType; + } + + public void setSourceType(Integer sourceType) { + this.sourceType = sourceType; + } + + public String getTouxiang() { + return touxiang; + } + + public void setTouxiang(String touxiang) { + this.touxiang = touxiang; + } + + public String getMemberName() { + return memberName; + } + + public void setMemberName(String memberName) { + this.memberName = memberName; + } + + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public String getNo() { + return no; + } + + public void setNo(String no) { + this.no = no; + } + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getStoreNo() { + return storeNo; + } + + public void setStoreNo(String storeNo) { + this.storeNo = storeNo; + } + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + + public Date getSaleDate() { + return saleDate; + } + + public void setSaleDate(Date saleDate) { + this.saleDate = saleDate; + } + + public String getTableNo() { + return tableNo; + } + + public void setTableNo(String tableNo) { + this.tableNo = tableNo; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public Integer getPeople() { + return people; + } + + public void setPeople(Integer people) { + this.people = people; + } + + public Integer getBusMode() { + return busMode; + } + + public void setBusMode(Integer busMode) { + this.busMode = busMode; + } + + public String getReserveTime() { + return reserveTime; + } + + public void setReserveTime(String reserveTime) { + this.reserveTime = reserveTime; + } + + public Double getDeliverFee() { + return deliverFee; + } + + public void setDeliverFee(Double deliverFee) { + this.deliverFee = deliverFee; + } + + public Double getPackageFee() { + return packageFee; + } + + public void setPackageFee(Double packageFee) { + this.packageFee = packageFee; + } + + public Double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + + public Double getDiscount() { + return discount; + } + + public void setDiscount(Double discount) { + this.discount = discount; + } + + public Double getDiscountTotal() { + return discountTotal; + } + + public void setDiscountTotal(Double discountTotal) { + this.discountTotal = discountTotal; + } + + public Double getReceivable() { + return receivable; + } + + public void setReceivable(Double receivable) { + this.receivable = receivable; + } + + public Double getMaling() { + return maling; + } + + public void setMaling(Double maling) { + this.maling = maling; + } + + public Double getPaid() { + return paid; + } + + public void setPaid(Double paid) { + this.paid = paid; + } + + public String getNoOrg() { + return noOrg; + } + + public void setNoOrg(String noOrg) { + this.noOrg = noOrg; + } + + public String getBackCause() { + return backCause; + } + + public void setBackCause(String backCause) { + this.backCause = backCause; + } + + public String getSeqNo() { + return seqNo; + } + + public void setSeqNo(String seqNo) { + this.seqNo = seqNo; + } + + public String getWeather() { + return weather; + } + + public void setWeather(String weather) { + this.weather = weather; + } + + public String getWeeker() { + return weeker; + } + + public void setWeeker(String weeker) { + this.weeker = weeker; + } + + public String getExt2() { + return ext2; + } + + public void setExt2(String ext2) { + this.ext2 = ext2; + } + + public List getTicketInfo() { + return ticketInfo; + } + + public void setTicketInfo(List ticketInfo) { + this.ticketInfo = ticketInfo; + } + + public List getOrderProduct() { + return orderProduct; + } + + public void setOrderProduct(List orderProduct) { + this.orderProduct = orderProduct; + } + + public ProgramStoreBusinessTicketDeliverEntity getTicketDeliver() { + return ticketDeliver; + } + + public void setTicketDeliver(ProgramStoreBusinessTicketDeliverEntity ticketDeliver) { + this.ticketDeliver = ticketDeliver; + } + + public List getOrderPay() { + return orderPay; + } + + public void setOrderPay(List orderPay) { + this.orderPay = orderPay; + } + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/program/ProgramStoreOrderProductEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/program/ProgramStoreOrderProductEntity.java new file mode 100644 index 0000000..469fd3d --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/program/ProgramStoreOrderProductEntity.java @@ -0,0 +1,471 @@ +package com.jwsaas.api.entity.program; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; + +public class ProgramStoreOrderProductEntity implements Serializable { + + private static final long serialVersionUID = -3692629944440206569L; + + private String clientId;//前台系统ID + + private String parentId;//父记录ID + + private String productId;//产品ID + + private String productNo;//产品编号 + + private String productName;//产品名称 + + private String productUnitId;//产品单位 + + private String productUnitName;//产品单位名 + + private String productImageUrl;//商品图片 + + private String seriesId;//大类ID + + private String seriesName;//大类名称 + + private String typePath;//类别路径 + + private String typeId;//类别ID + + private String typeName;//类别名 + + private String specId;//规格ID + + private String specName;//规格名称 + + private Double count;//数量 + + private Double rcount;//退菜数量 + + private Double price;//销售价格 + + private Double priceOrg;//产品原价 + + private Double discountPrice;//折后价格 + + private Integer isSuit;//是否套菜 + + private String suitId;//套菜ID + + private Date saleDate;//销售时间 + + private Double amount;//消费金额 + + private Double discount;//优惠率 + + private Double discountTotal;//优惠额 + + private Double receivable;//应收金额 + + private Double addPriceTotal;//加价金额 + + private Double discountAddTotal;//加价优惠金额 + + private Double amountAddTotal;//加价应收金额 + + private Double amountTotal;//消费总额 + + private Double receivableTotal;//应收总额 + + private Double packageFee;//餐盒费 + + private Integer lineNo;//行号 + + + private List productInfo;// 菜品销售记录优惠明细 + + private List productMake;// 销售单做法 + + public ProgramStoreOrderProductEntity() { + + } + + public ProgramStoreOrderProductEntity(JSONObject json) { + if (json.containsKey("id")) + clientId = json.getString("id");// 前台系统ID + if (json.containsKey("parentId")) + parentId = json.getString("parentId");// 父记录ID + if (json.containsKey("productId")) + productId = json.getString("productId");// 菜品ID + if (json.containsKey("productNo")) + productNo = json.getString("productNo");// 菜品编号 + if (json.containsKey("productName")) + productName = json.getString("productName");// 菜品名称 + if (json.containsKey("productUnitId")) + productUnitId = json.getString("productUnitId");// 菜品单位 + if (json.containsKey("productUnitName")) + productUnitName = json.getString("productUnitName");// 菜品单位名 + if (json.containsKey("productImageUrl")) + productImageUrl = json.getString("productImageUrl");// 菜品单位名 + if (json.containsKey("seriesId")) + seriesId = json.getString("seriesId");// 菜品大类ID + if (json.containsKey("seriesName")) + seriesName = json.getString("seriesName");// 菜品大类名称 + if (json.containsKey("typePath")) + typePath = json.getString("typePath");// 菜品大类路径 + if (json.containsKey("typeId")) + typeId = json.getString("typeId");// 类别ID + if (json.containsKey("typeName")) + typeName = json.getString("typeName");// 类别名 + if (json.containsKey("specId")) + specId = json.getString("specId");// 规格ID + if (json.containsKey("specName")) + specName = json.getString("specName");// 规格名称 + if (json.containsKey("count")) + count = json.getDouble("count");// 数量 + if (json.containsKey("rcount")) + rcount = json.getDouble("rcount");// 退菜数量 + if (json.containsKey("price")) + price = json.getDouble("price");// 销售价格 + if (json.containsKey("discountPrice")) + discountPrice = json.getDouble("discountPrice");// 折后价格 + if (json.containsKey("priceOrg")) + priceOrg = json.getDouble("priceOrg");// 菜品原价 + if (json.containsKey("isSuit")) + isSuit = json.getInteger("isSuit");// 是否套菜 + if (json.containsKey("suitId")) + suitId = json.getString("suitId");// 套菜ID + if (json.containsKey("saleDate")) + saleDate = json.getDate("saleDate");// 销售时间 + if (json.containsKey("amount")) + amount = json.getDouble("amount");// 消费金额 + if (json.containsKey("discount")) + discount = json.getDouble("discount");// 优惠率 + if (json.containsKey("discountTotal")) + discountTotal = json.getDouble("discountTotal");// 优惠额 + if (json.containsKey("receivable")) + receivable = json.getDouble("receivable");// 应收金额 + if (json.containsKey("addPriceTotal")) + addPriceTotal = json.getDouble("addPriceTotal");// 加价总额 + if (json.containsKey("discountAddTotal")) + discountAddTotal = json.getDouble("discountAddTotal");// 加价优惠金额 + if (json.containsKey("amountAddTotal")) + amountAddTotal = json.getDouble("amountAddTotal");// 加价应收金额 + if (json.containsKey("amountTotal")) + amountTotal = json.getDouble("amountTotal");// 消费总额 + if (json.containsKey("receivableTotal")) + receivableTotal = json.getDouble("receivableTotal");// 应收总额 + if (json.containsKey("lineNo")) + lineNo = json.getInteger("lineNo");// 行号 + if (json.containsKey("packageFee")) + packageFee = json.getDouble("packageFee");// 餐盒费 + + if (json.containsKey("product_info")) { + JSONArray product_info = json.getJSONArray("product_info"); + productInfo = new ArrayList<>(); + for (int i = 0; i < product_info.size(); i++) { + JSONObject infoObject = product_info.getJSONObject(i); + ProgramStoreOrderProductInfoEntity entity = new ProgramStoreOrderProductInfoEntity(infoObject); + productInfo.add(entity); + } + } + if (json.containsKey("product_make")) { + JSONArray product_make = json.getJSONArray("product_make"); + productMake = new ArrayList<>(); + for (int i = 0; i < product_make.size(); i++) { + JSONObject makeObject = product_make.getJSONObject(i); + ProgramStoreOrderProductMakeEntity entity = new ProgramStoreOrderProductMakeEntity(makeObject); + productMake.add(entity); + } + } + + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getParentId() { + return parentId; + } + + public void setParentId(String parentId) { + this.parentId = parentId; + } + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId; + } + + public String getProductNo() { + return productNo; + } + + public void setProductNo(String productNo) { + this.productNo = productNo; + } + + public String getProductName() { + return productName; + } + + public void setProductName(String productName) { + this.productName = productName; + } + + public String getProductUnitId() { + return productUnitId; + } + + public void setProductUnitId(String productUnitId) { + this.productUnitId = productUnitId; + } + + public String getProductUnitName() { + return productUnitName; + } + + public void setProductUnitName(String productUnitName) { + this.productUnitName = productUnitName; + } + + public String getProductImageUrl() { + return productImageUrl; + } + + public void setProductImageUrl(String productImageUrl) { + this.productImageUrl = productImageUrl; + } + + public String getSeriesId() { + return seriesId; + } + + public void setSeriesId(String seriesId) { + this.seriesId = seriesId; + } + + public String getSeriesName() { + return seriesName; + } + + public void setSeriesName(String seriesName) { + this.seriesName = seriesName; + } + + public String getTypePath() { + return typePath; + } + + public void setTypePath(String typePath) { + this.typePath = typePath; + } + + public String getTypeId() { + return typeId; + } + + public void setTypeId(String typeId) { + this.typeId = typeId; + } + + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public String getSpecId() { + return specId; + } + + public void setSpecId(String specId) { + this.specId = specId; + } + + public String getSpecName() { + return specName; + } + + public void setSpecName(String specName) { + this.specName = specName; + } + + public Double getCount() { + return count; + } + + public void setCount(Double count) { + this.count = count; + } + + public Double getRcount() { + return rcount; + } + + public void setRcount(Double rcount) { + this.rcount = rcount; + } + + public Double getPrice() { + return price; + } + + public void setPrice(Double price) { + this.price = price; + } + + public Double getPriceOrg() { + return priceOrg; + } + + public void setPriceOrg(Double priceOrg) { + this.priceOrg = priceOrg; + } + + public Double getDiscountPrice() { + return discountPrice; + } + + public void setDiscountPrice(Double discountPrice) { + this.discountPrice = discountPrice; + } + + public Integer getIsSuit() { + return isSuit; + } + + public void setIsSuit(Integer isSuit) { + this.isSuit = isSuit; + } + + public String getSuitId() { + return suitId; + } + + public void setSuitId(String suitId) { + this.suitId = suitId; + } + + public Date getSaleDate() { + return saleDate; + } + + public void setSaleDate(Date saleDate) { + this.saleDate = saleDate; + } + + public Double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + + public Double getDiscount() { + return discount; + } + + public void setDiscount(Double discount) { + this.discount = discount; + } + + public Double getDiscountTotal() { + return discountTotal; + } + + public void setDiscountTotal(Double discountTotal) { + this.discountTotal = discountTotal; + } + + public Double getReceivable() { + return receivable; + } + + public void setReceivable(Double receivable) { + this.receivable = receivable; + } + + public Double getAddPriceTotal() { + return addPriceTotal; + } + + public void setAddPriceTotal(Double addPriceTotal) { + this.addPriceTotal = addPriceTotal; + } + + public Double getDiscountAddTotal() { + return discountAddTotal; + } + + public void setDiscountAddTotal(Double discountAddTotal) { + this.discountAddTotal = discountAddTotal; + } + + public Double getAmountAddTotal() { + return amountAddTotal; + } + + public void setAmountAddTotal(Double amountAddTotal) { + this.amountAddTotal = amountAddTotal; + } + + public Double getAmountTotal() { + return amountTotal; + } + + public void setAmountTotal(Double amountTotal) { + this.amountTotal = amountTotal; + } + + public Double getReceivableTotal() { + return receivableTotal; + } + + public void setReceivableTotal(Double receivableTotal) { + this.receivableTotal = receivableTotal; + } + + public Double getPackageFee() { + return packageFee; + } + + public void setPackageFee(Double packageFee) { + this.packageFee = packageFee; + } + + public Integer getLineNo() { + return lineNo; + } + + public void setLineNo(Integer lineNo) { + this.lineNo = lineNo; + } + + public List getProductInfo() { + return productInfo; + } + + public void setProductInfo(List productInfo) { + this.productInfo = productInfo; + } + + public List getProductMake() { + return productMake; + } + + public void setProductMake(List productMake) { + this.productMake = productMake; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/program/ProgramStoreOrderProductInfoEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/program/ProgramStoreOrderProductInfoEntity.java new file mode 100644 index 0000000..4900aa4 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/program/ProgramStoreOrderProductInfoEntity.java @@ -0,0 +1,80 @@ +package com.jwsaas.api.entity.program; + +import java.io.Serializable; +import java.util.Date; + +import com.alibaba.fastjson.JSONObject; + +public class ProgramStoreOrderProductInfoEntity implements Serializable { + + private static final long serialVersionUID = 423665380801647033L; + + private String clientId;//前台系统ID + + private String orderItemId;//订单明细记录ID + + private Integer type;//优惠类型 + + private String info;//优惠说明 + + private Double discountMoney;//优惠金额 + + + public ProgramStoreOrderProductInfoEntity() { + + } + + public ProgramStoreOrderProductInfoEntity(JSONObject json) { + if (json.containsKey("id")) + clientId = json.getString("id");// 前台系统ID + if (json.containsKey("orderItemId")) + orderItemId = json.getString("orderItemId");// 订单明细记录ID + if (json.containsKey("type")) + type = json.getInteger("type");// 优惠类型 + if (json.containsKey("info")) + info = json.getString("info");// 优惠说明 + if (json.containsKey("discountMoney")) + discountMoney = json.getDouble("discountMoney");// 优惠金额 + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getOrderItemId() { + return orderItemId; + } + + public void setOrderItemId(String orderItemId) { + this.orderItemId = orderItemId; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } + + public Double getDiscountMoney() { + return discountMoney; + } + + public void setDiscountMoney(Double discountMoney) { + this.discountMoney = discountMoney; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/program/ProgramStoreOrderProductMakeEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/program/ProgramStoreOrderProductMakeEntity.java new file mode 100644 index 0000000..11b662f --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/program/ProgramStoreOrderProductMakeEntity.java @@ -0,0 +1,174 @@ +package com.jwsaas.api.entity.program; + +import java.io.Serializable; + +import com.alibaba.fastjson.JSONObject; + +public class ProgramStoreOrderProductMakeEntity implements Serializable { + + private static final long serialVersionUID = 591519802105870207L; + + private String clientId;// 前台系统ID + + private String orderItemId;// 订单明细记录ID + + private String makeId;// 做法ID + + private String makeName;// 做法名称 + + private Double addPrice;// 做法加价 + + private Double discountPrice;// 做法折后加价 + + private Double count;// 做法数量 + + private Double rcount;// 做法退数量 + + private Double addTotal;// 加价总额 + + private Double discountAddTotal;// 折后总额 + + private Double discount;// 折扣率 + + private Integer qtyFlag;// 做法管理数量标识 + + private Integer hand;// 手写做法标识 + + public ProgramStoreOrderProductMakeEntity() { + + } + + public ProgramStoreOrderProductMakeEntity(JSONObject json) { + if (json.containsKey("id")) + clientId = json.getString("id");// 前台系统ID + if (json.containsKey("orderItemId")) + orderItemId = json.getString("orderItemId");// 订单明细记录ID + if (json.containsKey("makeId")) + makeId = json.getString("makeId");// 做法ID + if (json.containsKey("makeName")) + makeName = json.getString("makeName");// 做法名称 + if (json.containsKey("addPrice")) + addPrice = json.getDouble("addPrice");// 做法加价 + if (json.containsKey("discountPrice")) + discountPrice = json.getDouble("discountPrice");// 做法折后加价 + if (json.containsKey("count")) + count = json.getDouble("count");// 做法数量 + if (json.containsKey("rcount")) + rcount = json.getDouble("rcount");// 做法退数量 + if (json.containsKey("addTotal")) + addTotal = json.getDouble("addTotal");// 加价总额 + if (json.containsKey("discountAddTotal")) + discountAddTotal = json.getDouble("discountAddTotal");// 折后总额 + if (json.containsKey("discount")) + discount = json.getDouble("discount");// 折扣率 + if (json.containsKey("qtyFlag")) + qtyFlag = json.getInteger("qtyFlag");// 做法管理数量标识 + if (json.containsKey("hand")) + hand = json.getInteger("hand");// 手写做法标识 + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getOrderItemId() { + return orderItemId; + } + + public void setOrderItemId(String orderItemId) { + this.orderItemId = orderItemId; + } + + public String getMakeId() { + return makeId; + } + + public void setMakeId(String makeId) { + this.makeId = makeId; + } + + public String getMakeName() { + return makeName; + } + + public void setMakeName(String makeName) { + this.makeName = makeName; + } + + public Double getAddPrice() { + return addPrice; + } + + public void setAddPrice(Double addPrice) { + this.addPrice = addPrice; + } + + public Double getDiscountPrice() { + return discountPrice; + } + + public void setDiscountPrice(Double discountPrice) { + this.discountPrice = discountPrice; + } + + public Double getCount() { + return count; + } + + public void setCount(Double count) { + this.count = count; + } + + public Double getRcount() { + return rcount; + } + + public void setRcount(Double rcount) { + this.rcount = rcount; + } + + public Double getAddTotal() { + return addTotal; + } + + public void setAddTotal(Double addTotal) { + this.addTotal = addTotal; + } + + public Double getDiscountAddTotal() { + return discountAddTotal; + } + + public void setDiscountAddTotal(Double discountAddTotal) { + this.discountAddTotal = discountAddTotal; + } + + public Double getDiscount() { + return discount; + } + + public void setDiscount(Double discount) { + this.discount = discount; + } + + public Integer getQtyFlag() { + return qtyFlag; + } + + public void setQtyFlag(Integer qtyFlag) { + this.qtyFlag = qtyFlag; + } + + public Integer getHand() { + return hand; + } + + public void setHand(Integer hand) { + this.hand = hand; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/program/ProgramStorePayEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/program/ProgramStorePayEntity.java new file mode 100644 index 0000000..b40b879 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/program/ProgramStorePayEntity.java @@ -0,0 +1,262 @@ +package com.jwsaas.api.entity.program; + +import java.io.Serializable; +import java.util.Date; + +import com.alibaba.fastjson.JSONObject; + +public class ProgramStorePayEntity implements Serializable { + + private static final long serialVersionUID = 6571275430103880876L; + + private String clientId;// 前台系统ID + + private String payNo;// 付款单号 + + private String payTypeNo;// 付款方式编号 + + private String payType;// 付款方式 + + private Double paid;// 实收金额 + + private Double rchange;// 找零金额 + + private Double money;// 已收金额 + + private Double overAmount;// 溢出金额 + + private String voucherNo;// 凭证号 + + private Date payDate;// 付款时间 + + private String cardno;// 付款卡号 + + private Double cardYe;// 充值卡支付前余额 + + private Double cardJf;// 充值卡支付前积分 + + private Integer incomeFlag;// 是否实收 + + private Integer otherRateType;// 第三方扣费类型 + + private Double otherRateValue;// 第三方扣费值 + + private Double otherRate;// 第三方扣费 + + private Integer payChannel;// 支付渠道 + + private String memo;// 备注 + + public ProgramStorePayEntity() { + + } + + public ProgramStorePayEntity(JSONObject json) { + if (json.containsKey("id")) + clientId = json.getString("id");// 前台系统ID + if (json.containsKey("payNo")) + payNo = json.getString("payNo");// 付款单号 + if (json.containsKey("payTypeNo")) + payTypeNo = json.getString("payTypeNo");// 付款方式编号 + if (json.containsKey("payType")) + payType = json.getString("payType");// 付款方式 + if (json.containsKey("paid")) + paid = json.getDouble("paid");// 实收金额 + if (json.containsKey("rchange")) + rchange = json.getDouble("rchange");// 找零金额 + if (json.containsKey("money")) + money = json.getDouble("money");// 已收金额 + if (json.containsKey("overAmount")) + overAmount = json.getDouble("overAmount");// 溢出金额 + if (json.containsKey("voucherNo")) + voucherNo = json.getString("voucherNo");// 凭证号 + if (json.containsKey("payDate")) + payDate = json.getDate("payDate");// 付款时间 + if (json.containsKey("cardno")) + cardno = json.getString("cardno");// 付款卡号 + if (json.containsKey("cardYe")) + cardYe = json.getDouble("cardYe");// 充值卡支付前余额 + if (json.containsKey("cardJf")) + cardJf = json.getDouble("cardJf");// 充值卡支付前积分 + if (json.containsKey("incomeFlag")) { + incomeFlag = json.getInteger("incomeFlag");// 充值卡支付前积分 + } else { + incomeFlag = 0; + } + if (json.containsKey("otherRateType")) { + otherRateType = json.getInteger("otherRateType");// 第三方扣费类型 + } else { + otherRateType = 0; + } + if (json.containsKey("otherRateValue")) { + otherRateValue = json.getDouble("otherRateValue");// 第三方扣费值 + } else { + otherRateValue = 0.00; + } + if (json.containsKey("otherRate")) { + otherRate = json.getDouble("otherRate");// 第三方扣费 + } else { + otherRate = 0.00; + } + if (json.containsKey("payChannel")) { + payChannel = json.getInteger("payChannel");// 前台支付渠道 + } else { + payChannel = -1; + } + if (json.containsKey("memo")) + memo = json.getString("memo");// 备注 + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getPayNo() { + return payNo; + } + + public void setPayNo(String payNo) { + this.payNo = payNo; + } + + public String getPayTypeNo() { + return payTypeNo; + } + + public void setPayTypeNo(String payTypeNo) { + this.payTypeNo = payTypeNo; + } + + public String getPayType() { + return payType; + } + + public void setPayType(String payType) { + this.payType = payType; + } + + public Double getPaid() { + return paid; + } + + public void setPaid(Double paid) { + this.paid = paid; + } + + public Double getRchange() { + return rchange; + } + + public void setRchange(Double rchange) { + this.rchange = rchange; + } + + public Double getMoney() { + return money; + } + + public void setMoney(Double money) { + this.money = money; + } + + public Double getOverAmount() { + return overAmount; + } + + public void setOverAmount(Double overAmount) { + this.overAmount = overAmount; + } + + public String getVoucherNo() { + return voucherNo; + } + + public void setVoucherNo(String voucherNo) { + this.voucherNo = voucherNo; + } + + public Date getPayDate() { + return payDate; + } + + public void setPayDate(Date payDate) { + this.payDate = payDate; + } + + public String getCardno() { + return cardno; + } + + public void setCardno(String cardno) { + this.cardno = cardno; + } + + public Double getCardYe() { + return cardYe; + } + + public void setCardYe(Double cardYe) { + this.cardYe = cardYe; + } + + public Double getCardJf() { + return cardJf; + } + + public void setCardJf(Double cardJf) { + this.cardJf = cardJf; + } + + public Integer getIncomeFlag() { + return incomeFlag; + } + + public void setIncomeFlag(Integer incomeFlag) { + this.incomeFlag = incomeFlag; + } + + public Integer getOtherRateType() { + return otherRateType; + } + + public void setOtherRateType(Integer otherRateType) { + this.otherRateType = otherRateType; + } + + public Double getOtherRateValue() { + return otherRateValue; + } + + public void setOtherRateValue(Double otherRateValue) { + this.otherRateValue = otherRateValue; + } + + public Double getOtherRate() { + return otherRate; + } + + public void setOtherRate(Double otherRate) { + this.otherRate = otherRate; + } + + public Integer getPayChannel() { + return payChannel; + } + + public void setPayChannel(Integer payChannel) { + this.payChannel = payChannel; + } + + public String getMemo() { + return memo; + } + + public void setMemo(String memo) { + this.memo = memo; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/AskGoodsDetailEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/AskGoodsDetailEntity.java new file mode 100644 index 0000000..37a13a7 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/AskGoodsDetailEntity.java @@ -0,0 +1,88 @@ +package com.jwsaas.api.entity.storage; + +import java.io.Serializable; + +import com.alibaba.fastjson.JSONObject; +import com.fasterxml.jackson.annotation.JsonAutoDetect; + +@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) +public class AskGoodsDetailEntity implements Serializable { + + private static final long serialVersionUID = -1011161468394424082L; + + private String productId;// 原料Id + + private String specId;// 规格Id + + private Double amount;// 要货数量(配送单位数量) + + private Double price;// 单价(配送价) + + private Double money;// 金额 + + private String description;// 备注说明 + + public AskGoodsDetailEntity(JSONObject json) { + if (json.containsKey("productId")) + productId = json.getString("productId");// 原料Id + if (json.containsKey("specId")) + specId = json.getString("specId");// 原料Id + if (json.containsKey("amount")) + amount = json.getDouble("amount");// 要货数量(配送单位数量) + if (json.containsKey("price")) + price = json.getDouble("price");// 单价(配送价) + if (json.containsKey("money")) + money = json.getDouble("money");// 金额 + if (json.containsKey("description")) + description = json.getString("description");// 备注说明 + } + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId; + } + + public String getSpecId() { + return specId; + } + + public void setSpecId(String specId) { + this.specId = specId; + } + + public Double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + + public Double getPrice() { + return price; + } + + public void setPrice(Double price) { + this.price = price; + } + + public Double getMoney() { + return money; + } + + public void setMoney(Double money) { + this.money = money; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/AskGoodsTemplateDetailEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/AskGoodsTemplateDetailEntity.java new file mode 100644 index 0000000..8aab29e --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/AskGoodsTemplateDetailEntity.java @@ -0,0 +1,52 @@ +package com.jwsaas.api.entity.storage; + +import java.io.Serializable; + +import com.alibaba.fastjson.JSONObject; +import com.fasterxml.jackson.annotation.JsonAutoDetect; + +@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) +public class AskGoodsTemplateDetailEntity implements Serializable { + + private static final long serialVersionUID = -1011161468394424082L; + + private String productId;// 原料Id + + private String specId;// 规格Id + + private String description;// 备注说明 + + public AskGoodsTemplateDetailEntity(JSONObject json) { + if (json.containsKey("productId")) + productId = json.getString("productId");// 原料Id + if (json.containsKey("specId")) + specId = json.getString("specId");// 原料Id + if (json.containsKey("description")) + description = json.getString("description");// 备注说明 + } + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId; + } + + public String getSpecId() { + return specId; + } + + public void setSpecId(String specId) { + this.specId = specId; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/AskGoodsTemplateEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/AskGoodsTemplateEntity.java new file mode 100644 index 0000000..8ccab04 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/AskGoodsTemplateEntity.java @@ -0,0 +1,85 @@ +package com.jwsaas.api.entity.storage; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.fasterxml.jackson.annotation.JsonAutoDetect; + +@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) +public class AskGoodsTemplateEntity implements Serializable { + + private static final long serialVersionUID = 1531637046832984193L; + + private String id;// 模板ID + + private String no;// 模板单号 + + private String name;// 模板名称 + + private String description;// 备注信息 + + private List detail; + + public AskGoodsTemplateEntity(JSONObject json) { + if (json.containsKey("id")) + id = json.getString("id");// 模板ID + if (json.containsKey("no")) + no = json.getString("no");// 模板单号 + if (json.containsKey("name")) + name = json.getString("name");// 模板名称 + if (json.containsKey("description")) + description = json.getString("description");//备注信息 + if (json.containsKey("detail")) { + JSONArray detailArray = json.getJSONArray("detail"); + detail = new ArrayList<>(); + for (int i = 0; i < detailArray.size(); i++) { + AskGoodsTemplateDetailEntity entity = new AskGoodsTemplateDetailEntity(detailArray.getJSONObject(i)); + detail.add(entity); + } + } + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getNo() { + return no; + } + + public void setNo(String no) { + this.no = no; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public List getDetail() { + return detail; + } + + public void setDetail(List detail) { + this.detail = detail; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/AskGoodsTicketEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/AskGoodsTicketEntity.java new file mode 100644 index 0000000..6496caa --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/AskGoodsTicketEntity.java @@ -0,0 +1,157 @@ +package com.jwsaas.api.entity.storage; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.fasterxml.jackson.annotation.JsonAutoDetect; + +@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) +public class AskGoodsTicketEntity implements Serializable { + + private static final long serialVersionUID = 1531637046832984193L; + + private String id;// 单据ID + + private String no;// 单据编号 + + private String storeId;// 门店ID + + private String description;// 备注信息 + + private Double productMoney;// 商品总额 + + private Double dispatchMoney;// 配送费用 + + private Double totalMoney;// 总金额 + + private String setMan;// 制单人 + + private String deliveryMode;// 配送方式 + + private String deliveryModeDesc;// 配送方式说明 + + private List detail; + + public AskGoodsTicketEntity(JSONObject json) { + if (json.containsKey("id")) + id = json.getString("id");// 单据ID + if (json.containsKey("no")) + no = json.getString("no");// 要货单号 + if (json.containsKey("storeId")) + storeId = json.getString("storeId");// 门店ID + if (json.containsKey("description")) + description = json.getString("description");// + if (json.containsKey("productMoney")) + productMoney = json.getDouble("productMoney");// 商品总额 + if (json.containsKey("dispatchMoney")) + dispatchMoney = json.getDouble("dispatchMoney");// 配送费用 + if (json.containsKey("totalMoney")) + totalMoney = json.getDouble("totalMoney");// 总金额 + if (json.containsKey("setMan")) + setMan = json.getString("setMan");// 制单人 + if (json.containsKey("deliveryMode")) + deliveryMode = json.getString("deliveryMode");// 配送方式 + if (json.containsKey("deliveryModeDesc")) + deliveryModeDesc = json.getString("deliveryModeDesc");// 配送方式说明 + if (json.containsKey("detail")) { + JSONArray detailArray = json.getJSONArray("detail"); + detail = new ArrayList<>(); + for (int i = 0; i < detailArray.size(); i++) { + AskGoodsDetailEntity entity = new AskGoodsDetailEntity(detailArray.getJSONObject(i)); + detail.add(entity); + } + } + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getNo() { + return no; + } + + public void setNo(String no) { + this.no = no; + } + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Double getProductMoney() { + return productMoney; + } + + public void setProductMoney(Double productMoney) { + this.productMoney = productMoney; + } + + public Double getDispatchMoney() { + return dispatchMoney; + } + + public void setDispatchMoney(Double dispatchMoney) { + this.dispatchMoney = dispatchMoney; + } + + public Double getTotalMoney() { + return totalMoney; + } + + public void setTotalMoney(Double totalMoney) { + this.totalMoney = totalMoney; + } + + public String getSetMan() { + return setMan; + } + + public void setSetMan(String setMan) { + this.setMan = setMan; + } + + public String getDeliveryMode() { + return deliveryMode; + } + + public void setDeliveryMode(String deliveryMode) { + this.deliveryMode = deliveryMode; + } + + public String getDeliveryModeDesc() { + return deliveryModeDesc; + } + + public void setDeliveryModeDesc(String deliveryModeDesc) { + this.deliveryModeDesc = deliveryModeDesc; + } + + public List getDetail() { + return detail; + } + + public void setDetail(List detail) { + this.detail = detail; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreCostTicketEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreCostTicketEntity.java new file mode 100644 index 0000000..0353cf5 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreCostTicketEntity.java @@ -0,0 +1,334 @@ +package com.jwsaas.api.entity.storage; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.fasterxml.jackson.annotation.JsonAutoDetect; + +@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) +public class StoreCostTicketEntity implements Serializable { + + private static final long serialVersionUID = -3756739708550270138L; + + private String id;// 订单ID + + private String no;// 单据编号 + + private String storeId;// 门店ID + + private String storeNo;// 门店编号 + + private String storeName;// 门店名称 + + private String description;// 备注信息 + + private Double amount;// 营业额 + + private Double discountAmount;// 折扣金额 + + private Double receivableAmount;// 应收金额 + + private Double boxAmount;// 餐盒费 + + private Double workerAmount;// 员工餐 + + private String summaryDate;// 汇总日期 + + private Integer ticketCount;// 营业单数 + + private Double peoplePrice;// 客单价 + + private Double profit;// 纯利润 + + private Double totalCost;// 今日总成本 + + private Double difTotalCost;// 成日成本总差额 + + List productTypeList;// 商品类别汇总列 + + List payTypeList;// 商品支付方式汇总列 + + List productChangeList;// 生成变动成本列 + + List productMoreChangeList;// 辅助生成变动成本列 + + List productOtherChangeList;// 其他生产变动成本列 + + List productFixedChangeList;// 固定生产成本变动列 + + public StoreCostTicketEntity(JSONObject json) { + if (json.containsKey("id")) + id = json.getString("id");// 单据ID + if (json.containsKey("no")) + no = json.getString("no");// 单据编号 + if (json.containsKey("storeId")) + storeId = json.getString("storeId");// 门店ID + if (json.containsKey("storeNo")) + storeNo = json.getString("storeNo");// 门店编号 + if (json.containsKey("storeName")) + storeName = json.getString("storeName");// 门店名称 + if (json.containsKey("description")) + description = json.getString("description");// + if (json.containsKey("amount")) + amount = json.getDouble("amount");// 营业额 + if (json.containsKey("discountAmount")) + discountAmount = json.getDouble("discountAmount");// 折扣金额 + if (json.containsKey("receivableAmount")) + receivableAmount = json.getDouble("receivableAmount");// 应收金额 + if (json.containsKey("boxAmount")) + boxAmount = json.getDouble("boxAmount");// 餐盒费 + if (json.containsKey("workerAmount")) + workerAmount = json.getDouble("workerAmount");// 员工餐 + if (json.containsKey("summaryDate")) + summaryDate = json.getString("summaryDate");// 汇总日期 + if (json.containsKey("ticketCount")) + ticketCount = json.getInteger("ticketCount");// 营业单数 + if (json.containsKey("peoplePrice")) + peoplePrice = json.getDouble("peoplePrice");// 客单价 + if (json.containsKey("profit")) + profit = json.getDouble("profit");// 纯利润 + if (json.containsKey("totalCost")) + totalCost = json.getDouble("totalCost");// 今日总成本 + if (json.containsKey("difTotalCost")) + difTotalCost = json.getDouble("difTotalCost");// 成日成本总差额 + if (json.containsKey("productType")) { + JSONArray detailArray = json.getJSONArray("productType"); + productTypeList = new ArrayList<>(); + for (int i = 0; i < detailArray.size(); i++) { + StoreCostTicketProductTypeEntity entity = new StoreCostTicketProductTypeEntity(detailArray.getJSONObject(i)); + productTypeList.add(entity); + } + } + if (json.containsKey("payType")) { + JSONArray detailArray = json.getJSONArray("payType"); + payTypeList = new ArrayList<>(); + for (int i = 0; i < detailArray.size(); i++) { + StoreCostTicketPayTypeEntity entity = new StoreCostTicketPayTypeEntity(detailArray.getJSONObject(i)); + payTypeList.add(entity); + } + } + if (json.containsKey("productChange")) { + JSONArray detailArray = json.getJSONArray("productChange"); + productChangeList = new ArrayList<>(); + for (int i = 0; i < detailArray.size(); i++) { + StoreCostTicketProductChangeEntity entity = new StoreCostTicketProductChangeEntity(detailArray.getJSONObject(i)); + productChangeList.add(entity); + } + } + if (json.containsKey("productMoreChange")) { + JSONArray detailArray = json.getJSONArray("productMoreChange"); + productMoreChangeList = new ArrayList<>(); + for (int i = 0; i < detailArray.size(); i++) { + StoreCostTicketProductMoreChangeEntity entity = new StoreCostTicketProductMoreChangeEntity(detailArray.getJSONObject(i)); + productMoreChangeList.add(entity); + } + } + + if (json.containsKey("productOtherChange")) { + JSONArray detailArray = json.getJSONArray("productOtherChange"); + productOtherChangeList = new ArrayList<>(); + for (int i = 0; i < detailArray.size(); i++) { + StoreCostTicketProductOtherChangeEntity entity = new StoreCostTicketProductOtherChangeEntity(detailArray.getJSONObject(i)); + productOtherChangeList.add(entity); + } + } + + if (json.containsKey("productFixedChange")) { + JSONArray detailArray = json.getJSONArray("productFixedChange"); + productFixedChangeList = new ArrayList<>(); + for (int i = 0; i < detailArray.size(); i++) { + StoreCostTicketProductFixedChangeEntity entity = new StoreCostTicketProductFixedChangeEntity(detailArray.getJSONObject(i)); + productFixedChangeList.add(entity); + } + } + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getNo() { + return no; + } + + public void setNo(String no) { + this.no = no; + } + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getStoreNo() { + return storeNo; + } + + public void setStoreNo(String storeNo) { + this.storeNo = storeNo; + } + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + + public Double getDiscountAmount() { + return discountAmount; + } + + public void setDiscountAmount(Double discountAmount) { + this.discountAmount = discountAmount; + } + + public Double getReceivableAmount() { + return receivableAmount; + } + + public void setReceivableAmount(Double receivableAmount) { + this.receivableAmount = receivableAmount; + } + + public Double getBoxAmount() { + return boxAmount; + } + + public void setBoxAmount(Double boxAmount) { + this.boxAmount = boxAmount; + } + + public Double getWorkerAmount() { + return workerAmount; + } + + public void setWorkerAmount(Double workerAmount) { + this.workerAmount = workerAmount; + } + + public String getSummaryDate() { + return summaryDate; + } + + public void setSummaryDate(String summaryDate) { + this.summaryDate = summaryDate; + } + + public Integer getTicketCount() { + return ticketCount; + } + + public void setTicketCount(Integer ticketCount) { + this.ticketCount = ticketCount; + } + + public Double getPeoplePrice() { + return peoplePrice; + } + + public void setPeoplePrice(Double peoplePrice) { + this.peoplePrice = peoplePrice; + } + + public Double getProfit() { + return profit; + } + + public void setProfit(Double profit) { + this.profit = profit; + } + + public Double getTotalCost() { + return totalCost; + } + + public void setTotalCost(Double totalCost) { + this.totalCost = totalCost; + } + + public Double getDifTotalCost() { + return difTotalCost; + } + + public void setDifTotalCost(Double difTotalCost) { + this.difTotalCost = difTotalCost; + } + + public List getProductTypeList() { + return productTypeList; + } + + public void setProductTypeList(List productTypeList) { + this.productTypeList = productTypeList; + } + + public List getPayTypeList() { + return payTypeList; + } + + public void setPayTypeList(List payTypeList) { + this.payTypeList = payTypeList; + } + + public List getProductChangeList() { + return productChangeList; + } + + public void setProductChangeList(List productChangeList) { + this.productChangeList = productChangeList; + } + + public List getProductMoreChangeList() { + return productMoreChangeList; + } + + public void setProductMoreChangeList(List productMoreChangeList) { + this.productMoreChangeList = productMoreChangeList; + } + + public List getProductOtherChangeList() { + return productOtherChangeList; + } + + public void setProductOtherChangeList(List productOtherChangeList) { + this.productOtherChangeList = productOtherChangeList; + } + + public List getProductFixedChangeList() { + return productFixedChangeList; + } + + public void setProductFixedChangeList(List productFixedChangeList) { + this.productFixedChangeList = productFixedChangeList; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreCostTicketPayTypeEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreCostTicketPayTypeEntity.java new file mode 100644 index 0000000..4c38a66 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreCostTicketPayTypeEntity.java @@ -0,0 +1,88 @@ +package com.jwsaas.api.entity.storage; + +import java.io.Serializable; + +import com.alibaba.fastjson.JSONObject; +import com.fasterxml.jackson.annotation.JsonAutoDetect; + +@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) +public class StoreCostTicketPayTypeEntity implements Serializable { + + private static final long serialVersionUID = 5992103546663200385L; + + private String payTypeNo;// 支付方式编号 + + private String payTypeName;// 支付方式名称 + + private Integer otherRateType;// 三方扣费类型 + + private Double otherRateValue;// 三方费值 + + private Double money;// 金额 + + private Double realMoney;// 门店实得金额 + + public StoreCostTicketPayTypeEntity(JSONObject json) { + if (json.containsKey("payTypeNo")) + payTypeNo = json.getString("payTypeNo");// 支付方式编号 + if (json.containsKey("payTypeName")) + payTypeName = json.getString("payTypeName");// 支付方式名称 + if (json.containsKey("otherRateType")) + otherRateType = json.getInteger("otherRateType");// 三方扣费类型 + if (json.containsKey("otherRateValue")) + otherRateValue = json.getDouble("otherRateValue");// 三方费值 + if (json.containsKey("money")) + money = json.getDouble("money");// 金额 + if (json.containsKey("realMoney")) + realMoney = json.getDouble("realMoney");// 门店实得金额 + } + + public String getPayTypeNo() { + return payTypeNo; + } + + public void setPayTypeNo(String payTypeNo) { + this.payTypeNo = payTypeNo; + } + + public String getPayTypeName() { + return payTypeName; + } + + public void setPayTypeName(String payTypeName) { + this.payTypeName = payTypeName; + } + + public Integer getOtherRateType() { + return otherRateType; + } + + public void setOtherRateType(Integer otherRateType) { + this.otherRateType = otherRateType; + } + + public Double getOtherRateValue() { + return otherRateValue; + } + + public void setOtherRateValue(Double otherRateValue) { + this.otherRateValue = otherRateValue; + } + + public Double getMoney() { + return money; + } + + public void setMoney(Double money) { + this.money = money; + } + + public Double getRealMoney() { + return realMoney; + } + + public void setRealMoney(Double realMoney) { + this.realMoney = realMoney; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreCostTicketProductChangeEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreCostTicketProductChangeEntity.java new file mode 100644 index 0000000..6ab071c --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreCostTicketProductChangeEntity.java @@ -0,0 +1,292 @@ +package com.jwsaas.api.entity.storage; + +import java.io.Serializable; + +import com.alibaba.fastjson.JSONObject; +import com.fasterxml.jackson.annotation.JsonAutoDetect; + +@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) +public class StoreCostTicketProductChangeEntity implements Serializable { + + private static final long serialVersionUID = 5984664006784436026L; + + private String typeId;// 类别ID + + private String typeNo;// 类别编号 + + private String typeName;// 类别名 + + private String productId;// 商品ID + + private String productNo;// 商品编号 + + private String productName;// 商品名称 + + private String specId;// 规格ID + + private String specName;// 规格名称 + + private String packUnitId;// 包装单位(分店库存单位) + + private Integer costType;// 成本控制类型 + + private Double yeterdayStock;// 昨日库存 + + private Double todayIn;// 今日入库 + + private Double todayStock;// 今晚库存 + + private Double todayLoss;// 今日损耗 + + private Double todayUse;// 实际用量 + + private Double posUse;// 收银用量 + + private Double difUse;// 相差数量 + + private Double difMoney;// 相差金额 + + private Double cost;// 单项成本 + + private Double salePro;// 占比 + + private Double standard;// 运营标准 + + private Double difStandard;// 差值 + + private String memo; + + public StoreCostTicketProductChangeEntity(JSONObject json) { + if (json.containsKey("typeId")) + typeId = json.getString("typeId");// 支付方式编号 + if (json.containsKey("typeNo")) + typeNo = json.getString("typeNo");// 支付方式名称 + if (json.containsKey("typeName")) + typeName = json.getString("typeName");// 三方扣费类型 + if (json.containsKey("productId")) + productId = json.getString("productId");// 三方费值 + if (json.containsKey("productNo")) + productNo = json.getString("productNo");// 金额 + if (json.containsKey("productName")) + productName = json.getString("productName");// 产品名称 + if (json.containsKey("specId")) + specId = json.getString("specId");// 规格ID + if (json.containsKey("specName")) + specName = json.getString("specName");// 规格名称 + if (json.containsKey("packUnitId")) + packUnitId = json.getString("packUnitId");// 包装单位(分店库存单位) + if (json.containsKey("costType")) + costType = json.getInteger("costType");// 成本控制类型 + if (json.containsKey("yeterdayStock")) + yeterdayStock = json.getDouble("yeterdayStock");// 成本控制类型 + if (json.containsKey("todayIn")) + todayIn = json.getDouble("todayIn");// 今日入库 + if (json.containsKey("todayStock")) + todayStock = json.getDouble("todayStock");// 今晚库存 + if (json.containsKey("todayLoss")) + todayLoss = json.getDouble("todayLoss");// 今日损耗 + if (json.containsKey("todayUse")) + todayUse = json.getDouble("todayUse");// 实际用量 + if (json.containsKey("posUse")) + posUse = json.getDouble("posUse");// 收银用量 + if (json.containsKey("difUse")) + difUse = json.getDouble("difUse");// 相差数量 + if (json.containsKey("difMoney")) + difMoney = json.getDouble("difMoney");// 相差金额 + if (json.containsKey("cost")) + cost = json.getDouble("cost");// 单项成本 + if (json.containsKey("salePro")) + salePro = json.getDouble("salePro");// 占比 + if (json.containsKey("standard")) + standard = json.getDouble("standard");// 运营标准 + if (json.containsKey("difStandard")) + difStandard = json.getDouble("difStandard");// 差值 + if (json.containsKey("memo")) + memo = json.getString("memo");// 差异原因; + + } + + public String getTypeId() { + return typeId; + } + + public void setTypeId(String typeId) { + this.typeId = typeId; + } + + public String getTypeNo() { + return typeNo; + } + + public void setTypeNo(String typeNo) { + this.typeNo = typeNo; + } + + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId; + } + + public String getProductNo() { + return productNo; + } + + public void setProductNo(String productNo) { + this.productNo = productNo; + } + + public String getProductName() { + return productName; + } + + public void setProductName(String productName) { + this.productName = productName; + } + + public String getSpecId() { + return specId; + } + + public void setSpecId(String specId) { + this.specId = specId; + } + + public String getSpecName() { + return specName; + } + + public void setSpecName(String specName) { + this.specName = specName; + } + + public String getPackUnitId() { + return packUnitId; + } + + public void setPackUnitId(String packUnitId) { + this.packUnitId = packUnitId; + } + + public Integer getCostType() { + return costType; + } + + public void setCostType(Integer costType) { + this.costType = costType; + } + + public Double getYeterdayStock() { + return yeterdayStock; + } + + public void setYeterdayStock(Double yeterdayStock) { + this.yeterdayStock = yeterdayStock; + } + + public Double getTodayIn() { + return todayIn; + } + + public void setTodayIn(Double todayIn) { + this.todayIn = todayIn; + } + + public Double getTodayStock() { + return todayStock; + } + + public void setTodayStock(Double todayStock) { + this.todayStock = todayStock; + } + + public Double getTodayLoss() { + return todayLoss; + } + + public void setTodayLoss(Double todayLoss) { + this.todayLoss = todayLoss; + } + + public Double getTodayUse() { + return todayUse; + } + + public void setTodayUse(Double todayUse) { + this.todayUse = todayUse; + } + + public Double getPosUse() { + return posUse; + } + + public void setPosUse(Double posUse) { + this.posUse = posUse; + } + + public Double getDifUse() { + return difUse; + } + + public void setDifUse(Double difUse) { + this.difUse = difUse; + } + + public Double getDifMoney() { + return difMoney; + } + + public void setDifMoney(Double difMoney) { + this.difMoney = difMoney; + } + + public Double getCost() { + return cost; + } + + public void setCost(Double cost) { + this.cost = cost; + } + + public Double getSalePro() { + return salePro; + } + + public void setSalePro(Double salePro) { + this.salePro = salePro; + } + + public Double getStandard() { + return standard; + } + + public void setStandard(Double standard) { + this.standard = standard; + } + + public Double getDifStandard() { + return difStandard; + } + + public void setDifStandard(Double difStandard) { + this.difStandard = difStandard; + } + + public String getMemo() { + return memo; + } + + public void setMemo(String memo) { + this.memo = memo; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreCostTicketProductFixedChangeEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreCostTicketProductFixedChangeEntity.java new file mode 100644 index 0000000..a93ec9c --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreCostTicketProductFixedChangeEntity.java @@ -0,0 +1,124 @@ +package com.jwsaas.api.entity.storage; + +import java.io.Serializable; + +import com.alibaba.fastjson.JSONObject; +import com.fasterxml.jackson.annotation.JsonAutoDetect; + +@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) +public class StoreCostTicketProductFixedChangeEntity implements Serializable { + + private static final long serialVersionUID = 8242794789813270237L; + + private String itemId;// 费用Id + + private String typeId;// 费用类别Id + + private String typePath;// 费用类别路径 + + private String typeNo;//费用类别编号 + + private String typeName;//费用类别名称 + + private String no;// 费用项目编号 + + private String name;// 费用项目名称 + + private Integer type;// 费用类型 + + private Double money;// 金额 + + public StoreCostTicketProductFixedChangeEntity(JSONObject json) { + if (json.containsKey("itemId")) + itemId = json.getString("itemId");// 费用Id + if (json.containsKey("typeId")) + typeId = json.getString("typeId");// 费用类别Id + if (json.containsKey("typePath")) + typePath = json.getString("typePath");// 费用类别路径 + if (json.containsKey("no")) + no = json.getString("no");// 费用项目编号 + if (json.containsKey("name")) + name = json.getString("name");// 费用项目名称 + if (json.containsKey("type")) + type = json.getInteger("type");// 费用类型 + if (json.containsKey("money")) + money = json.getDouble("money");// 金额 + if (json.containsKey("typeNo")) + typeNo = json.getString("typeNo");//费用类型编号 + if (json.containsKey("typeName")) + typeName = json.getString("typeName");//费用类型名称 + } + + public String getItemId() { + return itemId; + } + + public void setItemId(String itemId) { + this.itemId = itemId; + } + + public String getTypeId() { + return typeId; + } + + public void setTypeId(String typeId) { + this.typeId = typeId; + } + + public String getTypePath() { + return typePath; + } + + public void setTypePath(String typePath) { + this.typePath = typePath; + } + + public String getTypeNo() { + return typeNo; + } + + public void setTypeNo(String typeNo) { + this.typeNo = typeNo; + } + + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public String getNo() { + return no; + } + + public void setNo(String no) { + this.no = no; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public Double getMoney() { + return money; + } + + public void setMoney(Double money) { + this.money = money; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreCostTicketProductMoreChangeEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreCostTicketProductMoreChangeEntity.java new file mode 100644 index 0000000..b3f6255 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreCostTicketProductMoreChangeEntity.java @@ -0,0 +1,281 @@ +package com.jwsaas.api.entity.storage; + +import java.io.Serializable; + +import com.alibaba.fastjson.JSONObject; +import com.fasterxml.jackson.annotation.JsonAutoDetect; + +@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) +public class StoreCostTicketProductMoreChangeEntity implements Serializable { + + private static final long serialVersionUID = -5201406635245215668L; + + private String typeId;//类别ID + + private String typeNo;//类别编号 + + private String typeName;//类别名 + + private String productId;//商品ID + + private String productNo;//商品编号 + + private String productName;//商品名称 + + private String specId;//规格ID + + private String specName;//规格名称 + + private String packUnitId;//包装单位(分店库存单位) + + private Integer costType;//成本控制类型 + + private Double yeterdayStock;//昨日库存 + + private Double todayIn;//今日入库 + + private Double todayStock;//今晚库存 + + private Double todayLoss;//今日损耗 + + private Double todayUse;//实际用量 + + private Double posUse;//收银用量 + + private Double difUse;//相差数量 + + private Double difMoney;//相差金额 + + private Double cost;//单项成本 + + private Double salePro;//占比 + + private Double standard;//运营标准 + + private Double difStandard;//差值 + + public StoreCostTicketProductMoreChangeEntity(JSONObject json) { + if (json.containsKey("typeId")) + typeId = json.getString("typeId");// 支付方式编号 + if (json.containsKey("typeNo")) + typeNo = json.getString("typeNo");// 支付方式名称 + if (json.containsKey("typeName")) + typeName = json.getString("typeName");// 三方扣费类型 + if (json.containsKey("productId")) + productId = json.getString("productId");// 三方费值 + if (json.containsKey("productNo")) + productNo = json.getString("productNo");// 金额 + if (json.containsKey("productName")) + productName = json.getString("productName");// 产品名称 + if (json.containsKey("specId")) + specId = json.getString("specId");// 规格ID + if (json.containsKey("specName")) + specName = json.getString("specName");// 规格名称 + if (json.containsKey("packUnitId")) + packUnitId = json.getString("packUnitId");// 包装单位(分店库存单位) + if (json.containsKey("costType")) + costType = json.getInteger("costType");// 成本控制类型 + if (json.containsKey("yeterdayStock")) + yeterdayStock = json.getDouble("yeterdayStock");// 成本控制类型 + if (json.containsKey("todayIn")) + todayIn = json.getDouble("todayIn");// 今日入库 + if (json.containsKey("todayStock")) + todayStock = json.getDouble("todayStock");// 今晚库存 + if (json.containsKey("todayLoss")) + todayLoss = json.getDouble("todayLoss");// 今日损耗 + if (json.containsKey("todayUse")) + todayUse = json.getDouble("todayUse");// 实际用量 + if (json.containsKey("posUse")) + posUse = json.getDouble("posUse");// 收银用量 + if (json.containsKey("difUse")) + difUse = json.getDouble("difUse");// 相差数量 + if (json.containsKey("difMoney")) + difMoney = json.getDouble("difMoney");// 相差金额 + if (json.containsKey("cost")) + cost = json.getDouble("cost");// 单项成本 + if (json.containsKey("salePro")) + salePro = json.getDouble("salePro");// 占比 + if (json.containsKey("standard")) + standard = json.getDouble("standard");// 运营标准 + if (json.containsKey("difStandard")) + difStandard = json.getDouble("difStandard");// 差值 + + } + + public String getTypeId() { + return typeId; + } + + public void setTypeId(String typeId) { + this.typeId = typeId; + } + + public String getTypeNo() { + return typeNo; + } + + public void setTypeNo(String typeNo) { + this.typeNo = typeNo; + } + + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId; + } + + public String getProductNo() { + return productNo; + } + + public void setProductNo(String productNo) { + this.productNo = productNo; + } + + public String getProductName() { + return productName; + } + + public void setProductName(String productName) { + this.productName = productName; + } + + public String getSpecId() { + return specId; + } + + public void setSpecId(String specId) { + this.specId = specId; + } + + public String getSpecName() { + return specName; + } + + public void setSpecName(String specName) { + this.specName = specName; + } + + public String getPackUnitId() { + return packUnitId; + } + + public void setPackUnitId(String packUnitId) { + this.packUnitId = packUnitId; + } + + public Integer getCostType() { + return costType; + } + + public void setCostType(Integer costType) { + this.costType = costType; + } + + public Double getYeterdayStock() { + return yeterdayStock; + } + + public void setYeterdayStock(Double yeterdayStock) { + this.yeterdayStock = yeterdayStock; + } + + public Double getTodayIn() { + return todayIn; + } + + public void setTodayIn(Double todayIn) { + this.todayIn = todayIn; + } + + public Double getTodayStock() { + return todayStock; + } + + public void setTodayStock(Double todayStock) { + this.todayStock = todayStock; + } + + public Double getTodayLoss() { + return todayLoss; + } + + public void setTodayLoss(Double todayLoss) { + this.todayLoss = todayLoss; + } + + public Double getTodayUse() { + return todayUse; + } + + public void setTodayUse(Double todayUse) { + this.todayUse = todayUse; + } + + public Double getPosUse() { + return posUse; + } + + public void setPosUse(Double posUse) { + this.posUse = posUse; + } + + public Double getDifUse() { + return difUse; + } + + public void setDifUse(Double difUse) { + this.difUse = difUse; + } + + public Double getDifMoney() { + return difMoney; + } + + public void setDifMoney(Double difMoney) { + this.difMoney = difMoney; + } + + public Double getCost() { + return cost; + } + + public void setCost(Double cost) { + this.cost = cost; + } + + public Double getSalePro() { + return salePro; + } + + public void setSalePro(Double salePro) { + this.salePro = salePro; + } + + public Double getStandard() { + return standard; + } + + public void setStandard(Double standard) { + this.standard = standard; + } + + public Double getDifStandard() { + return difStandard; + } + + public void setDifStandard(Double difStandard) { + this.difStandard = difStandard; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreCostTicketProductOtherChangeEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreCostTicketProductOtherChangeEntity.java new file mode 100644 index 0000000..cb32bb6 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreCostTicketProductOtherChangeEntity.java @@ -0,0 +1,124 @@ +package com.jwsaas.api.entity.storage; + +import java.io.Serializable; + +import com.alibaba.fastjson.JSONObject; +import com.fasterxml.jackson.annotation.JsonAutoDetect; + +@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) +public class StoreCostTicketProductOtherChangeEntity implements Serializable { + + private static final long serialVersionUID = -1291969680590404215L; + + private String itemId;// 费用Id + + private String typeId;//费用类别Id + + private String typePath;//费用类别路径 + + private String typeNo;//费用类别编号 + + private String typeName;//费用类别名称 + + private String no;//费用项目编号 + + private String name;//费用项目名称 + + private Integer type;//费用类型 + + private Double money;//金额 + + public StoreCostTicketProductOtherChangeEntity(JSONObject json) { + if (json.containsKey("itemId")) + itemId = json.getString("itemId");//费用Id + if (json.containsKey("typeId")) + typeId = json.getString("typeId");//费用类别Id + if (json.containsKey("typePath")) + typePath = json.getString("typePath");//费用类别路径 + if (json.containsKey("no")) + no = json.getString("no");//费用项目编号 + if (json.containsKey("name")) + name = json.getString("name");//费用项目名称 + if (json.containsKey("type")) + type = json.getInteger("type");//费用类型 + if (json.containsKey("money")) + money = json.getDouble("money");//金额 + if (json.containsKey("typeNo")) + typeNo = json.getString("typeNo");//费用类型编号 + if (json.containsKey("typeName")) + typeName = json.getString("typeName");//费用类型名称 + } + + public String getItemId() { + return itemId; + } + + public void setItemId(String itemId) { + this.itemId = itemId; + } + + public String getTypeNo() { + return typeNo; + } + + public void setTypeNo(String typeNo) { + this.typeNo = typeNo; + } + + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public String getTypeId() { + return typeId; + } + + public void setTypeId(String typeId) { + this.typeId = typeId; + } + + public String getTypePath() { + return typePath; + } + + public void setTypePath(String typePath) { + this.typePath = typePath; + } + + public String getNo() { + return no; + } + + public void setNo(String no) { + this.no = no; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public Double getMoney() { + return money; + } + + public void setMoney(Double money) { + this.money = money; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreCostTicketProductTypeEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreCostTicketProductTypeEntity.java new file mode 100644 index 0000000..524002f --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreCostTicketProductTypeEntity.java @@ -0,0 +1,64 @@ +package com.jwsaas.api.entity.storage; + +import java.io.Serializable; + +import com.alibaba.fastjson.JSONObject; +import com.fasterxml.jackson.annotation.JsonAutoDetect; + +@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) +public class StoreCostTicketProductTypeEntity implements Serializable { + + private static final long serialVersionUID = 8380092464228907087L; + + private String typeId;// 类别ID + + private String typeNo;// 类别编号 + + private String typeName;// 类别名 + + private Double money;// 金额 + + public StoreCostTicketProductTypeEntity(JSONObject json) { + if (json.containsKey("typeId")) + typeId = json.getString("typeId");//分类ID + if (json.containsKey("typeNo")) + typeNo = json.getString("typeNo");//分类编号 + if (json.containsKey("typeName")) + typeName = json.getString("typeName");//分类名称 + if (json.containsKey("money")) + money = json.getDouble("money");//汇总金额 + } + + public String getTypeId() { + return typeId; + } + + public void setTypeId(String typeId) { + this.typeId = typeId; + } + + public String getTypeNo() { + return typeNo; + } + + public void setTypeNo(String typeNo) { + this.typeNo = typeNo; + } + + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public Double getMoney() { + return money; + } + + public void setMoney(Double money) { + this.money = money; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreStockCheckTicketDetailEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreStockCheckTicketDetailEntity.java new file mode 100644 index 0000000..3509fed --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreStockCheckTicketDetailEntity.java @@ -0,0 +1,204 @@ +package com.jwsaas.api.entity.storage; + +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; + +@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) +public class StoreStockCheckTicketDetailEntity implements Serializable { + + private static final long serialVersionUID = 3452729988649251444L; + + private String id;// 盘点明细ID + private String ticketId;// 盘点单ID + private String ticketNo;// 盘点单编号 + + private String storageId;// 仓库ID + private String storageName;// 仓库名称 + private String productId;// 商品ID + private String productNo;// 商品编号 + private String productName;// 商品名称 + private String specId;// 规格ID + private String specName;// 规格名称 + private String productDescription;// 商品说明 + private String stockUnitId;// 库存单位ID + private String stockUnitName;// 库存单位名称 + private String description;// 备注说明 + + private Double sysPrice;// 系统价格 + private Double sysAmount;// 系统数量 + private Double checkAmount;// 盘点数量 + private Double differenceAmount;// 差异数量 + private Double sysMoney;// 系统金额 + private Double checkMoney;// 盘点金额 + private Double differenceMoney;// 差异金额 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getTicketId() { + return ticketId; + } + + public void setTicketId(String ticketId) { + this.ticketId = ticketId; + } + + public String getTicketNo() { + return ticketNo; + } + + public void setTicketNo(String ticketNo) { + this.ticketNo = ticketNo; + } + + public String getStorageId() { + return storageId; + } + + public void setStorageId(String storageId) { + this.storageId = storageId; + } + + public String getStorageName() { + return storageName; + } + + public void setStorageName(String storageName) { + this.storageName = storageName; + } + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId; + } + + public String getProductNo() { + return productNo; + } + + public void setProductNo(String productNo) { + this.productNo = productNo; + } + + public String getProductName() { + return productName; + } + + public void setProductName(String productName) { + this.productName = productName; + } + + public String getSpecId() { + return specId; + } + + public void setSpecId(String specId) { + this.specId = specId; + } + + public String getSpecName() { + return specName; + } + + public void setSpecName(String specName) { + this.specName = specName; + } + + public String getProductDescription() { + return productDescription; + } + + public void setProductDescription(String productDescription) { + this.productDescription = productDescription; + } + + public String getStockUnitId() { + return stockUnitId; + } + + public void setStockUnitId(String stockUnitId) { + this.stockUnitId = stockUnitId; + } + + public String getStockUnitName() { + return stockUnitName; + } + + public void setStockUnitName(String stockUnitName) { + this.stockUnitName = stockUnitName; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Double getSysPrice() { + return sysPrice; + } + + public void setSysPrice(Double sysPrice) { + this.sysPrice = sysPrice; + } + + public Double getSysAmount() { + return sysAmount; + } + + public void setSysAmount(Double sysAmount) { + this.sysAmount = sysAmount; + } + + public Double getCheckAmount() { + return checkAmount; + } + + public void setCheckAmount(Double checkAmount) { + this.checkAmount = checkAmount; + } + + public Double getDifferenceAmount() { + return differenceAmount; + } + + public void setDifferenceAmount(Double differenceAmount) { + this.differenceAmount = differenceAmount; + } + + public Double getSysMoney() { + return sysMoney; + } + + public void setSysMoney(Double sysMoney) { + this.sysMoney = sysMoney; + } + + public Double getCheckMoney() { + return checkMoney; + } + + public void setCheckMoney(Double checkMoney) { + this.checkMoney = checkMoney; + } + + public Double getDifferenceMoney() { + return differenceMoney; + } + + public void setDifferenceMoney(Double differenceMoney) { + this.differenceMoney = differenceMoney; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreStockCheckTicketEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreStockCheckTicketEntity.java new file mode 100644 index 0000000..8f66240 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreStockCheckTicketEntity.java @@ -0,0 +1,59 @@ +package com.jwsaas.api.entity.storage; + +import java.io.Serializable; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; + +@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) +public class StoreStockCheckTicketEntity implements Serializable { + + private static final long serialVersionUID = -5362912874325707414L; + + private String no;// 单据编号 + private String description;// 备注信息 + private String setMan;// 制单人 + private String setDate;// 制单日期 + private List detailList; + + public String getNo() { + return no; + } + + public void setNo(String no) { + this.no = no; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getSetMan() { + return setMan; + } + + public void setSetMan(String setMan) { + this.setMan = setMan; + } + + public String getSetDate() { + return setDate; + } + + public void setSetDate(String setDate) { + this.setDate = setDate; + } + + public List getDetailList() { + return detailList; + } + + public void setDetailList(List detailList) { + this.detailList = detailList; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreStorageOutTicketDetailEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreStorageOutTicketDetailEntity.java new file mode 100644 index 0000000..cc7f9c5 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreStorageOutTicketDetailEntity.java @@ -0,0 +1,121 @@ +package com.jwsaas.api.entity.storage; + +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; + +@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) +public class StoreStorageOutTicketDetailEntity implements Serializable { + + private static final long serialVersionUID = 6963862914528936629L; + + private String productId;// 原料ID + private String productNo;// 原料编号 + private String productName;// 原料名称 + private String specId;// 规格ID + private String specName;// 规格名称 + private String productDescription;// 原料说明 + private String stockUnitId;// 库存单位 + private String stockUnitName;// 库存单位名称 + private Double amount;// 出库数量 + private Double price;// 价格 + private Double money;// 金额 + private String description;// 备注说明 + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId; + } + + public String getProductNo() { + return productNo; + } + + public void setProductNo(String productNo) { + this.productNo = productNo; + } + + public String getProductName() { + return productName; + } + + public void setProductName(String productName) { + this.productName = productName; + } + + public String getSpecId() { + return specId; + } + + public void setSpecId(String specId) { + this.specId = specId; + } + + public String getSpecName() { + return specName; + } + + public void setSpecName(String specName) { + this.specName = specName; + } + + public String getProductDescription() { + return productDescription; + } + + public void setProductDescription(String productDescription) { + this.productDescription = productDescription; + } + + public String getStockUnitId() { + return stockUnitId; + } + + public void setStockUnitId(String stockUnitId) { + this.stockUnitId = stockUnitId; + } + + public String getStockUnitName() { + return stockUnitName; + } + + public void setStockUnitName(String stockUnitName) { + this.stockUnitName = stockUnitName; + } + + public Double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + + public Double getPrice() { + return price; + } + + public void setPrice(Double price) { + this.price = price; + } + + public Double getMoney() { + return money; + } + + public void setMoney(Double money) { + this.money = money; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreStorageOutTicketEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreStorageOutTicketEntity.java new file mode 100644 index 0000000..3eceaa7 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreStorageOutTicketEntity.java @@ -0,0 +1,95 @@ +package com.jwsaas.api.entity.storage; + +import java.io.Serializable; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; + +@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) +public class StoreStorageOutTicketEntity implements Serializable { + + private static final long serialVersionUID = 881578381261964674L; + + private String id;// 单据ID + private String no;// 单据编号 + private Integer type;// 出库类型 + private String storageId;// 仓库ID + private String storageName;// 仓库名称 + private String description;// 备注信息 + private String setMan;// 制单人 + private String setDate;// 制单日期 + private List detailList; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getNo() { + return no; + } + + public void setNo(String no) { + this.no = no; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getStorageId() { + return storageId; + } + + public void setStorageId(String storageId) { + this.storageId = storageId; + } + + public String getStorageName() { + return storageName; + } + + public void setStorageName(String storageName) { + this.storageName = storageName; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getSetMan() { + return setMan; + } + + public void setSetMan(String setMan) { + this.setMan = setMan; + } + + public String getSetDate() { + return setDate; + } + + public void setSetDate(String setDate) { + this.setDate = setDate; + } + + public List getDetailList() { + return detailList; + } + + public void setDetailList(List detailList) { + this.detailList = detailList; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreStorageTicketDetailEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreStorageTicketDetailEntity.java new file mode 100644 index 0000000..8786691 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreStorageTicketDetailEntity.java @@ -0,0 +1,121 @@ +package com.jwsaas.api.entity.storage; + +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; + +@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) +public class StoreStorageTicketDetailEntity implements Serializable { + + private static final long serialVersionUID = 6963862914528936629L; + + private String productId;// 原料ID + private String productNo;// 原料编号 + private String productName;// 原料名称 + private String specId;// 规格ID + private String specName;// 规格名称 + private String productDescription;// 原料说明 + private String stockUnitId;// 库存单位 + private String stockUnitName;// 库存单位名称 + private Double amount;// 入库数量 + private Double price;// 价格 + private Double money;// 金额 + private String description;// 备注说明 + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId; + } + + public String getProductNo() { + return productNo; + } + + public void setProductNo(String productNo) { + this.productNo = productNo; + } + + public String getProductName() { + return productName; + } + + public void setProductName(String productName) { + this.productName = productName; + } + + public String getSpecId() { + return specId; + } + + public void setSpecId(String specId) { + this.specId = specId; + } + + public String getSpecName() { + return specName; + } + + public void setSpecName(String specName) { + this.specName = specName; + } + + public String getProductDescription() { + return productDescription; + } + + public void setProductDescription(String productDescription) { + this.productDescription = productDescription; + } + + public String getStockUnitId() { + return stockUnitId; + } + + public void setStockUnitId(String stockUnitId) { + this.stockUnitId = stockUnitId; + } + + public String getStockUnitName() { + return stockUnitName; + } + + public void setStockUnitName(String stockUnitName) { + this.stockUnitName = stockUnitName; + } + + public Double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + + public Double getPrice() { + return price; + } + + public void setPrice(Double price) { + this.price = price; + } + + public Double getMoney() { + return money; + } + + public void setMoney(Double money) { + this.money = money; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreStorageTicketEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreStorageTicketEntity.java new file mode 100644 index 0000000..72a25ee --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/storage/StoreStorageTicketEntity.java @@ -0,0 +1,95 @@ +package com.jwsaas.api.entity.storage; + +import java.io.Serializable; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; + +@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) +public class StoreStorageTicketEntity implements Serializable { + + private static final long serialVersionUID = -760131509859686079L; + + private String id;// 单据ID + private String no;// 单据编号 + private Integer type;// 入库类型 + private String storageId;// 仓库ID + private String storageName;// 仓库名称 + private String description;// 备注信息 + private String setMan;// 制单人 + private String setDate;// 制单日期 + private List detailList; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getNo() { + return no; + } + + public void setNo(String no) { + this.no = no; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getStorageId() { + return storageId; + } + + public void setStorageId(String storageId) { + this.storageId = storageId; + } + + public String getStorageName() { + return storageName; + } + + public void setStorageName(String storageName) { + this.storageName = storageName; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getSetMan() { + return setMan; + } + + public void setSetMan(String setMan) { + this.setMan = setMan; + } + + public String getSetDate() { + return setDate; + } + + public void setSetDate(String setDate) { + this.setDate = setDate; + } + + public List getDetailList() { + return detailList; + } + + public void setDetailList(List detailList) { + this.detailList = detailList; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreBusinessLogEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreBusinessLogEntity.java new file mode 100644 index 0000000..4a96e86 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreBusinessLogEntity.java @@ -0,0 +1,33 @@ +package com.jwsaas.api.entity.upload; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; + +public class StoreBusinessLogEntity implements Serializable { + + private static final long serialVersionUID = -8214545172121912780L; + + List list; + + public StoreBusinessLogEntity(JSONArray orderBurden) { + list = new ArrayList<>(); + for (int i = 0; i < orderBurden.size(); i++) { + JSONObject orderBurdenObject = orderBurden.getJSONObject(i); + StoreOperationLogEntity entity = new StoreOperationLogEntity(orderBurdenObject); + list.add(entity); + } + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreBusinessOrderBurdenEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreBusinessOrderBurdenEntity.java new file mode 100644 index 0000000..cec5972 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreBusinessOrderBurdenEntity.java @@ -0,0 +1,33 @@ +package com.jwsaas.api.entity.upload; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; + +public class StoreBusinessOrderBurdenEntity implements Serializable { + + private static final long serialVersionUID = -8214545172121912780L; + + List list; + + public StoreBusinessOrderBurdenEntity(JSONArray orderBurden) { + list = new ArrayList<>(); + for (int i = 0; i < orderBurden.size(); i++) { + JSONObject orderBurdenObject = orderBurden.getJSONObject(i); + StoreOrderBurdenEntity entity = new StoreOrderBurdenEntity(orderBurdenObject); + list.add(entity); + } + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreBusinessTicketDeliveryEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreBusinessTicketDeliveryEntity.java new file mode 100644 index 0000000..10d060b --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreBusinessTicketDeliveryEntity.java @@ -0,0 +1,173 @@ +package com.jwsaas.api.entity.upload; + +import java.io.Serializable; + +import com.alibaba.fastjson.JSONObject; + +public class StoreBusinessTicketDeliveryEntity implements Serializable { + + private static final long serialVersionUID = 2700463675262433248L; + + private String clientId;// 前台系统ID + private String orderTime;// 订餐时间 + private String visitorName;// 订餐人 + private String orderTel;// 订餐电话 + private String recipientName;// 收货人名称 + private String recipientPhone;// 收货人电话 + private String recipientAddress;// 收货人地址 + private String deliveryWorkerNo;// 送餐员工号 + private String deliveryWorkerName;// 送餐员名称 + private Double advanceAmount;// 预支金额 + private Double distributionFee;// 加收服务费 + private String deliveryBeginTime;// 送出时间 + private String deliveryEndTime;// 送达时间 + private String settlementTime;// 交账时间 + + public StoreBusinessTicketDeliveryEntity() { + + } + + public StoreBusinessTicketDeliveryEntity(JSONObject json) { + if (json.containsKey("id")) + clientId = json.getString("id");// 前台系统ID + if (json.containsKey("orderTime")) + orderTime = json.getString("orderTime");// 订餐时间 + if (json.containsKey("visitorName")) + visitorName = json.getString("visitorName");// 订餐人 + if (json.containsKey("orderTel")) + orderTel = json.getString("orderTel");// 订餐电话 + if (json.containsKey("recipientName")) + recipientName = json.getString("recipientName");// 收货人名称 + if (json.containsKey("recipientPhone")) + recipientPhone = json.getString("recipientPhone");// 收货人电话 + if (json.containsKey("recipientAddress")) + recipientAddress = json.getString("recipientAddress");// 收货人地址 + if (json.containsKey("deliveryWorkerNo")) + deliveryWorkerNo = json.getString("deliveryWorkerNo");// 送餐员工号 + if (json.containsKey("deliveryWorkerName")) + deliveryWorkerName = json.getString("deliveryWorkerName");// 送餐员名称 + if (json.containsKey("advanceAmount")) + advanceAmount = json.getDouble("advanceAmount");// 预支金额 + if (json.containsKey("distributionFee")) + distributionFee = json.getDouble("distributionFee");// 加收服务费 + if (json.containsKey("deliveryBeginTime")) + deliveryBeginTime = json.getString("deliveryBeginTime");// 送出时间 + if (json.containsKey("deliveryEndTime")) + deliveryEndTime = json.getString("deliveryEndTime");// 送达时间 + if (json.containsKey("settlementTime")) + settlementTime = json.getString("settlementTime");// 交账时间 + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getOrderTime() { + return orderTime; + } + + public void setOrderTime(String orderTime) { + this.orderTime = orderTime; + } + + public String getVisitorName() { + return visitorName; + } + + public void setVisitorName(String visitorName) { + this.visitorName = visitorName; + } + + public String getOrderTel() { + return orderTel; + } + + public void setOrderTel(String orderTel) { + this.orderTel = orderTel; + } + + public String getRecipientName() { + return recipientName; + } + + public void setRecipientName(String recipientName) { + this.recipientName = recipientName; + } + + public String getRecipientPhone() { + return recipientPhone; + } + + public void setRecipientPhone(String recipientPhone) { + this.recipientPhone = recipientPhone; + } + + public String getRecipientAddress() { + return recipientAddress; + } + + public void setRecipientAddress(String recipientAddress) { + this.recipientAddress = recipientAddress; + } + + public String getDeliveryWorkerNo() { + return deliveryWorkerNo; + } + + public void setDeliveryWorkerNo(String deliveryWorkerNo) { + this.deliveryWorkerNo = deliveryWorkerNo; + } + + public String getDeliveryWorkerName() { + return deliveryWorkerName; + } + + public void setDeliveryWorkerName(String deliveryWorkerName) { + this.deliveryWorkerName = deliveryWorkerName; + } + + public Double getAdvanceAmount() { + return advanceAmount; + } + + public void setAdvanceAmount(Double advanceAmount) { + this.advanceAmount = advanceAmount; + } + + public Double getDistributionFee() { + return distributionFee; + } + + public void setDistributionFee(Double distributionFee) { + this.distributionFee = distributionFee; + } + + public String getDeliveryBeginTime() { + return deliveryBeginTime; + } + + public void setDeliveryBeginTime(String deliveryBeginTime) { + this.deliveryBeginTime = deliveryBeginTime; + } + + public String getDeliveryEndTime() { + return deliveryEndTime; + } + + public void setDeliveryEndTime(String deliveryEndTime) { + this.deliveryEndTime = deliveryEndTime; + } + + public String getSettlementTime() { + return settlementTime; + } + + public void setSettlementTime(String settlementTime) { + this.settlementTime = settlementTime; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreBusinessTicketEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreBusinessTicketEntity.java new file mode 100644 index 0000000..42f6c51 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreBusinessTicketEntity.java @@ -0,0 +1,563 @@ +package com.jwsaas.api.entity.upload; + +import java.io.Serializable; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; + +public class StoreBusinessTicketEntity implements Serializable { + + private static final long serialVersionUID = 503169609864764788L; + + private String clientId;// 前台系统ID + + private String no;// 单据编号 + + private String storeId;// 门店ID + + private String storeNo;// 门店编号 + + private String storeName;// 门店名称 + + private Integer status;// 单据状态 + + private String workNo;// 操作员工号 + + private Date saleDate;// 销售时间 + + private String tableNo;// 餐桌号 + + private Integer people;// 人数 + + private Integer busMode;// 营业模式 + + private String shiftNo;// 班次 + + private String shiftName;// 班次名称 + + private Double amount;// 消费金额 + + private Double discount;// 优惠率 + + private Double discountTotal;// 优惠额 + + private Double receivable;// 应收金额 + + private Double maling;// 抹零金额 + + private Double paid;// 实收金额 + + private String noOrg;// 原单号 + + private String backCause;// 退单原因 + + private Integer isMember;// 是否使用会员卡 + + private String memberNo;// 会员卡号 + + private Double memberJifen;// 本单积分 + + private String deviceName;// 设备名称 + + private String deviceMac;// 设备MAC + + private String deviceIp;// 设备IP + + private String posNo;// 设备编号 + + private String seqNo;// 当日流水号 + private String weather;// 天气 + private String weeker;// 星期 + private Double estimatedCost;// 预估成本 + private Double estimatedProfitAmount;// 预估毛利金额 + private Double estimatedProfitMargin;// 预估毛利率 + private Double totalCost;// 实际成本 + private Double profitAmount;// 实际毛利金额 + private Double profitMargin;// 实际毛利率 + + private String ext2;//orderChargeBack-本单扣款 ; + + + private List ticketInfo;// 主单优惠信息 + + private List orderProduct;// 门店产品销售记录 + + private List pay;// 门店收银流水 + + private List deliveryInfo;// 前台销售单外送信息 + + public StoreBusinessTicketEntity() { + + } + + public StoreBusinessTicketEntity(JSONObject json) { + if (json.containsKey("id")) + clientId = json.getString("id");// 前台系统ID + if (json.containsKey("no")) + no = json.getString("no");// 单据编号 + if (json.containsKey("storeId")) + storeId = json.getString("storeId");// 门店ID + if (json.containsKey("storeNo")) + storeNo = json.getString("storeNo");// 门店编号 + if (json.containsKey("storeName")) + storeName = json.getString("storeName");// 门店名称 + if (json.containsKey("status")) + status = json.getInteger("status");// 单据状态 + if (json.containsKey("workNo")) + workNo = json.getString("workNo");// 操作员工号 + if (json.containsKey("saleDate")) { + try { + saleDate = json.getDate("saleDate");// 销售时间 + } catch (Exception e) { + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + //将字符串形式的时间转化为Date类型的时间 + try { + Date date = sdf.parse("2000-01-01 00:00:00"); + saleDate = date; + } catch (ParseException e1) { + e1.printStackTrace(); + } + } + } + if (json.containsKey("tableNo")) + tableNo = json.getString("tableNo");// 餐桌号 + if (json.containsKey("people")) + people = json.getInteger("people");// 人数 + if (json.containsKey("busMode")) + busMode = json.getInteger("busMode");// 营业模式 + if (json.containsKey("shiftNo")) + shiftNo = json.getString("shiftNo");// 班次 + if (json.containsKey("shiftName")) + shiftName = json.getString("shiftName");// 班次名称 + if (json.containsKey("amount")) + amount = json.getDouble("amount");// 消费金额 + if (json.containsKey("discount")) + discount = json.getDouble("discount");// 优惠率 + if (json.containsKey("discountTotal")) + discountTotal = json.getDouble("discountTotal");// 优惠额 + if (json.containsKey("receivable")) + receivable = json.getDouble("receivable");// 应收金额 + if (json.containsKey("maling")) + maling = json.getDouble("maling");// 抹零金额 + if (json.containsKey("paid")) + paid = json.getDouble("paid");// 抹零金额 + if (json.containsKey("noOrg")) + noOrg = json.getString("noOrg");// 原单号 + if (json.containsKey("backCause")) + backCause = json.getString("backCause");// 退单原因 + if (json.containsKey("isMember")) + isMember = json.getInteger("isMember");// 是否使用会员卡 + if (json.containsKey("memberNo")) + memberNo = json.getString("memberNo");// 会员卡号 + if (json.containsKey("memberJifen")) + memberJifen = json.getDouble("memberJifen");// 本单积分 + if (json.containsKey("deviceName")) + deviceName = json.getString("deviceName");// 设备名称 + if (json.containsKey("deviceMac")) + deviceMac = json.getString("deviceMac");// 设备名称 + if (json.containsKey("deviceIp")) + deviceIp = json.getString("deviceIp");// 设备名称 + if (json.containsKey("posNo")) + posNo = json.getString("posNo");// 设备编号 + if (json.containsKey("seqNo")) + seqNo = json.getString("seqNo");// 当日流水号 + if (json.containsKey("weather")) + weather = json.getString("weather");// 天气 + if (json.containsKey("weeker")) + weeker = json.getString("weeker");// 星期 + if (json.containsKey("estimatedCost")) + estimatedCost = json.getDouble("estimatedCost");// 预估成本 + if (json.containsKey("estimatedProfitAmount")) + estimatedProfitAmount = json.getDouble("estimatedProfitAmount");// 预估毛利金额 + if (json.containsKey("estimatedProfitMargin")) + estimatedProfitMargin = json.getDouble("estimatedProfitMargin");// 预估毛利率 + if (json.containsKey("totalCost")) + totalCost = json.getDouble("totalCost");// 实际成本 + if (json.containsKey("profitAmount")) + profitAmount = json.getDouble("profitAmount");// 实际毛利金额 + if (json.containsKey("profitMargin")) + profitMargin = json.getDouble("profitMargin");// 实际毛利率 + if (json.containsKey("orderChargeBack")) + ext2 = json.getString("orderChargeBack");// 本单扣款 + + if (json.containsKey("ticket_info")) { + JSONArray ticket_info = json.getJSONArray("ticket_info"); + ticketInfo = new ArrayList<>(); + for (int i = 0; i < ticket_info.size(); i++) { + JSONObject infoObject = ticket_info.getJSONObject(i); + StoreBusinessTicketInfoEntity entity = new StoreBusinessTicketInfoEntity(infoObject); + ticketInfo.add(entity); + } + } + if (json.containsKey("order_product")) { + JSONArray order_product = json.getJSONArray("order_product"); + orderProduct = new ArrayList<>(); + for (int i = 0; i < order_product.size(); i++) { + JSONObject productObject = order_product.getJSONObject(i); + StoreOrderProductEntity entity = new StoreOrderProductEntity(productObject); + orderProduct.add(entity); + } + } + if (json.containsKey("pay")) { + JSONArray order_pay = json.getJSONArray("pay"); + pay = new ArrayList<>(); + for (int i = 0; i < order_pay.size(); i++) { + JSONObject payObject = order_pay.getJSONObject(i); + StorePayEntity entity = new StorePayEntity(payObject); + pay.add(entity); + } + } + if (json.containsKey("deliveryInfo")) { + JSONArray delivery_info = json.getJSONArray("deliveryInfo");// 前台销售单外送信息 + deliveryInfo = new ArrayList<>(); + for (int i = 0; i < delivery_info.size(); i++) { + JSONObject payObject = delivery_info.getJSONObject(i); + StoreBusinessTicketDeliveryEntity entity = new StoreBusinessTicketDeliveryEntity(payObject); + deliveryInfo.add(entity); + } + } + } + + public String getExt2() { + return ext2; + } + + public void setExt2(String ext2) { + this.ext2 = ext2; + } + + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getNo() { + return no; + } + + public void setNo(String no) { + this.no = no; + } + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getStoreNo() { + return storeNo; + } + + public void setStoreNo(String storeNo) { + this.storeNo = storeNo; + } + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getWorkNo() { + return workNo; + } + + public void setWorkNo(String workNo) { + this.workNo = workNo; + } + + public Date getSaleDate() { + return saleDate; + } + + public void setSaleDate(Date saleDate) { + this.saleDate = saleDate; + } + + public String getTableNo() { + return tableNo; + } + + public void setTableNo(String tableNo) { + this.tableNo = tableNo; + } + + public Integer getPeople() { + return people; + } + + public void setPeople(Integer people) { + this.people = people; + } + + public Integer getBusMode() { + return busMode; + } + + public void setBusMode(Integer busMode) { + this.busMode = busMode; + } + + public String getShiftNo() { + return shiftNo; + } + + public void setShiftNo(String shiftNo) { + this.shiftNo = shiftNo; + } + + public String getShiftName() { + return shiftName; + } + + public void setShiftName(String shiftName) { + this.shiftName = shiftName; + } + + public Double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + + public Double getDiscount() { + return discount; + } + + public void setDiscount(Double discount) { + this.discount = discount; + } + + public Double getDiscountTotal() { + return discountTotal; + } + + public void setDiscountTotal(Double discountTotal) { + this.discountTotal = discountTotal; + } + + public Double getReceivable() { + return receivable; + } + + public void setReceivable(Double receivable) { + this.receivable = receivable; + } + + public Double getMaling() { + return maling; + } + + public void setMaling(Double maling) { + this.maling = maling; + } + + public Double getPaid() { + return paid; + } + + public void setPaid(Double paid) { + this.paid = paid; + } + + public String getNoOrg() { + return noOrg; + } + + public void setNoOrg(String noOrg) { + this.noOrg = noOrg; + } + + public String getBackCause() { + return backCause; + } + + public void setBackCause(String backCause) { + this.backCause = backCause; + } + + public Integer getIsMember() { + return isMember; + } + + public void setIsMember(Integer isMember) { + this.isMember = isMember; + } + + public String getMemberNo() { + return memberNo; + } + + public void setMemberNo(String memberNo) { + this.memberNo = memberNo; + } + + public Double getMemberJifen() { + return memberJifen; + } + + public void setMemberJifen(Double memberJifen) { + this.memberJifen = memberJifen; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getDeviceMac() { + return deviceMac; + } + + public void setDeviceMac(String deviceMac) { + this.deviceMac = deviceMac; + } + + public String getDeviceIp() { + return deviceIp; + } + + public void setDeviceIp(String deviceIp) { + this.deviceIp = deviceIp; + } + + public String getPosNo() { + return posNo; + } + + public void setPosNo(String posNo) { + this.posNo = posNo; + } + + public String getSeqNo() { + return seqNo; + } + + public void setSeqNo(String seqNo) { + this.seqNo = seqNo; + } + + public String getWeather() { + return weather; + } + + public void setWeather(String weather) { + this.weather = weather; + } + + public String getWeeker() { + return weeker; + } + + public void setWeeker(String weeker) { + this.weeker = weeker; + } + + public Double getEstimatedCost() { + return estimatedCost; + } + + public void setEstimatedCost(Double estimatedCost) { + this.estimatedCost = estimatedCost; + } + + public Double getEstimatedProfitAmount() { + return estimatedProfitAmount; + } + + public void setEstimatedProfitAmount(Double estimatedProfitAmount) { + this.estimatedProfitAmount = estimatedProfitAmount; + } + + public Double getEstimatedProfitMargin() { + return estimatedProfitMargin; + } + + public void setEstimatedProfitMargin(Double estimatedProfitMargin) { + this.estimatedProfitMargin = estimatedProfitMargin; + } + + public Double getTotalCost() { + return totalCost; + } + + public void setTotalCost(Double totalCost) { + this.totalCost = totalCost; + } + + public Double getProfitAmount() { + return profitAmount; + } + + public void setProfitAmount(Double profitAmount) { + this.profitAmount = profitAmount; + } + + public Double getProfitMargin() { + return profitMargin; + } + + public void setProfitMargin(Double profitMargin) { + this.profitMargin = profitMargin; + } + + public List getTicketInfo() { + return ticketInfo; + } + + public void setTicketInfo(List ticketInfo) { + this.ticketInfo = ticketInfo; + } + + public List getOrderProduct() { + return orderProduct; + } + + public void setOrderProduct(List orderProduct) { + this.orderProduct = orderProduct; + } + + public List getPay() { + return pay; + } + + public void setPay(List pay) { + this.pay = pay; + } + + public List getDeliveryInfo() { + return deliveryInfo; + } + + public void setDeliveryInfo(List deliveryInfo) { + this.deliveryInfo = deliveryInfo; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreBusinessTicketExtendEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreBusinessTicketExtendEntity.java new file mode 100644 index 0000000..34e289e --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreBusinessTicketExtendEntity.java @@ -0,0 +1,571 @@ +package com.jwsaas.api.entity.upload; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; + +public class StoreBusinessTicketExtendEntity implements Serializable { + + private static final long serialVersionUID = 7732029364606643387L; + + private String clientId;// 前台系统ID + private String no;// 单据编号 + private String storeId;// 门店ID + private String storeNo;// 门店编号 + private String storeName;// 门店名称 + private Integer status;// 单据状态 + private String workNo;// 操作员工号 + private Date saleDate;// 销售时间 + private String tableNo;// 餐桌号 + private Integer people;// 人数 + private Integer busMode;// 营业模式 + private String shiftNo;// 班次 + private String shiftName;// 班次名称 + private Double amount;// 消费金额 + private Double discount;// 优惠率 + private Double discountTotal;// 优惠额 + private Double receivable;// 应收金额 + private Double maling;// 抹零金额 + private Double paid;// 实收金额 + private String noOrg;// 原单号 + private String backCause;// 退单原因 + private Integer isMember;// 是否使用会员卡 + private String memberNo;// 会员卡号 + private Double memberJifen;// 本单积分 + private String deviceName;// 设备名称 + private String deviceMac;// 设备MAC + private String deviceIp;// 设备IP + private String posNo;// 设备编号 + private String seqNo;// 当日流水号 + private String weather;// 天气 + private String weeker;// 星期 + private Double estimatedCost;// 预估成本 + private Double estimatedProfitAmount;// 预估毛利金额 + private Double estimatedProfitMargin;// 预估毛利率 + private Double totalCost;// 实际成本 + private Double profitAmount;// 实际毛利金额 + private Double profitMargin;// 实际毛利率 + + private List ticketInfo;// 主单优惠信息 + private List orderProduct;// 门店产品销售记录 + private List pay;// 门店收银流水 + private List deliveryInfo;// 前台销售单外送信息 + + private String tableName;// 餐桌名称 + private String ext1;// 扩展信息1 + private String ext2;// 扩展信息2 + private String ext3;// 扩展信息3 + + private List tableList;// 餐桌列表 + + public StoreBusinessTicketExtendEntity() { + + } + + public StoreBusinessTicketExtendEntity(JSONObject json) { + if (json.containsKey("id")) + clientId = json.getString("id");// 前台系统ID + if (json.containsKey("no")) + no = json.getString("no");// 单据编号 + if (json.containsKey("storeId")) + storeId = json.getString("storeId");// 门店ID + if (json.containsKey("storeNo")) + storeNo = json.getString("storeNo");// 门店编号 + if (json.containsKey("storeName")) + storeName = json.getString("storeName");// 门店名称 + if (json.containsKey("status")) + status = json.getInteger("status");// 单据状态 + if (json.containsKey("workNo")) + workNo = json.getString("workNo");// 操作员工号 + if (json.containsKey("saleDate")) + saleDate = json.getDate("saleDate");// 销售时间 + if (json.containsKey("tableNo")) + tableNo = json.getString("tableNo");// 餐桌号 + if (json.containsKey("people")) + people = json.getInteger("people");// 人数 + if (json.containsKey("busMode")) + busMode = json.getInteger("busMode");// 营业模式 + if (json.containsKey("shiftNo")) + shiftNo = json.getString("shiftNo");// 班次 + if (json.containsKey("shiftName")) + shiftName = json.getString("shiftName");// 班次名称 + if (json.containsKey("amount")) + amount = json.getDouble("amount");// 消费金额 + if (json.containsKey("discount")) + discount = json.getDouble("discount");// 优惠率 + if (json.containsKey("discountTotal")) + discountTotal = json.getDouble("discountTotal");// 优惠额 + if (json.containsKey("receivable")) + receivable = json.getDouble("receivable");// 应收金额 + if (json.containsKey("maling")) + maling = json.getDouble("maling");// 抹零金额 + if (json.containsKey("paid")) + paid = json.getDouble("paid");// 抹零金额 + if (json.containsKey("noOrg")) + noOrg = json.getString("noOrg");// 原单号 + if (json.containsKey("backCause")) + backCause = json.getString("backCause");// 退单原因 + if (json.containsKey("isMember")) + isMember = json.getInteger("isMember");// 是否使用会员卡 + if (json.containsKey("memberNo")) + memberNo = json.getString("memberNo");// 会员卡号 + if (json.containsKey("memberJifen")) + memberJifen = json.getDouble("memberJifen");// 本单积分 + if (json.containsKey("deviceName")) + deviceName = json.getString("deviceName");// 设备名称 + if (json.containsKey("deviceMac")) + deviceMac = json.getString("deviceMac");// 设备名称 + if (json.containsKey("deviceIp")) + deviceIp = json.getString("deviceIp");// 设备名称 + if (json.containsKey("posNo")) + posNo = json.getString("posNo");// 设备编号 + if (json.containsKey("seqNo")) + seqNo = json.getString("seqNo");// 当日流水号 + if (json.containsKey("weather")) + weather = json.getString("weather");// 天气 + if (json.containsKey("weeker")) + weeker = json.getString("weeker");// 星期 + if (json.containsKey("estimatedCost")) + estimatedCost = json.getDouble("estimatedCost");// 预估成本 + if (json.containsKey("estimatedProfitAmount")) + estimatedProfitAmount = json.getDouble("estimatedProfitAmount");// 预估毛利金额 + if (json.containsKey("estimatedProfitMargin")) + estimatedProfitMargin = json.getDouble("estimatedProfitMargin");// 预估毛利率 + if (json.containsKey("totalCost")) + totalCost = json.getDouble("totalCost");// 实际成本 + if (json.containsKey("profitAmount")) + profitAmount = json.getDouble("profitAmount");// 实际毛利金额 + if (json.containsKey("profitMargin")) + profitMargin = json.getDouble("profitMargin");// 实际毛利率 + + if (json.containsKey("ticket_info")) { + JSONArray ticket_info = json.getJSONArray("ticket_info"); + ticketInfo = new ArrayList<>(); + for (int i = 0; i < ticket_info.size(); i++) { + JSONObject infoObject = ticket_info.getJSONObject(i); + StoreBusinessTicketInfoExtendEntity entity = new StoreBusinessTicketInfoExtendEntity(infoObject); + ticketInfo.add(entity); + } + } + if (json.containsKey("order_product")) { + JSONArray order_product = json.getJSONArray("order_product"); + orderProduct = new ArrayList<>(); + for (int i = 0; i < order_product.size(); i++) { + JSONObject productObject = order_product.getJSONObject(i); + StoreOrderProductExtendEntity entity = new StoreOrderProductExtendEntity(productObject); + orderProduct.add(entity); + } + } + if (json.containsKey("pay")) { + JSONArray order_pay = json.getJSONArray("pay"); + pay = new ArrayList<>(); + for (int i = 0; i < order_pay.size(); i++) { + JSONObject payObject = order_pay.getJSONObject(i); + StorePayExtendEntity entity = new StorePayExtendEntity(payObject); + pay.add(entity); + } + } + if (json.containsKey("deliveryInfo")) { + JSONArray delivery_info = json.getJSONArray("deliveryInfo");// 前台销售单外送信息 + deliveryInfo = new ArrayList<>(); + for (int i = 0; i < delivery_info.size(); i++) { + JSONObject deliveryObject = delivery_info.getJSONObject(i); + StoreBusinessTicketDeliveryEntity entity = new StoreBusinessTicketDeliveryEntity(deliveryObject); + deliveryInfo.add(entity); + } + } + + if (json.containsKey("tableName")) + tableName = json.getString("tableName");// 餐桌名称 + if (json.containsKey("ext1")) + ext1 = json.getString("ext1");// 扩展信息1 + if (json.containsKey("ext2")) + ext2 = json.getString("ext2");// 扩展信息2 + if (json.containsKey("ext3")) + ext3 = json.getString("ext3");// 扩展信息3 + + if (json.containsKey("tableList")) { + JSONArray table_list = json.getJSONArray("tableList");// 餐桌列表 + tableList = new ArrayList<>(); + for (int i = 0; i < table_list.size(); i++) { + JSONObject tableObject = table_list.getJSONObject(i); + StoreBusinessTicketTableEntity entity = new StoreBusinessTicketTableEntity(tableObject); + tableList.add(entity); + } + } + + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getNo() { + return no; + } + + public void setNo(String no) { + this.no = no; + } + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getStoreNo() { + return storeNo; + } + + public void setStoreNo(String storeNo) { + this.storeNo = storeNo; + } + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getWorkNo() { + return workNo; + } + + public void setWorkNo(String workNo) { + this.workNo = workNo; + } + + public Date getSaleDate() { + return saleDate; + } + + public void setSaleDate(Date saleDate) { + this.saleDate = saleDate; + } + + public String getTableNo() { + return tableNo; + } + + public void setTableNo(String tableNo) { + this.tableNo = tableNo; + } + + public Integer getPeople() { + return people; + } + + public void setPeople(Integer people) { + this.people = people; + } + + public Integer getBusMode() { + return busMode; + } + + public void setBusMode(Integer busMode) { + this.busMode = busMode; + } + + public String getShiftNo() { + return shiftNo; + } + + public void setShiftNo(String shiftNo) { + this.shiftNo = shiftNo; + } + + public String getShiftName() { + return shiftName; + } + + public void setShiftName(String shiftName) { + this.shiftName = shiftName; + } + + public Double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + + public Double getDiscount() { + return discount; + } + + public void setDiscount(Double discount) { + this.discount = discount; + } + + public Double getDiscountTotal() { + return discountTotal; + } + + public void setDiscountTotal(Double discountTotal) { + this.discountTotal = discountTotal; + } + + public Double getReceivable() { + return receivable; + } + + public void setReceivable(Double receivable) { + this.receivable = receivable; + } + + public Double getMaling() { + return maling; + } + + public void setMaling(Double maling) { + this.maling = maling; + } + + public Double getPaid() { + return paid; + } + + public void setPaid(Double paid) { + this.paid = paid; + } + + public String getNoOrg() { + return noOrg; + } + + public void setNoOrg(String noOrg) { + this.noOrg = noOrg; + } + + public String getBackCause() { + return backCause; + } + + public void setBackCause(String backCause) { + this.backCause = backCause; + } + + public Integer getIsMember() { + return isMember; + } + + public void setIsMember(Integer isMember) { + this.isMember = isMember; + } + + public String getMemberNo() { + return memberNo; + } + + public void setMemberNo(String memberNo) { + this.memberNo = memberNo; + } + + public Double getMemberJifen() { + return memberJifen; + } + + public void setMemberJifen(Double memberJifen) { + this.memberJifen = memberJifen; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getDeviceMac() { + return deviceMac; + } + + public void setDeviceMac(String deviceMac) { + this.deviceMac = deviceMac; + } + + public String getDeviceIp() { + return deviceIp; + } + + public void setDeviceIp(String deviceIp) { + this.deviceIp = deviceIp; + } + + public String getPosNo() { + return posNo; + } + + public void setPosNo(String posNo) { + this.posNo = posNo; + } + + public String getSeqNo() { + return seqNo; + } + + public void setSeqNo(String seqNo) { + this.seqNo = seqNo; + } + + public String getWeather() { + return weather; + } + + public void setWeather(String weather) { + this.weather = weather; + } + + public String getWeeker() { + return weeker; + } + + public void setWeeker(String weeker) { + this.weeker = weeker; + } + + public Double getEstimatedCost() { + return estimatedCost; + } + + public void setEstimatedCost(Double estimatedCost) { + this.estimatedCost = estimatedCost; + } + + public Double getEstimatedProfitAmount() { + return estimatedProfitAmount; + } + + public void setEstimatedProfitAmount(Double estimatedProfitAmount) { + this.estimatedProfitAmount = estimatedProfitAmount; + } + + public Double getEstimatedProfitMargin() { + return estimatedProfitMargin; + } + + public void setEstimatedProfitMargin(Double estimatedProfitMargin) { + this.estimatedProfitMargin = estimatedProfitMargin; + } + + public Double getTotalCost() { + return totalCost; + } + + public void setTotalCost(Double totalCost) { + this.totalCost = totalCost; + } + + public Double getProfitAmount() { + return profitAmount; + } + + public void setProfitAmount(Double profitAmount) { + this.profitAmount = profitAmount; + } + + public Double getProfitMargin() { + return profitMargin; + } + + public void setProfitMargin(Double profitMargin) { + this.profitMargin = profitMargin; + } + + public List getTicketInfo() { + return ticketInfo; + } + + public void setTicketInfo(List ticketInfo) { + this.ticketInfo = ticketInfo; + } + + public List getOrderProduct() { + return orderProduct; + } + + public void setOrderProduct(List orderProduct) { + this.orderProduct = orderProduct; + } + + public List getPay() { + return pay; + } + + public void setPay(List pay) { + this.pay = pay; + } + + public List getDeliveryInfo() { + return deliveryInfo; + } + + public void setDeliveryInfo(List deliveryInfo) { + this.deliveryInfo = deliveryInfo; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public String getExt1() { + return ext1; + } + + public void setExt1(String ext1) { + this.ext1 = ext1; + } + + public String getExt2() { + return ext2; + } + + public void setExt2(String ext2) { + this.ext2 = ext2; + } + + public String getExt3() { + return ext3; + } + + public void setExt3(String ext3) { + this.ext3 = ext3; + } + + public List getTableList() { + return tableList; + } + + public void setTableList(List tableList) { + this.tableList = tableList; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreBusinessTicketInfoEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreBusinessTicketInfoEntity.java new file mode 100644 index 0000000..744eb55 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreBusinessTicketInfoEntity.java @@ -0,0 +1,66 @@ +package com.jwsaas.api.entity.upload; + +import java.io.Serializable; + +import com.alibaba.fastjson.JSONObject; + +public class StoreBusinessTicketInfoEntity implements Serializable { + + private static final long serialVersionUID = 2700463675262433248L; + + private String clientId;// 前台系统ID + + private Integer type;// 优惠类型 + + private String info;// 优惠说明 + + private Double discountMoney;// 优惠金额 + + public StoreBusinessTicketInfoEntity() { + + } + + public StoreBusinessTicketInfoEntity(JSONObject json) { + if (json.containsKey("id")) + clientId = json.getString("id");// 前台系统ID + if (json.containsKey("type")) + type = json.getInteger("type");// 优惠类型 + if (json.containsKey("info")) + info = json.getString("info");// 优惠说明 + if (json.containsKey("discountMoney")) + discountMoney = json.getDouble("discountMoney");// 优惠金额 + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } + + public Double getDiscountMoney() { + return discountMoney; + } + + public void setDiscountMoney(Double discountMoney) { + this.discountMoney = discountMoney; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreBusinessTicketInfoExtendEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreBusinessTicketInfoExtendEntity.java new file mode 100644 index 0000000..6a6bb4b --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreBusinessTicketInfoExtendEntity.java @@ -0,0 +1,120 @@ +package com.jwsaas.api.entity.upload; + +import java.io.Serializable; + +import com.alibaba.fastjson.JSONObject; + +public class StoreBusinessTicketInfoExtendEntity implements Serializable { + + private static final long serialVersionUID = 2700463675262433248L; + + private String clientId;// 前台系统ID + private Integer type;// 优惠类型 + private String info;// 优惠说明 + private Double discountMoney;// 优惠金额 + + private String tableNo;// 餐桌编号 + private String tableName;// 餐桌名称 + private String ext1;// 扩展信息1 + private String ext2;// 扩展信息2 + private String ext3;// 扩展信息3 + + public StoreBusinessTicketInfoExtendEntity() { + + } + + public StoreBusinessTicketInfoExtendEntity(JSONObject json) { + if (json.containsKey("id")) + clientId = json.getString("id");// 前台系统ID + if (json.containsKey("type")) + type = json.getInteger("type");// 优惠类型 + if (json.containsKey("info")) + info = json.getString("info");// 优惠说明 + if (json.containsKey("discountMoney")) + discountMoney = json.getDouble("discountMoney");// 优惠金额 + + if (json.containsKey("tableNo")) + tableNo = json.getString("tableNo");// 餐桌编号 + if (json.containsKey("tableName")) + tableName = json.getString("tableName");// 餐桌名称 + if (json.containsKey("ext1")) + ext1 = json.getString("ext1");// 扩展信息1 + if (json.containsKey("ext2")) + ext2 = json.getString("ext2");// 扩展信息2 + if (json.containsKey("ext3")) + ext3 = json.getString("ext3");// 扩展信息3 + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } + + public Double getDiscountMoney() { + return discountMoney; + } + + public void setDiscountMoney(Double discountMoney) { + this.discountMoney = discountMoney; + } + + public String getTableNo() { + return tableNo; + } + + public void setTableNo(String tableNo) { + this.tableNo = tableNo; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public String getExt1() { + return ext1; + } + + public void setExt1(String ext1) { + this.ext1 = ext1; + } + + public String getExt2() { + return ext2; + } + + public void setExt2(String ext2) { + this.ext2 = ext2; + } + + public String getExt3() { + return ext3; + } + + public void setExt3(String ext3) { + this.ext3 = ext3; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreBusinessTicketTableEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreBusinessTicketTableEntity.java new file mode 100644 index 0000000..f823eba --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreBusinessTicketTableEntity.java @@ -0,0 +1,416 @@ +package com.jwsaas.api.entity.upload; + +import java.io.Serializable; +import java.util.Date; + +import com.alibaba.fastjson.JSONObject; + +public class StoreBusinessTicketTableEntity implements Serializable { + + private static final long serialVersionUID = -4237106175779013219L; + + private String clientId;// 前台系统ID + private String storeId;// 门店ID + private String ticketId;// 销售单ID + private String busNo;// 单据编号 + private String tableId;// 桌台ID + private String tableNo;// 桌台编号 + private String tableName;// 桌台名称 + private String typeId;// 桌台类型ID + private String typeNo;// 桌台类型编号 + private String typeName;// 桌台类型名称 + private String areaId;// 桌台区域ID + private String areaNo;// 桌台区域编号 + private String areaName;// 桌台区域名称 + private String tableStatus;// 桌台状态 + private Date openTime;// 开台时间 + private String openUser;// 开台操作员 + private String serialNo;// 桌台分组标签 + private Integer seatNumber;// 座位数 + private Integer peopleNumber;// 人数 + private Integer excessFlag;// 是否超额 + private Double totalAmount;// 消费金额 + private Double totalRefund;// 退菜数量 + private Double totalQuantity;// 菜品数量 + private Double discountAmount;// 优惠金额 + private Double discountRate;// 优惠率 + private Double receivableAmount;// 应收金额 + private Double paidAmount;// 实收金额 + private Double malingAmount;// 抹零金额 + private Integer masterTable;// 主台标识 + private Double perCapitaAmount;// 人均金额 + private String posNo;// 开台POS + private String payNo;// 结账单号 + private Date finishTime;// 完成时间 + private String ext1;// 扩展信息1 + private String ext2;// 扩展信息2 + private String ext3;// 扩展信息3 + + public StoreBusinessTicketTableEntity() { + + } + + public StoreBusinessTicketTableEntity(JSONObject json) { + if (json.containsKey("id")) + clientId = json.getString("id");// 前台系统ID + if (json.containsKey("storeId")) + storeId = json.getString("storeId");// 门店ID + if (json.containsKey("ticketId")) + ticketId = json.getString("ticketId");// 销售单ID + if (json.containsKey("busNo")) + busNo = json.getString("busNo");// 单据编号 + if (json.containsKey("tableId")) + tableId = json.getString("tableId");// 桌台ID + if (json.containsKey("tableNo")) + tableNo = json.getString("tableNo");// 桌台编号 + if (json.containsKey("tableName")) + tableName = json.getString("tableName");// 桌台名称 + if (json.containsKey("typeId")) + typeId = json.getString("typeId");// 桌台类型ID + if (json.containsKey("typeNo")) + typeNo = json.getString("typeNo");// 桌台类型编号 + if (json.containsKey("typeName")) + typeName = json.getString("typeName");// 桌台类型名称 + if (json.containsKey("areaId")) + areaId = json.getString("areaId");// 桌台区域ID + if (json.containsKey("areaNo")) + areaNo = json.getString("areaNo");// 桌台区域编号 + if (json.containsKey("areaName")) + areaName = json.getString("areaName");// 桌台区域名称 + if (json.containsKey("tableStatus")) + tableStatus = json.getString("tableStatus");// 桌台状态 + if (json.containsKey("openTime")) + openTime = json.getDate("openTime");// 开台时间 + if (json.containsKey("openUser")) + openUser = json.getString("openUser");// 开台操作员 + if (json.containsKey("serialNo")) + serialNo = json.getString("serialNo");// 桌台分组标签 + if (json.containsKey("seatNumber")) + seatNumber = json.getInteger("seatNumber");// 座位数 + if (json.containsKey("peopleNumber")) + peopleNumber = json.getInteger("peopleNumber");// 人数 + if (json.containsKey("excessFlag")) + excessFlag = json.getInteger("excessFlag");// 是否超额 + if (json.containsKey("totalAmount")) + totalAmount = json.getDouble("totalAmount");// 消费金额 + if (json.containsKey("totalRefund")) + totalRefund = json.getDouble("totalRefund");// 退菜数量 + if (json.containsKey("totalQuantity")) + totalQuantity = json.getDouble("totalQuantity");// 菜品数量 + if (json.containsKey("discountAmount")) + discountAmount = json.getDouble("discountAmount");// 优惠金额 + if (json.containsKey("discountRate")) + discountRate = json.getDouble("discountRate");// 优惠率 + if (json.containsKey("receivableAmount")) + receivableAmount = json.getDouble("receivableAmount");// 应收金额 + if (json.containsKey("paidAmount")) + paidAmount = json.getDouble("paidAmount");// 实收金额 + if (json.containsKey("malingAmount")) + malingAmount = json.getDouble("malingAmount");// 抹零金额 + if (json.containsKey("masterTable")) + masterTable = json.getInteger("masterTable");// 主台标识 + if (json.containsKey("perCapitaAmount")) + perCapitaAmount = json.getDouble("perCapitaAmount");// 人均金额 + if (json.containsKey("posNo")) + posNo = json.getString("posNo");// 开台POS + if (json.containsKey("payNo")) + payNo = json.getString("payNo");// 结账单号 + if (json.containsKey("finishTime")) + finishTime = json.getDate("finishTime");// 完成时间 + if (json.containsKey("ext1")) + ext1 = json.getString("ext1");// 扩展信息1 + if (json.containsKey("ext2")) + ext2 = json.getString("ext2");// 扩展信息2 + if (json.containsKey("ext3")) + ext3 = json.getString("ext3");// 扩展信息3 + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getTicketId() { + return ticketId; + } + + public void setTicketId(String ticketId) { + this.ticketId = ticketId; + } + + public String getBusNo() { + return busNo; + } + + public void setBusNo(String busNo) { + this.busNo = busNo; + } + + public String getTableId() { + return tableId; + } + + public void setTableId(String tableId) { + this.tableId = tableId; + } + + public String getTableNo() { + return tableNo; + } + + public void setTableNo(String tableNo) { + this.tableNo = tableNo; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public String getTypeId() { + return typeId; + } + + public void setTypeId(String typeId) { + this.typeId = typeId; + } + + public String getTypeNo() { + return typeNo; + } + + public void setTypeNo(String typeNo) { + this.typeNo = typeNo; + } + + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public String getAreaId() { + return areaId; + } + + public void setAreaId(String areaId) { + this.areaId = areaId; + } + + public String getAreaNo() { + return areaNo; + } + + public void setAreaNo(String areaNo) { + this.areaNo = areaNo; + } + + public String getAreaName() { + return areaName; + } + + public void setAreaName(String areaName) { + this.areaName = areaName; + } + + public String getTableStatus() { + return tableStatus; + } + + public void setTableStatus(String tableStatus) { + this.tableStatus = tableStatus; + } + + public Date getOpenTime() { + return openTime; + } + + public void setOpenTime(Date openTime) { + this.openTime = openTime; + } + + public String getOpenUser() { + return openUser; + } + + public void setOpenUser(String openUser) { + this.openUser = openUser; + } + + public String getSerialNo() { + return serialNo; + } + + public void setSerialNo(String serialNo) { + this.serialNo = serialNo; + } + + public Integer getSeatNumber() { + return seatNumber; + } + + public void setSeatNumber(Integer seatNumber) { + this.seatNumber = seatNumber; + } + + public Integer getPeopleNumber() { + return peopleNumber; + } + + public void setPeopleNumber(Integer peopleNumber) { + this.peopleNumber = peopleNumber; + } + + public Integer getExcessFlag() { + return excessFlag; + } + + public void setExcessFlag(Integer excessFlag) { + this.excessFlag = excessFlag; + } + + public Double getTotalAmount() { + return totalAmount; + } + + public void setTotalAmount(Double totalAmount) { + this.totalAmount = totalAmount; + } + + public Double getTotalRefund() { + return totalRefund; + } + + public void setTotalRefund(Double totalRefund) { + this.totalRefund = totalRefund; + } + + public Double getTotalQuantity() { + return totalQuantity; + } + + public void setTotalQuantity(Double totalQuantity) { + this.totalQuantity = totalQuantity; + } + + public Double getDiscountAmount() { + return discountAmount; + } + + public void setDiscountAmount(Double discountAmount) { + this.discountAmount = discountAmount; + } + + public Double getDiscountRate() { + return discountRate; + } + + public void setDiscountRate(Double discountRate) { + this.discountRate = discountRate; + } + + public Double getReceivableAmount() { + return receivableAmount; + } + + public void setReceivableAmount(Double receivableAmount) { + this.receivableAmount = receivableAmount; + } + + public Double getPaidAmount() { + return paidAmount; + } + + public void setPaidAmount(Double paidAmount) { + this.paidAmount = paidAmount; + } + + public Double getMalingAmount() { + return malingAmount; + } + + public void setMalingAmount(Double malingAmount) { + this.malingAmount = malingAmount; + } + + public Integer getMasterTable() { + return masterTable; + } + + public void setMasterTable(Integer masterTable) { + this.masterTable = masterTable; + } + + public Double getPerCapitaAmount() { + return perCapitaAmount; + } + + public void setPerCapitaAmount(Double perCapitaAmount) { + this.perCapitaAmount = perCapitaAmount; + } + + public String getPosNo() { + return posNo; + } + + public void setPosNo(String posNo) { + this.posNo = posNo; + } + + public String getPayNo() { + return payNo; + } + + public void setPayNo(String payNo) { + this.payNo = payNo; + } + + public Date getFinishTime() { + return finishTime; + } + + public void setFinishTime(Date finishTime) { + this.finishTime = finishTime; + } + + public String getExt1() { + return ext1; + } + + public void setExt1(String ext1) { + this.ext1 = ext1; + } + + public String getExt2() { + return ext2; + } + + public void setExt2(String ext2) { + this.ext2 = ext2; + } + + public String getExt3() { + return ext3; + } + + public void setExt3(String ext3) { + this.ext3 = ext3; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreCostRevenueEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreCostRevenueEntity.java new file mode 100644 index 0000000..ccfe44c --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreCostRevenueEntity.java @@ -0,0 +1,226 @@ +package com.jwsaas.api.entity.upload; + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlRootElement; + +import com.alibaba.fastjson.JSONObject; +import com.fasterxml.jackson.annotation.JsonAutoDetect; + +@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) +@XmlAccessorType(XmlAccessType.FIELD) +@XmlRootElement +public class StoreCostRevenueEntity implements Serializable { + + private static final long serialVersionUID = -200046861151928605L; + + private String storeId;// 门店ID + + private String storeNo;// 门店编号 + + private String storeName;// 门店名称 + + private String workId;// 员工ID + + private String workNo;// 员工编号 + + private String workName;// 员工名称 + + private String shiftNo;// 当前班次 + + private String shiftName;// 班次名称 + + private String posNo;// POS编号 + + private String name;// 名称 + + private Double money;// 金额 + + private Integer type;// 类型 + + private String description;// 备注信息 + + private String memo;// 备注信息 + + private String inputDate;// 登记时间 + + private String deviceName;//设备名称 + + private String deviceMac;//设备MAC + + private String deviceIp;//设备IP + + + public StoreCostRevenueEntity() { + + } + + public StoreCostRevenueEntity(JSONObject json) { + storeId = json.getString("storeId");// 门店ID + storeNo = json.getString("storeNo");// 门店编号 + storeName = json.getString("storeName");// 门店名称 + workId = json.getString("workId");// 员工ID + workNo = json.getString("workNo");// 员工编号 + workName = json.getString("workName");// 员工名称 + shiftNo = json.getString("shiftNo");// 当前班次 + shiftName = json.getString("shiftName");// 班次名称 + posNo = json.getString("posNo");// POS编号 + name = json.getString("name");// 名称 + money = json.getDouble("money");// 金额 + type = json.getInteger("type");// 类型 + description = json.getString("description");// 备注信息 + memo = json.getString("memo");// 备注说明 + inputDate = json.getString("inputDate");// 登记时间 + deviceName= json.getString("deviceName");// 设备名称 + deviceMac= json.getString("deviceMac");// 设备MAC + deviceIp= json.getString("deviceIp");// 设备IP + } + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getStoreNo() { + return storeNo; + } + + public void setStoreNo(String storeNo) { + this.storeNo = storeNo; + } + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + + public String getWorkId() { + return workId; + } + + public void setWorkId(String workId) { + this.workId = workId; + } + + public String getWorkNo() { + return workNo; + } + + public void setWorkNo(String workNo) { + this.workNo = workNo; + } + + public String getWorkName() { + return workName; + } + + public void setWorkName(String workName) { + this.workName = workName; + } + + public String getShiftNo() { + return shiftNo; + } + + public void setShiftNo(String shiftNo) { + this.shiftNo = shiftNo; + } + + public String getShiftName() { + return shiftName; + } + + public void setShiftName(String shiftName) { + this.shiftName = shiftName; + } + + public String getPosNo() { + return posNo; + } + + public void setPosNo(String posNo) { + this.posNo = posNo; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Double getMoney() { + return money; + } + + public void setMoney(Double money) { + this.money = money; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getMemo() { + return memo; + } + + public void setMemo(String memo) { + this.memo = memo; + } + + public String getInputDate() { + return inputDate; + } + + public void setInputDate(String inputDate) { + this.inputDate = inputDate; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getDeviceMac() { + return deviceMac; + } + + public void setDeviceMac(String deviceMac) { + this.deviceMac = deviceMac; + } + + public String getDeviceIp() { + return deviceIp; + } + + public void setDeviceIp(String deviceIp) { + this.deviceIp = deviceIp; + } + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreHandoverDetailEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreHandoverDetailEntity.java new file mode 100644 index 0000000..f402e31 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreHandoverDetailEntity.java @@ -0,0 +1,135 @@ +package com.jwsaas.api.entity.upload; + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +import com.alibaba.fastjson.JSONObject; +import com.fasterxml.jackson.annotation.JsonAutoDetect; + +@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) +@XmlAccessorType(XmlAccessType.FIELD) +@XmlRootElement +public class StoreHandoverDetailEntity implements Serializable { + + private static final long serialVersionUID = -9118307744846790018L; + + @XmlElement(name = "clientId") + private String clientId;// 前台系统ID + + @XmlElement(name = "payModeNo") + private String payModeNo;// 收银方式编号 + + @XmlElement(name = "payModeName") + private String payModeName;// 收银方式名称 + + @XmlElement(name = "count") + private Integer count;// 数量 + + @XmlElement(name = "money") + private Double money;// 金额 + + @XmlElement(name = "handsMoney") + private Double handsMoney;// 手工金额 + + @XmlElement(name = "cardCount") + private Integer cardCount;// 卡务次数 + + @XmlElement(name = "cardMoney") + private Double cardMoney;// 卡务金额 + + @XmlElement(name = "sumMoney") + private Double sumMoney;// 总金额 + + public StoreHandoverDetailEntity() { + + } + + public StoreHandoverDetailEntity(JSONObject json) { + clientId = json.getString("id");// 前台系统ID + payModeNo = json.getString("payModeNo");// 收银方式编号 + payModeName = json.getString("payModeName");// 收银方式名称 + count = json.getInteger("count");// 数量 + money = json.getDouble("money");// 金额 + handsMoney = json.getDouble("handsMoney");// 手工金额 + cardCount = json.getInteger("cardCount");// 卡务次数 + cardMoney = json.getDouble("cardMoney");// 卡务金额 + sumMoney = json.getDouble("sumMoney");// 总金额 + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getPayModeNo() { + return payModeNo; + } + + public void setPayModeNo(String payModeNo) { + this.payModeNo = payModeNo; + } + + public String getPayModeName() { + return payModeName; + } + + public void setPayModeName(String payModeName) { + this.payModeName = payModeName; + } + + public Integer getCount() { + return count; + } + + public void setCount(Integer count) { + this.count = count; + } + + public Double getMoney() { + return money; + } + + public void setMoney(Double money) { + this.money = money; + } + + public Double getHandsMoney() { + return handsMoney; + } + + public void setHandsMoney(Double handsMoney) { + this.handsMoney = handsMoney; + } + + public Integer getCardCount() { + return cardCount; + } + + public void setCardCount(Integer cardCount) { + this.cardCount = cardCount; + } + + public Double getCardMoney() { + return cardMoney; + } + + public void setCardMoney(Double cardMoney) { + this.cardMoney = cardMoney; + } + + public Double getSumMoney() { + return sumMoney; + } + + public void setSumMoney(Double sumMoney) { + this.sumMoney = sumMoney; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreHandoverDetailPartEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreHandoverDetailPartEntity.java new file mode 100644 index 0000000..594694c --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreHandoverDetailPartEntity.java @@ -0,0 +1,92 @@ +package com.jwsaas.api.entity.upload; + +import java.io.Serializable; + +import com.alibaba.fastjson.JSONObject; +import com.fasterxml.jackson.annotation.JsonAutoDetect; + +@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) +public class StoreHandoverDetailPartEntity implements Serializable { + + private static final long serialVersionUID = -1614711338196058138L; + + private String clientId;// 前台系统ID + + private String specName;// 规格名称 + + private Double preCount;// 初始数量 + + private Double count;// 系统数量 + + private Double handsCount;// 手工数量 + + private Double difCount;// 差异数量 + + public StoreHandoverDetailPartEntity() { + + } + + public StoreHandoverDetailPartEntity(JSONObject json) { + + clientId = json.getString("id");// 前台系统ID + + specName = json.getString("specName");// 规格名称 + + preCount = json.getDouble("preCount");// 系统数量 + + count = json.getDouble("count");// 系统数量 + + handsCount = json.getDouble("handsCount");// 手工数量 + + difCount = json.getDouble("difCount");// 差异数量 + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getSpecName() { + return specName; + } + + public void setSpecName(String specName) { + this.specName = specName; + } + + public Double getCount() { + return count; + } + + public void setCount(Double count) { + this.count = count; + } + + public Double getHandsCount() { + return handsCount; + } + + public void setHandsCount(Double handsCount) { + this.handsCount = handsCount; + } + + public Double getPreCount() { + return preCount; + } + + public void setPreCount(Double preCount) { + this.preCount = preCount; + } + + public Double getDifCount() { + return difCount; + } + + public void setDifCount(Double difCount) { + this.difCount = difCount; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreHandoverDetailPayEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreHandoverDetailPayEntity.java new file mode 100644 index 0000000..6e0192c --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreHandoverDetailPayEntity.java @@ -0,0 +1,96 @@ +package com.jwsaas.api.entity.upload; + +import java.io.Serializable; + +import com.alibaba.fastjson.JSONObject; + +public class StoreHandoverDetailPayEntity implements Serializable { + + private static final long serialVersionUID = -7441812048043913518L; + + private String clientId;// 前台系统ID + private String payModeNo;// 收银方式编号 + private String payModeName;// 收银方式名称 + private Integer busMode;// 营业模式 + private Double money;// 金额 + private Integer count;// 数量 + private Integer busType;// 业务类型 + + public StoreHandoverDetailPayEntity() { + + } + + public StoreHandoverDetailPayEntity(JSONObject json) { + if (json.containsKey("id")) + clientId = json.getString("id"); + if (json.containsKey("payModeNo")) + payModeNo = json.getString("payModeNo"); + if (json.containsKey("payModeName")) + payModeName = json.getString("payModeName"); + if (json.containsKey("busMode")) + busMode = json.getInteger("busMode"); + if (json.containsKey("money")) + money = json.getDouble("money"); + if (json.containsKey("count")) + count = json.getInteger("count"); + if (json.containsKey("busType")) + busType = json.getInteger("busType"); + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getPayModeNo() { + return payModeNo; + } + + public void setPayModeNo(String payModeNo) { + this.payModeNo = payModeNo; + } + + public String getPayModeName() { + return payModeName; + } + + public void setPayModeName(String payModeName) { + this.payModeName = payModeName; + } + + public Integer getBusMode() { + return busMode; + } + + public void setBusMode(Integer busMode) { + this.busMode = busMode; + } + + public Double getMoney() { + return money; + } + + public void setMoney(Double money) { + this.money = money; + } + + public Integer getCount() { + return count; + } + + public void setCount(Integer count) { + this.count = count; + } + + public Integer getBusType() { + return busType; + } + + public void setBusType(Integer busType) { + this.busType = busType; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreHandoverEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreHandoverEntity.java new file mode 100644 index 0000000..5fdf43d --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreHandoverEntity.java @@ -0,0 +1,502 @@ +package com.jwsaas.api.entity.upload; + +import java.io.Serializable; +import java.util.Date; + +import com.alibaba.fastjson.JSONObject; + +public class StoreHandoverEntity implements Serializable { + + private static final long serialVersionUID = -5192734263188875505L; + + private String clientId;// 前台系统ID + + private String no;// 交班单号 + + private String storeId;// 门店ID + + private String storeNo;// 门店编号 + + private String storeName;// 门店名称 + + private String workId;// 员工ID + + private String workNo;// 员工编号 + + private String workName;// 员工名称 + + private String shiftNo;// 班次 + + private String shiftName;// 班次名称 + + private Date datetimeBegin;// 开始时间 + + private Date datetimeEnd;// 结束时间 + + private Date datetimeShift;// 交班时间 + + private String acceptWorkerNo;// 交单工号 + + private String posNo;// 交单POS + + private String memo;// 备注 + + private Integer peopleCount;// 总人数 + + private Integer dealTicketCount;// 成交单数 + + private Double dealAmount;// 成交金额 + + private Integer backTicketCount;// 退单次数 + + private Double backAmount;// 退单金额 + + private Integer ticketCount;// 合计单数 + + private Double amount;// 合计金额 + + private Double discountMoney;// 优惠金额 + + private Double couponDiscountMoney;//电子券抵扣金额 + + private Double otherDiscountMoney;//其他优惠金额 + + private Double receivable;// 实收金额 + + private Double maling;// 抹零金额 + + private Double paid;// 实收金额 + + private Integer cardCount;// 充值笔数 + + private Double cardRealMoney;// 卡充值金额 + + private Integer cardRefundCount;// 退卡笔数 + + private Double cardRefundMoney;// 退卡金额 + + private Double sumRealMoney;// 营业收入金额 + + private Double inmoney;// 非营业收入 + + private Double outmoney;// 非营业支出 + + private Double distributionFee;// 配送费(微信点餐) + + private Double shiftAmount;// 班次总收入金额 + + private Double imprest;// 备用金 + + private String deviceName;// 设备名称 + + private String deviceMac;// 设备MAC + + private String deviceIp;// 设备IP + + public StoreHandoverEntity() { + + } + + public StoreHandoverEntity(JSONObject json) { + clientId = json.getString("id");// 前台系统ID + no = json.getString("no");// 交班单号 + storeId = json.getString("storeId");// 门店ID + storeNo = json.getString("storeNo");// 门店编号 + storeName = json.getString("storeName");// 门店名称 + workId = json.getString("workId");// 员工ID + workNo = json.getString("workNo");// 员工编号. + workName = json.getString("workName");// 员工名称 + shiftNo = json.getString("shiftNo");// 班次 + shiftName = json.getString("shiftName");// 班次名称 + datetimeBegin = json.getDate("datetimeBegin");// 开始时间 + datetimeEnd = json.getDate("datetimeEnd");// 结束时间 + datetimeShift = json.getDate("datetimeShift");// 交班时间 + acceptWorkerNo = json.getString("acceptWorkerNo");// 交单工号 + posNo = json.getString("posNo");// 交单POS + memo = json.getString("memo");// 备注 + ticketCount = json.getInteger("ticketCount");// 合计单数 + peopleCount = json.getInteger("peopleCount");// 总人数 + amount = json.getDouble("amount");// 合计金额 + discountMoney = json.getDouble("discountMoney");// 优惠金额 + if(json.containsKey("couponDiscountMoney")){ + couponDiscountMoney = json.getDouble("couponDiscountMoney");// 电子券优惠 + }else{ + couponDiscountMoney = 0.00;// 充值笔数 + } + if(json.containsKey("otherDiscountMoney")){ + otherDiscountMoney = json.getDouble("otherDiscountMoney");// 其他优惠 + }else{ + otherDiscountMoney = 0.00;// 充值笔数 + } + receivable = json.getDouble("receivable");// 实收金额 + maling = json.getDouble("maling");// 抹零金额 + paid = json.getDouble("paid");// 实收金额 + cardCount = json.getInteger("cardCount");// 充值笔数 + cardRealMoney = json.getDouble("cardRealMoney");// 卡充值金额 + if(json.containsKey("cardRefundCount")){ + cardRefundCount = json.getInteger("cardRefundCount");// 充值笔数 + }else{ + cardRefundCount = 0;// 充值笔数 + } + if(json.containsKey("cardRefundMoney")){ + cardRefundMoney = json.getDouble("cardRefundMoney");// 卡充值金额 + }else{ + cardRefundMoney = 0.00;// 充值笔数 + } + sumRealMoney = json.getDouble("sumRealMoney");// 总收入金额 + imprest = json.getDouble("imprest");// 备用金 + inmoney = json.getDouble("inmoney");// 非营业收入 + outmoney = json.getDouble("outmoney");// 非营业支出 + if(json.containsKey("distributionFee")){ + distributionFee = json.getDouble("distributionFee");// 充值笔数 + }else{ + distributionFee = 0.00;// 充值笔数 + } + dealTicketCount = json.getInteger("dealTicketCount");// 成交单数 + dealAmount = json.getDouble("dealAmount");// 成交金额 + backTicketCount = json.getInteger("backTicketCount");// 退单次数 + backAmount = json.getDouble("backAmount");// 退单金额 + shiftAmount = json.getDouble("shiftAmount");// 班次总收入金额 + deviceName = json.getString("deviceName");// 设备名称 + deviceMac = json.getString("deviceMac");// 设备MAC + deviceIp = json.getString("deviceIp");// 设备IP + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getNo() { + return no; + } + + public void setNo(String no) { + this.no = no; + } + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getStoreNo() { + return storeNo; + } + + public void setStoreNo(String storeNo) { + this.storeNo = storeNo; + } + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + + public String getWorkId() { + return workId; + } + + public void setWorkId(String workId) { + this.workId = workId; + } + + public String getWorkNo() { + return workNo; + } + + public void setWorkNo(String workNo) { + this.workNo = workNo; + } + + public String getWorkName() { + return workName; + } + + public void setWorkName(String workName) { + this.workName = workName; + } + + public String getShiftNo() { + return shiftNo; + } + + public void setShiftNo(String shiftNo) { + this.shiftNo = shiftNo; + } + + public String getShiftName() { + return shiftName; + } + + public void setShiftName(String shiftName) { + this.shiftName = shiftName; + } + + public Date getDatetimeBegin() { + return datetimeBegin; + } + + public void setDatetimeBegin(Date datetimeBegin) { + this.datetimeBegin = datetimeBegin; + } + + public Date getDatetimeEnd() { + return datetimeEnd; + } + + public void setDatetimeEnd(Date datetimeEnd) { + this.datetimeEnd = datetimeEnd; + } + + public Date getDatetimeShift() { + return datetimeShift; + } + + public void setDatetimeShift(Date datetimeShift) { + this.datetimeShift = datetimeShift; + } + + public String getAcceptWorkerNo() { + return acceptWorkerNo; + } + + public void setAcceptWorkerNo(String acceptWorkerNo) { + this.acceptWorkerNo = acceptWorkerNo; + } + + public String getPosNo() { + return posNo; + } + + public void setPosNo(String posNo) { + this.posNo = posNo; + } + + public String getMemo() { + return memo; + } + + public void setMemo(String memo) { + this.memo = memo; + } + + public Integer getTicketCount() { + return ticketCount; + } + + public void setTicketCount(Integer ticketCount) { + this.ticketCount = ticketCount; + } + + public Integer getPeopleCount() { + return peopleCount; + } + + public void setPeopleCount(Integer peopleCount) { + this.peopleCount = peopleCount; + } + + public Double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + + public Double getDiscountMoney() { + return discountMoney; + } + + public void setDiscountMoney(Double discountMoney) { + this.discountMoney = discountMoney; + } + + public Double getCouponDiscountMoney() { + return couponDiscountMoney; + } + + public void setCouponDiscountMoney(Double couponDiscountMoney) { + this.couponDiscountMoney = couponDiscountMoney; + } + + public Double getOtherDiscountMoney() { + return otherDiscountMoney; + } + + public void setOtherDiscountMoney(Double otherDiscountMoney) { + this.otherDiscountMoney = otherDiscountMoney; + } + + public Double getReceivable() { + return receivable; + } + + public void setReceivable(Double receivable) { + this.receivable = receivable; + } + + public Double getMaling() { + return maling; + } + + public void setMaling(Double maling) { + this.maling = maling; + } + + public Double getPaid() { + return paid; + } + + public void setPaid(Double paid) { + this.paid = paid; + } + + public Integer getCardCount() { + return cardCount; + } + + public void setCardCount(Integer cardCount) { + this.cardCount = cardCount; + } + + public Double getCardRealMoney() { + return cardRealMoney; + } + + public void setCardRealMoney(Double cardRealMoney) { + this.cardRealMoney = cardRealMoney; + } + + + public Integer getCardRefundCount() { + return cardRefundCount; + } + + public void setCardRefundCount(Integer cardRefundCount) { + this.cardRefundCount = cardRefundCount; + } + + public Double getCardRefundMoney() { + return cardRefundMoney; + } + + public void setCardRefundMoney(Double cardRefundMoney) { + this.cardRefundMoney = cardRefundMoney; + } + + public Double getSumRealMoney() { + return sumRealMoney; + } + + public void setSumRealMoney(Double sumRealMoney) { + this.sumRealMoney = sumRealMoney; + } + + public Double getImprest() { + return imprest; + } + + public void setImprest(Double imprest) { + this.imprest = imprest; + } + + public Double getInmoney() { + return inmoney; + } + + public void setInmoney(Double inmoney) { + this.inmoney = inmoney; + } + + public Double getOutmoney() { + return outmoney; + } + + public void setOutmoney(Double outmoney) { + this.outmoney = outmoney; + } + + public Double getDistributionFee() { + return distributionFee; + } + + public void setDistributionFee(Double distributionFee) { + this.distributionFee = distributionFee; + } + + public Integer getDealTicketCount() { + return dealTicketCount; + } + + public void setDealTicketCount(Integer dealTicketCount) { + this.dealTicketCount = dealTicketCount; + } + + public Double getDealAmount() { + return dealAmount; + } + + public void setDealAmount(Double dealAmount) { + this.dealAmount = dealAmount; + } + + public Integer getBackTicketCount() { + return backTicketCount; + } + + public void setBackTicketCount(Integer backTicketCount) { + this.backTicketCount = backTicketCount; + } + + public Double getBackAmount() { + return backAmount; + } + + public void setBackAmount(Double backAmount) { + this.backAmount = backAmount; + } + + public Double getShiftAmount() { + return shiftAmount; + } + + public void setShiftAmount(Double shiftAmount) { + this.shiftAmount = shiftAmount; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getDeviceMac() { + return deviceMac; + } + + public void setDeviceMac(String deviceMac) { + this.deviceMac = deviceMac; + } + + public String getDeviceIp() { + return deviceIp; + } + + public void setDeviceIp(String deviceIp) { + this.deviceIp = deviceIp; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreOperationLogEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreOperationLogEntity.java new file mode 100644 index 0000000..52b0a22 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreOperationLogEntity.java @@ -0,0 +1,211 @@ +package com.jwsaas.api.entity.upload; + +import java.io.Serializable; + +import com.alibaba.fastjson.JSONObject; + +public class StoreOperationLogEntity implements Serializable { + + private static final long serialVersionUID = 7922187392242329079L; + + private String clientId;// 前台系统ID + + private String tenantId;// 租户ID + + private String storeId;// 门店ID + + private String storeNo;// 门店编号 + + private String storeName;// 门店名称 + + private String workerNo;// 员工工号 + + private String shiftNo;// 班次编号 + + private String shiftName;// 班次名称 + + private String deviceName;// 设备名 + + private String deviceMac;// 设备MAC + + private String deviceIp;// 设备IP + + private String posNo;// POS编号 + + private String operationTime;// 操作时间 + + private String type;// 类型 + + private String typeTxt;// 类型名称 + + private String memo;// 备注说明 + + + public StoreOperationLogEntity() { + + } + + public StoreOperationLogEntity(JSONObject json) { + if (json.containsKey("id")) + clientId = json.getString("id");// 前台系统ID + if (json.containsKey("tenantId")) + tenantId = json.getString("tenantId");// 租户ID + if (json.containsKey("storeId")) + storeId = json.getString("storeId");// 门店ID + if (json.containsKey("storeNo")) + storeNo = json.getString("storeNo");// 门店编号 + if (json.containsKey("storeName")) + storeName = json.getString("storeName");// 门店名称 + if (json.containsKey("workerNo")) + workerNo = json.getString("workerNo");// 员工编号 + if (json.containsKey("shiftNo")) + shiftNo = json.getString("shiftNo");// 班次编号 + if (json.containsKey("shiftName")) + shiftName = json.getString("shiftName");// 班次名称 + if (json.containsKey("deviceName")) + deviceName = json.getString("deviceName");// 设备名称 + if (json.containsKey("deviceMac")) + deviceMac = json.getString("deviceMac");// 设备MAC + if (json.containsKey("deviceIp")) + deviceIp = json.getString("deviceIp");// 设备IP + if (json.containsKey("posNo")) + posNo = json.getString("posNo");// POS编号 + if (json.containsKey("operationTime")) + operationTime = json.getString("operationTime");// 操作时间 + if (json.containsKey("type")) + type = json.getString("type");// 操作类型 + if (json.containsKey("typeTxt")) + typeTxt = json.getString("typeTxt");// 操作类型说明 + if (json.containsKey("memo")) + memo = json.getString("memo");// 备注说明 + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getStoreNo() { + return storeNo; + } + + public void setStoreNo(String storeNo) { + this.storeNo = storeNo; + } + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + + public String getWorkerNo() { + return workerNo; + } + + public void setWorkerNo(String workerNo) { + this.workerNo = workerNo; + } + + public String getShiftNo() { + return shiftNo; + } + + public void setShiftNo(String shiftNo) { + this.shiftNo = shiftNo; + } + + public String getShiftName() { + return shiftName; + } + + public void setShiftName(String shiftName) { + this.shiftName = shiftName; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getDeviceMac() { + return deviceMac; + } + + public void setDeviceMac(String deviceMac) { + this.deviceMac = deviceMac; + } + + public String getDeviceIp() { + return deviceIp; + } + + public void setDeviceIp(String deviceIp) { + this.deviceIp = deviceIp; + } + + public String getPosNo() { + return posNo; + } + + public void setPosNo(String posNo) { + this.posNo = posNo; + } + + public String getOperationTime() { + return operationTime; + } + + public void setOperationTime(String operationTime) { + this.operationTime = operationTime; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getTypeTxt() { + return typeTxt; + } + + public void setTypeTxt(String typeTxt) { + this.typeTxt = typeTxt; + } + + public String getMemo() { + return memo; + } + + public void setMemo(String memo) { + this.memo = memo; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreOrderBurdenEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreOrderBurdenEntity.java new file mode 100644 index 0000000..b535d0b --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreOrderBurdenEntity.java @@ -0,0 +1,125 @@ +package com.jwsaas.api.entity.upload; + +import java.io.Serializable; + +import com.alibaba.fastjson.JSONObject; + +public class StoreOrderBurdenEntity implements Serializable { + + private static final long serialVersionUID = 7922187392242329079L; + + private String clientId;// 前台系统ID + + private String tenantId;// 租户ID + + private String storeId;// 门店ID + + private String orderId;// 订单ID + + private String tradeNo;// 订单号 + + private String burdenProductId;// 配料产品ID + + private String burdenSpecId;// 配料产品规格ID + + private String salesUnitId;// 销售单位ID + + private Double salesAmount;// 销售量 + + public StoreOrderBurdenEntity() { + + } + + public StoreOrderBurdenEntity(JSONObject json) { + if (json.containsKey("id")) + clientId = json.getString("id");// 前台系统ID + if (json.containsKey("tenantId")) + tenantId = json.getString("tenantId");// 租户ID + if (json.containsKey("storeId")) + storeId = json.getString("storeId");// 门店ID + if (json.containsKey("orderId")) + orderId = json.getString("orderId");// 订单ID + if (json.containsKey("tradeNo")) + tradeNo = json.getString("tradeNo");// 订单号 + if (json.containsKey("burdenProductId")) + burdenProductId = json.getString("burdenProductId");// 配料产品ID + if (json.containsKey("burdenSpecId")) + burdenSpecId = json.getString("burdenSpecId");// 配料产品规格ID + if (json.containsKey("salesUnitId")) + salesUnitId = json.getString("salesUnitId");// 销售单位ID + if (json.containsKey("salesAmount")) + salesAmount = json.getDouble("salesAmount");// 销售量 + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getOrderId() { + return orderId; + } + + public void setOrderId(String orderId) { + this.orderId = orderId; + } + + public String getTradeNo() { + return tradeNo; + } + + public void setTradeNo(String tradeNo) { + this.tradeNo = tradeNo; + } + + public String getBurdenProductId() { + return burdenProductId; + } + + public void setBurdenProductId(String burdenProductId) { + this.burdenProductId = burdenProductId; + } + + public String getBurdenSpecId() { + return burdenSpecId; + } + + public void setBurdenSpecId(String burdenSpecId) { + this.burdenSpecId = burdenSpecId; + } + + public String getSalesUnitId() { + return salesUnitId; + } + + public void setSalesUnitId(String salesUnitId) { + this.salesUnitId = salesUnitId; + } + + public Double getSalesAmount() { + return salesAmount; + } + + public void setSalesAmount(Double salesAmount) { + this.salesAmount = salesAmount; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreOrderProductEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreOrderProductEntity.java new file mode 100644 index 0000000..b998b46 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreOrderProductEntity.java @@ -0,0 +1,512 @@ +package com.jwsaas.api.entity.upload; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; + +public class StoreOrderProductEntity implements Serializable { + + private static final long serialVersionUID = 6017086791714799740L; + + private String clientId;// 前台系统ID + + private String parentId;// 父记录ID + + private String productId;// 菜品ID + + private String productNo;// 菜品编号 + + private String productName;// 菜品名称 + + private String productUnitId;// 菜品单位 + + private String productUnitName;// 菜品单位名 + + private String seriesId;// 大类ID + + private String seriesName;// 大类名称 + + private String typePath;// 类别路径 + + private String typeId;// 类别ID + + private String typeName;// 类别名 + + private String specId;// 规格ID + + private String specName;// 规格名称 + + private Double count;// 数量 + + private Double rcount;// 退菜数量 + + private Double price;// 销售价格 + + private Double discountPrice;// 折后价格 + + private Double priceOrg;// 菜品原价 + + private Integer isSuit;// 是否套菜 + + private String suitId;// 套菜ID + + private Date saleDate;// 销售时间 + + private Double amount;// 消费金额 + + private Double discount;// 优惠率 + + private Double discountTotal;// 优惠额 + + private Double receivable;// 应收金额 + + private Double addPriceTotal;// 加价金额 + + private Double discountAddTotal;// 加价优惠金额 + + private Double amountAddTotal;// 加价应收金额 + + private Double amountTotal;// 消费总额 + + private Double receivableTotal;// 应收总金额(应收总额+做法总额) + + private Integer lineNo;// 行号 + private Double estimatedCost;// 预估成本 + private Double estimatedProfitAmount;// 预估毛利金额 + private Double estimatedProfitMargin;// 预估毛利率 + private Double totalCost;// 实际成本 + private Double profitAmount;// 实际毛利金额 + private Double profitMargin;// 实际毛利率 + + private List productInfo;// 菜品销售记录优惠明细 + + private List productMake;// 销售单做法 + + public StoreOrderProductEntity() { + + } + + public StoreOrderProductEntity(JSONObject json) { + if (json.containsKey("id")) + clientId = json.getString("id");// 前台系统ID + if (json.containsKey("parentId")) + parentId = json.getString("parentId");// 父记录ID + if (json.containsKey("productId")) + productId = json.getString("productId");// 菜品ID + if (json.containsKey("productNo")) + productNo = json.getString("productNo");// 菜品编号 + if (json.containsKey("productName")) + productName = json.getString("productName");// 菜品名称 + if (json.containsKey("productUnitId")) + productUnitId = json.getString("productUnitId");// 菜品单位 + if (json.containsKey("productUnitName")) + productUnitName = json.getString("productUnitName");// 菜品单位名 + if (json.containsKey("seriesId")) + seriesId = json.getString("seriesId");// 菜品大类ID + if (json.containsKey("seriesName")) + seriesName = json.getString("seriesName");// 菜品大类名称 + if (json.containsKey("typePath")) + typePath = json.getString("typePath");// 菜品大类路径 + if (json.containsKey("typeId")) + typeId = json.getString("typeId");// 类别ID + if (json.containsKey("typeName")) + typeName = json.getString("typeName");// 类别名 + if (json.containsKey("specId")) + specId = json.getString("specId");// 规格ID + if (json.containsKey("specName")) + specName = json.getString("specName");// 规格名称 + if (json.containsKey("count")) + count = json.getDouble("count");// 数量 + if (json.containsKey("rcount")) + rcount = json.getDouble("rcount");// 退菜数量 + if (json.containsKey("price")) + price = json.getDouble("price");// 销售价格 + if (json.containsKey("discountPrice")) + discountPrice = json.getDouble("discountPrice");// 折后价格 + if (json.containsKey("priceOrg")) + priceOrg = json.getDouble("priceOrg");// 菜品原价 + if (json.containsKey("isSuit")) + isSuit = json.getInteger("isSuit");// 是否套菜 + if (json.containsKey("suitId")) + suitId = json.getString("suitId");// 套菜ID + if (json.containsKey("saleDate")) + saleDate = json.getDate("saleDate");// 销售时间 + if (json.containsKey("amount")) + amount = json.getDouble("amount");// 消费金额 + if (json.containsKey("discount")) + discount = json.getDouble("discount");// 优惠率 + if (json.containsKey("discountTotal")) + discountTotal = json.getDouble("discountTotal");// 优惠额 + if (json.containsKey("receivable")) + receivable = json.getDouble("receivable");// 应收金额 + if (json.containsKey("addPriceTotal")) + addPriceTotal = json.getDouble("addPriceTotal");// 加价总额 + if (json.containsKey("discountAddTotal")) + discountAddTotal = json.getDouble("discountAddTotal");// 加价优惠金额 + if (json.containsKey("amountAddTotal")) + amountAddTotal = json.getDouble("amountAddTotal");// 加价应收金额 + if (json.containsKey("amountTotal")) + amountTotal = json.getDouble("amountTotal");// 消费总额 + if (json.containsKey("receivableTotal")) + receivableTotal = json.getDouble("receivableTotal");// 应收总额 + if (json.containsKey("lineNo")) + lineNo = json.getInteger("lineNo");// 行号 + if (json.containsKey("estimatedCost")) + estimatedCost = json.getDouble("estimatedCost");// 预估成本 + if (json.containsKey("estimatedProfitAmount")) + estimatedProfitAmount = json.getDouble("estimatedProfitAmount");// 预估毛利金额 + if (json.containsKey("estimatedProfitMargin")) + estimatedProfitMargin = json.getDouble("estimatedProfitMargin");// 预估毛利率 + if (json.containsKey("totalCost")) + totalCost = json.getDouble("totalCost");// 实际成本 + if (json.containsKey("profitAmount")) + profitAmount = json.getDouble("profitAmount");// 实际毛利金额 + if (json.containsKey("profitMargin")) + profitMargin = json.getDouble("profitMargin");// 实际毛利率 + + if (json.containsKey("product_info")) { + JSONArray product_info = json.getJSONArray("product_info"); + productInfo = new ArrayList<>(); + for (int i = 0; i < product_info.size(); i++) { + JSONObject infoObject = product_info.getJSONObject(i); + StoreOrderProductInfoEntity entity = new StoreOrderProductInfoEntity(infoObject); + productInfo.add(entity); + } + } + if (json.containsKey("product_make")) { + JSONArray product_make = json.getJSONArray("product_make"); + productMake = new ArrayList<>(); + for (int i = 0; i < product_make.size(); i++) { + JSONObject makeObject = product_make.getJSONObject(i); + StoreOrderProductMakeEntity entity = new StoreOrderProductMakeEntity(makeObject); + productMake.add(entity); + } + } + + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getParentId() { + return parentId; + } + + public void setParentId(String parentId) { + this.parentId = parentId; + } + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId; + } + + public String getProductNo() { + return productNo; + } + + public void setProductNo(String productNo) { + this.productNo = productNo; + } + + public String getProductName() { + return productName; + } + + public void setProductName(String productName) { + this.productName = productName; + } + + public String getProductUnitId() { + return productUnitId; + } + + public void setProductUnitId(String productUnitId) { + this.productUnitId = productUnitId; + } + + public String getProductUnitName() { + return productUnitName; + } + + public void setProductUnitName(String productUnitName) { + this.productUnitName = productUnitName; + } + + public String getSeriesId() { + return seriesId; + } + + public void setSeriesId(String seriesId) { + this.seriesId = seriesId; + } + + public String getSeriesName() { + return seriesName; + } + + public void setSeriesName(String seriesName) { + this.seriesName = seriesName; + } + + public String getTypePath() { + return typePath; + } + + public void setTypePath(String typePath) { + this.typePath = typePath; + } + + public String getTypeId() { + return typeId; + } + + public void setTypeId(String typeId) { + this.typeId = typeId; + } + + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public String getSpecId() { + return specId; + } + + public void setSpecId(String specId) { + this.specId = specId; + } + + public String getSpecName() { + return specName; + } + + public void setSpecName(String specName) { + this.specName = specName; + } + + public Double getCount() { + return count; + } + + public void setCount(Double count) { + this.count = count; + } + + public Double getRcount() { + return rcount; + } + + public void setRcount(Double rcount) { + this.rcount = rcount; + } + + public Double getPrice() { + return price; + } + + public void setPrice(Double price) { + this.price = price; + } + + public Double getDiscountPrice() { + return discountPrice; + } + + public void setDiscountPrice(Double discountPrice) { + this.discountPrice = discountPrice; + } + + public Double getPriceOrg() { + return priceOrg; + } + + public void setPriceOrg(Double priceOrg) { + this.priceOrg = priceOrg; + } + + public Integer getIsSuit() { + return isSuit; + } + + public void setIsSuit(Integer isSuit) { + this.isSuit = isSuit; + } + + public String getSuitId() { + return suitId; + } + + public void setSuitId(String suitId) { + this.suitId = suitId; + } + + public Date getSaleDate() { + return saleDate; + } + + public void setSaleDate(Date saleDate) { + this.saleDate = saleDate; + } + + public Double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + + public Double getDiscount() { + return discount; + } + + public void setDiscount(Double discount) { + this.discount = discount; + } + + public Double getDiscountTotal() { + return discountTotal; + } + + public void setDiscountTotal(Double discountTotal) { + this.discountTotal = discountTotal; + } + + public Double getReceivable() { + return receivable; + } + + public void setReceivable(Double receivable) { + this.receivable = receivable; + } + + public Double getAddPriceTotal() { + return addPriceTotal; + } + + public void setAddPriceTotal(Double addPriceTotal) { + this.addPriceTotal = addPriceTotal; + } + + public Double getDiscountAddTotal() { + return discountAddTotal; + } + + public void setDiscountAddTotal(Double discountAddTotal) { + this.discountAddTotal = discountAddTotal; + } + + public Double getAmountAddTotal() { + return amountAddTotal; + } + + public void setAmountAddTotal(Double amountAddTotal) { + this.amountAddTotal = amountAddTotal; + } + + public Double getAmountTotal() { + return amountTotal; + } + + public void setAmountTotal(Double amountTotal) { + this.amountTotal = amountTotal; + } + + public Double getReceivableTotal() { + return receivableTotal; + } + + public void setReceivableTotal(Double receivableTotal) { + this.receivableTotal = receivableTotal; + } + + public Integer getLineNo() { + return lineNo; + } + + public void setLineNo(Integer lineNo) { + this.lineNo = lineNo; + } + + public Double getEstimatedCost() { + return estimatedCost; + } + + public void setEstimatedCost(Double estimatedCost) { + this.estimatedCost = estimatedCost; + } + + public Double getEstimatedProfitAmount() { + return estimatedProfitAmount; + } + + public void setEstimatedProfitAmount(Double estimatedProfitAmount) { + this.estimatedProfitAmount = estimatedProfitAmount; + } + + public Double getEstimatedProfitMargin() { + return estimatedProfitMargin; + } + + public void setEstimatedProfitMargin(Double estimatedProfitMargin) { + this.estimatedProfitMargin = estimatedProfitMargin; + } + + public Double getTotalCost() { + return totalCost; + } + + public void setTotalCost(Double totalCost) { + this.totalCost = totalCost; + } + + public Double getProfitAmount() { + return profitAmount; + } + + public void setProfitAmount(Double profitAmount) { + this.profitAmount = profitAmount; + } + + public Double getProfitMargin() { + return profitMargin; + } + + public void setProfitMargin(Double profitMargin) { + this.profitMargin = profitMargin; + } + + public List getProductInfo() { + return productInfo; + } + + public void setProductInfo(List productInfo) { + this.productInfo = productInfo; + } + + public List getProductMake() { + return productMake; + } + + public void setProductMake(List productMake) { + this.productMake = productMake; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreOrderProductExtendEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreOrderProductExtendEntity.java new file mode 100644 index 0000000..48e08a8 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreOrderProductExtendEntity.java @@ -0,0 +1,536 @@ +package com.jwsaas.api.entity.upload; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; + +public class StoreOrderProductExtendEntity implements Serializable { + + private static final long serialVersionUID = 7470765686334848699L; + + private String clientId;// 前台系统ID + private String parentId;// 父记录ID + private String productId;// 菜品ID + private String productNo;// 菜品编号 + private String productName;// 菜品名称 + private String productUnitId;// 菜品单位 + private String productUnitName;// 菜品单位名 + private String seriesId;// 大类ID + private String seriesName;// 大类名称 + private String typePath;// 类别路径 + private String typeId;// 类别ID + private String typeName;// 类别名 + private String specId;// 规格ID + private String specName;// 规格名称 + private Double count;// 数量 + private Double rcount;// 退菜数量 + private Double price;// 销售价格 + private Double discountPrice;// 折后价格 + private Double priceOrg;// 菜品原价 + private Integer isSuit;// 是否套菜 + private String suitId;// 套菜ID + private Date saleDate;// 销售时间 + private Double amount;// 消费金额 + private Double discount;// 优惠率 + private Double discountTotal;// 优惠额 + private Double receivable;// 应收金额 + private Double addPriceTotal;// 加价金额 + private Double discountAddTotal;// 加价优惠金额 + private Double amountAddTotal;// 加价应收金额 + private Double amountTotal;// 消费总额 + private Double receivableTotal;// 应收总金额(应收总额+做法总额) + private Integer lineNo;// 行号 + private Double estimatedCost;// 预估成本 + private Double estimatedProfitAmount;// 预估毛利金额 + private Double estimatedProfitMargin;// 预估毛利率 + private Double totalCost;// 实际成本 + private Double profitAmount;// 实际毛利金额 + private Double profitMargin;// 实际毛利率 + + private String tableNo;// 餐桌编号 + private String tableName;// 餐桌名称 + private String ext1;// 扩展信息1 + private String ext2;// 扩展信息2 + private String ext3;// 扩展信息3 + + private List productInfo;// 菜品销售记录优惠明细 + private List productMake;// 销售单做法 + + public StoreOrderProductExtendEntity() { + + } + + public StoreOrderProductExtendEntity(JSONObject json) { + if (json.containsKey("id")) + clientId = json.getString("id");// 前台系统ID + if (json.containsKey("parentId")) + parentId = json.getString("parentId");// 父记录ID + if (json.containsKey("productId")) + productId = json.getString("productId");// 菜品ID + if (json.containsKey("productNo")) + productNo = json.getString("productNo");// 菜品编号 + if (json.containsKey("productName")) + productName = json.getString("productName");// 菜品名称 + if (json.containsKey("productUnitId")) + productUnitId = json.getString("productUnitId");// 菜品单位 + if (json.containsKey("productUnitName")) + productUnitName = json.getString("productUnitName");// 菜品单位名 + if (json.containsKey("seriesId")) + seriesId = json.getString("seriesId");// 菜品大类 + if (json.containsKey("seriesName")) + seriesName = json.getString("seriesName");// 菜品大类名称 + if (json.containsKey("typePath")) + typePath = json.getString("typePath");// 菜品类别路径 + if (json.containsKey("typeId")) + typeId = json.getString("typeId");// 类别ID + if (json.containsKey("typeName")) + typeName = json.getString("typeName");// 类别名 + if (json.containsKey("specId")) + specId = json.getString("specId");// 规格ID + if (json.containsKey("specName")) + specName = json.getString("specName");// 规格名称 + if (json.containsKey("count")) + count = json.getDouble("count");// 数量 + if (json.containsKey("rcount")) + rcount = json.getDouble("rcount");// 退菜数量 + if (json.containsKey("price")) + price = json.getDouble("price");// 销售价格 + if (json.containsKey("discountPrice")) + discountPrice = json.getDouble("discountPrice");// 折后价格 + if (json.containsKey("priceOrg")) + priceOrg = json.getDouble("priceOrg");// 菜品原价 + if (json.containsKey("isSuit")) + isSuit = json.getInteger("isSuit");// 是否套菜 + if (json.containsKey("suitId")) + suitId = json.getString("suitId");// 套菜ID + if (json.containsKey("saleDate")) + saleDate = json.getDate("saleDate");// 销售时间 + if (json.containsKey("amount")) + amount = json.getDouble("amount");// 消费金额 + if (json.containsKey("discount")) + discount = json.getDouble("discount");// 优惠率 + if (json.containsKey("discountTotal")) + discountTotal = json.getDouble("discountTotal");// 优惠额 + if (json.containsKey("receivable")) + receivable = json.getDouble("receivable");// 应收金额 + if (json.containsKey("addPriceTotal")) + addPriceTotal = json.getDouble("addPriceTotal");// 加价总额 + if (json.containsKey("discountAddTotal")) + discountAddTotal = json.getDouble("discountAddTotal");// 加价优惠金额 + if (json.containsKey("amountAddTotal")) + amountAddTotal = json.getDouble("amountAddTotal");// 加价应收金额 + if (json.containsKey("amountTotal")) + amountTotal = json.getDouble("amountTotal");// 消费总额 + if (json.containsKey("receivableTotal")) + receivableTotal = json.getDouble("receivableTotal");// 应收总额 + if (json.containsKey("lineNo")) + lineNo = json.getInteger("lineNo");// 行号 + if (json.containsKey("estimatedCost")) + estimatedCost = json.getDouble("estimatedCost");// 预估成本 + if (json.containsKey("estimatedProfitAmount")) + estimatedProfitAmount = json.getDouble("estimatedProfitAmount");// 预估毛利金额 + if (json.containsKey("estimatedProfitMargin")) + estimatedProfitMargin = json.getDouble("estimatedProfitMargin");// 预估毛利率 + if (json.containsKey("totalCost")) + totalCost = json.getDouble("totalCost");// 实际成本 + if (json.containsKey("profitAmount")) + profitAmount = json.getDouble("profitAmount");// 实际毛利金额 + if (json.containsKey("profitMargin")) + profitMargin = json.getDouble("profitMargin");// 实际毛利率 + + if (json.containsKey("product_info")) { + JSONArray product_info = json.getJSONArray("product_info"); + productInfo = new ArrayList<>(); + for (int i = 0; i < product_info.size(); i++) { + JSONObject infoObject = product_info.getJSONObject(i); + StoreOrderProductInfoExtendEntity entity = new StoreOrderProductInfoExtendEntity(infoObject); + productInfo.add(entity); + } + } + if (json.containsKey("product_make")) { + JSONArray product_make = json.getJSONArray("product_make"); + productMake = new ArrayList<>(); + for (int i = 0; i < product_make.size(); i++) { + JSONObject makeObject = product_make.getJSONObject(i); + StoreOrderProductMakeExtendEntity entity = new StoreOrderProductMakeExtendEntity(makeObject); + productMake.add(entity); + } + } + + if (json.containsKey("tableNo")) + tableNo = json.getString("tableNo");// 餐桌编号 + if (json.containsKey("tableName")) + tableName = json.getString("tableName");// 餐桌名称 + if (json.containsKey("ext1")) + ext1 = json.getString("ext1");// 扩展信息1 + if (json.containsKey("ext2")) + ext2 = json.getString("ext2");// 扩展信息2 + if (json.containsKey("ext3")) + ext3 = json.getString("ext3");// 扩展信息3 + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getParentId() { + return parentId; + } + + public void setParentId(String parentId) { + this.parentId = parentId; + } + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId; + } + + public String getProductNo() { + return productNo; + } + + public void setProductNo(String productNo) { + this.productNo = productNo; + } + + public String getProductName() { + return productName; + } + + public void setProductName(String productName) { + this.productName = productName; + } + + public String getProductUnitId() { + return productUnitId; + } + + public void setProductUnitId(String productUnitId) { + this.productUnitId = productUnitId; + } + + public String getProductUnitName() { + return productUnitName; + } + + public void setProductUnitName(String productUnitName) { + this.productUnitName = productUnitName; + } + + public String getSeriesId() { + return seriesId; + } + + public void setSeriesId(String seriesId) { + this.seriesId = seriesId; + } + + public String getSeriesName() { + return seriesName; + } + + public void setSeriesName(String seriesName) { + this.seriesName = seriesName; + } + + public String getTypePath() { + return typePath; + } + + public void setTypePath(String typePath) { + this.typePath = typePath; + } + + public String getTypeId() { + return typeId; + } + + public void setTypeId(String typeId) { + this.typeId = typeId; + } + + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public String getSpecId() { + return specId; + } + + public void setSpecId(String specId) { + this.specId = specId; + } + + public String getSpecName() { + return specName; + } + + public void setSpecName(String specName) { + this.specName = specName; + } + + public Double getCount() { + return count; + } + + public void setCount(Double count) { + this.count = count; + } + + public Double getRcount() { + return rcount; + } + + public void setRcount(Double rcount) { + this.rcount = rcount; + } + + public Double getPrice() { + return price; + } + + public void setPrice(Double price) { + this.price = price; + } + + public Double getDiscountPrice() { + return discountPrice; + } + + public void setDiscountPrice(Double discountPrice) { + this.discountPrice = discountPrice; + } + + public Double getPriceOrg() { + return priceOrg; + } + + public void setPriceOrg(Double priceOrg) { + this.priceOrg = priceOrg; + } + + public Integer getIsSuit() { + return isSuit; + } + + public void setIsSuit(Integer isSuit) { + this.isSuit = isSuit; + } + + public String getSuitId() { + return suitId; + } + + public void setSuitId(String suitId) { + this.suitId = suitId; + } + + public Date getSaleDate() { + return saleDate; + } + + public void setSaleDate(Date saleDate) { + this.saleDate = saleDate; + } + + public Double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + + public Double getDiscount() { + return discount; + } + + public void setDiscount(Double discount) { + this.discount = discount; + } + + public Double getDiscountTotal() { + return discountTotal; + } + + public void setDiscountTotal(Double discountTotal) { + this.discountTotal = discountTotal; + } + + public Double getReceivable() { + return receivable; + } + + public void setReceivable(Double receivable) { + this.receivable = receivable; + } + + public Double getAddPriceTotal() { + return addPriceTotal; + } + + public void setAddPriceTotal(Double addPriceTotal) { + this.addPriceTotal = addPriceTotal; + } + + public Double getDiscountAddTotal() { + return discountAddTotal; + } + + public void setDiscountAddTotal(Double discountAddTotal) { + this.discountAddTotal = discountAddTotal; + } + + public Double getAmountAddTotal() { + return amountAddTotal; + } + + public void setAmountAddTotal(Double amountAddTotal) { + this.amountAddTotal = amountAddTotal; + } + + public Double getAmountTotal() { + return amountTotal; + } + + public void setAmountTotal(Double amountTotal) { + this.amountTotal = amountTotal; + } + + public Double getReceivableTotal() { + return receivableTotal; + } + + public void setReceivableTotal(Double receivableTotal) { + this.receivableTotal = receivableTotal; + } + + public Integer getLineNo() { + return lineNo; + } + + public void setLineNo(Integer lineNo) { + this.lineNo = lineNo; + } + + public Double getEstimatedCost() { + return estimatedCost; + } + + public void setEstimatedCost(Double estimatedCost) { + this.estimatedCost = estimatedCost; + } + + public Double getEstimatedProfitAmount() { + return estimatedProfitAmount; + } + + public void setEstimatedProfitAmount(Double estimatedProfitAmount) { + this.estimatedProfitAmount = estimatedProfitAmount; + } + + public Double getEstimatedProfitMargin() { + return estimatedProfitMargin; + } + + public void setEstimatedProfitMargin(Double estimatedProfitMargin) { + this.estimatedProfitMargin = estimatedProfitMargin; + } + + public Double getTotalCost() { + return totalCost; + } + + public void setTotalCost(Double totalCost) { + this.totalCost = totalCost; + } + + public Double getProfitAmount() { + return profitAmount; + } + + public void setProfitAmount(Double profitAmount) { + this.profitAmount = profitAmount; + } + + public Double getProfitMargin() { + return profitMargin; + } + + public void setProfitMargin(Double profitMargin) { + this.profitMargin = profitMargin; + } + + public String getTableNo() { + return tableNo; + } + + public void setTableNo(String tableNo) { + this.tableNo = tableNo; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public String getExt1() { + return ext1; + } + + public void setExt1(String ext1) { + this.ext1 = ext1; + } + + public String getExt2() { + return ext2; + } + + public void setExt2(String ext2) { + this.ext2 = ext2; + } + + public String getExt3() { + return ext3; + } + + public void setExt3(String ext3) { + this.ext3 = ext3; + } + + public List getProductInfo() { + return productInfo; + } + + public void setProductInfo(List productInfo) { + this.productInfo = productInfo; + } + + public List getProductMake() { + return productMake; + } + + public void setProductMake(List productMake) { + this.productMake = productMake; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreOrderProductInfoEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreOrderProductInfoEntity.java new file mode 100644 index 0000000..7dc3a91 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreOrderProductInfoEntity.java @@ -0,0 +1,78 @@ +package com.jwsaas.api.entity.upload; + +import java.io.Serializable; + +import com.alibaba.fastjson.JSONObject; + +public class StoreOrderProductInfoEntity implements Serializable { + + private static final long serialVersionUID = -2729141073352388840L; + + private String clientId;// 前台系统ID + + private String orderItemId;// 订单明细记录ID + + private Integer type;// 优惠类型 + + private String info;// 优惠说明 + + private Double discountMoney;// 优惠金额 + + public StoreOrderProductInfoEntity() { + + } + + public StoreOrderProductInfoEntity(JSONObject json) { + if (json.containsKey("id")) + clientId = json.getString("id");// 前台系统ID + if (json.containsKey("orderItemId")) + orderItemId = json.getString("orderItemId");// 订单明细记录ID + if (json.containsKey("type")) + type = json.getInteger("type");// 优惠类型 + if (json.containsKey("info")) + info = json.getString("info");// 优惠说明 + if (json.containsKey("discountMoney")) + discountMoney = json.getDouble("discountMoney");// 优惠金额 + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getOrderItemId() { + return orderItemId; + } + + public void setOrderItemId(String orderItemId) { + this.orderItemId = orderItemId; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } + + public Double getDiscountMoney() { + return discountMoney; + } + + public void setDiscountMoney(Double discountMoney) { + this.discountMoney = discountMoney; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreOrderProductInfoExtendEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreOrderProductInfoExtendEntity.java new file mode 100644 index 0000000..82d5848 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreOrderProductInfoExtendEntity.java @@ -0,0 +1,131 @@ +package com.jwsaas.api.entity.upload; + +import java.io.Serializable; + +import com.alibaba.fastjson.JSONObject; + +public class StoreOrderProductInfoExtendEntity implements Serializable { + + private static final long serialVersionUID = 5755901272572150862L; + + private String clientId;// 前台系统ID + private String orderItemId;// 订单明细记录ID + private Integer type;// 优惠类型 + private String info;// 优惠说明 + private Double discountMoney;// 优惠金额 + + private String tableNo;// 餐桌编号 + private String tableName;// 餐桌名称 + private String ext1;// 扩展信息1 + private String ext2;// 扩展信息2 + private String ext3;// 扩展信息3 + + public StoreOrderProductInfoExtendEntity() { + + } + + public StoreOrderProductInfoExtendEntity(JSONObject json) { + if (json.containsKey("id")) + clientId = json.getString("id");// 前台系统ID + if (json.containsKey("orderItemId")) + orderItemId = json.getString("orderItemId");// 订单明细记录ID + if (json.containsKey("type")) + type = json.getInteger("type");// 优惠类型 + if (json.containsKey("info")) + info = json.getString("info");// 优惠说明 + if (json.containsKey("discountMoney")) + discountMoney = json.getDouble("discountMoney");// 优惠金额 + + if (json.containsKey("tableNo")) + tableNo = json.getString("tableNo");// 餐桌编号 + if (json.containsKey("tableName")) + tableName = json.getString("tableName");// 餐桌名称 + if (json.containsKey("ext1")) + ext1 = json.getString("ext1");// 扩展信息1 + if (json.containsKey("ext2")) + ext2 = json.getString("ext2");// 扩展信息2 + if (json.containsKey("ext3")) + ext3 = json.getString("ext3");// 扩展信息3 + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getOrderItemId() { + return orderItemId; + } + + public void setOrderItemId(String orderItemId) { + this.orderItemId = orderItemId; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } + + public Double getDiscountMoney() { + return discountMoney; + } + + public void setDiscountMoney(Double discountMoney) { + this.discountMoney = discountMoney; + } + + public String getTableNo() { + return tableNo; + } + + public void setTableNo(String tableNo) { + this.tableNo = tableNo; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public String getExt1() { + return ext1; + } + + public void setExt1(String ext1) { + this.ext1 = ext1; + } + + public String getExt2() { + return ext2; + } + + public void setExt2(String ext2) { + this.ext2 = ext2; + } + + public String getExt3() { + return ext3; + } + + public void setExt3(String ext3) { + this.ext3 = ext3; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreOrderProductMakeEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreOrderProductMakeEntity.java new file mode 100644 index 0000000..d6db293 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreOrderProductMakeEntity.java @@ -0,0 +1,174 @@ +package com.jwsaas.api.entity.upload; + +import java.io.Serializable; + +import com.alibaba.fastjson.JSONObject; + +public class StoreOrderProductMakeEntity implements Serializable { + + private static final long serialVersionUID = -1423104643161740209L; + + private String clientId;// 前台系统ID + + private String orderItemId;// 订单明细记录ID + + private String makeId;// 做法ID + + private String makeName;// 做法名称 + + private Double addPrice;// 做法加价 + + private Double discountPrice;// 做法折后加价 + + private Double count;// 做法数量 + + private Double rcount;// 做法退数量 + + private Double addTotal;// 加价总额 + + private Double discountAddTotal;// 折后总额 + + private Double discount;// 折扣率 + + private Integer qtyFlag;// 做法管理数量标识 + + private Integer hand;// 手写做法标识 + + public StoreOrderProductMakeEntity() { + + } + + public StoreOrderProductMakeEntity(JSONObject json) { + if (json.containsKey("id")) + clientId = json.getString("id");// 前台系统ID + if (json.containsKey("orderItemId")) + orderItemId = json.getString("orderItemId");// 订单明细记录ID + if (json.containsKey("makeId")) + makeId = json.getString("makeId");// 做法ID + if (json.containsKey("makeName")) + makeName = json.getString("makeName");// 做法名称 + if (json.containsKey("addPrice")) + addPrice = json.getDouble("addPrice");// 做法加价 + if (json.containsKey("discountPrice")) + discountPrice = json.getDouble("discountPrice");// 做法折后加价 + if (json.containsKey("count")) + count = json.getDouble("count");// 做法数量 + if (json.containsKey("rcount")) + rcount = json.getDouble("rcount");// 做法退数量 + if (json.containsKey("addTotal")) + addTotal = json.getDouble("addTotal");// 加价总额 + if (json.containsKey("discountAddTotal")) + discountAddTotal = json.getDouble("discountAddTotal");// 折后总额 + if (json.containsKey("discount")) + discount = json.getDouble("discount");// 折扣率 + if (json.containsKey("qtyFlag")) + qtyFlag = json.getInteger("qtyFlag");// 做法管理数量标识 + if (json.containsKey("hand")) + hand = json.getInteger("hand");// 手写做法标识 + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getOrderItemId() { + return orderItemId; + } + + public void setOrderItemId(String orderItemId) { + this.orderItemId = orderItemId; + } + + public String getMakeId() { + return makeId; + } + + public void setMakeId(String makeId) { + this.makeId = makeId; + } + + public String getMakeName() { + return makeName; + } + + public void setMakeName(String makeName) { + this.makeName = makeName; + } + + public Double getAddPrice() { + return addPrice; + } + + public void setAddPrice(Double addPrice) { + this.addPrice = addPrice; + } + + public Double getDiscountPrice() { + return discountPrice; + } + + public void setDiscountPrice(Double discountPrice) { + this.discountPrice = discountPrice; + } + + public Double getCount() { + return count; + } + + public void setCount(Double count) { + this.count = count; + } + + public Double getRcount() { + return rcount; + } + + public void setRcount(Double rcount) { + this.rcount = rcount; + } + + public Double getAddTotal() { + return addTotal; + } + + public void setAddTotal(Double addTotal) { + this.addTotal = addTotal; + } + + public Double getDiscountAddTotal() { + return discountAddTotal; + } + + public void setDiscountAddTotal(Double discountAddTotal) { + this.discountAddTotal = discountAddTotal; + } + + public Double getDiscount() { + return discount; + } + + public void setDiscount(Double discount) { + this.discount = discount; + } + + public Integer getQtyFlag() { + return qtyFlag; + } + + public void setQtyFlag(Integer qtyFlag) { + this.qtyFlag = qtyFlag; + } + + public Integer getHand() { + return hand; + } + + public void setHand(Integer hand) { + this.hand = hand; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreOrderProductMakeExtendEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreOrderProductMakeExtendEntity.java new file mode 100644 index 0000000..077ec8c --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StoreOrderProductMakeExtendEntity.java @@ -0,0 +1,219 @@ +package com.jwsaas.api.entity.upload; + +import java.io.Serializable; + +import com.alibaba.fastjson.JSONObject; + +public class StoreOrderProductMakeExtendEntity implements Serializable { + + private static final long serialVersionUID = 1080182055966657285L; + + private String clientId;// 前台系统ID + private String orderItemId;// 订单明细记录ID + private String makeId;// 做法ID + private String makeName;// 做法名称 + private Double addPrice;// 做法加价 + private Double discountPrice;// 做法折后加价 + private Double count;// 做法数量 + private Double rcount;// 做法退数量 + private Double addTotal;// 加价总额 + private Double discountAddTotal;// 折后总额 + private Double discount;// 折扣率 + private Integer qtyFlag;// 做法管理数量标识 + private Integer hand;// 手写做法标识 + + private String tableNo;// 餐桌编号 + private String tableName;// 餐桌名称 + private String ext1;// 扩展信息1 + private String ext2;// 扩展信息2 + private String ext3;// 扩展信息3 + + public StoreOrderProductMakeExtendEntity() { + + } + + public StoreOrderProductMakeExtendEntity(JSONObject json) { + if (json.containsKey("id")) + clientId = json.getString("id");// 前台系统ID + if (json.containsKey("orderItemId")) + orderItemId = json.getString("orderItemId");// 订单明细记录ID + if (json.containsKey("makeId")) + makeId = json.getString("makeId");// 做法ID + if (json.containsKey("makeName")) + makeName = json.getString("makeName");// 做法名称 + if (json.containsKey("addPrice")) + addPrice = json.getDouble("addPrice");// 做法加价 + if (json.containsKey("discountPrice")) + discountPrice = json.getDouble("discountPrice");// 做法折后加价 + if (json.containsKey("count")) + count = json.getDouble("count");// 做法数量 + if (json.containsKey("rcount")) + rcount = json.getDouble("rcount");// 做法退数量 + if (json.containsKey("addTotal")) + addTotal = json.getDouble("addTotal");// 加价总额 + if (json.containsKey("discountAddTotal")) + discountAddTotal = json.getDouble("discountAddTotal");// 折后总额 + if (json.containsKey("discount")) + discount = json.getDouble("discount");// 折扣率 + if (json.containsKey("qtyFlag")) + qtyFlag = json.getInteger("qtyFlag");// 做法管理数量标识 + if (json.containsKey("hand")) + hand = json.getInteger("hand");// 手写做法标识 + + if (json.containsKey("tableNo")) + tableNo = json.getString("tableNo");// 餐桌编号 + if (json.containsKey("tableName")) + tableName = json.getString("tableName");// 餐桌名称 + if (json.containsKey("ext1")) + ext1 = json.getString("ext1");// 扩展信息1 + if (json.containsKey("ext2")) + ext2 = json.getString("ext2");// 扩展信息2 + if (json.containsKey("ext3")) + ext3 = json.getString("ext3");// 扩展信息3 + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getOrderItemId() { + return orderItemId; + } + + public void setOrderItemId(String orderItemId) { + this.orderItemId = orderItemId; + } + + public String getMakeId() { + return makeId; + } + + public void setMakeId(String makeId) { + this.makeId = makeId; + } + + public String getMakeName() { + return makeName; + } + + public void setMakeName(String makeName) { + this.makeName = makeName; + } + + public Double getAddPrice() { + return addPrice; + } + + public void setAddPrice(Double addPrice) { + this.addPrice = addPrice; + } + + public Double getDiscountPrice() { + return discountPrice; + } + + public void setDiscountPrice(Double discountPrice) { + this.discountPrice = discountPrice; + } + + public Double getCount() { + return count; + } + + public void setCount(Double count) { + this.count = count; + } + + public Double getRcount() { + return rcount; + } + + public void setRcount(Double rcount) { + this.rcount = rcount; + } + + public Double getAddTotal() { + return addTotal; + } + + public void setAddTotal(Double addTotal) { + this.addTotal = addTotal; + } + + public Double getDiscountAddTotal() { + return discountAddTotal; + } + + public void setDiscountAddTotal(Double discountAddTotal) { + this.discountAddTotal = discountAddTotal; + } + + public Double getDiscount() { + return discount; + } + + public void setDiscount(Double discount) { + this.discount = discount; + } + + public Integer getQtyFlag() { + return qtyFlag; + } + + public void setQtyFlag(Integer qtyFlag) { + this.qtyFlag = qtyFlag; + } + + public Integer getHand() { + return hand; + } + + public void setHand(Integer hand) { + this.hand = hand; + } + + public String getTableNo() { + return tableNo; + } + + public void setTableNo(String tableNo) { + this.tableNo = tableNo; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public String getExt1() { + return ext1; + } + + public void setExt1(String ext1) { + this.ext1 = ext1; + } + + public String getExt2() { + return ext2; + } + + public void setExt2(String ext2) { + this.ext2 = ext2; + } + + public String getExt3() { + return ext3; + } + + public void setExt3(String ext3) { + this.ext3 = ext3; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StorePayEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StorePayEntity.java new file mode 100644 index 0000000..50af29f --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StorePayEntity.java @@ -0,0 +1,287 @@ +package com.jwsaas.api.entity.upload; + +import java.io.Serializable; +import java.util.Date; + +import com.alibaba.fastjson.JSONObject; + +public class StorePayEntity implements Serializable { + + private static final long serialVersionUID = -9028055196966074617L; + + private String clientId;// 前台系统ID + + private String payNo;// 付款单号 + + private String payTypeNo;// 付款方式编号 + + private String payType;// 付款方式 + + private Double paid;// 实收金额 + + private Double rchange;// 找零金额 + + private Double money;// 已收金额 + + private Double overAmount;// 溢出金额 + + private String voucherNo;// 凭证号 + + private Date payDate;// 付款时间 + + private String cardno;// 付款卡号 + + private Double cardYe;// 充值卡支付前余额 + + private Double cardJf;// 充值卡支付前积分 + + private Integer incomeFlag;// 是否实收(0-否;1-是;) + + private Integer otherRateType;// 第三方扣费类型 + + private Double otherRateValue;// 第三方扣费值 + + private Double otherRate;// 第三方扣费 + + private Integer payChannel;// 支付渠道 ( -1无 0原生支付 1付呗支付 2POS通交易-3 嗖嗖支付) + + + + private String memo;// 备注 + + private String ext1;//deductionRate-支付方式扣率; + private String ext2;//chargeBack-扣款; + + public StorePayEntity() { + + } + + public StorePayEntity(JSONObject json) { + if (json.containsKey("id")) + clientId = json.getString("id");// 前台系统ID + if (json.containsKey("payNo")) + payNo = json.getString("payNo");// 付款单号 + if (json.containsKey("payTypeNo")) + payTypeNo = json.getString("payTypeNo");// 付款方式编号 + if (json.containsKey("payType")) + payType = json.getString("payType");// 付款方式 + if (json.containsKey("paid")) + paid = json.getDouble("paid");// 实收金额 + if (json.containsKey("rchange")) + rchange = json.getDouble("rchange");// 找零金额 + if (json.containsKey("money")) + money = json.getDouble("money");// 已收金额 + if (json.containsKey("overAmount")) + overAmount = json.getDouble("overAmount");// 溢出金额 + if (json.containsKey("voucherNo")) + voucherNo = json.getString("voucherNo");// 凭证号 + if (json.containsKey("payDate")) + payDate = json.getDate("payDate");// 付款时间 + if (json.containsKey("cardno")) + cardno = json.getString("cardno");// 付款卡号 + if (json.containsKey("cardYe")) + cardYe = json.getDouble("cardYe");// 充值卡支付前余额 + if (json.containsKey("cardJf")) + cardJf = json.getDouble("cardJf");// 充值卡支付前积分 + if (json.containsKey("incomeFlag")) { + incomeFlag = json.getInteger("incomeFlag");// 充值卡支付前积分 + } else { + incomeFlag = 0; + } + if (json.containsKey("otherRateType")) { + otherRateType = json.getInteger("otherRateType");// 第三方扣费类型 + } else { + otherRateType = 0; + } + if (json.containsKey("otherRateValue")){ + otherRateValue = json.getDouble("otherRateValue");// 第三方扣费值 + }else{ + otherRateValue =0.00; + } + if (json.containsKey("otherRate")) { + otherRate = json.getDouble("otherRate");// 第三方扣费 + } else { + otherRate = 0.00; + } + if (json.containsKey("payChannel")) { + payChannel = json.getInteger("payChannel");// 前台支付渠道 + } else { + payChannel = -1; + } + if (json.containsKey("memo")) + memo = json.getString("memo");// 备注 + if (json.containsKey("deductionRate")) + ext1 = json.getString("deductionRate");// 支付方式扣率 + if (json.containsKey("chargeBack")) + ext2 = json.getString("chargeBack");// 支付方式扣款 + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getPayNo() { + return payNo; + } + + public void setPayNo(String payNo) { + this.payNo = payNo; + } + + public String getPayTypeNo() { + return payTypeNo; + } + + public void setPayTypeNo(String payTypeNo) { + this.payTypeNo = payTypeNo; + } + + public String getPayType() { + return payType; + } + + public void setPayType(String payType) { + this.payType = payType; + } + + public Double getMoney() { + return money; + } + + public Double getOverAmount() { + return overAmount; + } + + public void setOverAmount(Double overAmount) { + this.overAmount = overAmount; + } + + public void setMoney(Double money) { + this.money = money; + } + + public Double getPaid() { + return paid; + } + + public void setPaid(Double paid) { + this.paid = paid; + } + + public Double getRchange() { + return rchange; + } + + public void setRchange(Double rchange) { + this.rchange = rchange; + } + + public String getVoucherNo() { + return voucherNo; + } + + public void setVoucherNo(String voucherNo) { + this.voucherNo = voucherNo; + } + + public Date getPayDate() { + return payDate; + } + + public void setPayDate(Date payDate) { + this.payDate = payDate; + } + + public String getCardno() { + return cardno; + } + + public void setCardno(String cardno) { + this.cardno = cardno; + } + + public Double getCardYe() { + return cardYe; + } + + public void setCardYe(Double cardYe) { + this.cardYe = cardYe; + } + + public Double getCardJf() { + return cardJf; + } + + public void setCardJf(Double cardJf) { + this.cardJf = cardJf; + } + + public Integer getIncomeFlag() { + return incomeFlag; + } + + public void setIncomeFlag(Integer incomeFlag) { + this.incomeFlag = incomeFlag; + } + + public Integer getOtherRateType() { + return otherRateType; + } + + public void setOtherRateType(Integer otherRateType) { + this.otherRateType = otherRateType; + } + + public Double getOtherRateValue() { + return otherRateValue; + } + + public void setOtherRateValue(Double otherRateValue) { + this.otherRateValue = otherRateValue; + } + + + public Double getOtherRate() { + return otherRate; + } + + public void setOtherRate(Double otherRate) { + this.otherRate = otherRate; + } + + public Integer getPayChannel() { + return payChannel; + } + + public void setPayChannel(Integer payChannel) { + this.payChannel = payChannel; + } + + public String getMemo() { + return memo; + } + + public void setMemo(String memo) { + this.memo = memo; + } + + public String getExt1() { + return ext1; + } + + public void setExt1(String ext1) { + this.ext1 = ext1; + } + + public String getExt2() { + return ext2; + } + + public void setExt2(String ext2) { + this.ext2 = ext2; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StorePayExtendEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StorePayExtendEntity.java new file mode 100644 index 0000000..b4d6039 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/upload/StorePayExtendEntity.java @@ -0,0 +1,301 @@ +package com.jwsaas.api.entity.upload; + +import java.io.Serializable; +import java.util.Date; + +import com.alibaba.fastjson.JSONObject; + +public class StorePayExtendEntity implements Serializable { + + private static final long serialVersionUID = -2400662375519006541L; + + private String clientId;// 前台系统ID + private String payNo;// 付款单号 + private String payTypeNo;// 付款方式编号 + private String payType;// 付款方式 + private Double paid;// 实收金额 + private Double rchange;// 找零金额 + private Double money;// 已收金额 + private Double overAmount;// 溢出金额 + private String voucherNo;// 凭证号 + private Date payDate;// 付款时间 + private String cardno;// 付款卡号 + private Double cardYe;// 充值卡支付前余额 + private Double cardJf;// 充值卡支付前积分 + private Integer incomeFlag;// 是否实收(0-否;1-是;) + private Integer otherRateType;// 第三方扣费类型 + private Double otherRateValue;// 第三方扣费值 + private Double otherRate;// 第三方扣费 + private Integer payChannel;// 支付渠道 ( -1无 0原生支付 1付呗支付 2POS通交易-3 嗖嗖支付) + private String memo;// 备注 + + private String tableNo;// 餐桌编号 + private String tableName;// 餐桌名称 + private String ext1;// 扩展信息1 + private String ext2;// 扩展信息2 + private String ext3;// 扩展信息3 + + public StorePayExtendEntity() { + + } + + public StorePayExtendEntity(JSONObject json) { + if (json.containsKey("id")) + clientId = json.getString("id");// 前台系统ID + if (json.containsKey("payNo")) + payNo = json.getString("payNo");// 付款单号 + if (json.containsKey("payTypeNo")) + payTypeNo = json.getString("payTypeNo");// 付款方式编号 + if (json.containsKey("payType")) + payType = json.getString("payType");// 付款方式 + if (json.containsKey("paid")) + paid = json.getDouble("paid");// 实收金额 + if (json.containsKey("rchange")) + rchange = json.getDouble("rchange");// 找零金额 + if (json.containsKey("money")) + money = json.getDouble("money");// 已收金额 + if (json.containsKey("overAmount")) + overAmount = json.getDouble("overAmount");// 溢出金额 + if (json.containsKey("voucherNo")) + voucherNo = json.getString("voucherNo");// 凭证号 + if (json.containsKey("payDate")) + payDate = json.getDate("payDate");// 付款时间 + if (json.containsKey("cardno")) + cardno = json.getString("cardno");// 付款卡号 + if (json.containsKey("cardYe")) + cardYe = json.getDouble("cardYe");// 充值卡支付前余额 + if (json.containsKey("cardJf")) + cardJf = json.getDouble("cardJf");// 充值卡支付前积分 + if (json.containsKey("incomeFlag")) { + incomeFlag = json.getInteger("incomeFlag");// 充值卡支付前积分 + } else { + incomeFlag = 0; + } + if (json.containsKey("otherRateType")) { + otherRateType = json.getInteger("otherRateType");// 第三方扣费类型 + } else { + otherRateType = 0; + } + if (json.containsKey("otherRateValue")) { + otherRateValue = json.getDouble("otherRateValue");// 第三方扣费值 + } else { + otherRateValue = 0.00; + } + if (json.containsKey("otherRate")) { + otherRate = json.getDouble("otherRate");// 第三方扣费 + } else { + otherRate = 0.00; + } + if (json.containsKey("payChannel")) { + payChannel = json.getInteger("payChannel");// 前台支付渠道 + } else { + payChannel = -1; + } + if (json.containsKey("memo")) + memo = json.getString("memo");// 备注 + + if (json.containsKey("tableNo")) + tableNo = json.getString("tableNo");// 餐桌编号 + if (json.containsKey("tableName")) + tableName = json.getString("tableName");// 餐桌名称 + if (json.containsKey("ext1")) + ext1 = json.getString("ext1");// 扩展信息1 + if (json.containsKey("ext2")) + ext2 = json.getString("ext2");// 扩展信息2 + if (json.containsKey("ext3")) + ext3 = json.getString("ext3");// 扩展信息3 + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getPayNo() { + return payNo; + } + + public void setPayNo(String payNo) { + this.payNo = payNo; + } + + public String getPayTypeNo() { + return payTypeNo; + } + + public void setPayTypeNo(String payTypeNo) { + this.payTypeNo = payTypeNo; + } + + public String getPayType() { + return payType; + } + + public void setPayType(String payType) { + this.payType = payType; + } + + public Double getMoney() { + return money; + } + + public Double getOverAmount() { + return overAmount; + } + + public void setOverAmount(Double overAmount) { + this.overAmount = overAmount; + } + + public void setMoney(Double money) { + this.money = money; + } + + public Double getPaid() { + return paid; + } + + public void setPaid(Double paid) { + this.paid = paid; + } + + public Double getRchange() { + return rchange; + } + + public void setRchange(Double rchange) { + this.rchange = rchange; + } + + public String getVoucherNo() { + return voucherNo; + } + + public void setVoucherNo(String voucherNo) { + this.voucherNo = voucherNo; + } + + public Date getPayDate() { + return payDate; + } + + public void setPayDate(Date payDate) { + this.payDate = payDate; + } + + public String getCardno() { + return cardno; + } + + public void setCardno(String cardno) { + this.cardno = cardno; + } + + public Double getCardYe() { + return cardYe; + } + + public void setCardYe(Double cardYe) { + this.cardYe = cardYe; + } + + public Double getCardJf() { + return cardJf; + } + + public void setCardJf(Double cardJf) { + this.cardJf = cardJf; + } + + public Integer getIncomeFlag() { + return incomeFlag; + } + + public void setIncomeFlag(Integer incomeFlag) { + this.incomeFlag = incomeFlag; + } + + public Integer getOtherRateType() { + return otherRateType; + } + + public void setOtherRateType(Integer otherRateType) { + this.otherRateType = otherRateType; + } + + public Double getOtherRateValue() { + return otherRateValue; + } + + public void setOtherRateValue(Double otherRateValue) { + this.otherRateValue = otherRateValue; + } + + public Double getOtherRate() { + return otherRate; + } + + public void setOtherRate(Double otherRate) { + this.otherRate = otherRate; + } + + public Integer getPayChannel() { + return payChannel; + } + + public void setPayChannel(Integer payChannel) { + this.payChannel = payChannel; + } + + public String getMemo() { + return memo; + } + + public void setMemo(String memo) { + this.memo = memo; + } + + public String getTableNo() { + return tableNo; + } + + public void setTableNo(String tableNo) { + this.tableNo = tableNo; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public String getExt1() { + return ext1; + } + + public void setExt1(String ext1) { + this.ext1 = ext1; + } + + public String getExt2() { + return ext2; + } + + public void setExt2(String ext2) { + this.ext2 = ext2; + } + + public String getExt3() { + return ext3; + } + + public void setExt3(String ext3) { + this.ext3 = ext3; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/visitor/VisitorAddressEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/visitor/VisitorAddressEntity.java new file mode 100644 index 0000000..a767bbc --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/visitor/VisitorAddressEntity.java @@ -0,0 +1,109 @@ +package com.jwsaas.api.entity.visitor; + +import java.io.Serializable; + +public class VisitorAddressEntity implements Serializable { + + private static final long serialVersionUID = 1174381421822301992L; + + private String id;// 系统主键 + private String visitorId;// 熟客ID + private String name;// 联系人 + private String telephone;// 联系电话 + private String areaName;// 所在地区 + private String address;// 详细地址 + private String description;// 备注说明 + private String createUser;// 创建人 + private String createDate;// 创建日期 + private String modifyUser;// 修改人 + private String modifyDate;// 修改日期 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getVisitorId() { + return visitorId; + } + + public void setVisitorId(String visitorId) { + this.visitorId = visitorId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getTelephone() { + return telephone; + } + + public void setTelephone(String telephone) { + this.telephone = telephone; + } + + public String getAreaName() { + return areaName; + } + + public void setAreaName(String areaName) { + this.areaName = areaName; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } + + public String getCreateDate() { + return createDate; + } + + public void setCreateDate(String createDate) { + this.createDate = createDate; + } + + public String getModifyUser() { + return modifyUser; + } + + public void setModifyUser(String modifyUser) { + this.modifyUser = modifyUser; + } + + public String getModifyDate() { + return modifyDate; + } + + public void setModifyDate(String modifyDate) { + this.modifyDate = modifyDate; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/visitor/VisitorEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/visitor/VisitorEntity.java new file mode 100644 index 0000000..918b2c9 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/visitor/VisitorEntity.java @@ -0,0 +1,164 @@ +package com.jwsaas.api.entity.visitor; + +import java.io.Serializable; +import java.util.List; + +public class VisitorEntity implements Serializable { + + private static final long serialVersionUID = 503169609864764788L; + + private String id; + private String no;// 编号 + private String tel;// 来电号码 + private String name;// 姓名 + private String spell;// 拼音 + private Integer sex;// 性别 + private String title;// 称谓 + private String position;// 职位 + private String fphone;// 联系方式一 + private String sphone;// 联系方式二 + private String description;// 备注说明 + private String createUser;// 创建人 + private String createDate;// 创建日期 + private String modifyUser;// 修改人 + private String modifyDate;// 修改日期 + private List tagList; + private List addressList; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getNo() { + return no; + } + + public void setNo(String no) { + this.no = no; + } + + public String getTel() { + return tel; + } + + public void setTel(String tel) { + this.tel = tel; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getSpell() { + return spell; + } + + public void setSpell(String spell) { + this.spell = spell; + } + + public Integer getSex() { + return sex; + } + + public void setSex(Integer sex) { + this.sex = sex; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getPosition() { + return position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getFphone() { + return fphone; + } + + public void setFphone(String fphone) { + this.fphone = fphone; + } + + public String getSphone() { + return sphone; + } + + public void setSphone(String sphone) { + this.sphone = sphone; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } + + public String getCreateDate() { + return createDate; + } + + public void setCreateDate(String createDate) { + this.createDate = createDate; + } + + public String getModifyUser() { + return modifyUser; + } + + public void setModifyUser(String modifyUser) { + this.modifyUser = modifyUser; + } + + public String getModifyDate() { + return modifyDate; + } + + public void setModifyDate(String modifyDate) { + this.modifyDate = modifyDate; + } + + public List getTagList() { + return tagList; + } + + public void setTagList(List tagList) { + this.tagList = tagList; + } + + public List getAddressList() { + return addressList; + } + + public void setAddressList(List addressList) { + this.addressList = addressList; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/visitor/VisitorTagEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/visitor/VisitorTagEntity.java new file mode 100644 index 0000000..051f40a --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/visitor/VisitorTagEntity.java @@ -0,0 +1,73 @@ +package com.jwsaas.api.entity.visitor; + +import java.io.Serializable; + +public class VisitorTagEntity implements Serializable { + + private static final long serialVersionUID = -239149934868280789L; + + private String id;// 系统主键 + private String visitorId;// 熟客ID + private String name;// 标签名称 + private String createUser;// 创建人 + private String createDate;// 创建日期 + private String modifyUser;// 修改人 + private String modifyDate;// 修改日期 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getVisitorId() { + return visitorId; + } + + public void setVisitorId(String visitorId) { + this.visitorId = visitorId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } + + public String getCreateDate() { + return createDate; + } + + public void setCreateDate(String createDate) { + this.createDate = createDate; + } + + public String getModifyUser() { + return modifyUser; + } + + public void setModifyUser(String modifyUser) { + this.modifyUser = modifyUser; + } + + public String getModifyDate() { + return modifyDate; + } + + public void setModifyDate(String modifyDate) { + this.modifyDate = modifyDate; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/vpos/VposStoreBusinessTicketEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/vpos/VposStoreBusinessTicketEntity.java new file mode 100644 index 0000000..73b0f52 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/vpos/VposStoreBusinessTicketEntity.java @@ -0,0 +1,565 @@ +package com.jwsaas.api.entity.vpos; + +import java.io.Serializable; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; + +public class VposStoreBusinessTicketEntity implements Serializable { + + private static final long serialVersionUID = 503169609864764788L; + + private String clientId;// 前台系统ID + + private String memberId;//会员ID + + private String openId;//会员openId + + private String mobile;//手机号 + + private String no;// 单据编号 + + private String storeId;// 门店ID + + private String storeNo;// 门店编号 + + private String storeName;// 门店名称 + + private Integer status;// 单据状态 + + private String workNo;// 操作员工号 + + private Date saleDate;// 销售时间 + + private String tableNo;// 餐桌号 + + private Integer people;// 人数 + + private Integer busMode;// 营业模式 + + private String shiftNo;// 班次 + + private String shiftName;// 班次名称 + + private Double amount;// 消费金额 + + private Double discount;// 优惠率 + + private Double discountTotal;// 优惠额 + + private Double receivable;// 应收金额 + + private Double maling;// 抹零金额 + + private Double paid;// 实收金额 + + private String noOrg;// 原单号 + + private String backCause;// 退单原因 + + private Integer isMember;// 是否使用会员卡 + + private String memberNo;// 会员卡号 + + private Double memberJifen;// 本单积分 + + private String deviceName;// 设备名称 + + private String deviceMac;// 设备MAC + + private String deviceIp;// 设备IP + + private String posNo;// 设备编号 + + private String seqNo;// 当日流水号 + + private String weather;// 天气 + + private String weeker;// 星期 + + private Double estimatedCost;// 预估成本 + + private Double estimatedProfitAmount;// 预估毛利金额 + + private Double estimatedProfitMargin;// 预估毛利率 + + private Double totalCost;// 实际成本 + + private Double profitAmount;// 实际毛利金额 + + private Double profitMargin;// 实际毛利率 + + private String ext2;// 订单备注 + + private List ticketInfo;// 主单优惠信息 + + private List orderProduct;// 门店产品销售记录 + + public VposStoreBusinessTicketEntity() { + + } + + public VposStoreBusinessTicketEntity(JSONObject json) { + if (json.containsKey("memberId")) + memberId = json.getString("memberId");// 会员ID + if (json.containsKey("openId")) + openId = json.getString("openId");// 会员openId + if (json.containsKey("mobile")) + mobile = json.getString("mobile");// 会员手机号 + if (json.containsKey("id")) + clientId = json.getString("id");// 前台系统ID + if (json.containsKey("storeId")) + storeId = json.getString("storeId");// 门店ID + if (json.containsKey("storeNo")) + storeNo = json.getString("storeNo");// 门店编号 + if (json.containsKey("storeName")) + storeName = json.getString("storeName");// 门店名称 + if (json.containsKey("status")) + status = json.getInteger("status");// 单据状态 + if (json.containsKey("workNo")) + workNo = json.getString("workNo");// 操作员工号 + if (json.containsKey("saleDate")) { + try { + saleDate = json.getDate("saleDate");// 销售时间 + } catch (Exception e) { + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + //将字符串形式的时间转化为Date类型的时间 + try { + Date date = sdf.parse("2000-01-01 00:00:00"); + saleDate = date; + } catch (ParseException e1) { + e1.printStackTrace(); + } + } + } + if (json.containsKey("tableNo")) + tableNo = json.getString("tableNo");// 餐桌号 + if (json.containsKey("people")) + people = json.getInteger("people");// 人数 + if (json.containsKey("busMode")) + busMode = json.getInteger("busMode");// 营业模式 + if (json.containsKey("shiftNo")) + shiftNo = json.getString("shiftNo");// 班次 + if (json.containsKey("shiftName")) + shiftName = json.getString("shiftName");// 班次名称 + if (json.containsKey("amount")) + amount = json.getDouble("amount");// 消费金额 + if (json.containsKey("discount")) + discount = json.getDouble("discount");// 优惠率 + if (json.containsKey("discountTotal")) + discountTotal = json.getDouble("discountTotal");// 优惠额 + if (json.containsKey("receivable")) + receivable = json.getDouble("receivable");// 应收金额 + if (json.containsKey("maling")) + maling = json.getDouble("maling");// 抹零金额 + if (json.containsKey("paid")) + paid = json.getDouble("paid");// 抹零金额 + if (json.containsKey("noOrg")) + noOrg = json.getString("noOrg");// 原单号 + if (json.containsKey("backCause")) + backCause = json.getString("backCause");// 退单原因 + if (json.containsKey("isMember")) + isMember = json.getInteger("isMember");// 是否使用会员卡 + if (json.containsKey("memberNo")) + memberNo = json.getString("memberNo");// 会员卡号 + if (json.containsKey("memberJifen")) + memberJifen = json.getDouble("memberJifen");// 本单积分 + if (json.containsKey("deviceName")) + deviceName = json.getString("deviceName");// 设备名称 + if (json.containsKey("deviceMac")) + deviceMac = json.getString("deviceMac");// 设备名称 + if (json.containsKey("deviceIp")) + deviceIp = json.getString("deviceIp");// 设备名称 + if (json.containsKey("posNo")) + posNo = json.getString("posNo");// 设备编号 + if (json.containsKey("seqNo")) + seqNo = json.getString("seqNo");// 当日流水号 + if (json.containsKey("weather")) + weather = json.getString("weather");// 天气 + if (json.containsKey("weeker")) + weeker = json.getString("weeker");// 星期 + if (json.containsKey("estimatedCost")) + estimatedCost = json.getDouble("estimatedCost");// 预估成本 + if (json.containsKey("estimatedProfitAmount")) + estimatedProfitAmount = json.getDouble("estimatedProfitAmount");// 预估毛利金额 + if (json.containsKey("estimatedProfitMargin")) + estimatedProfitMargin = json.getDouble("estimatedProfitMargin");// 预估毛利率 + if (json.containsKey("totalCost")) + totalCost = json.getDouble("totalCost");// 实际成本 + if (json.containsKey("profitAmount")) + profitAmount = json.getDouble("profitAmount");// 实际毛利金额 + if (json.containsKey("profitMargin")) + profitMargin = json.getDouble("profitMargin");// 实际毛利率 + if (json.containsKey("ext2")) + ext2 = json.getString("ext2");// 订单备注 + + if (json.containsKey("ticket_info")) { + JSONArray ticket_info = json.getJSONArray("ticket_info"); + ticketInfo = new ArrayList<>(); + for (int i = 0; i < ticket_info.size(); i++) { + JSONObject infoObject = ticket_info.getJSONObject(i); + VposStoreBusinessTicketInfoEntity entity = new VposStoreBusinessTicketInfoEntity(infoObject); + ticketInfo.add(entity); + } + } + if (json.containsKey("order_product")) { + JSONArray order_product = json.getJSONArray("order_product"); + orderProduct = new ArrayList<>(); + for (int i = 0; i < order_product.size(); i++) { + JSONObject productObject = order_product.getJSONObject(i); + VposStoreOrderProductEntity entity = new VposStoreOrderProductEntity(productObject); + orderProduct.add(entity); + } + } + } + + public String getMemberId() { + return memberId; + } + + public void setMemberId(String memberId) { + this.memberId = memberId; + } + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getNo() { + return no; + } + + public void setNo(String no) { + this.no = no; + } + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getStoreNo() { + return storeNo; + } + + public void setStoreNo(String storeNo) { + this.storeNo = storeNo; + } + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getWorkNo() { + return workNo; + } + + public void setWorkNo(String workNo) { + this.workNo = workNo; + } + + public Date getSaleDate() { + return saleDate; + } + + public void setSaleDate(Date saleDate) { + this.saleDate = saleDate; + } + + public String getTableNo() { + return tableNo; + } + + public void setTableNo(String tableNo) { + this.tableNo = tableNo; + } + + public Integer getPeople() { + return people; + } + + public void setPeople(Integer people) { + this.people = people; + } + + public Integer getBusMode() { + return busMode; + } + + public void setBusMode(Integer busMode) { + this.busMode = busMode; + } + + public String getShiftNo() { + return shiftNo; + } + + public void setShiftNo(String shiftNo) { + this.shiftNo = shiftNo; + } + + public String getShiftName() { + return shiftName; + } + + public void setShiftName(String shiftName) { + this.shiftName = shiftName; + } + + public Double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + + public Double getDiscount() { + return discount; + } + + public void setDiscount(Double discount) { + this.discount = discount; + } + + public Double getDiscountTotal() { + return discountTotal; + } + + public void setDiscountTotal(Double discountTotal) { + this.discountTotal = discountTotal; + } + + public Double getReceivable() { + return receivable; + } + + public void setReceivable(Double receivable) { + this.receivable = receivable; + } + + public Double getMaling() { + return maling; + } + + public void setMaling(Double maling) { + this.maling = maling; + } + + public Double getPaid() { + return paid; + } + + public void setPaid(Double paid) { + this.paid = paid; + } + + public String getNoOrg() { + return noOrg; + } + + public void setNoOrg(String noOrg) { + this.noOrg = noOrg; + } + + public String getBackCause() { + return backCause; + } + + public void setBackCause(String backCause) { + this.backCause = backCause; + } + + public Integer getIsMember() { + return isMember; + } + + public void setIsMember(Integer isMember) { + this.isMember = isMember; + } + + public String getMemberNo() { + return memberNo; + } + + public void setMemberNo(String memberNo) { + this.memberNo = memberNo; + } + + public Double getMemberJifen() { + return memberJifen; + } + + public void setMemberJifen(Double memberJifen) { + this.memberJifen = memberJifen; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getDeviceMac() { + return deviceMac; + } + + public void setDeviceMac(String deviceMac) { + this.deviceMac = deviceMac; + } + + public String getDeviceIp() { + return deviceIp; + } + + public void setDeviceIp(String deviceIp) { + this.deviceIp = deviceIp; + } + + public String getPosNo() { + return posNo; + } + + public void setPosNo(String posNo) { + this.posNo = posNo; + } + + public String getSeqNo() { + return seqNo; + } + + public void setSeqNo(String seqNo) { + this.seqNo = seqNo; + } + + public String getWeather() { + return weather; + } + + public void setWeather(String weather) { + this.weather = weather; + } + + public String getWeeker() { + return weeker; + } + + public void setWeeker(String weeker) { + this.weeker = weeker; + } + + public Double getEstimatedCost() { + return estimatedCost; + } + + public void setEstimatedCost(Double estimatedCost) { + this.estimatedCost = estimatedCost; + } + + public Double getEstimatedProfitAmount() { + return estimatedProfitAmount; + } + + public void setEstimatedProfitAmount(Double estimatedProfitAmount) { + this.estimatedProfitAmount = estimatedProfitAmount; + } + + public Double getEstimatedProfitMargin() { + return estimatedProfitMargin; + } + + public void setEstimatedProfitMargin(Double estimatedProfitMargin) { + this.estimatedProfitMargin = estimatedProfitMargin; + } + + public Double getTotalCost() { + return totalCost; + } + + public void setTotalCost(Double totalCost) { + this.totalCost = totalCost; + } + + public Double getProfitAmount() { + return profitAmount; + } + + public void setProfitAmount(Double profitAmount) { + this.profitAmount = profitAmount; + } + + public Double getProfitMargin() { + return profitMargin; + } + + public void setProfitMargin(Double profitMargin) { + this.profitMargin = profitMargin; + } + + public String getExt2() { + return ext2; + } + + public void setExt2(String ext2) { + this.ext2 = ext2; + } + + public List getTicketInfo() { + return ticketInfo; + } + + public void setTicketInfo(List ticketInfo) { + this.ticketInfo = ticketInfo; + } + + public List getOrderProduct() { + return orderProduct; + } + + public void setOrderProduct(List orderProduct) { + this.orderProduct = orderProduct; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/vpos/VposStoreBusinessTicketInfoEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/vpos/VposStoreBusinessTicketInfoEntity.java new file mode 100644 index 0000000..796aa7e --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/vpos/VposStoreBusinessTicketInfoEntity.java @@ -0,0 +1,66 @@ +package com.jwsaas.api.entity.vpos; + +import java.io.Serializable; + +import com.alibaba.fastjson.JSONObject; + +public class VposStoreBusinessTicketInfoEntity implements Serializable { + + private static final long serialVersionUID = 2700463675262433248L; + + private String clientId;// 前台系统ID + + private Integer type;// 优惠类型 + + private String info;// 优惠说明 + + private Double discountMoney;// 优惠金额 + + public VposStoreBusinessTicketInfoEntity() { + + } + + public VposStoreBusinessTicketInfoEntity(JSONObject json) { + if (json.containsKey("id")) + clientId = json.getString("id");// 前台系统ID + if (json.containsKey("type")) + type = json.getInteger("type");// 优惠类型 + if (json.containsKey("info")) + info = json.getString("info");// 优惠说明 + if (json.containsKey("discountMoney")) + discountMoney = json.getDouble("discountMoney");// 优惠金额 + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } + + public Double getDiscountMoney() { + return discountMoney; + } + + public void setDiscountMoney(Double discountMoney) { + this.discountMoney = discountMoney; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/vpos/VposStoreBusinessTicketRefundPartEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/vpos/VposStoreBusinessTicketRefundPartEntity.java new file mode 100644 index 0000000..abb055b --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/vpos/VposStoreBusinessTicketRefundPartEntity.java @@ -0,0 +1,179 @@ +package com.jwsaas.api.entity.vpos; + +import java.io.Serializable; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; + +public class VposStoreBusinessTicketRefundPartEntity implements Serializable { + + private static final long serialVersionUID = -140925787249912585L; + + private String storeId;// 门店ID + + private String storeNo;// 门店编号 + + private String storeName;// 门店名称 + + private String workNo;// 操作员工号 + + private Date saleDate;// 销售时间 + + private String deviceName;// 设备名称 + + private String deviceMac;// 设备MAC + + private String deviceIp;// 设备IP + + private String posNo;// 设备编号 + + private List orderProduct;// 门店产品销售记录 + + private List orderPay;// 门店支付明细 + + public VposStoreBusinessTicketRefundPartEntity(JSONObject json) { + + if (json.containsKey("storeId")) + storeId = json.getString("storeId");// 门店ID + if (json.containsKey("storeNo")) + storeNo = json.getString("storeNo");// 门店编号 + if (json.containsKey("storeName")) + storeName = json.getString("storeName");// 门店名称 + if (json.containsKey("workNo")) + workNo = json.getString("workNo");// 操作员工号 + if (json.containsKey("saleDate")) { + try { + saleDate = json.getDate("saleDate");// 销售时间 + } catch (Exception e) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + // 将字符串形式的时间转化为Date类型的时间 + try { + Date date = sdf.parse("2000-01-01 00:00:00"); + saleDate = date; + } catch (ParseException e1) { + e1.printStackTrace(); + } + } + } + if (json.containsKey("deviceName")) + deviceName = json.getString("deviceName");// 设备名称 + if (json.containsKey("deviceMac")) + deviceMac = json.getString("deviceMac");// 设备名称 + if (json.containsKey("deviceIp")) + deviceIp = json.getString("deviceIp");// 设备名称 + if (json.containsKey("posNo")) + posNo = json.getString("posNo");// 设备编号 + if (json.containsKey("order_product")) { + JSONArray order_product = json.getJSONArray("order_product"); + orderProduct = new ArrayList<>(); + for (int i = 0; i < order_product.size(); i++) { + JSONObject productObject = order_product.getJSONObject(i); + VposStoreOrderProductRefundPartEntity entity = new VposStoreOrderProductRefundPartEntity(productObject); + orderProduct.add(entity); + } + } + if (json.containsKey("order_pay")) { + JSONArray order_pay = json.getJSONArray("order_pay"); + orderPay = new ArrayList<>(); + for (int i = 0; i < order_pay.size(); i++) { + JSONObject productObject = order_pay.getJSONObject(i); + VposStorePayRefundPartEntity entity = new VposStorePayRefundPartEntity(productObject); + orderPay.add(entity); + } + } + } + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getStoreNo() { + return storeNo; + } + + public void setStoreNo(String storeNo) { + this.storeNo = storeNo; + } + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + + public String getWorkNo() { + return workNo; + } + + public void setWorkNo(String workNo) { + this.workNo = workNo; + } + + public Date getSaleDate() { + return saleDate; + } + + public void setSaleDate(Date saleDate) { + this.saleDate = saleDate; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getDeviceMac() { + return deviceMac; + } + + public void setDeviceMac(String deviceMac) { + this.deviceMac = deviceMac; + } + + public String getDeviceIp() { + return deviceIp; + } + + public void setDeviceIp(String deviceIp) { + this.deviceIp = deviceIp; + } + + public String getPosNo() { + return posNo; + } + + public void setPosNo(String posNo) { + this.posNo = posNo; + } + + public List getOrderProduct() { + return orderProduct; + } + + public void setOrderProduct(List orderProduct) { + this.orderProduct = orderProduct; + } + + public List getOrderPay() { + return orderPay; + } + + public void setOrderPay(List orderPay) { + this.orderPay = orderPay; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/vpos/VposStoreOrderProductEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/vpos/VposStoreOrderProductEntity.java new file mode 100644 index 0000000..345a740 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/vpos/VposStoreOrderProductEntity.java @@ -0,0 +1,530 @@ +package com.jwsaas.api.entity.vpos; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; + +public class VposStoreOrderProductEntity implements Serializable { + + private static final long serialVersionUID = 6017086791714799740L; + + private String clientId;// 前台系统ID + + private String parentId;// 父记录ID + + private String productId;// 菜品ID + + private String productNo;// 菜品编号 + + private String productName;// 菜品名称 + + private String productUnitId;// 菜品单位 + + private String productUnitName;// 菜品单位名 + + private String productImageUrl;//商品图片 + + private String seriesId;// 大类ID + + private String seriesName;// 大类名称 + + private String typePath;// 类别路径 + + private String typeId;// 类别ID + + private String typeName;// 类别名 + + private String specId;// 规格ID + + private String specName;// 规格名称 + + private Double count;// 数量 + + private Double rcount;// 退菜数量 + + private Double price;// 销售价格 + + private Double discountPrice;// 折后价格 + + private Double priceOrg;// 菜品原价 + + private Integer isSuit;// 是否套菜 + + private String suitId;// 套菜ID + + private Date saleDate;// 销售时间 + + private Double amount;// 消费金额 + + private Double discount;// 优惠率 + + private Double discountTotal;// 优惠额 + + private Double receivable;// 应收金额 + + private Double addPriceTotal;// 加价金额 + + private Double discountAddTotal;// 加价优惠金额 + + private Double amountAddTotal;// 加价应收金额 + + private Double amountTotal;// 消费总额 + + private Double receivableTotal;// 应收总金额(应收总额+做法总额) + + private Integer lineNo;// 行号 + + private Double estimatedCost;// 预估成本 + + private Double estimatedProfitAmount;// 预估毛利金额 + + private Double estimatedProfitMargin;// 预估毛利率 + + private Double totalCost;// 实际成本 + + private Double profitAmount;// 实际毛利金额 + + private Double profitMargin;// 实际毛利率 + + private List productInfo;// 菜品销售记录优惠明细 + + private List productMake;// 销售单做法 + + public VposStoreOrderProductEntity() { + + } + + public VposStoreOrderProductEntity(JSONObject json) { + if (json.containsKey("id")) + clientId = json.getString("id");// 前台系统ID + if (json.containsKey("parentId")) + parentId = json.getString("parentId");// 父记录ID + if (json.containsKey("productId")) + productId = json.getString("productId");// 菜品ID + if (json.containsKey("productNo")) + productNo = json.getString("productNo");// 菜品编号 + if (json.containsKey("productName")) + productName = json.getString("productName");// 菜品名称 + if (json.containsKey("productUnitId")) + productUnitId = json.getString("productUnitId");// 菜品单位 + if (json.containsKey("productUnitName")) + productUnitName = json.getString("productUnitName");// 菜品单位名 + if (json.containsKey("productImageUrl")) + productImageUrl = json.getString("productImageUrl");// 菜品单位名 + if (json.containsKey("seriesId")) + seriesId = json.getString("seriesId");// 菜品大类ID + if (json.containsKey("seriesName")) + seriesName = json.getString("seriesName");// 菜品大类名称 + if (json.containsKey("typePath")) + typePath = json.getString("typePath");// 菜品大类路径 + if (json.containsKey("typeId")) + typeId = json.getString("typeId");// 类别ID + if (json.containsKey("typeName")) + typeName = json.getString("typeName");// 类别名 + if (json.containsKey("specId")) + specId = json.getString("specId");// 规格ID + if (json.containsKey("specName")) + specName = json.getString("specName");// 规格名称 + if (json.containsKey("count")) + count = json.getDouble("count");// 数量 + if (json.containsKey("rcount")) + rcount = json.getDouble("rcount");// 退菜数量 + if (json.containsKey("price")) + price = json.getDouble("price");// 销售价格 + if (json.containsKey("discountPrice")) + discountPrice = json.getDouble("discountPrice");// 折后价格 + if (json.containsKey("priceOrg")) + priceOrg = json.getDouble("priceOrg");// 菜品原价 + if (json.containsKey("isSuit")) + isSuit = json.getInteger("isSuit");// 是否套菜 + if (json.containsKey("suitId")) + suitId = json.getString("suitId");// 套菜ID + if (json.containsKey("saleDate")) + saleDate = json.getDate("saleDate");// 销售时间 + if (json.containsKey("amount")) + amount = json.getDouble("amount");// 消费金额 + if (json.containsKey("discount")) + discount = json.getDouble("discount");// 优惠率 + if (json.containsKey("discountTotal")) + discountTotal = json.getDouble("discountTotal");// 优惠额 + if (json.containsKey("receivable")) + receivable = json.getDouble("receivable");// 应收金额 + if (json.containsKey("addPriceTotal")) + addPriceTotal = json.getDouble("addPriceTotal");// 加价总额 + if (json.containsKey("discountAddTotal")) + discountAddTotal = json.getDouble("discountAddTotal");// 加价优惠金额 + if (json.containsKey("amountAddTotal")) + amountAddTotal = json.getDouble("amountAddTotal");// 加价应收金额 + if (json.containsKey("amountTotal")) + amountTotal = json.getDouble("amountTotal");// 消费总额 + if (json.containsKey("receivableTotal")) + receivableTotal = json.getDouble("receivableTotal");// 应收总额 + if (json.containsKey("lineNo")) + lineNo = json.getInteger("lineNo");// 行号 + if (json.containsKey("estimatedCost")) + estimatedCost = json.getDouble("estimatedCost");// 预估成本 + if (json.containsKey("estimatedProfitAmount")) + estimatedProfitAmount = json.getDouble("estimatedProfitAmount");// 预估毛利金额 + if (json.containsKey("estimatedProfitMargin")) + estimatedProfitMargin = json.getDouble("estimatedProfitMargin");// 预估毛利率 + if (json.containsKey("totalCost")) + totalCost = json.getDouble("totalCost");// 实际成本 + if (json.containsKey("profitAmount")) + profitAmount = json.getDouble("profitAmount");// 实际毛利金额 + if (json.containsKey("profitMargin")) + profitMargin = json.getDouble("profitMargin");// 实际毛利率 + + if (json.containsKey("product_info")) { + JSONArray product_info = json.getJSONArray("product_info"); + productInfo = new ArrayList<>(); + for (int i = 0; i < product_info.size(); i++) { + JSONObject infoObject = product_info.getJSONObject(i); + VposStoreOrderProductInfoEntity entity = new VposStoreOrderProductInfoEntity(infoObject); + productInfo.add(entity); + } + } + if (json.containsKey("product_make")) { + JSONArray product_make = json.getJSONArray("product_make"); + productMake = new ArrayList<>(); + for (int i = 0; i < product_make.size(); i++) { + JSONObject makeObject = product_make.getJSONObject(i); + VposStoreOrderProductMakeEntity entity = new VposStoreOrderProductMakeEntity(makeObject); + productMake.add(entity); + } + } + + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getParentId() { + return parentId; + } + + public void setParentId(String parentId) { + this.parentId = parentId; + } + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId; + } + + public String getProductNo() { + return productNo; + } + + public void setProductNo(String productNo) { + this.productNo = productNo; + } + + public String getProductName() { + return productName; + } + + public void setProductName(String productName) { + this.productName = productName; + } + + public String getProductUnitId() { + return productUnitId; + } + + public void setProductUnitId(String productUnitId) { + this.productUnitId = productUnitId; + } + + public String getProductUnitName() { + return productUnitName; + } + + public void setProductUnitName(String productUnitName) { + this.productUnitName = productUnitName; + } + + public String getProductImageUrl() { + return productImageUrl; + } + + public void setProductImageUrl(String productImageUrl) { + this.productImageUrl = productImageUrl; + } + + public String getSeriesId() { + return seriesId; + } + + public void setSeriesId(String seriesId) { + this.seriesId = seriesId; + } + + public String getSeriesName() { + return seriesName; + } + + public void setSeriesName(String seriesName) { + this.seriesName = seriesName; + } + + public String getTypePath() { + return typePath; + } + + public void setTypePath(String typePath) { + this.typePath = typePath; + } + + public String getTypeId() { + return typeId; + } + + public void setTypeId(String typeId) { + this.typeId = typeId; + } + + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public String getSpecId() { + return specId; + } + + public void setSpecId(String specId) { + this.specId = specId; + } + + public String getSpecName() { + return specName; + } + + public void setSpecName(String specName) { + this.specName = specName; + } + + public Double getCount() { + return count; + } + + public void setCount(Double count) { + this.count = count; + } + + public Double getRcount() { + return rcount; + } + + public void setRcount(Double rcount) { + this.rcount = rcount; + } + + public Double getPrice() { + return price; + } + + public void setPrice(Double price) { + this.price = price; + } + + public Double getDiscountPrice() { + return discountPrice; + } + + public void setDiscountPrice(Double discountPrice) { + this.discountPrice = discountPrice; + } + + public Double getPriceOrg() { + return priceOrg; + } + + public void setPriceOrg(Double priceOrg) { + this.priceOrg = priceOrg; + } + + public Integer getIsSuit() { + return isSuit; + } + + public void setIsSuit(Integer isSuit) { + this.isSuit = isSuit; + } + + public String getSuitId() { + return suitId; + } + + public void setSuitId(String suitId) { + this.suitId = suitId; + } + + public Date getSaleDate() { + return saleDate; + } + + public void setSaleDate(Date saleDate) { + this.saleDate = saleDate; + } + + public Double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + + public Double getDiscount() { + return discount; + } + + public void setDiscount(Double discount) { + this.discount = discount; + } + + public Double getDiscountTotal() { + return discountTotal; + } + + public void setDiscountTotal(Double discountTotal) { + this.discountTotal = discountTotal; + } + + public Double getReceivable() { + return receivable; + } + + public void setReceivable(Double receivable) { + this.receivable = receivable; + } + + public Double getAddPriceTotal() { + return addPriceTotal; + } + + public void setAddPriceTotal(Double addPriceTotal) { + this.addPriceTotal = addPriceTotal; + } + + public Double getDiscountAddTotal() { + return discountAddTotal; + } + + public void setDiscountAddTotal(Double discountAddTotal) { + this.discountAddTotal = discountAddTotal; + } + + public Double getAmountAddTotal() { + return amountAddTotal; + } + + public void setAmountAddTotal(Double amountAddTotal) { + this.amountAddTotal = amountAddTotal; + } + + public Double getAmountTotal() { + return amountTotal; + } + + public void setAmountTotal(Double amountTotal) { + this.amountTotal = amountTotal; + } + + public Double getReceivableTotal() { + return receivableTotal; + } + + public void setReceivableTotal(Double receivableTotal) { + this.receivableTotal = receivableTotal; + } + + public Integer getLineNo() { + return lineNo; + } + + public void setLineNo(Integer lineNo) { + this.lineNo = lineNo; + } + + public Double getEstimatedCost() { + return estimatedCost; + } + + public void setEstimatedCost(Double estimatedCost) { + this.estimatedCost = estimatedCost; + } + + public Double getEstimatedProfitAmount() { + return estimatedProfitAmount; + } + + public void setEstimatedProfitAmount(Double estimatedProfitAmount) { + this.estimatedProfitAmount = estimatedProfitAmount; + } + + public Double getEstimatedProfitMargin() { + return estimatedProfitMargin; + } + + public void setEstimatedProfitMargin(Double estimatedProfitMargin) { + this.estimatedProfitMargin = estimatedProfitMargin; + } + + public Double getTotalCost() { + return totalCost; + } + + public void setTotalCost(Double totalCost) { + this.totalCost = totalCost; + } + + public Double getProfitAmount() { + return profitAmount; + } + + public void setProfitAmount(Double profitAmount) { + this.profitAmount = profitAmount; + } + + public Double getProfitMargin() { + return profitMargin; + } + + public void setProfitMargin(Double profitMargin) { + this.profitMargin = profitMargin; + } + + public List getProductInfo() { + return productInfo; + } + + public void setProductInfo(List productInfo) { + this.productInfo = productInfo; + } + + public List getProductMake() { + return productMake; + } + + public void setProductMake(List productMake) { + this.productMake = productMake; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/vpos/VposStoreOrderProductInfoEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/vpos/VposStoreOrderProductInfoEntity.java new file mode 100644 index 0000000..8ecf7b2 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/vpos/VposStoreOrderProductInfoEntity.java @@ -0,0 +1,78 @@ +package com.jwsaas.api.entity.vpos; + +import java.io.Serializable; + +import com.alibaba.fastjson.JSONObject; + +public class VposStoreOrderProductInfoEntity implements Serializable { + + private static final long serialVersionUID = -2729141073352388840L; + + private String clientId;// 前台系统ID + + private String orderItemId;// 订单明细记录ID + + private Integer type;// 优惠类型 + + private String info;// 优惠说明 + + private Double discountMoney;// 优惠金额 + + public VposStoreOrderProductInfoEntity() { + + } + + public VposStoreOrderProductInfoEntity(JSONObject json) { + if (json.containsKey("id")) + clientId = json.getString("id");// 前台系统ID + if (json.containsKey("orderItemId")) + orderItemId = json.getString("orderItemId");// 订单明细记录ID + if (json.containsKey("type")) + type = json.getInteger("type");// 优惠类型 + if (json.containsKey("info")) + info = json.getString("info");// 优惠说明 + if (json.containsKey("discountMoney")) + discountMoney = json.getDouble("discountMoney");// 优惠金额 + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getOrderItemId() { + return orderItemId; + } + + public void setOrderItemId(String orderItemId) { + this.orderItemId = orderItemId; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } + + public Double getDiscountMoney() { + return discountMoney; + } + + public void setDiscountMoney(Double discountMoney) { + this.discountMoney = discountMoney; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/vpos/VposStoreOrderProductMakeEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/vpos/VposStoreOrderProductMakeEntity.java new file mode 100644 index 0000000..07823a4 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/vpos/VposStoreOrderProductMakeEntity.java @@ -0,0 +1,174 @@ +package com.jwsaas.api.entity.vpos; + +import java.io.Serializable; + +import com.alibaba.fastjson.JSONObject; + +public class VposStoreOrderProductMakeEntity implements Serializable { + + private static final long serialVersionUID = -1423104643161740209L; + + private String clientId;// 前台系统ID + + private String orderItemId;// 订单明细记录ID + + private String makeId;// 做法ID + + private String makeName;// 做法名称 + + private Double addPrice;// 做法加价 + + private Double discountPrice;// 做法折后加价 + + private Double count;// 做法数量 + + private Double rcount;// 做法退数量 + + private Double addTotal;// 加价总额 + + private Double discountAddTotal;// 折后总额 + + private Double discount;// 折扣率 + + private Integer qtyFlag;// 做法管理数量标识 + + private Integer hand;// 手写做法标识 + + public VposStoreOrderProductMakeEntity() { + + } + + public VposStoreOrderProductMakeEntity(JSONObject json) { + if (json.containsKey("id")) + clientId = json.getString("id");// 前台系统ID + if (json.containsKey("orderItemId")) + orderItemId = json.getString("orderItemId");// 订单明细记录ID + if (json.containsKey("makeId")) + makeId = json.getString("makeId");// 做法ID + if (json.containsKey("makeName")) + makeName = json.getString("makeName");// 做法名称 + if (json.containsKey("addPrice")) + addPrice = json.getDouble("addPrice");// 做法加价 + if (json.containsKey("discountPrice")) + discountPrice = json.getDouble("discountPrice");// 做法折后加价 + if (json.containsKey("count")) + count = json.getDouble("count");// 做法数量 + if (json.containsKey("rcount")) + rcount = json.getDouble("rcount");// 做法退数量 + if (json.containsKey("addTotal")) + addTotal = json.getDouble("addTotal");// 加价总额 + if (json.containsKey("discountAddTotal")) + discountAddTotal = json.getDouble("discountAddTotal");// 折后总额 + if (json.containsKey("discount")) + discount = json.getDouble("discount");// 折扣率 + if (json.containsKey("qtyFlag")) + qtyFlag = json.getInteger("qtyFlag");// 做法管理数量标识 + if (json.containsKey("hand")) + hand = json.getInteger("hand");// 手写做法标识 + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getOrderItemId() { + return orderItemId; + } + + public void setOrderItemId(String orderItemId) { + this.orderItemId = orderItemId; + } + + public String getMakeId() { + return makeId; + } + + public void setMakeId(String makeId) { + this.makeId = makeId; + } + + public String getMakeName() { + return makeName; + } + + public void setMakeName(String makeName) { + this.makeName = makeName; + } + + public Double getAddPrice() { + return addPrice; + } + + public void setAddPrice(Double addPrice) { + this.addPrice = addPrice; + } + + public Double getDiscountPrice() { + return discountPrice; + } + + public void setDiscountPrice(Double discountPrice) { + this.discountPrice = discountPrice; + } + + public Double getCount() { + return count; + } + + public void setCount(Double count) { + this.count = count; + } + + public Double getRcount() { + return rcount; + } + + public void setRcount(Double rcount) { + this.rcount = rcount; + } + + public Double getAddTotal() { + return addTotal; + } + + public void setAddTotal(Double addTotal) { + this.addTotal = addTotal; + } + + public Double getDiscountAddTotal() { + return discountAddTotal; + } + + public void setDiscountAddTotal(Double discountAddTotal) { + this.discountAddTotal = discountAddTotal; + } + + public Double getDiscount() { + return discount; + } + + public void setDiscount(Double discount) { + this.discount = discount; + } + + public Integer getQtyFlag() { + return qtyFlag; + } + + public void setQtyFlag(Integer qtyFlag) { + this.qtyFlag = qtyFlag; + } + + public Integer getHand() { + return hand; + } + + public void setHand(Integer hand) { + this.hand = hand; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/vpos/VposStoreOrderProductMakeRefundPartEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/vpos/VposStoreOrderProductMakeRefundPartEntity.java new file mode 100644 index 0000000..2ed9aee --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/vpos/VposStoreOrderProductMakeRefundPartEntity.java @@ -0,0 +1,91 @@ +package com.jwsaas.api.entity.vpos; + +import java.io.Serializable; + +import com.alibaba.fastjson.JSONObject; + +public class VposStoreOrderProductMakeRefundPartEntity implements Serializable { + + private static final long serialVersionUID = 7763633995393738838L; + + private String clientId;// 前台系统ID + + private String orderItemId;// 订单明细记录ID + + private String makeId;// 做法ID + + private String makeName;// 做法名称 + + private Double addPrice;// 做法加价 + + private Double brcount;// 本次退数量 + + + + public VposStoreOrderProductMakeRefundPartEntity() { + + } + + public VposStoreOrderProductMakeRefundPartEntity(JSONObject json) { + if (json.containsKey("clientId")) + clientId = json.getString("clientId");// 前台系统ID + if (json.containsKey("orderItemId")) + orderItemId = json.getString("orderItemId");// 订单明细记录ID + if (json.containsKey("makeId")) + makeId = json.getString("makeId");// 做法ID + if (json.containsKey("makeName")) + makeName = json.getString("makeName");// 做法名称 + if (json.containsKey("addPrice")) + addPrice = json.getDouble("addPrice");// 做法加价 + if (json.containsKey("brcount")) + brcount = json.getDouble("brcount");// 本次退数量 + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getOrderItemId() { + return orderItemId; + } + + public void setOrderItemId(String orderItemId) { + this.orderItemId = orderItemId; + } + + public String getMakeId() { + return makeId; + } + + public void setMakeId(String makeId) { + this.makeId = makeId; + } + + public String getMakeName() { + return makeName; + } + + public void setMakeName(String makeName) { + this.makeName = makeName; + } + + public Double getAddPrice() { + return addPrice; + } + + public void setAddPrice(Double addPrice) { + this.addPrice = addPrice; + } + + public Double getBrcount() { + return brcount; + } + + public void setBrcount(Double brcount) { + this.brcount = brcount; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/vpos/VposStoreOrderProductRefundPartEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/vpos/VposStoreOrderProductRefundPartEntity.java new file mode 100644 index 0000000..bc71cb2 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/vpos/VposStoreOrderProductRefundPartEntity.java @@ -0,0 +1,268 @@ +package com.jwsaas.api.entity.vpos; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; + +public class VposStoreOrderProductRefundPartEntity implements Serializable { + + private static final long serialVersionUID = 2808188818230811845L; + + private String id;// 系统ID + + private String clientId;// 前台系统ID + + private String productId;// 菜品ID + + private String productNo;// 菜品编号 + + private String productName;// 菜品名称 + + private String productUnitId;// 菜品单位 + + private String productUnitName;// 菜品单位名 + + private String seriesId;// 大类ID + + private String seriesName;// 大类名称 + + private String typePath;// 类别路径 + + private String typeId;// 类别ID + + private String typeName;// 类别名 + + private String specId;// 规格ID + + private String specName;// 规格名称 + + private Double count;// 退菜数量 + + private Double rcount;// 退菜数量 + + private Double price;// 销售价格 + + private Double brcount;// 本次退款数量 + + private Double amount;// 本次退款金额 + + private List productMake;// 销售单做法 + + public VposStoreOrderProductRefundPartEntity() { + + } + + public VposStoreOrderProductRefundPartEntity(JSONObject json) { + if (json.containsKey("id")) + id = json.getString("id");// 系统ID + if (json.containsKey("clientId")) + clientId = json.getString("clientId");// 前台系统ID + if (json.containsKey("productId")) + productId = json.getString("productId");// 菜品ID + if (json.containsKey("productNo")) + productNo = json.getString("productNo");// 菜品编号 + if (json.containsKey("productName")) + productName = json.getString("productName");// 菜品名称 + if (json.containsKey("productUnitId")) + productUnitId = json.getString("productUnitId");// 菜品单位 + if (json.containsKey("productUnitName")) + productUnitName = json.getString("productUnitName");// 菜品单位名 + if (json.containsKey("seriesId")) + seriesId = json.getString("seriesId");// 菜品大类ID + if (json.containsKey("seriesName")) + seriesName = json.getString("seriesName");// 菜品大类名称 + if (json.containsKey("typePath")) + typePath = json.getString("typePath");// 菜品大类路径 + if (json.containsKey("typeId")) + typeId = json.getString("typeId");// 类别ID + if (json.containsKey("typeName")) + typeName = json.getString("typeName");// 类别名 + if (json.containsKey("specId")) + specId = json.getString("specId");// 规格ID + if (json.containsKey("specName")) + specName = json.getString("specName");// 规格名称 + if (json.containsKey("count")) + count = json.getDouble("count");// 菜品数量 + if (json.containsKey("rcount")) + rcount = json.getDouble("rcount");// 退菜数量 + if (json.containsKey("brcount")) + brcount = json.getDouble("brcount");// 本次退菜数量 + if (json.containsKey("price")) + price = json.getDouble("price");// 销售价格 + if (json.containsKey("amount")) + amount = json.getDouble("amount");// 消费金额 + if (json.containsKey("product_make")) { + JSONArray product_make = json.getJSONArray("product_make"); + productMake = new ArrayList<>(); + for (int i = 0; i < product_make.size(); i++) { + JSONObject makeObject = product_make.getJSONObject(i); + VposStoreOrderProductMakeRefundPartEntity entity = new VposStoreOrderProductMakeRefundPartEntity(makeObject); + productMake.add(entity); + } + } + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId; + } + + public String getProductNo() { + return productNo; + } + + public void setProductNo(String productNo) { + this.productNo = productNo; + } + + public String getProductName() { + return productName; + } + + public void setProductName(String productName) { + this.productName = productName; + } + + public String getProductUnitId() { + return productUnitId; + } + + public void setProductUnitId(String productUnitId) { + this.productUnitId = productUnitId; + } + + public String getProductUnitName() { + return productUnitName; + } + + public void setProductUnitName(String productUnitName) { + this.productUnitName = productUnitName; + } + + public String getSeriesId() { + return seriesId; + } + + public void setSeriesId(String seriesId) { + this.seriesId = seriesId; + } + + public String getSeriesName() { + return seriesName; + } + + public void setSeriesName(String seriesName) { + this.seriesName = seriesName; + } + + public String getTypePath() { + return typePath; + } + + public void setTypePath(String typePath) { + this.typePath = typePath; + } + + public String getTypeId() { + return typeId; + } + + public void setTypeId(String typeId) { + this.typeId = typeId; + } + + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public String getSpecId() { + return specId; + } + + public void setSpecId(String specId) { + this.specId = specId; + } + + public String getSpecName() { + return specName; + } + + public void setSpecName(String specName) { + this.specName = specName; + } + + public Double getCount() { + return count; + } + + public void setCount(Double count) { + this.count = count; + } + + public Double getBrcount() { + return brcount; + } + + public void setBrcount(Double brcount) { + this.brcount = brcount; + } + + public Double getRcount() { + return rcount; + } + + public void setRcount(Double rcount) { + this.rcount = rcount; + } + + public Double getPrice() { + return price; + } + + public void setPrice(Double price) { + this.price = price; + } + + public Double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + + public List getProductMake() { + return productMake; + } + + public void setProductMake(List productMake) { + this.productMake = productMake; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/vpos/VposStorePayEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/vpos/VposStorePayEntity.java new file mode 100644 index 0000000..6d07ca3 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/vpos/VposStorePayEntity.java @@ -0,0 +1,265 @@ +package com.jwsaas.api.entity.vpos; + +import java.io.Serializable; +import java.util.Date; + +import com.alibaba.fastjson.JSONObject; + +public class VposStorePayEntity implements Serializable { + + private static final long serialVersionUID = -9028055196966074617L; + + private String clientId;// 前台系统ID + + private String payNo;// 付款单号 + + private String payTypeNo;// 付款方式编号 + + private String payType;// 付款方式 + + private Double paid;// 实收金额 + + private Double rchange;// 找零金额 + + private Double money;// 已收金额 + + private Double overAmount;// 溢出金额 + + private String voucherNo;// 凭证号 + + private Date payDate;// 付款时间 + + private String cardno;// 付款卡号 + + private Double cardYe;// 充值卡支付前余额 + + private Double cardJf;// 充值卡支付前积分 + + private Integer incomeFlag;// 是否实收(0-否;1-是;) + + private Integer otherRateType;// 第三方扣费类型 + + private Double otherRateValue;// 第三方扣费值 + + private Double otherRate;// 第三方扣费 + + private Integer payChannel;// 支付渠道 ( -1无 0原生支付 1付呗支付 2POS通交易-3 嗖嗖支付) + + + + private String memo;// 备注 + + public VposStorePayEntity() { + + } + + public VposStorePayEntity(JSONObject json) { + if (json.containsKey("id")) + clientId = json.getString("id");// 前台系统ID + if (json.containsKey("payNo")) + payNo = json.getString("payNo");// 付款单号 + if (json.containsKey("payTypeNo")) + payTypeNo = json.getString("payTypeNo");// 付款方式编号 + if (json.containsKey("payType")) + payType = json.getString("payType");// 付款方式 + if (json.containsKey("paid")) + paid = json.getDouble("paid");// 实收金额 + if (json.containsKey("rchange")) + rchange = json.getDouble("rchange");// 找零金额 + if (json.containsKey("money")) + money = json.getDouble("money");// 已收金额 + if (json.containsKey("overAmount")) + overAmount = json.getDouble("overAmount");// 溢出金额 + if (json.containsKey("voucherNo")) + voucherNo = json.getString("voucherNo");// 凭证号 + if (json.containsKey("payDate")) + payDate = json.getDate("payDate");// 付款时间 + if (json.containsKey("cardno")) + cardno = json.getString("cardno");// 付款卡号 + if (json.containsKey("cardYe")) + cardYe = json.getDouble("cardYe");// 充值卡支付前余额 + if (json.containsKey("cardJf")) + cardJf = json.getDouble("cardJf");// 充值卡支付前积分 + if (json.containsKey("incomeFlag")) { + incomeFlag = json.getInteger("incomeFlag");// 充值卡支付前积分 + } else { + incomeFlag = 0; + } + if (json.containsKey("otherRateType")) { + otherRateType = json.getInteger("otherRateType");// 第三方扣费类型 + } else { + otherRateType = 0; + } + if (json.containsKey("otherRateValue")){ + otherRateValue = json.getDouble("otherRateValue");// 第三方扣费值 + }else{ + otherRateValue =0.00; + } + if (json.containsKey("otherRate")) { + otherRate = json.getDouble("otherRate");// 第三方扣费 + } else { + otherRate = 0.00; + } + if (json.containsKey("payChannel")) { + payChannel = json.getInteger("payChannel");// 前台支付渠道 + } else { + payChannel = -1; + } + if (json.containsKey("memo")) + memo = json.getString("memo");// 备注 + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getPayNo() { + return payNo; + } + + public void setPayNo(String payNo) { + this.payNo = payNo; + } + + public String getPayTypeNo() { + return payTypeNo; + } + + public void setPayTypeNo(String payTypeNo) { + this.payTypeNo = payTypeNo; + } + + public String getPayType() { + return payType; + } + + public void setPayType(String payType) { + this.payType = payType; + } + + public Double getMoney() { + return money; + } + + public Double getOverAmount() { + return overAmount; + } + + public void setOverAmount(Double overAmount) { + this.overAmount = overAmount; + } + + public void setMoney(Double money) { + this.money = money; + } + + public Double getPaid() { + return paid; + } + + public void setPaid(Double paid) { + this.paid = paid; + } + + public Double getRchange() { + return rchange; + } + + public void setRchange(Double rchange) { + this.rchange = rchange; + } + + public String getVoucherNo() { + return voucherNo; + } + + public void setVoucherNo(String voucherNo) { + this.voucherNo = voucherNo; + } + + public Date getPayDate() { + return payDate; + } + + public void setPayDate(Date payDate) { + this.payDate = payDate; + } + + public String getCardno() { + return cardno; + } + + public void setCardno(String cardno) { + this.cardno = cardno; + } + + public Double getCardYe() { + return cardYe; + } + + public void setCardYe(Double cardYe) { + this.cardYe = cardYe; + } + + public Double getCardJf() { + return cardJf; + } + + public void setCardJf(Double cardJf) { + this.cardJf = cardJf; + } + + public Integer getIncomeFlag() { + return incomeFlag; + } + + public void setIncomeFlag(Integer incomeFlag) { + this.incomeFlag = incomeFlag; + } + + public Integer getOtherRateType() { + return otherRateType; + } + + public void setOtherRateType(Integer otherRateType) { + this.otherRateType = otherRateType; + } + + public Double getOtherRateValue() { + return otherRateValue; + } + + public void setOtherRateValue(Double otherRateValue) { + this.otherRateValue = otherRateValue; + } + + + public Double getOtherRate() { + return otherRate; + } + + public void setOtherRate(Double otherRate) { + this.otherRate = otherRate; + } + + public Integer getPayChannel() { + return payChannel; + } + + public void setPayChannel(Integer payChannel) { + this.payChannel = payChannel; + } + + public String getMemo() { + return memo; + } + + public void setMemo(String memo) { + this.memo = memo; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/vpos/VposStorePayRefundPartEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/vpos/VposStorePayRefundPartEntity.java new file mode 100644 index 0000000..f9ba044 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/vpos/VposStorePayRefundPartEntity.java @@ -0,0 +1,241 @@ +package com.jwsaas.api.entity.vpos; + +import java.io.Serializable; +import java.util.Date; + +import com.alibaba.fastjson.JSONObject; + +public class VposStorePayRefundPartEntity implements Serializable { + + private static final long serialVersionUID = -9028055196966074617L; + + private String clientId;// 前台系统ID + + private String payNo;// 付款单号 + + private String payTypeNo;// 付款方式编号 + + private String payType;// 付款方式 + + private Double paid;// 实收金额 + + private Double money;// 已收金额 + + private String voucherNo;// 凭证号 + + private Date payDate;// 付款时间 + + private String cardno;// 付款卡号 + + private Double cardYe;// 充值卡支付前余额 + + private Double cardJf;// 充值卡支付前积分 + + private Integer incomeFlag;// 是否实收(0-否;1-是;) + + private Integer otherRateType;// 第三方扣费类型 + + private Double otherRateValue;// 第三方扣费值 + + private Double otherRate;// 第三方扣费 + + private Integer payChannel;// 支付渠道 ( -1无 0原生支付 1付呗支付 2POS通交易-3 嗖嗖支付) + + + + private String memo;// 备注 + + public VposStorePayRefundPartEntity() { + + } + + public VposStorePayRefundPartEntity(JSONObject json) { + if (json.containsKey("id")) + clientId = json.getString("id");// 前台系统ID + if (json.containsKey("payNo")) + payNo = json.getString("payNo");// 付款单号 + if (json.containsKey("payTypeNo")) + payTypeNo = json.getString("payTypeNo");// 付款方式编号 + if (json.containsKey("payType")) + payType = json.getString("payType");// 付款方式 + if (json.containsKey("paid")) + paid = json.getDouble("paid");// 实收金额 + if (json.containsKey("money")) + money = json.getDouble("money");// 已收金额 + if (json.containsKey("voucherNo")) + voucherNo = json.getString("voucherNo");// 凭证号 + if (json.containsKey("payDate")) + payDate = json.getDate("payDate");// 付款时间 + if (json.containsKey("cardno")) + cardno = json.getString("cardno");// 付款卡号 + if (json.containsKey("cardYe")) + cardYe = json.getDouble("cardYe");// 充值卡支付前余额 + if (json.containsKey("cardJf")) + cardJf = json.getDouble("cardJf");// 充值卡支付前积分 + if (json.containsKey("incomeFlag")) { + incomeFlag = json.getInteger("incomeFlag");// 充值卡支付前积分 + } else { + incomeFlag = 0; + } + if (json.containsKey("otherRateType")) { + otherRateType = json.getInteger("otherRateType");// 第三方扣费类型 + } else { + otherRateType = 0; + } + if (json.containsKey("otherRateValue")){ + otherRateValue = json.getDouble("otherRateValue");// 第三方扣费值 + }else{ + otherRateValue =0.00; + } + if (json.containsKey("otherRate")) { + otherRate = json.getDouble("otherRate");// 第三方扣费 + } else { + otherRate = 0.00; + } + if (json.containsKey("payChannel")) { + payChannel = json.getInteger("payChannel");// 前台支付渠道 + } else { + payChannel = -1; + } + if (json.containsKey("memo")) + memo = json.getString("memo");// 备注 + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getPayNo() { + return payNo; + } + + public void setPayNo(String payNo) { + this.payNo = payNo; + } + + public String getPayTypeNo() { + return payTypeNo; + } + + public void setPayTypeNo(String payTypeNo) { + this.payTypeNo = payTypeNo; + } + + public String getPayType() { + return payType; + } + + public void setPayType(String payType) { + this.payType = payType; + } + + public Double getMoney() { + return money; + } + + public void setMoney(Double money) { + this.money = money; + } + + public Double getPaid() { + return paid; + } + + public void setPaid(Double paid) { + this.paid = paid; + } + + public String getVoucherNo() { + return voucherNo; + } + + public void setVoucherNo(String voucherNo) { + this.voucherNo = voucherNo; + } + + public Date getPayDate() { + return payDate; + } + + public void setPayDate(Date payDate) { + this.payDate = payDate; + } + + public String getCardno() { + return cardno; + } + + public void setCardno(String cardno) { + this.cardno = cardno; + } + + public Double getCardYe() { + return cardYe; + } + + public void setCardYe(Double cardYe) { + this.cardYe = cardYe; + } + + public Double getCardJf() { + return cardJf; + } + + public void setCardJf(Double cardJf) { + this.cardJf = cardJf; + } + + public Integer getIncomeFlag() { + return incomeFlag; + } + + public void setIncomeFlag(Integer incomeFlag) { + this.incomeFlag = incomeFlag; + } + + public Integer getOtherRateType() { + return otherRateType; + } + + public void setOtherRateType(Integer otherRateType) { + this.otherRateType = otherRateType; + } + + public Double getOtherRateValue() { + return otherRateValue; + } + + public void setOtherRateValue(Double otherRateValue) { + this.otherRateValue = otherRateValue; + } + + + public Double getOtherRate() { + return otherRate; + } + + public void setOtherRate(Double otherRate) { + this.otherRate = otherRate; + } + + public Integer getPayChannel() { + return payChannel; + } + + public void setPayChannel(Integer payChannel) { + this.payChannel = payChannel; + } + + public String getMemo() { + return memo; + } + + public void setMemo(String memo) { + this.memo = memo; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/wxdc/SalesOrderEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/wxdc/SalesOrderEntity.java new file mode 100644 index 0000000..4a69470 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/wxdc/SalesOrderEntity.java @@ -0,0 +1,208 @@ +package com.jwsaas.api.entity.wxdc; + +import java.io.Serializable; +import java.util.List; + +public class SalesOrderEntity implements Serializable { + + private static final long serialVersionUID = 4589864590815096054L; + + private String ticketNo;// 销售订单编号 + private String phone;// 用户手机号 + private String saleDate;// 销售时间 + private String channel;// 销售渠道 + private Integer people;// 人数 + private Integer busMode;// 营业模式 + private String bookTime;// 预定时间 + private Double amount;// 消费金额 + private Double discountTotal;// 优惠金额 + private Double receivable;// 应收金额 + private String description;// 备注说明 + private String payType;// 付款类型 + private String payMode;// 付款方式 + private String payDate;// 付款时间 + private List items; + private List pays; + private String receiveName; //收餐人姓名 + /*** + * 收餐人电话 + */ + private String receiveMobile; + /** + * 收餐人地址 + */ + private String receiveAddress; + /** + * 配送费 + */ + private Double distributionFee=0.0; + private Double boxFee=0.0; //餐盒费 + + public String getTicketNo() { + return ticketNo; + } + + public void setTicketNo(String ticketNo) { + this.ticketNo = ticketNo; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public String getSaleDate() { + return saleDate; + } + + public void setSaleDate(String saleDate) { + this.saleDate = saleDate; + } + + public String getChannel() { + return channel; + } + + public void setChannel(String channel) { + this.channel = channel; + } + + public Integer getPeople() { + return people; + } + + public void setPeople(Integer people) { + this.people = people; + } + + public Integer getBusMode() { + return busMode; + } + + public void setBusMode(Integer busMode) { + this.busMode = busMode; + } + + public String getBookTime() { + return bookTime; + } + + public void setBookTime(String bookTime) { + this.bookTime = bookTime; + } + + public Double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + + public Double getDiscountTotal() { + return discountTotal; + } + + public void setDiscountTotal(Double discountTotal) { + this.discountTotal = discountTotal; + } + + public Double getReceivable() { + return receivable; + } + + public void setReceivable(Double receivable) { + this.receivable = receivable; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getPayType() { + return payType; + } + + public void setPayType(String payType) { + this.payType = payType; + } + + public String getPayMode() { + return payMode; + } + + public void setPayMode(String payMode) { + this.payMode = payMode; + } + + public String getPayDate() { + return payDate; + } + + public void setPayDate(String payDate) { + this.payDate = payDate; + } + + public List getItems() { + return items; + } + + public void setItems(List items) { + this.items = items; + } + + public List getPays() { + return pays; + } + + public void setPays(List pays) { + this.pays = pays; + } + + public String getReceiveName() { + return receiveName; + } + + public void setReceiveName(String receiveName) { + this.receiveName = receiveName; + } + + public String getReceiveMobile() { + return receiveMobile; + } + + public void setReceiveMobile(String receiveMobile) { + this.receiveMobile = receiveMobile; + } + + public String getReceiveAddress() { + return receiveAddress; + } + + public void setReceiveAddress(String receiveAddress) { + this.receiveAddress = receiveAddress; + } + + public Double getDistributionFee() { + return distributionFee; + } + + public void setDistributionFee(Double distributionFee) { + this.distributionFee = distributionFee; + } + + public Double getBoxFee() { + return boxFee; + } + + public void setBoxFee(Double boxFee) { + this.boxFee = boxFee; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/wxdc/SalesOrderItemEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/wxdc/SalesOrderItemEntity.java new file mode 100644 index 0000000..3e61454 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/wxdc/SalesOrderItemEntity.java @@ -0,0 +1,273 @@ +package com.jwsaas.api.entity.wxdc; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +public class SalesOrderItemEntity implements Serializable { + + private static final long serialVersionUID = 7889898017317747884L; + + private String id;// 唯一ID + private Integer lineNo;// 行号 + private String goodsId;// 商品ID + private String goodsName;// 商品名称 + private String specName;// 规格名称 + private String categoryId;// 分类ID + private String productId;// 产品ID + private String productNo;// 产品编号 + private String specId;// 规格ID + private String productUnitId;// 产品单位 + private Double count;// 数量 + private Double price;// 销售价格 + private Double priceOrg;// 产品原价 + private Double discountPrice;// 折后价格 + private Double amount;// 消费金额 + private Double discountTotal;// 优惠额 + private Double receivable;// 应收金额 + private Double addPriceTotal;// 加价金额 + private Double discountAddTotal;// 加价优惠金额 + private Double amountAddTotal;// 加价应收金额 + private Double amountTotal;// 消费总额 + private Double receivableTotal;// 应收总额 + private Integer isSuit;// 是否套餐 + private String suitId;// 套餐主菜ID + private String parentId;// 主菜ID + private List makes;// 做法信息列表 + private List promotions;// 优惠信息列表 + private Double boxNum=0.0; //餐盒数量 + private Double boxPrice=0.0; //餐盒费 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Integer getLineNo() { + return lineNo; + } + + public void setLineNo(Integer lineNo) { + this.lineNo = lineNo; + } + + public String getGoodsId() { + return goodsId; + } + + public void setGoodsId(String goodsId) { + this.goodsId = goodsId; + } + + public String getGoodsName() { + return goodsName; + } + + public void setGoodsName(String goodsName) { + this.goodsName = goodsName; + } + + public String getSpecName() { + return specName; + } + + public void setSpecName(String specName) { + this.specName = specName; + } + + public String getCategoryId() { + return categoryId; + } + + public void setCategoryId(String categoryId) { + this.categoryId = categoryId; + } + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId; + } + + public String getProductNo() { + return productNo; + } + + public void setProductNo(String productNo) { + this.productNo = productNo; + } + + public String getSpecId() { + return specId; + } + + public void setSpecId(String specId) { + this.specId = specId; + } + + public String getProductUnitId() { + return productUnitId; + } + + public void setProductUnitId(String productUnitId) { + this.productUnitId = productUnitId; + } + + public Double getCount() { + return count; + } + + public void setCount(Double count) { + this.count = count; + } + + public Double getPrice() { + return price; + } + + public void setPrice(Double price) { + this.price = price; + } + + public Double getPriceOrg() { + return priceOrg; + } + + public void setPriceOrg(Double priceOrg) { + this.priceOrg = priceOrg; + } + + public Double getDiscountPrice() { + return discountPrice; + } + + public void setDiscountPrice(Double discountPrice) { + this.discountPrice = discountPrice; + } + + public Double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + + public Double getDiscountTotal() { + return discountTotal; + } + + public void setDiscountTotal(Double discountTotal) { + this.discountTotal = discountTotal; + } + + public Double getReceivable() { + return receivable; + } + + public void setReceivable(Double receivable) { + this.receivable = receivable; + } + + public Double getAddPriceTotal() { + return addPriceTotal; + } + + public void setAddPriceTotal(Double addPriceTotal) { + this.addPriceTotal = addPriceTotal; + } + + public Double getDiscountAddTotal() { + return discountAddTotal; + } + + public void setDiscountAddTotal(Double discountAddTotal) { + this.discountAddTotal = discountAddTotal; + } + + public Double getAmountAddTotal() { + return amountAddTotal; + } + + public void setAmountAddTotal(Double amountAddTotal) { + this.amountAddTotal = amountAddTotal; + } + + public Double getAmountTotal() { + return amountTotal; + } + + public void setAmountTotal(Double amountTotal) { + this.amountTotal = amountTotal; + } + + public Double getReceivableTotal() { + return receivableTotal; + } + + public void setReceivableTotal(Double receivableTotal) { + this.receivableTotal = receivableTotal; + } + + public Integer getIsSuit() { + return isSuit; + } + + public void setIsSuit(Integer isSuit) { + this.isSuit = isSuit; + } + + public String getSuitId() { + return suitId; + } + + public void setSuitId(String suitId) { + this.suitId = suitId; + } + + public String getParentId() { + return parentId; + } + + public void setParentId(String parentId) { + this.parentId = parentId; + } + + public List getMakes() { + return makes; + } + + public void setMakes(List makes) { + this.makes = makes; + } + + public List getPromotions() { + return promotions==null?new ArrayList<>():promotions; + } + + public void setPromotions(List promotions) { + this.promotions = promotions; + } + + public Double getBoxNum() { + return boxNum; + } + + public void setBoxNum(Double boxNum) { + this.boxNum = boxNum; + } + + public Double getBoxPrice() { + return boxPrice; + } + + public void setBoxPrice(Double boxPrice) { + this.boxPrice = boxPrice; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/wxdc/SalesOrderItemMakeEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/wxdc/SalesOrderItemMakeEntity.java new file mode 100644 index 0000000..d89dcae --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/wxdc/SalesOrderItemMakeEntity.java @@ -0,0 +1,82 @@ +package com.jwsaas.api.entity.wxdc; + +import java.io.Serializable; + +public class SalesOrderItemMakeEntity implements Serializable { + + private static final long serialVersionUID = 7521049582914222659L; + + private String makeId;// 做法ID + private String makeName;// 做法名称 + private Double addPrice;// 做法加价 + private Double discountPrice;// 做法折后加价 + private Double count;// 做法数量 + private Double addTotal;// 加价总额 + private Double discountAddTotal;// 折后总额 + private Integer mngNum;// 管理数量 + + public String getMakeId() { + return makeId; + } + + public void setMakeId(String makeId) { + this.makeId = makeId; + } + + public String getMakeName() { + return makeName; + } + + public void setMakeName(String makeName) { + this.makeName = makeName; + } + + public Double getAddPrice() { + return addPrice; + } + + public void setAddPrice(Double addPrice) { + this.addPrice = addPrice; + } + + public Double getDiscountPrice() { + return discountPrice; + } + + public void setDiscountPrice(Double discountPrice) { + this.discountPrice = discountPrice; + } + + public Double getCount() { + return count; + } + + public void setCount(Double count) { + this.count = count; + } + + public Double getAddTotal() { + return addTotal; + } + + public void setAddTotal(Double addTotal) { + this.addTotal = addTotal; + } + + public Double getDiscountAddTotal() { + return discountAddTotal; + } + + public void setDiscountAddTotal(Double discountAddTotal) { + this.discountAddTotal = discountAddTotal; + } + + public Integer getMngNum() { + return mngNum; + } + + public void setMngNum(Integer mngNum) { + this.mngNum = mngNum; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/wxdc/SalesOrderItemPromoEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/wxdc/SalesOrderItemPromoEntity.java new file mode 100644 index 0000000..19fc69f --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/wxdc/SalesOrderItemPromoEntity.java @@ -0,0 +1,37 @@ +package com.jwsaas.api.entity.wxdc; + +import java.io.Serializable; + +public class SalesOrderItemPromoEntity implements Serializable { + + private static final long serialVersionUID = -6151122814513175681L; + + private Integer type;// 优惠类型 + private String info;// 优惠说明 + private Double discountMoney;// 优惠金额 + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } + + public Double getDiscountMoney() { + return discountMoney; + } + + public void setDiscountMoney(Double discountMoney) { + this.discountMoney = discountMoney; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/wxdc/SalesOrderPayEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/wxdc/SalesOrderPayEntity.java new file mode 100644 index 0000000..da64984 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/entity/wxdc/SalesOrderPayEntity.java @@ -0,0 +1,109 @@ +package com.jwsaas.api.entity.wxdc; + +import java.io.Serializable; + +public class SalesOrderPayEntity implements Serializable { + + private static final long serialVersionUID = 781468306165051617L; + + private String payNo;// 付款单号 + private String payType;// 付款类型 + private String payMode;// 付款方式 + private Integer status;// 单据状态 + private Double paid;// 实收金额 + private Double rchange;// 找零金额 + private Double money;// 已收金额 + private String voucherNo;// 凭证号 + private String payDate;// 付款时间 + private String payAccount;// 付款账号 + private String memo;// 备注 + + public String getPayNo() { + return payNo; + } + + public void setPayNo(String payNo) { + this.payNo = payNo; + } + + public String getPayType() { + return payType; + } + + public void setPayType(String payType) { + this.payType = payType; + } + + public String getPayMode() { + return payMode; + } + + public void setPayMode(String payMode) { + this.payMode = payMode; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Double getPaid() { + return paid; + } + + public void setPaid(Double paid) { + this.paid = paid; + } + + public Double getRchange() { + return rchange; + } + + public void setRchange(Double rchange) { + this.rchange = rchange; + } + + public Double getMoney() { + return money; + } + + public void setMoney(Double money) { + this.money = money; + } + + public String getVoucherNo() { + return voucherNo; + } + + public void setVoucherNo(String voucherNo) { + this.voucherNo = voucherNo; + } + + public String getPayDate() { + return payDate; + } + + public void setPayDate(String payDate) { + this.payDate = payDate; + } + + public String getPayAccount() { + return payAccount; + } + + public void setPayAccount(String payAccount) { + this.payAccount = payAccount; + } + + public String getMemo() { + return memo; + } + + public void setMemo(String memo) { + this.memo = memo; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/qimai/request/CategoryUpdateRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/qimai/request/CategoryUpdateRequest.java new file mode 100644 index 0000000..dc78237 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/qimai/request/CategoryUpdateRequest.java @@ -0,0 +1,110 @@ +package com.jwsaas.api.qimai.request; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +/** + * 企迈商品分类创建/更新接口 + * + * @author Administrator + * + */ +public class CategoryUpdateRequest extends AbstractRequest { + + @NotNull + @IgnoreSign + private String name;// 分类名称 + + @NotNull + @IgnoreSign + private int type;// 分类类型 1-堂食 2-外卖 3-堂食和外卖 + + @IgnoreSign + private int id;// 没有id新增分类 有id修改分类 + + @NotNull + @IgnoreSign + private int showPeriod;// 上架时间 0- 全时段展示 1- 自定义时段 + + @IgnoreSign + private String beginDate;// 自定义时段时 选择时间段 开始日期 + + @IgnoreSign + private String endDate;// 自定义时段时 选择时间段 结束日期 + + @IgnoreSign + private String weeks;// 自定义时段时 星期集合 ["1", "2", "3", "4", "5", "6", + // "7"](json格式) + + @IgnoreSign + private String period;// 售卖时间段集合 [{time: ["00:00:00", "23:59:59"]}, {time: + // ["00:00:00", "23:59:59"]}, {time: ["00:00:00", + // "23:59:59"]}] + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getShowPeriod() { + return showPeriod; + } + + public void setShowPeriod(int showPeriod) { + this.showPeriod = showPeriod; + } + + public String getBeginDate() { + return beginDate; + } + + public void setBeginDate(String beginDate) { + this.beginDate = beginDate; + } + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + public String getWeeks() { + return weeks; + } + + public void setWeeks(String weeks) { + this.weeks = weeks; + } + + public String getPeriod() { + return period; + } + + public void setPeriod(String period) { + this.period = period; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/qimai/service/QiMaiProductTypeService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/qimai/service/QiMaiProductTypeService.java new file mode 100644 index 0000000..273caf9 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/qimai/service/QiMaiProductTypeService.java @@ -0,0 +1,14 @@ +package com.jwsaas.api.qimai.service; + +import com.jwsaas.api.qimai.request.CategoryUpdateRequest; +import com.jwsaas.api.service.WopService; + +public interface QiMaiProductTypeService extends WopService { + + /** + * 商品分类的创建/更新 + * @param request + * @return + */ + Object categoryUpdate(CategoryUpdateRequest request); +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/qimai/service/impl/QiMaiBaseServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/qimai/service/impl/QiMaiBaseServiceImpl.java new file mode 100644 index 0000000..71c082a --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/qimai/service/impl/QiMaiBaseServiceImpl.java @@ -0,0 +1,84 @@ +package com.jwsaas.api.qimai.service.impl; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.jwsaas.api.service.ErpBaseService; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.util.HmacSHA1Utils; +import com.jwsaas.utils.Base64; + +/** + * @Author:ZGT + * @Date:Create in 2018/12/11 + * @Description: + */ +public class QiMaiBaseServiceImpl extends WopServiceImpl implements ErpBaseService { + + private static final long serialVersionUID = 6071365470932465969L; + + protected String fileName = "qimai.properties"; + + /** + * 对paramValues进行签名 + * + * @param paramValues + * @param secret + * @return + * @throws Exception + */ + public String sign(Map paramValues, String openKey) throws Exception { + return sign(paramValues, null, openKey); + } + + /** + * 对paramValues进行签名,其中ignoreParamNames这些参数不参与签名 + * + * @param paramValues + * @param ignoreParamNames + * @param secret + * @return + * @throws Exception + */ + public String sign(Map paramValues, List ignoreParamNames, String openKey) throws Exception { + StringBuilder sb = new StringBuilder(); + List paramNames = new ArrayList(paramValues.size()); + paramNames.addAll(paramValues.keySet()); + if (ignoreParamNames != null && ignoreParamNames.size() > 0) { + for (String ignoreParamName : ignoreParamNames) { + paramNames.remove(ignoreParamName); + } + } + Collections.sort(paramNames); + + for (String paramName : paramNames) { + sb.append(paramName+"=").append(paramValues.get(paramName)); + sb.append("&"); + } + String signStr = sb.toString(); + if (signStr.length() > 0) { + signStr = signStr.substring(0, signStr.length() - 1); + } + System.out.println(signStr); + String sign = Base64.encode(HmacSHA1Utils.HmacSHA1Encrypt(signStr, openKey)); + System.out.println(sign); + return sign; + + } + + public static void main(String[] args) { + Map paramMap = new HashMap<>(20); + paramMap.put("OpenId", "6dc05b4ac175cf316d226252b05cf685"); // 密钥Id + paramMap.put("GrantCode", "782c281f62"); // 授权code + paramMap.put("Timestamp", String.valueOf(System.currentTimeMillis()));// 当前时间戳 + paramMap.put("Nonce", 1); // 随机正整数 + try { + System.out.println(new QiMaiBaseServiceImpl().sign(paramMap, "xvFMqoyxFPMQirDRvYiWgSaEaszc75ZBVGdnFEg49")); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/qimai/service/impl/QiMaiProductTypeServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/qimai/service/impl/QiMaiProductTypeServiceImpl.java new file mode 100644 index 0000000..3ba86f3 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/qimai/service/impl/QiMaiProductTypeServiceImpl.java @@ -0,0 +1,87 @@ +package com.jwsaas.api.qimai.service.impl; + +import java.util.HashMap; +import java.util.Map; + +import org.apache.http.HttpResponse; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.jwsaas.api.qimai.request.CategoryUpdateRequest; +import com.jwsaas.api.qimai.service.QiMaiProductTypeService; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.http.HttpTool; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.utils.AppKeyUtil; + +@ServiceMethodBean(version = "1.0") +public class QiMaiProductTypeServiceImpl extends QiMaiBaseServiceImpl implements QiMaiProductTypeService { + + private static final long serialVersionUID = 4632618098161260313L; + + @ServiceMethod(method = "qimai.goods.category.update", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "商品分类的创建/更新") + @Override + public Object categoryUpdate(CategoryUpdateRequest request) { + + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String info = "goods.category.update-->categoryUpdate 商品分类的创建/更新"; + logger.info(info + "企业号:{}", tenantId); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + // 开放接口签名 + Map paramMap = new HashMap<>(20); + // 系统级参数 + paramMap.put("OpenId", "6dc05b4ac175cf316d226252b05cf685"); // 开发者必须事先通过申请获取appKey/secret后,才能进行应用的开发 + paramMap.put("GrantCode", "782c281f62"); // 方法名称 + paramMap.put("Timestamp", String.valueOf(System.currentTimeMillis()));// 报文的格式,支持XML和JSON,默认JSON + paramMap.put("Nonce", (int) (Math.random() * 1000000)); // 本地化类型,默认zh_CN + // 参数签名 + String signValue = this.sign(paramMap, "xvFMqoyxFPMQirDRvYiWgSaEaszc75ZBVGdnFEg49"); + paramMap.put("Token", signValue); // 签名串,请求参数的签名,服务平台通过它验证请求数据的合法性 + paramMap.put("name", request.getName()); + paramMap.put("type", request.getType()); + paramMap.put("id", request.getId()); + paramMap.put("show_period", request.getShowPeriod()); + paramMap.put("begin_date", request.getBeginDate()); + paramMap.put("end_date", request.getEndDate()); + paramMap.put("weeks", request.getWeeks()); + paramMap.put("period", request.getPeriod()); + // String url=PropertiesUtil.getValue(fileName,"open.api.url"); + long startTime = System.currentTimeMillis(); + final HttpResponse hr = HttpTool.url("https://openapi.qimai.shop/api/V1/cy/goods-category/goods-category-update").form(paramMap).post(); + long endTime = System.currentTimeMillis(); + logger.info("执行时间:{}", endTime - startTime); + final String content = HttpTool.getResponseAsString(hr); + logger.debug("调用企迈接口返回的数据如下:{}", content); + JSONObject object = JSON.parseObject(content); + boolean status = object.getBooleanValue("status"); + String code = object.getString("code"); + String message = object.getString("message"); + if (status && "0".equals(code)) { + response.setStatus(1); + response.setMessage("操作成功"); + } else { + response.setStatus(0); + response.setMessage(message); + response.setErrCode(code); + response.setErrMessage(message); + } + } catch (Exception e) { + e.printStackTrace(); + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/AbstractRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/AbstractRequest.java new file mode 100644 index 0000000..b9261f5 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/AbstractRequest.java @@ -0,0 +1,7 @@ +package com.jwsaas.api.request; + +import com.jwsaas.open.AbstractWopRequest; + +public abstract class AbstractRequest extends AbstractWopRequest { + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/cardsync/ProductListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/cardsync/ProductListRequest.java new file mode 100644 index 0000000..beea6a7 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/cardsync/ProductListRequest.java @@ -0,0 +1,49 @@ +package com.jwsaas.api.request.cardsync; + +import com.jwsaas.open.AbstractWopRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ProductListRequest extends AbstractWopRequest { + + @IgnoreSign + private int pageNumber = 1; + @IgnoreSign + private int pageSize = 10; + @IgnoreSign + private String keyword; + @IgnoreSign + private String typeId; + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + public String getKeyword() { + return keyword; + } + + public void setKeyword(String keyword) { + this.keyword = keyword; + } + + public String getTypeId() { + return typeId; + } + + public void setTypeId(String typeId) { + this.typeId = typeId; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/cardsync/ProductTypeRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/cardsync/ProductTypeRequest.java new file mode 100644 index 0000000..8ce218f --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/cardsync/ProductTypeRequest.java @@ -0,0 +1,7 @@ +package com.jwsaas.api.request.cardsync; + +import com.jwsaas.open.AbstractWopRequest; + +public class ProductTypeRequest extends AbstractWopRequest { + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/cardsync/StoreMessageRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/cardsync/StoreMessageRequest.java new file mode 100644 index 0000000..4202e15 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/cardsync/StoreMessageRequest.java @@ -0,0 +1,30 @@ +package com.jwsaas.api.request.cardsync; + +import com.jwsaas.open.AbstractWopRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreMessageRequest extends AbstractWopRequest { + + @IgnoreSign + private int pageNumber = 1; + + @IgnoreSign + private int pageSize = 10; + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/cardsync/StorePayTypeRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/cardsync/StorePayTypeRequest.java new file mode 100644 index 0000000..8d5abed --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/cardsync/StorePayTypeRequest.java @@ -0,0 +1,9 @@ +package com.jwsaas.api.request.cardsync; + +import com.jwsaas.open.AbstractWopRequest; + +public class StorePayTypeRequest extends AbstractWopRequest { + + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/cardsync/StorePosRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/cardsync/StorePosRequest.java new file mode 100644 index 0000000..6900e42 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/cardsync/StorePosRequest.java @@ -0,0 +1,30 @@ +package com.jwsaas.api.request.cardsync; + +import com.jwsaas.open.AbstractWopRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StorePosRequest extends AbstractWopRequest { + + @IgnoreSign + private int pageNumber = 1; + + @IgnoreSign + private int pageSize = 10; + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/cardsync/StoreTypeRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/cardsync/StoreTypeRequest.java new file mode 100644 index 0000000..eb1d476 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/cardsync/StoreTypeRequest.java @@ -0,0 +1,9 @@ +package com.jwsaas.api.request.cardsync; + +import com.jwsaas.open.AbstractWopRequest; + +public class StoreTypeRequest extends AbstractWopRequest { + + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/cardsync/StoreWorkerRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/cardsync/StoreWorkerRequest.java new file mode 100644 index 0000000..36adcc3 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/cardsync/StoreWorkerRequest.java @@ -0,0 +1,30 @@ +package com.jwsaas.api.request.cardsync; + +import com.jwsaas.open.AbstractWopRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreWorkerRequest extends AbstractWopRequest { + + @IgnoreSign + private int pageNumber = 1; + + @IgnoreSign + private int pageSize = 10; + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/ccb/CcbParamGetRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/ccb/CcbParamGetRequest.java new file mode 100644 index 0000000..734d347 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/ccb/CcbParamGetRequest.java @@ -0,0 +1,33 @@ +package com.jwsaas.api.request.ccb; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.open.AbstractWopRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class CcbParamGetRequest extends AbstractWopRequest { + + @NotNull + @IgnoreSign + public String paras;// 待加密参数串 + @NotNull + @IgnoreSign + public String key;// 加密Key + + public String getParas() { + return paras; + } + + public void setParas(String paras) { + this.paras = paras; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/common/SayHelloRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/common/SayHelloRequest.java new file mode 100644 index 0000000..f132afc --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/common/SayHelloRequest.java @@ -0,0 +1,7 @@ +package com.jwsaas.api.request.common; + +import com.jwsaas.api.request.AbstractRequest; + +public class SayHelloRequest extends AbstractRequest { + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/common/SessionCreateRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/common/SessionCreateRequest.java new file mode 100644 index 0000000..a84b07c --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/common/SessionCreateRequest.java @@ -0,0 +1,7 @@ +package com.jwsaas.api.request.common; + +import com.jwsaas.api.request.AbstractRequest; + +public class SessionCreateRequest extends AbstractRequest { + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/common/SessionGetRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/common/SessionGetRequest.java new file mode 100644 index 0000000..f6b61c7 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/common/SessionGetRequest.java @@ -0,0 +1,7 @@ +package com.jwsaas.api.request.common; + +import com.jwsaas.api.request.AbstractRequest; + +public class SessionGetRequest extends AbstractRequest { + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/common/SessionRemoveRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/common/SessionRemoveRequest.java new file mode 100644 index 0000000..0297d2d --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/common/SessionRemoveRequest.java @@ -0,0 +1,7 @@ +package com.jwsaas.api.request.common; + +import com.jwsaas.api.request.AbstractRequest; + +public class SessionRemoveRequest extends AbstractRequest { + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/costlimit/CostTicketTemplateRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/costlimit/CostTicketTemplateRequest.java new file mode 100644 index 0000000..63541fe --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/costlimit/CostTicketTemplateRequest.java @@ -0,0 +1,33 @@ +package com.jwsaas.api.request.costlimit; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +import javax.validation.constraints.NotNull; + +/** + * Created by Administrator on 2019\4\12 0012. + */ +public class CostTicketTemplateRequest extends AbstractRequest{ + + @NotNull + private String storeId; + @IgnoreSign + private String dateTime; + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getDateTime() { + return dateTime; + } + + public void setDateTime(String dateTime) { + this.dateTime = dateTime; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/jwygj/ProductSpecInfoEntity.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/jwygj/ProductSpecInfoEntity.java new file mode 100644 index 0000000..f7e297a --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/jwygj/ProductSpecInfoEntity.java @@ -0,0 +1,74 @@ +package com.jwsaas.api.request.jwygj; + +import com.alibaba.fastjson.JSONObject; + +import java.io.Serializable; + +/** + * Created by Administrator on 2018\10\24 0024. + */ +public class ProductSpecInfoEntity implements Serializable { + + + private static final long serialVersionUID = 2700463675262412345L; + + private String specId; + private String specName; + private Double price; + private Double memberPrice; + private String description; + + + public ProductSpecInfoEntity(JSONObject json) { + if (json.containsKey("specId")) + specId = json.getString("specId"); + if (json.containsKey("specName")) + specName = json.getString("specName"); + if (json.containsKey("price")) + price = json.getDouble("price"); + if (json.containsKey("memberPrice")) + memberPrice = json.getDouble("memberPrice"); + if (json.containsKey("description")) + description = json.getString("description"); + } + + public String getSpecId() { + return specId; + } + + public void setSpecId(String specId) { + this.specId = specId; + } + + public String getSpecName() { + return specName; + } + + public void setSpecName(String specName) { + this.specName = specName; + } + + public Double getPrice() { + return price; + } + + public void setPrice(Double price) { + this.price = price; + } + + public Double getMemberPrice() { + return memberPrice; + } + + public void setMemberPrice(Double memberPrice) { + this.memberPrice = memberPrice; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/jwygj/YgjAddProductCheckRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/jwygj/YgjAddProductCheckRequest.java new file mode 100644 index 0000000..352e930 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/jwygj/YgjAddProductCheckRequest.java @@ -0,0 +1,67 @@ +package com.jwsaas.api.request.jwygj; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class YgjAddProductCheckRequest extends StoreBaseRequest { + + @IgnoreSign + private String brandId;// 商品品牌 + + @IgnoreSign + private String typeId;// 分类ID + + @IgnoreSign + private String typePath;// 分类路径 + + @NotNull + @IgnoreSign + private String name;// 商品名称 + + @NotNull + @IgnoreSign + private String unitId;// 商品单位ID + + public String getBrandId() { + return brandId; + } + + public void setBrandId(String brandId) { + this.brandId = brandId; + } + + public String getTypeId() { + return typeId; + } + + public void setTypeId(String typeId) { + this.typeId = typeId; + } + + public String getTypePath() { + return typePath; + } + + public void setTypePath(String typePath) { + this.typePath = typePath; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUnitId() { + return unitId; + } + + public void setUnitId(String unitId) { + this.unitId = unitId; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/jwygj/YgjAddProductRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/jwygj/YgjAddProductRequest.java new file mode 100644 index 0000000..b29d56f --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/jwygj/YgjAddProductRequest.java @@ -0,0 +1,209 @@ +package com.jwsaas.api.request.jwygj; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +import java.util.List; + +public class YgjAddProductRequest extends StoreBaseRequest { + + @IgnoreSign + private String brandId;// 商品品牌 + + @IgnoreSign + private String typeId;// 分类ID + + @IgnoreSign + private String typePath;// 分类路径 + + @NotNull + @IgnoreSign + private String name;// 商品名称 + + @NotNull + @IgnoreSign + private String unitId;// 商品单位ID + + @NotNull + @IgnoreSign + private Double price;// 价格 + + @NotNull + @IgnoreSign + private Double memberPrice;// 会员价格 + + @NotNull + @IgnoreSign + private Integer labelPrintFlag;//是否标签打印 + + @NotNull + @IgnoreSign + private Integer weighFlag;//是否称重 + + @NotNull + @IgnoreSign + private Integer tapleFlag;//是否主食 + + @NotNull + @IgnoreSign + private Integer promotionFlag;//是否促销; + + @NotNull + @IgnoreSign + private Integer discountFlag;//是否折扣; + + @IgnoreSign + private String assistNo;// 辅助编码 + + @IgnoreSign + private String barCode;// 条码 + + @IgnoreSign + private String kitPlanId;// 厨打方案ID + + @NotNull + @IgnoreSign + private String workerNo;// 员工编号 + + @IgnoreSign + private String specInfos;//规格信息 + + public String getSpecInfos() { + return specInfos; + } + + public void setSpecInfos(String specInfos) { + this.specInfos = specInfos; + } + + public String getBrandId() { + return brandId; + } + + public void setBrandId(String brandId) { + this.brandId = brandId; + } + + public String getTypeId() { + return typeId; + } + + public void setTypeId(String typeId) { + this.typeId = typeId; + } + + public String getTypePath() { + return typePath; + } + + public void setTypePath(String typePath) { + this.typePath = typePath; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUnitId() { + return unitId; + } + + public void setUnitId(String unitId) { + this.unitId = unitId; + } + + public Double getPrice() { + return price; + } + + public void setPrice(Double price) { + this.price = price; + } + + public Double getMemberPrice() { + return memberPrice; + } + + public void setMemberPrice(Double memberPrice) { + this.memberPrice = memberPrice; + } + + public Integer getLabelPrintFlag() { + return labelPrintFlag; + } + + public void setLabelPrintFlag(Integer labelPrintFlag) { + this.labelPrintFlag = labelPrintFlag; + } + + public Integer getWeighFlag() { + return weighFlag; + } + + public void setWeighFlag(Integer weighFlag) { + this.weighFlag = weighFlag; + } + + public Integer getTapleFlag() { + return tapleFlag; + } + + public void setTapleFlag(Integer tapleFlag) { + this.tapleFlag = tapleFlag; + } + + public Integer getPromotionFlag() { + return promotionFlag; + } + + public void setPromotionFlag(Integer promotionFlag) { + this.promotionFlag = promotionFlag; + } + + public Integer getDiscountFlag() { + return discountFlag; + } + + public void setDiscountFlag(Integer discountFlag) { + this.discountFlag = discountFlag; + } + + public String getAssistNo() { + return assistNo; + } + + public void setAssistNo(String assistNo) { + this.assistNo = assistNo; + } + + public String getBarCode() { + return barCode; + } + + public void setBarCode(String barCode) { + this.barCode = barCode; + } + + public String getKitPlanId() { + return kitPlanId; + } + + public void setKitPlanId(String kitPlanId) { + this.kitPlanId = kitPlanId; + } + + public String getWorkerNo() { + return workerNo; + } + + public void setWorkerNo(String workerNo) { + this.workerNo = workerNo; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/jwygj/YgjAddSuitRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/jwygj/YgjAddSuitRequest.java new file mode 100644 index 0000000..be37844 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/jwygj/YgjAddSuitRequest.java @@ -0,0 +1,161 @@ +package com.jwsaas.api.request.jwygj; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class YgjAddSuitRequest extends StoreBaseRequest { + + @IgnoreSign + private String brandId;// 商品品牌 + + @IgnoreSign + private String typeId;// 分类ID + + @IgnoreSign + private String typePath;// 分类路径 + + @NotNull + @IgnoreSign + private String name;// 套餐名称 + + @NotNull + @IgnoreSign + private String unitId;// 商品单位ID + + @NotNull + @IgnoreSign + private Double price;// 价格 + + @NotNull + @IgnoreSign + private Double memberPrice;// 会员价格 + + @IgnoreSign + private String assistNo;// 辅助编码 + + @IgnoreSign + private String kitPlanId;// 厨打方案ID + + @NotNull + @IgnoreSign + private String productIds;// 商品ID逗号分隔 + + @NotNull + @IgnoreSign + private String specIds;// 规格ID逗号分隔 + + @NotNull + @IgnoreSign + private String quantitys;//数量ID逗号分隔 + + @NotNull + @IgnoreSign + private String workerNo;// 员工编号 + + public String getBrandId() { + return brandId; + } + + public void setBrandId(String brandId) { + this.brandId = brandId; + } + + public String getTypeId() { + return typeId; + } + + public void setTypeId(String typeId) { + this.typeId = typeId; + } + + public String getTypePath() { + return typePath; + } + + public void setTypePath(String typePath) { + this.typePath = typePath; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUnitId() { + return unitId; + } + + public void setUnitId(String unitId) { + this.unitId = unitId; + } + + public Double getPrice() { + return price; + } + + public void setPrice(Double price) { + this.price = price; + } + + public Double getMemberPrice() { + return memberPrice; + } + + public void setMemberPrice(Double memberPrice) { + this.memberPrice = memberPrice; + } + + public String getKitPlanId() { + return kitPlanId; + } + + public void setKitPlanId(String kitPlanId) { + this.kitPlanId = kitPlanId; + } + + public String getAssistNo() { + return assistNo; + } + + public void setAssistNo(String assistNo) { + this.assistNo = assistNo; + } + + public String getProductIds() { + return productIds; + } + + public void setProductIds(String productIds) { + this.productIds = productIds; + } + + public String getSpecIds() { + return specIds; + } + + public void setSpecIds(String specIds) { + this.specIds = specIds; + } + + public String getQuantitys() { + return quantitys; + } + + public void setQuantitys(String quantitys) { + this.quantitys = quantitys; + } + + public String getWorkerNo() { + return workerNo; + } + + public void setWorkerNo(String workerNo) { + this.workerNo = workerNo; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/jwygj/YgjEditProductRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/jwygj/YgjEditProductRequest.java new file mode 100644 index 0000000..c9a9fac --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/jwygj/YgjEditProductRequest.java @@ -0,0 +1,218 @@ +package com.jwsaas.api.request.jwygj; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class YgjEditProductRequest extends StoreBaseRequest { + + @IgnoreSign + private String brandId;// 商品品牌 + + @IgnoreSign + private String typeId;// 分类ID + + @IgnoreSign + private String typePath;// 分类路径 + + @NotNull + private String productId;// 商品ID + + + @NotNull + @IgnoreSign + private String unitId;// 商品单位ID + + @NotNull + @IgnoreSign + private String name;// 商品名称 + + @NotNull + @IgnoreSign + private Integer labelPrintFlag;//是否标签打印 + + @NotNull + @IgnoreSign + private Double price;// 价格 + + @NotNull + @IgnoreSign + private Double memberPrice;// 会员价格 + + @NotNull + @IgnoreSign + private Integer weighFlag;//是否称重 + + @NotNull + @IgnoreSign + private Integer tapleFlag;//是否主食 + + @NotNull + @IgnoreSign + private Integer promotionFlag;//是否促销; + + @NotNull + @IgnoreSign + private Integer discountFlag;//是否折扣; + + @IgnoreSign + private String assistNo;// 辅助编码 + + @IgnoreSign + private String barCode;// 条码 + + @IgnoreSign + private String kitPlanId;// 厨打方案ID + + @NotNull + @IgnoreSign + private String workerNo;// 员工编号 + + @IgnoreSign + private String specInfos;//规格信息 + + public String getSpecInfos() { + return specInfos; + } + + public void setSpecInfos(String specInfos) { + this.specInfos = specInfos; + } + + public String getBrandId() { + return brandId; + } + + public void setBrandId(String brandId) { + this.brandId = brandId; + } + + public String getTypeId() { + return typeId; + } + + public void setTypeId(String typeId) { + this.typeId = typeId; + } + + public String getTypePath() { + return typePath; + } + + public void setTypePath(String typePath) { + this.typePath = typePath; + } + + public String getUnitId() { + return unitId; + } + + public void setUnitId(String unitId) { + this.unitId = unitId; + } + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Double getPrice() { + return price; + } + + public void setPrice(Double price) { + this.price = price; + } + + public Double getMemberPrice() { + return memberPrice; + } + + public void setMemberPrice(Double memberPrice) { + this.memberPrice = memberPrice; + } + + public Integer getLabelPrintFlag() { + return labelPrintFlag; + } + + public void setLabelPrintFlag(Integer labelPrintFlag) { + this.labelPrintFlag = labelPrintFlag; + } + + public Integer getWeighFlag() { + return weighFlag; + } + + public void setWeighFlag(Integer weighFlag) { + this.weighFlag = weighFlag; + } + + public Integer getTapleFlag() { + return tapleFlag; + } + + public void setTapleFlag(Integer tapleFlag) { + this.tapleFlag = tapleFlag; + } + + public Integer getPromotionFlag() { + return promotionFlag; + } + + public void setPromotionFlag(Integer promotionFlag) { + this.promotionFlag = promotionFlag; + } + + public Integer getDiscountFlag() { + return discountFlag; + } + + public void setDiscountFlag(Integer discountFlag) { + this.discountFlag = discountFlag; + } + + public String getAssistNo() { + return assistNo; + } + + public void setAssistNo(String assistNo) { + this.assistNo = assistNo; + } + + public String getBarCode() { + return barCode; + } + + public void setBarCode(String barCode) { + this.barCode = barCode; + } + + public String getKitPlanId() { + return kitPlanId; + } + + public void setKitPlanId(String kitPlanId) { + this.kitPlanId = kitPlanId; + } + + public String getWorkerNo() { + return workerNo; + } + + public void setWorkerNo(String workerNo) { + this.workerNo = workerNo; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/jwygj/YgjProductTypeRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/jwygj/YgjProductTypeRequest.java new file mode 100644 index 0000000..ed0fc69 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/jwygj/YgjProductTypeRequest.java @@ -0,0 +1,29 @@ +package com.jwsaas.api.request.jwygj; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class YgjProductTypeRequest extends StoreBaseRequest { + + @IgnoreSign + private int pageNumber = 1; + + @IgnoreSign + private int pageSize = 10; + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/jwygj/YgjStoreAccountSummaryRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/jwygj/YgjStoreAccountSummaryRequest.java new file mode 100644 index 0000000..dc3c643 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/jwygj/YgjStoreAccountSummaryRequest.java @@ -0,0 +1,43 @@ +package com.jwsaas.api.request.jwygj; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class YgjStoreAccountSummaryRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String accountId;// 账户ID + + @IgnoreSign + private String startTime; + @IgnoreSign + private String endTime; + + public String getAccountId() { + return accountId; + } + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/jwygj/YgjStoreSetRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/jwygj/YgjStoreSetRequest.java new file mode 100644 index 0000000..4489646 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/jwygj/YgjStoreSetRequest.java @@ -0,0 +1,7 @@ +package com.jwsaas.api.request.jwygj; + +import com.jwsaas.api.request.store.StoreBaseRequest; + +public class YgjStoreSetRequest extends StoreBaseRequest { + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/jwygj/YgjWorkerModuleRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/jwygj/YgjWorkerModuleRequest.java new file mode 100644 index 0000000..1e82b97 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/jwygj/YgjWorkerModuleRequest.java @@ -0,0 +1,20 @@ +package com.jwsaas.api.request.jwygj; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; + +public class YgjWorkerModuleRequest extends StoreBaseRequest { + + @NotNull + public String workerId; + + public String getWorkerId() { + return workerId; + } + + public void setWorkerId(String workerId) { + this.workerId = workerId; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/kds/KdsPlanRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/kds/KdsPlanRequest.java new file mode 100644 index 0000000..b58067c --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/kds/KdsPlanRequest.java @@ -0,0 +1,7 @@ +package com.jwsaas.api.request.kds; + +import com.jwsaas.api.request.store.StoreBaseRequest; + +public class KdsPlanRequest extends StoreBaseRequest { + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/kds/KdsProductRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/kds/KdsProductRequest.java new file mode 100644 index 0000000..6147c94 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/kds/KdsProductRequest.java @@ -0,0 +1,29 @@ +package com.jwsaas.api.request.kds; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class KdsProductRequest extends StoreBaseRequest { + + @IgnoreSign + private int pageNumber = 1; + + @IgnoreSign + private int pageSize = 10; + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/kit/KitPlanRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/kit/KitPlanRequest.java new file mode 100644 index 0000000..a2b5f5e --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/kit/KitPlanRequest.java @@ -0,0 +1,7 @@ +package com.jwsaas.api.request.kit; + +import com.jwsaas.api.request.store.StoreBaseRequest; + +public class KitPlanRequest extends StoreBaseRequest { + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/kit/KitProductRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/kit/KitProductRequest.java new file mode 100644 index 0000000..6571ddc --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/kit/KitProductRequest.java @@ -0,0 +1,29 @@ +package com.jwsaas.api.request.kit; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class KitProductRequest extends StoreBaseRequest { + + @IgnoreSign + private int pageNumber = 1; + + @IgnoreSign + private int pageSize = 10; + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/kms/ProductSalesInfoRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/kms/ProductSalesInfoRequest.java new file mode 100644 index 0000000..c1a028e --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/kms/ProductSalesInfoRequest.java @@ -0,0 +1,40 @@ +package com.jwsaas.api.request.kms; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; + +public class ProductSalesInfoRequest extends AbstractRequest { + + @NotNull + private String storeId;// 门店ID + @NotNull + private String startTime;// 开始时间 + @NotNull + private String endTime;// 结束时间 + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/liteappdc/LiteAppOrderCreateRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/liteappdc/LiteAppOrderCreateRequest.java new file mode 100644 index 0000000..e719007 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/liteappdc/LiteAppOrderCreateRequest.java @@ -0,0 +1,69 @@ +package com.jwsaas.api.request.liteappdc; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class LiteAppOrderCreateRequest extends AbstractRequest { + + @NotNull + private String storeId; + + @NotNull + @IgnoreSign + private String wid; + + @NotNull + @IgnoreSign + private String userId; + + @NotNull + @IgnoreSign + private String openId; + + @NotNull + @IgnoreSign + private String orderInfoJson; + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getWid() { + return wid; + } + + public void setWid(String wid) { + this.wid = wid; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public String getOrderInfoJson() { + return orderInfoJson; + } + + public void setOrderInfoJson(String orderInfoJson) { + this.orderInfoJson = orderInfoJson; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/liteappdc/LiteAppSalesOrderCreateRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/liteappdc/LiteAppSalesOrderCreateRequest.java new file mode 100644 index 0000000..7ed83a9 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/liteappdc/LiteAppSalesOrderCreateRequest.java @@ -0,0 +1,66 @@ +package com.jwsaas.api.request.liteappdc; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class LiteAppSalesOrderCreateRequest extends AbstractRequest { + + @NotNull + private String storeId; + + @IgnoreSign + @NotNull + private String prepayId; + + @IgnoreSign + @NotNull + private String tradeNo; + + @IgnoreSign + private String memberId; + + @IgnoreSign + private String memo; + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getPrepayId() { + return prepayId; + } + + public void setPrepayId(String prepayId) { + this.prepayId = prepayId; + } + + public String getTradeNo() { + return tradeNo; + } + + public void setTradeNo(String tradeNo) { + this.tradeNo = tradeNo; + } + + public String getMemberId() { + return memberId; + } + + public void setMemberId(String memberId) { + this.memberId = memberId; + } + + public String getMemo() { + return memo; + } + + public void setMemo(String memo) { + this.memo = memo; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/liteappdc/LiteAppWxdcSalesOrderCreateRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/liteappdc/LiteAppWxdcSalesOrderCreateRequest.java new file mode 100644 index 0000000..41d71fb --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/liteappdc/LiteAppWxdcSalesOrderCreateRequest.java @@ -0,0 +1,311 @@ +package com.jwsaas.api.request.liteappdc; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +import javax.validation.constraints.NotNull; + +/** + * Created by Administrator on 2018\11\13 0013. + */ +public class LiteAppWxdcSalesOrderCreateRequest extends AbstractRequest { + @NotNull + private String storeId; + + @NotNull + @IgnoreSign + private String wid; + + @NotNull + @IgnoreSign + private String userId; + + @NotNull + @IgnoreSign + private String openId; + + @IgnoreSign + private String phone; + + @IgnoreSign + private String daySeq; + + @IgnoreSign + private String takeNo; + + @IgnoreSign + private String tableNo; + + @IgnoreSign + private String tableName; + + @NotNull + @IgnoreSign + private Integer people; + + @NotNull + @IgnoreSign + private Integer busMode; + + @NotNull + @IgnoreSign + private Double amount; + + @NotNull + @IgnoreSign + private Double discountTotal;//优惠额; + + @NotNull + @IgnoreSign + private Double receivable; + + @IgnoreSign + private Double maling; + + @IgnoreSign + private Double paid; + + @NotNull + @IgnoreSign + private String saleDate; + + @NotNull + @IgnoreSign + private Integer isMember; + + @IgnoreSign + private String description; + + @NotNull + @IgnoreSign + private String payMode;//付款方式 02:会员卡支付;05:微信支付; + + @IgnoreSign + private String receiveName; + + @IgnoreSign + private String receiveMobile; + + @IgnoreSign + private String receiveAddress; + + @NotNull + @IgnoreSign + private Double boxFee; + + @NotNull + @IgnoreSign + private Double distributionFee; + + @NotNull + @IgnoreSign + private String orderInfoJson; + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getWid() { + return wid; + } + + public void setWid(String wid) { + this.wid = wid; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public String getDaySeq() { + return daySeq; + } + + public void setDaySeq(String daySeq) { + this.daySeq = daySeq; + } + + public String getTakeNo() { + return takeNo; + } + + public void setTakeNo(String takeNo) { + this.takeNo = takeNo; + } + + public String getTableNo() { + return tableNo; + } + + public void setTableNo(String tableNo) { + this.tableNo = tableNo; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public Integer getPeople() { + return people; + } + + public void setPeople(Integer people) { + this.people = people; + } + + public Integer getBusMode() { + return busMode; + } + + public void setBusMode(Integer busMode) { + this.busMode = busMode; + } + + public Double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + + public Double getDiscountTotal() { + return discountTotal; + } + + public void setDiscountTotal(Double discountTotal) { + this.discountTotal = discountTotal; + } + + public Double getReceivable() { + return receivable; + } + + public void setReceivable(Double receivable) { + this.receivable = receivable; + } + + public Double getMaling() { + return maling; + } + + public void setMaling(Double maling) { + this.maling = maling; + } + + public Double getPaid() { + return paid; + } + + public void setPaid(Double paid) { + this.paid = paid; + } + + public String getSaleDate() { + return saleDate; + } + + public void setSaleDate(String saleDate) { + this.saleDate = saleDate; + } + + public Integer getIsMember() { + return isMember; + } + + public void setIsMember(Integer isMember) { + this.isMember = isMember; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getPayMode() { + return payMode; + } + + public void setPayMode(String payMode) { + this.payMode = payMode; + } + + public String getReceiveName() { + return receiveName; + } + + public void setReceiveName(String receiveName) { + this.receiveName = receiveName; + } + + public String getReceiveMobile() { + return receiveMobile; + } + + public void setReceiveMobile(String receiveMobile) { + this.receiveMobile = receiveMobile; + } + + public String getReceiveAddress() { + return receiveAddress; + } + + public void setReceiveAddress(String receiveAddress) { + this.receiveAddress = receiveAddress; + } + + public Double getBoxFee() { + return boxFee; + } + + public void setBoxFee(Double boxFee) { + this.boxFee = boxFee; + } + + public Double getDistributionFee() { + return distributionFee; + } + + public void setDistributionFee(Double distributionFee) { + this.distributionFee = distributionFee; + } + + public String getOrderInfoJson() { + return orderInfoJson; + } + + public void setOrderInfoJson(String orderInfoJson) { + this.orderInfoJson = orderInfoJson; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/liteappdc/LiteAppWxdcSalesPayDataRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/liteappdc/LiteAppWxdcSalesPayDataRequest.java new file mode 100644 index 0000000..9fb411f --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/liteappdc/LiteAppWxdcSalesPayDataRequest.java @@ -0,0 +1,48 @@ +package com.jwsaas.api.request.liteappdc; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +import javax.validation.constraints.NotNull; + +/** + * 微信点餐小程序支付成功后,修改订单状态; + * Created by Administrator on 2018\11\14 0014. + */ +public class LiteAppWxdcSalesPayDataRequest extends AbstractRequest { + + @NotNull + @IgnoreSign + private String wid; + + @NotNull + private String orderId; + + @NotNull + @IgnoreSign + private String payDate; + + public String getWid() { + return wid; + } + + public void setWid(String wid) { + this.wid = wid; + } + + public String getPayDate() { + return payDate; + } + + public void setPayDate(String payDate) { + this.payDate = payDate; + } + + public String getOrderId() { + return orderId; + } + + public void setOrderId(String orderId) { + this.orderId = orderId; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/ops/CityInfoListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/ops/CityInfoListRequest.java new file mode 100644 index 0000000..04332ac --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/ops/CityInfoListRequest.java @@ -0,0 +1,17 @@ +package com.jwsaas.api.request.ops; + +import com.jwsaas.api.request.AbstractRequest; + +public class CityInfoListRequest extends AbstractRequest { + + public String parentId; + + public String getParentId() { + return parentId; + } + + public void setParentId(String parentId) { + this.parentId = parentId; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/pay/PaymentParameterRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/pay/PaymentParameterRequest.java new file mode 100644 index 0000000..fe388aa --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/pay/PaymentParameterRequest.java @@ -0,0 +1,20 @@ +package com.jwsaas.api.request.pay; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; + +public class PaymentParameterRequest extends AbstractRequest { + + @NotNull + private String storeId; + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/peripheral/CardReaderInfoRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/peripheral/CardReaderInfoRequest.java new file mode 100644 index 0000000..6ae47d0 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/peripheral/CardReaderInfoRequest.java @@ -0,0 +1,7 @@ +package com.jwsaas.api.request.peripheral; + +import com.jwsaas.api.request.AbstractRequest; + +public class CardReaderInfoRequest extends AbstractRequest { + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/peripheral/PrinterInfoRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/peripheral/PrinterInfoRequest.java new file mode 100644 index 0000000..d7dc36d --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/peripheral/PrinterInfoRequest.java @@ -0,0 +1,7 @@ +package com.jwsaas.api.request.peripheral; + +import com.jwsaas.api.request.AbstractRequest; + +public class PrinterInfoRequest extends AbstractRequest { + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/pos/ErpPosSetRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/pos/ErpPosSetRequest.java new file mode 100644 index 0000000..3dd69b3 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/pos/ErpPosSetRequest.java @@ -0,0 +1,30 @@ +package com.jwsaas.api.request.pos; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; + +public class ErpPosSetRequest extends AbstractRequest { + + @NotNull + public String storeId; + + @NotNull + public String posNo; + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getPosNo() { + return posNo; + } + + public void setPosNo(String posNo) { + this.posNo = posNo; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/pos/PosAuthRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/pos/PosAuthRequest.java new file mode 100644 index 0000000..57fb719 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/pos/PosAuthRequest.java @@ -0,0 +1,31 @@ +package com.jwsaas.api.request.pos; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; + +public class PosAuthRequest extends AbstractRequest { + + @NotNull + public String storeId; + + @NotNull + public String posNo; + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getPosNo() { + return posNo; + } + + public void setPosNo(String posNo) { + this.posNo = posNo; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/pos/PosMonitorRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/pos/PosMonitorRequest.java new file mode 100644 index 0000000..5a97c4a --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/pos/PosMonitorRequest.java @@ -0,0 +1,144 @@ +package com.jwsaas.api.request.pos; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class PosMonitorRequest extends AbstractRequest { + + @NotNull + public String storeId; + @NotNull + public String posNo; + @NotNull + @IgnoreSign + public String os;// 操作系统 + @NotNull + @IgnoreSign + public String osType;// 操作系统类型(32-32位;64-64位;) + @NotNull + @IgnoreSign + public String softwareVersion;// 软件版本 + @IgnoreSign + public int memoryTotalSize;// 总内存 + @IgnoreSign + public int memoryFreeSize;// 剩余内存 + @IgnoreSign + public String diskName;// 工作盘盘符 + @IgnoreSign + public int diskTotalSize;// 工作盘磁盘空间 + @IgnoreSign + public int diskFreeSize;// 工作盘磁盘剩余空间 + @IgnoreSign + public int cpuSize;// 处理器数量 + @IgnoreSign + public String storeName;// 门店名称 + @IgnoreSign + public String aliasName;// POS别名 + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getPosNo() { + return posNo; + } + + public void setPosNo(String posNo) { + this.posNo = posNo; + } + + public String getOs() { + return os; + } + + public void setOs(String os) { + this.os = os; + } + + public String getOsType() { + return osType; + } + + public void setOsType(String osType) { + this.osType = osType; + } + + public String getSoftwareVersion() { + return softwareVersion; + } + + public void setSoftwareVersion(String softwareVersion) { + this.softwareVersion = softwareVersion; + } + + public int getMemoryTotalSize() { + return memoryTotalSize; + } + + public void setMemoryTotalSize(int memoryTotalSize) { + this.memoryTotalSize = memoryTotalSize; + } + + public int getMemoryFreeSize() { + return memoryFreeSize; + } + + public void setMemoryFreeSize(int memoryFreeSize) { + this.memoryFreeSize = memoryFreeSize; + } + + public String getDiskName() { + return diskName; + } + + public void setDiskName(String diskName) { + this.diskName = diskName; + } + + public int getDiskTotalSize() { + return diskTotalSize; + } + + public void setDiskTotalSize(int diskTotalSize) { + this.diskTotalSize = diskTotalSize; + } + + public int getDiskFreeSize() { + return diskFreeSize; + } + + public void setDiskFreeSize(int diskFreeSize) { + this.diskFreeSize = diskFreeSize; + } + + public int getCpuSize() { + return cpuSize; + } + + public void setCpuSize(int cpuSize) { + this.cpuSize = cpuSize; + } + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + + public String getAliasName() { + return aliasName; + } + + public void setAliasName(String aliasName) { + this.aliasName = aliasName; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/pos/PosRegisterRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/pos/PosRegisterRequest.java new file mode 100644 index 0000000..bd259db --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/pos/PosRegisterRequest.java @@ -0,0 +1,103 @@ +package com.jwsaas.api.request.pos; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class PosRegisterRequest extends AbstractRequest { + + @NotNull + public String pollcode; + + @NotNull + public String appSign; + + @NotNull + public String terminalType; + + @NotNull + @IgnoreSign + public String name; + + @NotNull + @IgnoreSign + public String MACAddress; + + @NotNull + @IgnoreSign + public String serialNumber; + + @NotNull + @IgnoreSign + public String cpuNumber; + + @IgnoreSign + public String aliasName;// 别名 + + public String getPollcode() { + return pollcode; + } + + public void setPollcode(String pollcode) { + this.pollcode = pollcode; + } + + + public String getAppSign() { + return appSign; + } + + public void setAppSign(String appSign) { + this.appSign = appSign; + } + + public String getTerminalType() { + return terminalType; + } + + public void setTerminalType(String terminalType) { + this.terminalType = terminalType; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getMACAddress() { + return MACAddress; + } + + public void setMACAddress(String mACAddress) { + MACAddress = mACAddress; + } + + public String getSerialNumber() { + return serialNumber; + } + + public void setSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + } + + public String getCpuNumber() { + return cpuNumber; + } + + public void setCpuNumber(String cpuNumber) { + this.cpuNumber = cpuNumber; + } + + public String getAliasName() { + return aliasName; + } + + public void setAliasName(String aliasName) { + this.aliasName = aliasName; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/pos/PosRegisterV1ToV2Request.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/pos/PosRegisterV1ToV2Request.java new file mode 100644 index 0000000..49ed4b1 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/pos/PosRegisterV1ToV2Request.java @@ -0,0 +1,149 @@ +package com.jwsaas.api.request.pos; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class PosRegisterV1ToV2Request extends AbstractRequest { + + @NotNull + public String storeId; + @NotNull + @IgnoreSign + public String tenantId4V1;// V1企业编号 + @NotNull + @IgnoreSign + public String storeNo4V1;// V1门店编号 + @NotNull + @IgnoreSign + public String storeName4V1;// V1门店名称 + @NotNull + @IgnoreSign + public String posNo4V1;// V1POS编号 + @NotNull + public String pollcode; + @NotNull + public String appSign; + @NotNull + public String terminalType; + @NotNull + @IgnoreSign + public String name; + @NotNull + @IgnoreSign + public String MACAddress; + @NotNull + @IgnoreSign + public String serialNumber; + @NotNull + @IgnoreSign + public String cpuNumber; + @IgnoreSign + public String aliasName;// 别名 + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getTenantId4V1() { + return tenantId4V1; + } + + public void setTenantId4V1(String tenantId4V1) { + this.tenantId4V1 = tenantId4V1; + } + + public String getStoreNo4V1() { + return storeNo4V1; + } + + public void setStoreNo4V1(String storeNo4V1) { + this.storeNo4V1 = storeNo4V1; + } + + public String getStoreName4V1() { + return storeName4V1; + } + + public void setStoreName4V1(String storeName4V1) { + this.storeName4V1 = storeName4V1; + } + + public String getPosNo4V1() { + return posNo4V1; + } + + public void setPosNo4V1(String posNo4V1) { + this.posNo4V1 = posNo4V1; + } + + public String getPollcode() { + return pollcode; + } + + public void setPollcode(String pollcode) { + this.pollcode = pollcode; + } + + public String getAppSign() { + return appSign; + } + + public void setAppSign(String appSign) { + this.appSign = appSign; + } + + public String getTerminalType() { + return terminalType; + } + + public void setTerminalType(String terminalType) { + this.terminalType = terminalType; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getMACAddress() { + return MACAddress; + } + + public void setMACAddress(String mACAddress) { + MACAddress = mACAddress; + } + + public String getSerialNumber() { + return serialNumber; + } + + public void setSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + } + + public String getCpuNumber() { + return cpuNumber; + } + + public void setCpuNumber(String cpuNumber) { + this.cpuNumber = cpuNumber; + } + + public String getAliasName() { + return aliasName; + } + + public void setAliasName(String aliasName) { + this.aliasName = aliasName; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/pos/PosSetPlanDownRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/pos/PosSetPlanDownRequest.java new file mode 100644 index 0000000..d0ff2b9 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/pos/PosSetPlanDownRequest.java @@ -0,0 +1,20 @@ +package com.jwsaas.api.request.pos; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; + +public class PosSetPlanDownRequest extends StoreBaseRequest { + + @NotNull + public String terminalType; + + public String getTerminalType() { + return terminalType; + } + + public void setTerminalType(String terminalType) { + this.terminalType = terminalType; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/pos/PosSetPlanRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/pos/PosSetPlanRequest.java new file mode 100644 index 0000000..73fdf52 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/pos/PosSetPlanRequest.java @@ -0,0 +1,33 @@ +package com.jwsaas.api.request.pos; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class PosSetPlanRequest extends AbstractRequest { + + @NotNull + public String storeId; + + @NotNull + @IgnoreSign + public String terminalType; + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getTerminalType() { + return terminalType; + } + + public void setTerminalType(String terminalType) { + this.terminalType = terminalType; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/pos/PosSetPlanUpRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/pos/PosSetPlanUpRequest.java new file mode 100644 index 0000000..35546f7 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/pos/PosSetPlanUpRequest.java @@ -0,0 +1,65 @@ +package com.jwsaas.api.request.pos; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class PosSetPlanUpRequest extends AbstractRequest { + + @NotNull + public String planId; + + @IgnoreSign + public String resources; + + @IgnoreSign + public String shortcut; + + @IgnoreSign + public String module; + + @IgnoreSign + public String config; + + public String getPlanId() { + return planId; + } + + public void setPlanId(String planId) { + this.planId = planId; + } + + public String getResources() { + return resources; + } + + public void setResources(String resources) { + this.resources = resources; + } + + public String getShortcut() { + return shortcut; + } + + public void setShortcut(String shortcut) { + this.shortcut = shortcut; + } + + public String getModule() { + return module; + } + + public void setModule(String module) { + this.module = module; + } + + public String getConfig() { + return config; + } + + public void setConfig(String config) { + this.config = config; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/pos/ServerDataVersionRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/pos/ServerDataVersionRequest.java new file mode 100644 index 0000000..bfe634b --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/pos/ServerDataVersionRequest.java @@ -0,0 +1,9 @@ +package com.jwsaas.api.request.pos; + +import com.jwsaas.api.request.AbstractRequest; + +/** + * Created by wanghui on 2019\2\14 0014. + */ +public class ServerDataVersionRequest extends AbstractRequest { +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/pos/TenantLineAuthRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/pos/TenantLineAuthRequest.java new file mode 100644 index 0000000..b5bee9d --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/pos/TenantLineAuthRequest.java @@ -0,0 +1,20 @@ +package com.jwsaas.api.request.pos; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; + +public class TenantLineAuthRequest extends AbstractRequest { + + @NotNull + public String productSign; + + public String getProductSign() { + return productSign; + } + + public void setProductSign(String productSign) { + this.productSign = productSign; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/MakeBurdenRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/MakeBurdenRequest.java new file mode 100644 index 0000000..0b8fc07 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/MakeBurdenRequest.java @@ -0,0 +1,30 @@ +package com.jwsaas.api.request.product; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class MakeBurdenRequest extends StoreBaseRequest{ + + @IgnoreSign + private int pageNumber = 1; + + @IgnoreSign + private int pageSize = 10; + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/ProductBrandRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/ProductBrandRequest.java new file mode 100644 index 0000000..c80d644 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/ProductBrandRequest.java @@ -0,0 +1,7 @@ +package com.jwsaas.api.request.product; + +import com.jwsaas.api.request.store.StoreBaseRequest; + +public class ProductBrandRequest extends StoreBaseRequest{ + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/ProductBurdenRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/ProductBurdenRequest.java new file mode 100644 index 0000000..fef407e --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/ProductBurdenRequest.java @@ -0,0 +1,30 @@ +package com.jwsaas.api.request.product; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ProductBurdenRequest extends StoreBaseRequest{ + + @IgnoreSign + private int pageNumber = 1; + + @IgnoreSign + private int pageSize = 10; + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/ProductImageRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/ProductImageRequest.java new file mode 100644 index 0000000..25ac63d --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/ProductImageRequest.java @@ -0,0 +1,29 @@ +package com.jwsaas.api.request.product; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ProductImageRequest extends StoreBaseRequest { + + @IgnoreSign + private int pageNumber = 1; + + @IgnoreSign + private int pageSize = 10; + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/ProductMakeDetailRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/ProductMakeDetailRequest.java new file mode 100644 index 0000000..6930b98 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/ProductMakeDetailRequest.java @@ -0,0 +1,29 @@ +package com.jwsaas.api.request.product; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ProductMakeDetailRequest extends StoreBaseRequest { + + @IgnoreSign + private int pageNumber = 1; + @IgnoreSign + private int pageSize = 10; + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/ProductRatioRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/ProductRatioRequest.java new file mode 100644 index 0000000..6c34554 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/ProductRatioRequest.java @@ -0,0 +1,29 @@ +package com.jwsaas.api.request.product; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ProductRatioRequest extends StoreBaseRequest { + + @IgnoreSign + private int pageNumber = 1; + + @IgnoreSign + private int pageSize = 10; + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/ProductRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/ProductRequest.java new file mode 100644 index 0000000..28974fe --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/ProductRequest.java @@ -0,0 +1,30 @@ +package com.jwsaas.api.request.product; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ProductRequest extends StoreBaseRequest{ + + @IgnoreSign + private int pageNumber = 1; + + @IgnoreSign + private int pageSize = 10; + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/ProductSpecRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/ProductSpecRequest.java new file mode 100644 index 0000000..4001050 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/ProductSpecRequest.java @@ -0,0 +1,30 @@ +package com.jwsaas.api.request.product; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ProductSpecRequest extends StoreBaseRequest{ + + @IgnoreSign + private int pageNumber = 1; + + @IgnoreSign + private int pageSize = 10; + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/ProductSuitDetailRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/ProductSuitDetailRequest.java new file mode 100644 index 0000000..5d269ed --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/ProductSuitDetailRequest.java @@ -0,0 +1,30 @@ +package com.jwsaas.api.request.product; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ProductSuitDetailRequest extends StoreBaseRequest{ + + @IgnoreSign + private int pageNumber = 1; + + @IgnoreSign + private int pageSize = 10; + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/ProductSuitRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/ProductSuitRequest.java new file mode 100644 index 0000000..c7de0a6 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/ProductSuitRequest.java @@ -0,0 +1,30 @@ +package com.jwsaas.api.request.product; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ProductSuitRequest extends StoreBaseRequest{ + + @IgnoreSign + private int pageNumber = 1; + + @IgnoreSign + private int pageSize = 10; + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/ProductTypeRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/ProductTypeRequest.java new file mode 100644 index 0000000..2af75e7 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/ProductTypeRequest.java @@ -0,0 +1,30 @@ +package com.jwsaas.api.request.product; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ProductTypeRequest extends StoreBaseRequest{ + + @IgnoreSign + private int pageNumber = 1; + + @IgnoreSign + private int pageSize = 10; + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/ProductUnitRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/ProductUnitRequest.java new file mode 100644 index 0000000..62ffc1e --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/ProductUnitRequest.java @@ -0,0 +1,30 @@ +package com.jwsaas.api.request.product; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ProductUnitRequest extends StoreBaseRequest{ + + @IgnoreSign + private int pageNumber = 1; + + @IgnoreSign + private int pageSize = 10; + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/StoreMakeDetailRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/StoreMakeDetailRequest.java new file mode 100644 index 0000000..c89447a --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/StoreMakeDetailRequest.java @@ -0,0 +1,7 @@ +package com.jwsaas.api.request.product; + +import com.jwsaas.api.request.store.StoreBaseRequest; + +public class StoreMakeDetailRequest extends StoreBaseRequest{ + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/StoreMakeTypeRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/StoreMakeTypeRequest.java new file mode 100644 index 0000000..82d8082 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/product/StoreMakeTypeRequest.java @@ -0,0 +1,7 @@ +package com.jwsaas.api.request.product; + +import com.jwsaas.api.request.store.StoreBaseRequest; + +public class StoreMakeTypeRequest extends StoreBaseRequest{ + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramAdvPictureRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramAdvPictureRequest.java new file mode 100644 index 0000000..39282f8 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramAdvPictureRequest.java @@ -0,0 +1,56 @@ +package com.jwsaas.api.request.program; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +import javax.validation.constraints.NotNull; + +/** + * Created by Administrator on 2019\7\9 0009. + */ +public class ProgramAdvPictureRequest extends AbstractRequest { + + @NotNull + private String programId; + + @IgnoreSign + private Integer pageNumber; + + @IgnoreSign + private Integer pageSize; + + @IgnoreSign + private String orderType; + + public Integer getPageNumber() { + return pageNumber; + } + + public void setPageNumber(Integer pageNumber) { + this.pageNumber = pageNumber; + } + + public String getProgramId() { + return programId; + } + + public void setProgramId(String programId) { + this.programId = programId; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getOrderType() { + return orderType; + } + + public void setOrderType(String orderType) { + this.orderType = orderType; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramEvaluateDownloadRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramEvaluateDownloadRequest.java new file mode 100644 index 0000000..f0cfab2 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramEvaluateDownloadRequest.java @@ -0,0 +1,67 @@ +package com.jwsaas.api.request.program; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +import javax.validation.constraints.NotNull; + +/** + * Created by Administrator on 2019\7\9 0009. + */ +public class ProgramEvaluateDownloadRequest extends AbstractRequest { + + @NotNull + private String programId; + + @NotNull + private String openId; + + @IgnoreSign + private String storeId; + + @IgnoreSign + private Integer pageNumber; + + @IgnoreSign + private Integer pageSize; + + public String getProgramId() { + return programId; + } + + public void setProgramId(String programId) { + this.programId = programId; + } + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public Integer getPageNumber() { + return pageNumber; + } + + public void setPageNumber(Integer pageNumber) { + this.pageNumber = pageNumber; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramEvaluateUploadRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramEvaluateUploadRequest.java new file mode 100644 index 0000000..f47f5f8 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramEvaluateUploadRequest.java @@ -0,0 +1,147 @@ +package com.jwsaas.api.request.program; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +import javax.validation.constraints.NotNull; + +/** + * 巨为小程序评价上传; + * Created by Administrator on 2019\7\9 0009. + */ +public class ProgramEvaluateUploadRequest extends AbstractRequest { + + @NotNull + private String programId; + + @IgnoreSign + private String memberId; + + @NotNull + private String openId; + + @IgnoreSign + private String mobile; + + @NotNull + private String storeId; + + @IgnoreSign + private String touxiang; + + @IgnoreSign + private String memberName; + + @IgnoreSign + @NotNull + private String memo; + + @IgnoreSign + private Integer storeLevel; + + @IgnoreSign + private Integer productLevel; + + @IgnoreSign + private Integer serverLevel; + + @IgnoreSign + @NotNull + private String tickingTime; + + public String getProgramId() { + return programId; + } + + public void setProgramId(String programId) { + this.programId = programId; + } + + public String getMemberId() { + return memberId; + } + + public void setMemberId(String memberId) { + this.memberId = memberId; + } + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getTouxiang() { + return touxiang; + } + + public void setTouxiang(String touxiang) { + this.touxiang = touxiang; + } + + public String getMemberName() { + return memberName; + } + + public void setMemberName(String memberName) { + this.memberName = memberName; + } + + public String getMemo() { + return memo; + } + + public void setMemo(String memo) { + this.memo = memo; + } + + public Integer getStoreLevel() { + return storeLevel; + } + + public void setStoreLevel(Integer storeLevel) { + this.storeLevel = storeLevel; + } + + public Integer getProductLevel() { + return productLevel; + } + + public void setProductLevel(Integer productLevel) { + this.productLevel = productLevel; + } + + public Integer getServerLevel() { + return serverLevel; + } + + public void setServerLevel(Integer serverLevel) { + this.serverLevel = serverLevel; + } + + public String getTickingTime() { + return tickingTime; + } + + public void setTickingTime(String tickingTime) { + this.tickingTime = tickingTime; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramListOrderRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramListOrderRequest.java new file mode 100644 index 0000000..314e634 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramListOrderRequest.java @@ -0,0 +1,80 @@ +package com.jwsaas.api.request.program; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ProgramListOrderRequest extends AbstractRequest { + + + @NotNull + private String storeId;// 单号 + + @NotNull + @IgnoreSign + private String startTime;// 开始时间 + + @NotNull + @IgnoreSign + private String endTime;// 结束时间 + + @IgnoreSign + @NotNull + private Integer status;// 状态 0全部1待确认2已完成 + + @IgnoreSign + private int pageNumber = 1;// 页码 + + @IgnoreSign + private int pageSize = 10;// 每页展示数量 + + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderCancelRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderCancelRequest.java new file mode 100644 index 0000000..5b99341 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderCancelRequest.java @@ -0,0 +1,31 @@ +package com.jwsaas.api.request.program; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; + +public class ProgramOrderCancelRequest extends AbstractRequest{ + + @NotNull + private String busNo;// 订单编号 + + @NotNull + private String storeId;// 单号 + + + public String getBusNo() { + return busNo; + } + + public void setBusNo(String busNo) { + this.busNo = busNo; + } + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderConfirmRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderConfirmRequest.java new file mode 100644 index 0000000..4fee958 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderConfirmRequest.java @@ -0,0 +1,31 @@ +package com.jwsaas.api.request.program; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; + +public class ProgramOrderConfirmRequest extends AbstractRequest{ + + @NotNull + private String busNo;// 订单编号 + + @NotNull + private String storeId;// 单号 + + + public String getBusNo() { + return busNo; + } + + public void setBusNo(String busNo) { + this.busNo = busNo; + } + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderCreateRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderCreateRequest.java new file mode 100644 index 0000000..75e5b03 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderCreateRequest.java @@ -0,0 +1,47 @@ +package com.jwsaas.api.request.program; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ProgramOrderCreateRequest extends AbstractRequest { + + + @IgnoreSign + @NotNull + private String programId;// 小程序ID + + @IgnoreSign + @NotNull + private String openId;// 小程序openId + + @IgnoreSign + @NotNull + private String jsonString; + + + public String getProgramId() { + return programId; + } + + public void setProgramId(String programId) { + this.programId = programId; + } + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public String getJsonString() { + return jsonString; + } + + public void setJsonString(String jsonString) { + this.jsonString = jsonString; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderCreateSyncRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderCreateSyncRequest.java new file mode 100644 index 0000000..1d0ef54 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderCreateSyncRequest.java @@ -0,0 +1,46 @@ +package com.jwsaas.api.request.program; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ProgramOrderCreateSyncRequest extends AbstractRequest { + + @IgnoreSign + @NotNull + private String programId;// 小程序ID + + @IgnoreSign + @NotNull + private String openId;// 小程序openId + + @IgnoreSign + @NotNull + private String jsonString; + + public String getProgramId() { + return programId; + } + + public void setProgramId(String programId) { + this.programId = programId; + } + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public String getJsonString() { + return jsonString; + } + + public void setJsonString(String jsonString) { + this.jsonString = jsonString; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderDetailRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderDetailRequest.java new file mode 100644 index 0000000..83458c1 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderDetailRequest.java @@ -0,0 +1,47 @@ +package com.jwsaas.api.request.program; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ProgramOrderDetailRequest extends AbstractRequest { + + @IgnoreSign + @NotNull + private String programId;// 小程序ID + + @IgnoreSign + @NotNull + private String openId;// 小程序openId + + @IgnoreSign + @NotNull + private String tradeNo;// 单号 + + + public String getProgramId() { + return programId; + } + + public void setProgramId(String programId) { + this.programId = programId; + } + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public String getTradeNo() { + return tradeNo; + } + + public void setTradeNo(String tradeNo) { + this.tradeNo = tradeNo; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderEditRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderEditRequest.java new file mode 100644 index 0000000..09dc3c6 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderEditRequest.java @@ -0,0 +1,167 @@ +package com.jwsaas.api.request.program; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ProgramOrderEditRequest extends AbstractRequest { + + @IgnoreSign + @NotNull + private String programId;// 小程序ID + + @IgnoreSign + @NotNull + private String openId;// 小程序openId + + @IgnoreSign + @NotNull + private String busNo;// 订单号 + + @IgnoreSign + private String mobile;// 手机号 + + @IgnoreSign + private String tableNo;// 餐桌号 + + @IgnoreSign + private String tableName;// 参数名 + + @IgnoreSign + private Integer people;// 就餐人数 + + @IgnoreSign + private Integer busMode;// 营业模式 + + @IgnoreSign + private String reserveTime;// 预定时间 + + @IgnoreSign + private Double deliverFee;// 配送费 + + @IgnoreSign + private Double packageFee;// 餐盒费 + + @IgnoreSign + private String ext2;// 订单备注 + + @IgnoreSign + private String jsonStringDeliver;// 配送信息 + + @IgnoreSign + private String jsonStringProduct;// 订单明细 + + public String getProgramId() { + return programId; + } + + public void setProgramId(String programId) { + this.programId = programId; + } + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public String getBusNo() { + return busNo; + } + + public void setBusNo(String busNo) { + this.busNo = busNo; + } + + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public String getTableNo() { + return tableNo; + } + + public void setTableNo(String tableNo) { + this.tableNo = tableNo; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public Integer getPeople() { + return people; + } + + public void setPeople(Integer people) { + this.people = people; + } + + public Integer getBusMode() { + return busMode; + } + + public void setBusMode(Integer busMode) { + this.busMode = busMode; + } + + public String getReserveTime() { + return reserveTime; + } + + public void setReserveTime(String reserveTime) { + this.reserveTime = reserveTime; + } + + public Double getDeliverFee() { + return deliverFee; + } + + public void setDeliverFee(Double deliverFee) { + this.deliverFee = deliverFee; + } + + public Double getPackageFee() { + return packageFee; + } + + public void setPackageFee(Double packageFee) { + this.packageFee = packageFee; + } + + public String getExt2() { + return ext2; + } + + public void setExt2(String ext2) { + this.ext2 = ext2; + } + + public String getJsonStringDeliver() { + return jsonStringDeliver; + } + + public void setJsonStringDeliver(String jsonStringDeliver) { + this.jsonStringDeliver = jsonStringDeliver; + } + + public String getJsonStringProduct() { + return jsonStringProduct; + } + + public void setJsonStringProduct(String jsonStringProduct) { + this.jsonStringProduct = jsonStringProduct; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderHandlePeriodRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderHandlePeriodRequest.java new file mode 100644 index 0000000..cd85d62 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderHandlePeriodRequest.java @@ -0,0 +1,43 @@ +package com.jwsaas.api.request.program; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +import javax.validation.constraints.NotNull; + +public class ProgramOrderHandlePeriodRequest extends AbstractRequest { + @NotNull + private String storeId;// 门店ID + + @NotNull + @IgnoreSign + private String startTime;// 开始时间 + + @NotNull + @IgnoreSign + private String endTime;// 结束时间 + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderHandleRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderHandleRequest.java new file mode 100644 index 0000000..9f9fa13 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderHandleRequest.java @@ -0,0 +1,20 @@ +package com.jwsaas.api.request.program; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; + +public class ProgramOrderHandleRequest extends AbstractRequest{ + + @NotNull + private String storeId;// 门店ID + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderListRequest.java new file mode 100644 index 0000000..85b14e2 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderListRequest.java @@ -0,0 +1,114 @@ +package com.jwsaas.api.request.program; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ProgramOrderListRequest extends AbstractRequest { + + + @IgnoreSign + @NotNull + private String programId;// 小程序ID + + @IgnoreSign + @NotNull + private String openId;// 小程序openId + + @IgnoreSign + @NotNull + private Integer status;// 状态 0全部1待支付2已支付 + + @IgnoreSign + private int pageNumber = 1;// 页码 + + @IgnoreSign + private int pageSize = 10;// 每页展示数量 + + @IgnoreSign + private String mobile;// 手机号 + + @IgnoreSign + private String seqNo;// 取餐号 + + @IgnoreSign + private String startTime;// 开始时间 + + @IgnoreSign + private String endTime;// 结束时间 + + + public String getProgramId() { + return programId; + } + + public void setProgramId(String programId) { + this.programId = programId; + } + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public String getSeqNo() { + return seqNo; + } + + public void setSeqNo(String seqNo) { + this.seqNo = seqNo; + } + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderPayRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderPayRequest.java new file mode 100644 index 0000000..a7b9567 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderPayRequest.java @@ -0,0 +1,57 @@ +package com.jwsaas.api.request.program; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ProgramOrderPayRequest extends AbstractRequest { + + @IgnoreSign + @NotNull + private String programId;// 小程序ID + + @IgnoreSign + @NotNull + private String openId;// 小程序openId + + @NotNull + private String busNo;// 订单编号 + + @IgnoreSign + @NotNull + private String jsonString; + + public String getProgramId() { + return programId; + } + + public void setProgramId(String programId) { + this.programId = programId; + } + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public String getBusNo() { + return busNo; + } + + public void setBusNo(String busNo) { + this.busNo = busNo; + } + + public String getJsonString() { + return jsonString; + } + + public void setJsonString(String jsonString) { + this.jsonString = jsonString; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderQueryByBusNoRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderQueryByBusNoRequest.java new file mode 100644 index 0000000..8e4bbc6 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderQueryByBusNoRequest.java @@ -0,0 +1,33 @@ +package com.jwsaas.api.request.program; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; + +public class ProgramOrderQueryByBusNoRequest extends AbstractRequest{ + + @NotNull + private String busNo;// 订单编号 + + @NotNull + private String storeId;// 单号 + + + public String getBusNo() { + return busNo; + } + + public void setBusNo(String busNo) { + this.busNo = busNo; + } + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderQueryByTlBusNoRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderQueryByTlBusNoRequest.java new file mode 100644 index 0000000..3a98528 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderQueryByTlBusNoRequest.java @@ -0,0 +1,33 @@ +package com.jwsaas.api.request.program; + +import com.jwsaas.api.request.AbstractRequest; + +import javax.validation.constraints.NotNull; + +public class ProgramOrderQueryByTlBusNoRequest extends AbstractRequest{ + + @NotNull + private String busNo;// 订单编号 + + @NotNull + private String storeId;// 单号 + + + public String getBusNo() { + return busNo; + } + + public void setBusNo(String busNo) { + this.busNo = busNo; + } + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderRefundAgreeRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderRefundAgreeRequest.java new file mode 100644 index 0000000..18e804d --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderRefundAgreeRequest.java @@ -0,0 +1,32 @@ +package com.jwsaas.api.request.program; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; + +public class ProgramOrderRefundAgreeRequest extends AbstractRequest { + + @NotNull + private String busNo;// 订单编号 + + @NotNull + private String storeId;// 单号 + + + public String getBusNo() { + return busNo; + } + + public void setBusNo(String busNo) { + this.busNo = busNo; + } + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderRefundApplyRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderRefundApplyRequest.java new file mode 100644 index 0000000..be34202 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderRefundApplyRequest.java @@ -0,0 +1,50 @@ +package com.jwsaas.api.request.program; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ProgramOrderRefundApplyRequest extends AbstractRequest { + + @IgnoreSign + @NotNull + private String programId;// 小程序ID + + @IgnoreSign + @NotNull + private String openId;// 小程序openId + + @NotNull + private String busNo;// 订单编号 + + public String getProgramId() { + return programId; + } + + + public void setProgramId(String programId) { + this.programId = programId; + } + + + public String getOpenId() { + return openId; + } + + + public void setOpenId(String openId) { + this.openId = openId; + } + + + public String getBusNo() { + return busNo; + } + + + public void setBusNo(String busNo) { + this.busNo = busNo; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderRefundRejectRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderRefundRejectRequest.java new file mode 100644 index 0000000..b8f2522 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramOrderRefundRejectRequest.java @@ -0,0 +1,31 @@ +package com.jwsaas.api.request.program; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; + +public class ProgramOrderRefundRejectRequest extends AbstractRequest{ + + @NotNull + private String busNo;// 订单编号 + + @NotNull + private String storeId;// 单号 + + + public String getBusNo() { + return busNo; + } + + public void setBusNo(String busNo) { + this.busNo = busNo; + } + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramProductDetailRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramProductDetailRequest.java new file mode 100644 index 0000000..7b7192a --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramProductDetailRequest.java @@ -0,0 +1,49 @@ +package com.jwsaas.api.request.program; + + + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +import javax.validation.constraints.NotNull; + +/** + * + * Created by Administrator on 2019\9\10 0010. + */ +public class ProgramProductDetailRequest extends AbstractRequest { + + @NotNull + private String productId; + + @NotNull + private String specId; + + @NotNull + private String storeId; + + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId; + } + + public String getSpecId() { + return specId; + } + + public void setSpecId(String specId) { + this.specId = specId; + } + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramProductRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramProductRequest.java new file mode 100644 index 0000000..2f6ec3a --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramProductRequest.java @@ -0,0 +1,35 @@ +package com.jwsaas.api.request.program; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ProgramProductRequest extends AbstractRequest { + + @IgnoreSign + @NotNull + private String programId;// 小程序ID + + @IgnoreSign + @NotNull + private String storeId;// 小程序门店ID + + + public String getProgramId() { + return programId; + } + + public void setProgramId(String programId) { + this.programId = programId; + } + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramProductSaleStatusRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramProductSaleStatusRequest.java new file mode 100644 index 0000000..c87a96f --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramProductSaleStatusRequest.java @@ -0,0 +1,42 @@ +package com.jwsaas.api.request.program; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +import javax.validation.constraints.NotNull; + +public class ProgramProductSaleStatusRequest extends AbstractRequest { + + @NotNull + private String storeId; + + @IgnoreSign + private String productTypeIds; + + @IgnoreSign + private String specIds; + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getProductTypeIds() { + return productTypeIds; + } + + public void setProductTypeIds(String productTypeIds) { + this.productTypeIds = productTypeIds; + } + + public String getSpecIds() { + return specIds; + } + + public void setSpecIds(String specIds) { + this.specIds = specIds; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramProductStockRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramProductStockRequest.java new file mode 100644 index 0000000..f462198 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramProductStockRequest.java @@ -0,0 +1,31 @@ +package com.jwsaas.api.request.program; + +import com.jwsaas.api.request.AbstractRequest; + +import javax.validation.constraints.NotNull; + +public class ProgramProductStockRequest extends AbstractRequest { + + @NotNull + private String specIds; + + @NotNull + private String storeId; + + + public String getSpecIds() { + return specIds; + } + + public void setSpecIds(String specIds) { + this.specIds = specIds; + } + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramStoreDetailRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramStoreDetailRequest.java new file mode 100644 index 0000000..ab19c24 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramStoreDetailRequest.java @@ -0,0 +1,20 @@ +package com.jwsaas.api.request.program; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; + +public class ProgramStoreDetailRequest extends AbstractRequest { + + @NotNull + private String storeId;// 门店ID + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramStoreListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramStoreListRequest.java new file mode 100644 index 0000000..606f909 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramStoreListRequest.java @@ -0,0 +1,87 @@ +package com.jwsaas.api.request.program; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ProgramStoreListRequest extends AbstractRequest { + + @NotNull + private String programId;// 小程序ID + + @NotNull + private String longitude; // 经度 + + @NotNull + private String latitude; // 维度 + + @IgnoreSign + private String keyword;// 门店名称关键字 + + private String busMode;//门店营业方式; + + @IgnoreSign + private int pageNumber = 1;// 页码 + + @IgnoreSign + private int pageSize = 10;// 每页展示数量 + + + public String getBusMode() { + return busMode; + } + + public void setBusMode(String busMode) { + this.busMode = busMode; + } + + public String getProgramId() { + return programId; + } + + public void setProgramId(String programId) { + this.programId = programId; + } + + public String getKeyword() { + return keyword; + } + + public void setKeyword(String keyword) { + this.keyword = keyword; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + public String getLongitude() { + return longitude; + } + + public void setLongitude(String longitude) { + this.longitude = longitude; + } + + public String getLatitude() { + return latitude; + } + + public void setLatitude(String latitude) { + this.latitude = latitude; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramStoreListSyncRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramStoreListSyncRequest.java new file mode 100644 index 0000000..5a7480f --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramStoreListSyncRequest.java @@ -0,0 +1,43 @@ +package com.jwsaas.api.request.program; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ProgramStoreListSyncRequest extends AbstractRequest { + + @IgnoreSign + private String programId;// 小程序ID + + @IgnoreSign + private int pageNumber = 1;// 页码 + + @IgnoreSign + private int pageSize = 10;// 每页展示数量 + + + public String getProgramId() { + return programId; + } + + public void setProgramId(String programId) { + this.programId = programId; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} + diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramStoreOpenRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramStoreOpenRequest.java new file mode 100644 index 0000000..a0d81ca --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramStoreOpenRequest.java @@ -0,0 +1,19 @@ +package com.jwsaas.api.request.program; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; + +public class ProgramStoreOpenRequest extends AbstractRequest { + + @NotNull + private String storeId;// 门店ID + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramStoreStopRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramStoreStopRequest.java new file mode 100644 index 0000000..de25532 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramStoreStopRequest.java @@ -0,0 +1,19 @@ +package com.jwsaas.api.request.program; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; + +public class ProgramStoreStopRequest extends AbstractRequest { + + @NotNull + private String storeId;// 门店ID + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } +} \ No newline at end of file diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramUserAddressCreateRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramUserAddressCreateRequest.java new file mode 100644 index 0000000..3bc169d --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramUserAddressCreateRequest.java @@ -0,0 +1,143 @@ +package com.jwsaas.api.request.program; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ProgramUserAddressCreateRequest extends AbstractRequest { + + @NotNull + private String programId;// 小程序ID + + @IgnoreSign + @NotNull + private String openId;// 会员openId + + @IgnoreSign + private String memberId;// 会员ID + + @IgnoreSign + private String mobile;// 会员手机号 + + @IgnoreSign + private String receiveName;// 收货人姓名 + + @IgnoreSign + private String receiveMobile;// 收货人手机号 + + @IgnoreSign + private String receiveAddress;// 收货人地址 + + @IgnoreSign + private String receiveDoor;// 收货人门牌号 + + @IgnoreSign + private String latitude;//纬度 + + @IgnoreSign + private String longitude;//经度 + + @IgnoreSign + private Integer defaultFlag;//是否默认 0否-1是 + + @IgnoreSign + private Integer addressType;//地址类型 0公司-1家-2学校 + + public String getProgramId() { + return programId; + } + + public void setProgramId(String programId) { + this.programId = programId; + } + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public String getMemberId() { + return memberId; + } + + public void setMemberId(String memberId) { + this.memberId = memberId; + } + + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public String getReceiveName() { + return receiveName; + } + + public void setReceiveName(String receiveName) { + this.receiveName = receiveName; + } + + public String getReceiveMobile() { + return receiveMobile; + } + + public void setReceiveMobile(String receiveMobile) { + this.receiveMobile = receiveMobile; + } + + public String getReceiveAddress() { + return receiveAddress; + } + + public void setReceiveAddress(String receiveAddress) { + this.receiveAddress = receiveAddress; + } + + public String getReceiveDoor() { + return receiveDoor; + } + + public void setReceiveDoor(String receiveDoor) { + this.receiveDoor = receiveDoor; + } + + public String getLatitude() { + return latitude; + } + + public void setLatitude(String latitude) { + this.latitude = latitude; + } + + public String getLongitude() { + return longitude; + } + + public void setLongitude(String longitude) { + this.longitude = longitude; + } + + public Integer getDefaultFlag() { + return defaultFlag; + } + + public void setDefaultFlag(Integer defaultFlag) { + this.defaultFlag = defaultFlag; + } + + public Integer getAddressType() { + return addressType; + } + + public void setAddressType(Integer addressType) { + this.addressType = addressType; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramUserAddressDeleteRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramUserAddressDeleteRequest.java new file mode 100644 index 0000000..ff2175c --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramUserAddressDeleteRequest.java @@ -0,0 +1,46 @@ +package com.jwsaas.api.request.program; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ProgramUserAddressDeleteRequest extends AbstractRequest { + + @NotNull + private String id;// 地址记录ID + + @NotNull + private String programId;// 小程序ID + + @IgnoreSign + @NotNull + private String openId;// 会员openId + + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getProgramId() { + return programId; + } + + public void setProgramId(String programId) { + this.programId = programId; + } + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramUserAddressListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramUserAddressListRequest.java new file mode 100644 index 0000000..6332aae --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramUserAddressListRequest.java @@ -0,0 +1,55 @@ +package com.jwsaas.api.request.program; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ProgramUserAddressListRequest extends AbstractRequest { + + @NotNull + private String programId;// 小程序ID + + @IgnoreSign + @NotNull + private String openId;// 会员openId + + @IgnoreSign + private int pageNumber = 1;// 页码 + + @IgnoreSign + private int pageSize = 10;// 每页展示数量 + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + public String getProgramId() { + return programId; + } + + public void setProgramId(String programId) { + this.programId = programId; + } + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramUserAddressUpdateRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramUserAddressUpdateRequest.java new file mode 100644 index 0000000..6563cf6 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramUserAddressUpdateRequest.java @@ -0,0 +1,157 @@ +package com.jwsaas.api.request.program; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ProgramUserAddressUpdateRequest extends AbstractRequest { + + @NotNull + private String id;// 地址记录ID + + @NotNull + private String programId;// 小程序ID + + @IgnoreSign + @NotNull + private String openId;// 会员openId + + @IgnoreSign + private String memberId;// 会员ID + + @IgnoreSign + private String mobile;// 会员手机号 + + @IgnoreSign + private String receiveName;// 收货人姓名 + + @IgnoreSign + private String receiveMobile;// 收货人手机号 + + @IgnoreSign + private String receiveAddress;// 收货人地址 + + @IgnoreSign + private String receiveDoor;// 收货人门牌号 + + @IgnoreSign + private String latitude;//纬度 + + @IgnoreSign + private String longitude;//经度 + + @IgnoreSign + private Integer defaultFlag;//是否默认 0否-1是 + + @IgnoreSign + private Integer addressType;//地址类型 0公司-1家-2学校 + + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getProgramId() { + return programId; + } + + public void setProgramId(String programId) { + this.programId = programId; + } + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public String getMemberId() { + return memberId; + } + + public void setMemberId(String memberId) { + this.memberId = memberId; + } + + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public String getReceiveName() { + return receiveName; + } + + public void setReceiveName(String receiveName) { + this.receiveName = receiveName; + } + + public String getReceiveMobile() { + return receiveMobile; + } + + public void setReceiveMobile(String receiveMobile) { + this.receiveMobile = receiveMobile; + } + + public String getReceiveAddress() { + return receiveAddress; + } + + public void setReceiveAddress(String receiveAddress) { + this.receiveAddress = receiveAddress; + } + + public String getReceiveDoor() { + return receiveDoor; + } + + public void setReceiveDoor(String receiveDoor) { + this.receiveDoor = receiveDoor; + } + + public String getLatitude() { + return latitude; + } + + public void setLatitude(String latitude) { + this.latitude = latitude; + } + + public String getLongitude() { + return longitude; + } + + public void setLongitude(String longitude) { + this.longitude = longitude; + } + + public Integer getDefaultFlag() { + return defaultFlag; + } + + public void setDefaultFlag(Integer defaultFlag) { + this.defaultFlag = defaultFlag; + } + + public Integer getAddressType() { + return addressType; + } + + public void setAddressType(Integer addressType) { + this.addressType = addressType; + } + + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramUserWeixinFormIdRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramUserWeixinFormIdRequest.java new file mode 100644 index 0000000..774b696 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramUserWeixinFormIdRequest.java @@ -0,0 +1,66 @@ +package com.jwsaas.api.request.program; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ProgramUserWeixinFormIdRequest extends AbstractRequest { + + @NotNull + private String formId; + + @IgnoreSign + @NotNull + private String openId; + + @NotNull + private String programId;//小程序ID + + @NotNull + private String sendType;//orderCreate 订单支付下单 orderBack 申请订单退款 + + @NotNull + private String busNo;//业务单号 + + public String getFormId() { + return formId; + } + + public void setFormId(String formId) { + this.formId = formId; + } + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public String getProgramId() { + return programId; + } + + public void setProgramId(String programId) { + this.programId = programId; + } + + public String getSendType() { + return sendType; + } + + public void setSendType(String sendType) { + this.sendType = sendType; + } + + public String getBusNo() { + return busNo; + } + + public void setBusNo(String busNo) { + this.busNo = busNo; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramWeixinPayQueryRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramWeixinPayQueryRequest.java new file mode 100644 index 0000000..9710248 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramWeixinPayQueryRequest.java @@ -0,0 +1,46 @@ +package com.jwsaas.api.request.program; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ProgramWeixinPayQueryRequest extends AbstractRequest { + + @NotNull + private String storeId;// 小程序ID + + @NotNull + private String programId;// 小程序ID + + @IgnoreSign + @NotNull + private String tradeNo;// 支付单号 + + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getProgramId() { + return programId; + } + + public void setProgramId(String programId) { + this.programId = programId; + } + + public String getTradeNo() { + return tradeNo; + } + + public void setTradeNo(String tradeNo) { + this.tradeNo = tradeNo; + } + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramWeixinPayRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramWeixinPayRequest.java new file mode 100644 index 0000000..0d1be0e --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/program/ProgramWeixinPayRequest.java @@ -0,0 +1,81 @@ +package com.jwsaas.api.request.program; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ProgramWeixinPayRequest extends AbstractRequest { + + @NotNull + private String storeId;// 小程序ID + + @NotNull + private String programId;// 小程序ID + + @IgnoreSign + @NotNull + private String appid;// 小程序appId + + @IgnoreSign + @NotNull + private String openId;// 小程序openId + + @IgnoreSign + @NotNull + private String tradeNo;// 支付单号 + + @IgnoreSign + @NotNull + private Double amount;// 金额 + + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getProgramId() { + return programId; + } + + public void setProgramId(String programId) { + this.programId = programId; + } + + public String getAppid() { + return appid; + } + + public void setAppid(String appid) { + this.appid = appid; + } + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public Double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + + public String getTradeNo() { + return tradeNo; + } + + public void setTradeNo(String tradeNo) { + this.tradeNo = tradeNo; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/promotion/PromotionTypeListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/promotion/PromotionTypeListRequest.java new file mode 100644 index 0000000..0f44ce1 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/promotion/PromotionTypeListRequest.java @@ -0,0 +1,7 @@ +package com.jwsaas.api.request.promotion; + +import com.jwsaas.api.request.AbstractRequest; + +public class PromotionTypeListRequest extends AbstractRequest { + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/promotion/StorePromotionTaskRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/promotion/StorePromotionTaskRequest.java new file mode 100644 index 0000000..19ea1db --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/promotion/StorePromotionTaskRequest.java @@ -0,0 +1,61 @@ +package com.jwsaas.api.request.promotion; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StorePromotionTaskRequest extends AbstractRequest { + + @NotNull + private String storeId; + @NotNull + private String startDate; + @IgnoreSign + private Integer day; + @IgnoreSign + private int pageNumber = 1; + @IgnoreSign + private int pageSize = 10; + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public Integer getDay() { + return day; + } + + public void setDay(Integer day) { + this.day = day; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/split/SplitFoodAccountRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/split/SplitFoodAccountRequest.java new file mode 100644 index 0000000..a9201bd --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/split/SplitFoodAccountRequest.java @@ -0,0 +1,38 @@ +package com.jwsaas.api.request.split; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +import javax.validation.constraints.NotNull; + +/** + * @Author 37962 + * @Date 2023/7/24 + */ +public class SplitFoodAccountRequest extends StoreBaseRequest { + + @IgnoreSign + private int pageNumber = 1; + + @IgnoreSign + private int pageSize = 10; + + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/split/SplitShopAccountRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/split/SplitShopAccountRequest.java new file mode 100644 index 0000000..945135b --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/split/SplitShopAccountRequest.java @@ -0,0 +1,39 @@ +package com.jwsaas.api.request.split; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +import javax.validation.constraints.NotNull; + +/** + * @Author 37962 + * @Date 2023/7/24 + */ +public class SplitShopAccountRequest extends StoreBaseRequest { + + @IgnoreSign + private int pageNumber = 1; + + @IgnoreSign + private int pageSize = 10; + + + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/split/SplitStorePayRequet.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/split/SplitStorePayRequet.java new file mode 100644 index 0000000..62498b0 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/split/SplitStorePayRequet.java @@ -0,0 +1,53 @@ +package com.jwsaas.api.request.split; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +import javax.validation.constraints.NotNull; + +/** + * @Author 37962 + * @Date 2023/7/24 + */ +public class SplitStorePayRequet extends StoreBaseRequest { + + @IgnoreSign + private int pageNumber = 1; + @IgnoreSign + private int pageSize = 10; + @NotNull + private String fromTime; + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getFromTime() { + return fromTime; + } + + public void setFromTime(String fromTime) { + this.fromTime = fromTime; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/spwxdc/SpWxdcOrderCreateRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/spwxdc/SpWxdcOrderCreateRequest.java new file mode 100644 index 0000000..4ca0286 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/spwxdc/SpWxdcOrderCreateRequest.java @@ -0,0 +1,69 @@ +package com.jwsaas.api.request.spwxdc; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class SpWxdcOrderCreateRequest extends AbstractRequest { + + @NotNull + private String storeId; + + @NotNull + @IgnoreSign + private String wid; + + @NotNull + @IgnoreSign + private String userId; + + @NotNull + @IgnoreSign + private String openId; + + @NotNull + @IgnoreSign + private String orderInfoJson; + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getWid() { + return wid; + } + + public void setWid(String wid) { + this.wid = wid; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public String getOrderInfoJson() { + return orderInfoJson; + } + + public void setOrderInfoJson(String orderInfoJson) { + this.orderInfoJson = orderInfoJson; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/AskGoodsDetailRemoveRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/AskGoodsDetailRemoveRequest.java new file mode 100644 index 0000000..ca513f8 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/AskGoodsDetailRemoveRequest.java @@ -0,0 +1,38 @@ +package com.jwsaas.api.request.storage; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class AskGoodsDetailRemoveRequest extends StoreBaseRequest { + + @NotNull + @IgnoreSign + private String ticketId;// 单据ID + @IgnoreSign + private String detailId;// 单据详情Id + @IgnoreSign + private String goodsId;// 要货商品Id + + public String getTicketId() { + return ticketId; + } + public void setTicketId(String ticketId) { + this.ticketId = ticketId; + } + public String getDetailId() { + return detailId; + } + public void setDetailId(String detailId) { + this.detailId = detailId; + } + public String getGoodsId() { + return goodsId; + } + public void setGoodsId(String goodsId) { + this.goodsId = goodsId; + } + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/AskGoodsDetailRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/AskGoodsDetailRequest.java new file mode 100644 index 0000000..9ab0ef3 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/AskGoodsDetailRequest.java @@ -0,0 +1,44 @@ +package com.jwsaas.api.request.storage; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class AskGoodsDetailRequest extends StoreBaseRequest { + + @NotNull + @IgnoreSign + private String ticketId;// 单据ID + + @IgnoreSign + private int pageNumber = 1; + + @IgnoreSign + private int pageSize = 10; + + public String getTicketId() { + return ticketId; + } + + public void setTicketId(String ticketId) { + this.ticketId = ticketId; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/AskGoodsTemplateAddRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/AskGoodsTemplateAddRequest.java new file mode 100644 index 0000000..1ebd791 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/AskGoodsTemplateAddRequest.java @@ -0,0 +1,21 @@ +package com.jwsaas.api.request.storage; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class AskGoodsTemplateAddRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String jsonString; + + public String getJsonString() { + return jsonString; + } + + public void setJsonString(String jsonString) { + this.jsonString = jsonString; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/AskGoodsTemplateDetailRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/AskGoodsTemplateDetailRequest.java new file mode 100644 index 0000000..3be2e95 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/AskGoodsTemplateDetailRequest.java @@ -0,0 +1,42 @@ +package com.jwsaas.api.request.storage; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class AskGoodsTemplateDetailRequest extends StoreBaseRequest { + + @NotNull + @IgnoreSign + private String ticketId;// 单据ID + @IgnoreSign + private int pageNumber = 1; + @IgnoreSign + private int pageSize = 10; + + public String getTicketId() { + return ticketId; + } + + public void setTicketId(String ticketId) { + this.ticketId = ticketId; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/AskGoodsTemplateEditRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/AskGoodsTemplateEditRequest.java new file mode 100644 index 0000000..17ca6f8 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/AskGoodsTemplateEditRequest.java @@ -0,0 +1,21 @@ +package com.jwsaas.api.request.storage; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class AskGoodsTemplateEditRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String jsonString; + + public String getJsonString() { + return jsonString; + } + + public void setJsonString(String jsonString) { + this.jsonString = jsonString; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/AskGoodsTemplateListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/AskGoodsTemplateListRequest.java new file mode 100644 index 0000000..4082969 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/AskGoodsTemplateListRequest.java @@ -0,0 +1,49 @@ +package com.jwsaas.api.request.storage; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class AskGoodsTemplateListRequest extends StoreBaseRequest { + + @IgnoreSign + private int pageNumber = 1; + @IgnoreSign + private int pageSize = 10; + @IgnoreSign + private String property;// 查找属性名称 + @IgnoreSign + private String keyword;// 查找关键字 + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + public String getProperty() { + return property; + } + + public void setProperty(String property) { + this.property = property; + } + + public String getKeyword() { + return keyword; + } + + public void setKeyword(String keyword) { + this.keyword = keyword; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/AskGoodsTicketAddRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/AskGoodsTicketAddRequest.java new file mode 100644 index 0000000..e196bef --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/AskGoodsTicketAddRequest.java @@ -0,0 +1,21 @@ +package com.jwsaas.api.request.storage; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class AskGoodsTicketAddRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String jsonString; + + public String getJsonString() { + return jsonString; + } + + public void setJsonString(String jsonString) { + this.jsonString = jsonString; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/AskGoodsTicketEditRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/AskGoodsTicketEditRequest.java new file mode 100644 index 0000000..6fa9d6c --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/AskGoodsTicketEditRequest.java @@ -0,0 +1,21 @@ +package com.jwsaas.api.request.storage; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class AskGoodsTicketEditRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String jsonString; + + public String getJsonString() { + return jsonString; + } + + public void setJsonString(String jsonString) { + this.jsonString = jsonString; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/AskGoodsTicketRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/AskGoodsTicketRequest.java new file mode 100644 index 0000000..06696d2 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/AskGoodsTicketRequest.java @@ -0,0 +1,91 @@ +package com.jwsaas.api.request.storage; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +/** + * 门店要货单信息 + * + * @author PC1 + * + */ +public class AskGoodsTicketRequest extends StoreBaseRequest { + + @IgnoreSign + private String no;// 单据编号 + + @IgnoreSign + private int pageNumber = 1; + + @IgnoreSign + private int pageSize = 10; + + @IgnoreSign + private Integer status;// 单据状态 + + @IgnoreSign + private Integer payStatus;// 支付状态 + + @IgnoreSign + private String startTime;// 开始时间 + + @IgnoreSign + private String endTime;// 结束时间 + + public String getNo() { + return no; + } + + public void setNo(String no) { + this.no = no; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Integer getPayStatus() { + return payStatus; + } + + public void setPayStatus(Integer payStatus) { + this.payStatus = payStatus; + } + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/AskGoodsTicketStatusRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/AskGoodsTicketStatusRequest.java new file mode 100644 index 0000000..28ae2d7 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/AskGoodsTicketStatusRequest.java @@ -0,0 +1,55 @@ +package com.jwsaas.api.request.storage; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class AskGoodsTicketStatusRequest extends StoreBaseRequest { + + @NotNull + private String ticketId;// 单据ID + + @NotNull + private Integer type;// 操作类型 1-驳回2-审核通过 3-作废4-反审核 + + @NotNull + @IgnoreSign + private String operator;// 操作员 + + @IgnoreSign + private String reason;// 原因 + + public String getTicketId() { + return ticketId; + } + + public void setTicketId(String ticketId) { + this.ticketId = ticketId; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getOperator() { + return operator; + } + + public void setOperator(String operator) { + this.operator = operator; + } + + public String getReason() { + return reason; + } + + public void setReason(String reason) { + this.reason = reason; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/DispatchTicketDetailRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/DispatchTicketDetailRequest.java new file mode 100644 index 0000000..dd7d4f5 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/DispatchTicketDetailRequest.java @@ -0,0 +1,44 @@ +package com.jwsaas.api.request.storage; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class DispatchTicketDetailRequest extends StoreBaseRequest { + + @NotNull + @IgnoreSign + private String ticketId;// 单据ID + + @IgnoreSign + private int pageNumber = 1; + + @IgnoreSign + private int pageSize = 10; + + public String getTicketId() { + return ticketId; + } + + public void setTicketId(String ticketId) { + this.ticketId = ticketId; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/DispatchTicketReceiveRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/DispatchTicketReceiveRequest.java new file mode 100644 index 0000000..eebcdf2 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/DispatchTicketReceiveRequest.java @@ -0,0 +1,98 @@ +package com.jwsaas.api.request.storage; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class DispatchTicketReceiveRequest extends StoreBaseRequest { + + @NotNull + @IgnoreSign + private String no;// 单据编号/配送收货单编号 + @NotNull + @IgnoreSign + private String dispatchId;// 配送单ID + @NotNull + @IgnoreSign + private String dispatchNo;// 配送单编号 + @NotNull + @IgnoreSign + private String storageId;// 入库仓库 + @NotNull + @IgnoreSign + private String receiveDate;// 验收日期 + @NotNull + @IgnoreSign + private String receiveUser;// 验收人 + @IgnoreSign + private String description;// 备注说明 + @NotNull + @IgnoreSign + private String detail;// 明细信息 + + public String getNo() { + return no; + } + + public void setNo(String no) { + this.no = no; + } + + public String getDispatchId() { + return dispatchId; + } + + public void setDispatchId(String dispatchId) { + this.dispatchId = dispatchId; + } + + public String getDispatchNo() { + return dispatchNo; + } + + public void setDispatchNo(String dispatchNo) { + this.dispatchNo = dispatchNo; + } + + public String getStorageId() { + return storageId; + } + + public void setStorageId(String storageId) { + this.storageId = storageId; + } + + public String getReceiveDate() { + return receiveDate; + } + + public void setReceiveDate(String receiveDate) { + this.receiveDate = receiveDate; + } + + public String getReceiveUser() { + return receiveUser; + } + + public void setReceiveUser(String receiveUser) { + this.receiveUser = receiveUser; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDetail() { + return detail; + } + + public void setDetail(String detail) { + this.detail = detail; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/DispatchTicketRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/DispatchTicketRequest.java new file mode 100644 index 0000000..b579a40 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/DispatchTicketRequest.java @@ -0,0 +1,89 @@ +package com.jwsaas.api.request.storage; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class DispatchTicketRequest extends StoreBaseRequest { + + @IgnoreSign + private String no;// 单据编号 + @IgnoreSign + private String askGoodsId;// 要货单据Id + @IgnoreSign + private String askGoodsNo;// 要货单据编号 + @IgnoreSign + private Integer status;// 单据状态 + @IgnoreSign + private Integer pageNumber = 1; + @IgnoreSign + private Integer pageSize = 10; + @IgnoreSign + private String startTime;// 开始时间 + @IgnoreSign + private String endTime;// 结束时间 + + public String getNo() { + return no; + } + + public void setNo(String no) { + this.no = no; + } + + public String getAskGoodsId() { + return askGoodsId; + } + + public void setAskGoodsId(String askGoodsId) { + this.askGoodsId = askGoodsId; + } + + public String getAskGoodsNo() { + return askGoodsNo; + } + + public void setAskGoodsNo(String askGoodsNo) { + this.askGoodsNo = askGoodsNo; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Integer getPageNumber() { + return pageNumber; + } + + public void setPageNumber(Integer pageNumber) { + this.pageNumber = pageNumber; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/ProductDispatchPriceRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/ProductDispatchPriceRequest.java new file mode 100644 index 0000000..c4900ee --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/ProductDispatchPriceRequest.java @@ -0,0 +1,29 @@ +package com.jwsaas.api.request.storage; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +/** + * 产品价格 + * + * @author ZGT + * + */ +public class ProductDispatchPriceRequest extends StoreBaseRequest { + + @NotNull + @IgnoreSign + private String specIds;// 规格IDs + + public String getSpecIds() { + return specIds; + } + + public void setSpecIds(String specIds) { + this.specIds = specIds; + } + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/ProductStockRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/ProductStockRequest.java new file mode 100644 index 0000000..a2214e1 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/ProductStockRequest.java @@ -0,0 +1,19 @@ +package com.jwsaas.api.request.storage; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; + +public class ProductStockRequest extends StoreBaseRequest { + @NotNull + private String specIds; + + public String getSpecIds() { + return specIds; + } + + public void setSpecIds(String specIds) { + this.specIds = specIds; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreCostTicketDetailRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreCostTicketDetailRequest.java new file mode 100644 index 0000000..894fe27 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreCostTicketDetailRequest.java @@ -0,0 +1,23 @@ +package com.jwsaas.api.request.storage; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreCostTicketDetailRequest extends StoreBaseRequest { + + @NotNull + @IgnoreSign + private String ticketId;//单据编号 + + public String getTicketId() { + return ticketId; + } + + public void setTicketId(String ticketId) { + this.ticketId = ticketId; + } + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreCostTicketRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreCostTicketRequest.java new file mode 100644 index 0000000..b49f80a --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreCostTicketRequest.java @@ -0,0 +1,77 @@ +package com.jwsaas.api.request.storage; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreCostTicketRequest extends StoreBaseRequest { + + @IgnoreSign + private String no;//单据编号 + + @NotNull + private Integer status;//单据状态 + + @IgnoreSign + private Integer pageNumber = 1; + + @IgnoreSign + private Integer pageSize = 10; + + @IgnoreSign + private String startTime;// 开始时间 + + @IgnoreSign + private String endTime;// 结束时间 + + + public String getNo() { + return no; + } + + public void setNo(String no) { + this.no = no; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Integer getPageNumber() { + return pageNumber; + } + + public void setPageNumber(Integer pageNumber) { + this.pageNumber = pageNumber; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreCostTicketSalesInfoRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreCostTicketSalesInfoRequest.java new file mode 100644 index 0000000..2652fe7 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreCostTicketSalesInfoRequest.java @@ -0,0 +1,33 @@ +package com.jwsaas.api.request.storage; + +import com.jwsaas.api.request.AbstractRequest; + +import javax.validation.constraints.NotNull; + +/** + * Created by Administrator on 2019\4\18 0018. + */ +public class StoreCostTicketSalesInfoRequest extends AbstractRequest { + + @NotNull + private String storeId; + @NotNull + private String date; + + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getDate() { + return date; + } + + public void setDate(String date) { + this.date = date; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreCostTicketSaveRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreCostTicketSaveRequest.java new file mode 100644 index 0000000..ac6c652 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreCostTicketSaveRequest.java @@ -0,0 +1,34 @@ +package com.jwsaas.api.request.storage; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreCostTicketSaveRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String jsonString; + + @NotNull + @IgnoreSign + private String operator;// 操作员 + + public String getJsonString() { + return jsonString; + } + + public void setJsonString(String jsonString) { + this.jsonString = jsonString; + } + + public String getOperator() { + return operator; + } + + public void setOperator(String operator) { + this.operator = operator; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreCostTicketUpdateRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreCostTicketUpdateRequest.java new file mode 100644 index 0000000..4c552c6 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreCostTicketUpdateRequest.java @@ -0,0 +1,34 @@ +package com.jwsaas.api.request.storage; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreCostTicketUpdateRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String jsonString; + + @NotNull + @IgnoreSign + private String operator;// 操作员 + + public String getJsonString() { + return jsonString; + } + + public void setJsonString(String jsonString) { + this.jsonString = jsonString; + } + + public String getOperator() { + return operator; + } + + public void setOperator(String operator) { + this.operator = operator; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreCostTicketUpdateStatusRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreCostTicketUpdateStatusRequest.java new file mode 100644 index 0000000..04f91f4 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreCostTicketUpdateStatusRequest.java @@ -0,0 +1,44 @@ +package com.jwsaas.api.request.storage; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreCostTicketUpdateStatusRequest extends StoreBaseRequest { + + @NotNull + private String ticketId;// 单据ID + + @NotNull + private Integer type;// 操作类型 1审核2作废 + + @NotNull + @IgnoreSign + private String operator;// 操作员 + + public String getTicketId() { + return ticketId; + } + + public void setTicketId(String ticketId) { + this.ticketId = ticketId; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getOperator() { + return operator; + } + + public void setOperator(String operator) { + this.operator = operator; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreProductStockOutSummaryRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreProductStockOutSummaryRequest.java new file mode 100644 index 0000000..c97ff82 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreProductStockOutSummaryRequest.java @@ -0,0 +1,76 @@ +package com.jwsaas.api.request.storage; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +/** + * 门店商品库存消耗(出库)汇总
+ * 门店原物料消耗汇总 + * + * @author ZhangShuXiang + * + */ +public class StoreProductStockOutSummaryRequest extends StoreBaseRequest { + + @IgnoreSign + private String goodsType;// 商品类型 + @IgnoreSign + private String keyword;// 查询关键字(商品名称\商品编号) + @IgnoreSign + private Integer pageNumber = 1; + @IgnoreSign + private Integer pageSize = 10; + @IgnoreSign + private String startTime;// 开始时间 + @IgnoreSign + private String endTime;// 结束时间 + + public String getGoodsType() { + return goodsType; + } + + public void setGoodsType(String goodsType) { + this.goodsType = goodsType; + } + + public String getKeyword() { + return keyword; + } + + public void setKeyword(String keyword) { + this.keyword = keyword; + } + + public Integer getPageNumber() { + return pageNumber; + } + + public void setPageNumber(Integer pageNumber) { + this.pageNumber = pageNumber; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreProductStockRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreProductStockRequest.java new file mode 100644 index 0000000..7227c26 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreProductStockRequest.java @@ -0,0 +1,74 @@ +package com.jwsaas.api.request.storage; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreProductStockRequest extends StoreBaseRequest { + + @IgnoreSign + private String storageId;// 仓库ID + + @IgnoreSign + private String typeId;// 商品类别ID + + @IgnoreSign + private String goodsType;// 商品类型 + + @IgnoreSign + private String keyword;// 查询关键字(商品名称\商品编号) + + @IgnoreSign + private int pageNumber = 1; + + @IgnoreSign + private int pageSize = 10; + + public String getStorageId() { + return storageId; + } + + public void setStorageId(String storageId) { + this.storageId = storageId; + } + + public String getTypeId() { + return typeId; + } + + public void setTypeId(String typeId) { + this.typeId = typeId; + } + + public String getGoodsType() { + return goodsType; + } + + public void setGoodsType(String goodsType) { + this.goodsType = goodsType; + } + + public String getKeyword() { + return keyword; + } + + public void setKeyword(String keyword) { + this.keyword = keyword; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreProductStockSumRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreProductStockSumRequest.java new file mode 100644 index 0000000..105aa9d --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreProductStockSumRequest.java @@ -0,0 +1,28 @@ +package com.jwsaas.api.request.storage; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +/** + * 门店商品库存总数 + * + * @author ZhangShuXiang + * + */ +public class StoreProductStockSumRequest extends StoreBaseRequest { + + @NotNull + @IgnoreSign + private String specIds;// 规格IDs + + public String getSpecIds() { + return specIds; + } + + public void setSpecIds(String specIds) { + this.specIds = specIds; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStockCheckProductValidRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStockCheckProductValidRequest.java new file mode 100644 index 0000000..b97f47a --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStockCheckProductValidRequest.java @@ -0,0 +1,33 @@ +package com.jwsaas.api.request.storage; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreStockCheckProductValidRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String storageId;// 仓库ID + @IgnoreSign + @NotNull + private String specIds;// 商品Ids + + public String getStorageId() { + return storageId; + } + + public void setStorageId(String storageId) { + this.storageId = storageId; + } + + public String getSpecIds() { + return specIds; + } + + public void setSpecIds(String specIds) { + this.specIds = specIds; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStockCheckSummaryRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStockCheckSummaryRequest.java new file mode 100644 index 0000000..b23c9d1 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStockCheckSummaryRequest.java @@ -0,0 +1,69 @@ +package com.jwsaas.api.request.storage; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreStockCheckSummaryRequest extends StoreBaseRequest { + + @IgnoreSign + private String no;// 盘点单编号 + @IgnoreSign + private String storageId;// 仓库ID + @IgnoreSign + private String startTime;// 开始时间 + @IgnoreSign + private String endTime;// 结束时间 + @IgnoreSign + private String typeId;// 商品类别ID + @IgnoreSign + private String keyword; + + public String getNo() { + return no; + } + + public void setNo(String no) { + this.no = no; + } + + public String getStorageId() { + return storageId; + } + + public void setStorageId(String storageId) { + this.storageId = storageId; + } + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + + public String getTypeId() { + return typeId; + } + + public void setTypeId(String typeId) { + this.typeId = typeId; + } + + public String getKeyword() { + return keyword; + } + + public void setKeyword(String keyword) { + this.keyword = keyword; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStockCheckTemplateDetailRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStockCheckTemplateDetailRequest.java new file mode 100644 index 0000000..96f1a14 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStockCheckTemplateDetailRequest.java @@ -0,0 +1,20 @@ +package com.jwsaas.api.request.storage; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; + +public class StoreStockCheckTemplateDetailRequest extends StoreBaseRequest { + + @NotNull + private String ticketId; + + public String getTicketId() { + return ticketId; + } + + public void setTicketId(String ticketId) { + this.ticketId = ticketId; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStockCheckTemplateListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStockCheckTemplateListRequest.java new file mode 100644 index 0000000..bb92a7c --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStockCheckTemplateListRequest.java @@ -0,0 +1,39 @@ +package com.jwsaas.api.request.storage; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreStockCheckTemplateListRequest extends StoreBaseRequest { + + @IgnoreSign + private int pageNumber = 1; + @IgnoreSign + private int pageSize = 10; + @IgnoreSign + private String keyword; + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + public String getKeyword() { + return keyword; + } + + public void setKeyword(String keyword) { + this.keyword = keyword; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStockCheckTicketAddRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStockCheckTicketAddRequest.java new file mode 100644 index 0000000..076cb6c --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStockCheckTicketAddRequest.java @@ -0,0 +1,22 @@ +package com.jwsaas.api.request.storage; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreStockCheckTicketAddRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String jsonString; + + public String getJsonString() { + return jsonString; + } + + public void setJsonString(String jsonString) { + this.jsonString = jsonString; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStockCheckTicketDetailDelRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStockCheckTicketDetailDelRequest.java new file mode 100644 index 0000000..3bcdf14 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStockCheckTicketDetailDelRequest.java @@ -0,0 +1,22 @@ +package com.jwsaas.api.request.storage; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreStockCheckTicketDetailDelRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + public String detailIds; + + public String getDetailIds() { + return detailIds; + } + + public void setDetailIds(String detailIds) { + this.detailIds = detailIds; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStockCheckTicketDetailRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStockCheckTicketDetailRequest.java new file mode 100644 index 0000000..e4d3b37 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStockCheckTicketDetailRequest.java @@ -0,0 +1,44 @@ +package com.jwsaas.api.request.storage; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreStockCheckTicketDetailRequest extends StoreBaseRequest { + + @NotNull + @IgnoreSign + private String ticketId;// 单据ID + + @IgnoreSign + private int pageNumber = 1; + + @IgnoreSign + private int pageSize = 10; + + public String getTicketId() { + return ticketId; + } + + public void setTicketId(String ticketId) { + this.ticketId = ticketId; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStockCheckTicketRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStockCheckTicketRequest.java new file mode 100644 index 0000000..6ee01a6 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStockCheckTicketRequest.java @@ -0,0 +1,74 @@ +package com.jwsaas.api.request.storage; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreStockCheckTicketRequest extends StoreBaseRequest { + + @IgnoreSign + private String no;// 单据编号 + + @IgnoreSign + private int pageNumber = 1; + + @IgnoreSign + private int pageSize = 10; + + @IgnoreSign + private Integer status;// 单据状态 + + @IgnoreSign + private String startTime;// 开始时间 + + @IgnoreSign + private String endTime;// 结束时间 + + public String getNo() { + return no; + } + + public void setNo(String no) { + this.no = no; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStockUnCheckTicketDetailRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStockUnCheckTicketDetailRequest.java new file mode 100644 index 0000000..fc736f6 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStockUnCheckTicketDetailRequest.java @@ -0,0 +1,39 @@ +package com.jwsaas.api.request.storage; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreStockUnCheckTicketDetailRequest extends StoreBaseRequest { + + @IgnoreSign + private String storageId;// 仓库ID + @IgnoreSign + private String typeId;// 商品类别ID + @IgnoreSign + private String keyword; + + public String getStorageId() { + return storageId; + } + + public void setStorageId(String storageId) { + this.storageId = storageId; + } + + public String getTypeId() { + return typeId; + } + + public void setTypeId(String typeId) { + this.typeId = typeId; + } + + public String getKeyword() { + return keyword; + } + + public void setKeyword(String keyword) { + this.keyword = keyword; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStockUnCheckTicketDetailUpdateRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStockUnCheckTicketDetailUpdateRequest.java new file mode 100644 index 0000000..d4acf1f --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStockUnCheckTicketDetailUpdateRequest.java @@ -0,0 +1,32 @@ +package com.jwsaas.api.request.storage; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreStockUnCheckTicketDetailUpdateRequest extends StoreBaseRequest { + + @NotNull + private String workerNo;// 操作员工号 + @IgnoreSign + @NotNull + private String jsonString; + + public String getWorkerNo() { + return workerNo; + } + + public void setWorkerNo(String workerNo) { + this.workerNo = workerNo; + } + + public String getJsonString() { + return jsonString; + } + + public void setJsonString(String jsonString) { + this.jsonString = jsonString; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStockUnCheckTicketStatusUpdateRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStockUnCheckTicketStatusUpdateRequest.java new file mode 100644 index 0000000..01656b9 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStockUnCheckTicketStatusUpdateRequest.java @@ -0,0 +1,43 @@ +package com.jwsaas.api.request.storage; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreStockUnCheckTicketStatusUpdateRequest extends StoreBaseRequest { + + @IgnoreSign + private String storageId;// 仓库ID + @IgnoreSign + @NotNull + private Integer status;// 操作类型 1 审核 2 作废 + @IgnoreSign + @NotNull + private String checkMan;// 操作员 + + public String getStorageId() { + return storageId; + } + + public void setStorageId(String storageId) { + this.storageId = storageId; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getCheckMan() { + return checkMan; + } + + public void setCheckMan(String checkMan) { + this.checkMan = checkMan; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageOutTicketAddRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageOutTicketAddRequest.java new file mode 100644 index 0000000..b9348a4 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageOutTicketAddRequest.java @@ -0,0 +1,22 @@ +package com.jwsaas.api.request.storage; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreStorageOutTicketAddRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String jsonString; + + public String getJsonString() { + return jsonString; + } + + public void setJsonString(String jsonString) { + this.jsonString = jsonString; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageOutTicketDetailRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageOutTicketDetailRequest.java new file mode 100644 index 0000000..61d4aca --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageOutTicketDetailRequest.java @@ -0,0 +1,41 @@ +package com.jwsaas.api.request.storage; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreStorageOutTicketDetailRequest extends StoreBaseRequest { + + @NotNull + private String ticketId;// 单据ID + @IgnoreSign + private int pageNumber = 1; + @IgnoreSign + private int pageSize = 10; + + public String getTicketId() { + return ticketId; + } + + public void setTicketId(String ticketId) { + this.ticketId = ticketId; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageOutTicketEditRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageOutTicketEditRequest.java new file mode 100644 index 0000000..b5d7387 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageOutTicketEditRequest.java @@ -0,0 +1,22 @@ +package com.jwsaas.api.request.storage; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreStorageOutTicketEditRequest extends StoreBaseRequest { + + @NotNull + @IgnoreSign + private String jsonString; + + public String getJsonString() { + return jsonString; + } + + public void setJsonString(String jsonString) { + this.jsonString = jsonString; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageOutTicketListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageOutTicketListRequest.java new file mode 100644 index 0000000..3593c26 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageOutTicketListRequest.java @@ -0,0 +1,89 @@ +package com.jwsaas.api.request.storage; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreStorageOutTicketListRequest extends StoreBaseRequest { + + @IgnoreSign + private String type;// 出库类型 + @IgnoreSign + private String property;// 搜索属性 + @IgnoreSign + private String keyword;// 搜索关键字 + @IgnoreSign + private int pageNumber = 1; + @IgnoreSign + private int pageSize = 10; + @IgnoreSign + private Integer status;// 单据状态 + @IgnoreSign + private String startTime;// 开始时间 + @IgnoreSign + private String endTime;// 结束时间 + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getProperty() { + return property; + } + + public void setProperty(String property) { + this.property = property; + } + + public String getKeyword() { + return keyword; + } + + public void setKeyword(String keyword) { + this.keyword = keyword; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageOutTicketStatusChangeRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageOutTicketStatusChangeRequest.java new file mode 100644 index 0000000..0c4881a --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageOutTicketStatusChangeRequest.java @@ -0,0 +1,52 @@ +package com.jwsaas.api.request.storage; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreStorageOutTicketStatusChangeRequest extends StoreBaseRequest { + + @NotNull + private String ticketId;// 单据ID + @NotNull + private Integer action;// 操作类型(1-驳回;2-审核通过;3-作废;4-反审核;) + @NotNull + @IgnoreSign + private String operator;// 操作员 + @IgnoreSign + private String reason;// 原因 + + public String getTicketId() { + return ticketId; + } + + public void setTicketId(String ticketId) { + this.ticketId = ticketId; + } + + public Integer getAction() { + return action; + } + + public void setAction(Integer action) { + this.action = action; + } + + public String getOperator() { + return operator; + } + + public void setOperator(String operator) { + this.operator = operator; + } + + public String getReason() { + return reason; + } + + public void setReason(String reason) { + this.reason = reason; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageRequest.java new file mode 100644 index 0000000..26e61ec --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageRequest.java @@ -0,0 +1,7 @@ +package com.jwsaas.api.request.storage; + +import com.jwsaas.api.request.store.StoreBaseRequest; + +public class StoreStorageRequest extends StoreBaseRequest { + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageTicketAddRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageTicketAddRequest.java new file mode 100644 index 0000000..c21dfea --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageTicketAddRequest.java @@ -0,0 +1,22 @@ +package com.jwsaas.api.request.storage; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreStorageTicketAddRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String jsonString; + + public String getJsonString() { + return jsonString; + } + + public void setJsonString(String jsonString) { + this.jsonString = jsonString; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageTicketDetailRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageTicketDetailRequest.java new file mode 100644 index 0000000..3b53f19 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageTicketDetailRequest.java @@ -0,0 +1,41 @@ +package com.jwsaas.api.request.storage; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreStorageTicketDetailRequest extends StoreBaseRequest { + + @NotNull + private String ticketId;// 单据ID + @IgnoreSign + private int pageNumber = 1; + @IgnoreSign + private int pageSize = 10; + + public String getTicketId() { + return ticketId; + } + + public void setTicketId(String ticketId) { + this.ticketId = ticketId; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageTicketEditRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageTicketEditRequest.java new file mode 100644 index 0000000..e15e384 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageTicketEditRequest.java @@ -0,0 +1,22 @@ +package com.jwsaas.api.request.storage; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreStorageTicketEditRequest extends StoreBaseRequest { + + @NotNull + @IgnoreSign + private String jsonString; + + public String getJsonString() { + return jsonString; + } + + public void setJsonString(String jsonString) { + this.jsonString = jsonString; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageTicketListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageTicketListRequest.java new file mode 100644 index 0000000..90c186b --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageTicketListRequest.java @@ -0,0 +1,89 @@ +package com.jwsaas.api.request.storage; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreStorageTicketListRequest extends StoreBaseRequest { + + @IgnoreSign + private String type;// 入库类型 + @IgnoreSign + private String property;// 搜索属性 + @IgnoreSign + private String keyword;// 搜索关键字 + @IgnoreSign + private int pageNumber = 1; + @IgnoreSign + private int pageSize = 10; + @IgnoreSign + private Integer status;// 单据状态 + @IgnoreSign + private String startTime;// 开始时间 + @IgnoreSign + private String endTime;// 结束时间 + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getProperty() { + return property; + } + + public void setProperty(String property) { + this.property = property; + } + + public String getKeyword() { + return keyword; + } + + public void setKeyword(String keyword) { + this.keyword = keyword; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageTicketStatusChangeRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageTicketStatusChangeRequest.java new file mode 100644 index 0000000..16a8400 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageTicketStatusChangeRequest.java @@ -0,0 +1,52 @@ +package com.jwsaas.api.request.storage; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreStorageTicketStatusChangeRequest extends StoreBaseRequest { + + @NotNull + private String ticketId;// 单据ID + @NotNull + private Integer action;// 操作类型(1-驳回;2-审核通过;3-作废;4-反审核;) + @NotNull + @IgnoreSign + private String operator;// 操作员 + @IgnoreSign + private String reason;// 原因 + + public String getTicketId() { + return ticketId; + } + + public void setTicketId(String ticketId) { + this.ticketId = ticketId; + } + + public Integer getAction() { + return action; + } + + public void setAction(Integer action) { + this.action = action; + } + + public String getOperator() { + return operator; + } + + public void setOperator(String operator) { + this.operator = operator; + } + + public String getReason() { + return reason; + } + + public void setReason(String reason) { + this.reason = reason; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageTicketTypeRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageTicketTypeRequest.java new file mode 100644 index 0000000..02bbf69 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/storage/StoreStorageTicketTypeRequest.java @@ -0,0 +1,19 @@ +package com.jwsaas.api.request.storage; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreStorageTicketTypeRequest extends StoreBaseRequest { + + @IgnoreSign + private String type; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/AdjustPriceDetailRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/AdjustPriceDetailRequest.java new file mode 100644 index 0000000..cc96bf0 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/AdjustPriceDetailRequest.java @@ -0,0 +1,48 @@ +package com.jwsaas.api.request.store; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.open.annotation.IgnoreSign; + +/*** + * 调价单详情请求 + * @author louxutao + * + */ +public class AdjustPriceDetailRequest extends StoreBaseRequest { + + @NotNull + @IgnoreSign + private String ticketId;// 单据ID + + @IgnoreSign + private int pageNumber = 1; + + @IgnoreSign + private int pageSize = 10; + + public String getTicketId() { + return ticketId; + } + + public void setTicketId(String ticketId) { + this.ticketId = ticketId; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/AdjustPriceTicketAddRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/AdjustPriceTicketAddRequest.java new file mode 100644 index 0000000..6a55b07 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/AdjustPriceTicketAddRequest.java @@ -0,0 +1,85 @@ +package com.jwsaas.api.request.store; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.open.annotation.IgnoreSign; + +/** + * 新增商品调价单请求 + * @author louxutao + * + */ +public class AdjustPriceTicketAddRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String no; + + @IgnoreSign + @NotNull + private String effectDate; + + @IgnoreSign + @NotNull + private String workerNo; + + @IgnoreSign + private String description; + + @IgnoreSign + @NotNull + private String productString; + + @IgnoreSign + @NotNull + private String storeString; + + public String getNo() { + return no; + } + + public void setNo(String no) { + this.no = no; + } + + public String getEffectDate() { + return effectDate; + } + + public void setEffectDate(String effectDate) { + this.effectDate = effectDate; + } + + public String getWorkerNo() { + return workerNo; + } + + public void setWorkerNo(String workerNo) { + this.workerNo = workerNo; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getProductString() { + return productString; + } + + public void setProductString(String productString) { + this.productString = productString; + } + + public String getStoreString() { + return storeString; + } + + public void setStoreString(String storeString) { + this.storeString = storeString; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/AdjustPriceTicketAuditRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/AdjustPriceTicketAuditRequest.java new file mode 100644 index 0000000..4c45562 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/AdjustPriceTicketAuditRequest.java @@ -0,0 +1,41 @@ +package com.jwsaas.api.request.store; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +/** + * 商品调价单审核 + * + * @author PC1 + * + */ +public class AdjustPriceTicketAuditRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String ticketId; + + @IgnoreSign + @NotNull + private String workerNo; + + public String getTicketId() { + return ticketId; + } + + public void setTicketId(String ticketId) { + this.ticketId = ticketId; + } + + public String getWorkerNo() { + return workerNo; + } + + public void setWorkerNo(String workerNo) { + this.workerNo = workerNo; + } + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/AdjustPriceTicketEditRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/AdjustPriceTicketEditRequest.java new file mode 100644 index 0000000..7166cbc --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/AdjustPriceTicketEditRequest.java @@ -0,0 +1,85 @@ +package com.jwsaas.api.request.store; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.open.annotation.IgnoreSign; + +/** + * 编辑商品调价单请求 + * @author louxutao + * + */ +public class AdjustPriceTicketEditRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String ticketId; + + @IgnoreSign + @NotNull + private String effectDate; + + @IgnoreSign + @NotNull + private String workerNo; + + @IgnoreSign + private String description; + + @IgnoreSign + @NotNull + private String productString; + + @IgnoreSign + @NotNull + private String storeString; + + public String getTicketId() { + return ticketId; + } + + public void setTicketId(String ticketId) { + this.ticketId = ticketId; + } + + public String getEffectDate() { + return effectDate; + } + + public void setEffectDate(String effectDate) { + this.effectDate = effectDate; + } + + public String getWorkerNo() { + return workerNo; + } + + public void setWorkerNo(String workerNo) { + this.workerNo = workerNo; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getProductString() { + return productString; + } + + public void setProductString(String productString) { + this.productString = productString; + } + + public String getStoreString() { + return storeString; + } + + public void setStoreString(String storeString) { + this.storeString = storeString; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/AdjustPriceTicketRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/AdjustPriceTicketRequest.java new file mode 100644 index 0000000..2882f03 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/AdjustPriceTicketRequest.java @@ -0,0 +1,80 @@ +package com.jwsaas.api.request.store; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +/** + * 商品调价单请求 + * + * @author PC1 + * + */ +public class AdjustPriceTicketRequest extends StoreBaseRequest { + + @IgnoreSign + private String no;// 单据编号 + + @IgnoreSign + private int pageNumber = 1; + + @IgnoreSign + private int pageSize = 10; + + @IgnoreSign + private Integer status;// 单据状态 + + @IgnoreSign + private String startTime;// 开始时间 + + @IgnoreSign + private String endTime;// 结束时间 + + public String getNo() { + return no; + } + + public void setNo(String no) { + this.no = no; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/BrandRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/BrandRequest.java new file mode 100644 index 0000000..6e7e2ca --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/BrandRequest.java @@ -0,0 +1,5 @@ +package com.jwsaas.api.request.store; + +public class BrandRequest extends StoreBaseRequest{ + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/SalesOrderSummaryRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/SalesOrderSummaryRequest.java new file mode 100644 index 0000000..5915856 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/SalesOrderSummaryRequest.java @@ -0,0 +1,69 @@ +package com.jwsaas.api.request.store; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class SalesOrderSummaryRequest extends AbstractRequest { + + @NotNull + private String storeId; + + @IgnoreSign + private String workerNo; + + @IgnoreSign + private String typeIds;//末级分类ID,号分割 + + @IgnoreSign + @NotNull + private String startDate; + + @IgnoreSign + @NotNull + private String endDate; + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getWorkerNo() { + return workerNo; + } + + public void setWorkerNo(String workerNo) { + this.workerNo = workerNo; + } + + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + public String getTypeIds() { + return typeIds; + } + + public void setTypeIds(String typeIds) { + this.typeIds = typeIds; + } + + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountDetailInfoRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountDetailInfoRequest.java new file mode 100644 index 0000000..f8282ca --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountDetailInfoRequest.java @@ -0,0 +1,21 @@ +package com.jwsaas.api.request.store; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreAccountDetailInfoRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String detailId;// 明细ID + + public String getDetailId() { + return detailId; + } + + public void setDetailId(String detailId) { + this.detailId = detailId; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountDetailInfoRequest2.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountDetailInfoRequest2.java new file mode 100644 index 0000000..e6e214d --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountDetailInfoRequest2.java @@ -0,0 +1,30 @@ +package com.jwsaas.api.request.store; + + +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreAccountDetailInfoRequest2 extends StoreBaseRequest { + + @IgnoreSign + private String detailId;// 明细ID + + @IgnoreSign + private String voucherNo;// 微信支付单号 + + public String getDetailId() { + return detailId; + } + + public void setDetailId(String detailId) { + this.detailId = detailId; + } + + public String getVoucherNo() { + return voucherNo; + } + + public void setVoucherNo(String voucherNo) { + this.voucherNo = voucherNo; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountDetailListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountDetailListRequest.java new file mode 100644 index 0000000..22d1020 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountDetailListRequest.java @@ -0,0 +1,81 @@ +package com.jwsaas.api.request.store; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreAccountDetailListRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String accountId;// 账户ID + @IgnoreSign + private String type;// 收支类型(1-收入;2-支出;) + @IgnoreSign + private String busType;// 业务类型 + @IgnoreSign + private String startTime; + @IgnoreSign + private String endTime; + @IgnoreSign + private int pageNumber = 1; + @IgnoreSign + private int pageSize = 10; + + public String getAccountId() { + return accountId; + } + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getBusType() { + return busType; + } + + public void setBusType(String busType) { + this.busType = busType; + } + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountEnchashmentApplyRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountEnchashmentApplyRequest.java new file mode 100644 index 0000000..c68fcf3 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountEnchashmentApplyRequest.java @@ -0,0 +1,64 @@ +package com.jwsaas.api.request.store; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreAccountEnchashmentApplyRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String accountId;// 账户ID + @IgnoreSign + @NotNull + private Double amount;// 提现金额 + @IgnoreSign + @NotNull + private String workerNo;// 操作员工号 + @IgnoreSign + @NotNull + private String sourceSign;// 来源标识 + @IgnoreSign + private String memo;// 备注说明 + + public String getAccountId() { + return accountId; + } + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + public Double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + + public String getWorkerNo() { + return workerNo; + } + + public void setWorkerNo(String workerNo) { + this.workerNo = workerNo; + } + + public String getSourceSign() { + return sourceSign; + } + + public void setSourceSign(String sourceSign) { + this.sourceSign = sourceSign; + } + + public String getMemo() { + return memo; + } + + public void setMemo(String memo) { + this.memo = memo; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountEnchashmentCancelRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountEnchashmentCancelRequest.java new file mode 100644 index 0000000..31b8ffd --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountEnchashmentCancelRequest.java @@ -0,0 +1,64 @@ +package com.jwsaas.api.request.store; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreAccountEnchashmentCancelRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String accountId;// 账户ID + @IgnoreSign + @NotNull + private String recordId;// 申请记录ID + @IgnoreSign + @NotNull + private String workerNo;// 操作员工号 + @IgnoreSign + @NotNull + private String sourceSign;// 来源标识 + @IgnoreSign + private String cancelReason;// 取消原因 + + public String getAccountId() { + return accountId; + } + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + public String getRecordId() { + return recordId; + } + + public void setRecordId(String recordId) { + this.recordId = recordId; + } + + public String getWorkerNo() { + return workerNo; + } + + public void setWorkerNo(String workerNo) { + this.workerNo = workerNo; + } + + public String getSourceSign() { + return sourceSign; + } + + public void setSourceSign(String sourceSign) { + this.sourceSign = sourceSign; + } + + public String getCancelReason() { + return cancelReason; + } + + public void setCancelReason(String cancelReason) { + this.cancelReason = cancelReason; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountEnchashmentInfoRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountEnchashmentInfoRequest.java new file mode 100644 index 0000000..94e2f53 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountEnchashmentInfoRequest.java @@ -0,0 +1,21 @@ +package com.jwsaas.api.request.store; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreAccountEnchashmentInfoRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String recordId;// 申请记录ID + + public String getRecordId() { + return recordId; + } + + public void setRecordId(String recordId) { + this.recordId = recordId; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountEnchashmentListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountEnchashmentListRequest.java new file mode 100644 index 0000000..8b6aefa --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountEnchashmentListRequest.java @@ -0,0 +1,62 @@ +package com.jwsaas.api.request.store; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreAccountEnchashmentListRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String accountId;// 账户ID + + @IgnoreSign + private String startTime = ""; + @IgnoreSign + private String endTime = ""; + @IgnoreSign + private int pageNumber = 1; + @IgnoreSign + private int pageSize = 10; + + public String getAccountId() { + return accountId; + } + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + public int getPageNumber() { + return pageNumber; + } + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountGetRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountGetRequest.java new file mode 100644 index 0000000..f3ace11 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountGetRequest.java @@ -0,0 +1,5 @@ +package com.jwsaas.api.request.store; + +public class StoreAccountGetRequest extends StoreBaseRequest { + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountRechargeParameterRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountRechargeParameterRequest.java new file mode 100644 index 0000000..7d3aad0 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountRechargeParameterRequest.java @@ -0,0 +1,5 @@ +package com.jwsaas.api.request.store; + +public class StoreAccountRechargeParameterRequest extends StoreBaseRequest { + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountRechargeRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountRechargeRequest.java new file mode 100644 index 0000000..87bfed5 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountRechargeRequest.java @@ -0,0 +1,127 @@ +package com.jwsaas.api.request.store; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreAccountRechargeRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String sourceSign;// 来源标识 + @IgnoreSign + @NotNull + private String accountId;// 账户ID + @IgnoreSign + @NotNull + private Integer busType;// 业务类型 + @IgnoreSign + @NotNull + private String busNo;// 业务单号 + @IgnoreSign + @NotNull + private String busTime;// 交易时间 + @IgnoreSign + @NotNull + private Double amount;// 充值金额 + @IgnoreSign + private String payType;// 支付方式,0-银行卡充值1-支付宝充值2-微信支付充值3-配送扣款4-配送退款 + @IgnoreSign + private String voucherNo;// 凭证号 + @IgnoreSign + @NotNull + private String workerNo;// 操作员工号 + @IgnoreSign + private String posNo;// 设备编号 + @IgnoreSign + private String memo;// 备注说明 + + public String getSourceSign() { + return sourceSign; + } + + public void setSourceSign(String sourceSign) { + this.sourceSign = sourceSign; + } + + public String getAccountId() { + return accountId; + } + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + public Integer getBusType() { + return busType; + } + + public void setBusType(Integer busType) { + this.busType = busType; + } + + public String getBusNo() { + return busNo; + } + + public void setBusNo(String busNo) { + this.busNo = busNo; + } + + public String getBusTime() { + return busTime; + } + + public void setBusTime(String busTime) { + this.busTime = busTime; + } + + public Double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + + public String getPayType() { + return payType; + } + + public void setPayType(String payType) { + this.payType = payType; + } + + public String getVoucherNo() { + return voucherNo; + } + + public void setVoucherNo(String voucherNo) { + this.voucherNo = voucherNo; + } + + public String getWorkerNo() { + return workerNo; + } + + public void setWorkerNo(String workerNo) { + this.workerNo = workerNo; + } + + public String getPosNo() { + return posNo; + } + + public void setPosNo(String posNo) { + this.posNo = posNo; + } + + public String getMemo() { + return memo; + } + + public void setMemo(String memo) { + this.memo = memo; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountRechargeWeixinPayOrderQueryRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountRechargeWeixinPayOrderQueryRequest.java new file mode 100644 index 0000000..3ec7e01 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountRechargeWeixinPayOrderQueryRequest.java @@ -0,0 +1,43 @@ +package com.jwsaas.api.request.store; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreAccountRechargeWeixinPayOrderQueryRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String appid;// 小程序appId + + @IgnoreSign + @NotNull + private String tradeNo;// 单号 + + @IgnoreSign + private String outTradeNo;// 扫呗返回唯一单号 + + public String getAppid() { + return appid; + } + + public void setAppid(String appid) { + this.appid = appid; + } + + public String getTradeNo() { + return tradeNo; + } + + public void setTradeNo(String tradeNo) { + this.tradeNo = tradeNo; + } + + public String getOutTradeNo() { + return outTradeNo; + } + + public void setOutTradeNo(String outTradeNo) { + this.outTradeNo = outTradeNo; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountRechargeWeixinPayOrderQueryRequest2.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountRechargeWeixinPayOrderQueryRequest2.java new file mode 100644 index 0000000..0b8757c --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountRechargeWeixinPayOrderQueryRequest2.java @@ -0,0 +1,45 @@ +package com.jwsaas.api.request.store; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreAccountRechargeWeixinPayOrderQueryRequest2 extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String appid;// 小程序appId + + @IgnoreSign + @NotNull + private String outTradeNo;// 支付单号 + + @IgnoreSign + @NotNull + private String tradeNo;// 业务订单号 + + public String getAppid() { + return appid; + } + + public void setAppid(String appid) { + this.appid = appid; + } + + public String getOutTradeNo() { + return outTradeNo; + } + + public void setOutTradeNo(String outTradeNo) { + this.outTradeNo = outTradeNo; + } + + public String getTradeNo() { + return tradeNo; + } + + public void setTradeNo(String tradeNo) { + this.tradeNo = tradeNo; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountRechargeWeixinPayUnifiedorderRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountRechargeWeixinPayUnifiedorderRequest.java new file mode 100644 index 0000000..4ef31b2 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAccountRechargeWeixinPayUnifiedorderRequest.java @@ -0,0 +1,127 @@ +package com.jwsaas.api.request.store; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreAccountRechargeWeixinPayUnifiedorderRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String sourceSign;// 来源标识 + + @IgnoreSign + @NotNull + private String appid;// 小程序appId + + @IgnoreSign + @NotNull + private String openId;// 小程序openId + + @IgnoreSign + @NotNull + private String tradeNo;// 单号 + + @IgnoreSign + @NotNull + private String accountId;// 账户ID + + @IgnoreSign + @NotNull + private Double amount;// 充值金额 + + @IgnoreSign + @NotNull + private String workerNo;// 操作员工号 + + @IgnoreSign + private String posNo;// 设备编号 + + @IgnoreSign + @NotNull + private String ip;// + + @IgnoreSign + private String memo;// 备注说明 + + public String getSourceSign() { + return sourceSign; + } + + public void setSourceSign(String sourceSign) { + this.sourceSign = sourceSign; + } + + public String getAppid() { + return appid; + } + + public void setAppid(String appid) { + this.appid = appid; + } + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public String getAccountId() { + return accountId; + } + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + public Double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + + public String getWorkerNo() { + return workerNo; + } + + public void setWorkerNo(String workerNo) { + this.workerNo = workerNo; + } + + public String getPosNo() { + return posNo; + } + + public void setPosNo(String posNo) { + this.posNo = posNo; + } + + public String getMemo() { + return memo; + } + + public void setMemo(String memo) { + this.memo = memo; + } + + public String getTradeNo() { + return tradeNo; + } + + public void setTradeNo(String tradeNo) { + this.tradeNo = tradeNo; + } + + public String getIp() { + return ip; + } + + public void setIp(String ip) { + this.ip = ip; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAdvertCaptionRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAdvertCaptionRequest.java new file mode 100644 index 0000000..c98b9a2 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAdvertCaptionRequest.java @@ -0,0 +1,5 @@ +package com.jwsaas.api.request.store; + +public class StoreAdvertCaptionRequest extends StoreBaseRequest { + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAdvertPictureRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAdvertPictureRequest.java new file mode 100644 index 0000000..aa0ac23 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreAdvertPictureRequest.java @@ -0,0 +1,4 @@ +package com.jwsaas.api.request.store; + +public class StoreAdvertPictureRequest extends StoreBaseRequest { +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreBaseRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreBaseRequest.java new file mode 100644 index 0000000..fcfd946 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreBaseRequest.java @@ -0,0 +1,20 @@ +package com.jwsaas.api.request.store; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; + +public class StoreBaseRequest extends AbstractRequest { + + @NotNull + public String storeId; + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreBusinessPlanDetailRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreBusinessPlanDetailRequest.java new file mode 100644 index 0000000..61790fc --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreBusinessPlanDetailRequest.java @@ -0,0 +1,4 @@ +package com.jwsaas.api.request.store; + +public class StoreBusinessPlanDetailRequest extends StoreBaseRequest { +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreBusinessPlanRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreBusinessPlanRequest.java new file mode 100644 index 0000000..903469e --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreBusinessPlanRequest.java @@ -0,0 +1,4 @@ +package com.jwsaas.api.request.store; + +public class StoreBusinessPlanRequest extends StoreBaseRequest { +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreCouponCheckOutRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreCouponCheckOutRequest.java new file mode 100644 index 0000000..08aa08b --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreCouponCheckOutRequest.java @@ -0,0 +1,20 @@ +package com.jwsaas.api.request.store; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreCouponCheckOutRequest extends StoreBaseRequest { + + @NotNull + @IgnoreSign + public String couponCode;//券码 + + public String getCouponCode() { + return couponCode; + } + + public void setCouponCode(String couponCode) { + this.couponCode = couponCode; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreCouponCheckRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreCouponCheckRequest.java new file mode 100644 index 0000000..0670945 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreCouponCheckRequest.java @@ -0,0 +1,81 @@ +package com.jwsaas.api.request.store; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreCouponCheckRequest extends StoreBaseRequest { + + @NotNull + @IgnoreSign + public String couponCode;//券码 + + @NotNull + @IgnoreSign + public String busNo;//业务单号 + + @NotNull + @IgnoreSign + public String storeName;//门店名称 + + @NotNull + @IgnoreSign + public String storeNo;//门店编号 + + @NotNull + @IgnoreSign + public String workerNo;//工号 + + @NotNull + @IgnoreSign + public String posNo;//POS编号 + + public String getCouponCode() { + return couponCode; + } + + public void setCouponCode(String couponCode) { + this.couponCode = couponCode; + } + + public String getBusNo() { + return busNo; + } + + public void setBusNo(String busNo) { + this.busNo = busNo; + } + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + + public String getStoreNo() { + return storeNo; + } + + public void setStoreNo(String storeNo) { + this.storeNo = storeNo; + } + + public String getWorkerNo() { + return workerNo; + } + + public void setWorkerNo(String workerNo) { + this.workerNo = workerNo; + } + + public String getPosNo() { + return posNo; + } + + public void setPosNo(String posNo) { + this.posNo = posNo; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreCouponListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreCouponListRequest.java new file mode 100644 index 0000000..8b91a7f --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreCouponListRequest.java @@ -0,0 +1,28 @@ +package com.jwsaas.api.request.store; + +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreCouponListRequest extends StoreBaseRequest { + + @IgnoreSign + private int pageNumber = 1; + @IgnoreSign + private int pageSize = 10; + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreDispatchSettlePlanGetRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreDispatchSettlePlanGetRequest.java new file mode 100644 index 0000000..0c0620e --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreDispatchSettlePlanGetRequest.java @@ -0,0 +1,5 @@ +package com.jwsaas.api.request.store; + +public class StoreDispatchSettlePlanGetRequest extends StoreBaseRequest { + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreFeeItemListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreFeeItemListRequest.java new file mode 100644 index 0000000..475757d --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreFeeItemListRequest.java @@ -0,0 +1,5 @@ +package com.jwsaas.api.request.store; + +public class StoreFeeItemListRequest extends StoreBaseRequest { + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreGoodsRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreGoodsRequest.java new file mode 100644 index 0000000..5ce7759 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreGoodsRequest.java @@ -0,0 +1,73 @@ +package com.jwsaas.api.request.store; + + +import com.jwsaas.open.annotation.IgnoreSign; + +/*** + * 门店商品request + * @author louxutao + * + */ +public class StoreGoodsRequest extends StoreBaseRequest { + + @IgnoreSign + private String categoryId; + @IgnoreSign + private String brandIds; + @IgnoreSign + private String property; + @IgnoreSign + private String keyword; + @IgnoreSign + private int pageNumber = 1; + @IgnoreSign + private int pageSize = 10; + + public String getCategoryId() { + return categoryId; + } + + public void setCategoryId(String categoryId) { + this.categoryId = categoryId; + } + + public String getBrandIds() { + return brandIds; + } + + public void setBrandIds(String brandIds) { + this.brandIds = brandIds; + } + + public String getProperty() { + return property; + } + + public void setProperty(String property) { + this.property = property; + } + + public String getKeyword() { + return keyword; + } + + public void setKeyword(String keyword) { + this.keyword = keyword; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreInfoRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreInfoRequest.java new file mode 100644 index 0000000..fda59af --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreInfoRequest.java @@ -0,0 +1,62 @@ +package com.jwsaas.api.request.store; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.open.annotation.IgnoreSign; + +/*** + * 门店信息请求 + * @author louxutao + * + */ +public class StoreInfoRequest extends StoreBaseRequest{ + + // 应用 + @IgnoreSign + @NotNull + private String appSign; + + // 操作员 + @IgnoreSign + @NotNull + private String workerNo; + + // 门店信息 + @IgnoreSign + @NotNull + private String storeInfoJson; + + + public String getAppSign() { + return appSign; + } + + public void setAppSign(String appSign) { + this.appSign = appSign; + } + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getWorkerNo() { + return workerNo; + } + + public void setWorkerNo(String workerNo) { + this.workerNo = workerNo; + } + + public String getStoreInfoJson() { + return storeInfoJson; + } + + public void setStoreInfoJson(String storeInfoJson) { + this.storeInfoJson = storeInfoJson; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreListRequest.java new file mode 100644 index 0000000..de386e9 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreListRequest.java @@ -0,0 +1,7 @@ +package com.jwsaas.api.request.store; + +import com.jwsaas.api.request.AbstractRequest; + +public class StoreListRequest extends AbstractRequest { + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreMessageRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreMessageRequest.java new file mode 100644 index 0000000..af5f317 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreMessageRequest.java @@ -0,0 +1,5 @@ +package com.jwsaas.api.request.store; + +public class StoreMessageRequest extends StoreBaseRequest{ + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StorePayModeRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StorePayModeRequest.java new file mode 100644 index 0000000..2268e50 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StorePayModeRequest.java @@ -0,0 +1,5 @@ +package com.jwsaas.api.request.store; + +public class StorePayModeRequest extends StoreBaseRequest{ + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StorePayTypeRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StorePayTypeRequest.java new file mode 100644 index 0000000..5e8f439 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StorePayTypeRequest.java @@ -0,0 +1,5 @@ +package com.jwsaas.api.request.store; + +public class StorePayTypeRequest extends StoreBaseRequest{ + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StorePosListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StorePosListRequest.java new file mode 100644 index 0000000..b827834 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StorePosListRequest.java @@ -0,0 +1,38 @@ +package com.jwsaas.api.request.store; + +import com.jwsaas.open.annotation.IgnoreSign; + +public class StorePosListRequest extends StoreBaseRequest { + + @IgnoreSign + private String terminalType; + @IgnoreSign + private int pageNumber = 1; + @IgnoreSign + private int pageSize = 10; + + public String getTerminalType() { + return terminalType; + } + + public void setTerminalType(String terminalType) { + this.terminalType = terminalType; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StorePrintImageRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StorePrintImageRequest.java new file mode 100644 index 0000000..2e54f72 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StorePrintImageRequest.java @@ -0,0 +1,5 @@ +package com.jwsaas.api.request.store; + +public class StorePrintImageRequest extends StoreBaseRequest { + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreProductCouponListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreProductCouponListRequest.java new file mode 100644 index 0000000..87d8f80 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreProductCouponListRequest.java @@ -0,0 +1,28 @@ +package com.jwsaas.api.request.store; + +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreProductCouponListRequest extends StoreBaseRequest { + + @IgnoreSign + private int pageNumber = 1; + @IgnoreSign + private int pageSize = 10; + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreRechargeParameterListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreRechargeParameterListRequest.java new file mode 100644 index 0000000..7db97fe --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreRechargeParameterListRequest.java @@ -0,0 +1,5 @@ +package com.jwsaas.api.request.store; + +public class StoreRechargeParameterListRequest extends StoreBaseRequest { + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreRequest.java new file mode 100644 index 0000000..5ebc2ae --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreRequest.java @@ -0,0 +1,63 @@ +package com.jwsaas.api.request.store; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.open.annotation.IgnoreSign; + +/*** + * 门店信息请求 + * @author louxutao + * + */ +public class StoreRequest extends StoreBaseRequest{ + + // 应用 + @IgnoreSign + @NotNull + private String appSign; + + // 操作员 + @IgnoreSign + @NotNull + private String workerNo; + + // 门店信息 + @IgnoreSign + @NotNull + private String wxStoreId; + + + public String getAppSign() { + return appSign; + } + + public void setAppSign(String appSign) { + this.appSign = appSign; + } + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getWorkerNo() { + return workerNo; + } + + public void setWorkerNo(String workerNo) { + this.workerNo = workerNo; + } + + public String getWxStoreId() { + return wxStoreId; + } + + public void setWxStoreId(String wxStoreId) { + this.wxStoreId = wxStoreId; + } + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreSalesDayProductSummaryRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreSalesDayProductSummaryRequest.java new file mode 100644 index 0000000..ced5dfa --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreSalesDayProductSummaryRequest.java @@ -0,0 +1,94 @@ +package com.jwsaas.api.request.store; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +import javax.validation.constraints.NotNull; + +/** + * 门店营业日菜品明细销售统计 + * Created by Administrator on 2019\6\20 0020. + */ +public class StoreSalesDayProductSummaryRequest extends AbstractRequest { + + @NotNull + private String storeId; + + @IgnoreSign + @NotNull + private String startDate; + + @IgnoreSign + @NotNull + private String endDate; + + + @IgnoreSign + private String seriesId;//大类ID; + + @IgnoreSign + private String productNo;//大类ID; + + + @IgnoreSign + private int pageNumber = 1; + @IgnoreSign + private int pageSize = 10; + + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getProductNo() { + return productNo; + } + + public void setProductNo(String productNo) { + this.productNo = productNo; + } + + public String getSeriesId() { + return seriesId; + } + + public void setSeriesId(String seriesId) { + this.seriesId = seriesId; + } + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreSalesDaySummaryRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreSalesDaySummaryRequest.java new file mode 100644 index 0000000..7915ab3 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreSalesDaySummaryRequest.java @@ -0,0 +1,45 @@ +package com.jwsaas.api.request.store; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreSalesDaySummaryRequest extends AbstractRequest { + + @NotNull + private String storeNo; + + @IgnoreSign + @NotNull + private String startDate; + + @IgnoreSign + @NotNull + private String endDate; + + public String getStoreNo() { + return storeNo; + } + + public void setStoreNo(String storeNo) { + this.storeNo = storeNo; + } + + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreSalesOrderListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreSalesOrderListRequest.java new file mode 100644 index 0000000..dbfd43b --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreSalesOrderListRequest.java @@ -0,0 +1,73 @@ +package com.jwsaas.api.request.store; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreSalesOrderListRequest extends AbstractRequest { + + @NotNull + private String storeNo; + @IgnoreSign + @NotNull + private String startDate; + @IgnoreSign + @NotNull + private String endDate; + @IgnoreSign + private String no;// 单据编号 + @IgnoreSign + private int pageNumber = 1; + @IgnoreSign + private int pageSize = 10; + + public String getStoreNo() { + return storeNo; + } + + public void setStoreNo(String storeNo) { + this.storeNo = storeNo; + } + + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + public String getNo() { + return no; + } + + public void setNo(String no) { + this.no = no; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreShelfRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreShelfRequest.java new file mode 100644 index 0000000..eafa93e --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoreShelfRequest.java @@ -0,0 +1,41 @@ +package com.jwsaas.api.request.store; + + +import javax.validation.constraints.NotNull; + +import com.jwsaas.open.annotation.IgnoreSign; + + +/*** + * 门店商品request + * @author louxutao + * + */ +public class StoreShelfRequest extends StoreBaseRequest { + + // 是否更新全部 默认false + @IgnoreSign + private int isAll = 0; + + @IgnoreSign + @NotNull + private String ids; + + public int getIsAll() { + return isAll; + } + + public void setIsAll(int isAll) { + this.isAll = isAll; + } + + public String getIds() { + return ids; + } + + public void setIds(String ids) { + this.ids = ids; + } + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoretableAreaRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoretableAreaRequest.java new file mode 100644 index 0000000..671481d --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoretableAreaRequest.java @@ -0,0 +1,5 @@ +package com.jwsaas.api.request.store; + +public class StoretableAreaRequest extends StoreBaseRequest{ + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoretableRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoretableRequest.java new file mode 100644 index 0000000..b305c03 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoretableRequest.java @@ -0,0 +1,5 @@ +package com.jwsaas.api.request.store; + +public class StoretableRequest extends StoreBaseRequest{ + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoretableTypeRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoretableTypeRequest.java new file mode 100644 index 0000000..5ac26c6 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/store/StoretableTypeRequest.java @@ -0,0 +1,5 @@ +package com.jwsaas.api.request.store; + +public class StoretableTypeRequest extends StoreBaseRequest{ + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/upload/BusinessHandoverUploadRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/upload/BusinessHandoverUploadRequest.java new file mode 100644 index 0000000..7baadd7 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/upload/BusinessHandoverUploadRequest.java @@ -0,0 +1,22 @@ +package com.jwsaas.api.request.upload; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class BusinessHandoverUploadRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String jsonString; + + public String getJsonString() { + return jsonString; + } + + public void setJsonString(String jsonString) { + this.jsonString = jsonString; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/upload/BusinessLogUploadRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/upload/BusinessLogUploadRequest.java new file mode 100644 index 0000000..28f3e67 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/upload/BusinessLogUploadRequest.java @@ -0,0 +1,21 @@ +package com.jwsaas.api.request.upload; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class BusinessLogUploadRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String jsonString; + + public String getJsonString() { + return jsonString; + } + + public void setJsonString(String jsonString) { + this.jsonString = jsonString; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/upload/BusinessOrderBurdenUploadRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/upload/BusinessOrderBurdenUploadRequest.java new file mode 100644 index 0000000..119e032 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/upload/BusinessOrderBurdenUploadRequest.java @@ -0,0 +1,21 @@ +package com.jwsaas.api.request.upload; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class BusinessOrderBurdenUploadRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String jsonString; + + public String getJsonString() { + return jsonString; + } + + public void setJsonString(String jsonString) { + this.jsonString = jsonString; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/upload/BusinessOrderUploadExtendRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/upload/BusinessOrderUploadExtendRequest.java new file mode 100644 index 0000000..fc8206d --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/upload/BusinessOrderUploadExtendRequest.java @@ -0,0 +1,22 @@ +package com.jwsaas.api.request.upload; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class BusinessOrderUploadExtendRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String jsonString; + + public String getJsonString() { + return jsonString; + } + + public void setJsonString(String jsonString) { + this.jsonString = jsonString; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/upload/BusinessOrderUploadRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/upload/BusinessOrderUploadRequest.java new file mode 100644 index 0000000..012ef50 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/upload/BusinessOrderUploadRequest.java @@ -0,0 +1,22 @@ +package com.jwsaas.api.request.upload; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class BusinessOrderUploadRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String jsonString; + + public String getJsonString() { + return jsonString; + } + + public void setJsonString(String jsonString) { + this.jsonString = jsonString; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/upload/BusinessRevenueUploadRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/upload/BusinessRevenueUploadRequest.java new file mode 100644 index 0000000..ee377c7 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/upload/BusinessRevenueUploadRequest.java @@ -0,0 +1,22 @@ +package com.jwsaas.api.request.upload; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class BusinessRevenueUploadRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String jsonString; + + public String getJsonString() { + return jsonString; + } + + public void setJsonString(String jsonString) { + this.jsonString = jsonString; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/visitor/VisitorAddRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/visitor/VisitorAddRequest.java new file mode 100644 index 0000000..e386941 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/visitor/VisitorAddRequest.java @@ -0,0 +1,22 @@ +package com.jwsaas.api.request.visitor; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class VisitorAddRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String jsonString; + + public String getJsonString() { + return jsonString; + } + + public void setJsonString(String jsonString) { + this.jsonString = jsonString; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/visitor/VisitorAddressListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/visitor/VisitorAddressListRequest.java new file mode 100644 index 0000000..0e91f69 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/visitor/VisitorAddressListRequest.java @@ -0,0 +1,42 @@ +package com.jwsaas.api.request.visitor; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class VisitorAddressListRequest extends StoreBaseRequest { + + @IgnoreSign + private String createDate;//当前时间 + + @IgnoreSign + private int pageNumber = 1; + + @IgnoreSign + private int pageSize = 10; + + + public String getCreateDate() { + return createDate; + } + + public void setCreateDate(String createDate) { + this.createDate = createDate; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/visitor/VisitorInfoRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/visitor/VisitorInfoRequest.java new file mode 100644 index 0000000..40b3b63 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/visitor/VisitorInfoRequest.java @@ -0,0 +1,20 @@ +package com.jwsaas.api.request.visitor; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; + +public class VisitorInfoRequest extends StoreBaseRequest { + + @NotNull + public String id; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/visitor/VisitorListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/visitor/VisitorListRequest.java new file mode 100644 index 0000000..d341981 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/visitor/VisitorListRequest.java @@ -0,0 +1,41 @@ +package com.jwsaas.api.request.visitor; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class VisitorListRequest extends StoreBaseRequest { + + @IgnoreSign + private String createDate;//当前时间 + + @IgnoreSign + private int pageNumber = 1; + @IgnoreSign + private int pageSize = 10; + + + public String getCreateDate() { + return createDate; + } + + public void setCreateDate(String createDate) { + this.createDate = createDate; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/visitor/VisitorTagListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/visitor/VisitorTagListRequest.java new file mode 100644 index 0000000..d4c0f8a --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/visitor/VisitorTagListRequest.java @@ -0,0 +1,42 @@ +package com.jwsaas.api.request.visitor; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class VisitorTagListRequest extends StoreBaseRequest { + + @IgnoreSign + private String createDate;//当前时间 + + @IgnoreSign + private int pageNumber = 1; + + @IgnoreSign + private int pageSize = 10; + + + public String getCreateDate() { + return createDate; + } + + public void setCreateDate(String createDate) { + this.createDate = createDate; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/visitor/VisitorUpdateRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/visitor/VisitorUpdateRequest.java new file mode 100644 index 0000000..2fc6d36 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/visitor/VisitorUpdateRequest.java @@ -0,0 +1,32 @@ +package com.jwsaas.api.request.visitor; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class VisitorUpdateRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String jsonString; + @NotNull + public String id; + + public String getJsonString() { + return jsonString; + } + + public void setJsonString(String jsonString) { + this.jsonString = jsonString; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/ProductTypeDetailRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/ProductTypeDetailRequest.java new file mode 100644 index 0000000..c1c15bd --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/ProductTypeDetailRequest.java @@ -0,0 +1,19 @@ +package com.jwsaas.api.request.vpos; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; + +public class ProductTypeDetailRequest extends StoreBaseRequest { + + @NotNull + public String typeId;// 大类ID + + public String getTypeId() { + return typeId; + } + + public void setTypeId(String typeId) { + this.typeId = typeId; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposAdPictureRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposAdPictureRequest.java new file mode 100644 index 0000000..8b66e13 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposAdPictureRequest.java @@ -0,0 +1,65 @@ +package com.jwsaas.api.request.vpos; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +/** + * Created by Administrator on 2019\5\21 0021. + */ +public class VposAdPictureRequest extends AbstractRequest { + + @IgnoreSign + private String storeId; + + @IgnoreSign + private String productTypeId; + + @IgnoreSign + private Integer type; + + @IgnoreSign + private Integer pageNumber; + + @IgnoreSign + private Integer pageSize; + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getProductTypeId() { + return productTypeId; + } + + public void setProductTypeId(String productTypeId) { + this.productTypeId = productTypeId; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public Integer getPageNumber() { + return pageNumber; + } + + public void setPageNumber(Integer pageNumber) { + this.pageNumber = pageNumber; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposBarCodePayRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposBarCodePayRequest.java new file mode 100644 index 0000000..d1619d1 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposBarCodePayRequest.java @@ -0,0 +1,34 @@ +package com.jwsaas.api.request.vpos; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class VposBarCodePayRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String tradeNo;// 支付单号 + + @IgnoreSign + @NotNull + private Double amount;// 金额 + + public Double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + + public String getTradeNo() { + return tradeNo; + } + + public void setTradeNo(String tradeNo) { + this.tradeNo = tradeNo; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposOrderCancelRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposOrderCancelRequest.java new file mode 100644 index 0000000..e897e0a --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposOrderCancelRequest.java @@ -0,0 +1,36 @@ +package com.jwsaas.api.request.vpos; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class VposOrderCancelRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String openId;// 小程序openId + + @IgnoreSign + @NotNull + private String tradeNo;// 单号 + + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public String getTradeNo() { + return tradeNo; + } + + public void setTradeNo(String tradeNo) { + this.tradeNo = tradeNo; + } + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposOrderCreateRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposOrderCreateRequest.java new file mode 100644 index 0000000..59855bb --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposOrderCreateRequest.java @@ -0,0 +1,21 @@ +package com.jwsaas.api.request.vpos; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class VposOrderCreateRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String jsonString; + + public String getJsonString() { + return jsonString; + } + + public void setJsonString(String jsonString) { + this.jsonString = jsonString; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposOrderDetailRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposOrderDetailRequest.java new file mode 100644 index 0000000..34ab0d5 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposOrderDetailRequest.java @@ -0,0 +1,33 @@ +package com.jwsaas.api.request.vpos; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class VposOrderDetailRequest extends StoreBaseRequest { + + @IgnoreSign + private String openId;// 小程序openId + + @IgnoreSign + @NotNull + private String tradeNo;// 单号 + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public String getTradeNo() { + return tradeNo; + } + + public void setTradeNo(String tradeNo) { + this.tradeNo = tradeNo; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposOrderEditRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposOrderEditRequest.java new file mode 100644 index 0000000..479a6b0 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposOrderEditRequest.java @@ -0,0 +1,82 @@ +package com.jwsaas.api.request.vpos; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class VposOrderEditRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String openId;// 小程序openId + + @IgnoreSign + @NotNull + private String tradeNo;// 单号 + + @IgnoreSign + @NotNull + private String tableNo;//桌号 + + @IgnoreSign + @NotNull + private String mobile;//手机号 + + @IgnoreSign + @NotNull + private Integer busMode;//营业模式 + + @IgnoreSign + private String ext2;//订单备注 + + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public String getTradeNo() { + return tradeNo; + } + + public void setTradeNo(String tradeNo) { + this.tradeNo = tradeNo; + } + + public String getTableNo() { + return tableNo; + } + + public void setTableNo(String tableNo) { + this.tableNo = tableNo; + } + + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public String getExt2() { + return ext2; + } + + public void setExt2(String ext2) { + this.ext2 = ext2; + } + + public Integer getBusMode() { + return busMode; + } + + public void setBusMode(Integer busMode) { + this.busMode = busMode; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposOrderListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposOrderListRequest.java new file mode 100644 index 0000000..dec87b2 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposOrderListRequest.java @@ -0,0 +1,99 @@ +package com.jwsaas.api.request.vpos; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class VposOrderListRequest extends StoreBaseRequest { + + @IgnoreSign + private String openId;// 小程序openId + + @IgnoreSign + @NotNull + private Integer status;// 状态 0全部1待支付2已完成 + + @IgnoreSign + private int pageNumber = 1;// 页码 + + @IgnoreSign + private int pageSize = 10;// 每页展示数量 + + @IgnoreSign + private String mobile;// 手机号 + + @IgnoreSign + private String seqNo;// 取餐号 + + @IgnoreSign + private String startTime;// 开始时间 + + @IgnoreSign + private String endTime;// 结束时间 + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public String getSeqNo() { + return seqNo; + } + + public void setSeqNo(String seqNo) { + this.seqNo = seqNo; + } + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposOrderPayRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposOrderPayRequest.java new file mode 100644 index 0000000..b2f0412 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposOrderPayRequest.java @@ -0,0 +1,33 @@ +package com.jwsaas.api.request.vpos; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class VposOrderPayRequest extends StoreBaseRequest { + + @NotNull + public String ticketId; + + @IgnoreSign + @NotNull + private String jsonString; + + + public String getTicketId() { + return ticketId; + } + + public void setTicketId(String ticketId) { + this.ticketId = ticketId; + } + + public String getJsonString() { + return jsonString; + } + + public void setJsonString(String jsonString) { + this.jsonString = jsonString; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposOrderRefundPartRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposOrderRefundPartRequest.java new file mode 100644 index 0000000..b3db2bc --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposOrderRefundPartRequest.java @@ -0,0 +1,58 @@ +package com.jwsaas.api.request.vpos; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class VposOrderRefundPartRequest extends StoreBaseRequest { + + @IgnoreSign + private String openId;// 小程序openId + + @IgnoreSign + @NotNull + private String tradeNo;// 单号 + + @IgnoreSign + @NotNull + private String payRefundNo;// 建行退款凭证号 + + @IgnoreSign + @NotNull + private String jsonString; + + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public String getTradeNo() { + return tradeNo; + } + + public void setTradeNo(String tradeNo) { + this.tradeNo = tradeNo; + } + + public String getPayRefundNo() { + return payRefundNo; + } + + public void setPayRefundNo(String payRefundNo) { + this.payRefundNo = payRefundNo; + } + + public String getJsonString() { + return jsonString; + } + + public void setJsonString(String jsonString) { + this.jsonString = jsonString; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposOrderRefundRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposOrderRefundRequest.java new file mode 100644 index 0000000..0a65606 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposOrderRefundRequest.java @@ -0,0 +1,46 @@ +package com.jwsaas.api.request.vpos; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class VposOrderRefundRequest extends StoreBaseRequest { + + @IgnoreSign + private String openId;// 小程序openId + + @IgnoreSign + @NotNull + private String tradeNo;// 单号 + + @IgnoreSign + @NotNull + private String payRefundNo;// 建行退款凭证号 + + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public String getTradeNo() { + return tradeNo; + } + + public void setTradeNo(String tradeNo) { + this.tradeNo = tradeNo; + } + + public String getPayRefundNo() { + return payRefundNo; + } + + public void setPayRefundNo(String payRefundNo) { + this.payRefundNo = payRefundNo; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposProductEvaluateLevelViewRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposProductEvaluateLevelViewRequest.java new file mode 100644 index 0000000..5c5b08a --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposProductEvaluateLevelViewRequest.java @@ -0,0 +1,24 @@ +package com.jwsaas.api.request.vpos; + +import com.jwsaas.api.request.AbstractRequest; + +import javax.validation.constraints.NotNull; + +/** + * Created by Administrator on 2019\6\12 0012. + */ +public class VposProductEvaluateLevelViewRequest extends AbstractRequest { + + @NotNull + private String seriesId; + + + public String getSeriesId() { + return seriesId; + } + + public void setSeriesId(String seriesId) { + this.seriesId = seriesId; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposProductEvaluateUploadRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposProductEvaluateUploadRequest.java new file mode 100644 index 0000000..b1bf635 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposProductEvaluateUploadRequest.java @@ -0,0 +1,131 @@ +package com.jwsaas.api.request.vpos; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +import javax.validation.constraints.NotNull; + +/** + * Created by Administrator on 2019\5\23 0023. + */ +public class VposProductEvaluateUploadRequest extends StoreBaseRequest { + + @NotNull + private String openId; + + private String memberId; + + private String mobile; + + @IgnoreSign + private String seriesId; + + @IgnoreSign + private String productId; + + @IgnoreSign + private String touxiang; + + @IgnoreSign + private String memberName; + + @IgnoreSign + @NotNull + private String memo; + + @NotNull + private Integer type; + + private Integer level; + + private String tickingTime; + + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public String getMemberId() { + return memberId; + } + + public void setMemberId(String memberId) { + this.memberId = memberId; + } + + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public String getSeriesId() { + return seriesId; + } + + public void setSeriesId(String seriesId) { + this.seriesId = seriesId; + } + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId; + } + + public String getTouxiang() { + return touxiang; + } + + public void setTouxiang(String touxiang) { + this.touxiang = touxiang; + } + + public String getMemberName() { + return memberName; + } + + public void setMemberName(String memberName) { + this.memberName = memberName; + } + + public String getMemo() { + return memo; + } + + public void setMemo(String memo) { + this.memo = memo; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public Integer getLevel() { + return level; + } + + public void setLevel(Integer level) { + this.level = level; + } + + public String getTickingTime() { + return tickingTime; + } + + public void setTickingTime(String tickingTime) { + this.tickingTime = tickingTime; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposProductEvaluateViewRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposProductEvaluateViewRequest.java new file mode 100644 index 0000000..7d1af19 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposProductEvaluateViewRequest.java @@ -0,0 +1,78 @@ +package com.jwsaas.api.request.vpos; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +import javax.validation.constraints.NotNull; + +/** + * Created by Administrator on 2019\5\23 0023. + */ +public class VposProductEvaluateViewRequest extends AbstractRequest{ + + @NotNull + private String openId; + + @IgnoreSign + private Integer type; + + @IgnoreSign + private String seriesId; + + @IgnoreSign + private String productId; + + @IgnoreSign + private Integer pageNumber; + + @IgnoreSign + private Integer pageSize; + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getSeriesId() { + return seriesId; + } + + public void setSeriesId(String seriesId) { + this.seriesId = seriesId; + } + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId; + } + + public Integer getPageNumber() { + return pageNumber; + } + + public void setPageNumber(Integer pageNumber) { + this.pageNumber = pageNumber; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposProductRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposProductRequest.java new file mode 100644 index 0000000..76b1144 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposProductRequest.java @@ -0,0 +1,52 @@ +package com.jwsaas.api.request.vpos; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class VposProductRequest extends StoreBaseRequest { + + @IgnoreSign + public String keyword;// 搜索关键次 + + @IgnoreSign + public String typeId;// 小类ID + + @IgnoreSign + private int pageNumber = 1;// 页码 + + @IgnoreSign + private int pageSize = 10;// 每页展示数量 + + public String getKeyword() { + return keyword; + } + + public void setKeyword(String keyword) { + this.keyword = keyword; + } + + public String getTypeId() { + return typeId; + } + + public void setTypeId(String typeId) { + this.typeId = typeId; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposProductStockRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposProductStockRequest.java new file mode 100644 index 0000000..665eefa --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposProductStockRequest.java @@ -0,0 +1,34 @@ +package com.jwsaas.api.request.vpos; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class VposProductStockRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String specIds; + + @IgnoreSign + @NotNull + private String counts; + + public String getSpecIds() { + return specIds; + } + + public void setSpecIds(String specIds) { + this.specIds = specIds; + } + + public String getCounts() { + return counts; + } + + public void setCounts(String counts) { + this.counts = counts; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposProductTypeLabelRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposProductTypeLabelRequest.java new file mode 100644 index 0000000..a34e904 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposProductTypeLabelRequest.java @@ -0,0 +1,30 @@ +package com.jwsaas.api.request.vpos; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class VposProductTypeLabelRequest extends StoreBaseRequest { + + @IgnoreSign + private int pageNumber = 1;// 页码 + + @IgnoreSign + private int pageSize = 10;// 每页展示数量 + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposProductTypeRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposProductTypeRequest.java new file mode 100644 index 0000000..2d050ee --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposProductTypeRequest.java @@ -0,0 +1,53 @@ +package com.jwsaas.api.request.vpos; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class VposProductTypeRequest extends StoreBaseRequest { + + @IgnoreSign + public String keyword;// 搜索关键次 + + @IgnoreSign + public String labelIds;// 标签ID逗号分隔 + + @IgnoreSign + private int pageNumber = 1;// 页码 + + @IgnoreSign + private int pageSize = 10;// 每页展示数量 + + + public String getKeyword() { + return keyword; + } + + public void setKeyword(String keyword) { + this.keyword = keyword; + } + + public String getLabelIds() { + return labelIds; + } + + public void setLabelIds(String labelIds) { + this.labelIds = labelIds; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposProductTypeTwoRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposProductTypeTwoRequest.java new file mode 100644 index 0000000..1d5cd3a --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposProductTypeTwoRequest.java @@ -0,0 +1,43 @@ +package com.jwsaas.api.request.vpos; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class VposProductTypeTwoRequest extends StoreBaseRequest { + + @NotNull + public String typeId;// 大类ID + + @IgnoreSign + private int pageNumber = 1;// 页码 + + @IgnoreSign + private int pageSize = 10;// 每页展示数量 + + public String getTypeId() { + return typeId; + } + + public void setTypeId(String typeId) { + this.typeId = typeId; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposWeixinPayQueryRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposWeixinPayQueryRequest.java new file mode 100644 index 0000000..b16bd29 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposWeixinPayQueryRequest.java @@ -0,0 +1,23 @@ +package com.jwsaas.api.request.vpos; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class VposWeixinPayQueryRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String tradeNo;// 支付单号 + + public String getTradeNo() { + return tradeNo; + } + + public void setTradeNo(String tradeNo) { + this.tradeNo = tradeNo; + } + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposWeixinPayRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposWeixinPayRequest.java new file mode 100644 index 0000000..11261aa --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposWeixinPayRequest.java @@ -0,0 +1,59 @@ +package com.jwsaas.api.request.vpos; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class VposWeixinPayRequest extends StoreBaseRequest { + + @IgnoreSign + @NotNull + private String appid;// 小程序appId + + @IgnoreSign + @NotNull + private String openId;// 小程序openId + + @IgnoreSign + @NotNull + private String tradeNo;// 支付单号 + + @IgnoreSign + @NotNull + private Double amount;// 金额 + + + public String getAppid() { + return appid; + } + + public void setAppid(String appid) { + this.appid = appid; + } + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public Double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + + public String getTradeNo() { + return tradeNo; + } + + public void setTradeNo(String tradeNo) { + this.tradeNo = tradeNo; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposWindowsCcbfzInfosRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposWindowsCcbfzInfosRequest.java new file mode 100644 index 0000000..e697b0f --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/vpos/VposWindowsCcbfzInfosRequest.java @@ -0,0 +1,23 @@ +package com.jwsaas.api.request.vpos; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + + +/** + * Created by Administrator on 2019\9\21 0021. + */ +public class VposWindowsCcbfzInfosRequest extends AbstractRequest { + + + @IgnoreSign + private String seriesIds;// 档口ids,多个用逗号连接; + + public String getSeriesIds() { + return seriesIds; + } + + public void setSeriesIds(String seriesIds) { + this.seriesIds = seriesIds; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/waimai/OrderStatisticsRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/waimai/OrderStatisticsRequest.java new file mode 100644 index 0000000..5be0da8 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/waimai/OrderStatisticsRequest.java @@ -0,0 +1,33 @@ +package com.jwsaas.api.request.waimai; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class OrderStatisticsRequest extends StoreBaseRequest { + + @NotNull + @IgnoreSign + private String startTime;// 开始时间 + @NotNull + @IgnoreSign + private String endTime;// 结束时间 + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/AgentStoreRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/AgentStoreRequest.java new file mode 100644 index 0000000..540cbda --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/AgentStoreRequest.java @@ -0,0 +1,20 @@ +package com.jwsaas.api.request.weixin; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; + +public class AgentStoreRequest extends AbstractRequest { + + @NotNull + public String agentId;// 代理商ID + + public String getAgentId() { + return agentId; + } + + public void setAgentId(String agentId) { + this.agentId = agentId; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/CategorySummaryListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/CategorySummaryListRequest.java new file mode 100644 index 0000000..7f1b476 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/CategorySummaryListRequest.java @@ -0,0 +1,43 @@ +package com.jwsaas.api.request.weixin; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class CategorySummaryListRequest extends AbstractRequest { + + @NotNull + private String startDate;// 开始时间 + + @NotNull + private String endDate;// 结束时间 + + @IgnoreSign + private String storeIds;// 门店ID列表 + + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + public String getStoreIds() { + return storeIds; + } + + public void setStoreIds(String storeIds) { + this.storeIds = storeIds; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/DaySummaryByDateRangeRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/DaySummaryByDateRangeRequest.java new file mode 100644 index 0000000..3074f1c --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/DaySummaryByDateRangeRequest.java @@ -0,0 +1,41 @@ +package com.jwsaas.api.request.weixin; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class DaySummaryByDateRangeRequest extends AbstractRequest { + + @NotNull + private String startTime;// 开始时间 + @NotNull + private String endTime;// 结束时间 + @IgnoreSign + private String storeIds;// 门店ID列表 + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + + public String getStoreIds() { + return storeIds; + } + + public void setStoreIds(String storeIds) { + this.storeIds = storeIds; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/DaySummaryListByDateRangeRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/DaySummaryListByDateRangeRequest.java new file mode 100644 index 0000000..486bdf1 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/DaySummaryListByDateRangeRequest.java @@ -0,0 +1,41 @@ +package com.jwsaas.api.request.weixin; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class DaySummaryListByDateRangeRequest extends AbstractRequest { + + @NotNull + private String startTime;// 开始时间 + @NotNull + private String endTime;// 结束时间 + @IgnoreSign + private String storeIds;// 门店ID列表 + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + + public String getStoreIds() { + return storeIds; + } + + public void setStoreIds(String storeIds) { + this.storeIds = storeIds; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/DaySummaryListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/DaySummaryListRequest.java new file mode 100644 index 0000000..b0e0410 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/DaySummaryListRequest.java @@ -0,0 +1,31 @@ +package com.jwsaas.api.request.weixin; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class DaySummaryListRequest extends AbstractRequest { + + @NotNull + private String saleDate;// 日期 + + @IgnoreSign + private String storeIds;// 门店ID列表 + + public String getSaleDate() { + return saleDate; + } + + public void setSaleDate(String saleDate) { + this.saleDate = saleDate; + } + + public String getStoreIds() { + return storeIds; + } + + public void setStoreIds(String storeIds) { + this.storeIds = storeIds; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/DaySummaryRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/DaySummaryRequest.java new file mode 100644 index 0000000..de60583 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/DaySummaryRequest.java @@ -0,0 +1,32 @@ +package com.jwsaas.api.request.weixin; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class DaySummaryRequest extends AbstractRequest { + + @NotNull + private String saleDate;// 日期 + + @IgnoreSign + private String storeIds;// 门店ID列表 + + public String getSaleDate() { + return saleDate; + } + + public void setSaleDate(String saleDate) { + this.saleDate = saleDate; + } + + public String getStoreIds() { + return storeIds; + } + + public void setStoreIds(String storeIds) { + this.storeIds = storeIds; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/GrossProfitAnalysisRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/GrossProfitAnalysisRequest.java new file mode 100644 index 0000000..ba17b45 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/GrossProfitAnalysisRequest.java @@ -0,0 +1,41 @@ +package com.jwsaas.api.request.weixin; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class GrossProfitAnalysisRequest extends AbstractRequest { + + @NotNull + private String startDate;// 开始时间 + @NotNull + private String endDate;// 结束时间 + @IgnoreSign + private String storeIds;// 门店ID列表 + + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + public String getStoreIds() { + return storeIds; + } + + public void setStoreIds(String storeIds) { + this.storeIds = storeIds; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/ManagerWorkerModuleRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/ManagerWorkerModuleRequest.java new file mode 100644 index 0000000..c692de2 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/ManagerWorkerModuleRequest.java @@ -0,0 +1,19 @@ +package com.jwsaas.api.request.weixin; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; + +public class ManagerWorkerModuleRequest extends StoreBaseRequest { + + @NotNull + public String workerId; + + public String getWorkerId() { + return workerId; + } + + public void setWorkerId(String workerId) { + this.workerId = workerId; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/OrderSummaryListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/OrderSummaryListRequest.java new file mode 100644 index 0000000..4d3d915 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/OrderSummaryListRequest.java @@ -0,0 +1,43 @@ +package com.jwsaas.api.request.weixin; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class OrderSummaryListRequest extends AbstractRequest { + + @NotNull + private String startDate;// 开始时间 + + @NotNull + private String endDate;// 结束时间 + + @IgnoreSign + private String storeIds;// 门店ID列表 + + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + public String getStoreIds() { + return storeIds; + } + + public void setStoreIds(String storeIds) { + this.storeIds = storeIds; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/PaySummaryListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/PaySummaryListRequest.java new file mode 100644 index 0000000..4c2d8f7 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/PaySummaryListRequest.java @@ -0,0 +1,43 @@ +package com.jwsaas.api.request.weixin; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class PaySummaryListRequest extends AbstractRequest { + + @NotNull + private String startDate;// 开始时间 + + @NotNull + private String endDate;// 结束时间 + + @IgnoreSign + private String storeIds;// 门店ID列表 + + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + public String getStoreIds() { + return storeIds; + } + + public void setStoreIds(String storeIds) { + this.storeIds = storeIds; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/ProductRankRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/ProductRankRequest.java new file mode 100644 index 0000000..08d0f28 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/ProductRankRequest.java @@ -0,0 +1,54 @@ +package com.jwsaas.api.request.weixin; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ProductRankRequest extends AbstractRequest { + + @NotNull + private String startDate;// 开始时间 + + @NotNull + private String endDate;// 结束时间 + + @IgnoreSign + private String storeIds;// 门店ID列表 + + @IgnoreSign + private Integer size;// 查询多少条数据 + + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + public String getStoreIds() { + return storeIds; + } + + public void setStoreIds(String storeIds) { + this.storeIds = storeIds; + } + + public Integer getSize() { + return size; + } + + public void setSize(Integer size) { + this.size = size; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/ProductSalesSummaryRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/ProductSalesSummaryRequest.java new file mode 100644 index 0000000..f6cf35e --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/ProductSalesSummaryRequest.java @@ -0,0 +1,41 @@ +package com.jwsaas.api.request.weixin; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class ProductSalesSummaryRequest extends AbstractRequest { + + @NotNull + private String startTime;// 开始时间 + @NotNull + private String endTime;// 结束时间 + @IgnoreSign + private String storeIds;// 门店ID列表 + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + + public String getStoreIds() { + return storeIds; + } + + public void setStoreIds(String storeIds) { + this.storeIds = storeIds; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/SalesDailyByDateRangeRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/SalesDailyByDateRangeRequest.java new file mode 100644 index 0000000..3ecda7f --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/SalesDailyByDateRangeRequest.java @@ -0,0 +1,41 @@ +package com.jwsaas.api.request.weixin; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class SalesDailyByDateRangeRequest extends AbstractRequest { + + @NotNull + private String startTime;// 开始时间 + @NotNull + private String endTime;// 结束时间 + @IgnoreSign + private String storeIds;// 门店ID列表 + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + + public String getStoreIds() { + return storeIds; + } + + public void setStoreIds(String storeIds) { + this.storeIds = storeIds; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/TimeSummaryListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/TimeSummaryListRequest.java new file mode 100644 index 0000000..a6dd078 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/TimeSummaryListRequest.java @@ -0,0 +1,43 @@ +package com.jwsaas.api.request.weixin; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class TimeSummaryListRequest extends AbstractRequest { + + @NotNull + private String startDate;// 开始时间 + + @NotNull + private String endDate;// 结束时间 + + @IgnoreSign + private String storeIds;// 门店ID列表 + + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + public String getStoreIds() { + return storeIds; + } + + public void setStoreIds(String storeIds) { + this.storeIds = storeIds; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/VposSalesSummaryRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/VposSalesSummaryRequest.java new file mode 100644 index 0000000..478c5f8 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/VposSalesSummaryRequest.java @@ -0,0 +1,53 @@ +package com.jwsaas.api.request.weixin; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +import javax.validation.constraints.NotNull; + +/** + * Created by Administrator on 2019\7\31 0031. + */ +public class VposSalesSummaryRequest extends AbstractRequest { + + @NotNull + private String startTime;// 开始时间 + @NotNull + private String endTime;// 结束时间 + @NotNull + private String vposUserId;//档口商户ID; + @IgnoreSign + private String seriesIds;// 档口ID列表 + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + + public String getVposUserId() { + return vposUserId; + } + + public void setVposUserId(String vposUserId) { + this.vposUserId = vposUserId; + } + + public String getSeriesIds() { + return seriesIds; + } + + public void setSeriesIds(String seriesIds) { + this.seriesIds = seriesIds; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/VposUserSeriesRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/VposUserSeriesRequest.java new file mode 100644 index 0000000..b2d0d8d --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/VposUserSeriesRequest.java @@ -0,0 +1,22 @@ +package com.jwsaas.api.request.weixin; + +import com.jwsaas.api.request.AbstractRequest; + +import javax.validation.constraints.NotNull; + +/** + * Created by Administrator on 2019\7\30 0030. + */ +public class VposUserSeriesRequest extends AbstractRequest { + + @NotNull + public String vposUserId; + + public String getVposUserId() { + return vposUserId; + } + + public void setVposUserId(String vposUserId) { + this.vposUserId = vposUserId; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/WaiMaiOrderStatisticsRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/WaiMaiOrderStatisticsRequest.java new file mode 100644 index 0000000..c891dfe --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/WaiMaiOrderStatisticsRequest.java @@ -0,0 +1,43 @@ +package com.jwsaas.api.request.weixin; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class WaiMaiOrderStatisticsRequest extends AbstractRequest { + + @NotNull + private String startDate;// 开始时间 + + @NotNull + private String endDate;// 结束时间 + + @IgnoreSign + private String storeIds;// 门店ID列表 + + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + public String getStoreIds() { + return storeIds; + } + + public void setStoreIds(String storeIds) { + this.storeIds = storeIds; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/WorkerStoreRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/WorkerStoreRequest.java new file mode 100644 index 0000000..191003a --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/weixin/WorkerStoreRequest.java @@ -0,0 +1,31 @@ +package com.jwsaas.api.request.weixin; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; + +public class WorkerStoreRequest extends AbstractRequest { + + @NotNull + public String storeNo;// 默认门店 + + @NotNull + public String workerId; + + public String getStoreNo() { + return storeNo; + } + + public void setStoreNo(String storeNo) { + this.storeNo = storeNo; + } + + public String getWorkerId() { + return workerId; + } + + public void setWorkerId(String workerId) { + this.workerId = workerId; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/worker/WorkerListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/worker/WorkerListRequest.java new file mode 100644 index 0000000..c6d6449 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/worker/WorkerListRequest.java @@ -0,0 +1,7 @@ +package com.jwsaas.api.request.worker; + +import com.jwsaas.api.request.store.StoreBaseRequest; + +public class WorkerListRequest extends StoreBaseRequest { + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/worker/WorkerLoginRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/worker/WorkerLoginRequest.java new file mode 100644 index 0000000..766106c --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/worker/WorkerLoginRequest.java @@ -0,0 +1,44 @@ +package com.jwsaas.api.request.worker; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class WorkerLoginRequest extends StoreBaseRequest { + + @NotNull + public String posNo;// POS编号 + + @NotNull + private String userName;// 用户名 + + @IgnoreSign + @NotNull + private String password;// 密码 + + public String getPosNo() { + return posNo; + } + + public void setPosNo(String posNo) { + this.posNo = posNo; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/worker/WorkerPosModuleRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/worker/WorkerPosModuleRequest.java new file mode 100644 index 0000000..77d8e8b --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/worker/WorkerPosModuleRequest.java @@ -0,0 +1,29 @@ +package com.jwsaas.api.request.worker; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class WorkerPosModuleRequest extends StoreBaseRequest { + + @IgnoreSign + private int pageNumber = 1; + + @IgnoreSign + private int pageSize = 10; + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/worker/WorkerPosRoleRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/worker/WorkerPosRoleRequest.java new file mode 100644 index 0000000..515aaa0 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/worker/WorkerPosRoleRequest.java @@ -0,0 +1,29 @@ +package com.jwsaas.api.request.worker; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class WorkerPosRoleRequest extends StoreBaseRequest { + + @IgnoreSign + private int pageNumber = 1; + + @IgnoreSign + private int pageSize = 10; + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/worker/WorkerUpdatePwdRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/worker/WorkerUpdatePwdRequest.java new file mode 100644 index 0000000..9a42117 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/worker/WorkerUpdatePwdRequest.java @@ -0,0 +1,62 @@ +package com.jwsaas.api.request.worker; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class WorkerUpdatePwdRequest extends StoreBaseRequest { + + @NotNull + private String posNo;// POS编号 + @NotNull + private String workerId;// 员工ID + @NotNull + private String workerNo;// 员工工号 + @IgnoreSign + private String passwd;// 密码 + @IgnoreSign + @NotNull + private String newPasswd;// 新密码 + + public String getPosNo() { + return posNo; + } + + public void setPosNo(String posNo) { + this.posNo = posNo; + } + + public String getWorkerId() { + return workerId; + } + + public void setWorkerId(String workerId) { + this.workerId = workerId; + } + + public String getWorkerNo() { + return workerNo; + } + + public void setWorkerNo(String workerNo) { + this.workerNo = workerNo; + } + + public String getPasswd() { + return passwd; + } + + public void setPasswd(String passwd) { + this.passwd = passwd; + } + + public String getNewPasswd() { + return newPasswd; + } + + public void setNewPasswd(String newPasswd) { + this.newPasswd = newPasswd; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/AdPictureListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/AdPictureListRequest.java new file mode 100644 index 0000000..3e5762c --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/AdPictureListRequest.java @@ -0,0 +1,7 @@ +package com.jwsaas.api.request.wxdc; + +import com.jwsaas.api.request.AbstractRequest; + +public class AdPictureListRequest extends AbstractRequest { + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/DistributionAddressRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/DistributionAddressRequest.java new file mode 100644 index 0000000..a92caf7 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/DistributionAddressRequest.java @@ -0,0 +1,115 @@ +package com.jwsaas.api.request.wxdc; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +import javax.validation.constraints.NotNull; + +/** + * @Author:CHL + * @Date:Create in 2018/7/27 + * @Description: 微信点餐配送地址信息 + */ +public class DistributionAddressRequest extends AbstractRequest { + @NotNull + private String wid; + @NotNull + private String openId; + @IgnoreSign + private String name; + @IgnoreSign + private String sex; + @IgnoreSign + private String mobile; + @IgnoreSign + private String receiveMobile; + @IgnoreSign + private String receiveAddress; + @IgnoreSign + private Integer isDefault; + @IgnoreSign + private String addressLabel; + @IgnoreSign + private String id; //配送地址ID + + + public String getWid() { + return wid; + } + + public void setWid(String wid) { + this.wid = wid; + } + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getSex() { + return sex; + } + + public void setSex(String sex) { + this.sex = sex; + } + + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public String getReceiveMobile() { + return receiveMobile; + } + + public void setReceiveMobile(String receiveMobile) { + this.receiveMobile = receiveMobile; + } + + public String getReceiveAddress() { + return receiveAddress; + } + + public void setReceiveAddress(String receiveAddress) { + this.receiveAddress = receiveAddress; + } + + public Integer getIsDefault() { + return isDefault; + } + + public void setIsDefault(Integer isDefault) { + this.isDefault = isDefault; + } + + public String getAddressLabel() { + return addressLabel; + } + + public void setAddressLabel(String addressLabel) { + this.addressLabel = addressLabel; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/DistributionRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/DistributionRequest.java new file mode 100644 index 0000000..d8b4d5a --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/DistributionRequest.java @@ -0,0 +1,12 @@ +package com.jwsaas.api.request.wxdc; + +import com.jwsaas.api.request.AbstractRequest; + +/** + * @Author:CHL + * @Date:Create in 2018/7/27 + * @Description: 微信点餐配送信息 + */ +public class DistributionRequest extends AbstractRequest { + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/GoodsCategoryListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/GoodsCategoryListRequest.java new file mode 100644 index 0000000..eba39a0 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/GoodsCategoryListRequest.java @@ -0,0 +1,8 @@ +package com.jwsaas.api.request.wxdc; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; + +public class GoodsCategoryListRequest extends AbstractRequest { +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/GoodsCategoryRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/GoodsCategoryRequest.java new file mode 100644 index 0000000..52b0aa8 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/GoodsCategoryRequest.java @@ -0,0 +1,19 @@ +package com.jwsaas.api.request.wxdc; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; + +public class GoodsCategoryRequest extends AbstractRequest { + + @NotNull + private String storeId; + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/GoodsInfoRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/GoodsInfoRequest.java new file mode 100644 index 0000000..9b609f9 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/GoodsInfoRequest.java @@ -0,0 +1,30 @@ +package com.jwsaas.api.request.wxdc; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; + +public class GoodsInfoRequest extends AbstractRequest { + + @NotNull + private String wxStoreId; + @NotNull + private String goodsId; + + public String getWxStoreId() { + return wxStoreId; + } + + public void setWxStoreId(String wxStoreId) { + this.wxStoreId = wxStoreId; + } + + public String getGoodsId() { + return goodsId; + } + + public void setGoodsId(String goodsId) { + this.goodsId = goodsId; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/GoodsInfoZCRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/GoodsInfoZCRequest.java new file mode 100644 index 0000000..b01b7bf --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/GoodsInfoZCRequest.java @@ -0,0 +1,30 @@ +package com.jwsaas.api.request.wxdc; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; + +public class GoodsInfoZCRequest extends AbstractRequest { + + @NotNull + private String storeId; + @NotNull + private String goodsId; + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getGoodsId() { + return goodsId; + } + + public void setGoodsId(String goodsId) { + this.goodsId = goodsId; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/GoodsListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/GoodsListRequest.java new file mode 100644 index 0000000..f752a2e --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/GoodsListRequest.java @@ -0,0 +1,71 @@ +package com.jwsaas.api.request.wxdc; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class GoodsListRequest extends AbstractRequest { + + @NotNull + private String storeId; + @IgnoreSign + private String categoryId; + @IgnoreSign + private String property; + @IgnoreSign + private String keyword; + @IgnoreSign + private int pageNumber = 1; + @IgnoreSign + private int pageSize = 10; + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getCategoryId() { + return categoryId; + } + + public void setCategoryId(String categoryId) { + this.categoryId = categoryId; + } + + public String getProperty() { + return property; + } + + public void setProperty(String property) { + this.property = property; + } + + public String getKeyword() { + return keyword; + } + + public void setKeyword(String keyword) { + this.keyword = keyword; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/GoodsMakeListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/GoodsMakeListRequest.java new file mode 100644 index 0000000..7f611dd --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/GoodsMakeListRequest.java @@ -0,0 +1,20 @@ +package com.jwsaas.api.request.wxdc; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; + +public class GoodsMakeListRequest extends AbstractRequest { + + @NotNull + private String productId; + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/GoodsSellInRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/GoodsSellInRequest.java new file mode 100644 index 0000000..12dcc39 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/GoodsSellInRequest.java @@ -0,0 +1,31 @@ +package com.jwsaas.api.request.wxdc; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class GoodsSellInRequest extends AbstractRequest { + + @NotNull + private String storeId; + + @IgnoreSign + private String productIds; + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getProductIds() { + return productIds; + } + + public void setProductIds(String productIds) { + this.productIds = productIds; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/GoodsSellOutRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/GoodsSellOutRequest.java new file mode 100644 index 0000000..583d497 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/GoodsSellOutRequest.java @@ -0,0 +1,33 @@ +package com.jwsaas.api.request.wxdc; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class GoodsSellOutRequest extends AbstractRequest { + + @NotNull + private String storeId; + + @IgnoreSign + private String productIds; + + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getProductIds() { + return productIds; + } + + public void setProductIds(String productIds) { + this.productIds = productIds; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/SalesOrderCancelRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/SalesOrderCancelRequest.java new file mode 100644 index 0000000..7b0a426 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/SalesOrderCancelRequest.java @@ -0,0 +1,52 @@ +package com.jwsaas.api.request.wxdc; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class SalesOrderCancelRequest extends AbstractRequest { + + @NotNull + private String storeId; + @NotNull + private String memberId; + @NotNull + private String ticketId; + @IgnoreSign + @NotNull + private String cancelReason; + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getMemberId() { + return memberId; + } + + public void setMemberId(String memberId) { + this.memberId = memberId; + } + + public String getTicketId() { + return ticketId; + } + + public void setTicketId(String ticketId) { + this.ticketId = ticketId; + } + + public String getCancelReason() { + return cancelReason; + } + + public void setCancelReason(String cancelReason) { + this.cancelReason = cancelReason; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/SalesOrderCreateRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/SalesOrderCreateRequest.java new file mode 100644 index 0000000..012cb87 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/SalesOrderCreateRequest.java @@ -0,0 +1,71 @@ +package com.jwsaas.api.request.wxdc; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class SalesOrderCreateRequest extends AbstractRequest { + + @NotNull + private String storeId; + private String tableNo; + @IgnoreSign + private String tableName; + @NotNull + private String wid;// 公众号主键 + @NotNull + private String memberId; + @IgnoreSign + @NotNull + private String orderInfoJson; + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getTableNo() { + return tableNo; + } + + public void setTableNo(String tableNo) { + this.tableNo = tableNo; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public String getWid() { + return wid; + } + + public void setWid(String wid) { + this.wid = wid; + } + + public String getMemberId() { + return memberId; + } + + public void setMemberId(String memberId) { + this.memberId = memberId; + } + + public String getOrderInfoJson() { + return orderInfoJson; + } + + public void setOrderInfoJson(String orderInfoJson) { + this.orderInfoJson = orderInfoJson; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/SalesOrderInfoRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/SalesOrderInfoRequest.java new file mode 100644 index 0000000..f37a70e --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/SalesOrderInfoRequest.java @@ -0,0 +1,57 @@ +package com.jwsaas.api.request.wxdc; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; + +public class SalesOrderInfoRequest extends AbstractRequest { + + private String wxStoreId; + private String erpStoreId; + private String memberId; + @NotNull + private String ticketId; + + private String ticketNo; + + public String getWxStoreId() { + return wxStoreId; + } + + public void setWxStoreId(String wxStoreId) { + this.wxStoreId = wxStoreId; + } + + public String getErpStoreId() { + return erpStoreId; + } + + public void setErpStoreId(String erpStoreId) { + this.erpStoreId = erpStoreId; + } + + public String getMemberId() { + return memberId; + } + + public void setMemberId(String memberId) { + this.memberId = memberId; + } + + public String getTicketId() { + return ticketId; + } + + public void setTicketId(String ticketId) { + this.ticketId = ticketId; + } + + public String getTicketNo() { + return ticketNo; + } + + public void setTicketNo(String ticketNo) { + this.ticketNo = ticketNo; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/SalesOrderListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/SalesOrderListRequest.java new file mode 100644 index 0000000..1306708 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/SalesOrderListRequest.java @@ -0,0 +1,86 @@ +package com.jwsaas.api.request.wxdc; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class SalesOrderListRequest extends AbstractRequest { + + @NotNull + private String memberId; + private String startDate; + private String endDate; + private String orderField;// 排序字段 + private String orderType;// ASC,DESC + private String status;// 状态 + @IgnoreSign + private int pageNumber = 1; + @IgnoreSign + private int pageSize = 10; + + public String getMemberId() { + return memberId; + } + + public void setMemberId(String memberId) { + this.memberId = memberId; + } + + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + public String getOrderField() { + return orderField; + } + + public void setOrderField(String orderField) { + this.orderField = orderField; + } + + public String getOrderType() { + return orderType; + } + + public void setOrderType(String orderType) { + this.orderType = orderType; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/StoreAgreeRefundRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/StoreAgreeRefundRequest.java new file mode 100644 index 0000000..8c772ed --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/StoreAgreeRefundRequest.java @@ -0,0 +1,30 @@ +package com.jwsaas.api.request.wxdc; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; + +public class StoreAgreeRefundRequest extends AbstractRequest { + + @NotNull + private String erpStoreId; + @NotNull + private String ticketId; + + public String getErpStoreId() { + return erpStoreId; + } + + public void setErpStoreId(String erpStoreId) { + this.erpStoreId = erpStoreId; + } + + public String getTicketId() { + return ticketId; + } + + public void setTicketId(String ticketId) { + this.ticketId = ticketId; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/StoreInfoRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/StoreInfoRequest.java new file mode 100644 index 0000000..ac47105 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/StoreInfoRequest.java @@ -0,0 +1,35 @@ +package com.jwsaas.api.request.wxdc; + +import com.jwsaas.api.request.AbstractRequest; + +public class StoreInfoRequest extends AbstractRequest { + + private String wxStoreId; + private String erpStoreId; + private String storeNo; + + public String getWxStoreId() { + return wxStoreId; + } + + public void setWxStoreId(String wxStoreId) { + this.wxStoreId = wxStoreId; + } + + public String getErpStoreId() { + return erpStoreId; + } + + public void setErpStoreId(String erpStoreId) { + this.erpStoreId = erpStoreId; + } + + public String getStoreNo() { + return storeNo; + } + + public void setStoreNo(String storeNo) { + this.storeNo = storeNo; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/StoreListByWidRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/StoreListByWidRequest.java new file mode 100644 index 0000000..3035e46 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/StoreListByWidRequest.java @@ -0,0 +1,32 @@ +package com.jwsaas.api.request.wxdc; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreListByWidRequest extends AbstractRequest { + + @NotNull + @IgnoreSign + private String wid; + + @IgnoreSign + private String keyword; + + public String getWid() { + return wid; + } + + public void setWid(String wid) { + this.wid = wid; + } + + public String getKeyword() { + return keyword; + } + + public void setKeyword(String keyword) { + this.keyword = keyword; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/StoreListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/StoreListRequest.java new file mode 100644 index 0000000..bc192dc --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/StoreListRequest.java @@ -0,0 +1,19 @@ +package com.jwsaas.api.request.wxdc; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreListRequest extends AbstractRequest { + + @IgnoreSign + private String keyword; + + public String getKeyword() { + return keyword; + } + + public void setKeyword(String keyword) { + this.keyword = keyword; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/StoreOpenStatusUpdateRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/StoreOpenStatusUpdateRequest.java new file mode 100644 index 0000000..6433965 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/StoreOpenStatusUpdateRequest.java @@ -0,0 +1,38 @@ +package com.jwsaas.api.request.wxdc; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; + +public class StoreOpenStatusUpdateRequest extends AbstractRequest { + + private String wxStoreId; + private String erpStoreId; + @NotNull + private Integer openStatus;// 1-营业;2-休息; + + public String getWxStoreId() { + return wxStoreId; + } + + public void setWxStoreId(String wxStoreId) { + this.wxStoreId = wxStoreId; + } + + public String getErpStoreId() { + return erpStoreId; + } + + public void setErpStoreId(String erpStoreId) { + this.erpStoreId = erpStoreId; + } + + public Integer getOpenStatus() { + return openStatus; + } + + public void setOpenStatus(Integer openStatus) { + this.openStatus = openStatus; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/StoreOrderCancelRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/StoreOrderCancelRequest.java new file mode 100644 index 0000000..e5f8038 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/StoreOrderCancelRequest.java @@ -0,0 +1,41 @@ +package com.jwsaas.api.request.wxdc; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreOrderCancelRequest extends AbstractRequest { + + @NotNull + private String erpStoreId; + @NotNull + private String ticketId; + @IgnoreSign + private String cancelReason;// 取消原因 + + public String getErpStoreId() { + return erpStoreId; + } + + public void setErpStoreId(String erpStoreId) { + this.erpStoreId = erpStoreId; + } + + public String getTicketId() { + return ticketId; + } + + public void setTicketId(String ticketId) { + this.ticketId = ticketId; + } + + public String getCancelReason() { + return cancelReason; + } + + public void setCancelReason(String cancelReason) { + this.cancelReason = cancelReason; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/StoreOrderConfirmRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/StoreOrderConfirmRequest.java new file mode 100644 index 0000000..15cf42d --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/StoreOrderConfirmRequest.java @@ -0,0 +1,30 @@ +package com.jwsaas.api.request.wxdc; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; + +public class StoreOrderConfirmRequest extends AbstractRequest { + + @NotNull + private String erpStoreId; + @NotNull + private String ticketId; + + public String getErpStoreId() { + return erpStoreId; + } + + public void setErpStoreId(String erpStoreId) { + this.erpStoreId = erpStoreId; + } + + public String getTicketId() { + return ticketId; + } + + public void setTicketId(String ticketId) { + this.ticketId = ticketId; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/StoreOrderDeliveryRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/StoreOrderDeliveryRequest.java new file mode 100644 index 0000000..9792f26 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/StoreOrderDeliveryRequest.java @@ -0,0 +1,30 @@ +package com.jwsaas.api.request.wxdc; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; + +public class StoreOrderDeliveryRequest extends AbstractRequest { + + @NotNull + private String erpStoreId; + @NotNull + private String ticketId; + + public String getErpStoreId() { + return erpStoreId; + } + + public void setErpStoreId(String erpStoreId) { + this.erpStoreId = erpStoreId; + } + + public String getTicketId() { + return ticketId; + } + + public void setTicketId(String ticketId) { + this.ticketId = ticketId; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/StoreOrderListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/StoreOrderListRequest.java new file mode 100644 index 0000000..8785498 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/StoreOrderListRequest.java @@ -0,0 +1,86 @@ +package com.jwsaas.api.request.wxdc; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreOrderListRequest extends AbstractRequest { + + @NotNull + private String erpStoreId; + private String startDate; + private String endDate; + private String status;// 状态 + private String orderField;// 排序字段 + private String orderType;// ASC,DESC + @IgnoreSign + private int pageNumber = 1; + @IgnoreSign + private int pageSize = 10; + + public String getErpStoreId() { + return erpStoreId; + } + + public void setErpStoreId(String erpStoreId) { + this.erpStoreId = erpStoreId; + } + + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getOrderField() { + return orderField; + } + + public void setOrderField(String orderField) { + this.orderField = orderField; + } + + public String getOrderType() { + return orderType; + } + + public void setOrderType(String orderType) { + this.orderType = orderType; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/StorePayParameterRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/StorePayParameterRequest.java new file mode 100644 index 0000000..4b2686a --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/StorePayParameterRequest.java @@ -0,0 +1,30 @@ +package com.jwsaas.api.request.wxdc; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; + +public class StorePayParameterRequest extends AbstractRequest { + + @NotNull + private String storeId; + @NotNull + private String payMode; + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getPayMode() { + return payMode; + } + + public void setPayMode(String payMode) { + this.payMode = payMode; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/StoreRefuseRefundRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/StoreRefuseRefundRequest.java new file mode 100644 index 0000000..0de52dd --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/StoreRefuseRefundRequest.java @@ -0,0 +1,41 @@ +package com.jwsaas.api.request.wxdc; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class StoreRefuseRefundRequest extends AbstractRequest { + + @NotNull + private String erpStoreId; + @NotNull + private String ticketId; + @IgnoreSign + private String refuseReason; + + public String getErpStoreId() { + return erpStoreId; + } + + public void setErpStoreId(String erpStoreId) { + this.erpStoreId = erpStoreId; + } + + public String getTicketId() { + return ticketId; + } + + public void setTicketId(String ticketId) { + this.ticketId = ticketId; + } + + public String getRefuseReason() { + return refuseReason; + } + + public void setRefuseReason(String refuseReason) { + this.refuseReason = refuseReason; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/UserApplyRefundRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/UserApplyRefundRequest.java new file mode 100644 index 0000000..e8e2768 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/UserApplyRefundRequest.java @@ -0,0 +1,51 @@ +package com.jwsaas.api.request.wxdc; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class UserApplyRefundRequest extends AbstractRequest { + + @NotNull + private String wxStoreId; + @NotNull + private String memberId; + @NotNull + private String ticketId; + @IgnoreSign + private String refundReason; + + public String getWxStoreId() { + return wxStoreId; + } + + public void setWxStoreId(String wxStoreId) { + this.wxStoreId = wxStoreId; + } + + public String getMemberId() { + return memberId; + } + + public void setMemberId(String memberId) { + this.memberId = memberId; + } + + public String getTicketId() { + return ticketId; + } + + public void setTicketId(String ticketId) { + this.ticketId = ticketId; + } + + public String getRefundReason() { + return refundReason; + } + + public void setRefundReason(String refundReason) { + this.refundReason = refundReason; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/WeixinPayUnifiedorderRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/WeixinPayUnifiedorderRequest.java new file mode 100644 index 0000000..c951b48 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/WeixinPayUnifiedorderRequest.java @@ -0,0 +1,151 @@ +package com.jwsaas.api.request.wxdc; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class WeixinPayUnifiedorderRequest extends AbstractRequest { + + @NotNull + private String storeId; + + @IgnoreSign + @NotNull + private String sourceSign;// 来源标识 + + @IgnoreSign + @NotNull + private String operatorType;// 操作类型 custom:消费 recharge:充值 + + @IgnoreSign + @NotNull + private String appid;// 小程序appId + + @IgnoreSign + @NotNull + private String openId;// 小程序openId + + @IgnoreSign + @NotNull + private String orderNo;// 订单单号 + + @IgnoreSign + @NotNull + private String tradeNo;// 支付单号 + + @IgnoreSign + @NotNull + private Double amount;// 金额 + + @IgnoreSign + @NotNull + private String workerNo;// 操作员工号 + + @IgnoreSign + private String posNo;// 设备编号 + + @IgnoreSign + @NotNull + private String ip;// + + @IgnoreSign + private String memo;// 备注说明 + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getSourceSign() { + return sourceSign; + } + + public void setSourceSign(String sourceSign) { + this.sourceSign = sourceSign; + } + + public String getOperatorType() { + return operatorType; + } + + public void setOperatorType(String operatorType) { + this.operatorType = operatorType; + } + + public String getAppid() { + return appid; + } + + public void setAppid(String appid) { + this.appid = appid; + } + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public String getOrderNo() { + return orderNo; + } + + public void setOrderNo(String orderNo) { + this.orderNo = orderNo; + } + + public Double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + + public String getWorkerNo() { + return workerNo; + } + + public void setWorkerNo(String workerNo) { + this.workerNo = workerNo; + } + + public String getPosNo() { + return posNo; + } + + public void setPosNo(String posNo) { + this.posNo = posNo; + } + + public String getMemo() { + return memo; + } + + public void setMemo(String memo) { + this.memo = memo; + } + + public String getTradeNo() { + return tradeNo; + } + + public void setTradeNo(String tradeNo) { + this.tradeNo = tradeNo; + } + + public String getIp() { + return ip; + } + + public void setIp(String ip) { + this.ip = ip; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/ZCGoodsCategoryListRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/ZCGoodsCategoryListRequest.java new file mode 100644 index 0000000..e6b5647 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxdc/ZCGoodsCategoryListRequest.java @@ -0,0 +1,18 @@ +package com.jwsaas.api.request.wxdc; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; + +public class ZCGoodsCategoryListRequest extends AbstractRequest { + @NotNull + private String storeId; + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxyh/UpdateWorkerPasswordRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxyh/UpdateWorkerPasswordRequest.java new file mode 100644 index 0000000..cd59363 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxyh/UpdateWorkerPasswordRequest.java @@ -0,0 +1,63 @@ +package com.jwsaas.api.request.wxyh; + +import com.jwsaas.api.request.AbstractRequest; + +import javax.validation.constraints.NotNull; + +public class UpdateWorkerPasswordRequest extends AbstractRequest { + + @NotNull + private String storeId; + + @NotNull + private String storeNo; + + @NotNull + private String userName; + + @NotNull + private String workerId; + + @NotNull + private String newPassword; + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getStoreNo() { + return storeNo; + } + + public void setStoreNo(String storeNo) { + this.storeNo = storeNo; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getWorkerId() { + return workerId; + } + + public void setWorkerId(String workerId) { + this.workerId = workerId; + } + + public String getNewPassword() { + return newPassword; + } + + public void setNewPassword(String newPassword) { + this.newPassword = newPassword; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxyh/WxyhCategoryRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxyh/WxyhCategoryRequest.java new file mode 100644 index 0000000..4528887 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxyh/WxyhCategoryRequest.java @@ -0,0 +1,31 @@ +package com.jwsaas.api.request.wxyh; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class WxyhCategoryRequest extends AbstractRequest { + @NotNull + private String storeId; + + @NotNull + @IgnoreSign + private Integer isMaterial = 0;// 0:所有 1:原料 辅料 2:非原料辅料 + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public Integer getIsMaterial() { + return isMaterial; + } + + public void setIsMaterial(Integer isMaterial) { + this.isMaterial = isMaterial; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxyh/WxyhGoodsRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxyh/WxyhGoodsRequest.java new file mode 100644 index 0000000..317d4e3 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/request/wxyh/WxyhGoodsRequest.java @@ -0,0 +1,81 @@ +package com.jwsaas.api.request.wxyh; + +import javax.validation.constraints.NotNull; + +import com.jwsaas.api.request.AbstractRequest; +import com.jwsaas.open.annotation.IgnoreSign; + +public class WxyhGoodsRequest extends AbstractRequest { + + @NotNull + private String storeId; + @IgnoreSign + private String categoryId; + @IgnoreSign + private String brandIds; + @IgnoreSign + private String property; + @IgnoreSign + private String keyword; + @IgnoreSign + private int pageNumber = 1; + @IgnoreSign + private int pageSize = 10; + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getCategoryId() { + return categoryId; + } + + public void setCategoryId(String categoryId) { + this.categoryId = categoryId; + } + + public String getBrandIds() { + return brandIds; + } + + public void setBrandIds(String brandIds) { + this.brandIds = brandIds; + } + + public String getProperty() { + return property; + } + + public void setProperty(String property) { + this.property = property; + } + + public String getKeyword() { + return keyword; + } + + public void setKeyword(String keyword) { + this.keyword = keyword; + } + + public int getPageNumber() { + return pageNumber; + } + + public void setPageNumber(int pageNumber) { + this.pageNumber = pageNumber; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/response/CommonResponse.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/response/CommonResponse.java new file mode 100644 index 0000000..c779a0b --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/response/CommonResponse.java @@ -0,0 +1,57 @@ +package com.jwsaas.api.response; + +public class CommonResponse { + + private int status; + + private String message; + + private String errCode; + + private String errMessage; + + public CommonResponse() { + super(); + } + + public CommonResponse(int status, String message, String errCode, String errMessage) { + super(); + this.status = status; + this.message = message; + this.errCode = errCode; + this.errMessage = errMessage; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public String getErrCode() { + return errCode; + } + + public void setErrCode(String errCode) { + this.errCode = errCode; + } + + public String getErrMessage() { + return errMessage; + } + + public void setErrMessage(String errMessage) { + this.errMessage = errMessage; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/response/common/SayHelloResponse.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/response/common/SayHelloResponse.java new file mode 100644 index 0000000..9c89633 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/response/common/SayHelloResponse.java @@ -0,0 +1,15 @@ +package com.jwsaas.api.response.common; + +public class SayHelloResponse { + + private long timestamp;// 时间戳 + + public long getTimestamp() { + return timestamp; + } + + public void setTimestamp(long timestamp) { + this.timestamp = timestamp; + } + +} \ No newline at end of file diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/response/common/SessionCreateResponse.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/response/common/SessionCreateResponse.java new file mode 100644 index 0000000..e731781 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/response/common/SessionCreateResponse.java @@ -0,0 +1,15 @@ +package com.jwsaas.api.response.common; + +public class SessionCreateResponse { + + private String sessionId; + + public String getSessionId() { + return sessionId; + } + + public void setSessionId(String sessionId) { + this.sessionId = sessionId; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/response/common/SessionGetResponse.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/response/common/SessionGetResponse.java new file mode 100644 index 0000000..f9eac76 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/response/common/SessionGetResponse.java @@ -0,0 +1,17 @@ +package com.jwsaas.api.response.common; + +import java.util.Map; + +public class SessionGetResponse { + + private Map data; + + public Map getData() { + return data; + } + + public void setData(Map data) { + this.data = data; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/response/mode/CommonDataResponse.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/response/mode/CommonDataResponse.java new file mode 100644 index 0000000..b6267dc --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/response/mode/CommonDataResponse.java @@ -0,0 +1,57 @@ +package com.jwsaas.api.response.mode; + +import java.util.Map; + +public class CommonDataResponse { + + private int status; + + private String message; + + private String errCode; + + private String errMessage; + + Map data; + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public String getErrCode() { + return errCode; + } + + public void setErrCode(String errCode) { + this.errCode = errCode; + } + + public String getErrMessage() { + return errMessage; + } + + public void setErrMessage(String errMessage) { + this.errMessage = errMessage; + } + + public Map getData() { + return data; + } + + public void setData(Map data) { + this.data = data; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/response/mode/CommonErrorCode.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/response/mode/CommonErrorCode.java new file mode 100644 index 0000000..d4bce2c --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/response/mode/CommonErrorCode.java @@ -0,0 +1,48 @@ +package com.jwsaas.api.response.mode; + +public enum CommonErrorCode { + + error0("0000", "企业编号不存在"), + error1("0001", "注册码不可用"), + error2("0002", "注册码对应门店信息不存在"), + error3("0003", "门店不存在"), + error4("0004", "门店营业方案未定义"), + error5("0005", "POS编号不存在"), + error6("0006", "员工工号不存在"), + error7("0007", "员工登录密码错误"), + error8("0008", "此员工无权登录当前门店"), + error9("0009", "门店未授权开通"), + error10("0010", "仓库不存在"), + error11("0011", "熟客不存在"), + error20("0020", "单据号已存在"), + error21("0021", "单据号不存在"), + error22("0022", "操作状态错误"), + error23("0023", "单据信息不存在"), + error24("0024", "单据信息不一致"), + error25("0025", "无权访问该单据"), + error26("0026", "门店余额账户不存在"), + error27("0027", "账户余额正在充值中"), + error998("0998", "参数错误,具体说明参照message"), + error999("0999", "其他未知异常"); + + private CommonErrorCode(String code, String message) { + this.code = code; + this.message = message; + } + + private String code; + private String message; + + public String getCode() { + return code; + } + public void setCode(String code) { + this.code = code; + } + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/response/mode/CommonListResponse.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/response/mode/CommonListResponse.java new file mode 100644 index 0000000..cf7f1b2 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/response/mode/CommonListResponse.java @@ -0,0 +1,57 @@ +package com.jwsaas.api.response.mode; + +import java.util.List; +import java.util.Map; + +public class CommonListResponse { + + private int status; + + private String message; + + private String errCode; + + private String errMessage; + + List> list; + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public String getErrCode() { + return errCode; + } + + public void setErrCode(String errCode) { + this.errCode = errCode; + } + + public String getErrMessage() { + return errMessage; + } + + public void setErrMessage(String errMessage) { + this.errMessage = errMessage; + } + + public List> getList() { + return list; + } + + public void setList(List> list) { + this.list = list; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/response/mode/CommonPagerResponse.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/response/mode/CommonPagerResponse.java new file mode 100644 index 0000000..bec4614 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/response/mode/CommonPagerResponse.java @@ -0,0 +1,97 @@ +package com.jwsaas.api.response.mode; + +import java.util.List; +import java.util.Map; + +public class CommonPagerResponse { + + private int status; + + private String message; + + private String errCode; + + private String errMessage; + + private Integer pageNumber;// 当前页码 + + private Integer pageSize;// 每页记录数 + + private Integer totalCount;// 总记录数 + + private Integer pageCount;// 总页数 + + List> list; + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public String getErrCode() { + return errCode; + } + + public void setErrCode(String errCode) { + this.errCode = errCode; + } + + public String getErrMessage() { + return errMessage; + } + + public void setErrMessage(String errMessage) { + this.errMessage = errMessage; + } + + public Integer getPageNumber() { + return pageNumber; + } + + public void setPageNumber(Integer pageNumber) { + this.pageNumber = pageNumber; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public Integer getTotalCount() { + return totalCount; + } + + public void setTotalCount(Integer totalCount) { + this.totalCount = totalCount; + } + + public Integer getPageCount() { + return pageCount; + } + + public void setPageCount(Integer pageCount) { + this.pageCount = pageCount; + } + + public List> getList() { + return list; + } + + public void setList(List> list) { + this.list = list; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/response/mode/DataPageResponse.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/response/mode/DataPageResponse.java new file mode 100644 index 0000000..8d06c27 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/response/mode/DataPageResponse.java @@ -0,0 +1,97 @@ +package com.jwsaas.api.response.mode; + +import java.util.List; +import java.util.Map; + +public class DataPageResponse { + + private int status; + + private String message; + + private String errCode; + + private String errMessage; + + private Integer pageNumber;// 当前页码 + + private Integer pageSize;// 每页记录数 + + private Integer totalCount;// 总记录数 + + private Integer pageCount;// 总页数 + + private Object list; + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public String getErrCode() { + return errCode; + } + + public void setErrCode(String errCode) { + this.errCode = errCode; + } + + public String getErrMessage() { + return errMessage; + } + + public void setErrMessage(String errMessage) { + this.errMessage = errMessage; + } + + public Integer getPageNumber() { + return pageNumber; + } + + public void setPageNumber(Integer pageNumber) { + this.pageNumber = pageNumber; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public Integer getTotalCount() { + return totalCount; + } + + public void setTotalCount(Integer totalCount) { + this.totalCount = totalCount; + } + + public Integer getPageCount() { + return pageCount; + } + + public void setPageCount(Integer pageCount) { + this.pageCount = pageCount; + } + + public Object getList() { + return list; + } + + public void setList(Object list) { + this.list = list; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/ErpBaseService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/ErpBaseService.java new file mode 100644 index 0000000..de5f68d --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/ErpBaseService.java @@ -0,0 +1,7 @@ +package com.jwsaas.api.service; + +import java.io.Serializable; + +public interface ErpBaseService extends Serializable { + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/WopService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/WopService.java new file mode 100644 index 0000000..3947d93 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/WopService.java @@ -0,0 +1,7 @@ +package com.jwsaas.api.service; + +import java.io.Serializable; + +public interface WopService extends Serializable { + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/cardsync/CardsyncService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/cardsync/CardsyncService.java new file mode 100644 index 0000000..5d20bfd --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/cardsync/CardsyncService.java @@ -0,0 +1,75 @@ +package com.jwsaas.api.service.cardsync; + +import com.jwsaas.api.request.cardsync.ProductListRequest; +import com.jwsaas.api.request.cardsync.ProductTypeRequest; +import com.jwsaas.api.request.cardsync.StoreMessageRequest; +import com.jwsaas.api.request.cardsync.StorePayTypeRequest; +import com.jwsaas.api.request.cardsync.StorePosRequest; +import com.jwsaas.api.request.cardsync.StoreTypeRequest; +import com.jwsaas.api.request.cardsync.StoreWorkerRequest; +import com.jwsaas.api.service.WopService; + +/** + * 基础服务相关接口 + */ +public interface CardsyncService extends WopService { + + /** + * 门店类型 + * + * @param request + * @return + */ + Object storeType(StoreTypeRequest request); + + /** + * 门店信息(分页) + * + * @param request + * @return + */ + Object storeMessage(StoreMessageRequest request); + + /** + * 门店员工(分页) + * + * @param request + * @return + */ + Object storeWorker(StoreWorkerRequest request); + + /** + * 员工可登陆门店(分页) + * + * @param request + * @return + */ + Object workerStore(StoreWorkerRequest request); + + /** + * 门店POS(分页) + * + * @param request + * @return + */ + Object storePos(StorePosRequest request); + + /** + * 支付方式 + * + * @param request + * @return + */ + Object storePayType(StorePayTypeRequest request); + + /** + * 商品类别 + */ + Object productType(ProductTypeRequest request); + + /** + * 商品列表 + */ + Object productList(ProductListRequest request); + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/ccb/CcbPayService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/ccb/CcbPayService.java new file mode 100644 index 0000000..ae72b6e --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/ccb/CcbPayService.java @@ -0,0 +1,19 @@ +package com.jwsaas.api.service.ccb; + +import com.jwsaas.api.request.ccb.CcbParamGetRequest; +import com.jwsaas.api.service.WopService; + +/** + * 建行互联网支付相关接口 + */ +public interface CcbPayService extends WopService { + + /** + * 获取请求加密字符串 + *

+ * 为防止数据被篡改和保障数据的完整性,商户向建行网关地址POST参数时,关键参数需要在商户系统中以加密串的方式通过ccbParam参数提交给建行支付网关。 + *

+ */ + Object getCcbParam(CcbParamGetRequest request); + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/ccb/impl/CcbPayServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/ccb/impl/CcbPayServiceImpl.java new file mode 100644 index 0000000..0d01307 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/ccb/impl/CcbPayServiceImpl.java @@ -0,0 +1,64 @@ +package com.jwsaas.api.service.ccb.impl; + +import java.util.HashMap; +import java.util.Map; + +import com.jwsaas.api.request.ccb.CcbParamGetRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.service.ccb.CcbPayService; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; + +/** + * 建行互联网支付相关接口 + */ +@ServiceMethodBean(version = "1.0") +public class CcbPayServiceImpl extends WopServiceImpl implements CcbPayService { + + private static final long serialVersionUID = -1788592846883476683L; + + /** + * 获取请求加密字符串 + *

+ * 为防止数据被篡改和保障数据的完整性,商户向建行网关地址POST参数时,关键参数需要在商户系统中以加密串的方式通过ccbParam参数提交给建行支付网关。 + *

+ */ + @ServiceMethod(method = "ccb.pay.ccbparam.get", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "获取请求加密字符串") + @Override + public Object getCcbParam(CcbParamGetRequest request) { + String info = "获取请求加密字符串"; + logger.debug(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + // AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + // String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + // String tenantId = tenantCode; + String paras = request.getParas();// 待加密参数串 + String key = request.getKey();// 加密Key + CommonDataResponse response = null; + try { + String ccbParam = ""; + // COM.CCB.EnDecryptAlgorithm.MCipherEncryptor ccbEncryptor = new + // COM.CCB.EnDecryptAlgorithm.MCipherEncryptor(key); + // 执行加密 + // ccbParam = ccbEncryptor.doEncrypt(paras); + response = new CommonDataResponse(); + response.setStatus(1); + response.setMessage("操作成功"); + Map data = new HashMap<>(); + data.put("ccbParam", ccbParam); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/common/CommonService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/common/CommonService.java new file mode 100644 index 0000000..bf63af1 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/common/CommonService.java @@ -0,0 +1,19 @@ +package com.jwsaas.api.service.common; + +import com.jwsaas.api.request.common.SayHelloRequest; +import com.jwsaas.api.service.WopService; + +/** + * 基础服务相关接口 + */ +public interface CommonService extends WopService { + + /** + * 获取服务端存活状态 + *

+ * 获取服务端存活状态,这样可以确保网络通信一定是正常的。 + *

+ */ + Object sayHello(SayHelloRequest request); + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/common/SessionService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/common/SessionService.java new file mode 100644 index 0000000..cbc273a --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/common/SessionService.java @@ -0,0 +1,37 @@ +package com.jwsaas.api.service.common; + +import com.jwsaas.api.request.common.SessionCreateRequest; +import com.jwsaas.api.request.common.SessionGetRequest; +import com.jwsaas.api.request.common.SessionRemoveRequest; +import com.jwsaas.api.service.WopService; + +/** + * Session相关接口,示例,实际使用过程中请根据业务需求创建/清除Session + */ +public interface SessionService extends WopService { + + /** + * 创建Session + *

+ * 创建Session,用于演示Session的使用。 + *

+ */ + Object create(SessionCreateRequest request); + + /** + * 获取Session + *

+ * 获取Session,用于演示Session的使用。 + *

+ */ + Object get(SessionGetRequest request); + + /** + * 清除Session + *

+ * 清除Session,用于演示Session的使用。 + *

+ */ + Object remove(SessionRemoveRequest request); + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/cost/CostTicketTemplateService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/cost/CostTicketTemplateService.java new file mode 100644 index 0000000..af2cb6a --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/cost/CostTicketTemplateService.java @@ -0,0 +1,17 @@ +package com.jwsaas.api.service.cost; + +import com.jwsaas.api.request.costlimit.CostTicketTemplateRequest; +import com.jwsaas.api.service.WopService; + + +/** + * Created by Administrator on 2019\4\12 0012. + */ +public interface CostTicketTemplateService extends WopService{ + + /*** + * 获取门店对应经营会计报表模板信息; + * @return + */ + Object costTicketTemplateInfos(CostTicketTemplateRequest request); +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/cost/impl/CostTicketTemplateServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/cost/impl/CostTicketTemplateServiceImpl.java new file mode 100644 index 0000000..1a0722e --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/cost/impl/CostTicketTemplateServiceImpl.java @@ -0,0 +1,253 @@ +package com.jwsaas.api.service.cost.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.jwsaas.api.request.costlimit.CostTicketTemplateRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.service.cost.CostTicketTemplateService; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.cache.data.ProductRatioCache; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.*; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.service.food.*; +import com.jwsaas.service.food.StoreStorageTicketService; +import com.jwsaas.utils.AppKeyUtil; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.*; + +/** + * Created by Administrator on 2019\4\12 0012. + */ + +@ServiceMethodBean(version = "1.0") +public class CostTicketTemplateServiceImpl extends WopServiceImpl implements CostTicketTemplateService { + + @Resource + private com.jwsaas.service.food.CostTicketTemplateService costTicketTemplateService; + @Resource + private CostTicketTemplateProductChangeService costTicketTemplateProductChangeService; + @Resource + private CostTicketTemplateProductMoreChangeService costTicketTemplateProductMoreChangeService; + @Resource + private CostTicketTemplateProductFixedChangeService costTicketTemplateProductFixedChangeService; + @Resource + private CostTicketTemplateProductOtherChangeService costTicketTemplateProductOtherChangeService; + @Resource + private CostTicketService costTicketService; + @Resource + private CostTicketProductChangeService costTicketProductChangeService; + @Resource + private CostTicketProductMoreChangeService costTicketProductMoreChangeService; + @Resource + private ReceiveGoodsTicketService receiveGoodsTicketService; + @Resource + private ReceiveGoodsDetailService receiveGoodsDetailService; + @Resource + private ProductRatioCache productRatioCache; + @Resource + private StoreStorageTicketService storeStorageTicketService; + @Resource + private StoreStorageTicketDetailService storeStorageTicketDetailService; + + + + /** + * 获取经营会计报表模板信息; + * @param request + * @return + */ + @ServiceMethod(method = "cost.ticketTemplate.info", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "微信点餐-创建微信订单") + @Override + public Object costTicketTemplateInfos(CostTicketTemplateRequest request) { + String info = "获取经营会计报表模板信息"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + String dateTime = request.getDateTime(); + CommonDataResponse response = null; + try{ + response = new CommonDataResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId",storeId)); + List templateIds = costTicketTemplateService.getListByCriteria(tenantId,"ticketId",criteria); + if(CollectionUtils.isEmpty(templateIds)){ + response.setStatus(0); + response.setMessage("此门店下不存在模板信息"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + //模版信息; + CostTicketTemplate template = costTicketTemplateService.get(tenantId,templateIds.get(0)); + Map map = JSON.parseObject(JSON.toJSONString(template),Map.class); + criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketId",template.getId())); + List productChangeList = costTicketTemplateProductChangeService.getList(tenantId,criteria); + List moreChangeList = costTicketTemplateProductMoreChangeService.getList(tenantId,criteria); + List fixedChangeList = costTicketTemplateProductFixedChangeService.getList(tenantId,criteria); + List otherChangeList = costTicketTemplateProductOtherChangeService.getList(tenantId,criteria); + + //昨日库存信息,查询已审核的经营会计报表; + if(StringUtils.isEmpty(dateTime)){ + dateTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); + } + String startTime = dateTime + " 00:00:00"; + String endTime = dateTime + " 23:59:59"; + Criteria criter = new Criteria(); + criter.add(Restrictions.eq("status",1)); + criter.add(Restrictions.eq("storeId",storeId)); + criter.add(Restrictions.order("createDate","desc")); + //昨天的日期; + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new SimpleDateFormat("yyyy-MM-dd").parse(dateTime)); + calendar.add(Calendar.DATE,-1); + Date time = calendar.getTime(); + String lastDay = new SimpleDateFormat("yyyy-MM-dd").format(time); + criter.add(Restrictions.eq("summaryDate",lastDay)); + List costTickets = costTicketService.getList(tenantId,criter); + Map lastStockProductMap = new HashMap<>(); + Map lastStockProductMoreMap = new HashMap<>(); + if(CollectionUtils.isNotEmpty(costTickets)){ + CostTicket ticket = costTickets.get(0); + criter = new Criteria(); + criter.add(Restrictions.eq("ticketId",ticket.getId())); + List changeList = costTicketProductChangeService.getList(tenantId,criter); + List moreChanges = costTicketProductMoreChangeService.getList(tenantId,criter); + + for(CostTicketProductChange change : changeList){ + lastStockProductMap.put(change.getSpecId(),change.getTodayStock() == null ? 0.0:change.getTodayStock()); + } + for(CostTicketProductMoreChange more : moreChanges){ + lastStockProductMoreMap.put(more.getSpecId(),more.getTodayStock() == null ? 0.0:more.getTodayStock()); + } + } + //今日入库信息; + //门店入库验收; + criter = new Criteria(); + criter.add(Restrictions.eq("storeId",storeId)); + criter.add(Restrictions.eq("status",1)); + criter.add(Restrictions.ge("checkDate",startTime)); + criter.add(Restrictions.le("checkDate",endTime)); + List receiveGoodsTickets = receiveGoodsTicketService.getList(tenantId,criter); + Map srmap = new HashMap<>(); + if(CollectionUtils.isNotEmpty(receiveGoodsTickets)){ + List ticketIds = new ArrayList<>(); + for(ReceiveGoodsTicket ticket : receiveGoodsTickets){ + ticketIds.add(ticket.getId()); + } + Map ratioMap = productRatioCache.getAllMap(tenantId); + criter = new Criteria(); + criter.add(Restrictions.in("ticketId",ticketIds)); + List details = receiveGoodsDetailService.getList(tenantId,criter); + for(ReceiveGoodsDetail detail : details){ + if(!srmap.containsKey(detail.getSpecId())){ + ProductRatio ratio = ratioMap.get(detail.getProductId()); + if(ratio != null){ + Double dpScale = ratio.getDpScale(); + Double stock = detail.getReceiveAmount() == null ? 0.0 : detail.getReceiveAmount(); + if(stock != 0.0){ + stock = stock*dpScale; + } + srmap.put(detail.getSpecId(),stock); + }else{ + srmap.put(detail.getSpecId(),detail.getReceiveAmount() == null ? 0.0 : detail.getReceiveAmount()); + } + }else{ + Double stock = srmap.get(detail.getSpecId()); + Double amount = detail.getReceiveAmount() == null ? 0.0:detail.getReceiveAmount(); + srmap.put(detail.getSpecId(),stock+amount); + } + } + } + //门店采购入库; + criter = new Criteria(); + criter.add(Restrictions.eq("storeId",storeId)); + criter.add(Restrictions.eq("status",2)); + criter.add(Restrictions.ge("checkDate",startTime)); + criter.add(Restrictions.le("checkDate",endTime)); + List storeStorageTickets = storeStorageTicketService.getList(tenantId,criter); + if(CollectionUtils.isNotEmpty(storeStorageTickets)){ + List ticketIds = new ArrayList<>(); + for(StoreStorageTicket ticket : storeStorageTickets){ + ticketIds.add(ticket.getId()); + } + + criter = new Criteria(); + criter.add(Restrictions.in("ticketId",ticketIds)); + List details = storeStorageTicketDetailService.getList(tenantId,criter); + for(StoreStorageTicketDetail detail : details){ + if(!srmap.containsKey(detail.getSpecId())){ + Double stock = detail.getAmount() == null ? 0.0 : detail.getAmount(); + srmap.put(detail.getSpecId(),stock); + }else{ + Double stock = srmap.get(detail.getSpecId()); + Double amount = detail.getAmount() == null ? 0.0:detail.getAmount(); + srmap.put(detail.getSpecId(),stock+amount); + } + } + } + + JSONArray productChangeArr = new JSONArray(); + JSONArray moreChangeArr = new JSONArray(); + JSONArray fixedChangeArr = new JSONArray(); + JSONArray otherChangeArr = new JSONArray(); + if(CollectionUtils.isNotEmpty(productChangeList)){ + for(CostTicketTemplateProductChange change : productChangeList){ + Double lastStock = lastStockProductMap.get(change.getSpecId()) == null ? 0.0 : lastStockProductMap.get(change.getSpecId()); + Double todayStockIn = srmap.get(change.getSpecId()) == null ? 0.0 : srmap.get(change.getSpecId()); + change.setLastStock(new BigDecimal(lastStock).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); + change.setTodayStockIn(new BigDecimal(todayStockIn).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); + } + productChangeArr = JSON.parseArray(JSON.toJSONString(productChangeList)); + } + if(CollectionUtils.isNotEmpty(moreChangeList)){ + for(CostTicketTemplateProductMoreChange change : moreChangeList){ + Double lastStock = lastStockProductMap.get(change.getSpecId()) == null ? 0.0 : lastStockProductMap.get(change.getSpecId()); + Double todayStockIn = srmap.get(change.getSpecId()) == null ? 0.0 : srmap.get(change.getSpecId()); + change.setLastStock(new BigDecimal(lastStock).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); + change.setTodayStockIn(new BigDecimal(todayStockIn).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); + } + moreChangeArr = JSON.parseArray(JSON.toJSONString(moreChangeList)); + } + if(CollectionUtils.isNotEmpty(fixedChangeList)){ + fixedChangeArr = JSON.parseArray(JSON.toJSONString(fixedChangeList)); + } + if(CollectionUtils.isNotEmpty(otherChangeList)){ + otherChangeArr = JSON.parseArray(JSON.toJSONString(otherChangeList)); + } + map.put("productChangeList",productChangeArr); + map.put("moreChangeList",moreChangeArr); + map.put("fixedChangeList",fixedChangeArr); + map.put("otherChangeList",otherChangeArr); + response.setStatus(1); + response.setMessage("获取成功"); + response.setData(map); + + }catch (Exception e){ + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + + + return response; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/ErpBaseServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/ErpBaseServiceImpl.java new file mode 100644 index 0000000..dce8d0b --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/ErpBaseServiceImpl.java @@ -0,0 +1,68 @@ +package com.jwsaas.api.service.impl; + +import com.jwsaas.api.service.ErpBaseService; +import com.jwsaas.open.utils.WopUtils; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +/** + * @Author:CHL + * @Date:Create in 2018/3/23 + * @Description: + */ +public class ErpBaseServiceImpl extends WopServiceImpl implements ErpBaseService { + protected final String ERROR_TOKEN = "@@$-ERROR_TOKEN$-@@"; + protected String fileName="erp.properties"; + + /** + * 对paramValues进行签名 + * + * @param paramValues + * @param secret + * @return + */ + public String sign(Map paramValues, String secret) { + return sign(paramValues, null, secret); + } + + /** + * 对paramValues进行签名,其中ignoreParamNames这些参数不参与签名 + * + * @param paramValues + * @param ignoreParamNames + * @param secret + * @return + */ + public String sign(Map paramValues, List ignoreParamNames, String secret) { + StringBuilder sb = new StringBuilder(); + List paramNames = new ArrayList(paramValues.size()); + paramNames.addAll(paramValues.keySet()); + if (ignoreParamNames != null && ignoreParamNames.size() > 0) { + for (String ignoreParamName : ignoreParamNames) { + paramNames.remove(ignoreParamName); + } + } + Collections.sort(paramNames); + + sb.append(secret); + for (String paramName : paramNames) { + sb.append(paramName).append(paramValues.get(paramName)); + } + sb.append(secret); + + System.out.println(sb.toString()); + + String sign = WopUtils.sign(sb.toString()); + System.out.println(sign); + + return sign; + + } + + protected boolean isSuccessful(String content) { + return !(content.contains(ERROR_TOKEN)); + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/WopServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/WopServiceImpl.java new file mode 100644 index 0000000..6656513 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/WopServiceImpl.java @@ -0,0 +1,103 @@ +package com.jwsaas.api.service.impl; + +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; + +import com.jwsaas.api.service.WopService; +import com.jwsaas.open.utils.DES; +import com.jwsaas.open.utils.DESEx; + +import reactor.bus.EventBus; + +public class WopServiceImpl implements WopService { + + private static final long serialVersionUID = -99983283853789280L; + + protected Logger logger = LoggerFactory.getLogger(getClass()); + + private DecimalFormat df = new DecimalFormat("######0.0000"); + + @Autowired + protected EventBus eventBus; + + protected String getDecryptStr(String passwd) { + String pwd = null; + // 暴力模式适配javascript的ecb模式下的des加密解密 + try { + // CBC模式,进行SafeBase64解密,使用于C#、Delphi、Android + pwd = DES.decrypt(passwd); + } catch (Exception ex) { + // ECB模式,进行HEX编码解密,适用于JS、NODE + String strSuffix = DESEx.get3DESRandomSuffix(); + String cipherText = passwd.toUpperCase().substring(0, passwd.length() - 16) + strSuffix; + pwd = DESEx.tripleDESDecrypt(cipherText); + } + + return pwd == null ? passwd : pwd; + } + + /** + * 复制集合 + */ + public List copyTo(List source, Class destinationClass) throws InstantiationException, IllegalAccessException { + if (source.size() == 0) + return Collections.emptyList(); + List res = new ArrayList(source.size()); + for (Object o : source) { + E e = destinationClass.newInstance(); + BeanUtils.copyProperties(o, e); + res.add(e); + } + return res; + } + + public String doubleFormat(Object doubleValue) { + String strValue = "0"; + try { + strValue = df.format(doubleValue); + } catch (Exception e) { + strValue = "0"; + } + return strValue; + } + + public String formatYMDHMS(Date date) { + String sDateTime = null; + try { + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + sDateTime = df.format(date); + } catch (Exception e) { + } + return sDateTime; + } + + public String formatYMD(Date date) { + String sDateTime = null; + try { + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); + sDateTime = df.format(date); + } catch (Exception e) { + } + return sDateTime; + } + + public String formatHM(Date date) { + String sDateTime = null; + try { + SimpleDateFormat df = new SimpleDateFormat("HH:mm"); + sDateTime = df.format(date); + } catch (Exception e) { + } + return sDateTime; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/cardsync/CardsyncServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/cardsync/CardsyncServiceImpl.java new file mode 100644 index 0000000..c6149cb --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/cardsync/CardsyncServiceImpl.java @@ -0,0 +1,559 @@ +package com.jwsaas.api.service.impl.cardsync; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; + +import com.jwsaas.api.request.cardsync.ProductListRequest; +import com.jwsaas.api.request.cardsync.ProductTypeRequest; +import com.jwsaas.api.request.cardsync.StoreMessageRequest; +import com.jwsaas.api.request.cardsync.StorePayTypeRequest; +import com.jwsaas.api.request.cardsync.StorePosRequest; +import com.jwsaas.api.request.cardsync.StoreTypeRequest; +import com.jwsaas.api.request.cardsync.StoreWorkerRequest; +import com.jwsaas.api.response.mode.CommonListResponse; +import com.jwsaas.api.response.mode.CommonPagerResponse; +import com.jwsaas.api.service.cardsync.CardsyncService; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.Brand; +import com.jwsaas.entity.food.PayMode; +import com.jwsaas.entity.food.PosInfo; +import com.jwsaas.entity.food.ProductSpec; +import com.jwsaas.entity.food.ProductType; +import com.jwsaas.entity.food.ProductUnit; +import com.jwsaas.entity.food.Store; +import com.jwsaas.entity.food.StoreType; +import com.jwsaas.entity.food.StoreWorker; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.pager.Pager; +import com.jwsaas.utils.AppKeyUtil; + +@ServiceMethodBean(version = "1.0") +public class CardsyncServiceImpl extends WopServiceImpl implements CardsyncService { + + private static final long serialVersionUID = 7911080512514872578L; + + private static final String className = "CardsyncServiceImpl"; + + @Resource + private com.jwsaas.service.food.StoreTypeService storeTypeService; + + @Resource + private com.jwsaas.service.food.StoreService storeService; + + @Resource + private com.jwsaas.service.food.PosInfoService posInfoService; + + @Resource + private com.jwsaas.service.food.StoreWorkerService storeWorkerService; + + @Resource + private com.jwsaas.service.food.PayModeService payModeService; + + @Resource + private com.jwsaas.service.food.ProductTypeService productTypeService; + + @Resource + private com.jwsaas.service.food.ProductService productService; + + @Resource + private com.jwsaas.service.food.ProductSpecService productSpecService; + + @Resource + private com.jwsaas.service.food.ProductUnitService productUnitService; + + @Resource + private com.jwsaas.service.food.BrandService brandService; + + @ServiceMethod(method = "cardsync.store.type", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店类型") + @Override + public Object storeType(StoreTypeRequest request) { + String info = "门店类型"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + CommonListResponse response = null; + try { + response = new CommonListResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("deleteFlag", 0)); + criteria.add(Restrictions.order("no", "ASC")); + List source = storeTypeService.getList(tenantId, criteria); + List> list = new ArrayList<>(); + for (StoreType storeType : source) { + Map map = new HashMap<>(); + map.put("tenantId", storeType.getTenantId()); + map.put("id", storeType.getId()); + map.put("no", storeType.getNo()); + map.put("name", storeType.getName()); + map.put("sign", storeType.getSign()); + list.add(map); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "STORE_TYPE_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "cardsync.store.message", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店信息") + @Override + public Object storeMessage(StoreMessageRequest request) { + String info = "门店信息(分页)"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("deleteFlag", 0)); + criteria.add(Restrictions.order("no", "ASC")); + pager = storeService.getPager(tenantId, criteria, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (Store store : source) { + Map map = new HashMap<>(); + map.put("tenantId", store.getTenantId()); + map.put("id", store.getId()); + map.put("areaId", store.getAreaId()); + map.put("areaPath", store.getAreaPath()); + map.put("typeId", store.getTypeId()); + map.put("no", store.getNo()); + map.put("name", store.getName()); + map.put("manager", store.getManager()); + map.put("tel", store.getTel()); + map.put("mobile", store.getMobile()); + map.put("orderTel", store.getOrderTel()); + map.put("printName", store.getPrintName()); + map.put("address", store.getAddress()); + map.put("latitude", store.getLatitude()); + map.put("longitude", store.getLongitude()); + map.put("mail", store.getMail()); + map.put("enabled", store.getEnabled()); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "STORE_MESSAGE_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "cardsync.store.worker", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店员工") + @Override + public Object storeWorker(StoreWorkerRequest request) { + String info = "门店员工信息同步(分页)"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.order("no", "ASC")); + pager = storeWorkerService.getPager(tenantId, criteria, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (StoreWorker storeWorker : source) { + Map map = new HashMap<>(); + map.put("tenantId", storeWorker.getTenantId()); + map.put("id", storeWorker.getId()); + map.put("storeId", storeWorker.getStoreId()); + map.put("no", storeWorker.getNo()); + map.put("name", storeWorker.getName()); + map.put("sex", storeWorker.getSex()); + map.put("birthday", storeWorker.getBirthday()); + map.put("email", storeWorker.getEmail()); + map.put("mobile", storeWorker.getMobile()); + map.put("isAdmin", storeWorker.getIsAdmin()); + map.put("enabled", storeWorker.getEnabled()); + map.put("description", storeWorker.getDescription()); + map.put("deleteFlag", storeWorker.getDeleteFlag()); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "STORE_WORKER_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "cardsync.worker.store", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "员工可登陆门店") + @Override + public Object workerStore(StoreWorkerRequest request) { + String info = "员工门店信息同步(分页)"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + pager = storeWorkerService.getWorkerStorePager(tenantId, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (StoreWorker storeWorker : source) { + Map map = new HashMap<>(); + map.put("tenantId", storeWorker.getTenantId()); + map.put("workerId", storeWorker.getId()); + map.put("storeId", storeWorker.getStoreId()); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "WORKER_STORE_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "cardsync.store.pos", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店POS") + @Override + public Object storePos(StorePosRequest request) { + String info = "门店POS信息同步(分页)"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("deleteFlag", 0)); + criteria.add(Restrictions.order("posNo", "ASC")); + pager = posInfoService.getPager(tenantId, criteria, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (PosInfo posInfo : source) { + Map map = new HashMap<>(); + map.put("tenantId", posInfo.getTenantId()); + map.put("id", posInfo.getId()); + map.put("storeId", posInfo.getStoreId()); + map.put("storeNo", posInfo.getStoreNo()); + map.put("posNo", posInfo.getPosNo()); + map.put("name", posInfo.getName()); + map.put("MACAddress", posInfo.getMACAddress()); + map.put("serialNumber", posInfo.getSerialNumber()); + map.put("cpuNumber", posInfo.getCpuNumber()); + map.put("status", posInfo.getStatus()); + map.put("description", posInfo.getDescription()); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "STORE_POS_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "cardsync.store.paytype", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "收银方式") + @Override + public Object storePayType(StorePayTypeRequest request) { + String info = "收银方式"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + CommonListResponse response = null; + try { + response = new CommonListResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("deleteFlag", 0)); + criteria.add(Restrictions.eq("rechargeFlag", 1)); + criteria.add(Restrictions.order("no", "ASC")); + List source = payModeService.getList(tenantId, criteria); + List> list = new ArrayList<>(); + for (PayMode payMode : source) { + Map map = new HashMap<>(); + map.put("tenantId", payMode.getTenantId()); + map.put("id", payMode.getId()); + map.put("no", payMode.getNo()); + map.put("name", payMode.getName()); + map.put("shortcut", payMode.getShortcut()); + map.put("pointFlag", payMode.getPointFlag()); + map.put("frontFlag", payMode.getFrontFlag()); + map.put("discount", payMode.getDiscount()); + map.put("otherRateType",payMode.getOtherRateType()); + map.put("otherRateValue",payMode.getOtherRateValue()); + map.put("incomeFlag",payMode.getIncomeFlag()); + list.add(map); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "STORE_PAYTYPE_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "cardsync.product.type", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "商品类别") + @Override + public Object productType(ProductTypeRequest request) { + String info = "商品类别"; + logger.debug(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + CommonListResponse response = null; + try { + response = new CommonListResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.le("sign", 2));// 1-商品;2-通用;3-原料; + criteria.add(Restrictions.eq("deleteFlag", 0)); + criteria.add(Restrictions.order("no", "ASC")); + List source = productTypeService.getList(tenantId, criteria); + List> list = new ArrayList<>(); + for (ProductType type : source) { + Map map = new HashMap<>(); + map.put("tenantId", type.getTenantId()); + map.put("id", type.getId()); + map.put("no", type.getNo());// 编号 + map.put("name", type.getName());// 名称 + map.put("sign", type.getSign());// 标识符 + map.put("english", type.getEnglish());// 英文名称 + map.put("parentId", type.getParentId());// 父类别ID + map.put("path", type.getPath());// 类别路径 + list.add(map); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 商品列表 + */ + @ServiceMethod(method = "cardsync.product.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "商品列表") + @Override + public Object productList(ProductListRequest request) { + String info = "商品列表"; + logger.debug(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + String keyword = request.getKeyword();// 搜索关键字 + String typeId = request.getTypeId();// 商品类别ID + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + + Criteria criteria = new Criteria(); + if (StringUtils.isNotBlank(typeId)) { + ProductType productType = productTypeService.get(tenantId, typeId); + if (productType != null) { + criteria.add(Restrictions.like("p.typePath", productType.getPath() + "%")); + } + } + + // 简单查询 + if (StringUtils.isNotBlank(keyword)) { + criteria.add(Restrictions.or(Restrictions.like("p.no", "%" + keyword + "%"), Restrictions.like("p.name", "%" + keyword + "%"))); + } + + criteria.add(Restrictions.eq("p.deleteFlag", 0)); + criteria.add(Restrictions.eq("p.stopFlag", 0));// 停用(0-否;1-是;) + criteria.add(Restrictions.eq("ps.deleteFlag", 0)); + criteria.add(Restrictions.lt("p.type", 10)); + criteria.add(Restrictions.order("p.no", "asc")); + criteria.add(Restrictions.order("ps.no", "asc")); + pager = productSpecService.getPagerExtend(tenantId, criteria, pager); + + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + criteria = new Criteria(); + criteria.add(Restrictions.order("no", "asc")); + List productTypeList = productTypeService.getList(tenantId, criteria); + Map productTypeMap = new HashMap<>(); + if (CollectionUtils.isNotEmpty(productTypeList)) { + for (ProductType productType : productTypeList) { + productTypeMap.put(productType.getId(), productType); + } + } + + criteria = new Criteria(); + criteria.add(Restrictions.order("no", "asc")); + List productUnitList = productUnitService.getList(tenantId, criteria); + Map productUnitMap = new HashMap<>(); + if (CollectionUtils.isNotEmpty(productUnitList)) { + for (ProductUnit productUnit : productUnitList) { + productUnitMap.put(productUnit.getId(), productUnit); + } + } + + criteria = new Criteria(); + criteria.add(Restrictions.order("no", "asc")); + List brandList = brandService.getList(tenantId, criteria); + Map brandMap = new HashMap<>(); + if (CollectionUtils.isNotEmpty(brandList)) { + for (Brand brand : brandList) { + brandMap.put(brand.getId(), brand); + } + } + + List source = (List) pager.getList(); + for (ProductSpec productSpec : source) { + Map map = new HashMap<>(); + map.put("tenantId", productSpec.getTenantId()); + map.put("specId", productSpec.getId()); + map.put("specName", productSpec.getName()); + map.put("productId", productSpec.getProductId()); + map.put("productNo", productSpec.getProductNo());// 商品编号 + map.put("productName", productSpec.getProductName());// 商品名称 + map.put("productShortName", productSpec.getProductShortName());// 商品简称 + map.put("productDescription", productSpec.getProductDescription());// 商品说明 + map.put("type", productSpec.getType());// 商品类型 + + map.put("typeId", productSpec.getTypeId());// 类别Id + map.put("typeName", StringUtils.isNotBlank(productSpec.getTypeId()) + ? (productTypeMap.get(productSpec.getTypeId()) != null ? productTypeMap.get(productSpec.getTypeId()).getName() : null) : null);// 类别名称 + map.put("typePath", productSpec.getTypePath());// 类别路径 + + map.put("unitId", productSpec.getUnitId());// 单位Id + map.put("unitName", StringUtils.isNotBlank(productSpec.getUnitId()) + ? (productUnitMap.get(productSpec.getUnitId()) != null ? productUnitMap.get(productSpec.getUnitId()).getName() : null) : null);// 单位名称 + + map.put("brandId", productSpec.getBrandId());// 品牌Id + map.put("brandName", + StringUtils.isNotBlank(productSpec.getBrandId()) ? (brandMap.get(productSpec.getBrandId()) != null ? brandMap.get(productSpec.getBrandId()).getName() : null) : null);// 品牌名称 + + map.put("spell", productSpec.getSpell());// 拼音简码 + map.put("barCode", productSpec.getBarCode());// 商品条码 + map.put("suitFlag", productSpec.getSuitFlag());// 是否套餐(0-否;1-是;) + map.put("pictureUrl",(StringUtils.isNoneEmpty(productSpec.getGroupName()) && StringUtils.isNotEmpty(productSpec.getPicture()) ? "http://imgv1.jwsaas.com/"+productSpec.getGroupName()+"/"+productSpec.getPicture():null)); + + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/common/CommonServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/common/CommonServiceImpl.java new file mode 100644 index 0000000..4eb3c12 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/common/CommonServiceImpl.java @@ -0,0 +1,71 @@ +package com.jwsaas.api.service.impl.common; + +import java.util.Date; + +import javax.annotation.Resource; + +import com.jwsaas.api.request.common.SayHelloRequest; +import com.jwsaas.api.response.common.SayHelloResponse; +import com.jwsaas.api.service.common.CommonService; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.utils.AppKeyUtil; + +/** + * 基础服务相关接口 + */ +@ServiceMethodBean(version = "1.0") +public class CommonServiceImpl extends WopServiceImpl implements CommonService { + + private static final long serialVersionUID = -1057161277891776549L; + private static final String className = "CommonServiceImpl"; + + @Resource + private com.jwsaas.service.food.PosInfoService posInfoService; + + /** + * 获取服务端存活状态 + *

+ * 获取服务端存活状态,这样可以确保网络通信一定是正常的。 + *

+ */ + @ServiceMethod(method = "common.sayhello", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "获取服务端存活状态") + @Override + public Object sayHello(SayHelloRequest request) { + String info = "获取服务端存活状态"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + + SayHelloResponse response = null; + try { +// String sql = "select now() as sqlTime "; +// Map dataMap = posInfoService.selectOne(tenantId, sql); + // logger.error("dataMap.JSON:" + JSONUtil.toJSONString(dataMap)); + + response = new SayHelloResponse(); + response.setTimestamp(new Date().getTime()); + // response.setTimestamp(System.currentTimeMillis()); + } catch (Exception e) { + logger.error(className + ".sayHello(" + info + ")[" + tenantId + "] 发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_SAYHELLO_ERROR"); + } + + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/common/SessionServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/common/SessionServiceImpl.java new file mode 100644 index 0000000..0bf0397 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/common/SessionServiceImpl.java @@ -0,0 +1,145 @@ +package com.jwsaas.api.service.impl.common; + +import java.util.Map; + +import com.jwsaas.api.request.common.SessionCreateRequest; +import com.jwsaas.api.request.common.SessionGetRequest; +import com.jwsaas.api.request.common.SessionRemoveRequest; +import com.jwsaas.api.response.CommonResponse; +import com.jwsaas.api.response.common.SessionCreateResponse; +import com.jwsaas.api.response.common.SessionGetResponse; +import com.jwsaas.api.service.common.SessionService; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.open.session.Session; +import com.jwsaas.open.session.SimpleSession; +import com.jwsaas.open.utils.WopUtils; +import com.jwsaas.utils.AppKeyUtil; + +/** + * Session相关接口,示例,实际使用过程中请根据业务需求创建/清除Session + */ +@ServiceMethodBean(version = "1.0") +public class SessionServiceImpl extends WopServiceImpl implements SessionService { + + private static final long serialVersionUID = 1396641795321483433L; + private static final String className = "SessionServiceImpl"; + + /** + * 创建Session + *

+ * 创建Session,用于演示Session的使用。 + *

+ */ + @ServiceMethod(method = "session.create", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "创建Session") + @Override + public Object create(SessionCreateRequest request) { + String info = "创建Session"; + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + SessionCreateResponse response = null; + try { + // 创建一个会话 + SimpleSession session = new SimpleSession(); + session.setAttribute("appKey", appKey); + session.setAttribute("appId", appId); + session.setAttribute("tenantCode", tenantCode); + session.setAttribute("appCode", appCode); + + String sessionId = WopUtils.getUUID(); + request.getWopRequestContext().addSession(sessionId, session); + + response = new SessionCreateResponse(); + response.setSessionId(sessionId); + } catch (Exception e) { + logger.error(className + ".create(" + info + ") 发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "SESSION_CREATE_ERROR"); + } + + return response; + } + + /** + * 获取Session + *

+ * 获取Session,用于演示Session的使用。 + *

+ */ + @ServiceMethod(method = "session.get", httpAction = HttpAction.POST, needInSession = NeedInSessionType.YES, title = "获取Session") + @Override + public Object get(SessionGetRequest request) { + String info = "获取Session"; + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + // 会话ID + String sessionId = request.getWopRequestContext().getSessionId(); + // 请求所对应的会话 + Session session = request.getWopRequestContext().getSession(); + + SessionGetResponse response = null; + try { + Map data = session.getAllAttributes(); + + response = new SessionGetResponse(); + response.setData(data); + } catch (Exception e) { + logger.error(className + ".get(" + info + ") 发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "SESSION_GET_ERROR"); + } + + return response; + } + + /** + * 清除Session + *

+ * 清除Session,用于演示Session的使用。 + *

+ */ + @ServiceMethod(method = "session.remove", httpAction = HttpAction.POST, needInSession = NeedInSessionType.YES, title = "清除Session") + @Override + public Object remove(SessionRemoveRequest request) { + String info = "清除Session"; + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + // 会话ID + String sessionId = request.getWopRequestContext().getSessionId(); + // 请求所对应的会话 + Session session = request.getWopRequestContext().getSession(); + + CommonResponse response = null; + try { + request.getWopRequestContext().removeSession(); + + response = new CommonResponse(); + response.setStatus(1); + response.setMessage("操作成功"); + } catch (Exception e) { + logger.error(className + ".remove(" + info + ") 发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "SESSION_REMOVE_ERROR"); + } + + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/intelligence/IntelligenceGoodsServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/intelligence/IntelligenceGoodsServiceImpl.java new file mode 100644 index 0000000..eea0147 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/intelligence/IntelligenceGoodsServiceImpl.java @@ -0,0 +1,346 @@ +package com.jwsaas.api.service.impl.intelligence; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import javax.annotation.Resource; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; + +import com.jwsaas.api.request.storage.ProductStockRequest; +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonListResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.intelligence.IntelligenceGoodsService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.bean.StoresPrediction; +import com.jwsaas.cache.data.ProductRatioCache; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.CostTicket; +import com.jwsaas.entity.food.CostTicketProductChange; +import com.jwsaas.entity.food.CostTicketProductMoreChange; +import com.jwsaas.entity.food.ProductRatio; +import com.jwsaas.entity.food.TicketPrintSetting; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.service.food.CostTicketProductChangeService; +import com.jwsaas.service.food.CostTicketProductMoreChangeService; +import com.jwsaas.service.food.CostTicketService; +import com.jwsaas.service.food.DispatchTicketService; +import com.jwsaas.service.food.StoreBusinessTicketService; +import com.jwsaas.service.food.TicketPrintSettingService; +import com.jwsaas.utils.AppKeyUtil; +import com.jwsaas.utils.DateUtils; +@ServiceMethodBean(version = "1.0") +public class IntelligenceGoodsServiceImpl extends WopServiceImpl implements IntelligenceGoodsService{ + private static final long serialVersionUID = 611618152023790400L; + + @Resource + private StoreBusinessTicketService storeBusinessTicketService; + @Resource + private TicketPrintSettingService printSettingService; + @Resource + private DispatchTicketService dispatchTicketService; + @Resource + private CostTicketService costTicketService; + @Resource + private CostTicketProductChangeService costTicketProductChangeService; + @Resource + private CostTicketProductMoreChangeService costTicketProductMoreChangeService; + @Resource + private ProductRatioCache productRatioCache; + /** + * 获取门店库存商品 + */ + @ServiceMethod(method = "store.prediction.product.stock", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "获取门店库存商品") + @Override + public Object getProductStockByPids(ProductStockRequest request) { + String info = "获取门店库存商品"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantId = appKeyInfo.getTenantCode(); + List costTicketMap = new LinkedList<>(); + List dispatchTicketMap = new LinkedList<>(); + CommonDataResponse response=null; + try { + List productRatios = productRatioCache.getAll(tenantId); + String specIds = request.getSpecIds(); + String storeId = request.getStoreId(); + String[] ids = specIds.split(","); + //1,查询正在配送未入库的商品 + Criteria criteria= new Criteria(); + criteria.add(Restrictions.eq("t.storeId", storeId)); + criteria.add(Restrictions.eq("t.status", 4)); + criteria.add(Restrictions.in("d.specId",Arrays.asList(ids))); + criteria.add(Restrictions.group("d.specId")); + List> products = this.dispatchTicketService.getListWithProductIds(tenantId, criteria); + + products.forEach(t->{ + String productId = t.get("productId").toString(); + Double dispatchAmount =Double.valueOf(t.get("dispatchAmount").toString()) ; + Map map =new HashMap<>(); + map.put("productId", productId); + map.put("productNo", t.get("productNo").toString()); + map.put("productName", t.get("productName").toString()); + map.put("specId", t.get("specId").toString()); + map.put("specName", t.get("specName").toString()); + map.put("dispatchStock", dispatchAmount.toString()); + dispatchTicketMap.add(map); + }); + + //2,查询当前库存商品 + criteria= new Criteria(); + criteria.add(Restrictions.eq("tenantId", tenantId)); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.limit("0", "1")); + criteria.add(Restrictions.eq("status", 1)); + criteria.add(Restrictions.order("summaryDate", "desc")); + List list = costTicketService.getList(tenantId, criteria); + if(CollectionUtils.isNotEmpty(list)){ + CostTicket costTicket = list.get(0); + criteria= new Criteria(); + criteria.add(Restrictions.eq("tenantId", tenantId)); + criteria.add(Restrictions.eq("ticketId", costTicket.getId())); + criteria.add(Restrictions.in("specId",Arrays.asList(ids))); + List productChanges = this.costTicketProductChangeService.getList(tenantId, criteria); + List productMoreChanges = this.costTicketProductMoreChangeService.getList(tenantId, criteria); +// String jsonString = JSON.toJSONString(productMoreChanges, SerializerFeature.WriteDateUseDateFormat); +// List parseArray = JSON.parseArray(jsonString, CostTicketProductChange.class); +// productChanges.addAll(parseArray); + productChanges.forEach(t->{ + Double yeterdayStock = t.getYeterdayStock(); + String productId = t.getProductId(); + Optional productRatioOptional = productRatios.stream().filter(w->productId.equals(w.getProductId())).findFirst(); + if(productRatioOptional.isPresent()){ + ProductRatio productRatio = productRatioOptional.get(); + Double dpScale = productRatio.getDpScale(); + yeterdayStock=yeterdayStock/dpScale; + } + Map map =new HashMap<>(); + map.put("productId", t.getProductId()); + map.put("productNo", t.getProductNo()); + map.put("productName", t.getProductName()); + map.put("specId", t.getSpecId()); + map.put("specName", t.getSpecName()); + map.put("yeterdayStock",String.format("%.2f", yeterdayStock)); + map.put("summaryDate", t.getSummaryDate()); + costTicketMap.add(map); + }); + productMoreChanges.forEach(t->{ + Double yeterdayStock = t.getYeterdayStock(); + String productId = t.getProductId(); + Optional productRatioOptional = productRatios.stream().filter(w->productId.equals(w.getProductId())).findFirst(); + if(productRatioOptional.isPresent()){ + ProductRatio productRatio = productRatioOptional.get(); + Double dpScale = productRatio.getDpScale(); + yeterdayStock=yeterdayStock/dpScale; + } + Map map =new HashMap<>(); + map.put("productId", t.getProductId()); + map.put("productNo", t.getProductNo()); + map.put("productName", t.getProductName()); + map.put("specId", t.getSpecId()); + map.put("specName", t.getSpecName()); + map.put("yeterdayStock",String.format("%.2f", yeterdayStock)); + map.put("summaryDate", t.getSummaryDate()); + costTicketMap.add(map); + }); + } + response=new CommonDataResponse(); + Map dataMap=new HashMap<>(); + dataMap.put("costTickets", costTicketMap); + dataMap.put("dispatchTickets", dispatchTicketMap); + response.setData(dataMap); + response.setStatus(1); + response.setMessage("获取成功"); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "getProductStockByPids", request.getWopRequestContext().getLocale()); + } + return response; + } + + + /** + * 获取门店预估营业额 + */ + @ServiceMethod(method = "store.prediction.turnover", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "获取门店预估营业额") + @Override + public Object getPredictionTurnover(StoreBaseRequest request) { + String info = "获取门店预估营业额"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantId = appKeyInfo.getTenantCode(); + List> maps = new ArrayList<>(); + List datalist=new ArrayList<>(); + Map dataMap=new HashMap<>(); + CommonDataResponse response = null; + String storeId = request.getStoreId(); + String endDate = null; + Date cutDate=new Date(); + Date addDay = DateUtils.addDay(cutDate, -28); + endDate = DateUtils.format(addDay, "yyyy-MM-dd"); + int cutDayWeek = DateUtils.getDayOfWeek(cutDate); + + List> Mondays=new ArrayList<>(); + List> Tuesday=new ArrayList<>(); + List> Wednesday=new ArrayList<>(); + List> Thursday=new ArrayList<>(); + List> Friday=new ArrayList<>(); + List> Saturday=new ArrayList<>(); + List> Sunday=new ArrayList<>(); + try { + String sql = getSql(endDate,storeId,tenantId); + maps = storeBusinessTicketService.selectList(tenantId,sql); + if(maps!=null&&maps.size()>0){ + for(Map map:maps){ + String groupTime = map.get("groupTime").toString(); + int dayOfWeek = DateUtils.getDayOfWeek(groupTime); + if(dayOfWeek==1){ + Sunday.add(map); + }else if(dayOfWeek==2){ + Mondays.add(map); + }else if(dayOfWeek==3){ + Tuesday.add(map); + }else if(dayOfWeek==4){ + Wednesday.add(map); + }else if(dayOfWeek==5){ + Thursday.add(map); + }else if(dayOfWeek==6){ + Friday.add(map); + }else if(dayOfWeek==7){ + Saturday.add(map); + } + } + for(int i=0;i<7;i++){ + Date addDay2 = DateUtils.addDay(cutDate, i); + int dayOfWeek = DateUtils.getDayOfWeek(addDay2); + if(dayOfWeek!=cutDayWeek&&dayOfWeek==1){ + StoresPrediction data = getDataList(Sunday,addDay2); + if(data!=null){ + data.setWeekDay("日"); + datalist.add(data); + } + }else if(dayOfWeek!=cutDayWeek&&dayOfWeek==2){ + StoresPrediction data = getDataList(Mondays,addDay2); + if(data!=null){ + data.setWeekDay("一"); + datalist.add(data); + } + + }else if(dayOfWeek!=cutDayWeek&&dayOfWeek==3){ + StoresPrediction data = getDataList(Tuesday,addDay2); + if(data!=null){ + data.setWeekDay("二"); + datalist.add(data); + } + }else if(dayOfWeek!=cutDayWeek&&dayOfWeek==4){ + StoresPrediction data = getDataList(Wednesday,addDay2); + if(data!=null){ + data.setWeekDay("三"); + datalist.add(data); + } + }else if(dayOfWeek!=cutDayWeek&&dayOfWeek==5){ + StoresPrediction data = getDataList(Thursday,addDay2); + if(data!=null){ + data.setWeekDay("四"); + datalist.add(data); + } + }else if(dayOfWeek!=cutDayWeek&&dayOfWeek==6){ + StoresPrediction data = getDataList(Friday,addDay2); + if(data!=null){ + data.setWeekDay("五"); + datalist.add(data); + } + }else if(dayOfWeek!=cutDayWeek&&dayOfWeek==7){ + StoresPrediction data = getDataList(Saturday,addDay2); + if(data!=null){ + data.setWeekDay("六"); + datalist.add(data); + } + } + } + } + Collections.sort(datalist); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketSign", "intelligenceGoods"));// 单据标识 + List list = printSettingService.getList(tenantId, criteria); + dataMap.put("predictionTurnover", datalist); + list.forEach(t->{ + dataMap.put(t.getKey(), t.getValue()); + }); + response=new CommonDataResponse(); + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(dataMap); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + private StoresPrediction getDataList(List> Sunday,Date addDay2){ + StoresPrediction storesPrediction=new StoresPrediction(); + if(CollectionUtils.isNotEmpty(Sunday)){ + Double totalAmount = 0.0; + List> histrylist=new ArrayList<>(); + for(Map map:Sunday){ + Map hisData=new HashMap<>(); + BigDecimal amount = (BigDecimal) map.get("amount"); + totalAmount=totalAmount+amount.doubleValue(); + hisData.put("storeName", map.get("storeName")); + hisData.put("amount", map.get("amount")); + hisData.put("groupTime", map.get("groupTime")); + histrylist.add(hisData); + } + Double fu=totalAmount/Sunday.size(); + storesPrediction.setStoreId(Sunday.get(0).get("storeId").toString()); + storesPrediction.setId(Sunday.get(0).get("id").toString()); + storesPrediction.setStoreName(Sunday.get(0).get("storeName").toString()); + storesPrediction.setStoreNo(Sunday.get(0).get("storeNo").toString()); + storesPrediction.setPreDictionAmount(Double.valueOf(String.format("%.0f", fu))); + storesPrediction.setDateTime(addDay2); + storesPrediction.setHistrylist(histrylist); + return storesPrediction; + }else{ + return null; + } + + } + + + private String getSql(String endDate,String storeId,String tenantId)throws Exception { + String sql = "select id,storeId,storeNo,storeName,sum(receivable)as receivable,sum(discountTotal)as discountTotal," + + "sum(amount)as amount,count(no) as counts, saleDate, DATE_FORMAT(createDate,'%Y-%m-%d') as groupTime," + + "avg(amount) from cy_store_business_ticket where tenantId ='" + tenantId + "' and isInvalid = 0 " + + " and createDate>='"+endDate+"'"; + if(StringUtils.isNotBlank(storeId)){ + sql += " and storeId = '"+storeId+"' "; + } + + sql += " GROUP BY storeId,groupTime order by storeNo asc,saleDate desc "; + + return sql; + } + + + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/jwygj/StoreYgjProductServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/jwygj/StoreYgjProductServiceImpl.java new file mode 100644 index 0000000..d8203ef --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/jwygj/StoreYgjProductServiceImpl.java @@ -0,0 +1,1852 @@ +package com.jwsaas.api.service.impl.jwygj; + +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import com.alibaba.fastjson.JSONArray; +import com.jwsaas.api.request.jwygj.*; +import com.jwsaas.api.request.product.ProductTypeRequest; +import com.jwsaas.reactor.event.EventKeys; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; + +import com.alibaba.fastjson.JSON; +import com.jwsaas.api.request.wxyh.WxyhGoodsRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.response.mode.CommonPagerResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.jwygj.StoreYgjProductService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.Brand; +import com.jwsaas.entity.food.Product; +import com.jwsaas.entity.food.ProductKitPlan; +import com.jwsaas.entity.food.ProductRatio; +import com.jwsaas.entity.food.ProductSpec; +import com.jwsaas.entity.food.ProductSuit; +import com.jwsaas.entity.food.ProductSuitDetail; +import com.jwsaas.entity.food.ProductType; +import com.jwsaas.entity.food.ProductUnit; +import com.jwsaas.entity.food.Store; +import com.jwsaas.entity.food.StoreProduct; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.pager.Pager; +import com.jwsaas.utils.AppKeyUtil; + +import net.sourceforge.pinyin4j.PinyinHelper; +import reactor.bus.Event; + +@ServiceMethodBean(version = "1.0") +public class StoreYgjProductServiceImpl extends WopServiceImpl implements StoreYgjProductService { + + private static final long serialVersionUID = -5651655865350242478L; + + @Resource + private com.jwsaas.service.food.BrandService brandService; + + @Resource + private com.jwsaas.service.food.ProductUnitService productUnitService; + + @Resource + private com.jwsaas.service.food.ProductTypeService productTypeService; + + @Resource + private com.jwsaas.service.food.ProductService productService; + + @Resource + private com.jwsaas.service.food.ProductKitPlanService productKitPlanService; + + @Resource + private com.jwsaas.service.food.StoreService storeService; + + @Resource + private com.jwsaas.service.food.StoreProductService storeProductService; + + @Resource + private com.jwsaas.service.food.ProductRatioService productRatioService; + + @ServiceMethod(method = "ygj.add.product.check", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "新建商品校验") + @Override + public Object ygjAddProductCheck(YgjAddProductCheckRequest request) { + String info = "新建商品校验"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + String brandId = request.getBrandId(); + String typeId = request.getTypeId(); + String typePath = request.getTypePath(); + String name = request.getName(); + String unitId = request.getUnitId(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + if (brandId != null) { + Brand brand = brandService.get(tenantId, brandId); + if (brand == null) { + response.setStatus(0); + response.setMessage("校验失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage("品牌不存在"); + return response; + } + } + if (typeId != null) { + ProductType productType = productTypeService.get(tenantId, typeId); + if (productType == null) { + response.setStatus(0); + response.setMessage("校验失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage("商品类别不存在"); + return response; + } + } + + if (unitId != null) { + ProductUnit productUnit = productUnitService.get(tenantId, unitId); + if (productUnit == null) { + response.setStatus(0); + response.setMessage("校验失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage("商品单位不存在"); + return response; + } + } + if (name != null) { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantId", tenantId)); + criteria.add(Restrictions.eq("name", name)); + criteria.add(Restrictions.eq("selfFlag", 1)); + criteria.add(Restrictions.eq("storeId", storeId)); + List productUnit = productService.getList(tenantId, criteria); + if (productUnit != null && productUnit.size() > 0) { + response.setStatus(0); + response.setMessage("校验失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage("商品名称已存在"); + return response; + } + } + response.setStatus(1); + response.setMessage("校验通过"); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + + } + + @ServiceMethod(method = "ygj.add.product", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "新建商品") + @Override + public Object ygjAddProduct(YgjAddProductRequest request) { + String info = "新建商品"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + String brandId = request.getBrandId(); + String typeId = request.getTypeId(); + String typePath = request.getTypePath(); + String name = request.getName(); + String unitId = request.getUnitId(); + double price = request.getPrice(); + double memberPrice = request.getMemberPrice(); + int labelPrintFlag = request.getLabelPrintFlag(); + int weighFlag = request.getWeighFlag(); + int tapleFlag = request.getTapleFlag(); + String assistNo = request.getAssistNo(); + String barCode = request.getBarCode(); + String kitPlanId = request.getKitPlanId(); + String workerNo = request.getWorkerNo(); + Date date = new Date();// 创建时间 + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + + if (brandId != null) { + Brand brand = brandService.get(tenantId, brandId); + if (brand == null) { + response.setStatus(0); + response.setMessage("校验失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage("品牌不存在"); + return response; + } + } + if (typeId != null) { + ProductType productType = productTypeService.get(tenantId, typeId); + if (productType == null) { + response.setStatus(0); + response.setMessage("校验失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage("商品类别不存在"); + return response; + } + } + + if (unitId != null) { + ProductUnit productUnit = productUnitService.get(tenantId, unitId); + if (productUnit == null) { + response.setStatus(0); + response.setMessage("校验失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage("商品单位不存在"); + return response; + } + } + if (name != null) { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantId", tenantId)); + criteria.add(Restrictions.eq("name", name)); + criteria.add(Restrictions.eq("selfFlag", 1)); + criteria.add(Restrictions.eq("storeId", storeId)); + List productUnit = productService.getList(tenantId, criteria); + if (productUnit != null && productUnit.size() > 0) { + response.setStatus(0); + response.setMessage("校验失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage("商品名称已存在"); + return response; + } + } + // 第一步创建商品对象 + Product product = new Product(); + product.setTenantId(tenantId); + product.setBrandId(brandId); + product.setTypeId(typeId); + product.setTypePath(typePath); + String maxNo = productService.selectMaxNoSelf(tenantId, storeId); + String nextNo = getNextNo(maxNo); + product.setNo(nextNo); + product.setName(name); + product.setSpell(getPinYinHeadChar(name)); + product.setAssistNo(assistNo); + product.setBarCode(barCode); + product.setOtherNo(null); + product.setEnglish(null); + product.setShortName(name); + product.setSpec(null); + product.setUnitId(unitId); + product.setDescription("自建菜品"); + product.setCommissionType(0); + product.setCommissionValue(0.00); + product.setDiscountFlag(1); + product.setTapleFlag(tapleFlag); + product.setWeighFlag(weighFlag); + product.setCurrentFlag(1); + product.setLabelPrintFlag(labelPrintFlag); + product.setSuitFlag(0); + product.setMebDiscountFlag(0); + product.setGiveFlag(1); + product.setPromotionFlag(1); + product.setType(0); + product.setStockFlag(0); + product.setPointType(0); + product.setPointValue(0.00); + product.setPurchaseTax(0.00); + product.setSaleTax(0.00); + product.setLyRate(0.00); + product.setGroupName(null); + product.setPicture(null); + product.setStopFlag(0); + product.setDeleteFlag(0); + product.setNoType(1); + product.setZcFlag(1); + product.setErpCategoryCode(null); + product.setErpSyncFlag(null); + product.setSelfFlag(1); + product.setStoreId(storeId); + product.setCreateUser(workerNo); + product.setCreateDate(date); + // 第二步创建规格 + ProductSpec productSpec = new ProductSpec(); + productSpec.setTenantId(tenantId); + productSpec.setNo("0"); + productSpec.setName(null); + productSpec.setPrice(price); + productSpec.setMinPrice(0.00); + productSpec.setMemberPrice(memberPrice); + productSpec.setOtherPrice(0.00); + productSpec.setCostPrice(0.00); + productSpec.setPurchasePrice(0.00); + productSpec.setDispatchPrice(0.00); + productSpec.setMaterialRate(0.00); + productSpec.setIsdefault(1); + productSpec.setDeleteFlag(0); + productSpec.setErpCode(null); + productSpec.setErpSyncStatus(null); + productSpec.setCreateUser(workerNo); + productSpec.setCreateDate(date); + // 创建门店商品关联 + StoreProduct storeProduct = new StoreProduct(); + storeProduct.setTenantId(tenantId); + storeProduct.setStoreId(storeId); + storeProduct.setProductUnitId(unitId); + storeProduct.setTypeId(typeId); + storeProduct.setTypePath(typePath); + storeProduct.setPrice(price); + storeProduct.setMinPrice(0.00); + storeProduct.setMemberPrice(memberPrice); + storeProduct.setOtherPrice(0.00); + storeProduct.setCostPrice(0.00); + storeProduct.setPurchasePrice(0.00); + storeProduct.setDispatchPrice(0.00); + storeProduct.setCreateUser(workerNo); + storeProduct.setCreateDate(date); + // 设置出品 + if (kitPlanId != null && !"".equals(kitPlanId)) { + ProductKitPlan productKitPlan = new ProductKitPlan(); + productKitPlan.setTenantId(tenantId); + productKitPlan.setStoreId(storeId); + productKitPlan.setChudaFlag(1); + productKitPlan.setChuda(kitPlanId); + productKitPlan.setChupinFlag(0); + productKitPlan.setChupin(null); + productKitPlan.setLabelFlag(0); + productKitPlan.setLabelValue(null); + productKitPlan.setCreateUser(workerNo); + productKitPlan.setCreateDate(date); + productService.saveSelfProduct(tenantId, product, productSpec, storeProduct, productKitPlan, null, null); + } else { + productService.saveSelfProduct(tenantId, product, productSpec, storeProduct, null, null, null); + } + + response.setStatus(1); + response.setMessage("操作成功"); + + //更新服务数据版本信息; + Map eventData = new HashMap<>(); + eventData.put("tenantId", tenantId); + eventData.put("dataType", "CY_PRODUCTDATA"); + eventBus.notify(EventKeys.SERVERDATAVERSION_UPDATE, Event.wrap(eventData)); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "ygj.add.productSpec", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "新建商品") + @Override + public Object ygjAddProductSpecs(YgjAddProductRequest request) { + String info = "新建商品"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + String brandId = request.getBrandId(); + String typeId = request.getTypeId(); + String typePath = request.getTypePath(); + String name = request.getName(); + String unitId = request.getUnitId(); + double price = request.getPrice(); + double memberPrice = request.getMemberPrice(); + int labelPrintFlag = request.getLabelPrintFlag(); + int weighFlag = request.getWeighFlag(); + int tapleFlag = request.getTapleFlag(); + int promotionFlag = request.getPromotionFlag(); + int discountFlag = request.getDiscountFlag(); + String assistNo = request.getAssistNo(); + String barCode = request.getBarCode(); + String kitPlanId = request.getKitPlanId(); + String workerNo = request.getWorkerNo(); + + String jsonString = request.getSpecInfos(); + JSONArray jsonArray = JSON.parseArray(jsonString); + //ProductSpecEntity entity = new ProductSpecEntity(json); + + List entityList = new ArrayList<>(); + if(jsonArray != null && jsonArray.size() > 0){ + for(int i = 0 ; i < jsonArray.size() ; i++){ + ProductSpecInfoEntity entity = new ProductSpecInfoEntity(jsonArray.getJSONObject(i)); + entityList.add(entity); + } + } + + + + Date date = new Date();// 创建时间 + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + + if (brandId != null) { + Brand brand = brandService.get(tenantId, brandId); + if (brand == null) { + response.setStatus(0); + response.setMessage("校验失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage("品牌不存在"); + return response; + } + } + if (typeId != null) { + ProductType productType = productTypeService.get(tenantId, typeId); + if (productType == null) { + response.setStatus(0); + response.setMessage("校验失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage("商品类别不存在"); + return response; + } + } + + if (unitId != null) { + ProductUnit productUnit = productUnitService.get(tenantId, unitId); + if (productUnit == null) { + response.setStatus(0); + response.setMessage("校验失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage("商品单位不存在"); + return response; + } + } + //判断自建商品在此门店是否存在; + if (name != null) { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantId", tenantId)); + criteria.add(Restrictions.eq("name", name)); + criteria.add(Restrictions.eq("selfFlag", 1)); + criteria.add(Restrictions.eq("storeId", storeId)); + List productUnit = productService.getList(tenantId, criteria); + if (productUnit != null && productUnit.size() > 0) { + response.setStatus(0); + response.setMessage("校验失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage("商品名称已存在"); + return response; + } + } + + if(CollectionUtils.isNotEmpty(entityList)){ + // 第一步创建商品对象 + Product product = new Product(); + product.setTenantId(tenantId); + product.setBrandId(brandId); + product.setTypeId(typeId); + product.setTypePath(typePath); + String maxNo = productService.selectMaxNoSelf(tenantId, storeId); + String nextNo = getNextNo(maxNo); + product.setNo(nextNo); + product.setName(name); + product.setSpell(getPinYinHeadChar(name)); + product.setAssistNo(assistNo); + product.setBarCode(barCode); + product.setOtherNo(null); + product.setEnglish(null); + product.setShortName(name); + product.setSpec(entityList.get(0).getSpecName()); + product.setUnitId(unitId); + product.setDescription("自建菜品"); + product.setCommissionType(0); + product.setCommissionValue(0.00); + product.setDiscountFlag(1); + product.setTapleFlag(tapleFlag); + product.setWeighFlag(weighFlag); + product.setCurrentFlag(1); + product.setLabelPrintFlag(labelPrintFlag); + product.setSuitFlag(0); + product.setMebDiscountFlag(0); + product.setGiveFlag(1); + product.setPromotionFlag(promotionFlag); + product.setDiscountFlag(discountFlag); + product.setType(0); + product.setStockFlag(0); + product.setPointType(0); + product.setPointValue(0.00); + product.setPurchaseTax(0.00); + product.setSaleTax(0.00); + product.setLyRate(0.00); + product.setGroupName(null); + product.setPicture(null); + product.setStopFlag(0); + product.setDeleteFlag(0); + product.setNoType(1); + product.setZcFlag(1); + product.setErpCategoryCode(null); + product.setErpSyncFlag(null); + product.setSelfFlag(1); + product.setStoreId(storeId); + product.setCreateUser(workerNo); + product.setCreateDate(date); + // 第二步创建规格 + List specs = new ArrayList<>(); + int i = 0; + for(ProductSpecInfoEntity psInfo : entityList){ + ProductSpec productSpec = new ProductSpec(); + productSpec.setTenantId(tenantId); + productSpec.setNo(i+""); + productSpec.setName(psInfo.getSpecName()); + productSpec.setPrice(psInfo.getPrice()); + productSpec.setMinPrice(0.00); + productSpec.setMemberPrice(psInfo.getMemberPrice()); + productSpec.setOtherPrice(0.00); + productSpec.setCostPrice(0.00); + productSpec.setPurchasePrice(0.00); + productSpec.setDispatchPrice(0.00); + productSpec.setMaterialRate(0.00); + if(i == 0) { + productSpec.setIsdefault(1); + }else { + productSpec.setIsdefault(0); + } + productSpec.setDeleteFlag(0); + productSpec.setErpCode(null); + productSpec.setErpSyncStatus(null); + productSpec.setCreateUser(workerNo); + productSpec.setCreateDate(date); + specs.add(productSpec); + i++; + } + + // 设置出品 + if (kitPlanId != null && !"".equals(kitPlanId)) { + ProductKitPlan productKitPlan = new ProductKitPlan(); + productKitPlan.setTenantId(tenantId); + productKitPlan.setStoreId(storeId); + productKitPlan.setChudaFlag(1); + productKitPlan.setChuda(kitPlanId); + productKitPlan.setChupinFlag(0); + productKitPlan.setChupin(null); + productKitPlan.setLabelFlag(0); + productKitPlan.setLabelValue(null); + productKitPlan.setCreateUser(workerNo); + productKitPlan.setCreateDate(date); + productService.saveSelfProductSpecs(tenantId,storeId, product, specs, productKitPlan); + } else { + productService.saveSelfProductSpecs(tenantId,storeId, product, specs, null); + } + }else{ + // 第一步创建商品对象 + Product product = new Product(); + product.setTenantId(tenantId); + product.setBrandId(brandId); + product.setTypeId(typeId); + product.setTypePath(typePath); + String maxNo = productService.selectMaxNoSelf(tenantId, storeId); + String nextNo = getNextNo(maxNo); + product.setNo(nextNo); + product.setName(name); + product.setSpell(getPinYinHeadChar(name)); + product.setAssistNo(assistNo); + product.setBarCode(barCode); + product.setOtherNo(null); + product.setEnglish(null); + product.setShortName(name); + product.setSpec(null); + product.setUnitId(unitId); + product.setDescription("自建菜品"); + product.setCommissionType(0); + product.setCommissionValue(0.00); + product.setDiscountFlag(1); + product.setTapleFlag(tapleFlag); + product.setWeighFlag(weighFlag); + product.setCurrentFlag(1); + product.setLabelPrintFlag(labelPrintFlag); + product.setSuitFlag(0); + product.setMebDiscountFlag(0); + product.setGiveFlag(1); + product.setPromotionFlag(promotionFlag); + product.setDiscountFlag(discountFlag); + product.setType(0); + product.setStockFlag(0); + product.setPointType(0); + product.setPointValue(0.00); + product.setPurchaseTax(0.00); + product.setSaleTax(0.00); + product.setLyRate(0.00); + product.setGroupName(null); + product.setPicture(null); + product.setStopFlag(0); + product.setDeleteFlag(0); + product.setNoType(1); + product.setZcFlag(1); + product.setErpCategoryCode(null); + product.setErpSyncFlag(null); + product.setSelfFlag(1); + product.setStoreId(storeId); + product.setCreateUser(workerNo); + product.setCreateDate(date); + // 第二步创建规格 + ProductSpec productSpec = new ProductSpec(); + productSpec.setTenantId(tenantId); + productSpec.setNo("0"); + productSpec.setName(null); + productSpec.setPrice(price); + productSpec.setMinPrice(0.00); + productSpec.setMemberPrice(memberPrice); + productSpec.setOtherPrice(0.00); + productSpec.setCostPrice(0.00); + productSpec.setPurchasePrice(0.00); + productSpec.setDispatchPrice(0.00); + productSpec.setMaterialRate(0.00); + productSpec.setIsdefault(1); + productSpec.setDeleteFlag(0); + productSpec.setErpCode(null); + productSpec.setErpSyncStatus(null); + productSpec.setCreateUser(workerNo); + productSpec.setCreateDate(date); + // 创建门店商品关联 + StoreProduct storeProduct = new StoreProduct(); + storeProduct.setTenantId(tenantId); + storeProduct.setStoreId(storeId); + storeProduct.setProductUnitId(unitId); + storeProduct.setTypeId(typeId); + storeProduct.setTypePath(typePath); + storeProduct.setPrice(price); + storeProduct.setMinPrice(0.00); + storeProduct.setMemberPrice(memberPrice); + storeProduct.setOtherPrice(0.00); + storeProduct.setCostPrice(0.00); + storeProduct.setPurchasePrice(0.00); + storeProduct.setDispatchPrice(0.00); + storeProduct.setCreateUser(workerNo); + storeProduct.setCreateDate(date); + // 设置出品 + if (kitPlanId != null && !"".equals(kitPlanId)) { + ProductKitPlan productKitPlan = new ProductKitPlan(); + productKitPlan.setTenantId(tenantId); + productKitPlan.setStoreId(storeId); + productKitPlan.setChudaFlag(1); + productKitPlan.setChuda(kitPlanId); + productKitPlan.setChupinFlag(0); + productKitPlan.setChupin(null); + productKitPlan.setLabelFlag(0); + productKitPlan.setLabelValue(null); + productKitPlan.setCreateUser(workerNo); + productKitPlan.setCreateDate(date); + productService.saveSelfProduct(tenantId, product, productSpec, storeProduct, productKitPlan,null,null); + } else { + productService.saveSelfProduct(tenantId, product, productSpec, storeProduct, null,null,null); + } + } + + response.setStatus(1); + response.setMessage("操作成功"); + + //更新服务数据版本信息; + Map eventData = new HashMap<>(); + eventData.put("tenantId", tenantId); + eventData.put("dataType", "CY_PRODUCTDATA"); + eventBus.notify(EventKeys.SERVERDATAVERSION_UPDATE, Event.wrap(eventData)); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "ygj.add.suit", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "新建套餐") + @Override + public Object ygjAddSuit(YgjAddSuitRequest request) { + String info = "新建套餐"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + String brandId = request.getBrandId(); + String typeId = request.getTypeId(); + String typePath = request.getTypePath(); + String name = request.getName(); + String unitId = request.getUnitId(); + double price = request.getPrice(); + double memberPrice = request.getMemberPrice(); + String assistNo = request.getAssistNo(); + String workerNo = request.getWorkerNo(); + String kitPlanId = request.getKitPlanId(); + String productIds = request.getProductIds(); + String specIds = request.getSpecIds(); + String quantitys = request.getQuantitys(); + + Date date = new Date();// 创建时间 + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + + if (brandId != null) { + Brand brand = brandService.get(tenantId, brandId); + if (brand == null) { + response.setStatus(0); + response.setMessage("校验失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage("品牌不存在"); + return response; + } + } + if (typeId != null) { + ProductType productType = productTypeService.get(tenantId, typeId); + if (productType == null) { + response.setStatus(0); + response.setMessage("校验失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage("商品类别不存在"); + return response; + } + } + + if (unitId != null) { + ProductUnit productUnit = productUnitService.get(tenantId, unitId); + if (productUnit == null) { + response.setStatus(0); + response.setMessage("校验失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage("商品单位不存在"); + return response; + } + } + if (name != null) { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantId", tenantId)); + criteria.add(Restrictions.eq("name", name)); + criteria.add(Restrictions.eq("selfFlag", 1)); + criteria.add(Restrictions.eq("storeId", storeId)); + List productUnit = productService.getList(tenantId, criteria); + if (productUnit != null && productUnit.size() > 0) { + response.setStatus(0); + response.setMessage("校验失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage("商品名称已存在"); + return response; + } + } + // 第一步创建商品对象 + Product product = new Product(); + product.setTenantId(tenantId); + product.setBrandId(brandId); + product.setTypeId(typeId); + product.setTypePath(typePath); + String maxNo = productService.selectMaxNoSelf(tenantId, storeId); + String nextNo = getNextNo(maxNo); + product.setNo(nextNo); + product.setName(name); + product.setSpell(getPinYinHeadChar(name)); + product.setAssistNo(assistNo); + product.setBarCode(null); + product.setOtherNo(null); + product.setEnglish(null); + product.setShortName(name); + product.setSpec(null); + product.setUnitId(unitId); + product.setDescription("自建套餐"); + product.setCommissionType(0); + product.setCommissionValue(0.00); + product.setDiscountFlag(1); + product.setTapleFlag(0); + product.setWeighFlag(0); + product.setCurrentFlag(1); + product.setLabelPrintFlag(0); + product.setSuitFlag(1); + product.setMebDiscountFlag(0); + product.setGiveFlag(1); + product.setPromotionFlag(1); + product.setType(0); + product.setStockFlag(0); + product.setPointType(0); + product.setPointValue(0.00); + product.setPurchaseTax(0.00); + product.setSaleTax(0.00); + product.setLyRate(0.00); + product.setGroupName(null); + product.setPicture(null); + product.setStopFlag(0); + product.setDeleteFlag(0); + product.setNoType(1); + product.setZcFlag(1); + product.setErpCategoryCode(null); + product.setErpSyncFlag(null); + product.setSelfFlag(1); + product.setStoreId(storeId); + product.setCreateUser(workerNo); + product.setCreateDate(date); + // 第二步创建规格 + ProductSpec productSpec = new ProductSpec(); + productSpec.setTenantId(tenantId); + productSpec.setNo("0"); + productSpec.setName(null); + productSpec.setPrice(price); + productSpec.setMinPrice(0.00); + productSpec.setMemberPrice(memberPrice); + productSpec.setOtherPrice(0.00); + productSpec.setCostPrice(0.00); + productSpec.setPurchasePrice(0.00); + productSpec.setDispatchPrice(0.00); + productSpec.setMaterialRate(0.00); + productSpec.setIsdefault(1); + productSpec.setDeleteFlag(0); + productSpec.setErpCode(null); + productSpec.setErpSyncStatus(null); + productSpec.setCreateUser(workerNo); + productSpec.setCreateDate(date); + // 创建门店商品关联 + StoreProduct storeProduct = new StoreProduct(); + storeProduct.setTenantId(tenantId); + storeProduct.setStoreId(storeId); + storeProduct.setProductUnitId(unitId); + storeProduct.setTypeId(typeId); + storeProduct.setTypePath(typePath); + storeProduct.setPrice(price); + storeProduct.setMinPrice(0.00); + storeProduct.setMemberPrice(memberPrice); + storeProduct.setOtherPrice(0.00); + storeProduct.setCostPrice(0.00); + storeProduct.setPurchasePrice(0.00); + storeProduct.setDispatchPrice(0.00); + storeProduct.setCreateUser(workerNo); + storeProduct.setCreateDate(date); + String[] productIdArray = productIds.split(","); + String[] specIdArray = specIds.split(","); + String[] quantityArray = quantitys.split(","); + List suitList = new ArrayList<>(); + List suitDetailList = new ArrayList<>(); + for (int i = 0; i < productIdArray.length; i++) { + // 创建套餐道菜 + ProductSuit productSuit = new ProductSuit(); + productSuit.setTenantId(tenantId); + productSuit.setNo(String.valueOf(i + 1)); + productSuit.setName("第" + (i + 1) + "道菜"); + productSuit.setQuantity(1); + productSuit.setCreateUser(workerNo); + productSuit.setCreateDate(date); + suitList.add(productSuit); + // 创建道菜明细 + ProductSuitDetail productSuitDetail = new ProductSuitDetail(); + productSuitDetail.setTenantId(tenantId); + productSuitDetail.setProductId(productIdArray[i]); + productSuitDetail.setSpecId(specIdArray[i]); + productSuitDetail.setQuantity(IntegerFormat(quantityArray[i])); + productSuitDetail.setAddPrice(0.00); + productSuitDetail.setDefaultflag(1); + productSuitDetail.setCreateUser(workerNo); + productSuitDetail.setCreateDate(date); + suitDetailList.add(productSuitDetail); + } + // 设置出品 + if (kitPlanId != null && !"".equals(kitPlanId)) { + ProductKitPlan productKitPlan = new ProductKitPlan(); + productKitPlan.setTenantId(tenantId); + productKitPlan.setStoreId(storeId); + productKitPlan.setChudaFlag(1); + productKitPlan.setChuda(kitPlanId); + productKitPlan.setChupinFlag(0); + productKitPlan.setChupin(null); + productKitPlan.setLabelFlag(0); + productKitPlan.setLabelValue(null); + productKitPlan.setCreateUser(workerNo); + productKitPlan.setCreateDate(date); + productService.saveSelfProduct(tenantId, product, productSpec, storeProduct, productKitPlan, suitList, suitDetailList); + } else { + productService.saveSelfProduct(tenantId, product, productSpec, storeProduct, null, suitList, suitDetailList); + } + response.setStatus(1); + response.setMessage("操作成功"); + + //更新服务数据版本信息; + Map eventData = new HashMap<>(); + eventData.put("tenantId", tenantId); + eventData.put("dataType", "CY_PRODUCTDATA"); + eventBus.notify(EventKeys.SERVERDATAVERSION_UPDATE, Event.wrap(eventData)); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 得到中文首字母 + * + * @param str + * @return + */ + public String getPinYinHeadChar(String str) { + + String convert = ""; + for (int j = 0; j < str.length(); j++) { + char word = str.charAt(j); + String[] pinyinArray = PinyinHelper.toHanyuPinyinStringArray(word); + if (pinyinArray != null) { + convert += pinyinArray[0].charAt(0); + } else { + convert += word; + } + } + return convert.toUpperCase(); + } + + /** + * 得到中文首字母 + * + * @param str + * @return + */ + public int IntegerFormat(String str) { + int i = 0; + try { + i = Integer.parseInt(str); + } catch (NumberFormatException e) { + i = 0; + } + return i; + } + + private String getNextNo(String maxNo) { + if (StringUtils.isBlank(maxNo)) { + maxNo = "0"; + } + int maxNoInt = 0; + try { + maxNoInt = Integer.parseInt(maxNo); + } catch (Exception e) { + logger.error("字符串" + maxNo + "转换成数值出错!"); + } + String nextNo = StringUtils.leftPad("" + (maxNoInt + 1), 6, "0"); + return nextNo; + } + + @ServiceMethod(method = "ygj.edit.product", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "修改商品信息") + @Override + public Object ygjEditProduct(YgjEditProductRequest request) { + String info = "新建商品"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + String brandId = request.getBrandId(); + String typeId = request.getTypeId(); + String typePath = request.getTypePath(); + String unitId = request.getUnitId(); + String productId = request.getProductId(); + String name = request.getName(); + double price = request.getPrice(); + double memberPrice = request.getMemberPrice(); + int labelPrintFlag = request.getLabelPrintFlag(); + int weighFlag = request.getWeighFlag(); + int tapleFlag = request.getTapleFlag(); + String assistNo = request.getAssistNo(); + String barCode = request.getBarCode(); + String kitPlanId = request.getKitPlanId(); + String workerNo = request.getWorkerNo(); + Date date = new Date();// 创建时间 + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + + Product product = productService.get(tenantId, productId); + if (product == null) { + response.setStatus(0); + response.setMessage("校验失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage("商品信息不存在"); + return response; + } + if (product.getSelfFlag() == 0) { + response.setStatus(0); + response.setMessage("校验失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage("非自建商品不允许修改信息"); + return response; + } + if (name != null) { + if (!product.getName().equals(name)) { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantId", tenantId)); + criteria.add(Restrictions.eq("name", name)); + criteria.add(Restrictions.eq("selfFlag", 1)); + criteria.add(Restrictions.eq("storeId", storeId)); + List productUnit = productService.getList(tenantId, criteria); + if (productUnit != null && productUnit.size() > 0) { + response.setStatus(0); + response.setMessage("校验失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage("商品名称已存在"); + return response; + } + } + } + // 第一步创建商品对象 + product.setBrandId(brandId); + product.setTypeId(typeId); + product.setTypePath(typePath); + product.setUnitId(unitId); + product.setName(name); + product.setPrice(price); + product.setMemberPrice(memberPrice); + product.setSpell(getPinYinHeadChar(name)); + product.setAssistNo(assistNo); + product.setBarCode(barCode); + product.setShortName(name); + product.setTapleFlag(tapleFlag); + product.setWeighFlag(weighFlag); + product.setLabelPrintFlag(labelPrintFlag); + product.setModifyUser(workerNo); + product.setModifyDate(date); + // 修改商品厨打方案 + if (kitPlanId != null && !"".equals(kitPlanId)) { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("tenantId", tenantId)); + criteria.add(Restrictions.eq("productId", productId)); + List listKitPlan = productKitPlanService.getList(tenantId, criteria); + if (listKitPlan != null && listKitPlan.size() > 0) { + ProductKitPlan productKitPlan = listKitPlan.get(0); + productKitPlan.setChudaFlag(1); + productKitPlan.setChuda(kitPlanId); + productKitPlan.setModifyUser(workerNo); + productKitPlan.setModifyDate(date); + productService.updateSelfProduct(tenantId, product, productKitPlan); + } else { + ProductKitPlan productKitPlan = new ProductKitPlan(); + productKitPlan.setTenantId(tenantId); + productKitPlan.setStoreId(storeId); + productKitPlan.setChudaFlag(1); + productKitPlan.setChuda(kitPlanId); + productKitPlan.setChupinFlag(0); + productKitPlan.setChupin(null); + productKitPlan.setLabelFlag(0); + productKitPlan.setLabelValue(null); + productKitPlan.setCreateUser(workerNo); + productKitPlan.setCreateDate(date); + productService.updateSelfProduct(tenantId, product, productKitPlan); + } + } else { + productService.updateSelfProduct(tenantId, product, null); + } + response.setStatus(1); + response.setMessage("操作成功"); + + //更新服务数据版本信息; + Map eventData = new HashMap<>(); + eventData.put("tenantId", tenantId); + eventData.put("dataType", "CY_PRODUCTDATA"); + eventBus.notify(EventKeys.SERVERDATAVERSION_UPDATE, Event.wrap(eventData)); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "ygj.edit.productSpec", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "修改商品信息") + @Override + public Object ygjEditProductSpec(YgjEditProductRequest request) { + String info = "新建商品"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + String brandId = request.getBrandId(); + String typeId = request.getTypeId(); + String typePath = request.getTypePath(); + String unitId = request.getUnitId(); + String productId = request.getProductId(); + String name = request.getName(); + double price = request.getPrice(); + double memberPrice = request.getMemberPrice(); + int labelPrintFlag = request.getLabelPrintFlag(); + int weighFlag = request.getWeighFlag(); + int tapleFlag = request.getTapleFlag(); + int promotionFlag = request.getPromotionFlag(); + int discountFlag = request.getDiscountFlag(); + String assistNo = request.getAssistNo(); + String barCode = request.getBarCode(); + String kitPlanId = request.getKitPlanId(); + String workerNo = request.getWorkerNo(); + Date date = new Date();// 创建时间 + + String jsonString = request.getSpecInfos(); + JSONArray jsonArray = JSON.parseArray(jsonString); + List entityList = new ArrayList<>(); + if(jsonArray != null && jsonArray.size() > 0) { + for (int i = 0; i < jsonArray.size(); i++) { + ProductSpecInfoEntity entity = new ProductSpecInfoEntity(jsonArray.getJSONObject(i)); + entityList.add(entity); + } + } + + CommonDataResponse response = null; + + try { + response = new CommonDataResponse(); + + Product product = productService.get(tenantId, productId); + if (product == null) { + response.setStatus(0); + response.setMessage("校验失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage("商品信息不存在"); + return response; + } + if (product.getSelfFlag() == 0) { + response.setStatus(0); + response.setMessage("校验失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage("非自建商品不允许修改信息"); + return response; + } + if (name != null) { + if (!product.getName().equals(name)) { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantId", tenantId)); + criteria.add(Restrictions.eq("name", name)); + criteria.add(Restrictions.eq("selfFlag", 1)); + criteria.add(Restrictions.eq("storeId", storeId)); + List productUnit = productService.getList(tenantId, criteria); + if (productUnit != null && productUnit.size() > 0) { + response.setStatus(0); + response.setMessage("校验失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage("商品名称已存在"); + return response; + } + } + } + + if(CollectionUtils.isEmpty(entityList)){ + // 第一步创建商品对象 + product.setBrandId(brandId); + product.setTypeId(typeId); + product.setTypePath(typePath); + product.setUnitId(unitId); + product.setName(name); + product.setPrice(price); + product.setMemberPrice(memberPrice); + product.setSpell(getPinYinHeadChar(name)); + product.setAssistNo(assistNo); + product.setBarCode(barCode); + product.setShortName(name); + product.setTapleFlag(tapleFlag); + product.setWeighFlag(weighFlag); + product.setPromotionFlag(promotionFlag); + product.setDiscountFlag(discountFlag); + product.setLabelPrintFlag(labelPrintFlag); + product.setModifyUser(workerNo); + product.setModifyDate(date); + // 修改商品厨打方案 + if (kitPlanId != null && !"".equals(kitPlanId)) { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("tenantId", tenantId)); + criteria.add(Restrictions.eq("productId", productId)); + List listKitPlan = productKitPlanService.getList(tenantId, criteria); + if (listKitPlan != null && listKitPlan.size() > 0) { + ProductKitPlan productKitPlan = listKitPlan.get(0); + productKitPlan.setChudaFlag(1); + productKitPlan.setChuda(kitPlanId); + productKitPlan.setModifyUser(workerNo); + productKitPlan.setModifyDate(date); + productService.updateSelfProduct(tenantId, product, productKitPlan); + } else { + ProductKitPlan productKitPlan = new ProductKitPlan(); + productKitPlan.setTenantId(tenantId); + productKitPlan.setStoreId(storeId); + productKitPlan.setChudaFlag(1); + productKitPlan.setChuda(kitPlanId); + productKitPlan.setChupinFlag(0); + productKitPlan.setChupin(null); + productKitPlan.setLabelFlag(0); + productKitPlan.setLabelValue(null); + productKitPlan.setCreateUser(workerNo); + productKitPlan.setCreateDate(date); + productService.updateSelfProduct(tenantId, product, productKitPlan); + } + } else { + productService.updateSelfProduct(tenantId, product, null); + } + }else { + // 第一步创建商品对象 + product.setBrandId(brandId); + product.setTypeId(typeId); + product.setTypePath(typePath); + product.setUnitId(unitId); + product.setName(name); + product.setPrice(entityList.get(0).getPrice()); + product.setMemberPrice(entityList.get(0).getMemberPrice()); + product.setSpell(getPinYinHeadChar(name)); + product.setAssistNo(assistNo); + product.setBarCode(barCode); + product.setShortName(name); + product.setTapleFlag(tapleFlag); + product.setWeighFlag(weighFlag); + product.setPromotionFlag(promotionFlag); + product.setDiscountFlag(discountFlag); + product.setLabelPrintFlag(labelPrintFlag); + product.setModifyUser(workerNo); + product.setModifyDate(date); + + // 第二步创建规格 + List specs = new ArrayList<>(); + for(ProductSpecInfoEntity psInfo : entityList){ + ProductSpec productSpec = new ProductSpec(); + productSpec.setId(psInfo.getSpecId()); + productSpec.setTenantId(tenantId); + productSpec.setProductId(productId); + productSpec.setName(psInfo.getSpecName()); + productSpec.setPrice(psInfo.getPrice()); + productSpec.setMinPrice(0.00); + productSpec.setMemberPrice(psInfo.getMemberPrice()); + productSpec.setOtherPrice(0.00); + productSpec.setCostPrice(0.00); + productSpec.setPurchasePrice(0.00); + productSpec.setDispatchPrice(0.00); + productSpec.setMaterialRate(0.00); + productSpec.setDeleteFlag(0); + productSpec.setErpCode(null); + productSpec.setErpSyncStatus(null); + productSpec.setCreateUser(workerNo); + productSpec.setCreateDate(date); + productSpec.setModifyDate(date); + productSpec.setModifyUser(workerNo); + specs.add(productSpec); + } + + + + // 修改商品厨打方案 + if (kitPlanId != null && !"".equals(kitPlanId)) { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("tenantId", tenantId)); + criteria.add(Restrictions.eq("productId", productId)); + List listKitPlan = productKitPlanService.getList(tenantId, criteria); + if (listKitPlan != null && listKitPlan.size() > 0) { + ProductKitPlan productKitPlan = listKitPlan.get(0); + productKitPlan.setChudaFlag(1); + productKitPlan.setChuda(kitPlanId); + productKitPlan.setModifyUser(workerNo); + productKitPlan.setModifyDate(date); + productService.updateSelfProductSpec(tenantId, product,specs ,productKitPlan); + } else { + ProductKitPlan productKitPlan = new ProductKitPlan(); + productKitPlan.setTenantId(tenantId); + productKitPlan.setStoreId(storeId); + productKitPlan.setChudaFlag(1); + productKitPlan.setChuda(kitPlanId); + productKitPlan.setChupinFlag(0); + productKitPlan.setChupin(null); + productKitPlan.setLabelFlag(0); + productKitPlan.setLabelValue(null); + productKitPlan.setCreateUser(workerNo); + productKitPlan.setCreateDate(date); + productService.updateSelfProductSpec(tenantId, product,specs , productKitPlan); + } + } else { + productService.updateSelfProductSpec(tenantId, product,specs , null); + } + } + + response.setStatus(1); + response.setMessage("操作成功"); + + //更新服务数据版本信息; + Map eventData = new HashMap<>(); + eventData.put("tenantId", tenantId); + eventData.put("dataType", "CY_PRODUCTDATA"); + eventBus.notify(EventKeys.SERVERDATAVERSION_UPDATE, Event.wrap(eventData)); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + + @ServiceMethod(method = "ygj.product.type", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "云管家商品分类") + @Override + public Object ygjProductType(YgjProductTypeRequest request) { + String info = "商品类别"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + StringBuffer sBuf = new StringBuffer(); + sBuf.append(" SELECT a.`typePath` FROM `cy_store_product` a "); + sBuf.append(" LEFT JOIN cy_product b ON a.`productId` =b.`id` "); + sBuf.append(" WHERE a.storeId = '" + storeId + "' "); + sBuf.append(" AND b.`deleteFlag` = 0 "); + sBuf.append(" AND a.`tenantId` = '" + tenantId + "' "); + sBuf.append(" AND b.`type`<10 "); + sBuf.append(" GROUP BY a.`typePath` "); + List> productList = storeProductService.selectList(tenantId, sBuf.toString()); + List ids = new ArrayList(); + for (Map map : productList) { + if (map!=null && map.get("typePath") != null) { + String typePath = map.get("typePath").toString(); + String[] typeIds = typePath.split(","); + for (int i = 0; i < typeIds.length; i++) { + ids.add(typeIds[i]); + } + } + } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + List> list = new ArrayList<>(); + List typeIds = removeDuplicate(ids); + if (typeIds != null && typeIds.size() > 0) { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.in("id", typeIds)); + criteria.add(Restrictions.eq("deleteFlag", 0)); + pager = productTypeService.getPager(tenantId, criteria, pager); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (ProductType dishType : source) { + Map map = new HashMap<>(); + map.put("tenantId", dishType.getTenantId()); + map.put("id", dishType.getId()); + map.put("parentId", dishType.getParentId()); + map.put("path", dishType.getPath()); + map.put("no", dishType.getNo()); + map.put("name", dishType.getName()); + map.put("color", dishType.getColor()); + map.put("sign", dishType.getSign());// 标识符 + list.add(map); + } + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "ygj.selfProduct.type", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "自建商品类别") + @Override + public Object ygjSelfProductType(ProductTypeRequest request) { + String info = "门店自建商品类别"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("deleteFlag", 0)); + List> list = new ArrayList<>(); + if(tenantId.equals("571022")){ + List brands = brandService.getListBystoreId(tenantId,request.getStoreId()); + if(CollectionUtils.isNotEmpty(brands)){ + List brandIds = new ArrayList<>(); + for(Brand brand : brands){ + brandIds.add(brand.getId()); + } + criteria.add(Restrictions.in("brandId",brandIds)); + pager = productTypeService.getPagerWithBrandId(tenantId, criteria, pager); + }else{ + pager = productTypeService.getPager(tenantId, criteria, pager); + } + }else{ + pager = productTypeService.getPager(tenantId, criteria, pager); + } + + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (ProductType dishType : source) { + Map map = new HashMap<>(); + map.put("tenantId", dishType.getTenantId()); + map.put("id", dishType.getId()); + map.put("parentId", dishType.getParentId()); + map.put("path", dishType.getPath()); + map.put("no", dishType.getNo()); + map.put("name", dishType.getName()); + map.put("color", dishType.getColor()); + map.put("sign", dishType.getSign());// 标识符 + list.add(map); + } + } + + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "TYPE_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + public static List removeDuplicate(List list) { + if (list != null && list.size() > 0) { + for (int i = 0; i < list.size() - 1; i++) { + for (int j = list.size() - 1; j > i; j--) { + if (list.get(j).equals(list.get(i))) { + list.remove(j); + } + } + } + } + return list; + } + + @ServiceMethod(method = "ygj.material.type", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "云管家原料分类") + @Override + public Object ygjMaterialType(YgjProductTypeRequest request) { + String info = "原料类别"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + StringBuffer sBuf = new StringBuffer(); + sBuf.append(" SELECT a.`typePath` FROM `cy_store_product` a "); + sBuf.append(" LEFT JOIN cy_product b ON a.`productId` =b.`id` "); + sBuf.append(" WHERE a.storeId = '" + storeId + "' "); + sBuf.append(" AND b.`deleteFlag` = 0 "); + sBuf.append(" AND a.`tenantId` = '" + tenantId + "' "); + sBuf.append(" AND b.`type` >= 10 "); + sBuf.append(" GROUP BY a.`typePath` "); + List> productList = storeProductService.selectList(tenantId, sBuf.toString()); + List ids = new ArrayList(); + for (Map map : productList) { + if (map!=null && map.get("typePath") != null) { + String typePath = map.get("typePath").toString(); + String[] typeIds = typePath.split(","); + for (int i = 0; i < typeIds.length; i++) { + ids.add(typeIds[i]); + } + } + } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + List> list = new ArrayList<>(); + List typeIds = removeDuplicate(ids); + if (typeIds != null && typeIds.size() > 0) { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.in("id", typeIds)); + criteria.add(Restrictions.eq("deleteFlag", 0)); + pager = productTypeService.getPager(tenantId, criteria, pager); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (ProductType dishType : source) { + Map map = new HashMap<>(); + map.put("tenantId", dishType.getTenantId()); + map.put("id", dishType.getId()); + map.put("parentId", dishType.getParentId()); + map.put("path", dishType.getPath()); + map.put("no", dishType.getNo()); + map.put("name", dishType.getName()); + map.put("color", dishType.getColor()); + map.put("sign", dishType.getSign());// 标识符 + list.add(map); + } + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "ygj.product.type.more", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "云管家商品分类") + @Override + public Object ygjProductTypeMore(YgjProductTypeRequest request) { + String info = "云管家商品分类"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + // 第一步,获取门店下的品牌 + List brandIdsList = storeService.getBrandIdList(tenantId, request.getStoreId()); + StringBuffer sBuf = new StringBuffer(); + sBuf.append(" SELECT b.`typePath` FROM `cy_product` b WHERE "); + sBuf.append(" b.`deleteFlag` = 0 "); + if (brandIdsList != null && brandIdsList.size() > 0) { + sBuf.append(" AND (b.brandId IN (SELECT brandId FROM `cy_store_brand` WHERE storeId ='" + request.getStoreId() + "' AND tenantId = '" + tenantId + "') OR b.brandId IS NULL) "); + } + sBuf.append(" AND b.`tenantId` = '" + tenantId + "' "); + sBuf.append(" AND b.`type`<10 "); + sBuf.append(" GROUP BY b.`typePath` "); + List> productList = storeProductService.selectList(tenantId, sBuf.toString()); + List ids = new ArrayList(); + for (Map map : productList) { + if (map!=null && map.get("typePath") != null) { + String typePath = map.get("typePath").toString(); + String[] typeIds = typePath.split(","); + for (int i = 0; i < typeIds.length; i++) { + ids.add(typeIds[i]); + } + } + } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + List> list = new ArrayList<>(); + List typeIds = removeDuplicate(ids); + if (typeIds != null && typeIds.size() > 0) { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.in("id", typeIds)); + criteria.add(Restrictions.eq("deleteFlag", 0)); + pager = productTypeService.getPager(tenantId, criteria, pager); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (ProductType dishType : source) { + Map map = new HashMap<>(); + map.put("tenantId", dishType.getTenantId()); + map.put("id", dishType.getId()); + map.put("parentId", dishType.getParentId()); + map.put("path", dishType.getPath()); + map.put("no", dishType.getNo()); + map.put("name", dishType.getName()); + map.put("color", dishType.getColor()); + map.put("sign", dishType.getSign());// 标识符 + list.add(map); + } + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "ygj.product.type.check", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "可盘点商品分类") + @Override + public Object ygjProductTypeCheck(YgjProductTypeRequest request) { + String info = "可盘点商品分类"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + StringBuffer sBuf = new StringBuffer(); + sBuf.append(" SELECT a.`typePath` FROM `cy_store_product` a "); + sBuf.append(" LEFT JOIN cy_product b ON a.`productId` =b.`id` "); + sBuf.append(" WHERE a.storeId = '" + storeId + "' "); + sBuf.append(" AND b.`deleteFlag` = 0 "); + sBuf.append(" AND a.`tenantId` = '" + tenantId + "' "); + sBuf.append(" AND b.`stockFlag` = 1 "); + sBuf.append(" GROUP BY a.`typePath` "); + List> productList = storeProductService.selectList(tenantId, sBuf.toString()); + List ids = new ArrayList(); + for (Map map : productList) { + if (map!=null && map.get("typePath") != null) { + String typePath = map.get("typePath").toString(); + String[] typeIds = typePath.split(","); + for (int i = 0; i < typeIds.length; i++) { + ids.add(typeIds[i]); + } + } + } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + List> list = new ArrayList<>(); + List typeIds = removeDuplicate(ids); + if (typeIds != null && typeIds.size() > 0) { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.in("id", typeIds)); + criteria.add(Restrictions.eq("deleteFlag", 0)); + pager = productTypeService.getPager(tenantId, criteria, pager); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (ProductType dishType : source) { + Map map = new HashMap<>(); + map.put("tenantId", dishType.getTenantId()); + map.put("id", dishType.getId()); + map.put("parentId", dishType.getParentId()); + map.put("path", dishType.getPath()); + map.put("no", dishType.getNo()); + map.put("name", dishType.getName()); + map.put("color", dishType.getColor()); + map.put("sign", dishType.getSign());// 标识符 + list.add(map); + } + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "ygj.product.stock.check", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "可盘点商品列表") + @Override + public Object ygjProductStockCheck(WxyhGoodsRequest request) { + String info = "可盘点商品列表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + String categoryId = request.getCategoryId(); + String brandIds = request.getBrandIds(); + String property = request.getProperty(); + String keyword = request.getKeyword(); + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + + CommonPagerResponse response = null; + try { + + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + + Criteria criteria = new Criteria(); + // 模糊搜索 支持搜索名称,编码和拼音简码 + if (StringUtils.isNotBlank(keyword)) { + criteria.add(Restrictions.or(Restrictions.or(Restrictions.like("p.name", "%" + keyword + "%"), Restrictions.like("p.spell", "%" + keyword + "%")), Restrictions.or(Restrictions.like("p.no", "%" + keyword + "%"), Restrictions.like("p.barCode", "%" + keyword + "%")))); + } + if (StringUtils.isNotBlank(categoryId)) { + ProductType productType = productTypeService.get(tenantId, categoryId); + if (productType != null) { + criteria.add(Restrictions.like("sp.typePath", productType.getPath() + "%")); + } + } + if (StringUtils.isNotBlank(brandIds)) { + criteria.add(Restrictions.eq("p.brandId", brandIds)); + } + criteria.add(Restrictions.eq("sp.storeId", storeId)); + // 管理库存,未停用,未删除的原料,辅料 + criteria.add(Restrictions.eq("p.stopFlag", 0)); + criteria.add(Restrictions.eq("p.stockFlag", 1)); + criteria.add(Restrictions.eq("sp.storeId", storeId)); + criteria.add(Restrictions.eq("ps.deleteFlag", 0)); + // 原料属性; + criteria.add(Restrictions.order("p.no", "asc")); + criteria.add(Restrictions.order("ps.no", "asc")); + pager = storeProductService.getPagerExtend(tenantId, criteria, pager); + List productList = (List) pager.getList(); + List> list = new ArrayList>(); + + for (StoreProduct product : productList) { + Map map = new HashMap<>(); + map.put("productId", product.getProductId()); + map.put("productNo", product.getProductNo()); + map.put("productName", product.getProductName()); + map.put("specId", product.getSpecId()); + map.put("specName", product.getSpecName()); + map.put("barCode", product.getBarCode()); + map.put("assistNo", product.getAssistNo()); + map.put("spell", product.getSpell()); + list.add(map); + } + Map ratioMap = new HashMap(); + // 所有库存系数 + criteria = new Criteria(); + criteria.add(Restrictions.limit("0", "3000")); + List ratios = productRatioService.getList(tenantId, criteria); + for (ProductRatio ratio : ratios) { + ratioMap.put(ratio.getProductId(), ratio); + } + // 所有单位 + Map unitMap = new HashMap(); + criteria = new Criteria(); + List units = productUnitService.getList(tenantId, criteria); + for (ProductUnit unit : units) { + unitMap.put(unit.getId(), unit); + } + // 组装数据 + for (Map map : list) { + String productId = map.get("productId").toString(); + String productName = map.get("productName").toString(); + // 库存系数 + if (null == ratioMap.get(productId)) { + response.setStatus(0); + response.setMessage(productName + "没有库存系数"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + String packUnitId = ratioMap.get(productId).getPackUnitId(); + // 库存单位 + if (null == unitMap.get(packUnitId)) { + response.setStatus(0); + response.setMessage(productName + "没有库存单位"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + String packUnitName = unitMap.get(packUnitId).getName(); + map.put("stockUnitId", packUnitId); + map.put("stockUnitName", packUnitName); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/jwygj/StoreYgjWorkerServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/jwygj/StoreYgjWorkerServiceImpl.java new file mode 100644 index 0000000..8fe3c7c --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/jwygj/StoreYgjWorkerServiceImpl.java @@ -0,0 +1,234 @@ +package com.jwsaas.api.service.impl.jwygj; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import org.apache.commons.lang3.StringUtils; + +import com.jwsaas.StoreAccountBusType; +import com.jwsaas.api.request.jwygj.YgjStoreAccountSummaryRequest; +import com.jwsaas.api.request.jwygj.YgjStoreSetRequest; +import com.jwsaas.api.request.jwygj.YgjWorkerModuleRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.response.mode.CommonListResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.jwygj.StoreYgjWorkerService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.DispatchSettlePlan; +import com.jwsaas.entity.food.Store; +import com.jwsaas.entity.food.StoreAccount; +import com.jwsaas.entity.food.StoreAccountDetail; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.utils.AppKeyUtil; + +@ServiceMethodBean(version = "1.0") +public class StoreYgjWorkerServiceImpl extends WopServiceImpl implements StoreYgjWorkerService { + + private static final long serialVersionUID = 8575914501865417043L; + + @Resource + private com.jwsaas.service.food.StoreService storeService; + @Resource + private com.jwsaas.service.food.DispatchSettlePlanService dispatchSettlePlanService; + @Resource + private com.jwsaas.service.food.PosRoleService posRoleService; + + @Resource + private com.jwsaas.service.food.StoreAccountService storeAccountService; + @Resource + private com.jwsaas.service.food.StoreAccountDetailService storeAccountDetailService; + + @ServiceMethod(method = "ygj.store.set", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "云管家门店设置") + @Override + public Object ygjStoreSet(YgjStoreSetRequest request) { + String info = "云管家门店设置"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Store store = storeService.get(tenantId, storeId); + if (store == null) { + response.setStatus(0); + response.setMessage("获取失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage("门店不存在"); + return response; + } + Map data = new HashMap<>(); + data.put("tenantId", tenantId); + data.put("productFlag", store.getProductFlag());// 是否允许自建商品 + List dispatchSettleList = dispatchSettlePlanService.getListByStoreId(tenantId, storeId, new Criteria()); + if (dispatchSettleList != null && dispatchSettleList.size() > 0) { + DispatchSettlePlan dispatchSettlePlan = dispatchSettleList.get(0); + data.put("balanceMode", dispatchSettlePlan.getBalanceMode()); + data.put("creditType", dispatchSettlePlan.getCreditType()); + data.put("advanceValue", dispatchSettlePlan.getAdvanceValue()); + } else { + data.put("balanceMode", 0);// 是否启用结算 + data.put("creditType", 1);// 是否允许欠费 + data.put("advanceValue", 0);// 预付款值 + } + response.setStatus(1); + response.setMessage("校验通过"); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "ygj.worker.module", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "云管家员工权限") + @Override + public Object ygjWorkerModule(YgjWorkerModuleRequest request) { + String info = "云管家员工权限"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + String workerId = request.getWorkerId(); + CommonListResponse response = null; + try { + response = new CommonListResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("获取失败"); +// response.setErrCode(CommonErrorCode.error998.getCode()); +// response.setErrMessage("门店不存在"); +// return response; +// } + List> list = new ArrayList<>(); + List moduleNoList = posRoleService.getYgjModuleNoList(tenantId, workerId); + if (moduleNoList != null && moduleNoList.size() > 0) { + for (String moduleNo : moduleNoList) { + Map map = new HashMap<>(); + map.put("tenantId", tenantId); + map.put("moduleNo", moduleNo); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("校验通过"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "ygj.store.account.summary", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "云管家金额变动汇总") + @Override + public Object ygjStoreAccountSummary(YgjStoreAccountSummaryRequest request) { + String info = "云管家金额变动汇总"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String accountId = request.getAccountId();// 账户ID + String startTime = request.getStartTime(); + String endTime = request.getEndTime(); + CommonListResponse response = null; + try { + response = new CommonListResponse(); + if (StringUtils.isBlank(storeId)) { + response.setStatus(0); + response.setMessage("参数storeId不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (StringUtils.isBlank(accountId)) { + response.setStatus(0); + response.setMessage("参数accountId不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + StoreAccount storeAccount = storeAccountService.get(tenantId, accountId); + if (storeAccount == null) { + response.setStatus(0); + response.setMessage("门店余额账户不存在"); + response.setErrCode(CommonErrorCode.error26.getCode()); + response.setErrMessage(CommonErrorCode.error26.getMessage()); + return response; + } + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("accountId", accountId)); + criteria.add(Restrictions.eq("status", 1)); + if (StringUtils.isNotBlank(startTime)) { + criteria.add(Restrictions.ge("busTime", startTime)); + } + if (StringUtils.isNotBlank(endTime)) { + criteria.add(Restrictions.le("busTime", endTime)); + } + criteria.add(Restrictions.order("createDate", "desc")); + List list= storeAccountDetailService.getListGroup(tenantId, criteria); + + List> resultDataList = new ArrayList<>(); + if (list != null && list.size() > 0) { + Map busTypeMap = new HashMap<>();// 业务类型 + for (StoreAccountBusType tempBusType : StoreAccountBusType.values()) { + busTypeMap.put(tempBusType.getSign(), tempBusType); + } + for (StoreAccountDetail data : list) { + Map map = new HashMap<>(); + map.put("busType", data.getBusType());// 业务类型 + map.put("busTypeName", busTypeMap.get("" + data.getBusType()) == null ? "ERR" + : busTypeMap.get("" + data.getBusType()).getDescription());// 业务类型名称 + map.put("amount", doubleFormat(data.getAmount()));// 发生金额 + map.put("count", data.getType());// 次数 + resultDataList.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(resultDataList); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", + request.getWopRequestContext().getLocale()); + } + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/kds/KdsServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/kds/KdsServiceImpl.java new file mode 100644 index 0000000..9c1bcf8 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/kds/KdsServiceImpl.java @@ -0,0 +1,152 @@ +package com.jwsaas.api.service.impl.kds; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import com.jwsaas.api.request.kds.KdsPlanRequest; +import com.jwsaas.api.request.kds.KdsProductRequest; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.response.mode.CommonListResponse; +import com.jwsaas.api.response.mode.CommonPagerResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.kds.KdsService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.KdsPlan; +import com.jwsaas.entity.food.ProductKdsPlan; +import com.jwsaas.entity.food.Store; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.pager.Pager; +import com.jwsaas.utils.AppKeyUtil; + +@ServiceMethodBean(version = "1.0") +public class KdsServiceImpl extends WopServiceImpl implements KdsService { + + private static final long serialVersionUID = -2384146882350927512L; + + @Resource + private com.jwsaas.service.food.StoreService storeService; + + @Resource + private com.jwsaas.service.food.KdsPlanService kdsPlanService; + + @Resource + private com.jwsaas.service.food.ProductKdsPlanService productKdsPlanService; + + @ServiceMethod(method = "kds.plan", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "厨显方案列表") + @Override + public Object kdsPlan(KdsPlanRequest request) { + String info = "厨显方案"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + CommonListResponse response = null; + try { + response = new CommonListResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("deleteFlag", 0)); + List source = kdsPlanService.getListBystoreId(tenantId, request.getStoreId()); + List> list = new ArrayList<>(); + for (KdsPlan kdsPlan : source) { + Map map = new HashMap<>(); + map.put("tenantId", kdsPlan.getTenantId()); + map.put("id", kdsPlan.getId()); + map.put("no", kdsPlan.getNo()); + map.put("name", kdsPlan.getName()); + map.put("description", kdsPlan.getDescription()); + list.add(map); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "PLAN_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "kds.product", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "商品厨显方案关联") + @Override + public Object kdsProduct(KdsProductRequest request) { + String info = "商品厨显方案"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", request.getStoreId())); + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + pager = productKdsPlanService.getPager(tenantId, criteria, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (ProductKdsPlan productKdsPlan : source) { + Map map = new HashMap<>(); + map.put("tenantId", productKdsPlan.getTenantId()); + map.put("id", productKdsPlan.getId()); + map.put("storeId", productKdsPlan.getStoreId()); + map.put("productId", productKdsPlan.getProductId()); + map.put("chuxianFlag", productKdsPlan.getChuxianFlag()); + map.put("chuxian", productKdsPlan.getChuxian()); + map.put("chuxianTime", productKdsPlan.getChuxianTime()); + map.put("chupinFlag", productKdsPlan.getChupinFlag()); + map.put("chupin", productKdsPlan.getChupin()); + map.put("chupinTime", productKdsPlan.getChupinTime()); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "PRODUCT_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/kit/KitServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/kit/KitServiceImpl.java new file mode 100644 index 0000000..864ddd5 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/kit/KitServiceImpl.java @@ -0,0 +1,153 @@ +package com.jwsaas.api.service.impl.kit; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import com.jwsaas.api.request.kit.KitPlanRequest; +import com.jwsaas.api.request.kit.KitProductRequest; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.response.mode.CommonListResponse; +import com.jwsaas.api.response.mode.CommonPagerResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.kit.KitService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.KitPlan; +import com.jwsaas.entity.food.ProductKitPlan; +import com.jwsaas.entity.food.Store; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.pager.Pager; +import com.jwsaas.utils.AppKeyUtil; + +@ServiceMethodBean(version = "1.0") +public class KitServiceImpl extends WopServiceImpl implements KitService { + + private static final long serialVersionUID = -2384146882350927512L; + + @Resource + private com.jwsaas.service.food.StoreService storeService; + + @Resource + private com.jwsaas.service.food.KitPlanService kitPlanService; + + @Resource + private com.jwsaas.service.food.ProductKitPlanService productKitPlanService; + + @ServiceMethod(method = "kit.plan", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "厨打方案列表") + @Override + public Object kitPlan(KitPlanRequest request) { + String info = "厨打方案"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + CommonListResponse response = null; + try { + response = new CommonListResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("deleteFlag", 0)); + List source = kitPlanService.getListBystoreId(tenantId, request.getStoreId()); + List> list = new ArrayList<>(); + for (KitPlan kitPlan : source) { + Map map = new HashMap<>(); + map.put("tenantId", kitPlan.getTenantId()); + map.put("id", kitPlan.getId()); + map.put("no", kitPlan.getNo()); + map.put("name", kitPlan.getName()); + map.put("type", kitPlan.getType()); + map.put("description", kitPlan.getDescription()); + list.add(map); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "PLAN_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "kit.product", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "商品厨打方案关联") + @Override + public Object kitProduct(KitProductRequest request) { + String info = "商品厨打方案"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", request.getStoreId())); + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + pager = productKitPlanService.getPager(tenantId, criteria, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (ProductKitPlan productKitPlan : source) { + Map map = new HashMap<>(); + map.put("tenantId", productKitPlan.getTenantId()); + map.put("id", productKitPlan.getId()); + map.put("storeId", productKitPlan.getStoreId()); + map.put("productId", productKitPlan.getProductId()); + map.put("chudaFlag", productKitPlan.getChudaFlag()); + map.put("chuda", productKitPlan.getChuda()); + map.put("chupinFlag", productKitPlan.getChupinFlag()); + map.put("chupin", productKitPlan.getChupin()); + map.put("labelFlag", productKitPlan.getLabelFlag()); + map.put("labelValue", productKitPlan.getLabelValue()); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "PRODUCT_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/kms/KmsServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/kms/KmsServiceImpl.java new file mode 100644 index 0000000..13c93d5 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/kms/KmsServiceImpl.java @@ -0,0 +1,68 @@ +package com.jwsaas.api.service.impl.kms; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import com.jwsaas.api.request.kms.ProductSalesInfoRequest; +import com.jwsaas.api.response.mode.CommonListResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.kms.KmsService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.utils.AppKeyUtil; + +@ServiceMethodBean(version = "1.0") +public class KmsServiceImpl extends WopServiceImpl implements KmsService { + + private static final long serialVersionUID = 2365814326392664933L; + + @Resource + private com.jwsaas.service.food.StoreBusinessTicketService storeBusinessTicketService; + + @ServiceMethod(method = "kms.product.sales.info", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "商品销售信息列表") + @Override + public Object productSalesInfo(ProductSalesInfoRequest request) { + String info = "商品销售信息列表"; + logger.debug(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String startTime = request.getStartTime();// 开始时间 + String endTime = request.getEndTime();// 结束时间 + CommonListResponse response = null; + try { + response = new CommonListResponse(); + StringBuffer sqlBuf = new StringBuffer(); + sqlBuf.append(" select specId,specName,productId,productNo,productName,productUnitName,SUM(count-rcount) as saleCount,SUM(amountTotal) as amountTotal,max(saleDate) lastSaleDate from cy_store_order_product "); + sqlBuf.append(" where tenantId =" + tenantId + " AND saleDate >='" + startTime + "' and saleDate <='" + endTime + "' "); + sqlBuf.append(" AND isInvalid=0 AND isSuit <>'3' "); + sqlBuf.append(" AND storeId =" + storeId + " "); + sqlBuf.append(" group by specId "); + // sqlBuf.append(" order by productNo asc "); + List> list = storeBusinessTicketService.selectList(tenantId, sqlBuf.toString()); + if (list == null) { + list = new ArrayList<>(); + } + response.setStatus(1); + response.setMessage("查询成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/ops/CityInfoServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/ops/CityInfoServiceImpl.java new file mode 100644 index 0000000..43dd405 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/ops/CityInfoServiceImpl.java @@ -0,0 +1,80 @@ +package com.jwsaas.api.service.impl.ops; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import org.apache.commons.lang3.StringUtils; + +import com.jwsaas.Constant; +import com.jwsaas.api.request.ops.CityInfoListRequest; +import com.jwsaas.api.response.mode.CommonListResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.ops.CityInfoService; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.ops.City; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; + +@ServiceMethodBean(version = "1.0") +public class CityInfoServiceImpl extends WopServiceImpl implements CityInfoService { + + private static final long serialVersionUID = 8470329788597889569L; + + @Resource + private com.jwsaas.service.ops.CityService cityService; + + @ServiceMethod(method = "city.info.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "获取城市信息列表") + @Override + public Object getList(CityInfoListRequest request) { + String info = "获取城市信息列表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + // AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + // String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + // String tenantId = tenantCode; + + String parentId = request.getParentId(); + CommonListResponse response = null; + try { + response = new CommonListResponse(); + + Criteria criteria = new Criteria(); + if (StringUtils.isBlank(parentId)) { + criteria.add(Restrictions.isNull("parentId")); + } else { + criteria.add(Restrictions.eq("parentId", parentId)); + } + + List dataList = cityService.getList(Constant.DEFAULT_DB_SIGN, criteria); + List> list = new ArrayList<>(); + for (City city : dataList) { + Map map = new HashMap<>(); + map.put("id", city.getId()); + map.put("code", city.getCode());// 城市编号 + map.put("name", city.getName());// 城市名称 + map.put("fullName", city.getFullName());// 城市全称 + map.put("parentId", city.getParentId());// 上级城市ID + map.put("path", city.getPath());// 城市路径 + list.add(map); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/pay/PayServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/pay/PayServiceImpl.java new file mode 100644 index 0000000..302fe09 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/pay/PayServiceImpl.java @@ -0,0 +1,86 @@ +package com.jwsaas.api.service.impl.pay; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.jwsaas.api.request.pay.PaymentParameterRequest; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.response.mode.CommonListResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.pay.PayService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.entity.food.PaymentParameter; +import com.jwsaas.entity.food.Store; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.util.JSONUtil; +import com.jwsaas.utils.AppKeyUtil; + +@ServiceMethodBean(version = "1.0") +public class PayServiceImpl extends WopServiceImpl implements PayService { + + private static final long serialVersionUID = -8074574894807574619L; + + @Resource + private com.jwsaas.service.food.StoreService storeService; + + @Resource + private com.jwsaas.service.food.PaymentParameterService paymentParameterService; + + @ServiceMethod(method = "pay.get.parameter", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO) + @Override + public Object getParameter(PaymentParameterRequest request) { + String info = "获取门店支付参数"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + CommonListResponse response = null; + try { + String storeId = request.getStoreId(); + response = new CommonListResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + List source = this.paymentParameterService.getPaymentParameterByStoreId(tenantId, storeId); + List> list = new ArrayList<>(); + for (PaymentParameter paymentParameter : source) { + Map map = new HashMap<>(); + map.put("tenantId", paymentParameter.getTenantId()); + map.put("id", paymentParameter.getId()); + map.put("storeId", request.getStoreId()); + map.put("no", paymentParameter.getNo()); + map.put("name", paymentParameter.getName()); + map.put("sign", paymentParameter.getSign()); + Map pbodyMap = JSONUtil.parseObject(paymentParameter.getPbody(), new TypeReference>() { + }); + map.put("pbody", pbodyMap); + map.put("certText", paymentParameter.getCertText()); + list.add(map); + } + response.setStatus(1); + response.setMessage("获取支付参数成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "GET_PARAMETER_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/peripheral/PeripheralServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/peripheral/PeripheralServiceImpl.java new file mode 100644 index 0000000..2fa8113 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/peripheral/PeripheralServiceImpl.java @@ -0,0 +1,129 @@ +package com.jwsaas.api.service.impl.peripheral; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import com.jwsaas.Constant; +import com.jwsaas.api.request.peripheral.CardReaderInfoRequest; +import com.jwsaas.api.request.peripheral.PrinterInfoRequest; +import com.jwsaas.api.response.mode.CommonListResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.peripheral.PeripheralService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.entity.ops.CardReaderInfo; +import com.jwsaas.entity.ops.PrinterInfo; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.service.ops.CardReaderInfoService; +import com.jwsaas.service.ops.PrinterInfoService; +import com.jwsaas.utils.AppKeyUtil; + +@ServiceMethodBean(version = "1.0") +public class PeripheralServiceImpl extends WopServiceImpl implements PeripheralService { + + private static final long serialVersionUID = -6434240769802924126L; + + private static final String className = "PeripheralServiceImpl"; + + @Resource + private PrinterInfoService printerInfoService; + @Resource + private CardReaderInfoService cardReaderInfoService; + + @ServiceMethod(method = "peripheral.card.reader.info", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "读卡器信息") + @Override + public Object cardReaderInfo(CardReaderInfoRequest request) { + String info = "读卡器信息"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + CommonListResponse response = null; + try { + response = new CommonListResponse(); + Criteria criteria = new Criteria(); + List source = cardReaderInfoService.getList(Constant.DEFAULT_DB_SIGN, criteria); + List> list = new ArrayList<>(); + for (CardReaderInfo cardReaderInfo : source) { + Map map = new HashMap<>(); + map.put("id", cardReaderInfo.getId()); + map.put("name", cardReaderInfo.getName()); + map.put("port", cardReaderInfo.getPort()); + map.put("baudRate", cardReaderInfo.getBaudRate()); + map.put("cardType", cardReaderInfo.getCardType()); + map.put("memo", cardReaderInfo.getMemo()); + list.add(map); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "CARD_READER_INFO", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "peripheral.printer.info", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "打印信息") + @Override + public Object printerInfo(PrinterInfoRequest request) { + String info = "打印机信息"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + CommonListResponse response = null; + try { + response = new CommonListResponse(); + Criteria criteria = new Criteria(); + List source = printerInfoService.getList(Constant.DEFAULT_DB_SIGN, criteria); + List> list = new ArrayList<>(); + for (PrinterInfo printerInfo : source) { + Map map = new HashMap<>(); + map.put("id", printerInfo.getId()); + map.put("name", printerInfo.getName()); + map.put("type", printerInfo.getType()); + map.put("port", printerInfo.getPort()); + map.put("pageWidth", printerInfo.getPageWidth()); + map.put("baudRate", printerInfo.getBaudRate()); + map.put("dataNum", printerInfo.getDataNum()); + map.put("checkNum", printerInfo.getCheckNum()); + map.put("stopNum", printerInfo.getStopNum()); + map.put("pid", printerInfo.getPid()); + map.put("vid", printerInfo.getVid()); + map.put("initCode", printerInfo.getInitCode()); + map.put("zbkCode", printerInfo.getZbkCode()); + map.put("cutCode", printerInfo.getCutCode()); + map.put("ptztCode", printerInfo.getPtztCode()); + map.put("ztbgCode", printerInfo.getZtbgCode()); + map.put("bkbgCode", printerInfo.getBkbgCode()); + map.put("moneyCode", printerInfo.getMoneyCode()); + map.put("driver", printerInfo.getDriver()); + map.put("memo", printerInfo.getMemo()); + list.add(map); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "PRINTER_INFO_INFO", request.getWopRequestContext().getLocale()); + } + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/pos/ErpPosServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/pos/ErpPosServiceImpl.java new file mode 100644 index 0000000..120548e --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/pos/ErpPosServiceImpl.java @@ -0,0 +1,90 @@ +package com.jwsaas.api.service.impl.pos; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.jwsaas.api.request.pos.ErpPosSetRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.pos.ErpPosService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.ErpPosSet; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.service.food.ErpPosSetService; +import com.jwsaas.util.JSONUtil; +import com.jwsaas.utils.AppKeyUtil; + +/** + * ERP Pos设置 + * + * @author Administrator + * + */ +@ServiceMethodBean(version = "1.0") +public class ErpPosServiceImpl extends WopServiceImpl implements ErpPosService { + + private static final long serialVersionUID = -1501863932648156769L; + + private static final String className = "PosServiceImpl"; + + @Resource + private ErpPosSetService erpPosSetService; + + @ServiceMethod(method = "erp.pos.set", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "erpPos设置") + @Override + public Object getPosSet(ErpPosSetRequest request) { + String info = "erpPos设置"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String posNo = request.getPosNo(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("posNo", posNo)); + List list = erpPosSetService.getList(tenantId, criteria); + if (list != null && list.size() > 0) { + ErpPosSet set = list.get(0); + Map data = new HashMap<>(); + data.put("tenantId", set.getTenantId()); + data.put("id", set.getId()); + data.put("storeId", set.getStoreId()); + data.put("posNo", set.getPosNo()); + Map pbodyMap = JSONUtil.parseObject(set.getPbody(), new TypeReference>() { + }); + data.put("pbody", pbodyMap); + response.setStatus(1); + response.setMessage("POS参数获取成功"); + response.setData(data); + } else { + response.setErrMessage(CommonErrorCode.error998.getMessage()); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setStatus(0); + response.setMessage("POS参数未设置"); + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/pos/PosSaleClearServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/pos/PosSaleClearServiceImpl.java new file mode 100644 index 0000000..0ac4343 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/pos/PosSaleClearServiceImpl.java @@ -0,0 +1,252 @@ +package com.jwsaas.api.service.impl.pos; + + +import com.alibaba.fastjson.JSON; +import com.jwsaas.api.request.split.SplitFoodAccountRequest; +import com.jwsaas.api.request.split.SplitShopAccountRequest; +import com.jwsaas.api.request.upload.BusinessOrderUploadRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.DataPageResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.pos.PosSaleClearService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.BusinessOrderUpload; +import com.jwsaas.entity.food.SaleClear; +import com.jwsaas.entity.food.SplitShopAccount; +import com.jwsaas.entity.split.SplitCompanyEntity; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.pager.Pager; +import com.jwsaas.service.food.*; +import com.jwsaas.utils.AppKeyUtil; +import org.apache.commons.lang3.StringUtils; +import org.redisson.api.RBucket; +import org.redisson.api.RedissonClient; + +import javax.annotation.Resource; +import java.util.*; + + +@ServiceMethodBean(version = "1.0") +public class PosSaleClearServiceImpl extends WopServiceImpl implements PosSaleClearService { + + @Resource + private SaleClearService saleClearService; + @Resource + private RedissonClient redissonClient; + + + @ServiceMethod(method = "saleclear.business.upload", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "估清数据上传接口") + @Override + public Object businessSaleClearUpload(BusinessOrderUploadRequest request) { + String info = "估清数据上传接口"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + CommonDataResponse response = null; + String jsonString = request.getJsonString(); + try { + response = new CommonDataResponse(); + SaleClear pay = JSON.parseObject(jsonString, SaleClear.class); + String storeId=pay.getStoreId(); + /***商品Id*/ + String productId=pay.getProductId(); + saleClearService.deleteSaleClearByEndTime(tenantId,pay); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("productId", productId)); + List saleClearList = saleClearService.getList(tenantId, criteria); + if(saleClearList!=null&&saleClearList.size()>0){ + saleClearService.updateSaleClear(tenantId,pay); + response.setMessage("估清数据更新成功"); + }else{ + String createUser=pay.getCreateUser(); + if(StringUtils.isEmpty(createUser)){ + pay.setCreateUser("admin"); + } + saleClearService.save(tenantId,pay); + response.setMessage("估清数据新增成功"); + } + Map data = new HashMap<>(); + data.put("ticketId", new Date().getTime()); + response.setStatus(1); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + logger.error("jsonString:" + jsonString); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "BUSINESS_ORDER_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + /*RBucket bucket = redissonClient.getBucket("user"); + + redissonClient.getBucket()*/ + } + + + @ServiceMethod(method = "saleclear.business.updatekc", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "估清数据上传接口") + @Override + public Object businessSaleClearUploadkc(BusinessOrderUploadRequest request) { + String info = "估清数据修改库存接口"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + CommonDataResponse response = null; + String jsonString = request.getJsonString(); + + try { + response = new CommonDataResponse(); + SaleClear pay = JSON.parseObject(jsonString, SaleClear.class); + /***剩余数量*/ + Double quantity=pay.getQuantity(); + /***类别Id add reduce*/ + String typeId=pay.getTypeId(); + /***门店Id*/ + String storeId=pay.getStoreId(); + /***商品Id*/ + String productId=pay.getProductId(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("productId", productId)); + List saleClearList = saleClearService.getList(tenantId, criteria); + if(saleClearList!=null&&saleClearList.size()>0){ + SaleClear clear=saleClearList.get(0); + Double quantity2=clear.getQuantity(); + if("add".equals(typeId)){ //加 + quantity2=quantity2+quantity; + }else if("reduce".equals(typeId)){ //减 + quantity2=quantity2-quantity2; + } + clear.setQuantity(quantity2); + saleClearService.updateSaleClear(tenantId,clear); + response.setMessage("估清数据更新成功"); + response.setStatus(1); + }else{ + response.setMessage("估清数据更新失败,数据不存在"); + response.setStatus(2); + } + Map data = new HashMap<>(); + data.put("ticketId", new Date().getTime()); + + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + logger.error("jsonString:" + jsonString); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "BUSINESS_ORDER_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + + @ServiceMethod(method = "saleclear.business.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "估清列表接口") + @Override + public Object businessSaleClearList(SplitShopAccountRequest request) { + String info = "估清列表接口"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + String storeId=request.getStoreId(); + DataPageResponse response = null; + try { + SaleClear pay=new SaleClear(); + saleClearService.deleteSaleClearByEndTime(tenantId,pay); + response = new DataPageResponse(); + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("shopId", storeId)); + pager = saleClearService.getPager(tenantId, criteria, pager); + /*Map data = new HashMap<>(); + data.put("date", new Date().getTime());*/ + response.setList(pager.getList()); + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + response.setStatus(0); + //response.setMessage("获取失败"); + response.setErrMessage("获取失败"); + response.setErrCode("TYPE_ERROR"); + //return new BusinessServiceErrorResponse(request.getWopRequestContext(), "TYPE_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "saleclear.business.food", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "估清列表接口") + @Override + public Object businessSaleClearFood(BusinessOrderUploadRequest request) { + String info = "估清商品接口"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + CommonDataResponse response = null; + String jsonString = request.getJsonString(); + try { + response = new CommonDataResponse(); + SaleClear pay = JSON.parseObject(jsonString, SaleClear.class); + String storeId=pay.getStoreId(); + /***商品Id*/ + String productId=pay.getProductId(); + saleClearService.deleteSaleClearByEndTime(tenantId,pay); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("productId", productId)); + List saleClearList = saleClearService.getList(tenantId, criteria); + if(saleClearList!=null&&saleClearList.size()>0){ + Map data=new HashMap<>(); + data.put("SaleClear",saleClearList.get(0)); + response.setData(data); + response.setStatus(1); + response.setMessage("估清数据查询成功"); + }else{ + response.setMessage("估清数据查询失败,数据不存在"); + response.setStatus(0); + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + logger.error("jsonString:" + jsonString); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "BUSINESS_ORDER_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/pos/PosServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/pos/PosServiceImpl.java new file mode 100644 index 0000000..f5140e0 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/pos/PosServiceImpl.java @@ -0,0 +1,1366 @@ +package com.jwsaas.api.service.impl.pos; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +import javax.annotation.Resource; + +import com.jwsaas.api.request.pos.*; +import com.jwsaas.entity.food.*; +import com.jwsaas.service.food.*; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.amqp.rabbit.support.CorrelationData; + +import com.alibaba.fastjson.JSONArray; +import com.jwsaas.Constant; +import com.jwsaas.Constants; +import com.jwsaas.api.entity.pos.PosSetModuleEntity; +import com.jwsaas.api.entity.pos.PosSetResourcesEntity; +import com.jwsaas.api.entity.pos.PosSetShortcutEntity; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.response.mode.CommonListResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.pos.PosService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.config.MQMessageSender; +import com.jwsaas.entity.ops.TenantLineProduct; +import com.jwsaas.entity.ops.TenantPosInfo; +import com.jwsaas.entity.ops.TenantStoreAuth; +import com.jwsaas.entity.ops.UpgradePos; +import com.jwsaas.entity.ops.UpgradeScheme; +import com.jwsaas.entity.ops.UpgradeStore; +import com.jwsaas.entity.shared.AppAuth; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.service.ops.TenantLineProductService; +import com.jwsaas.service.ops.TenantPosInfoService; +import com.jwsaas.service.ops.TenantStoreAuthService; +import com.jwsaas.service.ops.UpgradePosService; +import com.jwsaas.service.ops.UpgradeSchemeService; +import com.jwsaas.service.ops.UpgradeStoreService; +import com.jwsaas.service.shared.AppAuthService; +import com.jwsaas.utils.AppKeyUtil; +import com.jwsaas.utils.DateUtils; + +/** + * 基础服务相关接口 + */ +@ServiceMethodBean(version = "1.0") +public class PosServiceImpl extends WopServiceImpl implements PosService { + + private static final long serialVersionUID = -6606085384358306949L; + + private static final String className = "PosServiceImpl"; + + @Resource + private TenantStoreAuthService tenantStoreAuthService; + @Resource + private PosInfoService posInfoService; + @Resource + private TenantPosInfoService tenantPosInfoService; + @Resource + private PosPollcodeService posPollcodeService; + @Resource + private StoreService storeService; + @Resource + private AppAuthService appAuthService; + @Resource + protected UpgradeSchemeService upgradeSchemeService; + @Resource + protected UpgradeStoreService upgradeStoreService; + @Resource + protected UpgradePosService upgradePosService; + @Resource + private PosSetPlanService posSetPlanService; + @Resource + private PosSetPlanResourcesService posSetPlanResourcesService; + @Resource + private PosSetPlanShortcutService posSetPlanShortcutService; + @Resource + private PosSetPlanModuleService posSetPlanModuleService; + @Resource + private PosSetPlanConfigService posSetPlanConfigService; + @Resource + private TenantLineProductService tenantLineProductService; + @Resource + private MQMessageSender mqMessageSender; + @Resource + private ServerDataVersionService serverDataVersionService; + + @ServiceMethod(method = "pos.register", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "POS注册接口") + @Override + public Object posRegister(PosRegisterRequest request) { + + String info = "POS注册接口"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String pollcode = request.getPollcode(); + String appSign = request.getAppSign(); + String terminalType = request.getTerminalType(); + String name = request.getName();// 计算器名 + String MACAddress = request.getMACAddress(); // MACaddress + String serialNumber = request.getSerialNumber(); // 硬件序列号 + String cpuNumber = request.getCpuNumber(); // CPU序列 + String aliasName = request.getAliasName();// 别名 + + PosPollcode posPollcode = null; + Store store = null; + PosInfo posInfo = null; + TenantPosInfo tenantPosInfo = null; + AppAuth appAuth = null; + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("status", 1)); + criteria.add(Restrictions.eq("tenantCode", tenantId)); + List appAuthlist = appAuthService.getList(Constant.DEFAULT_DB_SIGN, criteria); + if (appAuthlist != null && appAuthlist.size() > 0) { + appAuth = appAuthlist.get(0); + } + if (appAuth == null) { + response.setStatus(0); + response.setMessage(tenantId + "企业编号不存在"); + response.setErrCode(CommonErrorCode.error0.getCode()); + response.setErrMessage(CommonErrorCode.error0.getMessage()); + return response; + } + if ("373001".equals(tenantId) && "888888".equals(pollcode)) { + criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantId", tenantId)); + criteria.add(Restrictions.eq("storeId", "624481659819003904")); + List list = posPollcodeService.getList(tenantId, criteria); + if (list != null) { + posPollcode = list.get(0); + String storeId = posPollcode.getStoreId(); + store = storeService.get(tenantId, storeId); + posInfo = getPosInfo(tenantId, appSign, terminalType, storeId, name, MACAddress, serialNumber, cpuNumber); + if (posInfo != null) { + posInfo.setAppSign(appSign); + posInfo.setTerminalType(terminalType); + posInfo.setAppKey(appAuth.getAppKey()); + posInfo.setAppSecret(appAuth.getAppSecret()); + posInfo.setCpuNumber(cpuNumber); + posInfo.setMACAddress(MACAddress); + posInfo.setName(name); + posInfo.setSerialNumber(serialNumber); + posInfo.setAliasName(aliasName); + posInfo.setModifyDate(new Date()); + posInfo.setModifyUser("open-api"); + posInfoService.update(tenantId, posInfo); + Criteria criteria1 = new Criteria(); + criteria1.add(Restrictions.eq("tenantCode", tenantId)); + criteria1.add(Restrictions.eq("storeId", posInfo.getStoreId())); + criteria1.add(Restrictions.eq("appSign", posInfo.getAppSign())); + criteria1.add(Restrictions.eq("terminalType", posInfo.getTerminalType())); + List tenantPosInfoList = tenantPosInfoService.getList(Constant.DEFAULT_DB_SIGN, criteria1); + if (CollectionUtils.isNotEmpty(tenantPosInfoList)) { + tenantPosInfo = tenantPosInfoList.get(0); + tenantPosInfo.setAppSign(appSign); + tenantPosInfo.setTerminalType(terminalType); + tenantPosInfo.setCpuNumber(cpuNumber); + tenantPosInfo.setMACAddress(MACAddress); + tenantPosInfo.setName(name); + tenantPosInfo.setSerialNumber(serialNumber); + tenantPosInfo.setAliasName(aliasName); + tenantPosInfo.setStoreName(store.getName()); + tenantPosInfo.setModifyDate(new Date()); + tenantPosInfo.setModifyUser("open-api"); + tenantPosInfoService.update(Constant.DEFAULT_DB_SIGN, tenantPosInfo); + } + } else { + String maxNo = posInfoService.getMaxNo(tenantId); + posInfo = new PosInfo(); + posInfo.setAppSign(appSign); + posInfo.setTerminalType(terminalType); + posInfo.setAppKey(appAuth.getAppKey()); + posInfo.setAppSecret(appAuth.getAppSecret()); + posInfo.setCpuNumber(cpuNumber); + posInfo.setCreateDate(new Date()); + posInfo.setCreateUser("open-api"); + posInfo.setDescription("POS注册"); + posInfo.setMACAddress(MACAddress); + posInfo.setName(name); + posInfo.setAliasName(aliasName); + posInfo.setPollCode(pollcode); + String posNo = ""; + if (StringUtils.isEmpty(maxNo)) { + posNo = "00001"; + } else { + posNo = String.format("%05d", Integer.valueOf(maxNo) + 1); + } + posInfo.setPosNo(posNo); + posInfo.setSerialNumber(serialNumber); + posInfo.setStatus(0); + posInfo.setStoreId(storeId); + posInfo.setStoreNo(store.getNo()); + posInfoService.save(tenantId, posInfo); + tenantPosInfo = new TenantPosInfo(); + tenantPosInfo.setAppSign(posInfo.getAppSign()); + tenantPosInfo.setCpuNumber(posInfo.getCpuNumber()); + tenantPosInfo.setCreateDate(posInfo.getCreateDate()); + tenantPosInfo.setCreateUser(posInfo.getCreateUser()); + tenantPosInfo.setDeleteFlag(posInfo.getDeleteFlag()); + tenantPosInfo.setDescription(posInfo.getDescription()); + tenantPosInfo.setMACAddress(posInfo.getMACAddress()); + tenantPosInfo.setName(posInfo.getName()); + tenantPosInfo.setPosNo(posInfo.getPosNo()); + tenantPosInfo.setSerialNumber(posInfo.getSerialNumber()); + tenantPosInfo.setStatus(0); + tenantPosInfo.setStoreId(posInfo.getStoreId()); + tenantPosInfo.setStoreNo(posInfo.getStoreNo()); + tenantPosInfo.setTenantCode(tenantId); + tenantPosInfo.setTenantId(Constant.DEFAULT_DB_SIGN); + tenantPosInfo.setTerminalType(terminalType); + tenantPosInfo.setAliasName(posInfo.getAliasName()); + tenantPosInfo.setStoreName(store.getName()); + tenantPosInfoService.save(Constant.DEFAULT_DB_SIGN, tenantPosInfo); + } + } + } else { + criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantId", tenantId)); + criteria.add(Restrictions.eq("pollCode", pollcode)); + criteria.add(Restrictions.between("createDate", DateUtils.format(new Date(), DateUtils.SHOW_DATE_FORMAT) + " 00:00:00", DateUtils.format(DateUtils.addDay(new Date(), 1), DateUtils.SHOW_DATE_FORMAT) + " 00:00:00")); + List list = posPollcodeService.getList(tenantId, criteria); + if (list != null && list.size() == 1) { + posPollcode = list.get(0); + String storeId = posPollcode.getStoreId(); + store = storeService.get(tenantId, storeId); + posInfo = getPosInfo(tenantId, appSign, terminalType, storeId, name, MACAddress, serialNumber, cpuNumber); + if (posInfo != null) { + posInfo.setAppSign(appSign); + posInfo.setTerminalType(terminalType); + posInfo.setAppKey(appAuth.getAppKey()); + posInfo.setAppSecret(appAuth.getAppSecret()); + posInfo.setCpuNumber(cpuNumber); + posInfo.setMACAddress(MACAddress); + posInfo.setName(name); + posInfo.setSerialNumber(serialNumber); + posInfo.setAliasName(aliasName); + posInfo.setModifyDate(new Date()); + posInfo.setModifyUser("open-api"); + posInfoService.update(tenantId, posInfo); + Criteria criteria1 = new Criteria(); + criteria1.add(Restrictions.eq("tenantCode", tenantId)); + criteria1.add(Restrictions.eq("storeId", posInfo.getStoreId())); + criteria1.add(Restrictions.eq("appSign", posInfo.getAppSign())); + criteria1.add(Restrictions.eq("terminalType", posInfo.getTerminalType())); + List tenantPosInfoList = tenantPosInfoService.getList(Constant.DEFAULT_DB_SIGN, criteria1); + if (CollectionUtils.isNotEmpty(tenantPosInfoList)) { + tenantPosInfo = tenantPosInfoList.get(0); + tenantPosInfo.setAppSign(appSign); + tenantPosInfo.setTerminalType(terminalType); + tenantPosInfo.setCpuNumber(cpuNumber); + tenantPosInfo.setMACAddress(MACAddress); + tenantPosInfo.setName(name); + tenantPosInfo.setSerialNumber(serialNumber); + tenantPosInfo.setAliasName(aliasName); + tenantPosInfo.setStoreName(store.getName()); + tenantPosInfo.setModifyDate(new Date()); + tenantPosInfo.setModifyUser("open-api"); + tenantPosInfoService.update(Constant.DEFAULT_DB_SIGN, tenantPosInfo); + } + } else { + String maxNo = posInfoService.getMaxNo(tenantId); + posInfo = new PosInfo(); + posInfo.setAppSign(appSign); + posInfo.setTerminalType(terminalType); + posInfo.setAppKey(appAuth.getAppKey()); + posInfo.setAppSecret(appAuth.getAppSecret()); + posInfo.setCpuNumber(cpuNumber); + posInfo.setCreateDate(new Date()); + posInfo.setCreateUser("open-api"); + posInfo.setDescription("POS注册"); + posInfo.setMACAddress(MACAddress); + posInfo.setName(name); + posInfo.setAliasName(aliasName); + posInfo.setPollCode(pollcode); + String posNo = ""; + if (StringUtils.isEmpty(maxNo)) { + posNo = "00001"; + } else { + posNo = String.format("%05d", Integer.valueOf(maxNo) + 1); + } + posInfo.setPosNo(posNo); + posInfo.setSerialNumber(serialNumber); + posInfo.setStatus(0); + posInfo.setStoreId(storeId); + posInfo.setStoreNo(store.getNo()); + posInfoService.save(tenantId, posInfo); + tenantPosInfo = new TenantPosInfo(); + tenantPosInfo.setAppSign(posInfo.getAppSign()); + tenantPosInfo.setCpuNumber(posInfo.getCpuNumber()); + tenantPosInfo.setCreateDate(posInfo.getCreateDate()); + tenantPosInfo.setCreateUser(posInfo.getCreateUser()); + tenantPosInfo.setDeleteFlag(posInfo.getDeleteFlag()); + tenantPosInfo.setDescription(posInfo.getDescription()); + tenantPosInfo.setMACAddress(posInfo.getMACAddress()); + tenantPosInfo.setName(posInfo.getName()); + tenantPosInfo.setPosNo(posInfo.getPosNo()); + tenantPosInfo.setSerialNumber(posInfo.getSerialNumber()); + tenantPosInfo.setStatus(0); + tenantPosInfo.setStoreId(posInfo.getStoreId()); + tenantPosInfo.setStoreNo(posInfo.getStoreNo()); + tenantPosInfo.setTenantCode(tenantId); + tenantPosInfo.setTenantId(Constant.DEFAULT_DB_SIGN); + tenantPosInfo.setTerminalType(terminalType); + tenantPosInfo.setAliasName(posInfo.getAliasName()); + tenantPosInfo.setStoreName(store.getName()); + tenantPosInfoService.save(Constant.DEFAULT_DB_SIGN, tenantPosInfo); + } + } + } + + } catch (Exception e) { + logger.error(info + ",发生异常", e); + } + + if (posPollcode == null) { + response.setStatus(0); + response.setMessage(tenantId + "注册码不可用,操作失败"); + response.setErrCode(CommonErrorCode.error1.getCode()); + response.setErrMessage(CommonErrorCode.error1.getMessage()); + return response; + } else { + if (store == null) { + response.setStatus(0); + response.setMessage(tenantId + "注册码对应门店信息不存在,操作失败"); + response.setErrCode(CommonErrorCode.error2.getCode()); + response.setErrMessage(CommonErrorCode.error2.getMessage()); + return response; + } else { + response.setStatus(1); + response.setMessage("POS注册成功"); + Map data = new HashMap<>(); + data.put("storeId", store.getId()); + data.put("storeNo", store.getNo()); + data.put("storeName", store.getName()); + data.put("posId", posInfo.getId()); + data.put("posNo", posInfo.getPosNo()); + data.put("posAliasName", posInfo.getAliasName()); + response.setData(data); + return response; + } + } + } + + public PosInfo getPosInfo(String tenantId, String appSign, String terminalType, String storeId, String name, String MACAddress, String serialNumber, String cpuNumber) throws Exception { + PosInfo posInfo = null; + // 生成POS编号 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantId", tenantId)); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("appSign", appSign)); + criteria.add(Restrictions.eq("terminalType", terminalType)); + List infoList = posInfoService.getList(tenantId, criteria); + for (int i = 0; i < infoList.size(); i++) { + PosInfo posMessage = infoList.get(i); + int j = 0; + String cN = posMessage.getCpuNumber(); + String sN = posMessage.getSerialNumber(); + String mac = posMessage.getMACAddress(); + String dname = posMessage.getName(); + boolean flag1 = name.equals(dname); + if (flag1) { + j = j + 1; + } + boolean flag2 = false; + String[] macAddress = MACAddress.split(","); + for (int k = 0; k < macAddress.length; k++) { + if (mac.indexOf(macAddress[k]) >= 0) { + flag2 = true; + break; + } + } + if (flag2) { + j = j + 1; + } + boolean flag3 = serialNumber.equals(sN); + if (flag3) { + j = j + 1; + } + boolean flag4 = cpuNumber.equals(cN); + if (flag4) { + j = j + 1; + } + if (j >= 3) { + // 证明POS已经注册过了 + posInfo = posMessage; + break; + } + } + return posInfo; + } + + @ServiceMethod(method = "pos.monitor", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "POS监控") + @Override + public Object posMonitor(PosMonitorRequest request) { + String info = "POS监控"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String posNo = request.getPosNo(); + String os = request.getOs();// 操作系统 + String osType = request.getOsType();// 操作系统类型(32-32位;64-64位;) + String softwareVersion = request.getSoftwareVersion();// 软件版本 + int memoryTotalSize = request.getMemoryTotalSize();// 总内存 + int memoryFreeSize = request.getMemoryFreeSize();// 剩余内存 + String diskName = request.getDiskName();// 工作盘盘符 + int diskTotalSize = request.getDiskTotalSize();// 工作盘磁盘空间 + int diskFreeSize = request.getDiskFreeSize();// 工作盘磁盘剩余空间 + int cpuSize = request.getCpuSize();// 处理器数量 + // String extend = request.getExtend();// 扩展信息 + String extend = null; + String storeName = request.getStoreName();// 门店名称 + String aliasName = request.getAliasName();// POS别名 + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + // 5次上传一次 + int random = (int) (Math.random() * 10 + 1); + if (random < 10) { + response.setStatus(1); + response.setMessage("操作成功"); + Map data = new HashMap<>(); + response.setData(data); + return response; + } + if (StringUtils.isBlank(storeId)) { + response.setStatus(0); + response.setMessage("参数storeId不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (StringUtils.isBlank(posNo)) { + response.setStatus(0); + response.setMessage("参数posNo不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + // POS监控信息处理事件 + // Map eventData = new HashMap<>(); + // eventData.put("appKey", appKey); + // eventData.put("appId", appId); + // eventData.put("tenantCode", tenantCode); + // eventData.put("appCode", appCode); + // eventData.put("tenantId", tenantId); + // eventData.put("storeId", storeId); + // eventData.put("posNo", posNo); + // eventData.put("os", os); + // eventData.put("osType", osType); + // eventData.put("softwareVersion", softwareVersion); + // eventData.put("memoryTotalSize", memoryTotalSize); + // eventData.put("memoryFreeSize", memoryFreeSize); + // eventData.put("diskName", diskName); + // eventData.put("diskTotalSize", diskTotalSize); + // eventData.put("diskFreeSize", diskFreeSize); + // eventData.put("cpuSize", cpuSize); + // eventData.put("extend", extend); + // eventData.put("storeName", storeName); + // eventData.put("aliasName", aliasName); + // eventBus.notify(EventKeys.POS_MONITOR, Event.wrap(eventData)); + // String tenantId = eventData.get("tenantId").toString(); + // String storeId = eventData.get("storeId").toString(); + // String posNo = eventData.get("posNo").toString(); + // String os = eventData.get("os").toString();// 操作系统 + // String osType = eventData.get("osType").toString();// + // 操作系统类型(32-32位;64-64位;) + // String softwareVersion = + // eventData.get("softwareVersion").toString();// 软件版本 + // int memoryTotalSize = (int) eventData.get("memoryTotalSize");// + // 总内存 + // int memoryFreeSize = (int) eventData.get("memoryFreeSize");// + // 剩余内存 + // String diskName = eventData.get("diskName") == null ? null : + // eventData.get("diskName").toString();// 工作盘盘符 + // int diskTotalSize = (int) eventData.get("diskTotalSize");// + // 工作盘磁盘空间 + // int diskFreeSize = (int) eventData.get("diskFreeSize");// + // 工作盘磁盘剩余空间 + // int cpuSize = (int) eventData.get("cpuSize");// 处理器数量 + // String extend = eventData.get("extend") == null ? null : + // eventData.get("extend").toString();// 扩展信息 + // String storeName = eventData.get("storeName") == null ? null : + // eventData.get("storeName").toString();// 门店名称 + // String aliasName = eventData.get("aliasName") == null ? null : + // eventData.get("aliasName").toString();// POS别名 + logger.debug("tenantId:" + tenantId); + logger.debug("storeId:" + storeId); + logger.debug("posNo:" + posNo); + logger.debug("os:" + os); + logger.debug("osType:" + osType); + logger.debug("softwareVersion:" + softwareVersion); + logger.debug("memoryTotalSize:" + memoryTotalSize); + logger.debug("memoryFreeSize:" + memoryFreeSize); + logger.debug("diskName:" + diskName); + logger.debug("diskTotalSize:" + diskTotalSize); + logger.debug("diskFreeSize:" + diskFreeSize); + logger.debug("cpuSize:" + cpuSize); + Date currentDate = new Date(); + TenantPosInfo tenantPosInfo = new TenantPosInfo(); + tenantPosInfo.setStoreId(storeId); + tenantPosInfo.setPosNo(posNo); + tenantPosInfo.setOs(os);// 操作系统 + tenantPosInfo.setOsType(osType);// 操作系统类型(32-32位;64-64位;) + tenantPosInfo.setSoftwareVersion(softwareVersion);// 软件版本 + tenantPosInfo.setMemoryTotalSize(memoryTotalSize); + tenantPosInfo.setMemoryFreeSize(memoryFreeSize); + tenantPosInfo.setDiskName(diskName); + tenantPosInfo.setDiskTotalSize(diskTotalSize); + tenantPosInfo.setDiskFreeSize(diskFreeSize); + tenantPosInfo.setCpuSize(cpuSize); + tenantPosInfo.setExtend(extend);// 扩展信息 + tenantPosInfo.setMonitorDate(currentDate); + tenantPosInfo.setLastActiveDate(currentDate); + tenantPosInfo.setStoreName(storeName); + tenantPosInfo.setAliasName(aliasName); + tenantPosInfo.setModifyDate(currentDate); + tenantPosInfo.setModifyUser(Constant.CREATE_USER); + try { + // 放入消息队列 + Map message = new HashMap<>(); + message.put("type", "posmonitor"); + message.put("tenantPosInfo", tenantPosInfo); + CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString()); + this.mqMessageSender.send4posmonitor(tenantId, message, correlationData); + } catch (Exception ex) { + logger.error("Pos监控信息放入消息队列时发生异常", ex); + } + response.setStatus(1); + response.setMessage("操作成功"); + Map data = new HashMap<>(); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + + + @ServiceMethod(method = "pos.register.v1tov2", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "POS注册接口(V1升级V2)") + @Override + public Object posRegisterV1ToV2(PosRegisterV1ToV2Request request) { + String info = "POS注册接口(V1升级V2)"; + logger.debug(info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId();// V2门店ID + String tenantId4V1 = request.getTenantId4V1();// V1企业编号 + String storeNo4V1 = request.getStoreNo4V1();// V1门店编号 + String storeName4V1 = request.getStoreName4V1();// V1门店名称 + String posNo4V1 = request.getPosNo4V1();// V1POS编号 + + String pollcode = request.getPollcode(); + String appSign = request.getAppSign(); + String terminalType = request.getTerminalType(); + String name = request.getName();// 计算器名 + String MACAddress = request.getMACAddress(); // MACaddress + String serialNumber = request.getSerialNumber(); // 硬件序列号 + String cpuNumber = request.getCpuNumber(); // CPU序列 + String aliasName = request.getAliasName();// 别名 + + Store store = null; + PosInfo posInfo = null; + TenantPosInfo tenantPosInfo = null; + AppAuth appAuth = null; + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + if (StringUtils.isBlank(pollcode)) { + response.setStatus(0); + response.setMessage("参数pollcode不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else if (!StringUtils.equals("autov1tov2", pollcode)) { + response.setStatus(0); + response.setMessage("注册码不可用,操作失败"); + response.setErrCode(CommonErrorCode.error1.getCode()); + response.setErrMessage(CommonErrorCode.error1.getMessage()); + return response; + } + + if (StringUtils.isBlank(storeId)) {// V2门店ID + response.setStatus(0); + response.setMessage("参数storeId不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (StringUtils.isBlank(tenantId4V1)) {// V1企业编号 + response.setStatus(0); + response.setMessage("参数tenantId4V1不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (StringUtils.isBlank(storeNo4V1)) {// V1门店编号 + response.setStatus(0); + response.setMessage("参数storeNo4V1不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (StringUtils.isBlank(storeName4V1)) {// V1门店名称 + response.setStatus(0); + response.setMessage("参数storeName4V1不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (StringUtils.isBlank(posNo4V1)) {// V1POS编号 + response.setStatus(0); + response.setMessage("参数posNo4V1不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + // 校验升级信息 + // 根据V1企业号获取V2企业号 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("appSign", Constants.APP_TYPE_SIGN));// 应用标识 + criteria.add(Restrictions.eq("oldTenantCode", tenantId4V1)); + List schemeList = upgradeSchemeService.getList(Constant.DEFAULT_DB_SIGN, criteria); + UpgradeScheme upgradeScheme = null; + if (CollectionUtils.isEmpty(schemeList)) { + response.setStatus(0); + response.setMessage(tenantId4V1 + "对应的升级方案不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + upgradeScheme = schemeList.get(0); + if (upgradeScheme.getStatus() == 0) { + response.setStatus(0); + response.setMessage(tenantId4V1 + "没有可用的升级方案"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (!StringUtils.equals(tenantId, upgradeScheme.getTenantCode())) { + response.setStatus(0); + response.setMessage(tenantId4V1 + "对应的新租户信息不一致"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + // 根据V1门店号获取V2门店号 + criteria = new Criteria(); + criteria.add(Restrictions.eq("appSign", Constants.APP_TYPE_SIGN));// 应用标识 + criteria.add(Restrictions.eq("schemeId", upgradeScheme.getId()));// 升级方案ID + criteria.add(Restrictions.eq("oldStoreNo", storeNo4V1));// 旧门店编号 + List storeList = upgradeStoreService.getList(Constant.DEFAULT_DB_SIGN, criteria); + if (CollectionUtils.isEmpty(storeList)) { + response.setStatus(0); + response.setMessage("门店[" + storeNo4V1 + "]对应的新门店不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + UpgradeStore upgradeStore = storeList.get(0); + if (upgradeStore.getStatus() == 0) { + response.setStatus(0); + response.setMessage("门店[" + storeNo4V1 + "]没有可用的升级信息"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + // 查看授权信息 + criteria = new Criteria(); + criteria.add(Restrictions.eq("status", 1)); + criteria.add(Restrictions.eq("tenantCode", tenantId)); + List appAuthlist = appAuthService.getList(Constant.DEFAULT_DB_SIGN, criteria); + if (appAuthlist != null && appAuthlist.size() > 0) { + appAuth = appAuthlist.get(0); + } + if (appAuth == null) { + response.setStatus(0); + response.setMessage(tenantId + "企业编号不存在"); + response.setErrCode(CommonErrorCode.error0.getCode()); + response.setErrMessage(CommonErrorCode.error0.getMessage()); + return response; + } + + store = storeService.get(tenantId, storeId); + if (store == null) { + response.setStatus(0); + response.setMessage(tenantId + "注册码对应门店信息不存在,操作失败"); + response.setErrCode(CommonErrorCode.error2.getCode()); + response.setErrMessage(CommonErrorCode.error2.getMessage()); + return response; + } + if (!StringUtils.equals(store.getNo(), upgradeStore.getStoreNo())) { + response.setStatus(0); + response.setMessage("门店[" + storeNo4V1 + "]对应的新门店信息不一致"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + posInfo = getPosInfo(tenantId, appSign, terminalType, storeId, name, MACAddress, serialNumber, cpuNumber); + if (posInfo != null) { + posInfo.setAppSign(appSign); + posInfo.setTerminalType(terminalType); + posInfo.setAppKey(appAuth.getAppKey()); + posInfo.setAppSecret(appAuth.getAppSecret()); + posInfo.setCpuNumber(cpuNumber); + posInfo.setMACAddress(MACAddress); + posInfo.setName(name); + posInfo.setSerialNumber(serialNumber); + posInfo.setAliasName(aliasName); + posInfo.setModifyDate(new Date()); + posInfo.setModifyUser("open-api"); + posInfoService.update(tenantId, posInfo); + Criteria criteria1 = new Criteria(); + criteria1.add(Restrictions.eq("tenantCode", tenantId)); + criteria1.add(Restrictions.eq("storeId", posInfo.getStoreId())); + criteria1.add(Restrictions.eq("appSign", posInfo.getAppSign())); + criteria1.add(Restrictions.eq("terminalType", posInfo.getTerminalType())); + List tenantPosInfoList = tenantPosInfoService.getList(Constant.DEFAULT_DB_SIGN, criteria1); + if (CollectionUtils.isNotEmpty(tenantPosInfoList)) { + tenantPosInfo = tenantPosInfoList.get(0); + tenantPosInfo.setAppSign(appSign); + tenantPosInfo.setTerminalType(terminalType); + tenantPosInfo.setCpuNumber(cpuNumber); + tenantPosInfo.setMACAddress(MACAddress); + tenantPosInfo.setName(name); + tenantPosInfo.setSerialNumber(serialNumber); + tenantPosInfo.setAliasName(aliasName); + tenantPosInfo.setStoreName(store.getName()); + tenantPosInfo.setModifyDate(new Date()); + tenantPosInfo.setModifyUser("open-api"); + tenantPosInfoService.update(Constant.DEFAULT_DB_SIGN, tenantPosInfo); + } + } else { + String maxNo = posInfoService.getMaxNo(tenantId); + posInfo = new PosInfo(); + posInfo.setAppSign(appSign); + posInfo.setTerminalType(terminalType); + posInfo.setAppKey(appAuth.getAppKey()); + posInfo.setAppSecret(appAuth.getAppSecret()); + posInfo.setCpuNumber(cpuNumber); + posInfo.setCreateDate(new Date()); + posInfo.setCreateUser("open-api"); + posInfo.setDescription("POS注册"); + posInfo.setMACAddress(MACAddress); + posInfo.setName(name); + posInfo.setAliasName(aliasName); + posInfo.setPollCode(pollcode); + String posNo = ""; + if (StringUtils.isEmpty(maxNo)) { + posNo = "00001"; + } else { + posNo = String.format("%05d", Integer.valueOf(maxNo) + 1); + } + posInfo.setPosNo(posNo); + posInfo.setSerialNumber(serialNumber); + posInfo.setStatus(0); + posInfo.setStoreId(storeId); + posInfo.setStoreNo(store.getNo()); + posInfoService.save(tenantId, posInfo); + tenantPosInfo = new TenantPosInfo(); + tenantPosInfo.setAppSign(posInfo.getAppSign()); + tenantPosInfo.setCpuNumber(posInfo.getCpuNumber()); + tenantPosInfo.setCreateDate(posInfo.getCreateDate()); + tenantPosInfo.setCreateUser(posInfo.getCreateUser()); + tenantPosInfo.setDeleteFlag(posInfo.getDeleteFlag()); + tenantPosInfo.setDescription(posInfo.getDescription()); + tenantPosInfo.setMACAddress(posInfo.getMACAddress()); + tenantPosInfo.setName(posInfo.getName()); + tenantPosInfo.setPosNo(posInfo.getPosNo()); + tenantPosInfo.setSerialNumber(posInfo.getSerialNumber()); + tenantPosInfo.setStatus(0); + tenantPosInfo.setStoreId(posInfo.getStoreId()); + tenantPosInfo.setStoreNo(posInfo.getStoreNo()); + tenantPosInfo.setTenantCode(tenantId); + tenantPosInfo.setTenantId(Constant.DEFAULT_DB_SIGN); + tenantPosInfo.setTerminalType(terminalType); + tenantPosInfo.setAliasName(posInfo.getAliasName()); + tenantPosInfo.setStoreName(store.getName()); + tenantPosInfoService.save(Constant.DEFAULT_DB_SIGN, tenantPosInfo); + } + + UpgradePos upgradePos = new UpgradePos(); + upgradePos.setAppSign(upgradeScheme.getAppSign()); + upgradePos.setSchemeId(upgradeScheme.getId()); + upgradePos.setTenantCode(tenantCode);// 企业编码 + upgradePos.setOldTenantCode(tenantId4V1);// 旧企业编码 + upgradePos.setStoreNo(store.getNo());// 门店编号 + upgradePos.setStoreName(store.getName());// 门店名称 + upgradePos.setOldStoreNo(storeNo4V1);// 旧门店编号 + upgradePos.setOldStoreName(storeName4V1);// 旧门店名称 + upgradePos.setPosNo(posInfo.getPosNo());// POS编号 + upgradePos.setOldPosNo(posNo4V1);// 旧POS编号 + upgradePos.setDescription("自动升级"); + upgradePos.setCreateUser("open-api"); + upgradePosService.save(Constant.DEFAULT_DB_SIGN, upgradePos); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + } + + if (store == null) { + response.setStatus(0); + response.setMessage(tenantId + "注册码对应门店信息不存在,操作失败"); + response.setErrCode(CommonErrorCode.error2.getCode()); + response.setErrMessage(CommonErrorCode.error2.getMessage()); + return response; + } else { + response.setStatus(1); + response.setMessage("POS注册成功"); + Map data = new HashMap<>(); + data.put("storeId", store.getId()); + data.put("storeNo", store.getNo()); + data.put("storeName", store.getName()); + data.put("posId", posInfo.getId()); + data.put("posNo", posInfo.getPosNo()); + data.put("posAliasName", posInfo.getAliasName()); + response.setData(data); + return response; + } + } + + @ServiceMethod(method = "pos.auth", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "POS校验接口") + @Override + public Object posAuth(PosAuthRequest request) { + String info = "POS校验接口"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String posNo = request.getPosNo(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("tenantCode", tenantId)); + criteria.add(Restrictions.eq("appSign", "cy2")); + List storeAuthList = tenantStoreAuthService.getList(Constants.DEFAULT_DB_SIGN, criteria); + if (storeAuthList != null && storeAuthList.size() > 0) { + TenantStoreAuth tenantStoreAuth = storeAuthList.get(0); + int costMode = tenantStoreAuth.getCostMode();// 计费模式 + String dueDate = tenantStoreAuth.getDueDate();// 到期时间 + Map data = new HashMap<>(); + data.put("costMode", costMode);// 计费模式 + data.put("dueDate", dueDate);// 到期时间 + if (costMode == 0) { + if (dueDate == null) { + data.put("authDays", -1);// 剩余天数 + } else { + // 租赁模式计算一下距离到期时间 + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date date2 = format.parse(dueDate); + int authDays = differentDaysByMillisecond(new Date(), date2); + data.put("authDays", authDays);// 剩余天数 + } + } else { + data.put("authDays", -1);// 剩余天数 + } + response.setStatus(1); + response.setMessage("POS校验成功"); + response.setData(data); + } else { + response.setErrMessage(CommonErrorCode.error3.getMessage()); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setStatus(0); + response.setMessage("门店授权信息不存在"); + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + public String formatYMD(Date date) { + String sDateTime = null; + try { + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); + sDateTime = df.format(date); + } catch (Exception e) { + } + return sDateTime; + } + + /** + * 通过时间秒毫秒数判断两个时间的间隔 + * + * @param date1 + * @param date2 + * @return + */ + public int differentDaysByMillisecond(Date date1, Date date2) { + int days = (int) ((date2.getTime() - date1.getTime()) / (1000 * 3600 * 24)); + return days; + } + + @ServiceMethod(method = "pos.setplan.up", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "POS参数方案上传") + @Override + public Object posSetPlanUp(PosSetPlanUpRequest request) { + String info = "POS参数方案上传"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String planId = request.getPlanId(); + String resources = request.getResources(); + String shortcut = request.getShortcut(); + String module = request.getModule(); + String config = request.getConfig(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + PosSetPlan posSetPlan = posSetPlanService.get(tenantId, planId); + if (posSetPlan == null) { + response.setStatus(0); + response.setMessage("方案不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + List resourcesList = new ArrayList<>(); + if (resources != null && !"".equals(resources)) { + JSONArray jsonResources = new JSONArray().parseArray(resources); + for (int i = 0; i < jsonResources.size(); i++) { + // 前台资源 + PosSetResourcesEntity resourcesEntity = new PosSetResourcesEntity(jsonResources.getJSONObject(i)); + PosSetPlanResources posSetResources = new PosSetPlanResources(); + posSetResources.setTenantId(tenantId); + posSetResources.setPlanId(planId); + posSetResources.setClientId(resourcesEntity.getId()); + posSetResources.setGroup(resourcesEntity.getGroup()); + posSetResources.setName(resourcesEntity.getName()); + posSetResources.setKeycode(resourcesEntity.getKeycode()); + posSetResources.setKeydata(resourcesEntity.getKeydata()); + posSetResources.setEnable(resourcesEntity.getEnable()); + posSetResources.setPermission(resourcesEntity.getPermission()); + posSetResources.setCreateDate(new Date()); + posSetResources.setCreateUser("open-api"); + resourcesList.add(posSetResources); + } + } + + List shortcutList = new ArrayList<>(); + if (shortcut != null && !"".equals(shortcut)) { + JSONArray jsonShortcut = new JSONArray().parseArray(shortcut); + for (int i = 0; i < jsonShortcut.size(); i++) { + // 前台功能区 + PosSetShortcutEntity posSetShortcutEntity = new PosSetShortcutEntity(jsonShortcut.getJSONObject(i)); + PosSetPlanShortcut posSetShortcut = new PosSetPlanShortcut(); + posSetShortcut.setTenantId(tenantId); + posSetShortcut.setPlanId(planId); + posSetShortcut.setClientId(posSetShortcutEntity.getId()); + posSetShortcut.setArea(posSetShortcutEntity.getArea()); + posSetShortcut.setParentId(posSetShortcutEntity.getParentId()); + posSetShortcut.setName(posSetShortcutEntity.getName()); + posSetShortcut.setAlias(posSetShortcutEntity.getAlias()); + posSetShortcut.setKeycode(posSetShortcutEntity.getKeycode()); + posSetShortcut.setKeydata(posSetShortcutEntity.getKeydata()); + posSetShortcut.setColor1(posSetShortcutEntity.getColor1()); + posSetShortcut.setColor2(posSetShortcutEntity.getColor2()); + posSetShortcut.setColor3(posSetShortcutEntity.getColor3()); + posSetShortcut.setFontSize(posSetShortcutEntity.getFontSize()); + posSetShortcut.setShortcut(posSetShortcutEntity.getShortcut()); + posSetShortcut.setOrderNo(posSetShortcutEntity.getOrderNo()); + posSetShortcut.setIcon(posSetShortcutEntity.getIcon()); + posSetShortcut.setEnable(posSetShortcutEntity.getEnable()); + posSetShortcut.setResourceId(posSetShortcutEntity.getResourceId()); + posSetShortcut.setCreateDate(new Date()); + posSetShortcut.setCreateUser("open-api"); + shortcutList.add(posSetShortcut); + } + } + List moduleList = new ArrayList<>(); + if (module != null && !"".equals(module)) { + JSONArray jsonModule = new JSONArray().parseArray(module); + for (int i = 0; i < jsonModule.size(); i++) { + // 前台功能区 + PosSetModuleEntity posSetModuleEntity = new PosSetModuleEntity(jsonModule.getJSONObject(i)); + PosSetPlanModule posSetModule = new PosSetPlanModule(); + posSetModule.setTenantId(tenantId); + posSetModule.setPlanId(planId); + posSetModule.setClientId(posSetModuleEntity.getId()); + posSetModule.setArea(posSetModuleEntity.getArea()); + posSetModule.setParentId(posSetModuleEntity.getParentId()); + posSetModule.setName(posSetModuleEntity.getName()); + posSetModule.setAlias(posSetModuleEntity.getAlias()); + posSetModule.setKeycode(posSetModuleEntity.getKeycode()); + posSetModule.setKeydata(posSetModuleEntity.getKeydata()); + posSetModule.setColor1(posSetModuleEntity.getColor1()); + posSetModule.setColor2(posSetModuleEntity.getColor2()); + posSetModule.setColor3(posSetModuleEntity.getColor3()); + posSetModule.setFontSize(posSetModuleEntity.getFontSize()); + posSetModule.setShortcut(posSetModuleEntity.getShortcut()); + posSetModule.setOrderNo(posSetModuleEntity.getOrderNo()); + posSetModule.setIcon(posSetModuleEntity.getIcon()); + posSetModule.setEnable(posSetModuleEntity.getEnable()); + posSetModule.setResourceId(posSetModuleEntity.getResourceId()); + posSetModule.setLayout(posSetModuleEntity.getLayout()); + posSetModule.setCreateDate(new Date()); + posSetModule.setCreateUser("open-api"); + moduleList.add(posSetModule); + } + } + List configList = new ArrayList<>(); + // if (config != null && !"".equals(config)) { + // JSONArray jsonConfig = new JSONArray().parseArray(config); + // for (int i = 0; i < jsonConfig.size(); i++) { + // // 前台功能区 + // PosSetConfigEntity posSetConfigEntity = new + // PosSetConfigEntity(jsonConfig.getJSONObject(i)); + // PosSetPlanConfig posSetConfig = new PosSetPlanConfig(); + // posSetConfig.setTenantId(tenantId); + // posSetConfig.setPlanId(planId); + // posSetConfig.setClientId(posSetConfigEntity.getId()); + // posSetConfig.setGroup(posSetConfigEntity.getGroup()); + // posSetConfig.setKeys(posSetConfigEntity.getKeys()); + // posSetConfig.setValues(posSetConfigEntity.getValues()); + // posSetConfig.setCreateDate(new Date()); + // posSetConfig.setCreateUser("open-api"); + // configList.add(posSetConfig); + // } + // } + posSetPlanService.savePlanDetail(tenantId, planId, resourcesList, shortcutList, moduleList, configList); + response.setStatus(1); + response.setMessage("上传成功"); + Map data = new HashMap<>(); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "pos.setplan.down", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "POS参数方案下载") + @Override + public Object posSetPlanDown(PosSetPlanDownRequest request) { + String info = "POS参数方案下载"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String terminalType = request.getTerminalType(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + List> resourcesMap = new ArrayList<>(); + List> shortcutMap = new ArrayList<>(); + List> moduleMap = new ArrayList<>(); + List planIds = posSetPlanService.getPlanIdsByStoreId(tenantId, storeId); + if (planIds == null || planIds.size() <= 0) { + response.setStatus(1); + response.setMessage("POS参数方案不存在"); + Map data = new HashMap<>(); + data.put("resources", resourcesMap); + data.put("shortcut", shortcutMap); + data.put("module", moduleMap); + response.setData(data); + return response; + } + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantId", tenantId)); + criteria.add(Restrictions.in("id", planIds)); + criteria.add(Restrictions.eq("terminalType", terminalType)); + criteria.add(Restrictions.eq("enable", 1)); + List posSetPlanList = posSetPlanService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(posSetPlanList)) { + response.setStatus(1); + response.setMessage("POS参数方案不存在"); + Map data = new HashMap<>(); + data.put("resources", resourcesMap); + data.put("shortcut", shortcutMap); + data.put("module", moduleMap); + response.setData(data); + return response; + } + if (posSetPlanList.size() > 1) { + response.setStatus(1); + response.setMessage("存在多个方案"); + Map data = new HashMap<>(); + data.put("resources", resourcesMap); + data.put("shortcut", shortcutMap); + data.put("module", moduleMap); + response.setData(data); + return response; + } + PosSetPlan posSetPlan = posSetPlanList.get(0); + criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantId", tenantId)); + criteria.add(Restrictions.eq("planId", posSetPlan.getId())); + List resources = posSetPlanResourcesService.getList(tenantId, criteria); + + for (PosSetPlanResources posSetResources : resources) { + Map map = new HashMap<>(); + map.put("id", posSetResources.getClientId()); + map.put("tenantId", posSetResources.getTenantId()); + map.put("group", posSetResources.getGroup()); + map.put("name", posSetResources.getName()); + map.put("keycode", posSetResources.getKeycode()); + map.put("keydata", posSetResources.getKeydata()); + map.put("enable", posSetResources.getEnable()); + map.put("permission", posSetResources.getPermission()); + resourcesMap.add(map); + } + List shortcut = posSetPlanShortcutService.getList(tenantId, criteria); + + for (PosSetPlanShortcut posSetShortcut : shortcut) { + Map map = new HashMap<>(); + map.put("id", posSetShortcut.getClientId()); + map.put("tenantId", posSetShortcut.getTenantId()); + map.put("area", posSetShortcut.getArea()); + map.put("parentId", posSetShortcut.getParentId()); + map.put("name", posSetShortcut.getName()); + map.put("alias", posSetShortcut.getAlias()); + map.put("keycode", posSetShortcut.getKeycode()); + map.put("keydata", posSetShortcut.getKeydata()); + map.put("color1", posSetShortcut.getColor1()); + map.put("color2", posSetShortcut.getColor2()); + map.put("color3", posSetShortcut.getColor3()); + map.put("fontSize", posSetShortcut.getFontSize()); + map.put("shortcut", posSetShortcut.getShortcut()); + map.put("orderNo", posSetShortcut.getOrderNo()); + map.put("icon", posSetShortcut.getIcon()); + map.put("enable", posSetShortcut.getEnable()); + map.put("resourceId", posSetShortcut.getResourceId()); + shortcutMap.add(map); + } + List module = posSetPlanModuleService.getList(tenantId, criteria); + + for (PosSetPlanModule posSetModule : module) { + Map map = new HashMap<>(); + map.put("id", posSetModule.getClientId()); + map.put("tenantId", posSetModule.getTenantId()); + map.put("area", posSetModule.getArea()); + map.put("parentId", posSetModule.getParentId()); + map.put("name", posSetModule.getName()); + map.put("alias", posSetModule.getAlias()); + map.put("keycode", posSetModule.getKeycode()); + map.put("keydata", posSetModule.getKeydata()); + map.put("color1", posSetModule.getColor1()); + map.put("color2", posSetModule.getColor2()); + map.put("color3", posSetModule.getColor3()); + map.put("fontSize", posSetModule.getFontSize()); + map.put("shortcut", posSetModule.getShortcut()); + map.put("orderNo", posSetModule.getOrderNo()); + map.put("icon", posSetModule.getIcon()); + map.put("resourceId", posSetModule.getResourceId()); + map.put("enable", posSetModule.getEnable()); + map.put("layout", posSetModule.getLayout()); + moduleMap.add(map); + } + // 下载完毕删除门店关联 + posSetPlanService.deletePlanAndStoreId(tenantId, storeId, posSetPlan.getId()); + response.setStatus(1); + response.setMessage("下载成功"); + Map data = new HashMap<>(); + data.put("resources", resourcesMap); + data.put("shortcut", shortcutMap); + data.put("module", moduleMap); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "tenant.line.auth", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "云端产品时间校验") + @Override + public Object TenantLineAuth(TenantLineAuthRequest request) { + String info = "云端产品时间校验"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String productSign = request.getProductSign(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("code", tenantId)); + criteria.add(Restrictions.eq("productSign", productSign)); + List lineProduct = tenantLineProductService.getList(Constants.DEFAULT_DB_SIGN, criteria); + if (lineProduct != null && lineProduct.size() > 0) { + TenantLineProduct tenantLineProduct = lineProduct.get(0); + int costMode = tenantLineProduct.getCostMode();// 计费模式 + String dueDate = tenantLineProduct.getDueDate();// 到期时间 + Map data = new HashMap<>(); + data.put("costMode", costMode);// 计费模式 + data.put("dueDate", dueDate);// 到期时间 + if (costMode == 0) { + if (dueDate == null) { + data.put("authDays", -1);// 剩余天数 + } else { + // 租赁模式计算一下距离到期时间 + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); + Date date2 = format.parse(dueDate); + int authDays = differentDaysByMillisecond(new Date(), date2); + data.put("authDays", authDays);// 剩余天数 + } + } else { + data.put("authDays", -1);// 剩余天数 + } + response.setStatus(1); + response.setMessage("企业权限获取成功"); + response.setData(data); + } else { + response.setErrMessage(CommonErrorCode.error3.getMessage()); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setStatus(0); + response.setMessage("企业权限不存在"); + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "pos.setplan", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "POS参数方案") + @Override + public Object posSetPlan(PosSetPlanRequest request) { + String info = "POS参数方案"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String terminalType = request.getTerminalType(); + CommonListResponse response = null; + try { + response = new CommonListResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("terminalType", terminalType)); + criteria.add(Restrictions.eq("enable", 1)); + List source = posSetPlanService.getList(tenantId, criteria); + List> list = new ArrayList<>(); + for (PosSetPlan posSetPlan : source) { + Map map = new HashMap<>(); + map.put("tenantId", posSetPlan.getTenantId()); + map.put("id", posSetPlan.getId()); + map.put("name", posSetPlan.getName()); + map.put("description", posSetPlan.getDescription()); + list.add(map); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + + @ServiceMethod(method = "pos.serverdataversion.down", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "服务数据版本信息对比") + @Override + public Object serverDataVersionComparison(ServerDataVersionRequest request) { + String info = "服务数据版本信息对比"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + CommonListResponse response = null; + try { + response = new CommonListResponse(); + Criteria criteria = new Criteria(); + List versions = serverDataVersionService.getList(tenantId, criteria); + List> list = new ArrayList<>(); + + if (versions != null && versions.size() > 0) { + versions.forEach(version -> { + Map map = new HashMap<>(); + map.put("dataType",version.getDataType()); + map.put("dataVersion",version.getDataVerion()); + map.put("ext1",version.getExt1()); + map.put("ext2",version.getExt2()); + map.put("ext3",version.getExt3()); + list.add(map); + }); +// for(ServerDataVersion version : versions){ +// Map map = new HashMap<>(); +// map.put("dataType",version.getDataType()); +// map.put("dataVersion",version.getDataVerion()); +// map.put("ext1",version.getExt1()); +// map.put("ext2",version.getExt2()); +// map.put("ext3",version.getExt3()); +// list.add(map); +// } + response.setStatus(1); + response.setMessage("服务数据版本信息获取成功"); + response.setList(list); + } else { + response.setErrMessage(CommonErrorCode.error998.getMessage()); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setStatus(0); + response.setMessage("服务数据版本信息不存在"); + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/product/ProductServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/product/ProductServiceImpl.java new file mode 100644 index 0000000..6e33b34 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/product/ProductServiceImpl.java @@ -0,0 +1,1093 @@ +package com.jwsaas.api.service.impl.product; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; + +import com.alibaba.fastjson.JSON; +import com.jwsaas.api.request.product.MakeBurdenRequest; +import com.jwsaas.api.request.product.ProductBrandRequest; +import com.jwsaas.api.request.product.ProductBurdenRequest; +import com.jwsaas.api.request.product.ProductImageRequest; +import com.jwsaas.api.request.product.ProductMakeDetailRequest; +import com.jwsaas.api.request.product.ProductRatioRequest; +import com.jwsaas.api.request.product.ProductRequest; +import com.jwsaas.api.request.product.ProductSpecRequest; +import com.jwsaas.api.request.product.ProductSuitDetailRequest; +import com.jwsaas.api.request.product.ProductSuitRequest; +import com.jwsaas.api.request.product.ProductTypeRequest; +import com.jwsaas.api.request.product.ProductUnitRequest; +import com.jwsaas.api.request.product.StoreMakeDetailRequest; +import com.jwsaas.api.request.product.StoreMakeTypeRequest; +import com.jwsaas.api.request.wxyh.WxyhCategoryRequest; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.response.mode.CommonListResponse; +import com.jwsaas.api.response.mode.CommonPagerResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.product.ProductService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.Brand; +import com.jwsaas.entity.food.MakeBurden; +import com.jwsaas.entity.food.MakeDetail; +import com.jwsaas.entity.food.MakeType; +import com.jwsaas.entity.food.Product; +import com.jwsaas.entity.food.ProductBurden; +import com.jwsaas.entity.food.ProductImage; +import com.jwsaas.entity.food.ProductRatio; +import com.jwsaas.entity.food.ProductSpec; +import com.jwsaas.entity.food.ProductSuit; +import com.jwsaas.entity.food.ProductSuitDetail; +import com.jwsaas.entity.food.ProductType; +import com.jwsaas.entity.food.ProductUnit; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.pager.Pager; +import com.jwsaas.properties.FdfsClientProperties; +import com.jwsaas.utils.AppKeyUtil; + +@ServiceMethodBean(version = "1.0") +public class ProductServiceImpl extends WopServiceImpl implements ProductService { + + private static final long serialVersionUID = -8679485266481220208L; + + private static final String className = "ProductServiceImpl"; + + @Resource + private com.jwsaas.service.food.StoreService storeService; + @Resource + private com.jwsaas.service.food.MakeTypeService makeTypeService; + @Resource + private com.jwsaas.service.food.MakeDetailService makeDetailService; + @Resource + private com.jwsaas.service.food.ProductUnitService productUnitService; + @Resource + private com.jwsaas.service.food.ProductTypeService productTypeService; + @Resource + private com.jwsaas.service.food.ProductService productService; + @Resource + private com.jwsaas.service.food.ProductSpecService productSpecService; + @Resource + private com.jwsaas.service.food.ProductImageService productImageService; + @Resource + private com.jwsaas.service.food.ProductSuitService productSuitService; + @Resource + private com.jwsaas.service.food.ProductSuitDetailService productSuitDetailService; + @Resource + private com.jwsaas.service.food.ProductRatioService productRatioService; + @Resource + private com.jwsaas.service.food.BrandService brandService; + @Resource + private com.jwsaas.service.food.ProductBurdenService productBurdenService; + @Resource + private com.jwsaas.service.food.MakeBurdenService makeBurdenService; + @Autowired + private FdfsClientProperties fdfsClientProperties; + + @ServiceMethod(method = "product.maketype", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "做法类型") + @Override + public Object storeMakeType(StoreMakeTypeRequest request) { + String info = "做法类型"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + CommonListResponse response = null; + try { + response = new CommonListResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("deleteFlag", 0)); + List source = makeTypeService.getList(tenantId, criteria); + List> list = new ArrayList<>(); + for (MakeType makeType : source) { + Map map = new HashMap<>(); + map.put("tenantId", makeType.getTenantId()); + map.put("id", makeType.getId()); + map.put("no", makeType.getNo()); + map.put("name", makeType.getName()); + map.put("type", makeType.getType()); + map.put("seqNo", makeType.getSeqNo()); + map.put("isRadio", makeType.getIsRadio()); + map.put("color", makeType.getColor()); + list.add(map); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "MAKETYPE_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "product.makedetail", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "做法信息") + @Override + public Object storeMakeDetail(StoreMakeDetailRequest request) { + String info = "做法类型"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + CommonListResponse response = null; + try { + response = new CommonListResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("md.deleteFlag", 0)); + List source = makeDetailService.getListByStoreId(tenantId, request.getStoreId(), criteria); + List> list = new ArrayList<>(); + if (CollectionUtils.isEmpty(source)) { + source = new ArrayList<>(); + criteria = new Criteria(); + criteria.add(Restrictions.eq("deleteFlag", 0)); + criteria.add(Restrictions.eq("prvFlag", 0));// 是否私有(0-否;1-是;) + source = makeDetailService.getList(tenantId, criteria); + for (MakeDetail makeDetail : source) { + Map map = new HashMap<>(); + map.put("tenantId", makeDetail.getTenantId()); + map.put("id", makeDetail.getId()); + map.put("no", makeDetail.getNo()); + map.put("typeId", makeDetail.getTypeId()); + map.put("description", makeDetail.getDescription()); + map.put("spell", makeDetail.getSpell()); + map.put("addPrice", doubleFormat(makeDetail.getAddPrice())); + map.put("qtyFlag", makeDetail.getQtyFlag()); + map.put("orderNo", makeDetail.getOrderNo()); + map.put("color", makeDetail.getColor()); + map.put("prvFlag", makeDetail.getPrvFlag()); + list.add(map); + } + } else { + for (MakeDetail makeDetail : source) { + Map map = new HashMap<>(); + map.put("tenantId", makeDetail.getTenantId()); + map.put("id", makeDetail.getId()); + map.put("no", makeDetail.getNo()); + map.put("typeId", makeDetail.getTypeId()); + map.put("description", makeDetail.getDescription()); + map.put("spell", makeDetail.getSpell()); + map.put("addPrice", doubleFormat(makeDetail.getNewAddPrice())); + map.put("qtyFlag", makeDetail.getQtyFlag()); + map.put("orderNo", makeDetail.getOrderNo()); + map.put("color", makeDetail.getColor()); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "MAKEDETAIL_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "product.unit", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "产品单位") + @Override + public Object productUnit(ProductUnitRequest request) { + String info = "商品单位"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + // criteria.add(Restrictions.eq("deleteFlag", 0)); + pager = productUnitService.getPager(tenantId, criteria, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (ProductUnit productUnit : source) { + Map map = new HashMap<>(); + map.put("tenantId", productUnit.getTenantId()); + map.put("id", productUnit.getId()); + map.put("no", productUnit.getNo()); + map.put("name", productUnit.getName()); + map.put("deleteFlag", productUnit.getDeleteFlag()); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "UNIT_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "product.type", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "商品类别") + @Override + public Object productType(ProductTypeRequest request) { + String info = "商品类别"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("deleteFlag", 0)); + pager = productTypeService.getPager(tenantId, criteria, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (ProductType dishType : source) { + Map map = new HashMap<>(); + map.put("tenantId", dishType.getTenantId()); + map.put("id", dishType.getId()); + map.put("parentId", dishType.getParentId()); + map.put("path", dishType.getPath()); + map.put("no", dishType.getNo()); + map.put("name", dishType.getName()); + map.put("color", dishType.getColor()); + map.put("sign", dishType.getSign());// 标识符 + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "TYPE_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "product.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "商品列表(分页)") + @Override + public Object productList(ProductRequest request) { + String info = "商品列表(分页)"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + pager = productService.getPagerByStoreId(tenantId, request.getStoreId(), pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (Product product : source) { + Map map = new HashMap<>(); + map.put("tenantId", product.getTenantId()); + map.put("id", product.getId()); + map.put("brandId", product.getBrandId()); + map.put("typeId", product.getTypeId()); + map.put("typePath", product.getTypePath()); + map.put("no", product.getNo()); + map.put("name", product.getName()); + map.put("spell", product.getSpell()); + map.put("assistNo", product.getAssistNo()); + map.put("barCode", product.getBarCode()); + map.put("otherNo", product.getOtherNo()); + map.put("shortName", product.getShortName()); + map.put("english", product.getEnglish()); + map.put("unitId", product.getUnitId()); + map.put("description", product.getDescription()); + map.put("commissionType", product.getCommissionType()); + map.put("commissionValue", doubleFormat(product.getCommissionType())); + map.put("discountFlag", product.getDiscountFlag()); + map.put("tapleFlag", product.getTapleFlag()); + map.put("weighFlag", product.getWeighFlag()); + map.put("currentFlag", product.getCurrentFlag()); + map.put("labelPrintFlag", product.getLabelPrintFlag()); + map.put("suitFlag", product.getSuitFlag()); + map.put("mebDiscountFlag", product.getMebDiscountFlag()); + map.put("giveFlag", product.getGiveFlag()); + map.put("promotionFlag", product.getPromotionFlag()); + map.put("type", product.getType()); + map.put("stockFlag", product.getStockFlag()); + map.put("pointType", product.getPointType()); + map.put("pointValue", doubleFormat(product.getPointValue())); + map.put("purchaseTax", doubleFormat(product.getPurchaseTax())); + map.put("saleTax", doubleFormat(product.getSaleTax())); + map.put("lyRate", doubleFormat(product.getLyRate())); + map.put("groupName", product.getGroupName()); + map.put("picture", product.getPicture()); + map.put("stopFlag", product.getStopFlag()); + map.put("price", product.getPrice()); + map.put("memberPrice", doubleFormat(product.getMemberPrice())); + map.put("otherPrice", doubleFormat(product.getOtherPrice())); + map.put("costPrice", doubleFormat(product.getCostPrice())); + map.put("purchasePrice", doubleFormat(product.getPurchasePrice())); + map.put("dispatchPrice", doubleFormat(product.getDispatchPrice())); + map.put("minPrice", doubleFormat(product.getMinPrice())); + map.put("specCount", product.getSpecCount()); + map.put("kdsFlag", product.getKdsFlag()); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "LIST_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "product.spec", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "商品规格列表(分页)") + @Override + public Object productSpec(ProductSpecRequest request) { + String info = "商品规格列表(分页)"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + pager = productSpecService.getPagerByStoreId(tenantId, request.getStoreId(), pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (ProductSpec productSpec : source) { + Map map = new HashMap<>(); + map.put("tenantId", productSpec.getTenantId()); + map.put("id", productSpec.getId()); + map.put("productId", productSpec.getProductId()); + map.put("no", productSpec.getNo()); + map.put("name", productSpec.getName()); + map.put("price", doubleFormat(productSpec.getPrice())); + map.put("memberPrice", doubleFormat(productSpec.getMemberPrice())); + map.put("minPrice", doubleFormat(productSpec.getMinPrice())); + map.put("otherPrice", doubleFormat(productSpec.getOtherPrice())); + map.put("costPrice", doubleFormat(productSpec.getCostPrice())); + map.put("purchasePrice", doubleFormat(productSpec.getPurchasePrice())); + map.put("dispatchPrice", doubleFormat(productSpec.getDispatchPrice())); + map.put("materialRate", doubleFormat(productSpec.getMaterialRate())); + map.put("isdefault", productSpec.getIsdefault()); + map.put("deleteFlag", productSpec.getDeleteFlag()); + map.put("thUseLevel", doubleFormat(productSpec.getThUseLevel()));//理论万元用量 + map.put("realThUseLevel", doubleFormat(productSpec.getRealThUseLevel()));//实际万元用量 + map.put("cost", doubleFormat(productSpec.getCost()));//单项成本 + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "SPEC_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "product.image", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "商品图片列表(分页)") + @Override + public Object productImage(ProductImageRequest request) { + String info = "商品图片列表(分页)"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + String dfsAccessDomain = fdfsClientProperties.getAccessDomain(); + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + pager = productImageService.getPagerByStoreId(tenantId, request.getStoreId(), pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (ProductImage productImage : source) { + Map map = new HashMap<>(); + map.put("tenantId", productImage.getTenantId()); + map.put("id", productImage.getId()); + map.put("productId", productImage.getProductId()); + map.put("width", productImage.getWidth()); + map.put("height", productImage.getHeight()); + map.put("groupName", productImage.getGroupName()); + map.put("dfsAccessDomain", dfsAccessDomain);// 文件服务器地址 + map.put("storageFileName", productImage.getStorageFileName()); + if(StringUtils.contains(productImage.getStorageFileName(),"http:")){ + map.put("groupName", ""); + map.put("dfsAccessDomain", "");// 文件服务器地址 + } + map.put("length", productImage.getLength()); + map.put("mimeType", productImage.getMimeType()); + map.put("orderNo", productImage.getOrderNo()); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "IMAGES_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "product.suit", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "商品套菜(分页)") + @Override + public Object productSuit(ProductSuitRequest request) { + String info = "商品套菜(分页)"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + pager = productSuitService.getPagerByStoreId(tenantId, request.getStoreId(), pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (ProductSuit productSuit : source) { + Map map = new HashMap<>(); + map.put("tenantId", productSuit.getTenantId()); + map.put("id", productSuit.getId()); + map.put("productId", productSuit.getProductId()); + map.put("no", productSuit.getNo()); + map.put("name", productSuit.getName()); + map.put("quantity", productSuit.getQuantity()); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "SUIT_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "product.suit.detail", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "商品套菜明细(分页)") + @Override + public Object productSuitDetail(ProductSuitDetailRequest request) { + String info = "商品套菜明细(分页)"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + pager = productSuitDetailService.getPagerByStoreId(tenantId, request.getStoreId(), pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + Criteria criteria = new Criteria(); + List suitList = productSuitService.getList(tenantId, criteria); + Map suitMap = new HashMap<>(); + for (ProductSuit suit : suitList) { + suitMap.put(suit.getId(), suit); + } + + List source = (List) pager.getList(); + for (ProductSuitDetail productSuitDetail : source) { + Map map = new HashMap<>(); + map.put("tenantId", productSuitDetail.getTenantId()); + map.put("id", productSuitDetail.getId()); + map.put("suitId", productSuitDetail.getSuitId()); + + // ProductSuit productSuit = productSuitService.get(tenantId, productSuitDetail.getSuitId()); + // map.put("suitProductId", productSuit.getProductId()); + map.put("suitProductId", suitMap.get(productSuitDetail.getSuitId()).getProductId()); + + map.put("productId", productSuitDetail.getProductId()); + map.put("specId", productSuitDetail.getSpecId()); + map.put("quantity", productSuitDetail.getQuantity()); + map.put("addPrice", doubleFormat(productSuitDetail.getAddPrice())); + map.put("defaultflag", productSuitDetail.getDefaultflag()); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "SUIT_DETAIL_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "product.ratio", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "商品库存系统(分页)") + @Override + public Object productRatio(ProductRatioRequest request) { + String info = "商品库存系统(分页)"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + pager = productRatioService.getPagerByStoreId(tenantId, request.getStoreId(), pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (ProductRatio productRatio : source) { + Map map = new HashMap<>(); + map.put("tenantId", productRatio.getTenantId()); + map.put("id", productRatio.getId()); + map.put("productId", productRatio.getProductId()); + map.put("dispatchUnitId", productRatio.getDispatchUnitId()); + map.put("purchaseUnitId", productRatio.getPurchaseUnitId()); + map.put("pdScale", doubleFormat(productRatio.getPdScale())); + map.put("packUnitId", productRatio.getPackUnitId()); + map.put("dpScale", doubleFormat(productRatio.getDpScale())); + map.put("salesUnitId", productRatio.getSalesUnitId()); + map.put("psScale", doubleFormat(productRatio.getPsScale())); + map.put("maxStock", doubleFormat(productRatio.getMaxStock())); + map.put("minStock", doubleFormat(productRatio.getMinStock())); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "RATIO_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "product.private.makedetail", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "商品私有做法信息") + @Override + public Object productMakeDetail(ProductMakeDetailRequest request) { + String info = "商品私有做法信息"; + logger.debug(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + List> list = new ArrayList<>(); + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("md.deleteFlag", 0)); + pager = makeDetailService.getPager4Private(tenantId, storeId, criteria, pager); + + if (pager.getList() != null && pager.getList().size() > 0) { + List> dataList = (List>) pager.getList(); + + // 获取门店做法信息,处理加价 + criteria = new Criteria(); + criteria.add(Restrictions.eq("md.deleteFlag", 0)); + List storeMakeDetailList = makeDetailService.getListByStoreId(tenantId, request.getStoreId(), criteria); + Map storeMakeDetailMap = new HashMap<>(); + for (MakeDetail makeDetail : storeMakeDetailList) { + storeMakeDetailMap.put(makeDetail.getId(), makeDetail); + } + + // 组织返回数据 + for (Map data : dataList) { + Map map = new HashMap<>(); + map.put("tenantId", data.get("tenantId")); + map.put("storeId", data.get("storeId")); + map.put("productId", data.get("productId")); + map.put("makeId", data.get("makeId")); + map.put("no", data.get("no")); + map.put("spell", data.get("spell")); + map.put("description", data.get("description")); + map.put("addPrice", + doubleFormat(storeMakeDetailMap.get(data.get("makeId").toString()) == null ? data.get("addPrice") : storeMakeDetailMap.get(data.get("makeId").toString()).getNewAddPrice())); + map.put("orderNo", data.get("orderNo")); + map.put("color", data.get("color")); + map.put("qtyFlag", data.get("qtyFlag")); + map.put("typeId", data.get("typeId")); + map.put("prvFlag", data.get("prvFlag"));// 是否私有(0-否;1-是;) + + list.add(map); + } + } + + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "product.brand", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "商品品牌") + @Override + public Object productBrand(ProductBrandRequest request) { + String info = "商品品牌"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + CommonListResponse response = null; + try { + response = new CommonListResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + Criteria criteria = new Criteria(); + List brandList = brandService.getList(tenantId, criteria); + List> list = new ArrayList<>(); + if (brandList != null && brandList.size() > 0) { + for (Brand brand : brandList) { + Map map = JSON.parseObject(JSON.toJSONString(brand),Map.class); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "UNIT_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "product.store.brand", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店关联品牌") + @Override + public Object productStoreBrand(ProductBrandRequest request) { + String info = "门店关联品牌"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + CommonListResponse response = null; + try { + response = new CommonListResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + List brandList = brandService.getListBystoreId(tenantId, storeId); + List> list = new ArrayList<>(); + if (brandList != null && brandList.size() > 0) { + for (Brand brand : brandList) { + Map map = JSON.parseObject(JSON.toJSONString(brand),Map.class); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "UNIT_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.product.brand", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店商品品牌") + @Override + public Object storeProductBrand(WxyhCategoryRequest request) { + String info = "门店商品品牌"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + Integer isMaterial = request.getIsMaterial(); + CommonListResponse response = null; + try { + response = new CommonListResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("sp.storeId", storeId)); + if (isMaterial.intValue() == 1) { + criteria.add(Restrictions.ge("p.type", 10));// 原料,辅料 + criteria.add(Restrictions.eq("p.stockFlag", 1));// 管理库存 + } else if (isMaterial.intValue() == 2) { + criteria.add(Restrictions.lt("p.type", 10));// 非原料,辅料 + } + + criteria.add(Restrictions.eq("p.stopFlag", 0));// 未停用 + criteria.add(Restrictions.eq("p.deleteFlag", "0"));// 未删除 + criteria.add(Restrictions.isNotNull("b.id"));// 过滤空数据 + criteria.add(Restrictions.group("b.id")); + criteria.add(Restrictions.order("b.no", "asc")); + System.out.println("sql:"+criteria.toSQL()); + List> list = productService.getProductBrand(tenantId, criteria); + + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", + request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.product.burden", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "商品配方") + @Override + public Object storeProductBurden(ProductBurdenRequest request) { + String info = "做法配方"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("b.`storeId`", request.getStoreId())); + pager = productBurdenService.getPagerByStoreId(tenantId, criteria, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (ProductBurden productBurden : source) { + Map map = new HashMap<>(); + map.put("id", productBurden.getId()); + map.put("tenantId", productBurden.getTenantId()); + map.put("productId", productBurden.getProductId()); + map.put("specId", productBurden.getSpecId()); + map.put("burdenProductId", productBurden.getBurdenProductId()); + map.put("burdenSpecId", productBurden.getBurdenSpecId()); + map.put("salesUnitId", productBurden.getSalesUnitId()); + map.put("salesAmount", productBurden.getSalesAmount()); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.make.burden", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "做法配方") + @Override + public Object storeMakeBurdenRequest(MakeBurdenRequest request) { + String info = "做法配方"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + // criteria.add(Restrictions.eq("deleteFlag", 0)); + pager = makeBurdenService.getPager(tenantId, criteria, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (MakeBurden makeBurden : source) { + Map map = new HashMap<>(); + map.put("id", makeBurden.getId()); + map.put("tenantId", makeBurden.getTenantId()); + map.put("makeId", makeBurden.getMakeId()); + map.put("burdenProductId", makeBurden.getBurdenProductId()); + map.put("burdenSpecId", makeBurden.getBurdenSpecId()); + map.put("salesUnitId", makeBurden.getSalesUnitId()); + map.put("salesAmount", makeBurden.getSalesAmount()); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/promotion/PromotionServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/promotion/PromotionServiceImpl.java new file mode 100644 index 0000000..3c2db45 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/promotion/PromotionServiceImpl.java @@ -0,0 +1,205 @@ +package com.jwsaas.api.service.impl.promotion; + +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import org.apache.commons.lang3.StringUtils; + +import com.jwsaas.PromotionType; +import com.jwsaas.api.request.promotion.PromotionTypeListRequest; +import com.jwsaas.api.request.promotion.StorePromotionTaskRequest; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.response.mode.CommonListResponse; +import com.jwsaas.api.response.mode.CommonPagerResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.promotion.PromotionService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.PromotionTask; +import com.jwsaas.entity.food.Store; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.pager.Pager; +import com.jwsaas.util.DateUtils; +import com.jwsaas.utils.AppKeyUtil; + +@ServiceMethodBean(version = "1.0") +public class PromotionServiceImpl extends WopServiceImpl implements PromotionService { + + private static final long serialVersionUID = 6968611473820736945L; + + @Resource + private com.jwsaas.service.food.StoreService storeService; + @Resource + private com.jwsaas.service.food.PromotionTaskService promotionTaskService; + + @ServiceMethod(method = "promotion.type.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "促销类型列表") + @Override + public Object promotionTypeList(PromotionTypeListRequest request) { + String info = "促销类型列表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + // AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + // String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + // String tenantId = tenantCode; + + CommonListResponse response = null; + try { + response = new CommonListResponse(); + List> list = new ArrayList<>(); + for (PromotionType type : PromotionType.values()) { + Map map = new HashMap<>(); + map.put("sign", type.getSign()); + map.put("description", type.getDescription()); + list.add(map); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @SuppressWarnings("unchecked") + @ServiceMethod(method = "promotion.store.task", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店促销任务列表") + @Override + public Object storePromotionTask(StorePromotionTaskRequest request) { + String info = "门店促销任务列表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + String startDate = request.getStartDate(); + Integer day = request.getDay(); + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + if (StringUtils.isBlank(startDate)) { + response.setStatus(0); + response.setMessage("参数startDate不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + Date baseDate = null; + try { + baseDate = DateUtils.parseDate(startDate, DateUtils.SHOW_DATE_FORMAT); + } catch (Exception e) { + logger.error(info + "startDate参数解析时,发生异常", e); + } + if (baseDate == null) { + response.setStatus(0); + response.setMessage("参数startDate格式不正确"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + Date endDate = null; + if (day == null || day <= 1) { + endDate = DateUtils.addDay(baseDate, 0); + } else if (day > 3) { + endDate = DateUtils.addDay(baseDate, 3); + } else { + endDate = DateUtils.addDay(baseDate, day); + } + + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + // 状态: 0-预备;1-执行中;2-已中止;3-已结束;4-发布失败; + criteria.add(Restrictions.lt("status", 2)); + criteria.add(Restrictions.ge("startDate", DateUtils.format(baseDate, DateUtils.SHOW_DATE_FORMAT))); + criteria.add(Restrictions.le("startDate", DateUtils.format(endDate, DateUtils.SHOW_DATE_FORMAT))); + pager = promotionTaskService.getPager(tenantId, criteria, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List dataList = (List) pager.getList(); + for (PromotionTask data : dataList) { + Map map = new HashMap<>(); + map.put("id", data.getId()); + map.put("tenantId", data.getTenantId()); + map.put("storeId", data.getStoreId());// 门店Id + map.put("sn", data.getSn());// 任务编号 + map.put("scheduleId", data.getScheduleId());// 档期Id + map.put("scheduleSn", data.getScheduleSn());// 档期编号 + map.put("promotionId", data.getPromotionId());// 促销单Id + map.put("promotionSn", data.getPromotionSn());// 促销单编号 + map.put("promotionType", data.getPromotionType());// 促销类型 + map.put("valueType", data.getValueType());// 值类型 + map.put("valueId", data.getValueId());// 值Id + map.put("valueNo", data.getValueNo());// 值编号 + map.put("valueName", data.getValueName());// 值名称 + map.put("valueExt1", data.getValueExt1());// 值扩展1 + map.put("valueExt2", data.getValueExt2());// 值扩展2 + map.put("schemeId", data.getSchemeId());// 促销方案Id + map.put("schemeSn", data.getSchemeSn());// 方案编号 + map.put("startDate", DateUtils.format(data.getStartDate(), DateUtils.SHOW_DATE_FORMAT));// 开始日期 + map.put("endDate", DateUtils.format(data.getEndDate(), DateUtils.SHOW_DATE_FORMAT));// 结束日期 + map.put("startTime", data.getStartTime());// 开始时间 + map.put("endTime", data.getEndTime());// 结束时间 + map.put("validWeek", data.getValidWeek());// 每周频率 + map.put("validMonth", data.getValidMonth());// 每月频率 + map.put("isOnlyMember", data.getIsOnlyMember());// 是否会员专享 + map.put("isRepeatDiscount", data.getIsRepeatDiscount());// 是否会员折上折 + map.put("isAll", data.getIsAll());// 是否全场促销 + map.put("goodsBlackList", data.getGoodsBlackList());// 商品黑名单 + map.put("discountType", data.getDiscountType());// 优惠类型 + map.put("discountValue", data.getDiscountValue());// 优惠值 + map.put("rule", data.getRule());// 促销规则 + map.put("setMan", data.getSetMan());// 制单人 + map.put("setTime", DateUtils.format(data.getSetTime(), DateUtils.SHOW_DATETIME_FORMAT));// 制单时间 + map.put("status", data.getStatus());// 状态 + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/split/SplitLogServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/split/SplitLogServiceImpl.java new file mode 100644 index 0000000..d58e5c7 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/split/SplitLogServiceImpl.java @@ -0,0 +1,72 @@ +package com.jwsaas.api.service.impl.split; + + +import com.alibaba.fastjson.JSON; + +import com.jwsaas.api.request.upload.BusinessOrderUploadRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.split.SplitLogService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.BusinessOrderUpload; +import com.jwsaas.entity.food.SplitPayLog; +import com.jwsaas.entity.food.SplitStorePay; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.service.food.SplitPayLogService; +import com.jwsaas.util.KeyUtil; +import com.jwsaas.utils.AppKeyUtil; +import org.apache.commons.lang3.StringUtils; + +import javax.annotation.Resource; +import java.util.*; + + +@ServiceMethodBean(version = "1.0") +public class SplitLogServiceImpl extends WopServiceImpl implements SplitLogService { + + @Resource + private SplitPayLogService splitPayLogService; + + @ServiceMethod(method = "upload.splitstorepay.log", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "分帐错误日志上传") + @Override + public Object splitStorepayLogUpload(BusinessOrderUploadRequest request) { + String info = "分帐错误日志上传"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + CommonDataResponse response = null; + String jsonString = request.getJsonString(); + try { + response = new CommonDataResponse(); + List list = JSON.parseArray(jsonString, SplitPayLog.class); + for(SplitPayLog payLog:list) { + splitPayLogService.save(tenantId, payLog); + } + Map data = new HashMap<>(); + data.put("ticketId", new Date().getTime()); + response.setStatus(1); + response.setMessage("分帐错误日志数据上传成功"); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + logger.error("jsonString:" + jsonString); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "BUSINESS_ORDER_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/split/SplitSaleServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/split/SplitSaleServiceImpl.java new file mode 100644 index 0000000..dc16cb6 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/split/SplitSaleServiceImpl.java @@ -0,0 +1,396 @@ +package com.jwsaas.api.service.impl.split; + + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.jwsaas.TlData; +import com.jwsaas.TlReturnMsg; +import com.jwsaas.api.request.split.SplitStorePayRequet; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.SplitStorePay; +import com.jwsaas.entity.food.StoreHandover; +import com.jwsaas.entity.split.SplitCompanyEntity; +import com.jwsaas.api.request.split.SplitFoodAccountRequest; +import com.jwsaas.api.request.split.SplitShopAccountRequest; +import com.jwsaas.api.response.mode.DataPageResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.split.SplitSaleService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.entity.food.SplitShopAccount; +import com.jwsaas.entity.split.SplitHandoverEntity; +import com.jwsaas.entity.split.SplitProductEntity; +import com.jwsaas.entity.tl.member.SingalAgentPay; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.pager.Pager; +import com.jwsaas.properties.TongLianPayProperties; +import com.jwsaas.service.food.*; +import com.jwsaas.tonglian.TlHttpClient; +import com.jwsaas.util.KeyIdUtil; +import com.jwsaas.utils.AppKeyUtil; +import com.jwsaas.utils.PropertiesUtil; +import org.springframework.beans.factory.annotation.Autowired; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.SimpleDateFormat; +import java.util.*; + + +@ServiceMethodBean(version = "1.0") +public class SplitSaleServiceImpl extends WopServiceImpl implements SplitSaleService { + + @Resource + private SplitShopAccountService shopAccountService; + @Resource + private SplitFoodAccountService shopFoodService; + @Resource + private SplitStorePayService storePayService; + @Resource + private StoreHandoverService storeHandoverService; + @Resource + private com.jwsaas.service.food.SplitStorePayService splitStorePayService; + @Resource + private SplitShopAccountService splitShopAccountService; + @Autowired + private TongLianPayProperties tongLianPayProperties; + + @ServiceMethod(method = "sale.business.splitshops", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "公司列表接口") + @Override + public Object businessSplitShops(SplitShopAccountRequest request) { + String info = "公司列表接口"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + //String storeId=request.getStoreId(); + DataPageResponse response = null; + try { + response = new DataPageResponse(); + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + //criteria.add(Restrictions.eq("shopId", storeId)); + pager = shopAccountService.getPager(tenantId, criteria, pager); + /*Map data = new HashMap<>(); + data.put("date", new Date().getTime());*/ + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + List lists=new ArrayList<>(); + for(SplitShopAccount shop:source ){ + SplitCompanyEntity entity=new SplitCompanyEntity(); + entity.setId(shop.getId()); + entity.setUniCredit(shop.getUniCredit()); + lists.add(entity); + } + response.setList(lists); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + response.setStatus(0); + //response.setMessage("获取失败"); + response.setErrMessage("获取失败"); + response.setErrCode("TYPE_ERROR"); + //return new BusinessServiceErrorResponse(request.getWopRequestContext(), "TYPE_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "sale.business.splitfoods", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "菜品列表接口") + @Override + public Object businessSplitFoods(SplitFoodAccountRequest request) { + String info = "商品列表接口"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + String storeId=request.getStoreId(); + DataPageResponse response = null; + try { + response = new DataPageResponse(); + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("cs.uniCredit", storeId)); + pager =shopFoodService.getSplitProductPager(tenantId, criteria, pager); + List list= (List) pager.getList(); + for(int i=0;i0){ + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", shops.get(0).getShopId())); + criteria.add(Restrictions.ge("datetimeBegin", fromTime+" 00:00:00")); + criteria.add(Restrictions.le("datetimeEnd", fromTime+" 23:59:59")); + pager = storeHandoverService.getPager(tenantId, criteria, pager); + response.setList(pager.getList()); + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + }else{ + response.setErrMessage("获取失败"); + response.setErrCode("门店不存在"); + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + response.setStatus(0); + //response.setMessage("获取失败"); + response.setErrMessage("获取失败"); + response.setErrCode("TYPE_ERROR"); + //return new BusinessServiceErrorResponse(request.getWopRequestContext(), "TYPE_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + + @ServiceMethod(method = "sale.business.automaticprorate", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "定时分帐接口") + @Override + public Object businessAutomaticProrateHandover(SplitStorePayRequet request) { + String info = "定时分帐接口"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String fromTime = request.getFromTime(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + Map result = null; + logger.info("divide.order" + info); + Pager pager=new Pager(); + pager.setPageNumber(1); + pager.setPageSize(50); + try { + Date newdate=new Date(); + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); + String datestr=sdf.format(newdate); + //查询所有未分帐记录 + Criteria criter = new Criteria(); + criter.add(Restrictions.ge("payDate", datestr+" 00:00:00")); + criter.add(Restrictions.le("payDate", datestr+" 23:59:59")); + criter.add(Restrictions.eq("isInvalid",0)); + criter.add(Restrictions.eq("payTypeNo","50")); + List payModeList=splitStorePayService.getList(tenantId,criter); + /*Pager payModePageList=splitStorePayService.getSplitOrderPager(tenantId,criter,pager); + List payModeList= (List) payModePageList.getList();*/ + for (SplitStorePay splitStorePay : payModeList) { + String json = JSON.toJSONString(splitStorePay); + logger.debug("单笔托管代付:" + "(" + json + ")"); + if (splitStorePay != null) { + int isInvalid = splitStorePay.getIsInvalid();//是否生效 1是0否 + if (isInvalid == 1) { + logger.info("该订单已分帐,分帐失败" + splitStorePay.getId()); + } else { + //订单类型 堂食 = 0,外带 = 1,电话外卖 = 2,餐桌 = 3,美团外卖 = 4,饿了么 = 5,百度外卖 = 6,微信点餐 = 7 + String orderType = splitStorePay.getOrderType(); + String storeId = splitStorePay.getStoreId(); + Double paid = splitStorePay.getPaid();//实收金额 + long fee = splitStorePay.getFee();//手续费 + int isRefund = splitStorePay.getIsRefund();//是否有退款 0否 1有 + Double refundAmount = splitStorePay.getRefundAmount();//退款金额 + String payTyepNo=splitStorePay.getPayTypeNo(); + String id=splitStorePay.getId(); + if("50".equals(payTyepNo)) {//通联支付 + BigDecimal bpaid = new BigDecimal(paid); + BigDecimal brefundAmount = new BigDecimal(refundAmount); + int flag = bpaid.compareTo(brefundAmount); + if (flag == 0) {//相等 + logger.info("分帐失败,退款金额和实收金额相等" + splitStorePay.getId()); + } else if (flag == 1) {//大于 + String splitStoreId = splitStorePay.getSplitStoreId();//分店ID + SplitShopAccount account = splitShopAccountService.get(tenantId, splitStoreId); + String backUrl = tongLianPayProperties.getSignalagentPayotifyUrl(); + String bizUserId=account.getBizUserId(); + BigDecimal pidb = bpaid.subtract(brefundAmount); + BigDecimal b100 = new BigDecimal(100); + BigDecimal bigDecimal = pidb.multiply(b100).setScale(0, RoundingMode.HALF_UP); + long moneyValue = bigDecimal.longValue(); + SingalAgentPay pay = new SingalAgentPay(); + //String bizOrderNo = "tl-" + System.currentTimeMillis(); + String bizOrderNo = "tl-" + KeyIdUtil.getUniqueKey(""); + if ("7".equals(orderType)) { + pay.setBizOrderNo(bizOrderNo); + final JSONArray tranlist = new JSONArray(); + final HashMap trandetail1 = new HashMap<>(); + trandetail1.put("bizOrderNo", splitStorePay.getBusNo()); + trandetail1.put("amount", moneyValue); + tranlist.add(trandetail1); + String stranlist = JSON.toJSONString(tranlist); + pay.setCollectPayList(stranlist); + pay.setBizUserId(bizUserId); + pay.setBackUrl(backUrl); + pay.setAmount(moneyValue); + pay.setFee(fee); + pay.setTradeCode("3001"); + logger.error("租户编号_门店ID_订单号" + tenantId + "_" + storeId + "_" + id); + pay.setRemark(tenantId + "_" + storeId + "_" + id); + } else if ("0".equals(orderType) || "1".equals(orderType) || "3".equals(orderType)) { + String fromBizUserId = splitStorePay.getFromBizUserId(); + pay.setBizOrderNo(bizOrderNo); + final JSONArray tranlist = new JSONArray(); + final HashMap trandetail1 = new HashMap<>(); + trandetail1.put("bizOrderNo", splitStorePay.getBusNo()); + trandetail1.put("amount", moneyValue); + tranlist.add(trandetail1); + String stranlist = JSON.toJSONString(tranlist); + pay.setCollectPayList(stranlist); + pay.setBizUserId(fromBizUserId); + pay.setBackUrl(backUrl); + pay.setAmount(moneyValue); + pay.setFee((long) 0); + if(bizUserId.equals(fromBizUserId)==false){ + final JSONArray splitRuleList = new JSONArray(); + final HashMap splitRuletail1 = new HashMap<>(); + splitRuletail1.put("bizUserId", bizUserId); + splitRuletail1.put("amount", moneyValue); + splitRuletail1.put("fee", fee); + splitRuletail1.put("remark", ""); + splitRuleList.add(splitRuletail1); + pay.setSplitRuleList(splitRuleList); + } + pay.setTradeCode("3001"); + logger.error("租户编号_门店ID_订单号" + tenantId + "_" + storeId + "_" + id); + pay.setRemark(tenantId + "_" + storeId + "_" + id); + } + String jsonpay = JSON.toJSONString(pay); + logger.error("单笔托管代付param:" + jsonpay); + String content = TlHttpClient.post("order.signalAgentPay", pay); + System.out.println("单笔托管代付content:" + content); + TlReturnMsg msg = JSON.parseObject(content, TlReturnMsg.class); + String subCode = msg.getSubCode(); + String subMsg = msg.getMsg(); + if ("OK".equals(subCode)) { + String tldata = msg.getData(); + TlData dataa = JSON.parseObject(tldata, TlData.class); + splitStorePay.setBizOrderNo(bizOrderNo); + splitStorePayService.update(tenantId, splitStorePay); + logger.info("操作成功"); + } else if ("FAIL".equals(subCode)) { + logger.info("分帐失败,"+ subMsg); + } + } else { + logger.info("分帐失败,退款金额大于实收金额"); + } + } + } + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/split/SplitServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/split/SplitServiceImpl.java new file mode 100644 index 0000000..c384771 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/split/SplitServiceImpl.java @@ -0,0 +1,1153 @@ +package com.jwsaas.api.service.impl.split; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.jwsaas.api.entity.upload.*; +import com.jwsaas.api.request.product.ProductTypeRequest; +import com.jwsaas.api.request.split.SplitFoodAccountRequest; +import com.jwsaas.api.request.split.SplitShopAccountRequest; +import com.jwsaas.api.request.split.SplitStorePayRequet; +import com.jwsaas.api.request.upload.*; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.response.mode.CommonPagerResponse; +import com.jwsaas.api.response.mode.DataPageResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.split.SplitService; +import com.jwsaas.api.service.upload.UploadService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.cache.data.ProductUnitCache; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.config.MQMessageSender; +import com.jwsaas.entity.food.*; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.pager.Pager; +import com.jwsaas.reactor.event.EventKeys; +import com.jwsaas.service.food.*; +import com.jwsaas.util.JSONUtil; +import com.jwsaas.util.KeyUtil; +import com.jwsaas.utils.AppKeyUtil; +import com.jwsaas.utils.IdWorkerUtils; +import com.jwsaas.utils.MathUtil; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.amqp.rabbit.support.CorrelationData; +import reactor.bus.Event; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; + +@ServiceMethodBean(version = "1.0") +public class SplitServiceImpl extends WopServiceImpl implements SplitService { + + private static final long serialVersionUID = -4072449412690990747L; + + @Resource + private com.jwsaas.service.food.StoreService storeService; + @Resource + private com.jwsaas.service.food.StoreBusinessTicketService storeBusinessTicketService; + @Resource + private com.jwsaas.service.food.StoreCostRevenueService storeCostRevenueService; + @Resource + private com.jwsaas.service.food.StoreHandoverService storeHandoverService; + @Resource + private TicketPrintSettingService settingService; + @Resource + private com.jwsaas.service.food.ProductTypeService productTypeService; + @Resource + private com.jwsaas.service.food.ProductService productService; + @Resource + private com.jwsaas.service.food.ProductSpecService productSpecService; + @Resource + private com.jwsaas.service.food.ProductRatioService productRatioService; + @Resource + private ProductUnitCache productUnitCache; + @Resource + private com.jwsaas.service.food.StoreStorageService storeStorageService; + @Resource + private SplitStorePayService storePayService; + @Resource + private SplitShopAccountService shopAccountService; + @Resource + private SplitFoodAccountService foodAccountService; + @Resource + private ProductStoreStockService productStoreStockService; + @Resource + private MQMessageSender mqMessageSender; + + @ServiceMethod(method = "upload.business.splitorder", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "销售单上传接口") + @Override + public Object businessSplitOrderUpload(BusinessOrderUploadRequest request) { + String info = "分店销售单记录上传"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + CommonDataResponse response = null; + BusinessOrderUpload businessOrderUpload = new BusinessOrderUpload(); + String jsonString = request.getJsonString(); + try { + response = new CommonDataResponse(); + List list = JSON.parseArray(jsonString, SplitStorePay.class); + String clientIds=""; + for(SplitStorePay pay:list) { + Criteria criteria = new Criteria(); + String clientId = pay.getClientId(); + String storeId = pay.getStoreId(); + String ticketId = pay.getTicketId(); + criteria.add(Restrictions.eq("clientId", clientId)); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("ticketId ", ticketId)); + List listt = storePayService.getList(tenantId, criteria); + if (listt != null && listt.size() > 0) { + logger.info("数据已经上传:"+clientId+"_"+storeId+"_"+ticketId); + } else { + String id = pay.getId(); + if (StringUtils.isEmpty(id)) { + id = KeyUtil.getUniqueKey(""); + pay.setId(id); + } + String createUser = pay.getCreateUser(); + if (StringUtils.isEmpty(createUser)) { + pay.setCreateUser("sync"); + } + storePayService.save(tenantId, pay); + } + clientIds=clientIds+clientId+","; + } + Map data = new HashMap<>(); + data.put("ticketId", new Date().getTime()); + data.put("clientIds",clientIds); + response.setStatus(1); + response.setMessage("分店分帐销售数据上传成功"); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + logger.error("jsonString:" + jsonString); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "BUSINESS_ORDER_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + + @ServiceMethod(method = "update.business.splitorder", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "销售单上传接口") + @Override + public Object businessSplitOrderUpdate(BusinessOrderUploadRequest request) { + String info = "分店销售单记录修改"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + CommonDataResponse response = null; + BusinessOrderUpload businessOrderUpload = new BusinessOrderUpload(); + String jsonString = request.getJsonString(); + try { + response = new CommonDataResponse(); + SplitStorePay pay = JSON.parseObject(jsonString, SplitStorePay.class); + String clientId=pay.getClientId(); + String storeId=pay.getStoreId(); + String ticketId=pay.getTicketId(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("clientId", clientId)); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("ticketId ", ticketId )); + List list=storePayService.getList(tenantId,criteria); + logger.info("数据修改:"+clientId+"_"+storeId+"_"+ticketId); + if(list!=null&&list.size()>0){ + SplitStorePay payy=list.get(0); + pay.setId(payy.getId()); + storePayService.update(tenantId,pay); + Map data = new HashMap<>(); + data.put("ticketId", new Date().getTime()); + response.setStatus(1); + response.setMessage("分店分帐销售数据修改成功"); + response.setData(data); + }else{ + logger.info("数据不存在:"+clientId+"_"+storeId+"_"+ticketId); + Map data = new HashMap<>(); + data.put("ticketId", new Date().getTime()); + response.setStatus(0); + response.setMessage("分店分帐销售数据修改失败,数据不存在"); + response.setData(data); + } + + } catch (Exception e) { + logger.error(info + ",发生异常", e); + logger.error("jsonString:" + jsonString); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "BUSINESS_ORDER_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "upload.business.splitorder.plus", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "销售单上传接口") + @Override + public Object businessSplitOrderUploadPlus(BusinessOrderUploadRequest request) { + String info = "销售销售单记录(加强版)"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + CommonDataResponse response = null; + String jsonString = request.getJsonString(); + try { + response = new CommonDataResponse(); + JSONObject json = JSONObject.parseObject(jsonString); + // 销售单据校验开始 + StoreBusinessTicketEntity entity = new StoreBusinessTicketEntity(json); + StoreBusinessTicket storeBusinessTicket = new StoreBusinessTicket(); + Date createDate = new Date(); + storeBusinessTicket.setCreateDate(createDate); + storeBusinessTicket.setCreateUser("open-api"); + if (entity.getClientId() == null || "".equals(entity.getClientId()) || entity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("前台系统ID参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setClientId(entity.getClientId()); + } + if (entity.getNo() == null || "".equals(entity.getNo()) || entity.getNo().length() > 32) { + response.setStatus(0); + response.setMessage("主单No参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setNo(entity.getNo()); + } + //if (entity.getStoreId() == null || "".equals(entity.getStoreId()) || entity.getStoreId().length() > 18) { + //去掉18位限制,2020-02-29 16:00 + if (entity.getStoreId() == null || "".equals(entity.getStoreId())) { + response.setStatus(0); + response.setMessage("主单storeId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setStoreId(entity.getStoreId()); + } + if (entity.getStoreNo() != null && entity.getStoreNo().length() > 32) { + response.setStatus(0); + response.setMessage("主单storeNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setStoreNo(entity.getStoreNo()); + } + if (entity.getStoreName() != null && entity.getStoreName().length() > 500) { + response.setStatus(0); + response.setMessage("主单storeName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setStoreName(entity.getStoreName()); + } + storeBusinessTicket.setStatus(entity.getStatus()); + if (entity.getWorkNo() != null && entity.getWorkNo().length() > 16) { + response.setStatus(0); + response.setMessage("主单WorkNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setWorkNo(entity.getWorkNo()); + } + storeBusinessTicket.setSaleDate(entity.getSaleDate()); + if (entity.getTableNo() != null && entity.getTableNo().length() > 16) { + response.setStatus(0); + response.setMessage("主单TableNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setTableNo(entity.getTableNo()); + } + storeBusinessTicket.setPeople(entity.getPeople()); + storeBusinessTicket.setBusMode(entity.getBusMode()); + if (entity.getShiftNo() != null && entity.getShiftNo().length() > 16) { + response.setStatus(0); + response.setMessage("主单shiftNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setShiftNo(entity.getShiftNo()); + } + if (entity.getShiftName() != null && entity.getShiftName().length() > 32) { + response.setStatus(0); + response.setMessage("主单shiftName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setShiftName(entity.getShiftName()); + } + storeBusinessTicket.setAmount(entity.getAmount()); + storeBusinessTicket.setDiscount(entity.getDiscount()); + storeBusinessTicket.setDiscountTotal(entity.getDiscountTotal()); + storeBusinessTicket.setReceivable(entity.getReceivable()); + storeBusinessTicket.setMaling(entity.getMaling()); + if (entity.getPaid() == null || entity.getPaid() == 0) { + storeBusinessTicket.setPaid(entity.getReceivable() - entity.getMaling()); + } else { + storeBusinessTicket.setPaid(entity.getPaid()); + } + if (entity.getNoOrg() != null && entity.getNoOrg().length() > 32) { + response.setStatus(0); + response.setMessage("主单NoOrg参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setNoOrg(entity.getNoOrg()); + } + if (entity.getBackCause() != null && entity.getBackCause().length() > 128) { + response.setStatus(0); + response.setMessage("主单BackCause参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setBackCause(entity.getBackCause()); + } + storeBusinessTicket.setIsMember(entity.getIsMember()); + if (entity.getMemberNo() != null && entity.getMemberNo().length() > 32) { + response.setStatus(0); + response.setMessage("主MemberNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setMemberNo(entity.getMemberNo()); + } + storeBusinessTicket.setMemberJifen(entity.getMemberJifen()); + if (entity.getDeviceName() != null && entity.getDeviceName().length() > 64) { + response.setStatus(0); + response.setMessage("主DeviceName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setDeviceName(entity.getDeviceName()); + } + if (entity.getPosNo() != null && entity.getPosNo().length() > 64) { + response.setStatus(0); + response.setMessage("主PosNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setPosNo(entity.getPosNo()); + } + if (entity.getDeviceIp() != null && entity.getDeviceIp().length() > 256) { + response.setStatus(0); + response.setMessage("主deviceIp参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setDeviceIp(entity.getDeviceIp()); + } + if (entity.getDeviceMac() != null && entity.getDeviceMac().length() > 1024) { + response.setStatus(0); + response.setMessage("主deviceMac参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setDeviceMac(entity.getDeviceMac()); + } + storeBusinessTicket.setSeqNo(entity.getSeqNo());// 当日流水号 + storeBusinessTicket.setWeather(entity.getWeather());// 天气 + storeBusinessTicket.setWeeker(entity.getWeeker());// 星期 + storeBusinessTicket.setEstimatedCost(entity.getEstimatedCost() == null ? 0D : entity.getEstimatedCost());// 预估成本 + storeBusinessTicket.setEstimatedProfitAmount(entity.getEstimatedProfitAmount() == null ? storeBusinessTicket.getPaid() : entity.getEstimatedProfitAmount());// 预估毛利金额 + if (entity.getEstimatedProfitMargin() == null) { + if (MathUtil.eq(BigDecimal.ZERO, new BigDecimal(storeBusinessTicket.getReceivable()))) { + storeBusinessTicket.setEstimatedProfitMargin(0D);// 预估毛利率 + } else { + storeBusinessTicket.setEstimatedProfitMargin(MathUtil.multiply(new BigDecimal(100), MathUtil.divide(new BigDecimal(storeBusinessTicket.getEstimatedProfitAmount()), new BigDecimal(storeBusinessTicket.getReceivable())), 4, BigDecimal.ROUND_HALF_UP).doubleValue());// 预估毛利率 + } + } else { + storeBusinessTicket.setEstimatedProfitMargin(entity.getEstimatedProfitMargin());// 预估毛利率 + } + storeBusinessTicket.setTotalCost(entity.getTotalCost() == null ? storeBusinessTicket.getEstimatedCost() : entity.getTotalCost());// 实际成本 + storeBusinessTicket.setProfitAmount(entity.getProfitAmount() == null ? storeBusinessTicket.getEstimatedProfitAmount() : entity.getProfitAmount());// 实际毛利金额 + storeBusinessTicket.setProfitMargin(entity.getProfitMargin() == null ? storeBusinessTicket.getEstimatedProfitMargin() : entity.getProfitMargin());// 实际毛利率 + if(entity.getExt2() != null){ + storeBusinessTicket.setExt2(entity.getExt2()); + } + + // 前台销售单优惠明细校验开始 + List ticketInfoList = new ArrayList<>(); + List storeBusinessTicketInfoEntityList = entity.getTicketInfo(); + if (storeBusinessTicketInfoEntityList != null && storeBusinessTicketInfoEntityList.size() > 0) { + for (StoreBusinessTicketInfoEntity storeBusinessTicketInfoEntity : storeBusinessTicketInfoEntityList) { + StoreBusinessTicketInfo storeBusinessTicketInfo = new StoreBusinessTicketInfo(); + storeBusinessTicketInfo.setCreateDate(createDate); + storeBusinessTicketInfo.setCreateUser("open-api"); + if (storeBusinessTicketInfoEntity.getClientId() == null || "".equals(storeBusinessTicketInfoEntity.getClientId()) || storeBusinessTicketInfoEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("销售单优惠ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicketInfo.setClientId(storeBusinessTicketInfoEntity.getClientId()); + } + storeBusinessTicketInfo.setStoreId(entity.getStoreId()); + storeBusinessTicketInfo.setBusNo(entity.getNo()); + storeBusinessTicketInfo.setType(storeBusinessTicketInfoEntity.getType()); + if (storeBusinessTicketInfoEntity.getInfo() != null && storeBusinessTicketInfoEntity.getInfo().length() > 256) { + response.setStatus(0); + response.setMessage("销售单优惠Info参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicketInfo.setInfo(storeBusinessTicketInfoEntity.getInfo()); + } + storeBusinessTicketInfo.setDiscountMoney(storeBusinessTicketInfoEntity.getDiscountMoney()); + storeBusinessTicketInfo.setSaleDate(entity.getSaleDate()); + ticketInfoList.add(storeBusinessTicketInfo); + } + } + // 门店菜品销售记录校验开始 + List orderProductList = new ArrayList<>(); + List storeOrderProductEntityList = entity.getOrderProduct(); + // 销售明细优惠 + List orderProductInfoList = new ArrayList<>(); + // 销售明细做法 + List makeList = new ArrayList<>(); + if (storeOrderProductEntityList != null && storeOrderProductEntityList.size() > 0) { + int lineNo = 0; + for (StoreOrderProductEntity storeOrderProductEntity : storeOrderProductEntityList) { + StoreOrderProduct storeOrderProduct = new StoreOrderProduct(); + storeOrderProduct.setCreateDate(createDate); + storeOrderProduct.setCreateUser("open-api"); + if (storeOrderProductEntity.getClientId() == null || "".equals(storeOrderProductEntity.getClientId()) || storeOrderProductEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ID参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setClientId(storeOrderProductEntity.getClientId()); + } + if (storeOrderProductEntity.getParentId() != null && storeOrderProductEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ParentId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setParentId(storeOrderProductEntity.getParentId()); + } + storeOrderProduct.setBusNo(entity.getNo()); + storeOrderProduct.setBusMode(entity.getBusMode()); + storeOrderProduct.setStoreId(entity.getStoreId()); + storeOrderProduct.setStoreNo(entity.getStoreNo()); + storeOrderProduct.setStoreName(entity.getStoreName()); + storeOrderProduct.setTableNo(entity.getTableNo()); + + //if (storeOrderProductEntity.getProductId() == null || "".equals(storeOrderProductEntity.getProductId()) || storeOrderProductEntity.getProductId().length() > 18 || Long.parseLong(storeOrderProductEntity.getProductId()) < 0) { + //去掉18位限制,2020-02-29 16:00 + if (storeOrderProductEntity.getProductId() == null || "".equals(storeOrderProductEntity.getProductId()) || Long.parseLong(storeOrderProductEntity.getProductId()) < 0) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductId(storeOrderProductEntity.getProductId()); + } + if (storeOrderProductEntity.getProductNo() != null && storeOrderProductEntity.getProductNo().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductNo(storeOrderProductEntity.getProductNo()); + } + if (storeOrderProductEntity.getProductName() == null || "".equals(storeOrderProductEntity.getProductName()) || storeOrderProductEntity.getProductName().length() > 128) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductName(storeOrderProductEntity.getProductName()); + } + if (storeOrderProductEntity.getProductUnitId() != null && storeOrderProductEntity.getProductUnitId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductUnitId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductUnitId(storeOrderProductEntity.getProductUnitId()); + } + if (storeOrderProductEntity.getProductUnitName() != null && storeOrderProductEntity.getProductUnitName().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductUnitName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductUnitName(storeOrderProductEntity.getProductUnitName()); + } + if (storeOrderProductEntity.getTypeId() != null && storeOrderProductEntity.getTypeId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录TypeId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setTypeId(storeOrderProductEntity.getTypeId()); + } + // =======2018-10-10 根据分类ID补全分类所属大类的ID、大类的名称、类别路径 + if (storeOrderProductEntity.getSeriesId() != null && storeOrderProductEntity.getSeriesId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SeriesId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSeriesId(storeOrderProductEntity.getSeriesId()); + } + if (storeOrderProductEntity.getSeriesName() != null && storeOrderProductEntity.getSeriesName().length() > 64) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SeriesName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSeriesName(storeOrderProductEntity.getSeriesName()); + } + if (storeOrderProductEntity.getTypePath() != null && storeOrderProductEntity.getTypePath().length() > 256) { + response.setStatus(0); + response.setMessage("门店菜品销售记录TypePath参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setTypePath(storeOrderProductEntity.getTypePath()); + } + // ===============END + if (storeOrderProductEntity.getTypeName() != null && storeOrderProductEntity.getTypeName().length() > 64) { + response.setStatus(0); + response.setMessage("门店菜品销售记录TypeName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setTypeName(storeOrderProductEntity.getTypeName()); + } + if (storeOrderProductEntity.getSpecId() != null && storeOrderProductEntity.getSpecId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SpecId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSpecId(storeOrderProductEntity.getSpecId()); + } + if (storeOrderProductEntity.getSpecName() != null && storeOrderProductEntity.getSpecName().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SpecName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSpecName(storeOrderProductEntity.getSpecName()); + } + storeOrderProduct.setCount(storeOrderProductEntity.getCount()); + storeOrderProduct.setRcount(storeOrderProductEntity.getRcount()); + storeOrderProduct.setPrice(storeOrderProductEntity.getPrice()); + storeOrderProduct.setDiscountPrice(storeOrderProductEntity.getDiscountPrice()); + storeOrderProduct.setPriceOrg(storeOrderProductEntity.getPriceOrg()); + storeOrderProduct.setIsSuit(storeOrderProductEntity.getIsSuit()); + if (storeOrderProductEntity.getSuitId() != null && storeOrderProductEntity.getSuitId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SuitId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSuitId(storeOrderProductEntity.getSuitId()); + } + if (storeOrderProductEntity.getSuitId() != null && storeOrderProductEntity.getSuitId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SuitId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSuitId(storeOrderProductEntity.getSuitId()); + } + storeOrderProduct.setWorkerNo(entity.getWorkNo()); + storeOrderProduct.setSaleDate(entity.getSaleDate());// 订单时间和销售时间一致 + storeOrderProduct.setDeviceName(entity.getDeviceName()); + storeOrderProduct.setDeviceMac(entity.getDeviceMac()); + storeOrderProduct.setDeviceIp(entity.getDeviceIp()); + storeOrderProduct.setPosNo(entity.getPosNo()); + storeOrderProduct.setAmount(storeOrderProductEntity.getAmount()); + storeOrderProduct.setDiscount(storeOrderProductEntity.getDiscount()); + storeOrderProduct.setDiscountTotal(storeOrderProductEntity.getDiscountTotal()); + storeOrderProduct.setReceivable(storeOrderProductEntity.getReceivable()); + storeOrderProduct.setAddPriceTotal(storeOrderProductEntity.getAddPriceTotal()); + storeOrderProduct.setDiscountAddTotal(storeOrderProductEntity.getDiscountAddTotal()); + storeOrderProduct.setAmountAddTotal(storeOrderProductEntity.getAmountAddTotal()); + storeOrderProduct.setAmountTotal(storeOrderProductEntity.getAmountTotal()); + storeOrderProduct.setReceivableTotal(storeOrderProductEntity.getReceivableTotal()); + storeOrderProduct.setIsMember(entity.getIsMember()); + storeOrderProduct.setMemberNo(entity.getMemberNo()); + lineNo++; + storeOrderProduct.setSeqNo(storeBusinessTicket.getSeqNo());// 当日流水号 + storeOrderProduct.setWeather(storeBusinessTicket.getWeather());// 天气 + storeOrderProduct.setWeeker(storeBusinessTicket.getWeeker());// 星期 + storeOrderProduct.setLineNo(storeOrderProductEntity.getLineNo() == null ? lineNo : storeOrderProductEntity.getLineNo());// 行号 + storeOrderProduct.setEstimatedCost(storeOrderProductEntity.getEstimatedCost() == null ? 0D : storeOrderProductEntity.getEstimatedCost());// 预估成本 + storeOrderProduct.setEstimatedProfitAmount(storeOrderProductEntity.getEstimatedProfitAmount() == null ? storeOrderProduct.getReceivableTotal() : storeOrderProductEntity.getEstimatedProfitAmount());// 预估毛利金额 + if (storeOrderProductEntity.getEstimatedProfitMargin() == null) { + if (MathUtil.eq(BigDecimal.ZERO, new BigDecimal(storeOrderProductEntity.getReceivableTotal()))) { + storeOrderProduct.setEstimatedProfitMargin(0D);// 预估毛利率 + } else { + storeOrderProduct.setEstimatedProfitMargin(MathUtil.multiply(new BigDecimal(100), MathUtil.divide(new BigDecimal(storeOrderProduct.getEstimatedProfitAmount()), new BigDecimal(storeOrderProduct.getReceivableTotal())), 4, BigDecimal.ROUND_HALF_UP).doubleValue());// 预估毛利率 + } + } else { + storeOrderProduct.setEstimatedProfitMargin(storeOrderProductEntity.getEstimatedProfitMargin());// 预估毛利率 + } + storeOrderProduct.setTotalCost(storeOrderProductEntity.getTotalCost() == null ? storeOrderProduct.getEstimatedCost() : storeOrderProductEntity.getTotalCost());// 实际成本 + storeOrderProduct.setProfitAmount(storeOrderProductEntity.getProfitAmount() == null ? storeOrderProduct.getEstimatedProfitAmount() : storeOrderProductEntity.getProfitAmount());// 实际毛利金额 + storeOrderProduct.setProfitMargin(storeOrderProductEntity.getProfitMargin() == null ? storeOrderProduct.getEstimatedProfitMargin() : storeOrderProductEntity.getProfitMargin());// 实际毛利率 + orderProductList.add(storeOrderProduct); + List storeOrderProductInfoEntityList = storeOrderProductEntity.getProductInfo(); + // 门店菜品销售记录优惠明细校验开始 + if (storeOrderProductInfoEntityList != null && storeOrderProductInfoEntityList.size() > 0) { + for (StoreOrderProductInfoEntity storeOrderProductInfoEntity : storeOrderProductInfoEntityList) { + StoreOrderProductInfo storeOrderProductInfo = new StoreOrderProductInfo(); + storeOrderProductInfo.setCreateDate(createDate); + storeOrderProductInfo.setCreateUser("open-api"); + if (storeOrderProductInfoEntity.getClientId() == null || "".equals(storeOrderProductInfoEntity.getClientId()) || storeOrderProductInfoEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("销售单记录优惠ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductInfo.setClientId(storeOrderProductInfoEntity.getClientId()); + } + + if (storeOrderProductInfoEntity.getOrderItemId() != null && storeOrderProductInfoEntity.getOrderItemId().length() > 64) { + response.setStatus(0); + response.setMessage("销售单记录优惠OrderItemId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductInfo.setOrderItemId(storeOrderProductInfoEntity.getOrderItemId()); + } + storeOrderProductInfo.setStoreId(entity.getStoreId()); + storeOrderProductInfo.setBusNo(entity.getNo()); + storeOrderProductInfo.setType(storeOrderProductInfoEntity.getType()); + if (storeOrderProductInfoEntity.getInfo() != null && storeOrderProductInfoEntity.getInfo().length() > 256) { + response.setStatus(0); + response.setMessage("销售单优惠记录Info参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductInfo.setInfo(storeOrderProductInfoEntity.getInfo()); + } + storeOrderProductInfo.setDiscountMoney(storeOrderProductInfoEntity.getDiscountMoney()); + storeOrderProductInfo.setSaleDate(entity.getSaleDate()); + orderProductInfoList.add(storeOrderProductInfo); + } + } + List storeOrderProductMakeEntityList = storeOrderProductEntity.getProductMake(); + // 门店菜品做法明细校验开始 + if (storeOrderProductMakeEntityList != null && storeOrderProductMakeEntityList.size() > 0) { + for (StoreOrderProductMakeEntity storeOrderProductMakeEntity : storeOrderProductMakeEntityList) { + StoreOrderProductMake storeOrderProductMake = new StoreOrderProductMake(); + storeOrderProductMake.setCreateDate(createDate); + storeOrderProductMake.setCreateUser("open-api"); + if (storeOrderProductMakeEntity.getClientId() == null || "".equals(storeOrderProductMakeEntity.getClientId()) || storeOrderProductMakeEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("菜品做法ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductMake.setClientId(storeOrderProductMakeEntity.getClientId()); + } + if (storeOrderProductMakeEntity.getOrderItemId() != null && storeOrderProductMakeEntity.getOrderItemId().length() > 64) { + response.setStatus(0); + response.setMessage("菜品做法OrderItemId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductMake.setOrderItemId(storeOrderProductMakeEntity.getOrderItemId()); + } + storeOrderProductMake.setStoreId(entity.getStoreId()); + storeOrderProductMake.setStoreNo(entity.getStoreNo()); + storeOrderProductMake.setStoreName(entity.getStoreName()); + storeOrderProductMake.setBusNo(entity.getNo()); + if (storeOrderProductMakeEntity.getMakeId() != null && storeOrderProductMakeEntity.getMakeId().length() > 32) { + response.setStatus(0); + response.setMessage("菜品做法makeId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductMake.setMakeId(storeOrderProductMakeEntity.getMakeId()); + } + if (storeOrderProductMakeEntity.getMakeName() != null && storeOrderProductMakeEntity.getMakeName().length() > 32) { + response.setStatus(0); + response.setMessage("菜品做法makeName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductMake.setMakeName(storeOrderProductMakeEntity.getMakeName()); + } + storeOrderProductMake.setAddPrice(storeOrderProductMakeEntity.getAddPrice()); + storeOrderProductMake.setDiscountPrice(storeOrderProductMakeEntity.getDiscountPrice()); + storeOrderProductMake.setCount(storeOrderProductMakeEntity.getCount()); + storeOrderProductMake.setRcount(storeOrderProductMakeEntity.getRcount()); + storeOrderProductMake.setAddTotal(storeOrderProductMakeEntity.getAddTotal()); + storeOrderProductMake.setDiscountAddTotal(storeOrderProductMakeEntity.getDiscountAddTotal()); + storeOrderProductMake.setDiscount(storeOrderProductMakeEntity.getDiscount()); + storeOrderProductMake.setQtyFlag(storeOrderProductMakeEntity.getQtyFlag()); + storeOrderProductMake.setHand(storeOrderProductMakeEntity.getHand()); + storeOrderProductMake.setSaleDate(entity.getSaleDate()); + makeList.add(storeOrderProductMake); + } + } + } + } else { + Map data = new HashMap<>(); + data.put("busNo", storeBusinessTicket.getNo()); + data.put("ticketId", new Date().getTime()); + response.setStatus(1); + response.setMessage("销售数据上传成功"); + response.setData(data); + logger.error("无销售明细的数据上传jsonString:" + tenantId + "" + storeBusinessTicket.getStoreNo()); + return response; + } + // 门店菜品销售记录优惠明细校验开始 + List payList = new ArrayList<>(); + List storePayEntityList = entity.getPay(); + if (storePayEntityList != null && storePayEntityList.size() > 0) { + for (StorePayEntity storePayEntity : storePayEntityList) { + StorePay storePay = new StorePay(); + storePay.setCreateDate(createDate); + storePay.setCreateUser("open-api"); + if (storePayEntity.getClientId() == null || "".equals(storePayEntity.getClientId()) || storePayEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("支付记录ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setClientId(storePayEntity.getClientId()); + } + storePay.setStoreId(entity.getStoreId()); + storePay.setStoreNo(entity.getStoreNo()); + storePay.setStoreName(entity.getStoreName()); + storePay.setBusNo(entity.getNo()); + storePay.setBusMode(entity.getBusMode()); + if (storePayEntity.getPayNo() == null || "".equals(storePayEntity.getPayNo()) || storePayEntity.getPayNo().length() > 32) { + response.setStatus(0); + response.setMessage("支付记录BusNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setPayNo(storePayEntity.getPayNo()); + } + storePay.setTableNo(entity.getTableNo()); + if (storePayEntity.getPayTypeNo() == null || "".equals(storePayEntity.getPayTypeNo()) || storePayEntity.getPayTypeNo().length() > 32) { + response.setStatus(0); + response.setMessage("支付记录PayTypeNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setPayTypeNo(storePayEntity.getPayTypeNo()); + } + if (storePayEntity.getPayType() != null && storePayEntity.getPayType().length() > 16) { + response.setStatus(0); + response.setMessage("支付记录payType参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setPayType(storePayEntity.getPayType()); + } + storePay.setPaid(storePayEntity.getPaid()); + storePay.setRchange(storePayEntity.getRchange()); + storePay.setMoney(storePayEntity.getMoney()); + storePay.setOverAmount(storePayEntity.getOverAmount()); + storePay.setWorkNo(entity.getWorkNo()); + storePay.setDeviceName(entity.getDeviceName()); + storePay.setDeviceMac(entity.getDeviceMac()); + storePay.setDeviceIp(entity.getDeviceIp()); + storePay.setPosNo(entity.getPosNo()); + if (storePayEntity.getVoucherNo() != null && storePayEntity.getVoucherNo().length() > 128) { + response.setStatus(0); + response.setMessage("支付记录VoucherNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setVoucherNo(storePayEntity.getVoucherNo()); + } + storePay.setPayDate(entity.getSaleDate());// 订单时间和销售时间一致 + if (storePayEntity.getCardno() != null && storePayEntity.getCardno().length() > 32) { + response.setStatus(0); + response.setMessage("支付记录Cardno参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setCardno(storePayEntity.getCardno()); + } + storePay.setCardYe(storePayEntity.getCardYe()); + storePay.setCardJf(storePayEntity.getCardJf()); + storePay.setIncomeFlag(storePayEntity.getIncomeFlag()); + storePay.setOtherRateType(storePayEntity.getOtherRateType()); + storePay.setOtherRateValue(storePayEntity.getOtherRateValue()); + storePay.setOtherRate(storePayEntity.getOtherRate()); + storePay.setPayChannel(storePayEntity.getPayChannel()); + if (storePayEntity.getMemo() != null && storePayEntity.getMemo().length() > 256) { + response.setStatus(0); + response.setMessage("支付记录Memo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setMemo(storePayEntity.getMemo()); + } + if(StringUtils.isNotEmpty(storePayEntity.getExt1())){ + storePay.setExt1(storePayEntity.getExt1()); + } + if(StringUtils.isNotEmpty(storePayEntity.getExt2())){ + storePay.setExt2(storePayEntity.getExt2()); + } + payList.add(storePay); + } + } + + // 前台销售单外送信息校验开始,2017-12-23 + List deliveryList = new ArrayList<>(); + List deliveryEntityList = entity.getDeliveryInfo(); + if (CollectionUtils.isNotEmpty(deliveryEntityList)) { + for (StoreBusinessTicketDeliveryEntity deliveryEntity : deliveryEntityList) { + StoreBusinessTicketDelivery delivery = new StoreBusinessTicketDelivery(); + delivery.setCreateDate(createDate); + delivery.setCreateUser("open-api"); + if (deliveryEntity.getClientId() == null || "".equals(deliveryEntity.getClientId()) || deliveryEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("外送信息ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + delivery.setClientId(deliveryEntity.getClientId()); + } + delivery.setStoreId(entity.getStoreId());// 门店ID + delivery.setBusNo(entity.getNo());// 单据编号 + delivery.setOrderTime(deliveryEntity.getOrderTime());// 订餐时间 + delivery.setVisitorName(deliveryEntity.getVisitorName());// 订餐人 + delivery.setOrderTel(deliveryEntity.getOrderTel());// 订餐电话 + delivery.setRecipientName(deliveryEntity.getRecipientName());// 收货人名称 + delivery.setRecipientPhone(deliveryEntity.getRecipientPhone());// 收货人电话 + delivery.setRecipientAddress(deliveryEntity.getRecipientAddress());// 收货人地址 + delivery.setDeliveryWorkerNo(deliveryEntity.getDeliveryWorkerNo());// 送餐员工号 + delivery.setDeliveryWorkerName(deliveryEntity.getDeliveryWorkerName());// 送餐员名称 + delivery.setAdvanceAmount(deliveryEntity.getAdvanceAmount());// 预支金额 + delivery.setDistributionFee(deliveryEntity.getDistributionFee());// 加收服务费 + delivery.setDeliveryBeginTime(deliveryEntity.getDeliveryBeginTime());// 送出时间 + delivery.setDeliveryEndTime(deliveryEntity.getDeliveryEndTime());// 送达时间 + delivery.setSettlementTime(deliveryEntity.getSettlementTime());// 交账时间 + deliveryList.add(delivery); + } + } + try { + long ticketId = IdWorkerUtils.getInstance().nextId(); + storeBusinessTicket.setId(String.valueOf(ticketId)); + // 放入消息队列 + Map message = new HashMap<>(); + message.put("type", "businessorderplus"); + message.put("storeBusinessTicket", storeBusinessTicket); + message.put("ticketInfoList", ticketInfoList); + message.put("orderProductList", orderProductList); + message.put("orderProductInfoList", orderProductInfoList); + message.put("payList", payList); + message.put("makeList", makeList); + message.put("deliveryList", deliveryList); + CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString()); + this.mqMessageSender.send4businessorderplus(tenantId, message, correlationData); + Map data = new HashMap<>(); + data.put("busNo", storeBusinessTicket.getNo()); + data.put("ticketId", ticketId); + response.setStatus(1); + response.setMessage("销售数据上传成功"); + response.setData(data); + } catch (Exception ex) { + logger.error("数据上传(加强版)放入消息队列时发生异常", ex); + Map data = new HashMap<>(); + data.put("busNo", storeBusinessTicket.getNo()); + data.put("ticketId", ""); + response.setStatus(2); + response.setMessage("服务器繁忙,请稍后再传"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + response.setData(data); + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + logger.error("jsonString:" + jsonString); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + + @ServiceMethod(method = "splitFoodAccount.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "菜品和账户关联数据") + @Override + public Object splitFoodAccount(SplitFoodAccountRequest request) { + String info = "菜品和账户关联数据"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + /*String jsonString = request.getJsonString(); + JSONObject json = JSONObject.parseObject(jsonString); + String shopId=json.getString("shopId");*/ + String storeId=request.getStoreId(); + DataPageResponse response = null; + try { + response = new DataPageResponse(); + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + pager = foodAccountService.getPager(tenantId, criteria, pager); + Map data = new HashMap<>(); + data.put("date", new Date().getTime()); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + response.setList(source); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + response.setStatus(0); + //response.setMessage("获取失败"); + response.setErrMessage("获取失败"); + response.setErrCode("TYPE_ERROR"); + //return new BusinessServiceErrorResponse(request.getWopRequestContext(), "TYPE_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "splitShopAccount.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "店铺分帐户数据") + @Override + public Object splitShopAccount(SplitShopAccountRequest request) { + String info = "店铺分帐户数据"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + String storeId=request.getStoreId(); + DataPageResponse response = null; + try { + response = new DataPageResponse(); + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("shopId", storeId)); + pager = shopAccountService.getPager(tenantId, criteria, pager); + Map data = new HashMap<>(); + data.put("date", new Date().getTime()); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + response.setList(source); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + response.setStatus(0); + //response.setMessage("获取失败"); + response.setErrMessage("获取失败"); + response.setErrCode("TYPE_ERROR"); + //return new BusinessServiceErrorResponse(request.getWopRequestContext(), "TYPE_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + + @ServiceMethod(method = "splitStorePay.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "商品类别") + @Override + public Object splitStorePay(SplitStorePayRequet request) { + String info = "店铺分帐流水数据"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + //criteria.add(Restrictions.eq("deleteFlag", 0)); + pager = storePayService.getPager(tenantId, criteria, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (ProductType dishType : source) { + Map map = new HashMap<>(); + map.put("tenantId", dishType.getTenantId()); + map.put("id", dishType.getId()); + map.put("parentId", dishType.getParentId()); + map.put("path", dishType.getPath()); + map.put("no", dishType.getNo()); + map.put("name", dishType.getName()); + map.put("color", dishType.getColor()); + map.put("sign", dishType.getSign());// 标识符 + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "TYPE_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + /** + * 验证是否启用自动耗料 + */ + private boolean validEnableZdhl(String tenantId) { + String info = "验证[" + tenantId + "]是否启用自动耗料"; + logger.debug(">>>>>>>" + info + "。。。"); + boolean result = false; + try { + // 可引入缓存,验证结果放入缓存10分钟后失效 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketSign", "storeStock")); + List settinglist = settingService.getList(tenantId, criteria); + Map settingMap = new HashMap<>(); + for (TicketPrintSetting setting : settinglist) { + settingMap.put(setting.getKey(), setting); + } + result = settingMap.get("zdhl") != null && StringUtils.equalsIgnoreCase("1", settingMap.get("zdhl").getValue()); + } catch (Exception ex) { + logger.error(info + "时,发生异常", ex); + } + logger.debug(">>>>>>>" + info + "。。。result:" + result); + return result; + } + + /** + * 生成订单编号 时间戳+3位整数 + * @return + */ + public static String autoOrderId(){ + + Date date = new Date(); + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String str = format.format(date); + Date orderId = null; + Random rand = new Random(); + //[900]:900个 100:从100 + int x = rand.nextInt(900) + 100; + try { + orderId = format.parse(str); + } catch (ParseException e) { + e.printStackTrace(); + } + return String.valueOf(orderId.getTime()) + x; + } + + public static void main(String[] args) { + String id=System.currentTimeMillis()+""; + //String id=""; + Random rand = new Random(); + //[900]:900个 100:从100 + int x = rand.nextInt(900) + 100; + System.out.println(id+x); + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/storage/StoreCostTicketServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/storage/StoreCostTicketServiceImpl.java new file mode 100644 index 0000000..4b5165a --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/storage/StoreCostTicketServiceImpl.java @@ -0,0 +1,1111 @@ +package com.jwsaas.api.service.impl.storage; + +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import com.jwsaas.api.request.storage.*; +import com.jwsaas.api.request.weixin.DaySummaryByDateRangeRequest; +import com.jwsaas.entity.food.*; +import com.jwsaas.service.food.ProductTypeService; +import com.jwsaas.service.food.StoreBusinessTicketService; +import com.jwsaas.service.food.StoreOrderProductService; +import com.jwsaas.service.food.StorePayService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; + +import com.alibaba.fastjson.JSONObject; +import com.jwsaas.api.entity.storage.StoreCostTicketEntity; +import com.jwsaas.api.entity.storage.StoreCostTicketPayTypeEntity; +import com.jwsaas.api.entity.storage.StoreCostTicketProductChangeEntity; +import com.jwsaas.api.entity.storage.StoreCostTicketProductFixedChangeEntity; +import com.jwsaas.api.entity.storage.StoreCostTicketProductMoreChangeEntity; +import com.jwsaas.api.entity.storage.StoreCostTicketProductOtherChangeEntity; +import com.jwsaas.api.entity.storage.StoreCostTicketProductTypeEntity; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.response.mode.CommonPagerResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.storage.StoreCostTicketService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.pager.Pager; +import com.jwsaas.utils.AppKeyUtil; + +@ServiceMethodBean(version = "1.0") +public class StoreCostTicketServiceImpl extends WopServiceImpl implements StoreCostTicketService { + + private static final long serialVersionUID = -5120131702336263054L; + + @Resource + private com.jwsaas.service.food.StoreService storeService; + + @Resource + private com.jwsaas.service.food.CostTicketService costTicketService; + + @Resource + private com.jwsaas.service.food.CostTicketProductTypeService costTicketProductTypeService; + + @Resource + private com.jwsaas.service.food.CostTicketPayTypeService costTicketPayTypeService; + + @Resource + private com.jwsaas.service.food.CostTicketProductChangeService costTicketProductChangeService; + + @Resource + private com.jwsaas.service.food.CostTicketProductMoreChangeService costTicketProductMoreChangeService; + + @Resource + private com.jwsaas.service.food.CostTicketProductFixedChangeService costTicketProductFixedChangeService; + + @Resource + private com.jwsaas.service.food.CostTicketProductOtherChangeService costTicketProductOtherChangeService; + + @Resource + private StoreBusinessTicketService storeBusinessTicketService; + @Resource + private StoreOrderProductService storeOrderProductService; + @Resource + private StorePayService storePayService; + @Resource + private ProductTypeService productTypeService; + + + @ServiceMethod(method = "store.cost.ticket", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "经营会计报表") + @Override + public Object storeCostTicket(StoreCostTicketRequest request) { + String info = "经营会计报表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + String no = request.getNo();// 单号 + Integer status = request.getStatus();// 单据状态 + String startTime = request.getStartTime();// 开始时间 + String endTime = request.getEndTime();// 结束时间 + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", request.getStoreId()));// 单据编号 + if (StringUtils.isNotEmpty(no)) { + criteria.add(Restrictions.like("no", "%"+no+"%"));// 单据编号 + } + if (status >= 0) { + criteria.add(Restrictions.eq("status", status));// 单据状态 + } + if (StringUtils.isNotEmpty(startTime)) { + criteria.add(Restrictions.ge("summaryDate", startTime));// 开始时间 + } + if (StringUtils.isNotEmpty(endTime)) { + criteria.add(Restrictions.le("summaryDate", endTime));// 结束时间 + } + + criteria.add(Restrictions.order("summaryDate", "desc")); + pager = costTicketService.getPager(tenantId, criteria, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List dataList = (List) pager.getList(); + for (CostTicket ticket : dataList) { + Map map = new HashMap<>(); + map.put("id", ticket.getId()); + map.put("tenantId", ticket.getTenantId()); + map.put("no", ticket.getNo());// 单据编号 + map.put("storeId", ticket.getStoreId());// 门店ID + map.put("storeNo", ticket.getStoreNo());// 门店编号 + map.put("storeName", ticket.getStoreName());// 门店名称 + map.put("description", ticket.getDescription());// 备注信息 + map.put("status", ticket.getStatus());// 单据状态 + map.put("amount", ticket.getAmount());// 营业额 + map.put("discountAmount", ticket.getDiscountAmount());// 折扣金额 + map.put("receivableAmount", ticket.getReceivableAmount());// 应收金额 + map.put("boxAmount", ticket.getBoxAmount());// 餐盒费 + map.put("workerAmount", ticket.getWorkerAmount());// 员工餐 + map.put("summaryDate", ticket.getSummaryDate());// 汇总日期 + map.put("checkPeople", ticket.getCheckPeople());// 审核人 + map.put("checkDate", formatYMDHMS(ticket.getCheckDate()));// 审核日期 + map.put("ticketCount", ticket.getTicketCount());// 营业单数 + map.put("peoplePrice", ticket.getPeoplePrice());// 客单价 + map.put("profit", ticket.getProfit());// 纯利润 + map.put("totalCost", ticket.getTotalCost());// 今日总成本 + map.put("difTotalCost", ticket.getDifTotalCost());// 成日成本总差额 + map.put("createUser", ticket.getCreateUser());// 制单人 + map.put("createDate", formatYMDHMS(ticket.getCreateDate()));// 制单时间 + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.cost.ticket.detail", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "经营会计报表详情") + @Override + public Object storeCostTicketDetail(StoreCostTicketDetailRequest request) { + String info = "经营会计报表详情"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String ticketId = request.getTicketId();// 订单ID + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + CostTicket ticket = costTicketService.get(tenantId, ticketId); + if (ticket == null) { + response.setStatus(0); + response.setMessage("经营会计报表信息不存在"); + response.setErrCode(CommonErrorCode.error23.getCode()); + response.setErrMessage(CommonErrorCode.error23.getMessage()); + return response; + } + // 第一步加载主单信息 + Map map = new HashMap<>(); + map.put("id", ticket.getId()); + map.put("tenantId", ticket.getTenantId()); + map.put("no", ticket.getNo());// 单据编号 + map.put("storeId", ticket.getStoreId());// 门店ID + map.put("storeNo", ticket.getStoreNo());// 门店编号 + map.put("storeName", ticket.getStoreName());// 门店名称 + map.put("description", ticket.getDescription());// 备注信息 + map.put("status", ticket.getStatus());// 单据状态 + map.put("amount", ticket.getAmount());// 营业额 + map.put("discountAmount", ticket.getDiscountAmount());// 折扣金额 + map.put("receivableAmount", ticket.getReceivableAmount());// 应收金额 + map.put("boxAmount", ticket.getBoxAmount());// 餐盒费 + map.put("workerAmount", ticket.getWorkerAmount());// 员工餐 + map.put("summaryDate", ticket.getSummaryDate());// 汇总日期 + map.put("checkPeople", ticket.getCheckPeople());// 审核人 + map.put("checkDate", formatYMDHMS(ticket.getCheckDate()));// 审核日期 + map.put("ticketCount", ticket.getTicketCount());// 营业单数 + map.put("peoplePrice", ticket.getPeoplePrice());// 客单价 + map.put("profit", ticket.getProfit());// 纯利润 + map.put("totalCost", ticket.getTotalCost());// 今日总成本 + map.put("difTotalCost", ticket.getDifTotalCost());// 成日成本总差额 + map.put("createUser", ticket.getCreateUser());// 制单人 + map.put("createDate", formatYMDHMS(ticket.getCreateDate()));// 制单时间 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", request.getStoreId()));// 门店ID + criteria.add(Restrictions.eq("ticketId", request.getTicketId()));// 订单明细ID + // 第二步加载分类汇总 + List productTypeList = costTicketProductTypeService.getList(tenantId, criteria); + List> productTypeMap = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(productTypeList)) { + for (CostTicketProductType costTicketProductType : productTypeList) { + Map mapType = new HashMap<>(); + mapType.put("id", costTicketProductType.getId()); + mapType.put("tenantId", costTicketProductType.getTenantId()); + mapType.put("ticketId", costTicketProductType.getTicketId()); + mapType.put("ticketNo", costTicketProductType.getTicketNo()); + mapType.put("storeId", costTicketProductType.getStoreId()); + mapType.put("storeNo", costTicketProductType.getStoreNo()); + mapType.put("storeName", costTicketProductType.getStoreName()); + mapType.put("summaryDate", costTicketProductType.getSummaryDate()); + mapType.put("typeId", costTicketProductType.getTypeId()); + mapType.put("typeNo", costTicketProductType.getTypeNo()); + mapType.put("typeName", costTicketProductType.getTypeName()); + mapType.put("money", costTicketProductType.getMoney()); + productTypeMap.add(mapType); + } + } + map.put("productType", productTypeMap); + // 第三步加载支付汇总 + List payTypeList = costTicketPayTypeService.getList(tenantId, criteria); + List> payTypeMap = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(payTypeList)) { + for (CostTicketPayType costTicketPayType : payTypeList) { + Map mapType = new HashMap<>(); + mapType.put("id", costTicketPayType.getId()); + mapType.put("tenantId", costTicketPayType.getTenantId()); + mapType.put("ticketId", costTicketPayType.getTicketId()); + mapType.put("ticketNo", costTicketPayType.getTicketNo()); + mapType.put("storeId", costTicketPayType.getStoreId()); + mapType.put("storeNo", costTicketPayType.getStoreNo()); + mapType.put("storeName", costTicketPayType.getStoreName()); + mapType.put("summaryDate", costTicketPayType.getSummaryDate()); + mapType.put("payTypeNo", costTicketPayType.getPayTypeNo()); + mapType.put("payTypeName", costTicketPayType.getPayTypeName()); + mapType.put("otherRateType", costTicketPayType.getOtherRateType()); + mapType.put("otherRateValue", costTicketPayType.getOtherRateValue()); + mapType.put("money", costTicketPayType.getMoney()); + mapType.put("realMoney", costTicketPayType.getRealMoney()); + payTypeMap.add(mapType); + } + } + map.put("payType", payTypeMap); + // 第四步加载生成变动成本 + List productChangeList = costTicketProductChangeService.getList(tenantId, criteria); + List> productChangeMap = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(productChangeList)) { + for (CostTicketProductChange costTicketProductChange : productChangeList) { + Map mapType = new HashMap<>(); + mapType.put("id", costTicketProductChange.getId()); + mapType.put("tenantId", costTicketProductChange.getTenantId()); + mapType.put("ticketId", costTicketProductChange.getTicketId()); + mapType.put("ticketNo", costTicketProductChange.getTicketNo()); + mapType.put("storeId", costTicketProductChange.getStoreId()); + mapType.put("storeNo", costTicketProductChange.getStoreNo()); + mapType.put("storeName", costTicketProductChange.getStoreName()); + mapType.put("summaryDate", costTicketProductChange.getSummaryDate()); + mapType.put("typeId", costTicketProductChange.getTypeId()); + mapType.put("typeNo", costTicketProductChange.getTypeNo()); + mapType.put("typeName", costTicketProductChange.getTypeName()); + mapType.put("productId", costTicketProductChange.getProductId()); + mapType.put("productNo", costTicketProductChange.getProductNo()); + mapType.put("productName", costTicketProductChange.getProductName()); + mapType.put("specId", costTicketProductChange.getSpecId()); + mapType.put("specName", costTicketProductChange.getSpecName()); + mapType.put("packUnitId", costTicketProductChange.getPackUnitId()); + mapType.put("costType", costTicketProductChange.getCostType()); + mapType.put("yeterdayStock", costTicketProductChange.getYeterdayStock()); + mapType.put("todayIn", costTicketProductChange.getTodayIn()); + mapType.put("todayStock", costTicketProductChange.getTodayStock()); + mapType.put("todayLoss", costTicketProductChange.getTodayLoss()); + mapType.put("todayUse", costTicketProductChange.getTodayUse()); + mapType.put("posUse", costTicketProductChange.getPosUse()); + mapType.put("difUse", costTicketProductChange.getDifUse()); + mapType.put("difMoney", costTicketProductChange.getDifMoney()); + mapType.put("cost", costTicketProductChange.getCost()); + mapType.put("salePro", costTicketProductChange.getSalePro()); + mapType.put("standard", costTicketProductChange.getStandard()); + mapType.put("difStandard", costTicketProductChange.getDifStandard()); + mapType.put("memo", costTicketProductChange.getExt1()); + productChangeMap.add(mapType); + } + } + map.put("productChange", productChangeMap); + // 第四步加载生成变动成本 + List productMoreChangeList = costTicketProductMoreChangeService.getList(tenantId, criteria); + List> productMoreChangeMap = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(productMoreChangeList)) { + for (CostTicketProductMoreChange costTicketProductMoreChange : productMoreChangeList) { + Map mapType = new HashMap<>(); + mapType.put("id", costTicketProductMoreChange.getId()); + mapType.put("tenantId", costTicketProductMoreChange.getTenantId()); + mapType.put("ticketId", costTicketProductMoreChange.getTicketId()); + mapType.put("ticketNo", costTicketProductMoreChange.getTicketNo()); + mapType.put("storeId", costTicketProductMoreChange.getStoreId()); + mapType.put("storeNo", costTicketProductMoreChange.getStoreNo()); + mapType.put("storeName", costTicketProductMoreChange.getStoreName()); + mapType.put("summaryDate", costTicketProductMoreChange.getSummaryDate()); + mapType.put("typeId", costTicketProductMoreChange.getTypeId()); + mapType.put("typeNo", costTicketProductMoreChange.getTypeNo()); + mapType.put("typeName", costTicketProductMoreChange.getTypeName()); + mapType.put("productId", costTicketProductMoreChange.getProductId()); + mapType.put("productNo", costTicketProductMoreChange.getProductNo()); + mapType.put("productName", costTicketProductMoreChange.getProductName()); + mapType.put("specId", costTicketProductMoreChange.getSpecId()); + mapType.put("specName", costTicketProductMoreChange.getSpecName()); + mapType.put("packUnitId", costTicketProductMoreChange.getPackUnitId()); + mapType.put("costType", costTicketProductMoreChange.getCostType()); + mapType.put("yeterdayStock", costTicketProductMoreChange.getYeterdayStock()); + mapType.put("todayIn", costTicketProductMoreChange.getTodayIn()); + mapType.put("todayStock", costTicketProductMoreChange.getTodayStock()); + mapType.put("todayLoss", costTicketProductMoreChange.getTodayLoss()); + mapType.put("todayUse", costTicketProductMoreChange.getTodayUse()); + mapType.put("posUse", costTicketProductMoreChange.getPosUse()); + mapType.put("difUse", costTicketProductMoreChange.getDifUse()); + mapType.put("difMoney", costTicketProductMoreChange.getDifMoney()); + mapType.put("cost", costTicketProductMoreChange.getCost()); + mapType.put("salePro", costTicketProductMoreChange.getSalePro()); + mapType.put("standard", costTicketProductMoreChange.getStandard()); + mapType.put("difStandard", costTicketProductMoreChange.getDifStandard()); + productMoreChangeMap.add(mapType); + } + } + map.put("productMoreChange", productMoreChangeMap); + // 第五步加载其他变动费 + List productOtherChangeList = costTicketProductOtherChangeService.getList(tenantId, criteria); + List> productOtherChangeMap = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(productOtherChangeList)) { + for (CostTicketProductOtherChange costTicketProductOtherChange : productOtherChangeList) { + Map mapType = new HashMap<>(); + mapType.put("id", costTicketProductOtherChange.getId()); + mapType.put("tenantId", costTicketProductOtherChange.getTenantId()); + mapType.put("ticketId", costTicketProductOtherChange.getTicketId()); + mapType.put("ticketNo", costTicketProductOtherChange.getTicketNo()); + mapType.put("storeId", costTicketProductOtherChange.getStoreId()); + mapType.put("storeNo", costTicketProductOtherChange.getStoreNo()); + mapType.put("storeName", costTicketProductOtherChange.getStoreName()); + mapType.put("summaryDate", costTicketProductOtherChange.getSummaryDate()); + mapType.put("typeNo", costTicketProductOtherChange.getTypeNo()); + mapType.put("typeName", costTicketProductOtherChange.getTypeName()); + mapType.put("typeId", costTicketProductOtherChange.getTypeId()); + mapType.put("typePath", costTicketProductOtherChange.getTypePath()); + mapType.put("itemId", costTicketProductOtherChange.getItemId()); + mapType.put("no", costTicketProductOtherChange.getNo()); + mapType.put("name", costTicketProductOtherChange.getName()); + mapType.put("type", costTicketProductOtherChange.getType()); + mapType.put("money", costTicketProductOtherChange.getMoney()); + productOtherChangeMap.add(mapType); + } + } + map.put("productOtherChange", productOtherChangeMap); + // 第六步加载固定费 + List productFixedChangeList = costTicketProductFixedChangeService.getList(tenantId, criteria); + List> productFixedChangeMap = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(productFixedChangeList)) { + for (CostTicketProductFixedChange costTicketProductFixedChange : productFixedChangeList) { + Map mapType = new HashMap<>(); + mapType.put("id", costTicketProductFixedChange.getId()); + mapType.put("tenantId", costTicketProductFixedChange.getTenantId()); + mapType.put("ticketId", costTicketProductFixedChange.getTicketId()); + mapType.put("ticketNo", costTicketProductFixedChange.getTicketNo()); + mapType.put("storeId", costTicketProductFixedChange.getStoreId()); + mapType.put("storeNo", costTicketProductFixedChange.getStoreNo()); + mapType.put("storeName", costTicketProductFixedChange.getStoreName()); + mapType.put("summaryDate", costTicketProductFixedChange.getSummaryDate()); + mapType.put("typeId", costTicketProductFixedChange.getTypeId()); + mapType.put("typePath", costTicketProductFixedChange.getTypePath()); + mapType.put("typeNo", costTicketProductFixedChange.getTypeNo()); + mapType.put("typeName", costTicketProductFixedChange.getTypeName()); + mapType.put("itemId", costTicketProductFixedChange.getItemId()); + mapType.put("no", costTicketProductFixedChange.getNo()); + mapType.put("name", costTicketProductFixedChange.getName()); + mapType.put("type", costTicketProductFixedChange.getType()); + mapType.put("money", costTicketProductFixedChange.getMoney()); + productFixedChangeMap.add(mapType); + } + } + map.put("productFixedChange", productFixedChangeMap); + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(map); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.cost.ticket.save", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "经营会计报表保存") + @Override + public Object storeCostTicketSave(StoreCostTicketSaveRequest request) { + + String info = "经营会计报表保存"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId();// 门店ID + String jsonString = request.getJsonString();// 盘存数据 + String operator = request.getOperator();// 操作员 + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Store store = storeService.get(tenantId, storeId); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + logger.info(info + "========>" + jsonString); + StoreCostTicketEntity entity = new StoreCostTicketEntity(JSONObject.parseObject(jsonString)); + Date createDate = new Date(); + CostTicket ticket = new CostTicket(); + ticket.setCreateDate(createDate); + ticket.setCreateUser(operator); + ticket.setAmount(entity.getAmount()); + ticket.setBoxAmount(entity.getBoxAmount()); + if (StringUtils.isNotEmpty(entity.getDescription()) && entity.getDescription().length() > 128) { + response.setStatus(0); + response.setMessage("盘存表备注说明参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ticket.setDescription(entity.getDescription()); + ticket.setDifTotalCost(entity.getDifTotalCost()); + ticket.setDiscountAmount(entity.getDiscountAmount()); + if (StringUtils.isEmpty(entity.getNo()) || entity.getNo().length() > 32) { + response.setStatus(0); + response.setMessage("盘存表单据号参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ticket.setNo(entity.getNo()); + ticket.setPeoplePrice(entity.getPeoplePrice()); + ticket.setProfit(entity.getProfit()); + ticket.setReceivableAmount(entity.getReceivableAmount()); + ticket.setStatus(0); + ticket.setStoreId(storeId); + ticket.setStoreNo(store.getNo()); + ticket.setStoreName(store.getName()); + if (StringUtils.isEmpty(entity.getSummaryDate()) || entity.getSummaryDate().length() > 32) { + response.setStatus(0); + response.setMessage("盘存表汇总日期不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("summaryDate", entity.getSummaryDate())); + criteria.add(Restrictions.eq("status", 1)); + criteria.add(Restrictions.eq("storeId",storeId)); + List ticketList = costTicketService.getList(tenantId, criteria); + if (CollectionUtils.isNotEmpty(ticketList)) { + response.setStatus(0); + response.setMessage("今天已经创建过盘点单了,不允许再次保存"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ticket.setSummaryDate(entity.getSummaryDate()); + ticket.setTenantId(tenantId); + ticket.setTicketCount(entity.getTicketCount()); + ticket.setTotalCost(entity.getTotalCost()); + ticket.setWorkerAmount(entity.getWorkerAmount()); + ticketList = costTicketService.findList(tenantId, "no", entity.getNo()); + if (CollectionUtils.isNotEmpty(ticketList)) { + response.setStatus(0); + response.setMessage("盘存表单据号已存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + // 第二步汇总商品类别 + List productTypeList = entity.getProductTypeList(); + List productType = new ArrayList<>(); + for (StoreCostTicketProductTypeEntity productTypeEntity : productTypeList) { + CostTicketProductType costTicketProductType = new CostTicketProductType(); + costTicketProductType.setCreateDate(createDate); + costTicketProductType.setCreateUser(operator); + costTicketProductType.setMoney(productTypeEntity.getMoney()); + costTicketProductType.setStoreId(storeId); + costTicketProductType.setStoreName(ticket.getStoreName()); + costTicketProductType.setStoreNo(ticket.getStoreNo()); + costTicketProductType.setSummaryDate(ticket.getSummaryDate()); + costTicketProductType.setTenantId(tenantId); + costTicketProductType.setTicketNo(ticket.getNo()); + costTicketProductType.setTypeId(productTypeEntity.getTypeId()); + costTicketProductType.setTypeName(productTypeEntity.getTypeName()); + costTicketProductType.setTypeNo(productTypeEntity.getTypeNo()); + productType.add(costTicketProductType); + } + // 第三步汇总支付汇总 + List payTypeList = entity.getPayTypeList(); + List payType = new ArrayList<>(); + for (StoreCostTicketPayTypeEntity payTypeEntity : payTypeList) { + CostTicketPayType costTicketPayType = new CostTicketPayType(); + costTicketPayType.setCreateDate(createDate); + costTicketPayType.setCreateUser(operator); + costTicketPayType.setMoney(payTypeEntity.getMoney()); + costTicketPayType.setOtherRateType(payTypeEntity.getOtherRateType()); + costTicketPayType.setOtherRateValue(payTypeEntity.getOtherRateValue()); + costTicketPayType.setPayTypeName(payTypeEntity.getPayTypeName()); + costTicketPayType.setPayTypeNo(payTypeEntity.getPayTypeNo()); + costTicketPayType.setRealMoney(payTypeEntity.getRealMoney()); + costTicketPayType.setStoreId(storeId); + costTicketPayType.setStoreName(ticket.getStoreName()); + costTicketPayType.setStoreNo(ticket.getStoreNo()); + costTicketPayType.setSummaryDate(ticket.getSummaryDate()); + costTicketPayType.setTenantId(tenantId); + costTicketPayType.setTicketNo(ticket.getNo()); + payType.add(costTicketPayType); + } + // 第四步 生成变动汇总 + List productChangeList = entity.getProductChangeList(); + List productChange = new ArrayList<>(); + for (StoreCostTicketProductChangeEntity productChangeEntity : productChangeList) { + CostTicketProductChange costTicketProductChange = new CostTicketProductChange(); + costTicketProductChange.setCreateDate(createDate); + costTicketProductChange.setCreateUser(operator); + costTicketProductChange.setCost(productChangeEntity.getCost()); + costTicketProductChange.setCostType(productChangeEntity.getCostType()); + costTicketProductChange.setDifMoney(productChangeEntity.getDifMoney()); + costTicketProductChange.setDifStandard(productChangeEntity.getDifStandard()); + costTicketProductChange.setDifUse(productChangeEntity.getDifUse()); + costTicketProductChange.setPackUnitId(productChangeEntity.getPackUnitId()); + costTicketProductChange.setPosUse(productChangeEntity.getPosUse()); + costTicketProductChange.setProductId(productChangeEntity.getProductId()); + costTicketProductChange.setProductName(productChangeEntity.getProductName()); + costTicketProductChange.setProductNo(productChangeEntity.getProductNo()); + costTicketProductChange.setSalePro(productChangeEntity.getSalePro()); + costTicketProductChange.setSpecId(productChangeEntity.getSpecId()); + costTicketProductChange.setSpecName(productChangeEntity.getSpecName()); + costTicketProductChange.setStandard(productChangeEntity.getStandard()); + costTicketProductChange.setStoreId(storeId); + costTicketProductChange.setStoreName(ticket.getStoreName()); + costTicketProductChange.setStoreNo(ticket.getStoreNo()); + costTicketProductChange.setSummaryDate(ticket.getSummaryDate()); + costTicketProductChange.setTenantId(tenantId); + costTicketProductChange.setTicketNo(ticket.getNo()); + costTicketProductChange.setTodayIn(productChangeEntity.getTodayIn()); + costTicketProductChange.setTodayLoss(productChangeEntity.getTodayLoss()); + costTicketProductChange.setTodayStock(productChangeEntity.getTodayStock()); + costTicketProductChange.setTodayUse(productChangeEntity.getTodayUse()); + costTicketProductChange.setTypeId(productChangeEntity.getTypeId()); + costTicketProductChange.setTypeName(productChangeEntity.getTypeName()); + costTicketProductChange.setTypeNo(productChangeEntity.getTypeNo()); + costTicketProductChange.setYeterdayStock(productChangeEntity.getYeterdayStock()); + costTicketProductChange.setExt1(productChangeEntity.getMemo());//差异原因; + productChange.add(costTicketProductChange); + } + // 第四步 辅助变动汇总 + List productMoreChangeList = entity.getProductMoreChangeList(); + List productMoreChange = new ArrayList<>(); + for (StoreCostTicketProductMoreChangeEntity productMoreChangeEntity : productMoreChangeList) { + CostTicketProductMoreChange costTicketProductMoreChange = new CostTicketProductMoreChange(); + costTicketProductMoreChange.setCreateDate(createDate); + costTicketProductMoreChange.setCreateUser(operator); + costTicketProductMoreChange.setCost(productMoreChangeEntity.getCost()); + costTicketProductMoreChange.setCostType(productMoreChangeEntity.getCostType()); + costTicketProductMoreChange.setDifMoney(productMoreChangeEntity.getDifMoney()); + costTicketProductMoreChange.setDifStandard(productMoreChangeEntity.getDifStandard()); + costTicketProductMoreChange.setDifUse(productMoreChangeEntity.getDifUse()); + costTicketProductMoreChange.setPackUnitId(productMoreChangeEntity.getPackUnitId()); + costTicketProductMoreChange.setPosUse(productMoreChangeEntity.getPosUse()); + costTicketProductMoreChange.setProductId(productMoreChangeEntity.getProductId()); + costTicketProductMoreChange.setProductName(productMoreChangeEntity.getProductName()); + costTicketProductMoreChange.setProductNo(productMoreChangeEntity.getProductNo()); + costTicketProductMoreChange.setSalePro(productMoreChangeEntity.getSalePro()); + costTicketProductMoreChange.setSpecId(productMoreChangeEntity.getSpecId()); + costTicketProductMoreChange.setSpecName(productMoreChangeEntity.getSpecName()); + costTicketProductMoreChange.setStandard(productMoreChangeEntity.getStandard()); + costTicketProductMoreChange.setStoreId(storeId); + costTicketProductMoreChange.setStoreName(ticket.getStoreName()); + costTicketProductMoreChange.setStoreNo(ticket.getStoreNo()); + costTicketProductMoreChange.setSummaryDate(ticket.getSummaryDate()); + costTicketProductMoreChange.setTenantId(tenantId); + costTicketProductMoreChange.setTicketNo(ticket.getNo()); + costTicketProductMoreChange.setTodayIn(productMoreChangeEntity.getTodayIn()); + costTicketProductMoreChange.setTodayLoss(productMoreChangeEntity.getTodayLoss()); + costTicketProductMoreChange.setTodayStock(productMoreChangeEntity.getTodayStock()); + costTicketProductMoreChange.setTodayUse(productMoreChangeEntity.getTodayUse()); + costTicketProductMoreChange.setTypeId(productMoreChangeEntity.getTypeId()); + costTicketProductMoreChange.setTypeName(productMoreChangeEntity.getTypeName()); + costTicketProductMoreChange.setTypeNo(productMoreChangeEntity.getTypeNo()); + costTicketProductMoreChange.setYeterdayStock(productMoreChangeEntity.getYeterdayStock()); + productMoreChange.add(costTicketProductMoreChange); + } + // 第五步 其他变动成本 + List productOtherChangeList = entity.getProductOtherChangeList(); + List productOtherChange = new ArrayList<>(); + for (StoreCostTicketProductOtherChangeEntity productOtherChangeEntity : productOtherChangeList) { + CostTicketProductOtherChange costTicketProductOtherChange = new CostTicketProductOtherChange(); + costTicketProductOtherChange.setCreateDate(createDate); + costTicketProductOtherChange.setCreateUser(operator); + costTicketProductOtherChange.setItemId(productOtherChangeEntity.getItemId()); + costTicketProductOtherChange.setMoney(productOtherChangeEntity.getMoney()); + costTicketProductOtherChange.setName(productOtherChangeEntity.getName()); + costTicketProductOtherChange.setNo(productOtherChangeEntity.getNo()); + costTicketProductOtherChange.setStoreId(storeId); + costTicketProductOtherChange.setStoreName(ticket.getStoreName()); + costTicketProductOtherChange.setStoreNo(ticket.getStoreNo()); + costTicketProductOtherChange.setSummaryDate(ticket.getSummaryDate()); + costTicketProductOtherChange.setTenantId(tenantId); + costTicketProductOtherChange.setTicketNo(ticket.getNo()); + costTicketProductOtherChange.setType(productOtherChangeEntity.getType()); + costTicketProductOtherChange.setTypeId(productOtherChangeEntity.getTypeId()); + costTicketProductOtherChange.setTypePath(productOtherChangeEntity.getTypePath()); + costTicketProductOtherChange.setTypeNo(productOtherChangeEntity.getTypeNo()); + costTicketProductOtherChange.setTypeName(productOtherChangeEntity.getTypeName()); + productOtherChange.add(costTicketProductOtherChange); + } + // 第五步固定费 + List productFixedChangeList = entity.getProductFixedChangeList(); + List productFixedChange = new ArrayList<>(); + for (StoreCostTicketProductFixedChangeEntity productFixedChangeEntity : productFixedChangeList) { + CostTicketProductFixedChange costTicketProductFixedChange = new CostTicketProductFixedChange(); + costTicketProductFixedChange.setCreateDate(createDate); + costTicketProductFixedChange.setCreateUser(operator); + costTicketProductFixedChange.setItemId(productFixedChangeEntity.getItemId()); + costTicketProductFixedChange.setMoney(productFixedChangeEntity.getMoney()); + costTicketProductFixedChange.setName(productFixedChangeEntity.getName()); + costTicketProductFixedChange.setNo(productFixedChangeEntity.getNo()); + costTicketProductFixedChange.setStoreId(storeId); + costTicketProductFixedChange.setStoreName(ticket.getStoreName()); + costTicketProductFixedChange.setStoreNo(ticket.getStoreNo()); + costTicketProductFixedChange.setSummaryDate(ticket.getSummaryDate()); + costTicketProductFixedChange.setTenantId(tenantId); + costTicketProductFixedChange.setTicketNo(ticket.getNo()); + costTicketProductFixedChange.setType(productFixedChangeEntity.getType()); + costTicketProductFixedChange.setTypeId(productFixedChangeEntity.getTypeId()); + costTicketProductFixedChange.setTypePath(productFixedChangeEntity.getTypePath()); + costTicketProductFixedChange.setTypeNo(productFixedChangeEntity.getTypeNo()); + costTicketProductFixedChange.setTypeName(productFixedChangeEntity.getTypeName()); + productFixedChange.add(costTicketProductFixedChange); + } + CostTicket costTicket = costTicketService.saveCostTicket(tenantId, ticket, productType, payType, productChange, productMoreChange, productOtherChange, productFixedChange); + Map map = new HashMap<>(); + map.put("ticketId", costTicket.getId()); + map.put("ticketNo", costTicket.getNo()); + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(map); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.cost.ticket.update", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "经营会计报表修改") + @Override + public Object storeCostTicketUpdate(StoreCostTicketUpdateRequest request) { + + String info = "经营会计报表修改"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId();// 门店ID + String jsonString = request.getJsonString();// 盘存数据 + String operator = request.getOperator();// 操作员 + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Store store = storeService.get(tenantId, storeId); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + logger.info(info + "========>" + jsonString); + StoreCostTicketEntity entity = new StoreCostTicketEntity(JSONObject.parseObject(jsonString)); + Date createDate = new Date(); + CostTicket ticket = new CostTicket(); + ticket.setId(entity.getId()); + ticket.setCreateDate(createDate); + ticket.setCreateUser(operator); + ticket.setAmount(entity.getAmount()); + ticket.setBoxAmount(entity.getBoxAmount()); + if (StringUtils.isNotEmpty(entity.getDescription()) && entity.getDescription().length() > 128) { + response.setStatus(0); + response.setMessage("盘存表备注说明参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ticket.setDescription(entity.getDescription()); + ticket.setDifTotalCost(entity.getDifTotalCost()); + ticket.setDiscountAmount(entity.getDiscountAmount()); + if (StringUtils.isEmpty(entity.getNo()) || entity.getNo().length() > 32) { + response.setStatus(0); + response.setMessage("盘存表单据号参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ticket.setNo(entity.getNo()); + ticket.setPeoplePrice(entity.getPeoplePrice()); + ticket.setProfit(entity.getProfit()); + ticket.setReceivableAmount(entity.getReceivableAmount()); + ticket.setStatus(0); + ticket.setStoreId(storeId); + ticket.setStoreNo(store.getNo()); + ticket.setStoreName(store.getName()); + if (StringUtils.isEmpty(entity.getSummaryDate()) || entity.getSummaryDate().length() > 32) { + response.setStatus(0); + response.setMessage("盘存表汇总日期不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("summaryDate", entity.getSummaryDate())); + criteria.add(Restrictions.eq("status", 1)); + criteria.add(Restrictions.eq("storeId",storeId)); + List ticketList = costTicketService.getList(tenantId, criteria); + if (CollectionUtils.isNotEmpty(ticketList)) { + response.setStatus(0); + response.setMessage("今天已经创建过盘点单了,不允许再次保存"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ticket.setSummaryDate(entity.getSummaryDate()); + ticket.setTenantId(tenantId); + ticket.setTicketCount(entity.getTicketCount()); + ticket.setTotalCost(entity.getTotalCost()); + ticket.setWorkerAmount(entity.getWorkerAmount()); + ticketList = costTicketService.findList(tenantId, "no", entity.getNo()); + if (CollectionUtils.isEmpty(ticketList)) { + response.setStatus(0); + response.setMessage("盘存表单据号不存在,修改失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + // 第二步汇总商品类别 + List productTypeList = entity.getProductTypeList(); + List productType = new ArrayList<>(); + for (StoreCostTicketProductTypeEntity productTypeEntity : productTypeList) { + CostTicketProductType costTicketProductType = new CostTicketProductType(); + costTicketProductType.setCreateDate(createDate); + costTicketProductType.setCreateUser(operator); + costTicketProductType.setMoney(productTypeEntity.getMoney()); + costTicketProductType.setStoreId(storeId); + costTicketProductType.setStoreName(ticket.getStoreName()); + costTicketProductType.setStoreNo(ticket.getStoreNo()); + costTicketProductType.setSummaryDate(ticket.getSummaryDate()); + costTicketProductType.setTenantId(tenantId); + costTicketProductType.setTicketNo(ticket.getNo()); + costTicketProductType.setTypeId(productTypeEntity.getTypeId()); + costTicketProductType.setTypeName(productTypeEntity.getTypeName()); + costTicketProductType.setTypeNo(productTypeEntity.getTypeNo()); + productType.add(costTicketProductType); + } + // 第三步汇总支付汇总 + List payTypeList = entity.getPayTypeList(); + List payType = new ArrayList<>(); + for (StoreCostTicketPayTypeEntity payTypeEntity : payTypeList) { + CostTicketPayType costTicketPayType = new CostTicketPayType(); + costTicketPayType.setCreateDate(createDate); + costTicketPayType.setCreateUser(operator); + costTicketPayType.setMoney(payTypeEntity.getMoney()); + costTicketPayType.setOtherRateType(payTypeEntity.getOtherRateType()); + costTicketPayType.setOtherRateValue(payTypeEntity.getOtherRateValue()); + costTicketPayType.setPayTypeName(payTypeEntity.getPayTypeName()); + costTicketPayType.setPayTypeNo(payTypeEntity.getPayTypeNo()); + costTicketPayType.setRealMoney(payTypeEntity.getRealMoney()); + costTicketPayType.setStoreId(storeId); + costTicketPayType.setStoreName(ticket.getStoreName()); + costTicketPayType.setStoreNo(ticket.getStoreNo()); + costTicketPayType.setSummaryDate(ticket.getSummaryDate()); + costTicketPayType.setTenantId(tenantId); + costTicketPayType.setTicketNo(ticket.getNo()); + payType.add(costTicketPayType); + } + // 第四步 生成变动汇总 + List productChangeList = entity.getProductChangeList(); + List productChange = new ArrayList<>(); + for (StoreCostTicketProductChangeEntity productChangeEntity : productChangeList) { + CostTicketProductChange costTicketProductChange = new CostTicketProductChange(); + costTicketProductChange.setCreateDate(createDate); + costTicketProductChange.setCreateUser(operator); + costTicketProductChange.setCost(productChangeEntity.getCost()); + costTicketProductChange.setCostType(productChangeEntity.getCostType()); + costTicketProductChange.setDifMoney(productChangeEntity.getDifMoney()); + costTicketProductChange.setDifStandard(productChangeEntity.getDifStandard()); + costTicketProductChange.setDifUse(productChangeEntity.getDifUse()); + costTicketProductChange.setPackUnitId(productChangeEntity.getPackUnitId()); + costTicketProductChange.setPosUse(productChangeEntity.getPosUse()); + costTicketProductChange.setProductId(productChangeEntity.getProductId()); + costTicketProductChange.setProductName(productChangeEntity.getProductName()); + costTicketProductChange.setProductNo(productChangeEntity.getProductNo()); + costTicketProductChange.setSalePro(productChangeEntity.getSalePro()); + costTicketProductChange.setSpecId(productChangeEntity.getSpecId()); + costTicketProductChange.setSpecName(productChangeEntity.getSpecName()); + costTicketProductChange.setStandard(productChangeEntity.getStandard()); + costTicketProductChange.setStoreId(storeId); + costTicketProductChange.setStoreName(ticket.getStoreName()); + costTicketProductChange.setStoreNo(ticket.getStoreNo()); + costTicketProductChange.setSummaryDate(ticket.getSummaryDate()); + costTicketProductChange.setTenantId(tenantId); + costTicketProductChange.setTicketNo(ticket.getNo()); + costTicketProductChange.setTodayIn(productChangeEntity.getTodayIn()); + costTicketProductChange.setTodayLoss(productChangeEntity.getTodayLoss()); + costTicketProductChange.setTodayStock(productChangeEntity.getTodayStock()); + costTicketProductChange.setTodayUse(productChangeEntity.getTodayUse()); + costTicketProductChange.setTypeId(productChangeEntity.getTypeId()); + costTicketProductChange.setTypeName(productChangeEntity.getTypeName()); + costTicketProductChange.setTypeNo(productChangeEntity.getTypeNo()); + costTicketProductChange.setYeterdayStock(productChangeEntity.getYeterdayStock()); + costTicketProductChange.setExt1(productChangeEntity.getMemo());//差异原因; + productChange.add(costTicketProductChange); + } + // 第四步 辅助变动汇总 + List productMoreChangeList = entity.getProductMoreChangeList(); + List productMoreChange = new ArrayList<>(); + for (StoreCostTicketProductMoreChangeEntity productMoreChangeEntity : productMoreChangeList) { + CostTicketProductMoreChange costTicketProductMoreChange = new CostTicketProductMoreChange(); + costTicketProductMoreChange.setCreateDate(createDate); + costTicketProductMoreChange.setCreateUser(operator); + costTicketProductMoreChange.setCost(productMoreChangeEntity.getCost()); + costTicketProductMoreChange.setCostType(productMoreChangeEntity.getCostType()); + costTicketProductMoreChange.setDifMoney(productMoreChangeEntity.getDifMoney()); + costTicketProductMoreChange.setDifStandard(productMoreChangeEntity.getDifStandard()); + costTicketProductMoreChange.setDifUse(productMoreChangeEntity.getDifUse()); + costTicketProductMoreChange.setPackUnitId(productMoreChangeEntity.getPackUnitId()); + costTicketProductMoreChange.setPosUse(productMoreChangeEntity.getPosUse()); + costTicketProductMoreChange.setProductId(productMoreChangeEntity.getProductId()); + costTicketProductMoreChange.setProductName(productMoreChangeEntity.getProductName()); + costTicketProductMoreChange.setProductNo(productMoreChangeEntity.getProductNo()); + costTicketProductMoreChange.setSalePro(productMoreChangeEntity.getSalePro()); + costTicketProductMoreChange.setSpecId(productMoreChangeEntity.getSpecId()); + costTicketProductMoreChange.setSpecName(productMoreChangeEntity.getSpecName()); + costTicketProductMoreChange.setStandard(productMoreChangeEntity.getStandard()); + costTicketProductMoreChange.setStoreId(storeId); + costTicketProductMoreChange.setStoreName(ticket.getStoreName()); + costTicketProductMoreChange.setStoreNo(ticket.getStoreNo()); + costTicketProductMoreChange.setSummaryDate(ticket.getSummaryDate()); + costTicketProductMoreChange.setTenantId(tenantId); + costTicketProductMoreChange.setTicketNo(ticket.getNo()); + costTicketProductMoreChange.setTodayIn(productMoreChangeEntity.getTodayIn()); + costTicketProductMoreChange.setTodayLoss(productMoreChangeEntity.getTodayLoss()); + costTicketProductMoreChange.setTodayStock(productMoreChangeEntity.getTodayStock()); + costTicketProductMoreChange.setTodayUse(productMoreChangeEntity.getTodayUse()); + costTicketProductMoreChange.setTypeId(productMoreChangeEntity.getTypeId()); + costTicketProductMoreChange.setTypeName(productMoreChangeEntity.getTypeName()); + costTicketProductMoreChange.setTypeNo(productMoreChangeEntity.getTypeNo()); + costTicketProductMoreChange.setYeterdayStock(productMoreChangeEntity.getYeterdayStock()); + productMoreChange.add(costTicketProductMoreChange); + } + // 第五步 其他变动成本 + List productOtherChangeList = entity.getProductOtherChangeList(); + List productOtherChange = new ArrayList<>(); + for (StoreCostTicketProductOtherChangeEntity productOtherChangeEntity : productOtherChangeList) { + CostTicketProductOtherChange costTicketProductOtherChange = new CostTicketProductOtherChange(); + costTicketProductOtherChange.setCreateDate(createDate); + costTicketProductOtherChange.setCreateUser(operator); + costTicketProductOtherChange.setItemId(productOtherChangeEntity.getItemId()); + costTicketProductOtherChange.setMoney(productOtherChangeEntity.getMoney()); + costTicketProductOtherChange.setName(productOtherChangeEntity.getName()); + costTicketProductOtherChange.setNo(productOtherChangeEntity.getNo()); + costTicketProductOtherChange.setStoreId(storeId); + costTicketProductOtherChange.setStoreName(ticket.getStoreName()); + costTicketProductOtherChange.setStoreNo(ticket.getStoreNo()); + costTicketProductOtherChange.setSummaryDate(ticket.getSummaryDate()); + costTicketProductOtherChange.setTenantId(tenantId); + costTicketProductOtherChange.setTicketNo(ticket.getNo()); + costTicketProductOtherChange.setType(productOtherChangeEntity.getType()); + costTicketProductOtherChange.setTypeId(productOtherChangeEntity.getTypeId()); + costTicketProductOtherChange.setTypePath(productOtherChangeEntity.getTypePath()); + costTicketProductOtherChange.setTypeNo(productOtherChangeEntity.getTypeNo()); + costTicketProductOtherChange.setTypeName(productOtherChangeEntity.getTypeName()); + productOtherChange.add(costTicketProductOtherChange); + } + // 第五步固定费 + List productFixedChangeList = entity.getProductFixedChangeList(); + List productFixedChange = new ArrayList<>(); + for (StoreCostTicketProductFixedChangeEntity productFixedChangeEntity : productFixedChangeList) { + CostTicketProductFixedChange costTicketProductFixedChange = new CostTicketProductFixedChange(); + costTicketProductFixedChange.setCreateDate(createDate); + costTicketProductFixedChange.setCreateUser(operator); + costTicketProductFixedChange.setItemId(productFixedChangeEntity.getItemId()); + costTicketProductFixedChange.setMoney(productFixedChangeEntity.getMoney()); + costTicketProductFixedChange.setName(productFixedChangeEntity.getName()); + costTicketProductFixedChange.setNo(productFixedChangeEntity.getNo()); + costTicketProductFixedChange.setStoreId(storeId); + costTicketProductFixedChange.setStoreName(ticket.getStoreName()); + costTicketProductFixedChange.setStoreNo(ticket.getStoreNo()); + costTicketProductFixedChange.setSummaryDate(ticket.getSummaryDate()); + costTicketProductFixedChange.setTenantId(tenantId); + costTicketProductFixedChange.setTicketNo(ticket.getNo()); + costTicketProductFixedChange.setType(productFixedChangeEntity.getType()); + costTicketProductFixedChange.setTypeId(productFixedChangeEntity.getTypeId()); + costTicketProductFixedChange.setTypePath(productFixedChangeEntity.getTypePath()); + costTicketProductFixedChange.setTypeNo(productFixedChangeEntity.getTypeNo()); + costTicketProductFixedChange.setTypeName(productFixedChangeEntity.getTypeName()); + productFixedChange.add(costTicketProductFixedChange); + } + Integer result = costTicketService.updateCostTicket(tenantId, ticket, productType, payType, productChange, productMoreChange, productOtherChange, productFixedChange); + Map map = new HashMap<>(); + map.put("ticketId", ticket.getId()); + map.put("ticketNo", ticket.getNo()); + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(map); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.cost.ticket.updatestatus", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "经营会计报表状态变更") + @Override + public Object storeCostTicketUpdateStatus(StoreCostTicketUpdateStatusRequest request) { + String info = "经营会计报表审核、作废"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId();// 门店ID + String ticketId = request.getTicketId();// 单据ID + Integer type = request.getType();// 类型 + String operator = request.getOperator();// 操作员 + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Store store = storeService.get(tenantId, storeId); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + CostTicket ticket = costTicketService.get(tenantId, ticketId); + if (ticket == null) { + response.setStatus(0); + response.setMessage("盘存表单据号不存在,修改失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + Date createDate = new Date(); + ticket.setCheckDate(createDate); + ticket.setCheckPeople(operator); + ticket.setStatus(type); + costTicketService.update(tenantId, ticket); + Map map = new HashMap<>(); + map.put("ticketId", ticket.getId()); + map.put("ticketNo", ticket.getNo()); + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(map); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.cost.ticket.salesinfo", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "经营会计报表门店支付方式汇总、大类汇总、门店营业信息") + @Override + public Object StoreCostTicketSalesInfos(StoreCostTicketSalesInfoRequest request) { + String info = "经营会计报表门店支付方式汇总、大类汇总、门店营业信息"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId();// 门店ID + String date = request.getDate(); + + CommonDataResponse response = null; + try{ + response = new CommonDataResponse(); + Store store = storeService.get(tenantId, storeId); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + String startTime = date+" 00:00:00"; + String endTime = date+" 23:59:59"; + + String summaryDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); + + //主单信息; + String ticketSql = "select CONCAT(storeId,'') as storeId,storeNo,storeName,sum(receivable)as receivableAmount,sum(discountTotal)as discountAmount," + + "sum(amount)as amount,count(no) as counts, count(case WHEN status = 2 THEN no END) as rcounts " + + "from cy_store_business_ticket where tenantId ='" + tenantId + "' and isInvalid = 0 and " + + "saleDate >= '" + startTime + "' and saleDate <= '" + endTime + "' and storeId = '"+storeId+"' group by storeId "; + Map map = storeBusinessTicketService.selectOne(tenantId,ticketSql); + if(map != null && map.get("storeId") != null){ + map.put("boxAmount",new BigDecimal(0.0)); + map.put("workerAmount",new BigDecimal(0.0)); + map.put("summaryDate",summaryDate); + map.put("ticketCount",Integer.parseInt(((Long)map.get("counts")-(Long)map.get("rcounts"))+"")); + map.put("peoplePrice",((BigDecimal)map.get("amount")).divide(BigDecimal.valueOf((Integer)map.get("ticketCount")),2,BigDecimal.ROUND_HALF_UP)); + }else{ + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(null); + return response; + } + + //支付信息; + String paySql = "select storeName,storeNo,payTypeNo,payType as payTypeName,count(id) as count," + + "sum(money) as money,otherRateType,otherRateValue,sum(otherRate) as otherRate" + + " from cy_store_pay where tenantId ='"+tenantId+"' and isInvalid = 0 and " + + "payDate >= '"+startTime+"' and payDate <= '"+endTime+"' and storeId = '"+storeId+"' group by payTypeNo order by payTypeNo "; + + List> payList = storePayService.selectList(tenantId,paySql); + if(CollectionUtils.isNotEmpty(payList)){ + for(Map payInfo : payList){ + payInfo.put("realMoney",((BigDecimal)payInfo.get("money")).subtract((BigDecimal) payInfo.get("otherRate"))); + payInfo.put("summaryDate",summaryDate); + } + map.put("payTypeList",payList); + } + Map productTypeMap = new HashMap<>(); + List productTypeList = productTypeService.getList(tenantId,new Criteria()); + if(CollectionUtils.isNotEmpty(productTypeList)){ + for(ProductType type : productTypeList){ + productTypeMap.put(type.getId(),type.getNo()); + } + } + + + //分类信息; + String typeSql = "select storeNo,storeName,seriesId as typeId,seriesName as typeName,sum(receivableTotal) as money from cy_store_order_product " + + "where tenantId = '"+tenantId+"' and isInvalid = 0 and saleDate >= '"+startTime+"' and saleDate <= '"+endTime+"' " + + "and storeId ='"+storeId+"' group by seriesId order by seriesName "; + List> typeList = storeOrderProductService.selectList(tenantId,typeSql); + if(CollectionUtils.isNotEmpty(typeList)){ + for(Map type : typeList){ + type.put("summaryDate",summaryDate); + String typeNo = ""; + if(type.get("typeId") != null){ + typeNo = productTypeMap.get(type.get("typeId").toString()); + } + type.put("typeNo",typeNo); + } + map.put("productTypeList",typeList); + } + + //单品销售信息; + String productSql = "select productName,CONCAT(productId,'') as productId,CONCAT(specId,'') as specId,sum(count-rcount) as count " + + "from cy_store_order_product where tenantId ='"+tenantId+"' and storeId = '"+storeId+"' and isInvalid = 0 and isSuit !=2 " + + "and saleDate >= '"+startTime+"' and saleDate <= '"+endTime+"' group by productId,specId limit 0,10000"; + List> productList = storeOrderProductService.selectList(tenantId,productSql); + if(CollectionUtils.isNotEmpty(productList)){ + map.put("productList",productList); + } + + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(map); + + }catch (Exception e){ + + } + + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/storage/StoreDispatchServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/storage/StoreDispatchServiceImpl.java new file mode 100644 index 0000000..449c3ba --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/storage/StoreDispatchServiceImpl.java @@ -0,0 +1,587 @@ +package com.jwsaas.api.service.impl.storage; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import com.jwsaas.cache.CacheUtil; +import org.apache.commons.lang3.StringUtils; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.jwsaas.Constant; +import com.jwsaas.api.request.storage.DispatchTicketDetailRequest; +import com.jwsaas.api.request.storage.DispatchTicketReceiveRequest; +import com.jwsaas.api.request.storage.DispatchTicketRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.response.mode.CommonPagerResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.storage.StoreDispatchService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.DispatchTicket; +import com.jwsaas.entity.food.DispatchTicketDetail; +import com.jwsaas.entity.food.ReceiveGoodsDetail; +import com.jwsaas.entity.food.ReceiveGoodsTicket; +import com.jwsaas.entity.food.Store; +import com.jwsaas.entity.food.StoreStorage; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.pager.Pager; +import com.jwsaas.util.DateUtils; +import com.jwsaas.util.JSONUtil; +import com.jwsaas.utils.AppKeyUtil; + +@ServiceMethodBean(version = "1.0") +public class StoreDispatchServiceImpl extends WopServiceImpl implements StoreDispatchService { + + private static final long serialVersionUID = 4556544687118941523L; + + @Resource + private com.jwsaas.service.food.StoreService storeService; + @Resource + private com.jwsaas.service.food.StoreStorageService storeStorageService; + @Resource + private com.jwsaas.service.food.DispatchTicketService dispatchTicketService; + @Resource + private com.jwsaas.service.food.DispatchTicketDetailService dispatchTicketDetailService; + @Resource + private com.jwsaas.service.food.ReceiveGoodsTicketService receiveGoodsTicketService; + @Resource + private com.jwsaas.service.food.ReceiveGoodsDetailService receiveGoodsDetailService; + + /** + * 配送单信息 + */ + @ServiceMethod(method = "store.dispatch.ticket", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "配送单信息") + @Override + public Object dispatchTicket(DispatchTicketRequest request) { + String info = "配送单信息"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + String no = request.getNo();// 单号 + String askGoodsId = request.getAskGoodsId(); + String askGoodsNo = request.getAskGoodsNo(); + Integer status = request.getStatus();// 单据状态 + String startTime = request.getStartTime();// 开始时间 + String endTime = request.getEndTime();// 结束时间 + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + if (StringUtils.isNotEmpty(no)) { + criteria.add(Restrictions.eq("no", no));// 单据编号 + } + if(StringUtils.isNotEmpty(askGoodsId)){ + criteria.add(Restrictions.eq("askgoodsId", askGoodsId));// 要货单Id + } + if(StringUtils.isNotEmpty(askGoodsNo)){ + criteria.add(Restrictions.eq("askgoodsNo", askGoodsNo));// 要货单Id + } + if (StringUtils.isNotEmpty(startTime)) { + criteria.add(Restrictions.ge("createDate", startTime));// 开始时间 + } + if (StringUtils.isNotEmpty(endTime)) { + criteria.add(Restrictions.le("createDate", endTime));// 结束时间 + } + + criteria.add(Restrictions.eq("storeId", request.getStoreId()));// 单据编号 + + // 配送单状态: 0-新建 1-驳回2-审核通过 3-作废4-已发货5-已收货 + List allowStatusList = new ArrayList<>(); + if (status != null) { + allowStatusList.add(status); + } else { + allowStatusList.add(4); + allowStatusList.add(5); + } + criteria.add(Restrictions.in("status", allowStatusList));// 单据状态 + + criteria.add(Restrictions.order("createDate", "desc")); + pager = dispatchTicketService.getPager(tenantId, criteria, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List dataList = (List) pager.getList(); + for (DispatchTicket ticket : dataList) { + Map map = new HashMap<>(); + map.put("tenantId", ticket.getTenantId()); + map.put("id", ticket.getId()); + map.put("askGoodsId", ticket.getAskgoodsId());// 要货单ID + map.put("askGoodsNo", ticket.getAskgoodsNo());// 要货单编号 + map.put("storeId", ticket.getStoreId());// 门店ID + map.put("no", ticket.getNo());// 单据编号 + map.put("status", ticket.getStatus());// 单据状态 + map.put("isUse", ticket.getIsUse());// 是否选用 + map.put("description", ticket.getDescription());// 备注信息 + map.put("setMan", ticket.getSetMan());// 制单人 + map.put("setDate", formatYMDHMS(ticket.getSetDate()));// 制单日期 + map.put("checkMan", ticket.getCheckMan());// 审核人 + map.put("checkDate", formatYMDHMS(ticket.getCheckDate()));// 审核日期 + map.put("arrivalDate", formatYMDHMS(ticket.getArrivalDate()));// 验收日期 + map.put("address", ticket.getAddress());// 联系地址 + map.put("linkMan", ticket.getLinkMan());// 联系人 + map.put("linkTelephone", ticket.getLinkTelephone());// 联系电话 + map.put("logisticsNo", ticket.getLogisticsNo());// 物流单号 + map.put("logisticsName", ticket.getLogisticsName());// 物流名称 + map.put("logisticsFee", ticket.getLogisticsFee());// 物流费用 + map.put("orderMoney", ticket.getOrderMoney());// 原料金额 + map.put("otherFee", ticket.getOtherFee());// 其他费用 + map.put("money", ticket.getMoney());// 总金额 + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 配送单明细 + */ + @ServiceMethod(method = "store.dispatch.ticket.detail", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "配送单明细信息") + @Override + public Object dispatchTicketDetail(DispatchTicketDetailRequest request) { + String info = "配送单明细信息"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + String ticketId = request.getTicketId();// 配送单ID + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + if (StringUtils.isBlank(ticketId)) { + response.setStatus(0); + response.setMessage("参数ticketId不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("dispatchId", ticketId)); + criteria.add(Restrictions.order("productNo", "asc")); + criteria.add(Restrictions.order("specId", "asc")); + pager = dispatchTicketDetailService.getPager(tenantId, criteria, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List dataList = (List) pager.getList(); + for (DispatchTicketDetail ticketDetail : dataList) { + Map map = new HashMap<>(); + map.put("tenantId", ticketDetail.getTenantId()); + map.put("id", ticketDetail.getId()); + map.put("ticketId", ticketDetail.getDispatchId());// 配送单ID + map.put("ticketNo", ticketDetail.getDispatchNo());// 配送单编号 + map.put("storageId", ticketDetail.getStorageId());// 出库库位ID + map.put("storageName", ticketDetail.getStorageName());// 出库库位名 + map.put("productId", ticketDetail.getProductId());// 原料ID + map.put("productNo", ticketDetail.getProductNo());// 原料编码 + map.put("productName", ticketDetail.getProductName());// 原料名称 + map.put("specId", ticketDetail.getSpecId());// 规格ID + map.put("specName", ticketDetail.getSpecName());// 规格名称 + map.put("productDescription", ticketDetail.getProductDescription());// 原料说明 + map.put("askgoodsAmount", doubleFormat(ticketDetail.getAskgoodsAmount()));// 要货数量 + map.put("dispatchAmount", doubleFormat(ticketDetail.getDispatchAmount()));// 配送数量 + map.put("dispatchUnitId", ticketDetail.getDispatchUnitId());// 配送单位 + map.put("dispatchUnitName", ticketDetail.getDispatchUnitName());// 配送单位名称 + map.put("price", doubleFormat(ticketDetail.getPrice()));// 配送价 + map.put("money", doubleFormat(ticketDetail.getMoney()));// 配送金额 + map.put("description", ticketDetail.getDescription());// 备注信息 + map.put("packUnitId", ticketDetail.getPackUnitId());// 包装单位 + map.put("packUnitName", ticketDetail.getPackUnitName());// 包装单位名称 + map.put("dpScale", ticketDetail.getDpScale());// 换算比例(配送单位和包装单位) + map.put("receiveAmount", doubleFormat(ticketDetail.getReceiveAmount()));// 收货数量 + map.put("differenceAmount", doubleFormat(ticketDetail.getDifferenceAmount()));// 差异数量 + map.put("differenceMoney", doubleFormat(ticketDetail.getDifferenceMoney()));// 差异金额 + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 配送单以及对应验收单明细 + */ + @ServiceMethod(method = "store.dispatchAndReceive.ticket.detail", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "配送单以及对应验收单明细") + @Override + public Object dispatchAndReceiveDetail(DispatchTicketDetailRequest request) { + String info = "配送单以及对应验收单明细"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + String ticketId = request.getTicketId();// 配送单ID + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + if (StringUtils.isBlank(ticketId)) { + response.setStatus(0); + response.setMessage("参数ticketId不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + // 验收单商品信息 + Map receiveDetailMap = new HashMap(); + + // 通过配送单Id拿到对应验收单 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("dispatchId", ticketId)); + List receiveTickets = receiveGoodsTicketService.getList(tenantId, criteria); + ReceiveGoodsTicket receiveTicket = null; + String rcvDepotId = ""; + String rcvDepotName = ""; + String rcvDepotNo = ""; + String rcvCheckDate = ""; + if(receiveTickets.size() > 0){ + receiveTicket = receiveTickets.get(0); + rcvCheckDate = formatYMDHMS(receiveTicket.getCheckDate()); + rcvDepotId = receiveTicket.getStorageId(); + // 获取验收门店信息 + StoreStorage storeDepot = storeStorageService.get(tenantId, rcvDepotId); + if(null != storeDepot){ + rcvDepotName = storeDepot.getName(); + rcvDepotNo = storeDepot.getNo(); + } + // 验收单详情 + criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketId", receiveTicket.getId())); + criteria.add(Restrictions.order("productNo", "asc")); + criteria.add(Restrictions.order("specId", "asc")); + List receiveDetails = receiveGoodsDetailService.getList(tenantId, criteria); + for(ReceiveGoodsDetail detail :receiveDetails){ + receiveDetailMap.put(detail.getSpecId(),detail); + } + } + + // 配送单详情 + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + criteria = new Criteria(); + criteria.add(Restrictions.eq("dispatchId", ticketId)); + criteria.add(Restrictions.order("productNo", "asc")); + criteria.add(Restrictions.order("specId", "asc")); + pager = dispatchTicketDetailService.getPager(tenantId, criteria, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List dataList = (List) pager.getList(); + for (DispatchTicketDetail ticketDetail : dataList) { + Map map = new HashMap<>(); + map.put("tenantId", ticketDetail.getTenantId()); + map.put("id", ticketDetail.getId()); + map.put("ticketId", ticketDetail.getDispatchId());// 配送单ID + map.put("ticketNo", ticketDetail.getDispatchNo());// 配送单编号 + map.put("storageId", ticketDetail.getStorageId());// 出库库位ID + map.put("storageName", ticketDetail.getStorageName());// 出库库位名 + map.put("productId", ticketDetail.getProductId());// 原料ID + map.put("productNo", ticketDetail.getProductNo());// 原料编码 + map.put("productName", ticketDetail.getProductName());// 原料名称 + map.put("specId", ticketDetail.getSpecId());// 规格ID + map.put("specName", ticketDetail.getSpecName());// 规格名称 + map.put("productDescription", ticketDetail.getProductDescription());// 原料说明 + map.put("askgoodsAmount", doubleFormat(ticketDetail.getAskgoodsAmount()));// 要货数量 + map.put("dispatchAmount", doubleFormat(ticketDetail.getDispatchAmount()));// 配送数量 + map.put("dispatchUnitId", ticketDetail.getDispatchUnitId());// 配送单位 + map.put("dispatchUnitName", ticketDetail.getDispatchUnitName());// 配送单位名称 + map.put("price", doubleFormat(ticketDetail.getPrice()));// 配送价 + map.put("money", doubleFormat(ticketDetail.getMoney()));// 配送金额 + map.put("description", ticketDetail.getDescription());// 备注信息 + map.put("packUnitId", ticketDetail.getPackUnitId());// 包装单位 + map.put("packUnitName", ticketDetail.getPackUnitName());// 包装单位名称 + map.put("dpScale", ticketDetail.getDpScale());// 换算比例(配送单位和包装单位) + map.put("receiveAmount", doubleFormat(ticketDetail.getReceiveAmount()));// 收货数量 + map.put("differenceAmount", doubleFormat(ticketDetail.getDifferenceAmount()));// 差异数量 + map.put("differenceMoney", doubleFormat(ticketDetail.getDifferenceMoney()));// 差异金额 + + // 验收单商品差异原因 + String rcvDescription = ""; + ReceiveGoodsDetail detail = receiveDetailMap.get(ticketDetail.getSpecId()); + if(detail != null){ + rcvDescription = detail.getDescription(); + } + map.put("rcvDescription", rcvDescription); + + map.put("rcvCheckDate", rcvCheckDate); //配送验收时间 + map.put("rcvDepotId", rcvDepotId); //配送验收入库仓库 + map.put("rcvDepotName", rcvDepotName); //配送验收入库仓库名称 + map.put("rcvDepotNo", rcvDepotNo); //配送验收入库仓库编码 + + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + private void isBlankValid(String property, String value, CommonDataResponse response) { + if (StringUtils.isBlank(value)) { + response.setStatus(0); + response.setMessage("参数" + property + "不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + } + } + + @ServiceMethod(method = "store.dispatch.ticket.receive", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "配送单验收") + @Override + public Object dispatchTicketReceive(DispatchTicketReceiveRequest request) { + String info = "配送单验收"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId();// 门店ID + String no = request.getNo();// 单据编号/配送收货单编号 + String dispatchId = request.getDispatchId();// 配送单ID + String dispatchNo = request.getDispatchNo();// 配送单编号 + String storageId = request.getStorageId();// 入库仓库 + String receiveDate = request.getReceiveDate();// 验收日期 + String receiveUser = request.getReceiveUser();// 验收人 + String description = request.getDescription();// 备注说明 + String detail = request.getDetail(); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + // 参数校验 + isBlankValid("no", no, response); + if (StringUtils.isNotBlank(response.getErrCode())) { + return response; + } + String key = tenantId+"-"+no; + if(CacheUtil.get(tenantId,key) != null){ + response.setStatus(0); + response.setMessage("此单据已处理"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + }else{ + CacheUtil.set(tenantId,key,dispatchNo,3*60); + } + + isBlankValid("dispatchId", dispatchId, response); + if (StringUtils.isNotBlank(response.getErrCode())) { + return response; + } + + isBlankValid("dispatchNo", dispatchNo, response); + if (StringUtils.isNotBlank(response.getErrCode())) { + return response; + } + + isBlankValid("storageId", storageId, response); + if (StringUtils.isNotBlank(response.getErrCode())) { + return response; + } + + isBlankValid("receiveDate", receiveDate, response); + if (StringUtils.isNotBlank(response.getErrCode())) { + return response; + } + + isBlankValid("receiveUser", receiveUser, response); + if (StringUtils.isNotBlank(response.getErrCode())) { + return response; + } + + isBlankValid("detail", detail, response); + if (StringUtils.isNotBlank(response.getErrCode())) { + return response; + } + List detailList = JSONUtil.parseObject(detail, new TypeReference>() { + }); + if (detailList.size() == 0) { + response.setStatus(0); + response.setMessage("参数detail不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + // 门店 +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + // 配送单 + DispatchTicket dispatchTicket = dispatchTicketService.get(tenantId, dispatchId); + if (dispatchTicket == null) { + response.setStatus(0); + response.setMessage("配送单信息不存在"); + response.setErrCode(CommonErrorCode.error23.getCode()); + response.setErrMessage(CommonErrorCode.error23.getMessage()); + return response; + } + if (!StringUtils.equals(dispatchTicket.getNo(), dispatchNo)) { + response.setStatus(0); + response.setMessage("单据信息不一致"); + response.setErrCode(CommonErrorCode.error24.getCode()); + response.setErrMessage(CommonErrorCode.error24.getMessage()); + return response; + } + if (!StringUtils.equals(dispatchTicket.getStoreId(), storeId)) { + response.setStatus(0); + response.setMessage("无权访问该配送单"); + response.setErrCode(CommonErrorCode.error25.getCode()); + response.setErrMessage(CommonErrorCode.error25.getMessage()); + return response; + } + + //0-新建 1-驳回 2-审核通过 3-作废 4-已发货 5-已收货 + if(5 == dispatchTicket.getStatus()){ + response.setStatus(0); + response.setMessage("此次配送已收货"); + response.setErrCode(CommonErrorCode.error22.getCode()); + response.setErrMessage(CommonErrorCode.error22.getMessage()); + return response; + } + + // 入库仓库/门店仓库 + StoreStorage storeStorage = storeStorageService.get(tenantId, storageId); + if (storeStorage == null) { + response.setStatus(0); + response.setMessage("入库仓库ID不存在"); + response.setErrCode(CommonErrorCode.error10.getCode()); + response.setErrMessage(CommonErrorCode.error10.getMessage()); + return response; + } + + // 配送收货单 + List receiveGoodsTicketList = receiveGoodsTicketService.findList(tenantId, "no", no); + if (receiveGoodsTicketList != null && receiveGoodsTicketList.size() > 0) { + response.setStatus(0); + response.setMessage("配送收货单编号已存在"); + response.setErrCode(CommonErrorCode.error20.getCode()); + response.setErrMessage(CommonErrorCode.error20.getMessage()); + return response; + } + + // 配送收货单 + ReceiveGoodsTicket receiveGoodsTicket = new ReceiveGoodsTicket(); + receiveGoodsTicket.setStoreId(storeId);// 收货门店ID + receiveGoodsTicket.setStorageId(storageId);// 入库仓库ID + receiveGoodsTicket.setDispatchId(dispatchId);// 配送单ID + receiveGoodsTicket.setDispatchNo(dispatchNo);// 配送单号 + receiveGoodsTicket.setNo(no);// 单据编号 + // 单据状态(0-新建 1-审核 2-废弃 3-反审核) + receiveGoodsTicket.setStatus(0); + receiveGoodsTicket.setIsUse(0);// 是否选用 + receiveGoodsTicket.setDescription(description);// 备注信息 + receiveGoodsTicket.setSetMan(receiveUser);// 制单人 + receiveGoodsTicket.setSetDate(DateUtils.parseDate(receiveDate, DateUtils.SHOW_DATETIME_FORMAT));// 制单日期 + receiveGoodsTicket.setCheckMan(null);// 审核人 + receiveGoodsTicket.setCheckDate(null);// 审核日期 + receiveGoodsTicket.setCreateUser(Constant.CREATE_USER); + + receiveGoodsTicket = receiveGoodsTicketService.saveWithDetailList(tenantId, receiveGoodsTicket, detailList); + logger.debug("receiveGoodsTicket:" + receiveGoodsTicket); + + Map map = new HashMap(); + map.put("id", receiveGoodsTicket.getId()); + map.put("no", receiveGoodsTicket.getNo()); + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(map); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/storage/StoreStockCheckServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/storage/StoreStockCheckServiceImpl.java new file mode 100644 index 0000000..55ac4ba --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/storage/StoreStockCheckServiceImpl.java @@ -0,0 +1,907 @@ +package com.jwsaas.api.service.impl.storage; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.jwsaas.Constant; +import com.jwsaas.api.entity.storage.StoreStockCheckTicketDetailEntity; +import com.jwsaas.api.entity.storage.StoreStockCheckTicketEntity; +import com.jwsaas.api.request.storage.StoreStockCheckProductValidRequest; +import com.jwsaas.api.request.storage.StoreStockCheckSummaryRequest; +import com.jwsaas.api.request.storage.StoreStockCheckTemplateDetailRequest; +import com.jwsaas.api.request.storage.StoreStockCheckTemplateListRequest; +import com.jwsaas.api.request.storage.StoreStockCheckTicketAddRequest; +import com.jwsaas.api.request.storage.StoreStockCheckTicketDetailDelRequest; +import com.jwsaas.api.request.storage.StoreStockCheckTicketDetailRequest; +import com.jwsaas.api.request.storage.StoreStockCheckTicketRequest; +import com.jwsaas.api.request.storage.StoreStockUnCheckTicketDetailRequest; +import com.jwsaas.api.request.storage.StoreStockUnCheckTicketDetailUpdateRequest; +import com.jwsaas.api.request.storage.StoreStockUnCheckTicketStatusUpdateRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.response.mode.CommonListResponse; +import com.jwsaas.api.response.mode.CommonPagerResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.storage.StoreStockCheckService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.DispatchTicket; +import com.jwsaas.entity.food.DispatchTicketDetail; +import com.jwsaas.entity.food.Store; +import com.jwsaas.entity.food.StoreStockCheckTemplate; +import com.jwsaas.entity.food.StoreStockCheckTemplateDetail; +import com.jwsaas.entity.food.StoreStockCheckTicket; +import com.jwsaas.entity.food.StoreStockCheckTicketDetail; +import com.jwsaas.entity.food.StoreStockCheckTicketLog; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.pager.Pager; +import com.jwsaas.util.DateUtils; +import com.jwsaas.util.JSONUtil; +import com.jwsaas.utils.AppKeyUtil; + +/** + * 门店库存盘点相关业务 + */ +@ServiceMethodBean(version = "1.0") +public class StoreStockCheckServiceImpl extends WopServiceImpl implements StoreStockCheckService { + + private static final long serialVersionUID = 1937539204337159563L; + + @Resource + private com.jwsaas.service.food.StoreStockCheckTicketService storeStockCheckTicketService; + @Resource + private com.jwsaas.service.food.StoreStockCheckTicketDetailService storeStockCheckTicketDetailService; + @Resource + private com.jwsaas.service.food.StoreService storeService; + @Resource + private com.jwsaas.service.food.StoreStockCheckTemplateService templateService; + @Resource + private com.jwsaas.service.food.StoreStockCheckTemplateDetailService templateDetailService; + + /** + * 门店库存盘点单新增 + */ + @ServiceMethod(method = "store.stock.check.ticket.add", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店库存盘点单新增") + @Override + public Object storeStockCheckTicketAdd(StoreStockCheckTicketAddRequest request) { + String info = "门店库存盘点单新增"; + logger.debug("info:" + info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId();// 门店ID + String jsonString = request.getJsonString();// 盘点单数据 + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + if (StringUtils.isBlank(jsonString)) { + response.setStatus(0); + response.setMessage("参数jsonString不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + StoreStockCheckTicketEntity ticketEntity = null; + try { + ticketEntity = JSONUtil.parseObject(jsonString, StoreStockCheckTicketEntity.class); + } catch (Exception e) { + logger.error(info + "参数jsonString转换成对象失败"); + response.setStatus(0); + response.setMessage("参数jsonString转换成对象失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + Map validResult = vaildParam(ticketEntity); + if (validResult != null && (Integer) validResult.get("status") == 0) { + response.setStatus(0); + response.setMessage(validResult.get("message").toString()); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + List StockCheckTicketList = storeStockCheckTicketService.findList(tenantId, "no", ticketEntity.getNo()); + if (StockCheckTicketList != null && StockCheckTicketList.size() > 0) { + response.setStatus(0); + response.setMessage("单据编号已存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + String createUser = Constant.CREATE_USER; + StoreStockCheckTicket ticket = new StoreStockCheckTicket(); + ticket.setStoreId(storeId); + ticket.setNo(ticketEntity.getNo()); + ticket.setDescription(ticketEntity.getDescription());// 备注信息 + ticket.setStatus(0);// 单据状态(0-新建;1-驳回;2-审核通过;3-已作废;) + ticket.setSetMan(ticketEntity.getSetMan());// 制单人 + ticket.setSetDate(DateUtils.parseDate(ticketEntity.getSetDate(), DateUtils.SHOW_DATETIME_FORMAT));// 制单日期 + ticket.setCreateUser(createUser); + + List detailList = new ArrayList<>(); + for (StoreStockCheckTicketDetailEntity detailEntity : ticketEntity.getDetailList()) { + StoreStockCheckTicketDetail detail = new StoreStockCheckTicketDetail(); + detail.setStorageId(detailEntity.getStorageId());// 仓库ID + detail.setStorageName(detailEntity.getStorageName());// 仓库名称 + detail.setProductId(detailEntity.getProductId());// 商品ID + detail.setProductNo(detailEntity.getProductNo());// 商品编号 + detail.setProductName(detailEntity.getProductName());// 商品名称 + detail.setSpecId(detailEntity.getSpecId());// 规格ID + detail.setSpecName(detailEntity.getSpecName());// 规格名称 + detail.setProductDescription(detailEntity.getProductDescription());// 商品说明 + detail.setStockUnitId(detailEntity.getStockUnitId());// 库存单位ID + detail.setStockUnitName(detailEntity.getStockUnitName());// 库存单位名称 + detail.setDescription(detailEntity.getDescription());// 备注说明 + detail.setCreateUser(createUser); + detailList.add(detail); + } + + StoreStockCheckTicketLog ticketLog = new StoreStockCheckTicketLog(); + ticketLog.setType(0);// 操作类型(0-新建;1-修改;2-审核;3-作废;4-反审核;) + ticketLog.setStatus(ticket.getStatus()); + ticketLog.setDescription("新建单据"); + ticketLog.setCreateUser(ticket.getSetMan()); + ticketLog.setTenantId(tenantId); + + StoreStockCheckTicket checkTicket = storeStockCheckTicketService.saveTicket(tenantId, ticket, detailList, ticketLog); + String ticketId = checkTicket.getId(); + response.setStatus(1); + response.setMessage("操作成功"); + Map data = new HashMap<>(); + data.put("ticketId", ticketId); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 业务参数校验 + */ + private Map vaildParam(StoreStockCheckTicketEntity ticket) { + Map validResult = new HashMap<>(); + if (StringUtils.isBlank(ticket.getNo())) { + validResult.put("status", 0); + validResult.put("message", "单据编号不能为空"); + return validResult; + } + + validResult.put("status", 1); + validResult.put("message", "校验通过"); + return validResult; + } + + /** + * 获取未审核的盘点单明细信息列表 + */ + @ServiceMethod(method = "store.stock.uncheck.ticket.detail", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "获取未审核的盘点单明细信息列表") + @Override + public Object storeStockUnCheckTicketDetail(StoreStockUnCheckTicketDetailRequest request) { + String info = "获取未审核的盘点单明细信息列表"; + logger.debug("info:" + info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId();// 门店ID + String storageId = request.getStorageId();// 仓库ID + String typeId = request.getTypeId();// 商品类别ID + String keyword = request.getKeyword();// 查询关键字 + CommonListResponse response = null; + try { + response = new CommonListResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("ct.storeId", storeId)); + if (StringUtils.isNotBlank(storageId)) { + criteria.add(Restrictions.eq("ctd.storageId", storageId)); + } + if (StringUtils.isNotBlank(keyword)) { + criteria.add(Restrictions.or(Restrictions.like("p.barCode", "%" + keyword + "%"), Restrictions.like("ctd.productNo", "%" + keyword + "%"), Restrictions.like("ctd.productName", "%" + keyword + "%"))); + } + if (StringUtils.isNotBlank(typeId)) { + criteria.add(Restrictions.like("p.typePath", "%" + typeId + "%"));// 商品类别ID + } + List> list = storeStockCheckTicketDetailService.getList4UnCheck(tenantId, criteria); + + List> dataList = new ArrayList<>(); + for (Map infoMap : list) { + Map data = new HashMap<>(); + data.put("id", infoMap.get("id"));// 盘点单明细ID + data.put("ticketId", infoMap.get("ticketId"));// 盘点单ID + data.put("ticketNo", infoMap.get("ticketNo"));// 盘点单编号 + data.put("storageId", infoMap.get("storageId"));// 仓库ID + data.put("storageName", infoMap.get("storageName"));// 仓库名称 + data.put("productId", infoMap.get("productId"));// 商品ID + data.put("productNo", infoMap.get("productNo"));// 商品编号 + data.put("productName", infoMap.get("productName"));// 商品名称 + data.put("specId", infoMap.get("specId"));// 规格ID + data.put("specName", infoMap.get("specName"));// 规格名称 + data.put("productDescription", infoMap.get("productDescription"));// 商品说明 + data.put("stockUnitId", infoMap.get("stockUnitId"));// 库存单位ID + data.put("stockUnitName", infoMap.get("stockUnitName"));// 库存单位名称 + data.put("sysPrice", infoMap.get("sysPrice"));// 系统价格 + data.put("sysAmount", infoMap.get("sysAmount"));// 系统数量 + data.put("checkAmount", infoMap.get("checkAmount"));// 盘点数量 + data.put("differenceAmount", infoMap.get("differenceAmount"));// 差异数量 + data.put("sysMoney", infoMap.get("sysMoney"));// 系统金额 + data.put("checkMoney", infoMap.get("checkMoney"));// 盘点金额 + data.put("differenceMoney", infoMap.get("differenceMoney"));// 差异金额 + data.put("description", infoMap.get("description"));// 备注说明 + dataList.add(data); + } + response.setStatus(1); + response.setMessage("操作成功"); + response.setList(dataList); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 门店库存盘点明细删除 + */ + @ServiceMethod(method = "store.stock.check.ticket.detail.del", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店库存盘点明细删除") + @Override + public Object storeStockCheckTicketDetailDel(StoreStockCheckTicketDetailDelRequest request) { + String info = "门店库存盘点明细删除"; + logger.debug("info:" + info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId();// 门店ID + String detailIds = request.getDetailIds();// 明细Ids + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + if (StringUtils.isBlank(detailIds)) { + response.setStatus(0); + response.setMessage("参数detailIds不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + List ids = Arrays.asList(StringUtils.split(detailIds, ",")); + storeStockCheckTicketDetailService.deleteByIds(tenantId, ids); + + Map data = new HashMap<>(); + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 更新未审核的盘点单明细信息 + */ + @ServiceMethod(method = "store.stock.uncheck.ticket.detail.update", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "更新未审核的盘点单明细信息") + @Override + public Object storeStockUnCheckTicketDetailUpdate(StoreStockUnCheckTicketDetailUpdateRequest request) { + String info = "更新未审核的盘点单明细信息"; + logger.debug("info:" + info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId();// 门店ID + String workerNo = request.getWorkerNo();// 操作员工号 + String jsonString = request.getJsonString();// 盘点明细信息 + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + if (StringUtils.isBlank(jsonString)) { + response.setStatus(0); + response.setMessage("参数jsonString不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + List detailList = null; + try { + detailList = JSONUtil.parseObject(jsonString, new TypeReference>() { + }); + } catch (Exception e) { + logger.error(info + "参数jsonString转换成对象失败"); + response.setStatus(0); + response.setMessage("参数jsonString转换成对象失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + if (CollectionUtils.isEmpty(detailList)) { + response.setStatus(0); + response.setMessage("盘点明细信息不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + List ticketDetailList = new ArrayList<>(); + for (StoreStockCheckTicketDetailEntity entity : detailList) { + StoreStockCheckTicketDetail ticketDetail = new StoreStockCheckTicketDetail(); + ticketDetail.setId(entity.getId()); + ticketDetail.setSysPrice(entity.getSysPrice());// 系统价格 + ticketDetail.setSysAmount(entity.getSysAmount());// 系统数量 + ticketDetail.setCheckAmount(entity.getCheckAmount());// 盘点数量 + ticketDetail.setDifferenceAmount(entity.getDifferenceAmount());// 差异数量 + ticketDetail.setSysMoney(entity.getSysMoney());// 系统金额 + ticketDetail.setCheckMoney(entity.getCheckMoney());// 盘点金额 + ticketDetail.setDifferenceMoney(entity.getDifferenceMoney());// 差异金额 + ticketDetail.setDescription(entity.getDescription());// 备注说明 + ticketDetail.setModifyUser(workerNo); + ticketDetail.setModifyDate(new Date()); + ticketDetailList.add(ticketDetail); + } + storeStockCheckTicketDetailService.update(tenantId, ticketDetailList); + + Map data = new HashMap<>(); + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 更新未审核的盘点单状态 + */ + @ServiceMethod(method = "store.stock.uncheck.ticket.status.update", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "更新未审核的盘点单状态") + @Override + public Object storeStockUnCheckTicketStatusUpdate(StoreStockUnCheckTicketStatusUpdateRequest request) { + String info = "更新未审核的盘点单状态"; + logger.debug("info:" + info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId();// 门店ID + String storageId = request.getStorageId();// 仓库ID + Integer status = request.getStatus();// 操作类型 1 审核 2 作废 + String checkMan = request.getCheckMan();// 操作员 + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + if (StringUtils.isBlank(checkMan)) { + response.setStatus(0); + response.setMessage("参数checkMan不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (status == null) { + response.setStatus(0); + response.setMessage("参数status不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + if (status != 1 && status != 2) { + response.setStatus(0); + response.setMessage("参数status有误"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + storeStockCheckTicketService.updateTicketStatus(tenantId, storeId, storageId, status, checkMan); + + response.setStatus(1); + response.setMessage(status == 1 ? "审核成功" : (status == 2 ? "作废成功" : "操作成功")); + Map data = new HashMap<>(); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 获取可盘点商品信息列表 + */ + @ServiceMethod(method = "store.stock.check.product.valid", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "获取可盘点商品信息列表") + @Override + public Object storeStockCheckProductValid(StoreStockCheckProductValidRequest request) { + String info = "获取可盘点商品信息列表"; + logger.debug("info:" + info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId();// 门店ID + String storageId = request.getStorageId();// 仓库ID + String specIds = request.getSpecIds();// 商品Ids + CommonListResponse response = null; + try { + response = new CommonListResponse(); + if (StringUtils.isBlank(storageId)) { + response.setStatus(0); + response.setMessage("参数storageId不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (StringUtils.isBlank(specIds)) { + response.setStatus(0); + response.setMessage("参数specIds不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + List> list = storeStockCheckTicketDetailService.getList4CheckProduct(tenantId, storeId, storageId, specIds); + + List> dataList = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(list)) { + dataList.addAll(list); + } + + response.setStatus(1); + response.setMessage("操作成功"); + response.setList(dataList); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 获取门店库存盘点模板列表 + */ + @ServiceMethod(method = "store.stock.check.template.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "获取门店库存盘点模板列表") + @Override + public Object storeStockCheckTemplateList(StoreStockCheckTemplateListRequest request) { + String info = "获取门店库存盘点模板列表"; + logger.debug("info:" + info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + String keyword = request.getKeyword();// 搜索关键字 + + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + if (StringUtils.isNotBlank(keyword)) { + criteria.add(Restrictions.or(Restrictions.like("t.no", "%" + keyword + "%"), Restrictions.like("t.name", "%" + keyword + "%"))); + } + pager = templateService.getPagerByStoreId(tenantId, storeId, criteria, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List dataList = (List) pager.getList(); + for (StoreStockCheckTemplate data : dataList) { + Map map = new HashMap<>(); + map.put("tenantId", data.getTenantId()); + map.put("id", data.getId()); + map.put("no", data.getNo());// 编号 + map.put("name", data.getName());// 名称 + map.put("description", data.getDescription());// 备注信息 + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 获取门店库存盘点模板明细 + */ + @ServiceMethod(method = "store.stock.check.template.detail", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "获取门店库存盘点模板明细") + @Override + public Object storeStockCheckTemplateDetail(StoreStockCheckTemplateDetailRequest request) { + String info = "获取门店库存盘点模板明细"; + logger.debug("info:" + info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId();// 门店ID + String ticketId = request.getTicketId();// 盘点模板ID + CommonListResponse response = null; + try { + response = new CommonListResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketId", ticketId)); + criteria.add(Restrictions.limit("0", "3000")); + List list = templateDetailService.getList(tenantId, criteria); + List> dataList = new ArrayList<>(); + for (StoreStockCheckTemplateDetail detail : list) { + Map data = new HashMap<>(); + data.put("id", detail.getId());// 盘点模板明细ID + data.put("tenantId", detail.getTenantId());// 租户ID + data.put("ticketId", detail.getTicketId());// 盘点模板ID + data.put("productId", detail.getProductId());// 商品ID + data.put("productNo", detail.getProductNo());// 商品编号 + data.put("productName", detail.getProductName());// 商品名称 + data.put("specId", detail.getSpecId());// 规格ID + data.put("specName", detail.getSpecName());// 规格名称 + data.put("productDescription", detail.getProductDescription());// 商品说明 + data.put("stockUnitId", detail.getStockUnitId());// 库存单位ID + data.put("stockUnitName", detail.getStockUnitName());// 库存单位名称 + dataList.add(data); + } + response.setStatus(1); + response.setMessage("操作成功"); + response.setList(dataList); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 门店库存盘点分析 + */ + @ServiceMethod(method = "store.stock.check.summary", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店库存盘点分析") + @Override + public Object storeStockCheckSummary(StoreStockCheckSummaryRequest request) { + String info = "门店库存盘点分析"; + logger.debug("info:" + info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId();// 门店ID + String no = request.getNo();// 盘点单编号 + String startTime = request.getStartTime();// 开始时间 + String endTime = request.getEndTime();// 结束时间 + String storageId = request.getStorageId();// 仓库ID + String typeId = request.getTypeId();// 商品类别ID + String keyword = request.getKeyword(); + CommonListResponse response = null; + try { + response = new CommonListResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + List> list = storeStockCheckTicketService.getSummary(tenantId, storeId, no, storageId, startTime, endTime, typeId, keyword); + List> dataList = new ArrayList<>(); + Map data = null; + for (Map infoMap : list) { + data = new HashMap<>(); + data.put("no", infoMap.get("no"));// 盘点单编号 + data.put("storageId", infoMap.get("storageId"));// 仓库ID + data.put("storageName", infoMap.get("storageName"));// 仓库名称 + data.put("productId", infoMap.get("productId"));// 商品ID + data.put("productNo", infoMap.get("productNo"));// 商品编号 + data.put("productName", infoMap.get("productName"));// 商品名称 + data.put("specId", infoMap.get("specId"));// 规格ID + data.put("specName", infoMap.get("specName"));// 规格名称 + data.put("productDescription", infoMap.get("productDescription"));// 商品说明 + data.put("stockUnitId", infoMap.get("stockUnitId"));// 库存单位ID + data.put("stockUnitName", infoMap.get("stockUnitName"));// 库存单位名称 + data.put("sysPrice", infoMap.get("sysPrice"));// 系统价格 + data.put("sysAmount", infoMap.get("sysAmount"));// 系统数量 + data.put("checkAmount", infoMap.get("checkAmount"));// 盘点数量 + data.put("differenceAmount", infoMap.get("differenceAmount"));// 差异数量 + data.put("sysMoney", infoMap.get("sysMoney"));// 系统金额 + data.put("checkMoney", infoMap.get("checkMoney"));// 盘点金额 + data.put("differenceMoney", infoMap.get("differenceMoney"));// 差异金额 + data.put("description", infoMap.get("description"));// 备注说明 + data.put("checkMan", infoMap.get("checkMan"));// 审核人 + data.put("checkDate", DateUtils.format((Date) infoMap.get("checkDate"), DateUtils.SHOW_DATETIME_FORMAT));// 审核时间 + dataList.add(data); + } + + response.setStatus(1); + response.setMessage("操作成功"); + response.setList(dataList); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.stock.check.ticket", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店盘点单列表") + @Override + public Object storeStockCheckTicket(StoreStockCheckTicketRequest request) { + String info = "门店盘点单列表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + String no = request.getNo();// 单号 + Integer status = request.getStatus();// 单据状态 + String startTime = request.getStartTime();// 开始时间 + String endTime = request.getEndTime();// 结束时间 + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + if (StringUtils.isNotEmpty(no)) { + criteria.add(Restrictions.eq("no", no));// 单据编号 + } + if (status >= 0) { + criteria.add(Restrictions.eq("status", status));// 单据状态 + } + if (StringUtils.isNotEmpty(startTime)) { + criteria.add(Restrictions.ge("createDate", startTime));// 开始时间 + } + if (StringUtils.isNotEmpty(endTime)) { + criteria.add(Restrictions.le("createDate", endTime));// 结束时间 + } + criteria.add(Restrictions.eq("storeId", request.getStoreId()));// 单据编号 + criteria.add(Restrictions.order("createDate", "desc")); + pager = storeStockCheckTicketService.getPager(tenantId, criteria, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List dataList = (List) pager.getList(); + for (StoreStockCheckTicket ticket : dataList) { + Map map = new HashMap<>(); + map.put("id", ticket.getId()); + map.put("tenantId", ticket.getTenantId()); + map.put("storeId", ticket.getStoreId());// 门店ID + map.put("no", ticket.getNo());// 单据编号 + map.put("status", ticket.getStatus());// 单据状态 + map.put("description", ticket.getDescription());// 备注信息 + map.put("setMan", ticket.getSetMan());// 制单人 + map.put("setDate", formatYMDHMS(ticket.getSetDate()));// 制单日期 + map.put("checkMan", ticket.getCheckMan());// 审核人 + map.put("checkDate", formatYMDHMS(ticket.getCheckDate()));// 审核日期 + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.stock.check.ticket.detail", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店盘点单明细") + @Override + public Object storeStockCheckTicketDetail(StoreStockCheckTicketDetailRequest request) { + String info = "门店盘点单明细"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + String ticketId = request.getTicketId();// 配送单ID + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + if (StringUtils.isBlank(ticketId)) { + response.setStatus(0); + response.setMessage("参数ticketId不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketId", ticketId)); + criteria.add(Restrictions.order("productNo", "asc")); + pager = storeStockCheckTicketDetailService.getPager(tenantId, criteria, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List dataList = (List) pager.getList(); + for (StoreStockCheckTicketDetail ticketDetail : dataList) { + Map map = new HashMap<>(); + map.put("id", ticketDetail.getId()); + map.put("tenantId", ticketDetail.getTenantId()); + map.put("ticketId", ticketDetail.getTicketId());// 盘点单ID + map.put("storageId", ticketDetail.getStorageId());// 出库库位ID + map.put("storageName", ticketDetail.getStorageName());// 出库库位名 + map.put("productId", ticketDetail.getProductId());// 原料ID + map.put("productNo", ticketDetail.getProductNo());// 原料编码 + map.put("productName", ticketDetail.getProductName());// 原料名称 + map.put("specId", ticketDetail.getSpecId());// 规格ID + map.put("specName", ticketDetail.getSpecName());// 规格名称 + map.put("productDescription", ticketDetail.getProductDescription());// 原料说明 + map.put("stockUnitId", ticketDetail.getStockUnitId());// 库存单位 + map.put("stockUnitName", ticketDetail.getStockUnitName());// 库存单位名称 + map.put("sysPrice", doubleFormat(ticketDetail.getSysPrice()));// 系统价格 + map.put("sysAmount", doubleFormat(ticketDetail.getSysAmount()));// 系统金额 + map.put("checkAmount", doubleFormat(ticketDetail.getCheckAmount()));// 盘点数量 + map.put("differenceAmount", doubleFormat(ticketDetail.getDifferenceAmount()));// 差异数量 + map.put("sysMoney", doubleFormat(ticketDetail.getSysMoney()));// 系统金额 + map.put("checkMoney", doubleFormat(ticketDetail.getCheckMoney()));// 盘点金额 + map.put("differenceMoney", doubleFormat(ticketDetail.getDifferenceMoney()));// 差异金额 + map.put("description", ticketDetail.getDescription());// 备注信息 + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/storage/StoreStorageServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/storage/StoreStorageServiceImpl.java new file mode 100644 index 0000000..18bba23 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/storage/StoreStorageServiceImpl.java @@ -0,0 +1,3117 @@ +package com.jwsaas.api.service.impl.storage; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import com.jwsaas.entity.food.*; +import com.jwsaas.reactor.event.EventKeys; +import com.jwsaas.service.food.DispatchTicketDetailService; +import com.jwsaas.service.food.StoreAccountService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; + +import com.alibaba.fastjson.JSONObject; +import com.jwsaas.api.entity.storage.AskGoodsDetailEntity; +import com.jwsaas.api.entity.storage.AskGoodsTemplateDetailEntity; +import com.jwsaas.api.entity.storage.AskGoodsTemplateEntity; +import com.jwsaas.api.entity.storage.AskGoodsTicketEntity; +import com.jwsaas.api.request.storage.AskGoodsDetailRemoveRequest; +import com.jwsaas.api.request.storage.AskGoodsDetailRequest; +import com.jwsaas.api.request.storage.AskGoodsTemplateAddRequest; +import com.jwsaas.api.request.storage.AskGoodsTemplateDetailRequest; +import com.jwsaas.api.request.storage.AskGoodsTemplateEditRequest; +import com.jwsaas.api.request.storage.AskGoodsTemplateListRequest; +import com.jwsaas.api.request.storage.AskGoodsTicketAddRequest; +import com.jwsaas.api.request.storage.AskGoodsTicketEditRequest; +import com.jwsaas.api.request.storage.AskGoodsTicketRequest; +import com.jwsaas.api.request.storage.AskGoodsTicketStatusRequest; +import com.jwsaas.api.request.storage.ProductDispatchPriceRequest; +import com.jwsaas.api.request.storage.StoreProductStockOutSummaryRequest; +import com.jwsaas.api.request.storage.StoreProductStockRequest; +import com.jwsaas.api.request.storage.StoreProductStockSumRequest; +import com.jwsaas.api.request.storage.StoreStorageRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.response.mode.CommonListResponse; +import com.jwsaas.api.response.mode.CommonPagerResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.storage.StoreStorageService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.pager.Pager; +import com.jwsaas.util.DateUtils; +import com.jwsaas.utils.AppKeyUtil; +import com.jwsaas.utils.MathUtil; +import reactor.bus.Event; + +@ServiceMethodBean(version = "1.0") +public class StoreStorageServiceImpl extends WopServiceImpl implements StoreStorageService { + + private static final long serialVersionUID = -1605461072453112374L; + + @Resource + private com.jwsaas.service.food.StoreService storeService; + + @Resource + private com.jwsaas.service.food.StoreStorageService storeStorageService; + + @Resource + private com.jwsaas.service.food.AskGoodsTicketService askGoodsTicketService; + + @Resource + private com.jwsaas.service.food.AskGoodsDetailService askGoodsDetailService; + + @Resource + private com.jwsaas.service.food.ReceiveDifferenceTicketService differenceTicketService; + + @Resource + private com.jwsaas.service.food.ReceiveDifferenceDetailService differenceDetailService; + + @Resource + private com.jwsaas.service.food.AskGoodsTicketLogService askGoodsTicketLogService; + + @Resource + private com.jwsaas.service.food.StoreProductService storeProductService; + + @Resource + private com.jwsaas.service.food.ProductService productService; + + @Resource + private com.jwsaas.service.food.ProductSpecService productSpecService; + + @Resource + private com.jwsaas.service.food.ProductRatioService productRatioService; + + @Resource + private com.jwsaas.service.food.ProductUnitService productUnitService; + + @Resource + private com.jwsaas.service.food.ProductStoreStockService productStoreStockService; + + @Resource + private com.jwsaas.service.food.StoreDispatchAccountService storeDispatchAccountService; + + @Resource + private com.jwsaas.service.food.AskGoodsTemplateService askGoodsTemplateService; + + @Resource + private com.jwsaas.service.food.AskGoodsTemplateDetailService askGoodsTemplateDetailService; + + @Resource + private com.jwsaas.service.food.ProductStoreStockLogService productStoreStockLogService; + + @Resource + private com.jwsaas.service.food.TicketPrintSettingService ticketPrintSettingService; + + @Resource + private com.jwsaas.service.food.DispatchTicketService dispatchTicketService; + + @Resource + private DispatchTicketDetailService dispatchTicketDetailService; + + @Resource + private StoreAccountService storeAccountService; + + + @ServiceMethod(method = "store.storage", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店仓库列表") + @Override + public Object storeStorage(StoreStorageRequest request) { + String info = "门店仓库列表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + CommonListResponse response = null; + try { + response = new CommonListResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + List source = storeStorageService.getListByStoreId(tenantId, request.getStoreId()); + List> list = new ArrayList<>(); + for (StoreStorage storeStorage : source) { + Map map = new HashMap<>(); + map.put("tenantId", storeStorage.getTenantId()); + map.put("id", storeStorage.getId()); + map.put("no", storeStorage.getNo()); + map.put("name", storeStorage.getName()); + list.add(map); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "STORAGE_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.askgoods.ticket", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店要货单信息") + @Override + public Object askGoodsTicket(AskGoodsTicketRequest request) { + + String info = "门店要货单信息"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + Integer status = request.getStatus();// 单据状态 + Integer payStatus = request.getPayStatus();// 付款类型 + String no = request.getNo();// 单号 + String startTime = request.getStartTime();// 开始时间 + String endTime = request.getEndTime();// 结束时间 + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + if (StringUtils.isNotEmpty(no)) { + // 单据编号 + criteria.add(Restrictions.eq("no", no)); + } + if (StringUtils.isNotEmpty(startTime)) { + // 开始时间 + criteria.add(Restrictions.ge("createDate", startTime)); + } + if (StringUtils.isNotEmpty(endTime)) { + // 结束时间 + criteria.add(Restrictions.le("createDate", endTime)); + } + if (null != status && status > -1) { + // 单据状态 + criteria.add(Restrictions.eq("status", status)); + } + if (null != payStatus && payStatus > 0) { + // 支付状态 + criteria.add(Restrictions.eq("payStatus", payStatus)); + } + criteria.add(Restrictions.eq("storeId", request.getStoreId())); + criteria.add(Restrictions.order("createDate", "desc")); + pager = askGoodsTicketService.getPager(tenantId, criteria, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (AskGoodsTicket askGoodsTicket : source) { + Map map = new HashMap<>(); + map.put("tenantId", askGoodsTicket.getTenantId()); + map.put("id", askGoodsTicket.getId()); + map.put("no", askGoodsTicket.getNo()); + map.put("storeId", askGoodsTicket.getStoreId()); + map.put("storeNo", askGoodsTicket.getStoreNo()); + map.put("storeName", askGoodsTicket.getStoreName()); + map.put("description", askGoodsTicket.getDescription()); + map.put("status", askGoodsTicket.getStatus()); + map.put("payStatus", askGoodsTicket.getPayStatus()); + map.put("productMoney", doubleFormat(askGoodsTicket.getProductMoney())); + map.put("dispatchMoney", doubleFormat(askGoodsTicket.getDispatchMoney())); + map.put("totalMoney", doubleFormat(askGoodsTicket.getTotalMoney())); + map.put("setMan", askGoodsTicket.getSetMan()); + map.put("setDate", formatYMDHMS(askGoodsTicket.getSetDate())); + map.put("reason", askGoodsTicket.getReason());// 驳回原因 + map.put("checkMan", askGoodsTicket.getCheckMan()); + map.put("checkDate", formatYMDHMS(askGoodsTicket.getCheckDate())); + map.put("dispatchDate", formatYMDHMS(askGoodsTicket.getDispatchDate())); + map.put("reason", askGoodsTicket.getReason());// 驳回作废原因 + map.put("deliveryMode", askGoodsTicket.getDeliveryMode());// 配送方式 + map.put("deliveryModeDesc", askGoodsTicket.getDeliveryModeDesc());// 配送方式说明 + map.put("barCodeNo", askGoodsTicket.getBarCodeNo());// 条码标识 + map.put("erpToExamine", askGoodsTicket.getErpToExamine());// ERP单据是否审核 + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "ASKGOODS_TICKET_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + + } + + // 门店要货单信息2(门店已审核,总部已配送单据统称为待发货要货单) + @ServiceMethod(method = "store.waitSendAskgoods.ticket", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店要货单信息2") + @Override + public Object waitSendAskgoods(AskGoodsTicketRequest request) { + + String info = "门店要货单信息2"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + Integer status = request.getStatus();// 单据状态 + Integer payStatus = request.getPayStatus();// 付款类型 + String no = request.getNo();// 单号 + String startTime = request.getStartTime();// 开始时间 + String endTime = request.getEndTime();// 结束时间 + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + if (StringUtils.isNotEmpty(no)) { + // 单据编号 + criteria.add(Restrictions.eq("no", no)); + } + if (StringUtils.isNotEmpty(startTime)) { + // 开始时间 + criteria.add(Restrictions.ge("createDate", startTime)); + } + if (StringUtils.isNotEmpty(endTime)) { + // 结束时间 + criteria.add(Restrictions.le("createDate", endTime)); + } + if (null != status && status > -1) { + // status:6 待发货订单 待发货订单包括门店已审核,总部已配送订单 + if (status == 6) { + List statusList = new ArrayList(); + statusList.add(status); + statusList.add(2); + criteria.add(Restrictions.in("status", statusList)); + } else { + // 单据状态 + criteria.add(Restrictions.eq("status", status)); + } + } + if (null != payStatus && payStatus > 0) { + // 支付状态 + criteria.add(Restrictions.eq("payStatus", payStatus)); + } + criteria.add(Restrictions.order("createDate", "desc")); + criteria.add(Restrictions.eq("storeId", request.getStoreId())); + pager = askGoodsTicketService.getPager(tenantId, criteria, pager); + + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (AskGoodsTicket askGoodsTicket : source) { + Map map = new HashMap<>(); + map.put("tenantId", askGoodsTicket.getTenantId()); + map.put("id", askGoodsTicket.getId()); + map.put("no", askGoodsTicket.getNo()); + map.put("storeId", askGoodsTicket.getStoreId()); + map.put("storeNo", askGoodsTicket.getStoreNo()); + map.put("storeName", askGoodsTicket.getStoreName()); + map.put("description", askGoodsTicket.getDescription()); + map.put("status", askGoodsTicket.getStatus()); + map.put("payStatus", askGoodsTicket.getPayStatus()); + DispatchTicket dispatchTicket = dispatchTicketService.find(tenantId, "askgoodsId", askGoodsTicket.getId()); + if (dispatchTicket != null) { + map.put("productMoney", doubleFormat(dispatchTicket.getOrderMoney())); + map.put("dispatchMoney", doubleFormat(dispatchTicket.getLogisticsFee() + dispatchTicket.getOtherFee())); + map.put("totalMoney", doubleFormat(dispatchTicket.getMoney())); + } else { + map.put("productMoney", doubleFormat(askGoodsTicket.getProductMoney())); + map.put("dispatchMoney", doubleFormat(askGoodsTicket.getDispatchMoney())); + map.put("totalMoney", doubleFormat(askGoodsTicket.getTotalMoney())); + } + map.put("setMan", askGoodsTicket.getSetMan()); + map.put("setDate", formatYMDHMS(askGoodsTicket.getSetDate())); + map.put("checkMan", askGoodsTicket.getCheckMan()); + map.put("checkDate", formatYMDHMS(askGoodsTicket.getCheckDate())); + map.put("dispatchDate", formatYMDHMS(askGoodsTicket.getDispatchDate())); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "ASKGOODS_TICKET_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.askgoods.detail", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店要货单明细信息") + @Override + public Object askGoodsDetail(AskGoodsDetailRequest request) { + + String info = "门店要货单明细信息"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + String ticketId = request.getTicketId();// 要货单ID + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + if (StringUtils.isBlank(ticketId)) { + response.setStatus(0); + response.setMessage("参数ticketId不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketId", ticketId)); + criteria.add(Restrictions.order("productNo", "asc")); + pager = askGoodsDetailService.getPager(tenantId, criteria, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (AskGoodsDetail askGoodsDetail : source) { + Map map = new HashMap<>(); + map.put("tenantId", askGoodsDetail.getTenantId()); + map.put("id", askGoodsDetail.getId()); + map.put("ticketId", askGoodsDetail.getTicketId()); + map.put("ticketNo", askGoodsDetail.getTicketNo()); + map.put("productId", askGoodsDetail.getProductId()); + map.put("productNo", askGoodsDetail.getProductNo()); + map.put("productName", askGoodsDetail.getProductName()); + map.put("specId", askGoodsDetail.getSpecId()); + map.put("specName", askGoodsDetail.getSpecName()); + map.put("productDescription", askGoodsDetail.getProductDescription()); + map.put("packUnitId", askGoodsDetail.getPackUnitId()); + map.put("packUnitName", askGoodsDetail.getPackUnitName()); + map.put("packUnitAmount", doubleFormat(askGoodsDetail.getPackUnitAmount())); + map.put("dispatchUnitId", askGoodsDetail.getDispatchUnitId()); + map.put("dispatchUnitName", askGoodsDetail.getDispatchUnitName()); + map.put("amount", doubleFormat(askGoodsDetail.getAmount())); + map.put("price", doubleFormat(askGoodsDetail.getPrice())); + map.put("money", doubleFormat(askGoodsDetail.getMoney())); + map.put("description", askGoodsDetail.getDescription()); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "ASKGOODS_DETAIL_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + + } + + // 配送验收差异信息 + @ServiceMethod(method = "store.receiveDifference.ticket", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "配送验收差异信息") + @Override + public Object differenceTicket(AskGoodsTicketRequest request) { + String info = "配送验收差异信息"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + Integer status = request.getStatus();// 单据状态 + String no = request.getNo();// 单号 + String startTime = request.getStartTime();// 开始时间 + String endTime = request.getEndTime();// 结束时间 + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + if (StringUtils.isNotEmpty(no)) { + // 单据编号 + criteria.add(Restrictions.eq("no", no)); + } + if (StringUtils.isNotEmpty(startTime)) { + // 开始时间 + criteria.add(Restrictions.ge("createDate", startTime)); + } + if (StringUtils.isNotEmpty(endTime)) { + // 结束时间 + criteria.add(Restrictions.le("createDate", endTime)); + } + if (null != status && status > -1) { + // 单据状态 + criteria.add(Restrictions.eq("status", status)); + } + criteria.add(Restrictions.eq("storeId", request.getStoreId())); + criteria.add(Restrictions.order("createDate", "desc")); + pager = differenceTicketService.getPager(tenantId, criteria, pager); + // 差异单 + List> list = new ArrayList<>(); + // 差异单Id + List ticketIds = new ArrayList(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (ReceiveDifferenceTicket ticket : source) { + Map map = new HashMap<>(); + map.put("tenantId", ticket.getTenantId()); + map.put("id", ticket.getId()); + map.put("no", ticket.getNo()); + + map.put("dispatchId", ticket.getDispatchId()); + map.put("dispatchNo", ticket.getDispatchNo()); + map.put("operator", ticket.getOperator()); + + map.put("storeId", ticket.getStoreId()); + map.put("storeNo", ticket.getStoreNo()); + map.put("storeName", ticket.getStoreName()); + map.put("description", ticket.getDescription()); + map.put("status", ticket.getStatus()); + + map.put("setMan", ticket.getSetMan()); + map.put("setDate", formatYMDHMS(ticket.getSetDate())); + map.put("checkMan", ticket.getCheckMan()); + map.put("checkDate", formatYMDHMS(ticket.getCheckDate())); + list.add(map); + + ticketIds.add(ticket.getId()); + } + } + + // 由订单Id查询订单详情金额汇总 + List> detailSums = new ArrayList>(); + if (CollectionUtils.isNotEmpty(ticketIds)) { + criteria = new Criteria(); + criteria.add(Restrictions.in("ticketId", ticketIds)); + criteria.add(Restrictions.group("ticketId")); + detailSums = differenceDetailService.getSumData(tenantId, criteria, false); + } + + // 组装数据 订单添加详情汇总金额和数量 + for (Map map : list) { + String ticketId = map.get("id").toString(); + double sumAmount = 0;// 差异数量汇总 + double sumMoney = 0; // 差异金额汇总 + boolean matched = false; + for (Map sumMap : detailSums) { + String sumTicketId = sumMap.get("ticketId").toString(); + if (ticketId.equals(sumTicketId)) { + matched = true; + sumAmount = -Double.valueOf(sumMap.get("sumAmount").toString()); + sumMoney = -Double.valueOf(sumMap.get("sumMoney").toString()); + } + } + if (!matched) { + logger.error(info + "时发生异常 订单id:[" + map.get("id").toString() + "] no:[" + map.get("no").toString() + "] 没有匹配的详情汇总信息"); + } + map.put("sumAmount", sumAmount); + map.put("sumMoney", sumMoney); + } + + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "RECEIVE_DIFFERENCE_TICKET_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + // 配送验收差异详情 + @ServiceMethod(method = "store.receiveDifference.detail", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "配送验收差异详情") + @Override + public Object differenceDetail(AskGoodsDetailRequest request) { + + String info = "配送验收差异详情"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + String ticketId = request.getTicketId();// 要货单ID + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + if (StringUtils.isBlank(ticketId)) { + response.setStatus(0); + response.setMessage("参数ticketId不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketId", ticketId)); + criteria.add(Restrictions.order("productNo", "asc")); + pager = differenceDetailService.getPager(tenantId, criteria, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (ReceiveDifferenceDetail ticketDetail : source) { + Map map = new HashMap<>(); + map.put("tenantId", ticketDetail.getTenantId()); + map.put("id", ticketDetail.getId()); + map.put("ticketId", ticketDetail.getTicketId()); + map.put("storageId", ticketDetail.getStorageId()); + map.put("storageName", ticketDetail.getStorageName()); + map.put("productId", ticketDetail.getProductId()); + map.put("productNo", ticketDetail.getProductNo()); + map.put("productName", ticketDetail.getProductName()); + map.put("specId", ticketDetail.getSpecId()); + map.put("specName", ticketDetail.getSpecName()); + map.put("productDescription", ticketDetail.getProductDescription()); + + map.put("askgoodsAmount", ticketDetail.getAskgoodsAmount()); + map.put("dispatchAmount", ticketDetail.getDispatchAmount()); + map.put("dispatchUnitId", ticketDetail.getDispatchUnitId()); + map.put("dispatchUnitName", ticketDetail.getDispatchUnitName()); + map.put("price", ticketDetail.getPrice()); + map.put("money", ticketDetail.getMoney()); + map.put("receivegoodsAmount", ticketDetail.getReceivegoodsAmount()); + map.put("subtotalPrice", ticketDetail.getSubtotalPrice()); + map.put("differenceAmount", ticketDetail.getDifferenceAmount()); + map.put("differencePrice", ticketDetail.getDifferencePrice()); + map.put("type", ticketDetail.getType()); + + map.put("description", ticketDetail.getDescription()); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "RECEIVE_DIFFERENCE_DETAIL_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + + } + + @ServiceMethod(method = "store.product.dispatchprice", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "原料批发价格") + @Override + public Object productDispatchPrice(ProductDispatchPriceRequest request) { + String info = "原料批发价格"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId();// 门店ID + String specIds = request.getSpecIds();// 规格ID + CommonListResponse response = null; + try { + response = new CommonListResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + List specIdList = new ArrayList<>(); + String[] ids = specIds.split(","); + for (int i = 0; i < ids.length; i++) { + specIdList.add(ids[i]); + } + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.in("specId", specIdList)); + criteria.add(Restrictions.group("specId")); + List source = storeProductService.getList(tenantId, criteria); + List> list = new ArrayList<>(); + for (StoreProduct storeProduct : source) { + Map map = new HashMap<>(); + map.put("tenantId", storeProduct.getTenantId()); + map.put("productId", storeProduct.getProductId()); + map.put("specId", storeProduct.getSpecId()); + map.put("dispatchPrice", doubleFormat(storeProduct.getDispatchPrice())); + list.add(map); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "PRODUCT_DISPATCHPRICE_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.askgoods.ticket.add", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店要货单新增") + @Override + public Object askGoodsTicketAdd(AskGoodsTicketAddRequest request) { + String info = "门店要货单新增"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId();// 门店ID + String jsonString = request.getJsonString();// 门店要货单新增数据 + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Store store = storeService.get(tenantId, storeId); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + AskGoodsTicketEntity entity = new AskGoodsTicketEntity(JSONObject.parseObject(jsonString)); + Date createDate = new Date(); + AskGoodsTicket ticket = new AskGoodsTicket(); + ticket.setCreateDate(createDate); + if (StringUtils.isEmpty(entity.getSetMan()) || entity.getSetMan().length() > 32) { + response.setStatus(0); + response.setMessage("要货单制单人参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ticket.setSetMan(entity.getSetMan()); + ticket.setCreateUser(entity.getSetMan()); + if (StringUtils.isNotEmpty(entity.getDescription()) && entity.getDescription().length() > 128) { + response.setStatus(0); + response.setMessage("要货单备注说明参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ticket.setDescription(entity.getDescription()); + ticket.setDispatchMoney(entity.getDispatchMoney()); + ticket.setIsUse(0); + if (StringUtils.isEmpty(entity.getNo()) || entity.getNo().length() > 32) { + response.setStatus(0); + response.setMessage("要货单单据号参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + List ticketList = askGoodsTicketService.findList(tenantId, "no", entity.getNo()); + if (CollectionUtils.isNotEmpty(ticketList)) { + response.setStatus(0); + response.setMessage("要货单单据号已存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ticket.setNo(entity.getNo()); + ticket.setPayStatus(0); + ticket.setProductMoney(entity.getProductMoney()); + ticket.setSetDate(createDate); + ticket.setStatus(0); + ticket.setStoreId(storeId); + ticket.setStoreName(store.getName()); + ticket.setStoreNo(store.getNo()); + ticket.setTenantId(tenantId); + ticket.setTotalMoney(entity.getTotalMoney()); + ticket.setDeliveryMode(entity.getDeliveryMode()); + ticket.setDeliveryModeDesc(entity.getDeliveryModeDesc()); + List detailList = entity.getDetail(); + List detail = new ArrayList<>(); + + for (AskGoodsDetailEntity detailEntity : detailList) { + + Product product = productService.get(tenantId, detailEntity.getProductId()); + if (product == null) { + response.setStatus(0); + response.setMessage("商品信息不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ProductSpec productSpec = productSpecService.get(tenantId, detailEntity.getSpecId()); + if (productSpec == null) { + response.setStatus(0); + response.setMessage("商品规格信息不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + List productRatioList = productRatioService.findList(tenantId, "productId", detailEntity.getProductId()); + if (CollectionUtils.isEmpty(productRatioList)) { + response.setStatus(0); + response.setMessage(product.getName() + "库存系数未设置"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ProductRatio productRatio = productRatioList.get(0); + ProductUnit productUnit = productUnitService.get(tenantId, productRatio.getDispatchUnitId()); + if (productUnit == null) { + response.setStatus(0); + response.setMessage(product.getName() + "配送单位不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ProductUnit productUnit1 = productUnitService.get(tenantId, productRatio.getPackUnitId()); + if (productUnit1 == null) { + response.setStatus(0); + response.setMessage(product.getName() + "包装单位不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + AskGoodsDetail askGoodsDetail = new AskGoodsDetail(); + askGoodsDetail.setAmount(detailEntity.getAmount()); + askGoodsDetail.setCreateDate(createDate); + askGoodsDetail.setCreateUser(entity.getSetMan()); + askGoodsDetail.setDescription(detailEntity.getDescription()); + askGoodsDetail.setDispatchUnitId(productRatio.getDispatchUnitId()); + askGoodsDetail.setDispatchUnitName(productUnit.getName()); + double money = MathUtil.multiply(detailEntity.getAmount(), detailEntity.getPrice()); + // askGoodsDetail.setMoney(detailEntity.getMoney()); + askGoodsDetail.setMoney(money); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("productId", detailEntity.getProductId())); + criteria.add(Restrictions.eq("specId", detailEntity.getSpecId())); + criteria.add(Restrictions.eq("storeId", storeId)); + List productStoreStockList = productStoreStockService.getList(tenantId, criteria); + double packUnitAmount = 0.0000; + if (CollectionUtils.isNotEmpty(productStoreStockList)) { + for (ProductStoreStock productStoreStock : productStoreStockList) { + packUnitAmount = packUnitAmount + productStoreStock.getStockAmount(); + } + } + askGoodsDetail.setPackUnitAmount(packUnitAmount);// 当前分店库存 + askGoodsDetail.setPackUnitId(productRatio.getPackUnitId()); + askGoodsDetail.setPackUnitName(productUnit1.getName()); + askGoodsDetail.setPrice(detailEntity.getPrice()); + askGoodsDetail.setProductId(detailEntity.getProductId()); + askGoodsDetail.setProductName(product.getName()); + askGoodsDetail.setProductNo(product.getNo()); + askGoodsDetail.setSpecId(detailEntity.getSpecId()); + askGoodsDetail.setSpecName(productSpec.getName()); + askGoodsDetail.setProductDescription(product.getDescription()); + askGoodsDetail.setTenantId(tenantId); + detail.add(askGoodsDetail); + + } + + AskGoodsTicketLog log = new AskGoodsTicketLog(); + log.setCreateDate(createDate); + log.setCreateUser(entity.getSetMan()); + log.setDescription("工号" + entity.getSetMan() + ",新增要货单"); + log.setPayStatus(0); + log.setStatus(0); + log.setType(0); + log.setTenantId(tenantId); + String ticketId = askGoodsTicketService.saveAskGoodsTicket(tenantId, ticket, detail, log); + response.setStatus(1); + response.setMessage("要货单新建成功"); + Map data = new HashMap<>(); + data.put("ticketId", ticketId); + response.setData(data); + + System.out.println("end " + DateUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss:SSS")); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "ASKGOODS_TICKET_ADD_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /*** + * 新增要货单(优化保存时间过长的问题) + */ + @ServiceMethod(method = "store.askgoods.ticket.add2", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店要货单新增") + @Override + public Object askGoodsTicketAdd2(AskGoodsTicketAddRequest request) { + String info = "门店要货单新增"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId();// 门店ID + String jsonString = request.getJsonString();// 门店要货单新增数据 + CommonDataResponse response = null; + try { + + response = new CommonDataResponse(); + Store store = storeService.get(tenantId, storeId); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + JSONObject orderObj = JSONObject.parseObject(jsonString); + if (null == orderObj || !orderObj.containsKey("detail") || StringUtils.isBlank(orderObj.getString("detail"))) { + logger.error(jsonString); + response.setStatus(0); + response.setMessage("订单信息异常"); + response.setErrCode(CommonErrorCode.error23.getCode()); + response.setErrMessage(CommonErrorCode.error23.getMessage()); + return response; + } + AskGoodsTicketEntity entity = new AskGoodsTicketEntity(orderObj); + Date createDate = new Date(); + AskGoodsTicket ticket = new AskGoodsTicket(); + ticket.setCreateDate(createDate); + if (StringUtils.isEmpty(entity.getSetMan()) || entity.getSetMan().length() > 32) { + response.setStatus(0); + response.setMessage("要货单制单人参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ticket.setSetMan(entity.getSetMan()); + ticket.setCreateUser(entity.getSetMan()); + if (StringUtils.isNotEmpty(entity.getDescription()) && entity.getDescription().length() > 128) { + response.setStatus(0); + response.setMessage("要货单备注说明参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ticket.setDescription(entity.getDescription()); + ticket.setDispatchMoney(entity.getDispatchMoney()); + ticket.setIsUse(0); + if (StringUtils.isEmpty(entity.getNo()) || entity.getNo().length() > 32) { + response.setStatus(0); + response.setMessage("要货单单据号参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + List ticketList = askGoodsTicketService.findList(tenantId, "no", entity.getNo()); + if (CollectionUtils.isNotEmpty(ticketList)) { + response.setStatus(0); + response.setMessage("要货单单据号已存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ticket.setNo(entity.getNo()); + ticket.setPayStatus(0); + ticket.setProductMoney(entity.getProductMoney()); + ticket.setSetDate(createDate); + ticket.setStatus(0); + ticket.setStoreId(storeId); + ticket.setStoreName(store.getName()); + ticket.setStoreNo(store.getNo()); + ticket.setTenantId(tenantId); + ticket.setDeliveryMode(entity.getDeliveryMode()); + ticket.setDeliveryModeDesc(entity.getDeliveryModeDesc()); + + List detailList = entity.getDetail(); + List detail = new ArrayList<>(); + + List productIds = new ArrayList(); + List specIds = new ArrayList(); + + for (AskGoodsDetailEntity detailEntity : detailList) { + productIds.add(detailEntity.getProductId()); + specIds.add(detailEntity.getSpecId()); + } + + // 查询并存储所有product + Map productMap = new HashMap(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.limit("0", "100000")); + criteria.add(Restrictions.eq("stockFlag", 1)); + criteria.add(Restrictions.eq("deleteFlag", 0)); + List productList = productService.getList(tenantId, criteria); + for (Product product : productList) { + productMap.put(product.getId(), product); + } + + // 查询并存储所有product + Map specMap = new HashMap(); + criteria = new Criteria(); + criteria.add(Restrictions.limit("0", "100000")); + criteria.add(Restrictions.eq("deleteFlag", 0)); + List specList = productSpecService.getList(tenantId, criteria); + for (ProductSpec spec : specList) { + specMap.put(spec.getId(), spec); + } + + // 查询所有商品库存系数 + Map ratioMap = new HashMap(); + criteria = new Criteria(); + criteria.add(Restrictions.limit("0", "100000")); + List ratioList = productRatioService.getList(tenantId, criteria); + for (ProductRatio ratio : ratioList) { + ratioMap.put(ratio.getProductId(), ratio); + } + + // 查询所有单位 + Map unitMap = new HashMap(); + criteria = new Criteria(); + criteria.add(Restrictions.limit("0", "100000")); + List unitList = productUnitService.getList(tenantId, criteria); + for (ProductUnit unit : unitList) { + unitMap.put(unit.getId(), unit); + } + double totalCash = 0.00; + for (AskGoodsDetailEntity detailEntity : detailList) { + + Product product = productMap.get(detailEntity.getProductId()); + if (null == product) { + response.setStatus(0); + response.setMessage("商品信息不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + ProductSpec productSpec = specMap.get(detailEntity.getSpecId()); + if (null == productSpec) { + response.setStatus(0); + response.setMessage("商品规格信息不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + ProductRatio productRatio = ratioMap.get(detailEntity.getProductId()); + if (null == productRatio) { + response.setStatus(0); + response.setMessage(product.getName() + "库存系数未设置"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + ProductUnit productUnit = unitMap.get(productRatio.getDispatchUnitId()); + if (productUnit == null) { + response.setStatus(0); + response.setMessage(product.getName() + "配送单位不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ProductUnit productUnit1 = unitMap.get(productRatio.getPackUnitId()); + if (productUnit1 == null) { + response.setStatus(0); + response.setMessage(product.getName() + "包装单位不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + AskGoodsDetail askGoodsDetail = new AskGoodsDetail(); + askGoodsDetail.setAmount(detailEntity.getAmount()); + askGoodsDetail.setCreateDate(createDate); + askGoodsDetail.setCreateUser(entity.getSetMan()); + askGoodsDetail.setDescription(detailEntity.getDescription()); + askGoodsDetail.setDispatchUnitId(productRatio.getDispatchUnitId()); + askGoodsDetail.setDispatchUnitName(productUnit.getName()); + + BigDecimal amount = new BigDecimal(String.valueOf(detailEntity.getAmount())); + BigDecimal price = new BigDecimal(String.valueOf(detailEntity.getPrice())); + BigDecimal money = MathUtil.multiply(amount, price, 4, BigDecimal.ROUND_HALF_UP); + totalCash = MathUtil.add(new BigDecimal(String.valueOf(totalCash)), money).doubleValue(); + + askGoodsDetail.setMoney(money.doubleValue()); + + criteria = new Criteria(); + criteria.add(Restrictions.eq("productId", detailEntity.getProductId())); + criteria.add(Restrictions.eq("specId", detailEntity.getSpecId())); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.limit("0", "10000")); + List productStoreStockList = productStoreStockService.getList(tenantId, criteria); + double packUnitAmount = 0.0000; + if (CollectionUtils.isNotEmpty(productStoreStockList)) { + for (ProductStoreStock productStoreStock : productStoreStockList) { + packUnitAmount = packUnitAmount + productStoreStock.getStockAmount(); + } + } + + askGoodsDetail.setPackUnitAmount(packUnitAmount);// 当前分店库存 + askGoodsDetail.setPackUnitId(productRatio.getPackUnitId()); + askGoodsDetail.setPackUnitName(productUnit1.getName()); + askGoodsDetail.setPrice(detailEntity.getPrice()); + askGoodsDetail.setProductId(detailEntity.getProductId()); + askGoodsDetail.setProductName(product.getName()); + askGoodsDetail.setProductNo(product.getNo()); + askGoodsDetail.setSpecId(detailEntity.getSpecId()); + askGoodsDetail.setSpecName(productSpec.getName()); + askGoodsDetail.setProductDescription(product.getDescription()); + askGoodsDetail.setTenantId(tenantId); + detail.add(askGoodsDetail); + + } + ticket.setProductMoney(totalCash); + ticket.setTotalMoney(totalCash); + + AskGoodsTicketLog log = new AskGoodsTicketLog(); + log.setCreateDate(createDate); + log.setCreateUser(entity.getSetMan()); + log.setDescription("工号" + entity.getSetMan() + ",新增要货单"); + log.setPayStatus(0); + log.setStatus(0); + log.setType(0); + log.setTenantId(tenantId); + String ticketId = askGoodsTicketService.saveAskGoodsTicket(tenantId, ticket, detail, log); + response.setStatus(1); + response.setMessage("要货单新建成功"); + Map data = new HashMap<>(); + data.put("ticketId", ticketId); + response.setData(data); + + } catch (Exception e) { + logger.error(info + " >>>>>>>" + jsonString); + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "ASKGOODS_TICKET_ADD_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.askgoods.ticket.edit", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店要货单修改") + @Override + public Object askGoodsTicketEdit(AskGoodsTicketEditRequest request) { + String info = "门店要货单修改"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId();// 门店ID + String jsonString = request.getJsonString();// 门店要货单新增数据 + CommonDataResponse response = null; + try { + + response = new CommonDataResponse(); + Store store = storeService.get(tenantId, storeId); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + AskGoodsTicketEntity entity = new AskGoodsTicketEntity(JSONObject.parseObject(jsonString)); + Date createDate = new Date(); + AskGoodsTicket ticket = new AskGoodsTicket(); + ticket.setCreateDate(createDate); + if (StringUtils.isEmpty(entity.getSetMan()) || entity.getSetMan().length() > 32) { + response.setStatus(0); + response.setMessage("要货单制单人参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ticket.setSetMan(entity.getSetMan()); + ticket.setCreateUser(entity.getSetMan()); + if (StringUtils.isNotEmpty(entity.getDescription()) && entity.getDescription().length() > 128) { + response.setStatus(0); + response.setMessage("要货单备注说明参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ticket.setDescription(entity.getDescription()); + ticket.setDispatchMoney(entity.getDispatchMoney()); + ticket.setIsUse(0); + if (StringUtils.isEmpty(entity.getNo()) || entity.getNo().length() > 32) { + response.setStatus(0); + response.setMessage("要货单单据号参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ticket.setId(entity.getId()); + ticket.setNo(entity.getNo()); + ticket.setPayStatus(0); + ticket.setProductMoney(entity.getProductMoney()); + ticket.setSetDate(createDate); + ticket.setStatus(0); + ticket.setStoreId(storeId); + ticket.setStoreName(store.getName()); + ticket.setStoreNo(store.getNo()); + ticket.setTenantId(tenantId); + ticket.setTotalMoney(entity.getTotalMoney()); + ticket.setDeliveryMode(entity.getDeliveryMode()); + ticket.setDeliveryModeDesc(entity.getDeliveryModeDesc()); + List detailList = entity.getDetail(); + List detail = new ArrayList<>(); + + for (AskGoodsDetailEntity detailEntity : detailList) { + + Product product = productService.get(tenantId, detailEntity.getProductId()); + if (product == null) { + response.setStatus(0); + response.setMessage("商品信息不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ProductSpec productSpec = productSpecService.get(tenantId, detailEntity.getSpecId()); + if (productSpec == null) { + response.setStatus(0); + response.setMessage("商品规格信息不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + List productRatioList = productRatioService.findList(tenantId, "productId", detailEntity.getProductId()); + if (CollectionUtils.isEmpty(productRatioList)) { + response.setStatus(0); + response.setMessage(product.getName() + "库存系数未设置"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ProductRatio productRatio = productRatioList.get(0); + ProductUnit productUnit = productUnitService.get(tenantId, productRatio.getDispatchUnitId()); + if (productUnit == null) { + response.setStatus(0); + response.setMessage(product.getName() + "配送单位不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ProductUnit productUnit1 = productUnitService.get(tenantId, productRatio.getPackUnitId()); + if (productUnit1 == null) { + response.setStatus(0); + response.setMessage(product.getName() + "包装单位不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + AskGoodsDetail askGoodsDetail = new AskGoodsDetail(); + askGoodsDetail.setAmount(detailEntity.getAmount()); + askGoodsDetail.setCreateDate(createDate); + askGoodsDetail.setCreateUser(entity.getSetMan()); + askGoodsDetail.setDescription(detailEntity.getDescription()); + askGoodsDetail.setDispatchUnitId(productRatio.getDispatchUnitId()); + askGoodsDetail.setDispatchUnitName(productUnit.getName()); + askGoodsDetail.setMoney(detailEntity.getMoney()); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("productId", detailEntity.getProductId())); + criteria.add(Restrictions.eq("specId", detailEntity.getSpecId())); + criteria.add(Restrictions.eq("storeId", storeId)); + List productStoreStockList = productStoreStockService.getList(tenantId, criteria); + double packUnitAmount = 0.0000; + if (CollectionUtils.isNotEmpty(productStoreStockList)) { + for (ProductStoreStock productStoreStock : productStoreStockList) { + packUnitAmount = packUnitAmount + productStoreStock.getStockAmount(); + } + } + askGoodsDetail.setPackUnitAmount(packUnitAmount);// 当前分店库存 + askGoodsDetail.setPackUnitId(productRatio.getPackUnitId()); + askGoodsDetail.setPackUnitName(productUnit1.getName()); + askGoodsDetail.setPrice(detailEntity.getPrice()); + askGoodsDetail.setProductId(detailEntity.getProductId()); + askGoodsDetail.setProductName(product.getName()); + askGoodsDetail.setProductNo(product.getNo()); + askGoodsDetail.setSpecId(detailEntity.getSpecId()); + askGoodsDetail.setSpecName(productSpec.getName()); + askGoodsDetail.setProductDescription(product.getDescription()); + askGoodsDetail.setTenantId(tenantId); + detail.add(askGoodsDetail); + + } + AskGoodsTicketLog log = new AskGoodsTicketLog(); + log.setCreateDate(createDate); + log.setCreateUser(entity.getSetMan()); + log.setDescription("工号" + entity.getSetMan() + ",修改要货单"); + log.setPayStatus(0); + log.setStatus(0); + log.setType(1); + log.setTenantId(tenantId); + + String ticketId = askGoodsTicketService.updateAskGoodsTicket(tenantId, ticket, detail, log); + + response.setStatus(1); + response.setMessage("要货单修改成功"); + Map data = new HashMap<>(); + data.put("ticketId", ticketId); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "ASKGOODS_TICKET_EDIT_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.askgoods.ticket.edit2", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店要货单修改") + @Override + public Object askGoodsTicketEdit2(AskGoodsTicketEditRequest request) { + String info = "门店要货单修改"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId();// 门店ID + String jsonString = request.getJsonString();// 门店要货单新增数据 + CommonDataResponse response = null; + try { + + response = new CommonDataResponse(); + Store store = storeService.get(tenantId, storeId); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + AskGoodsTicketEntity entity = new AskGoodsTicketEntity(JSONObject.parseObject(jsonString)); + Date createDate = new Date(); + AskGoodsTicket ticket = new AskGoodsTicket(); + ticket.setCreateDate(createDate); + if (StringUtils.isEmpty(entity.getSetMan()) || entity.getSetMan().length() > 32) { + response.setStatus(0); + response.setMessage("要货单制单人参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ticket.setSetMan(entity.getSetMan()); + ticket.setCreateUser(entity.getSetMan()); + if (StringUtils.isNotEmpty(entity.getDescription()) && entity.getDescription().length() > 128) { + response.setStatus(0); + response.setMessage("要货单备注说明参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ticket.setDescription(entity.getDescription()); + ticket.setDispatchMoney(entity.getDispatchMoney()); + ticket.setIsUse(0); + if (StringUtils.isEmpty(entity.getNo()) || entity.getNo().length() > 32) { + response.setStatus(0); + response.setMessage("要货单单据号参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + AskGoodsTicket askGoodsTicket = askGoodsTicketService.get(tenantCode,entity.getId()); + if(askGoodsTicket != null && askGoodsTicket.getStatus() != 0){ + response.setStatus(0); + response.setMessage("要货单不是新建状态"); + response.setErrCode(CommonErrorCode.error22.getCode()); + response.setErrMessage(CommonErrorCode.error22.getMessage()); + return response; + } + ticket.setId(entity.getId()); + ticket.setNo(entity.getNo()); + ticket.setPayStatus(0); + ticket.setProductMoney(entity.getProductMoney()); + ticket.setSetDate(createDate); + ticket.setStatus(0); + ticket.setStoreId(storeId); + ticket.setStoreName(store.getName()); + ticket.setStoreNo(store.getNo()); + ticket.setTenantId(tenantId); + ticket.setDeliveryMode(entity.getDeliveryMode()); + ticket.setDeliveryModeDesc(entity.getDeliveryModeDesc()); + // ticket.setTotalMoney(entity.getTotalMoney()); + List detailList = entity.getDetail(); + List detail = new ArrayList<>(); + + // 查询并存储所有product + Map productMap = new HashMap(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("stockFlag", 1)); + criteria.add(Restrictions.limit("0", "100000")); + List productList = productService.getList(tenantId, criteria); + for (Product product : productList) { + productMap.put(product.getId(), product); + } + + // 查询并存储所有product + Map specMap = new HashMap(); + criteria = new Criteria(); + criteria.add(Restrictions.limit("0", "100000")); + List specList = productSpecService.getList(tenantId, criteria); + for (ProductSpec spec : specList) { + specMap.put(spec.getId(), spec); + } + + // 查询所有商品库存系数 + Map ratioMap = new HashMap(); + criteria = new Criteria(); + criteria.add(Restrictions.limit("0", "100000")); + List ratioList = productRatioService.getList(tenantId, criteria); + for (ProductRatio ratio : ratioList) { + ratioMap.put(ratio.getProductId(), ratio); + } + + // 查询所有单位 + Map unitMap = new HashMap(); + criteria = new Criteria(); + criteria.add(Restrictions.limit("0", "10000")); + List unitList = productUnitService.getList(tenantId, criteria); + for (ProductUnit unit : unitList) { + unitMap.put(unit.getId(), unit); + } + double totalCash = 0.00; + for (AskGoodsDetailEntity detailEntity : detailList) { + + Product product = productMap.get(detailEntity.getProductId()); + if (null == product) { + response.setStatus(0); + response.setMessage("商品信息不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ProductSpec productSpec = specMap.get(detailEntity.getSpecId()); + if (null == productSpec) { + response.setStatus(0); + response.setMessage("商品规格信息不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ProductRatio productRatio = ratioMap.get(detailEntity.getProductId()); + if (null == productRatio) { + response.setStatus(0); + response.setMessage(product.getName() + "库存系数未设置"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + ProductUnit productUnit = unitMap.get(productRatio.getDispatchUnitId()); + if (productUnit == null) { + response.setStatus(0); + response.setMessage(product.getName() + "配送单位不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + ProductUnit productUnit1 = unitMap.get(productRatio.getPackUnitId()); + if (productUnit1 == null) { + response.setStatus(0); + response.setMessage(product.getName() + "包装单位不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + AskGoodsDetail askGoodsDetail = new AskGoodsDetail(); + askGoodsDetail.setAmount(detailEntity.getAmount()); + askGoodsDetail.setCreateDate(createDate); + askGoodsDetail.setCreateUser(entity.getSetMan()); + askGoodsDetail.setDescription(detailEntity.getDescription()); + askGoodsDetail.setDispatchUnitId(productRatio.getDispatchUnitId()); + askGoodsDetail.setDispatchUnitName(productUnit.getName()); + + BigDecimal amount = new BigDecimal(String.valueOf(detailEntity.getAmount())); + BigDecimal price = new BigDecimal(String.valueOf(detailEntity.getPrice())); + BigDecimal money = MathUtil.multiply(amount, price, 4, BigDecimal.ROUND_HALF_UP); + totalCash = MathUtil.add(new BigDecimal(String.valueOf(totalCash)), money).doubleValue(); + + askGoodsDetail.setMoney(money.doubleValue()); + + criteria = new Criteria(); + criteria.add(Restrictions.eq("productId", detailEntity.getProductId())); + criteria.add(Restrictions.eq("specId", detailEntity.getSpecId())); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.limit("0", "10000")); + List productStoreStockList = productStoreStockService.getList(tenantId, criteria); + double packUnitAmount = 0.0000; + if (CollectionUtils.isNotEmpty(productStoreStockList)) { + for (ProductStoreStock productStoreStock : productStoreStockList) { + packUnitAmount = packUnitAmount + productStoreStock.getStockAmount(); + } + } + askGoodsDetail.setPackUnitAmount(packUnitAmount);// 当前分店库存 + askGoodsDetail.setPackUnitId(productRatio.getPackUnitId()); + askGoodsDetail.setPackUnitName(productUnit1.getName()); + askGoodsDetail.setPrice(detailEntity.getPrice()); + askGoodsDetail.setProductId(detailEntity.getProductId()); + askGoodsDetail.setProductName(product.getName()); + askGoodsDetail.setProductNo(product.getNo()); + askGoodsDetail.setSpecId(detailEntity.getSpecId()); + askGoodsDetail.setSpecName(productSpec.getName()); + askGoodsDetail.setProductDescription(product.getDescription()); + askGoodsDetail.setTenantId(tenantId); + detail.add(askGoodsDetail); + + } + ticket.setTotalMoney(totalCash); + ticket.setProductMoney(totalCash); + + AskGoodsTicketLog log = new AskGoodsTicketLog(); + log.setCreateDate(createDate); + log.setCreateUser(entity.getSetMan()); + log.setDescription("工号" + entity.getSetMan() + ",修改要货单"); + log.setPayStatus(0); + log.setStatus(0); + log.setType(1); + log.setTenantId(tenantId); + + String ticketId = askGoodsTicketService.updateAskGoodsTicket(tenantId, ticket, detail, log); + + response.setStatus(1); + response.setMessage("要货单修改成功"); + Map data = new HashMap<>(); + data.put("ticketId", ticketId); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "ASKGOODS_TICKET_EDIT_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.askgoods.ticket.status", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店要货单状态") + @Override + public Object askGoodsTicketStatus(AskGoodsTicketStatusRequest request) { + String info = "门店要货单修改"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId();// 门店ID + String ticketId = request.getTicketId();// 单据编号 + int type = request.getType();// 操作类型 1-驳回2-审核通过 3-作废 + String operator = request.getOperator();// 操作员 + String reason = request.getReason();// 驳回原因 + Date createDate = new Date(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + AskGoodsTicket askGoodsTicket = askGoodsTicketService.get(tenantId, ticketId); + if (askGoodsTicket == null) { + response.setStatus(0); + response.setMessage("单据不存在"); + response.setErrCode(CommonErrorCode.error21.getCode()); + response.setErrMessage(CommonErrorCode.error21.getMessage()); + return response; + } + int status = askGoodsTicket.getStatus(); + switch (type) { + case 1:// 驳回 + if (status != 0) { + response.setStatus(0); + response.setMessage("只有新建状态的单据才能驳回"); + response.setErrCode(CommonErrorCode.error22.getCode()); + response.setErrMessage(CommonErrorCode.error22.getMessage()); + return response; + } else { + // 订单驳回 + askGoodsTicket.setStatus(1); + askGoodsTicket.setReason(reason); + AskGoodsTicketLog log = new AskGoodsTicketLog(); + log.setCreateDate(createDate); + log.setCreateUser(operator); + log.setDescription("工号" + operator + ",驳回要货单"); + log.setPayStatus(0); + log.setStatus(1); + log.setType(2); + log.setTenantId(tenantId); + askGoodsTicketService.updateAskGoodsTicketStatus(tenantId, askGoodsTicket, log); + response.setStatus(1); + response.setMessage("要货单驳回成功"); + Map data = new HashMap<>(); + data.put("ticketId", ticketId); + } + break; + case 2:// 审核通过,审核过程需要扣款操作 + if (status != 0) { + response.setStatus(0); + response.setMessage("只有新建状态的单据才能审核"); + response.setErrCode(CommonErrorCode.error22.getCode()); + response.setErrMessage(CommonErrorCode.error22.getMessage()); + return response; + } + + List storeDispatchAccountList = storeDispatchAccountService.findList(tenantId, "storeId", storeId); + if (CollectionUtils.isNotEmpty(storeDispatchAccountList)) { + // 启用结算方案 + response.setStatus(0); + response.setMessage("配送结算模式未开通,敬请期待"); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } else { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketId", ticketId)); + List detailList = askGoodsDetailService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(detailList)) { + response.setStatus(0); + response.setMessage("要货商品明细不能为空,请检查"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + double productMoney = 0.00; + // 自身金额校验 + for (AskGoodsDetail askGoodsDetail : detailList) { + if (!MathUtil.eq(BigDecimal.ZERO, MathUtil.subtract(new BigDecimal(String.valueOf(MathUtil.multiply(askGoodsDetail.getPrice(), askGoodsDetail.getAmount(), 2, BigDecimal.ROUND_HALF_UP))), new BigDecimal(askGoodsDetail.getMoney().toString()).setScale(2, BigDecimal.ROUND_HALF_UP)))) { + // if (askGoodsDetail.getPrice() * + // askGoodsDetail.getAmount() - + // askGoodsDetail.getMoney() != 0) { + response.setStatus(0); + response.setMessage("商品" + askGoodsDetail.getProductName() + "价格乘数量不等金额,请检查"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + // productMoney += askGoodsDetail.getMoney(); + productMoney = MathUtil.add(new BigDecimal(String.valueOf(productMoney)), new BigDecimal(String.valueOf(askGoodsDetail.getMoney()))).doubleValue(); + } + } + // 主单金额校验 + if (!MathUtil.eq(BigDecimal.ZERO, MathUtil.subtract(new BigDecimal(String.valueOf(productMoney)), new BigDecimal(String.valueOf(askGoodsTicket.getProductMoney()))))) { + // if (productMoney - askGoodsTicket.getProductMoney() + // != 0) { + response.setStatus(0); + response.setMessage("要货商品明细总金额不等于主单商品总额,请检查"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + // 服务端扣钱金额是否正确 + for (AskGoodsDetail askGoodsDetail : detailList) { + criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("productId", askGoodsDetail.getProductId())); + criteria.add(Restrictions.group("productId")); + List productList = storeProductService.getList(tenantId, criteria); + if (CollectionUtils.isNotEmpty(productList)) { + StoreProduct storeProduct = productList.get(0); + // 商品配送价 + if (!MathUtil.eq(BigDecimal.ZERO, MathUtil.subtract(new BigDecimal(String.valueOf(askGoodsDetail.getPrice())), new BigDecimal(String.valueOf(storeProduct.getDispatchPrice()))))) { + // if (askGoodsDetail.getPrice() - + // storeProduct.getDispatchPrice() != 0) { + response.setStatus(0); + response.setMessage("商品" + storeProduct.getProductName() + "价格不是最新价格,请刷新订单"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + } else { + response.setStatus(0); + response.setMessage("商品" + askGoodsDetail.getProductName() + "在原料资料中不存在,审核失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + } + // 结算方案为空走普通审核流程 + askGoodsTicket.setStatus(2); + askGoodsTicket.setReason(reason); + askGoodsTicket.setCheckDate(createDate); + askGoodsTicket.setCheckMan(operator); + AskGoodsTicketLog log = new AskGoodsTicketLog(); + log.setCreateDate(createDate); + log.setCreateUser(operator); + log.setDescription("工号" + operator + ",审核要货单"); + log.setPayStatus(0); + log.setStatus(2); + log.setType(3); + log.setTenantId(tenantId); + askGoodsTicketService.updateAskGoodsTicketStatus(tenantId, askGoodsTicket, log); + response.setStatus(1); + response.setMessage("要货单审核成功"); + Map data = new HashMap<>(); + data.put("ticketId", ticketId); + } + break; + case 3:// 作废 + if (status == 0 || status == 1) { + // 订单作废 + askGoodsTicket.setStatus(3); + askGoodsTicket.setReason(reason); + AskGoodsTicketLog log = new AskGoodsTicketLog(); + log.setCreateDate(createDate); + log.setCreateUser(operator); + log.setDescription("工号" + operator + ",作废要货单"); + log.setPayStatus(0); + log.setStatus(3); + log.setType(4); + log.setTenantId(tenantId); + askGoodsTicketService.updateAskGoodsTicketStatus(tenantId, askGoodsTicket, log); + response.setStatus(1); + response.setMessage("要货单作废成功"); + Map data = new HashMap<>(); + data.put("ticketId", ticketId); + } else { + response.setStatus(0); + response.setMessage("只有新建状态的单据才能作废"); + response.setErrCode(CommonErrorCode.error22.getCode()); + response.setErrMessage(CommonErrorCode.error22.getMessage()); + return response; + } + break; + case 4:// 反审核 + if (status != 2) { + response.setStatus(0); + response.setMessage("只有已审核状态的单据才能反审核"); + response.setErrCode(CommonErrorCode.error22.getCode()); + response.setErrMessage(CommonErrorCode.error22.getMessage()); + return response; + } else { + // 订单反审核 + askGoodsTicket.setStatus(0); + askGoodsTicket.setCheckDate(null); + askGoodsTicket.setCheckMan(null); + askGoodsTicket.setReason(reason); + AskGoodsTicketLog log = new AskGoodsTicketLog(); + log.setCreateDate(createDate); + log.setCreateUser(operator); + log.setDescription("工号" + operator + ",反审核要货单"); + log.setPayStatus(0); + log.setStatus(6); + log.setType(5); + log.setTenantId(tenantId); + askGoodsTicketService.updateAskGoodsTicketStatus(tenantId, askGoodsTicket, log); + response.setStatus(1); + response.setMessage("要货反审核回成功"); + Map data = new HashMap<>(); + data.put("ticketId", ticketId); + } + break; + default: + response.setStatus(0); + response.setMessage("操作类型不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + break; + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "ASKGOODS_TICKET_STATUS_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /*** + * 审核要货单(返回所有异常商品信息) + */ + @ServiceMethod(method = "store.askgoods.ticket.status2", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店要货单状态") + @Override + public Object askGoodsTicketStatus2(AskGoodsTicketStatusRequest request) { + String info = "门店要货单修改2"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId();// 门店ID + String ticketId = request.getTicketId();// 单据编号 + int type = request.getType();// 操作类型 1-驳回2-审核通过 3-作废 4- + String operator = request.getOperator();// 操作员 + String reason = request.getReason();// 驳回原因 + Date createDate = new Date(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + AskGoodsTicket askGoodsTicket = askGoodsTicketService.get(tenantId, ticketId); + if (askGoodsTicket == null) { + response.setStatus(0); + response.setMessage("单据不存在"); + response.setErrCode(CommonErrorCode.error21.getCode()); + response.setErrMessage(CommonErrorCode.error21.getMessage()); + return response; + } + int status = askGoodsTicket.getStatus(); + switch (type) { + case 1:// 驳回 + if (status != 0) { + response.setStatus(0); + response.setMessage("只有新建状态的单据才能驳回"); + response.setErrCode(CommonErrorCode.error22.getCode()); + response.setErrMessage(CommonErrorCode.error22.getMessage()); + return response; + } else { + // 订单驳回 + askGoodsTicket.setStatus(1); + askGoodsTicket.setReason(reason); + AskGoodsTicketLog log = new AskGoodsTicketLog(); + log.setCreateDate(createDate); + log.setCreateUser(operator); + log.setDescription("工号" + operator + ",驳回要货单"); + log.setPayStatus(0); + log.setStatus(1); + log.setType(2); + log.setTenantId(tenantId); + askGoodsTicketService.updateAskGoodsTicketStatus(tenantId, askGoodsTicket, log); + response.setStatus(1); + response.setMessage("要货单驳回成功"); + Map data = new HashMap<>(); + data.put("ticketId", ticketId); + } + break; + case 2:// 审核通过,审核过程需要扣款操作 + if (status != 0) { + response.setStatus(0); + response.setMessage("只有新建状态的单据才能审核"); + response.setErrCode(CommonErrorCode.error22.getCode()); + response.setErrMessage(CommonErrorCode.error22.getMessage()); + return response; + } + + logger.info(info + " 校验门店要货时间"); + // 校验门店要货时间 + try { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketSign", "dispatchTicket"));// 单据标识 + List list = ticketPrintSettingService.getList(tenantId, criteria); + Map dataMap = new HashMap<>(); + for (TicketPrintSetting setting : list) { + dataMap.put(setting.getKey(), setting); + } + if (null != dataMap.get("yhsd")) { + String yhsd = dataMap.get("yhsd").getValue(); + logger.info(info + "yhsd value" + yhsd); + // 1:24小时 2:指定时间段 + if (!"1".equals(yhsd)) { + if (null != dataMap.get("yhsj")) { + String value = dataMap.get("yhsj").getValue(); + logger.info(info + "yhsj value" + value); + if (StringUtils.isNotBlank(value)) { + String[] timeRound = value.split("-"); + if (timeRound.length == 2) { + String startTime = timeRound[0].trim(); + String endTime = timeRound[1].trim(); + + Date date = new Date(); + String currentTime = DateUtils.format(date, "yyyy-MM-dd"); + Date startDate = DateUtils.parseDate(currentTime + " " + startTime, "yyyy-MM-dd HH:mm"); + Date endDate = DateUtils.parseDate(currentTime + " " + endTime, "yyyy-MM-dd HH:mm"); + Date currentDate = DateUtils.parseDate(DateUtils.format(date, "yyyy-MM-dd HH:mm"), "yyyy-MM-dd HH:mm"); + logger.info(info + " currentDate:" + DateUtils.format(currentDate, "yyyy-MM-dd HH:mm") + "+ startDate:" + DateUtils.format(startDate, "yyyy-MM-dd HH:mm") + " endDate:" + DateUtils.format(endDate, "yyyy-MM-dd HH:mm")); + + if (currentDate.before(startDate) || currentDate.after(endDate)) { + response.setStatus(0); + response.setMessage("审核失败,请在指定时间(" + value + ")执行审核操作"); + response.setErrCode(CommonErrorCode.error22.getCode()); + response.setErrMessage(CommonErrorCode.error22.getMessage()); + return response; + } + } + } else { + response.setStatus(0); + response.setMessage("审核失败,要货配送设置中要货指定时间不存在"); + response.setErrCode(CommonErrorCode.error22.getCode()); + response.setErrMessage(CommonErrorCode.error22.getMessage()); + return response; + } + } else { + response.setStatus(0); + response.setMessage("审核失败,要货配送设置中要货指定时间不存在"); + response.setErrCode(CommonErrorCode.error22.getCode()); + response.setErrMessage(CommonErrorCode.error22.getMessage()); + return response; + } + } + } + } catch (Exception e) { + logger.error(info + " 校验门店要货时间时发生异常", e); + } + + List storeDispatchAccountList = storeDispatchAccountService.findList(tenantId, "storeId", storeId); + if (CollectionUtils.isNotEmpty(storeDispatchAccountList)) { + // 启用结算方案 + response.setStatus(0); + response.setMessage("配送结算模式未开通,敬请期待"); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } else { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketId", ticketId)); + List detailList = askGoodsDetailService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(detailList)) { + response.setStatus(0); + response.setMessage("要货商品明细不能为空,请检查"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + double productMoney = 0.00; + // 自身金额校验 + for (AskGoodsDetail askGoodsDetail : detailList) { + if (!MathUtil.eq(BigDecimal.ZERO, MathUtil.subtract(new BigDecimal(String.valueOf(askGoodsDetail.getPrice()* askGoodsDetail.getAmount())).setScale(2, BigDecimal.ROUND_HALF_UP), new BigDecimal(String.valueOf(askGoodsDetail.getMoney())).setScale(2, BigDecimal.ROUND_HALF_UP)))) { + // if (askGoodsDetail.getPrice() * + // askGoodsDetail.getAmount() - + // askGoodsDetail.getMoney() != 0) { + response.setStatus(0); + response.setMessage("商品" + askGoodsDetail.getProductName() + "价格乘数量不等金额,请检查"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + // productMoney += askGoodsDetail.getMoney(); + productMoney = MathUtil.add(new BigDecimal(String.valueOf(productMoney)), new BigDecimal(String.valueOf(askGoodsDetail.getMoney()))).doubleValue(); + } + } + // 主单金额校验 + if (!MathUtil.eq(BigDecimal.ZERO, MathUtil.subtract(new BigDecimal(String.valueOf(productMoney)), new BigDecimal(String.valueOf(askGoodsTicket.getProductMoney()))))) { + // if (productMoney - askGoodsTicket.getProductMoney() + // != 0) { + response.setStatus(0); + response.setMessage("要货商品明细总金额不等于主单商品总额,请检查"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + List exceptionList = new ArrayList(); + List> noneList = new ArrayList>(); + + // 服务端扣钱金额是否正确 + for (AskGoodsDetail askGoodsDetail : detailList) { + criteria = new Criteria(); + criteria.add(Restrictions.eq("sp.storeId", storeId)); + criteria.add(Restrictions.eq("sp.productId", askGoodsDetail.getProductId())); + criteria.add(Restrictions.group("sp.productId")); + List productList = storeProductService.getListExtend(tenantId, criteria); + if (CollectionUtils.isNotEmpty(productList)) { + StoreProduct storeProduct = productList.get(0); + // 商品配送价 + if (!MathUtil.eq(BigDecimal.ZERO, MathUtil.subtract(new BigDecimal(String.valueOf(askGoodsDetail.getPrice())), new BigDecimal(String.valueOf(storeProduct.getDispatchPrice()))))) { + + exceptionList.add(storeProduct); + } + } else { + Map noneMap = new HashMap(); + noneMap.put("specId", askGoodsDetail.getSpecId()); + noneMap.put("productName", askGoodsDetail.getProductName()); + noneList.add(noneMap); + } + } + + if (CollectionUtils.isNotEmpty(exceptionList) || CollectionUtils.isNotEmpty(noneList)) { + Map data = new HashMap(); + data.put("exceptionList", exceptionList); + data.put("noneList", noneList); + + response.setStatus(0); + response.setData(data); + response.setMessage("当前订单商品存在异常,请刷新订单"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + //判断如果是南宁的租户,将要货款先冻结; + if(StringUtils.startsWith(tenantId,"77")){ + Integer i = storeAccountService.saveFreezeAskGoodsTicketMoney(tenantId,askGoodsTicket.getId()); + if(i != 1){ + response.setStatus(0); + response.setMessage("门店账户异常,无法审核!"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + askGoodsTicket = askGoodsTicketService.get(tenantId,askGoodsTicket.getId()); + } + + // 结算方案为空走普通审核流程 + askGoodsTicket.setStatus(2); + askGoodsTicket.setReason(reason); + askGoodsTicket.setCheckDate(createDate); + askGoodsTicket.setCheckMan(operator); + AskGoodsTicketLog log = new AskGoodsTicketLog(); + log.setCreateDate(createDate); + log.setCreateUser(operator); + log.setDescription("工号" + operator + ",审核要货单"); + log.setPayStatus(0); + log.setStatus(2); + log.setType(3); + log.setTenantId(tenantId); + askGoodsTicketService.updateAskGoodsTicketStatus(tenantId, askGoodsTicket, log); + + + + Criteria criter = new Criteria(); + + criter.add(Restrictions.eq("`key`","process")); + criter.add(Restrictions.eq("`value`","standard")); + List settings = ticketPrintSettingService.getList(tenantId,criter); + if(CollectionUtils.isNotEmpty(settings)){ + criter = new Criteria(); + criter.add(Restrictions.eq("`key`","autoToDispatchTicket")); + criter.add(Restrictions.eq("`value`","auto")); + settings = ticketPrintSettingService.getList(tenantId,criter); + if(CollectionUtils.isNotEmpty(settings)){ + //生成配送单; + logger.debug(">>>>>>> 门店要货单审核成功后,自动生成配送单"); + Map eventData = new HashMap<>(); + eventData.put("tenantCode", tenantCode); + eventData.put("appCode", appCode); + eventData.put("tenantId", tenantId); + eventData.put("ticketId", ticketId); + eventData.put("operator", operator); + eventBus.notify(EventKeys.DISPATCHTICKET_CREATE_BY_ASKGOODSTICKET_AUTO, Event.wrap(eventData)); + } + + } + + response.setStatus(1); + response.setMessage("要货单审核成功"); + Map data = new HashMap<>(); + data.put("ticketId", ticketId); + } + break; + case 3:// 作废 + if (status == 0 || status == 1) { + + //判断如果是南宁的租户,将要货款先冻结; + if(StringUtils.startsWith(tenantId,"77") && askGoodsTicket.getStatus() == 1 && 6 == askGoodsTicket.getPayStatus()){ + Integer i = storeAccountService.saveFreezeAskGoodsTicketMoneyByAntiAudit(tenantId,askGoodsTicket.getId(),operator); + if(i != 1){ + response.setStatus(0); + response.setMessage("门店账户异常,无法审核!"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + askGoodsTicket = askGoodsTicketService.get(tenantId,askGoodsTicket.getId()); + } + + // 订单作废 + askGoodsTicket.setStatus(3); + askGoodsTicket.setReason(reason); + AskGoodsTicketLog log = new AskGoodsTicketLog(); + log.setCreateDate(createDate); + log.setCreateUser(operator); + log.setDescription("工号" + operator + ",作废要货单"); + log.setPayStatus(0); + log.setStatus(3); + log.setType(4); + log.setTenantId(tenantId); + askGoodsTicketService.updateAskGoodsTicketStatus(tenantId, askGoodsTicket, log); + response.setStatus(1); + response.setMessage("要货单作废成功"); + Map data = new HashMap<>(); + data.put("ticketId", ticketId); + } else { + response.setStatus(0); + response.setMessage("只有新建状态的单据才能作废"); + response.setErrCode(CommonErrorCode.error22.getCode()); + response.setErrMessage(CommonErrorCode.error22.getMessage()); + return response; + } + break; + case 4:// 反审核 + if (status != 2) { + response.setStatus(0); + response.setMessage("只有已审核状态的单据才能反审核"); + response.setErrCode(CommonErrorCode.error22.getCode()); + response.setErrMessage(CommonErrorCode.error22.getMessage()); + return response; + } else { + Criteria criter = new Criteria(); + criter.add(Restrictions.eq("`key`","process")); + criter.add(Restrictions.eq("`value`","standard")); + List settings = ticketPrintSettingService.getList(tenantId,criter); + if(CollectionUtils.isNotEmpty(settings)){ + criter = new Criteria(); + criter.add(Restrictions.eq("`key`","autoToDispatchTicket")); + criter.add(Restrictions.eq("`value`","auto")); + settings = ticketPrintSettingService.getList(tenantId,criter); + if(CollectionUtils.isNotEmpty(settings)){ + response.setStatus(0); + response.setMessage("已自动生成配送单,无法反审核"); + response.setErrCode(CommonErrorCode.error25.getCode()); + response.setErrMessage(CommonErrorCode.error25.getMessage()); + return response; + } + } + + //判断如果是南宁的租户,将要货款先冻结; + if(StringUtils.startsWith(tenantId,"77") && 6 == askGoodsTicket.getPayStatus()){ + Integer i = storeAccountService.saveFreezeAskGoodsTicketMoneyByAntiAudit(tenantId,askGoodsTicket.getId(),operator); + if(i != 1){ + response.setStatus(0); + response.setMessage("门店账户异常,无法审核!"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + askGoodsTicket = askGoodsTicketService.get(tenantId,askGoodsTicket.getId()); + } + + + // 订单反审核 + askGoodsTicket.setStatus(0); + askGoodsTicket.setCheckDate(null); + askGoodsTicket.setCheckMan(null); + askGoodsTicket.setReason(reason); + AskGoodsTicketLog log = new AskGoodsTicketLog(); + log.setCreateDate(createDate); + log.setCreateUser(operator); + log.setDescription("工号" + operator + ",反审核要货单"); + log.setPayStatus(0); + log.setStatus(6); + log.setType(5); + log.setTenantId(tenantId); + askGoodsTicketService.updateAskGoodsTicketStatus(tenantId, askGoodsTicket, log); + response.setStatus(1); + response.setMessage("要货反审核回成功"); + Map data = new HashMap<>(); + data.put("ticketId", ticketId); + } + break; + default: + response.setStatus(0); + response.setMessage("操作类型不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + break; + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "ASKGOODS_TICKET_STATUS_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.product.stock", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店商品库存") + @Override + public Object storeProductStock(StoreProductStockRequest request) { + String info = "门店商品库存"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + String storeId = request.getStoreId();// 门店ID + String storageId = request.getStorageId();// 仓库ID + String typeId = request.getTypeId();// 类别ID + String goodsType = request.getGoodsType();// 商品类型 + String keyword = request.getKeyword();// 查询关键字 + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("a.storeId", storeId)); + if (StringUtils.isNotBlank(typeId)) { + criteria.add(Restrictions.like("b.typePath", "%" + typeId + "%")); + } + if (StringUtils.isNotBlank(goodsType)) { + criteria.add(Restrictions.eq("b.type", goodsType)); + } + if (StringUtils.isNotBlank(keyword)) { + criteria.add(Restrictions.or(Restrictions.like("b.barCode", "%" + keyword + "%"), Restrictions.like("b.name", "%" + keyword + "%"), Restrictions.like("b.no", "%" + keyword + "%"))); + } + criteria.add(Restrictions.order("a.productNo", "asc")); + if (StringUtils.isNotEmpty(storageId)) { + // 门店仓库ID + criteria.add(Restrictions.eq("a.storageId", storageId)); + pager = productStoreStockService.getStockPager(tenantId, criteria, pager); + } else { + pager = productStoreStockService.getStockPagerNoStorageId(tenantId, criteria, pager); + } + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + // 查询所有单位 + Map unitMap = new HashMap(); + criteria = new Criteria(); + List unitList = productUnitService.getList(tenantId, criteria); + for (ProductUnit unit : unitList) { + unitMap.put(unit.getId(), unit); + } + + // 查询所有商品库存系数 + Map ratioMap = new HashMap(); + criteria = new Criteria(); + criteria.add(Restrictions.limit("0","100000")); + List ratioList = productRatioService.getList(tenantId, criteria); + for (ProductRatio ratio : ratioList) { + ratioMap.put(ratio.getProductId(), ratio); + } + + ProductRatio ratio = null; + List source = (List) pager.getList(); + for (ProductStoreStock productStoreStock : source) { + Map map = new HashMap<>(); + map.put("tenantId", productStoreStock.getTenantId()); + map.put("id", productStoreStock.getId()); + map.put("storeId", productStoreStock.getStoreId()); + map.put("storageId", productStoreStock.getStorageId()); + map.put("storageName", productStoreStock.getStorageName()); + map.put("productId", productStoreStock.getProductId()); + map.put("productNo", productStoreStock.getProductNo()); + map.put("productName", productStoreStock.getProductName()); + map.put("specId", productStoreStock.getSpecId()); + map.put("specName", productStoreStock.getSpecName()); + map.put("productDescription", productStoreStock.getProductDescription()); + map.put("dispatchUnitId", productStoreStock.getDispatchUnitId()); + map.put("dispatchUnitName", productStoreStock.getDispatchUnitName()); + map.put("packUnitId", productStoreStock.getPackUnitId()); + map.put("packUnitName", productStoreStock.getPackUnitName()); + map.put("stockAmount", doubleFormat(productStoreStock.getStockAmount())); + map.put("stockCost", doubleFormat(productStoreStock.getStockCost())); + map.put("type", productStoreStock.getType()); + map.put("typeId", productStoreStock.getTypeId()); + map.put("typeName", productStoreStock.getTypeName()); + + ratio = ratioMap.get(productStoreStock.getProductId()); + if (ratio != null) { + map.put("salesUnitId", ratio.getSalesUnitId()); + map.put("salesUnitName", unitMap.get(ratio.getSalesUnitId()).getName()); + map.put("psScale", ratio.getPsScale());// 换算比例(包装单位和销售单位) + } else { + map.put("salesUnitId", productStoreStock.getPackUnitId()); + map.put("salesUnitName", productStoreStock.getPackUnitName()); + map.put("psScale", 1);// 换算比例(包装单位和销售单位) + } + + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "PRODUCT_STOCK_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + + } + + @ServiceMethod(method = "store.product.nooffshelf.stock", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店商品库存") + @Override + public Object storeProductStockWithOutOffShelf(StoreProductStockRequest request) { + String info = "门店商品(不含下架)库存"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + String storeId = request.getStoreId();// 门店ID + String storageId = request.getStorageId();// 仓库ID + String typeId = request.getTypeId();// 类别ID + String goodsType = request.getGoodsType();// 商品类型 + String keyword = request.getKeyword();// 查询关键字 + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("a.storeId", storeId)); + criteria.add(Restrictions.eq("sp.storeId", storeId)); + if (StringUtils.isNotBlank(typeId)) { + criteria.add(Restrictions.like("b.typePath", "%" + typeId + "%")); + } + if (StringUtils.isNotBlank(goodsType)) { + criteria.add(Restrictions.eq("b.type", goodsType)); + } + if (StringUtils.isNotBlank(keyword)) { + criteria.add(Restrictions.or(Restrictions.like("b.barCode", "%" + keyword + "%"), Restrictions.like("b.name", "%" + keyword + "%"), Restrictions.like("b.no", "%" + keyword + "%"))); + } + criteria.add(Restrictions.order("a.productNo", "asc")); + if (StringUtils.isNotEmpty(storageId)) { + // 门店仓库ID + criteria.add(Restrictions.eq("a.storageId", storageId)); + pager = productStoreStockService.getStockPagerWithOutOffShelf(tenantId, criteria, pager); + } else { + pager = productStoreStockService.getStockPagerNoStorageIdWithOutOffShelf(tenantId, criteria, pager); + } + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + // 查询所有单位 + Map unitMap = new HashMap(); + criteria = new Criteria(); + List unitList = productUnitService.getList(tenantId, criteria); + for (ProductUnit unit : unitList) { + unitMap.put(unit.getId(), unit); + } + + // 查询所有商品库存系数 + Map ratioMap = new HashMap(); + criteria = new Criteria(); + criteria.add(Restrictions.limit("0","100000")); + List ratioList = productRatioService.getList(tenantId, criteria); + for (ProductRatio ratio : ratioList) { + ratioMap.put(ratio.getProductId(), ratio); + } + + ProductRatio ratio = null; + List source = (List) pager.getList(); + for (ProductStoreStock productStoreStock : source) { + Map map = new HashMap<>(); + map.put("tenantId", productStoreStock.getTenantId()); + map.put("id", productStoreStock.getId()); + map.put("storeId", productStoreStock.getStoreId()); + map.put("storageId", productStoreStock.getStorageId()); + map.put("storageName", productStoreStock.getStorageName()); + map.put("productId", productStoreStock.getProductId()); + map.put("productNo", productStoreStock.getProductNo()); + map.put("productName", productStoreStock.getProductName()); + map.put("specId", productStoreStock.getSpecId()); + map.put("specName", productStoreStock.getSpecName()); + map.put("productDescription", productStoreStock.getProductDescription()); + map.put("dispatchUnitId", productStoreStock.getDispatchUnitId()); + map.put("dispatchUnitName", productStoreStock.getDispatchUnitName()); + map.put("packUnitId", productStoreStock.getPackUnitId()); + map.put("packUnitName", productStoreStock.getPackUnitName()); + map.put("stockAmount", doubleFormat(productStoreStock.getStockAmount())); + map.put("stockCost", doubleFormat(productStoreStock.getStockCost())); + map.put("type", productStoreStock.getType()); + map.put("typeId", productStoreStock.getTypeId()); + map.put("typeName", productStoreStock.getTypeName()); + + ratio = ratioMap.get(productStoreStock.getProductId()); + if (ratio != null) { + map.put("salesUnitId", ratio.getSalesUnitId()); + map.put("salesUnitName", unitMap.get(ratio.getSalesUnitId()).getName()); + map.put("psScale", ratio.getPsScale());// 换算比例(包装单位和销售单位) + } else { + map.put("salesUnitId", productStoreStock.getPackUnitId()); + map.put("salesUnitName", productStoreStock.getPackUnitName()); + map.put("psScale", 1);// 换算比例(包装单位和销售单位) + } + + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "PRODUCT_STOCK_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @SuppressWarnings("unchecked") + @ServiceMethod(method = "store.askgoods.template.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店要货模板") + @Override + public Object askGoodsTemplateList(AskGoodsTemplateListRequest request) { + String info = "门店要货模板"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + String property = request.getProperty();// 查找属性名称 + String keyword = request.getKeyword();// 查找关键字 + + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + + Criteria criteria = new Criteria(); + // criteria.add(Restrictions.eq("agt.tenantId", tenantId)); + if (StringUtils.isNotEmpty(property) && StringUtils.isNotEmpty(keyword)) { + criteria.add(Restrictions.like("agt." + property, "%" + keyword + "%")); + } + criteria.add(Restrictions.order("agt.createDate", "desc")); + pager = askGoodsTemplateService.getPagerByStoreId(tenantId, criteria, pager, request.getStoreId()); + + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List dataList = (List) pager.getList(); + for (AskGoodsTemplate data : dataList) { + Map map = new HashMap<>(); + map.put("tenantId", data.getTenantId()); + map.put("id", data.getId()); + map.put("no", data.getNo()); + map.put("name", data.getName()); + map.put("description", data.getDescription());// 备注说明 + map.put("selfFlag", data.getSelfFlag());// 是否自建模板 + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + + return response; + } + + @SuppressWarnings("unchecked") + @ServiceMethod(method = "store.askgoods.template.detail", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店要货模板明细") + @Override + public Object askGoodsTemplateDetail(AskGoodsTemplateDetailRequest request) { + String info = "门店要货模板"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String ticketId = request.getTicketId();// 要货模板ID + + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + if (StringUtils.isBlank(ticketId)) { + response.setStatus(0); + response.setMessage("参数ticketId不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketId", ticketId)); + criteria.add(Restrictions.order("productNo", "asc")); + pager = askGoodsTemplateDetailService.getPager(tenantId, criteria, pager); + + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List dataList = (List) pager.getList(); + for (AskGoodsTemplateDetail data : dataList) { + Map map = new HashMap<>(); + map.put("tenantId", data.getTenantId()); + map.put("id", data.getId()); + map.put("ticketId", data.getTicketId());// 要货单模板Id + map.put("productId", data.getProductId());// 原料Id + map.put("productNo", data.getProductNo());// 原料编码 + map.put("productName", data.getProductName());// 原料名称 + map.put("specId", data.getSpecId());// 规格ID + map.put("specName", data.getSpecName());// 规格名称 + map.put("productDescription", data.getProductDescription());// 原料说明 + map.put("dispatchUnitId", data.getDispatchUnitId());// 配送单位ID + map.put("dispatchUnitName", data.getDispatchUnitName());// 配送单位名称 + map.put("description", data.getDescription());// 备注说明 + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + + return response; + } + + @ServiceMethod(method = "store.product.stock.sum", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "商品门店库存总数") + @Override + public Object storeProductStockSum(StoreProductStockSumRequest request) { + String info = "商品门店库存总数"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId();// 门店ID + String specIds = request.getSpecIds();// 规格ID + CommonListResponse response = null; + try { + response = new CommonListResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + List specIdList = new ArrayList<>(); + String[] ids = StringUtils.split(specIds, ","); + for (int i = 0; i < ids.length; i++) { + specIdList.add(ids[i]); + } + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.in("specId", specIdList)); + List stockList = productStoreStockService.getList(tenantId, criteria); + List> list = new ArrayList<>(); + Map> dataMap = new HashMap<>(); + for (ProductStoreStock stock : stockList) { + if (dataMap.get(stock.getSpecId()) == null) { + Map map = new HashMap<>(); + map.put("tenantId", stock.getTenantId()); + map.put("productId", stock.getProductId()); + map.put("specId", stock.getSpecId()); + map.put("stockAmount", doubleFormat(stock.getStockAmount())); + + list.add(map); + dataMap.put(stock.getSpecId(), map); + } else { + Map map = dataMap.get(stock.getSpecId()); + map.put("stockAmount", doubleFormat(MathUtil.add(new BigDecimal(stock.getStockAmount()), new BigDecimal(Double.valueOf(map.get("stockAmount").toString()))))); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 门店商品库存消耗(出库)汇总
+ * 门店原物料消耗汇总 + */ + @ServiceMethod(method = "store.product.stock.out.summary", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店商品库存消耗(出库)汇总") + @Override + public Object storeProductStockOutSummary(StoreProductStockOutSummaryRequest request) { + String info = "门店商品库存消耗(出库)汇总"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + String storeId = request.getStoreId(); + String startTime = request.getStartTime();// 开始时间 + String endTime = request.getEndTime();// 结束时间 + String goodsType = request.getGoodsType();// 商品类型 + String keyword = request.getKeyword();// 查询关键字 + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("psl.storeId", storeId)); + if (StringUtils.isNotBlank(startTime)) { + criteria.add(Restrictions.ge("psl.createDate", startTime));// 开始时间 + } + if (StringUtils.isNotBlank(endTime)) { + criteria.add(Restrictions.le("psl.createDate", endTime));// 结束时间 + } + if (StringUtils.isNotBlank(goodsType)) { + criteria.add(Restrictions.eq("p.type", goodsType));// 0-普通商品;1-成品;10-原料;11-辅料;12-半成品; + } + if (StringUtils.isNotBlank(keyword)) { + criteria.add(Restrictions.or(Restrictions.like("p.name", "%" + keyword + "%"), Restrictions.like("p.no", "%" + keyword + "%"))); + } + criteria.add(Restrictions.group("psl.specId")); + pager = productStoreStockLogService.getPager4OutSummary(tenantId, criteria, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List> dataList = (List>) pager.getList(); + for (Map dataMap : dataList) { + Map map = new HashMap<>(); + map.put("productId", dataMap.get("productId")); + map.put("productNo", dataMap.get("productNo")); + map.put("productName", dataMap.get("productName")); + map.put("specId", dataMap.get("specId")); + map.put("specName", dataMap.get("specName")); + map.put("productDescription", dataMap.get("productDescription")); + map.put("packUnitId", dataMap.get("packUnitId")); + map.put("packUnitName", dataMap.get("packUnitName")); + map.put("totalAmount", doubleFormat(dataMap.get("totalAmount"))); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.askgoods.detial.remove", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店要货单详情删除指定明细") + @Override + public Object askGoodsTicketDetailRemove(AskGoodsDetailRemoveRequest request) { + String info = "门店要货单详情删除指定明细"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId();// 门店ID + String ticketId = request.getTicketId(); + String detailId = request.getDetailId();// 要货详情记录Id + String goodsId = request.getGoodsId();// 要货详情goodsId + + CommonDataResponse response = null; + try { + + response = new CommonDataResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + AskGoodsTicket order = askGoodsTicketService.get(tenantId, ticketId); + if (null == order) { + response.setStatus(0); + response.setMessage("订单ID不存在"); + response.setErrCode(CommonErrorCode.error21.getCode()); + response.setErrMessage(CommonErrorCode.error21.getMessage()); + return response; + } + + if (order.getStatus() != 0) { + response.setStatus(0); + response.setMessage("订单状态非法"); + response.setErrCode(CommonErrorCode.error22.getCode()); + response.setErrMessage(CommonErrorCode.error22.getMessage()); + return response; + } + + if (StringUtils.isBlank(detailId) && StringUtils.isBlank(goodsId)) { + response.setStatus(0); + response.setMessage("记录id和商品id不能同时为空"); + response.setErrCode(CommonErrorCode.error23.getCode()); + response.setErrMessage(CommonErrorCode.error23.getMessage()); + return response; + } + + AskGoodsDetail detail = null; + if (StringUtils.isNotBlank(detailId)) { + detail = askGoodsDetailService.get(tenantId, detailId); + } else { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketId", ticketId)); + criteria.add(Restrictions.eq("specId", goodsId)); + List detailList = askGoodsDetailService.getList(tenantId, criteria); + if (CollectionUtils.isNotEmpty(detailList)) { + detail = detailList.get(0); + } + } + + if (null == detail) { + response.setStatus(0); + response.setMessage("没有查询到要货单指定商品"); + response.setErrCode(CommonErrorCode.error23.getCode()); + response.setErrMessage(CommonErrorCode.error23.getMessage()); + return response; + } + + int count = askGoodsDetailService.delete(tenantId, detail.getId()); + + response.setStatus(1); + response.setMessage("删除成功"); + Map data = new HashMap<>(); + data.put("ticketId", ticketId); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "ASKGOODS_DETIAL_REMOVE_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.askgoods.template.add", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店要货单模板新增") + @Override + public Object askGoodsTemplateAdd(AskGoodsTemplateAddRequest request) { + String info = "门店要货单模板新增"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId();// 门店ID + String jsonString = request.getJsonString();// 门店要货单新增数据 + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + AskGoodsTemplateEntity entity = new AskGoodsTemplateEntity(JSONObject.parseObject(jsonString)); + Date createDate = new Date(); + AskGoodsTemplate template = new AskGoodsTemplate(); + template.setCreateDate(createDate); + template.setCreateUser("open-api"); + if (StringUtils.isNotEmpty(entity.getName()) && entity.getName().length() > 16) { + response.setStatus(0); + response.setMessage("要货单模板名称参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + template.setName(entity.getName()); + if (StringUtils.isNotEmpty(entity.getDescription()) && entity.getDescription().length() > 128) { + response.setStatus(0); + response.setMessage("要货单模板备注说明参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + template.setDescription(entity.getDescription()); + if (StringUtils.isEmpty(entity.getNo()) || entity.getNo().length() > 32) { + response.setStatus(0); + response.setMessage("要货单模板单号号参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + template.setNo(entity.getNo()); + template.setStoreId(storeId); + template.setSelfFlag(1); + template.setTenantId(tenantId); + List detailList = entity.getDetail(); + List detail = new ArrayList<>(); + + for (AskGoodsTemplateDetailEntity detailEntity : detailList) { + + Product product = productService.get(tenantId, detailEntity.getProductId()); + if (product == null) { + response.setStatus(0); + response.setMessage("商品信息不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ProductSpec productSpec = productSpecService.get(tenantId, detailEntity.getSpecId()); + if (productSpec == null) { + response.setStatus(0); + response.setMessage("商品规格信息不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + List productRatioList = productRatioService.findList(tenantId, "productId", detailEntity.getProductId()); + if (CollectionUtils.isEmpty(productRatioList)) { + response.setStatus(0); + response.setMessage(product.getName() + "库存系数未设置"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ProductRatio productRatio = productRatioList.get(0); + ProductUnit productUnit = productUnitService.get(tenantId, productRatio.getDispatchUnitId()); + if (productUnit == null) { + response.setStatus(0); + response.setMessage(product.getName() + "配送单位不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ProductUnit productUnit1 = productUnitService.get(tenantId, productRatio.getPackUnitId()); + if (productUnit1 == null) { + response.setStatus(0); + response.setMessage(product.getName() + "包装单位不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + AskGoodsTemplateDetail askGoodsDetail = new AskGoodsTemplateDetail(); + askGoodsDetail.setCreateDate(createDate); + askGoodsDetail.setCreateUser("open-api"); + askGoodsDetail.setDescription(detailEntity.getDescription()); + askGoodsDetail.setDispatchUnitId(productRatio.getDispatchUnitId()); + askGoodsDetail.setDispatchUnitName(productUnit.getName()); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("productId", detailEntity.getProductId())); + criteria.add(Restrictions.eq("specId", detailEntity.getSpecId())); + criteria.add(Restrictions.eq("storeId", storeId)); + List productStoreStockList = productStoreStockService.getList(tenantId, criteria); + double packUnitAmount = 0.0000; + if (CollectionUtils.isNotEmpty(productStoreStockList)) { + for (ProductStoreStock productStoreStock : productStoreStockList) { + packUnitAmount = packUnitAmount + productStoreStock.getStockAmount(); + } + } + askGoodsDetail.setProductId(detailEntity.getProductId()); + askGoodsDetail.setProductName(product.getName()); + askGoodsDetail.setProductNo(product.getNo()); + askGoodsDetail.setSpecId(detailEntity.getSpecId()); + askGoodsDetail.setSpecName(productSpec.getName()); + askGoodsDetail.setProductDescription(product.getDescription()); + askGoodsDetail.setTenantId(tenantId); + detail.add(askGoodsDetail); + + } + String ticketId = askGoodsTemplateService.saveAskGoodsTemplate(tenantId, template, detail); + response.setStatus(1); + response.setMessage("要货单模板新建成功"); + Map data = new HashMap<>(); + data.put("ticketId", ticketId); + response.setData(data); + System.out.println("end " + DateUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss:SSS")); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "ASKGOODS_TEMPLATE_ADD_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.askgoods.template.edit", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店要货模板修改") + @Override + public Object askGoodsTemplateEdit(AskGoodsTemplateEditRequest request) { + String info = "门店要货模板修改"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId();// 门店ID + String jsonString = request.getJsonString();// 门店要货单新增数据 + CommonDataResponse response = null; + try { + + response = new CommonDataResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + AskGoodsTemplateEntity entity = new AskGoodsTemplateEntity(JSONObject.parseObject(jsonString)); + Date createDate = new Date(); + AskGoodsTemplate template = new AskGoodsTemplate(); + template.setCreateDate(createDate); + template.setCreateUser("open-api"); + if (StringUtils.isNotEmpty(entity.getName()) && entity.getName().length() > 16) { + response.setStatus(0); + response.setMessage("要货模板名称参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + template.setName(entity.getName()); + if (StringUtils.isNotEmpty(entity.getDescription()) && entity.getDescription().length() > 128) { + response.setStatus(0); + response.setMessage("要货模板备注说明参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + template.setDescription(entity.getDescription()); + if (StringUtils.isEmpty(entity.getNo()) || entity.getNo().length() > 32) { + response.setStatus(0); + response.setMessage("要货模板单据号参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + template.setNo(entity.getNo()); + template.setId(entity.getId()); + template.setStoreId(storeId); + template.setSelfFlag(1); + template.setTenantId(tenantId); + List detailList = entity.getDetail(); + List detail = new ArrayList<>(); + + for (AskGoodsTemplateDetailEntity detailEntity : detailList) { + + Product product = productService.get(tenantId, detailEntity.getProductId()); + if (product == null) { + response.setStatus(0); + response.setMessage("商品信息不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ProductSpec productSpec = productSpecService.get(tenantId, detailEntity.getSpecId()); + if (productSpec == null) { + response.setStatus(0); + response.setMessage("商品规格信息不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + List productRatioList = productRatioService.findList(tenantId, "productId", detailEntity.getProductId()); + if (CollectionUtils.isEmpty(productRatioList)) { + response.setStatus(0); + response.setMessage(product.getName() + "库存系数未设置"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ProductRatio productRatio = productRatioList.get(0); + ProductUnit productUnit = productUnitService.get(tenantId, productRatio.getDispatchUnitId()); + if (productUnit == null) { + response.setStatus(0); + response.setMessage(product.getName() + "配送单位不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ProductUnit productUnit1 = productUnitService.get(tenantId, productRatio.getPackUnitId()); + if (productUnit1 == null) { + response.setStatus(0); + response.setMessage(product.getName() + "包装单位不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + AskGoodsTemplateDetail askGoodsDetail = new AskGoodsTemplateDetail(); + askGoodsDetail.setCreateDate(createDate); + askGoodsDetail.setCreateUser("open-api"); + askGoodsDetail.setDescription(detailEntity.getDescription()); + askGoodsDetail.setDispatchUnitId(productRatio.getDispatchUnitId()); + askGoodsDetail.setDispatchUnitName(productUnit.getName()); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("productId", detailEntity.getProductId())); + criteria.add(Restrictions.eq("specId", detailEntity.getSpecId())); + criteria.add(Restrictions.eq("storeId", storeId)); + List productStoreStockList = productStoreStockService.getList(tenantId, criteria); + double packUnitAmount = 0.0000; + if (CollectionUtils.isNotEmpty(productStoreStockList)) { + for (ProductStoreStock productStoreStock : productStoreStockList) { + packUnitAmount = packUnitAmount + productStoreStock.getStockAmount(); + } + } + askGoodsDetail.setProductId(detailEntity.getProductId()); + askGoodsDetail.setProductName(product.getName()); + askGoodsDetail.setProductNo(product.getNo()); + askGoodsDetail.setSpecId(detailEntity.getSpecId()); + askGoodsDetail.setSpecName(productSpec.getName()); + askGoodsDetail.setProductDescription(product.getDescription()); + askGoodsDetail.setTenantId(tenantId); + detail.add(askGoodsDetail); + + } + String ticketId = askGoodsTemplateService.updateAskGoodsTemplate(tenantId, template, detail); + response.setStatus(1); + response.setMessage("要货模板修改成功"); + Map data = new HashMap<>(); + data.put("ticketId", ticketId); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "ASKGOODS_TEMPLATE_EDIT_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/storage/StoreStorageTicketServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/storage/StoreStorageTicketServiceImpl.java new file mode 100644 index 0000000..89e60c4 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/storage/StoreStorageTicketServiceImpl.java @@ -0,0 +1,1420 @@ +package com.jwsaas.api.service.impl.storage; + +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import org.apache.commons.lang3.StringUtils; + +import com.jwsaas.Constant; +import com.jwsaas.StoreStorageOutTicketType; +import com.jwsaas.StoreStorageTicketType; +import com.jwsaas.api.entity.storage.StoreStorageOutTicketDetailEntity; +import com.jwsaas.api.entity.storage.StoreStorageOutTicketEntity; +import com.jwsaas.api.entity.storage.StoreStorageTicketDetailEntity; +import com.jwsaas.api.entity.storage.StoreStorageTicketEntity; +import com.jwsaas.api.request.storage.StoreStorageOutTicketAddRequest; +import com.jwsaas.api.request.storage.StoreStorageOutTicketDetailRequest; +import com.jwsaas.api.request.storage.StoreStorageOutTicketEditRequest; +import com.jwsaas.api.request.storage.StoreStorageOutTicketListRequest; +import com.jwsaas.api.request.storage.StoreStorageOutTicketStatusChangeRequest; +import com.jwsaas.api.request.storage.StoreStorageTicketAddRequest; +import com.jwsaas.api.request.storage.StoreStorageTicketDetailRequest; +import com.jwsaas.api.request.storage.StoreStorageTicketEditRequest; +import com.jwsaas.api.request.storage.StoreStorageTicketListRequest; +import com.jwsaas.api.request.storage.StoreStorageTicketStatusChangeRequest; +import com.jwsaas.api.request.storage.StoreStorageTicketTypeRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.response.mode.CommonListResponse; +import com.jwsaas.api.response.mode.CommonPagerResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.storage.StoreStorageTicketService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.Store; +import com.jwsaas.entity.food.StoreStorageOutTicket; +import com.jwsaas.entity.food.StoreStorageOutTicketDetail; +import com.jwsaas.entity.food.StoreStorageOutTicketLog; +import com.jwsaas.entity.food.StoreStorageTicket; +import com.jwsaas.entity.food.StoreStorageTicketDetail; +import com.jwsaas.entity.food.StoreStorageTicketLog; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.pager.Pager; +import com.jwsaas.util.DateUtils; +import com.jwsaas.util.JSONUtil; +import com.jwsaas.utils.AppKeyUtil; + +/** + * 门店入库/出库相关业务 + */ +@ServiceMethodBean(version = "1.0") +public class StoreStorageTicketServiceImpl extends WopServiceImpl implements StoreStorageTicketService { + + private static final long serialVersionUID = 5937071398862740998L; + + @Resource + private com.jwsaas.service.food.StoreStorageTicketService storeStorageTicketService; + @Resource + private com.jwsaas.service.food.StoreStorageTicketDetailService storeStorageTicketDetailService; + @Resource + private com.jwsaas.service.food.StoreStorageOutTicketService storeStorageOutTicketService; + @Resource + private com.jwsaas.service.food.StoreStorageOutTicketDetailService storeStorageOutTicketDetailService; + @Resource + private com.jwsaas.service.food.StoreService storeService; + + /** + * 门店入库/出库类型 + */ + @ServiceMethod(method = "store.storage.ticket.type", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店入库/出库类型") + @Override + public Object storeStorageTicketType(StoreStorageTicketTypeRequest request) { + String info = "门店入库/出库类型"; + logger.debug("info:" + info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId();// 门店ID + String type = request.getType();// 操作类型(1-入库;2-出库;) + CommonListResponse response = null; + try { + response = new CommonListResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + List> list = new ArrayList<>(); + if (StringUtils.equals("1", type)) { + for (StoreStorageTicketType ticketType : StoreStorageTicketType.values()) { + Map data = new HashMap<>(); + data.put("type", 1); + data.put("sign", ticketType.getSign()); + data.put("description", ticketType.getDescription()); + list.add(data); + } + } else if (StringUtils.equals("2", type)) { + for (StoreStorageOutTicketType ticketType : StoreStorageOutTicketType.values()) { + Map data = new HashMap<>(); + data.put("type", 2); + data.put("sign", ticketType.getSign()); + data.put("description", ticketType.getDescription()); + list.add(data); + } + } else { + // 入库类型 + for (StoreStorageTicketType ticketType : StoreStorageTicketType.values()) { + Map data = new HashMap<>(); + data.put("type", 1); + data.put("sign", ticketType.getSign()); + data.put("description", ticketType.getDescription()); + list.add(data); + } + // 出库类型 + for (StoreStorageOutTicketType ticketType : StoreStorageOutTicketType.values()) { + Map data = new HashMap<>(); + data.put("type", 2); + data.put("sign", ticketType.getSign()); + data.put("description", ticketType.getDescription()); + list.add(data); + } + } + + response.setStatus(1); + response.setMessage("操作成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 门店入库单新增 + */ + @ServiceMethod(method = "store.storage.ticket.add", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店入库单新增") + @Override + public Object storeStorageTicketAdd(StoreStorageTicketAddRequest request) { + String info = "门店入库单新增"; + logger.debug("info:" + info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId();// 门店ID + String jsonString = request.getJsonString();// 入库单数据 + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + if (StringUtils.isBlank(jsonString)) { + response.setStatus(0); + response.setMessage("参数jsonString不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + Store store = storeService.get(tenantId, storeId); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + StoreStorageTicketEntity ticketEntity = null; + try { + ticketEntity = JSONUtil.parseObject(jsonString, StoreStorageTicketEntity.class); + } catch (Exception e) { + logger.error(info + "参数jsonString转换成对象失败"); + response.setStatus(0); + response.setMessage("参数jsonString转换成对象失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + Map validResult = vaildParam(ticketEntity); + if (validResult != null && (Integer) validResult.get("status") == 0) { + response.setStatus(0); + response.setMessage(validResult.get("message").toString()); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + String createUser = Constant.CREATE_USER; + StoreStorageTicket ticket = new StoreStorageTicket(); + ticket.setNo(ticketEntity.getNo()); + ticket.setStoreId(storeId); + ticket.setStoreNo(store.getNo()); + ticket.setStoreName(store.getName()); + ticket.setType(ticketEntity.getType());// 入库类型 + ticket.setStorageId(ticketEntity.getStorageId());// 仓库ID + ticket.setStorageName(ticketEntity.getStorageName());// 仓库名称 + ticket.setDescription(ticketEntity.getDescription());// 备注信息 + ticket.setStatus(0);// 单据状态(0-新建;1-驳回;2-审核通过;3-已作废;) + ticket.setSetMan(ticketEntity.getSetMan());// 制单人 + ticket.setSetDate(DateUtils.parseDate(ticketEntity.getSetDate(), DateUtils.SHOW_DATETIME_FORMAT));// 制单日期 + ticket.setCreateUser(createUser); + + List detailList = new ArrayList<>(); + for (StoreStorageTicketDetailEntity detailEntity : ticketEntity.getDetailList()) { + StoreStorageTicketDetail detail = new StoreStorageTicketDetail(); + detail.setProductId(detailEntity.getProductId());// 原料ID + detail.setProductNo(detailEntity.getProductNo());// 原料编号 + detail.setProductName(detailEntity.getProductName());// 原料名称 + detail.setSpecId(detailEntity.getSpecId());// 规格ID + detail.setSpecName(detailEntity.getSpecName());// 规格名称 + detail.setProductDescription(detailEntity.getProductDescription());// 原料说明 + detail.setStockUnitId(detailEntity.getStockUnitId());// 库存单位 + detail.setStockUnitName(detailEntity.getStockUnitName());// 库存单位名称 + detail.setAmount(detailEntity.getAmount());// 入库数量 + detail.setPrice(detailEntity.getPrice());// 价格 + detail.setMoney(detailEntity.getMoney());// 金额 + detail.setDescription(detailEntity.getDescription());// 备注说明 + detail.setCreateUser(createUser); + detailList.add(detail); + } + + StoreStorageTicketLog ticketLog = new StoreStorageTicketLog(); + ticketLog.setType(0);// 操作类型(0-新建;1-修改;2-审核;3-作废;4-反审核;) + ticketLog.setStatus(ticket.getStatus()); + ticketLog.setDescription("新建单据"); + ticketLog.setCreateUser(ticket.getSetMan()); + ticketLog.setTenantId(tenantId); + + StoreStorageTicket storageTicket = storeStorageTicketService.saveTicket(tenantId, ticket, detailList, ticketLog); + String ticketId = storageTicket.getId(); + response.setStatus(1); + response.setMessage("操作成功"); + Map data = new HashMap<>(); + data.put("ticketId", ticketId); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 业务参数校验 + */ + private Map vaildParam(StoreStorageTicketEntity ticket) { + Map validResult = new HashMap<>(); + if (StringUtils.isBlank(ticket.getNo())) { + validResult.put("status", 0); + validResult.put("message", "单据编号不能为空"); + return validResult; + } + + validResult.put("status", 1); + validResult.put("message", "校验通过"); + return validResult; + } + + /** + * 门店入库单修改 + */ + @ServiceMethod(method = "store.storage.ticket.edit", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店入库单修改") + @Override + public Object storeStorageTicketEdit(StoreStorageTicketEditRequest request) { + String info = "门店入库单修改"; + logger.debug("info:" + info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId();// 门店ID + String jsonString = request.getJsonString();// 入库单数据 + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + if (StringUtils.isBlank(jsonString)) { + response.setStatus(0); + response.setMessage("参数jsonString不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + Store store = storeService.get(tenantId, storeId); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + StoreStorageTicketEntity ticketEntity = null; + try { + ticketEntity = JSONUtil.parseObject(jsonString, StoreStorageTicketEntity.class); + } catch (Exception e) { + logger.error(info + "参数jsonString转换成对象失败"); + response.setStatus(0); + response.setMessage("参数jsonString转换成对象失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + if (StringUtils.isBlank(ticketEntity.getId())) { + response.setStatus(0); + response.setMessage("单据ID不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + Map validResult = vaildParam(ticketEntity); + if (validResult != null && (Integer) validResult.get("status") == 0) { + response.setStatus(0); + response.setMessage(validResult.get("message").toString()); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + StoreStorageTicket storeStorageTicket = storeStorageTicketService.get(tenantId, ticketEntity.getId()); + if (storeStorageTicket == null) { + response.setStatus(0); + response.setMessage("单据信息不存在"); + response.setErrCode(CommonErrorCode.error23.getCode()); + response.setErrMessage(CommonErrorCode.error23.getMessage()); + return response; + } + if (!StringUtils.equalsIgnoreCase(storeStorageTicket.getNo(), ticketEntity.getNo())) { + response.setStatus(0); + response.setMessage("单据信息不一致"); + response.setErrCode(CommonErrorCode.error24.getCode()); + response.setErrMessage(CommonErrorCode.error24.getMessage()); + return response; + } + if (storeStorageTicket.getStatus() != 0 && storeStorageTicket.getStatus() != 1) { + response.setStatus(0); + response.setMessage("只有新建或已驳回状态的单据才能修改"); + response.setErrCode(CommonErrorCode.error22.getCode()); + response.setErrMessage(CommonErrorCode.error22.getMessage()); + return response; + } + + String createUser = Constant.CREATE_USER; + StoreStorageTicket ticket = new StoreStorageTicket(); + ticket.setId(ticketEntity.getId()); + ticket.setNo(ticketEntity.getNo()); + ticket.setStoreId(storeId); + ticket.setStoreNo(store.getNo()); + ticket.setStoreName(store.getName()); + ticket.setType(ticketEntity.getType());// 入库类型 + ticket.setStorageId(ticketEntity.getStorageId());// 仓库ID + ticket.setStorageName(ticketEntity.getStorageName());// 仓库名称 + ticket.setDescription(ticketEntity.getDescription());// 备注信息 + ticket.setStatus(0);// 单据状态(0-新建;1-驳回;2-审核通过;3-已作废;) + ticket.setSetMan(ticketEntity.getSetMan());// 制单人 + ticket.setSetDate(DateUtils.parseDate(ticketEntity.getSetDate(), DateUtils.SHOW_DATETIME_FORMAT));// 制单日期 + ticket.setModifyUser(createUser); + ticket.setModifyDate(new Date()); + + List detailList = new ArrayList<>(); + for (StoreStorageTicketDetailEntity detailEntity : ticketEntity.getDetailList()) { + StoreStorageTicketDetail detail = new StoreStorageTicketDetail(); + detail.setProductId(detailEntity.getProductId());// 原料ID + detail.setProductNo(detailEntity.getProductNo());// 原料编号 + detail.setProductName(detailEntity.getProductName());// 原料名称 + detail.setSpecId(detailEntity.getSpecId());// 规格ID + detail.setSpecName(detailEntity.getSpecName());// 规格名称 + detail.setProductDescription(detailEntity.getProductDescription());// 原料说明 + detail.setStockUnitId(detailEntity.getStockUnitId());// 库存单位 + detail.setStockUnitName(detailEntity.getStockUnitName());// 库存单位名称 + detail.setAmount(detailEntity.getAmount());// 入库数量 + detail.setPrice(detailEntity.getPrice());// 价格 + detail.setMoney(detailEntity.getMoney());// 金额 + detail.setDescription(detailEntity.getDescription());// 备注说明 + detail.setCreateUser(createUser); + detailList.add(detail); + } + + StoreStorageTicketLog ticketLog = new StoreStorageTicketLog(); + ticketLog.setType(1);// 操作类型(0-新建;1-修改;2-审核;3-作废;4-反审核;) + ticketLog.setStatus(ticket.getStatus()); + ticketLog.setDescription("修改单据"); + ticketLog.setCreateUser(ticket.getSetMan()); + ticketLog.setTenantId(tenantId); + + storeStorageTicketService.updateTicket(tenantId, ticket, detailList, ticketLog); + String ticketId = ticket.getId(); + response.setStatus(1); + response.setMessage("操作成功"); + Map data = new HashMap<>(); + data.put("ticketId", ticketId); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 门店入库单状态调整 + */ + @ServiceMethod(method = "store.storage.ticket.status.change", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店入库单状态调整") + @Override + public Object storeStorageTicketStatusChange(StoreStorageTicketStatusChangeRequest request) { + String info = "门店入库单状态调整"; + logger.debug("info:" + info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId();// 门店ID + String ticketId = request.getTicketId();// 单据编号 + Integer action = request.getAction();// 操作类型(1-驳回;2-审核通过;3-作废;4-反审核;) + String operator = request.getOperator();// 操作员 + String reason = request.getReason();// 原因 + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + if (StringUtils.isBlank(operator)) { + response.setStatus(0); + response.setMessage("参数operator不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (StringUtils.isBlank(operator)) { + response.setStatus(0); + response.setMessage("参数operator不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (action == null) { + response.setStatus(0); + response.setMessage("参数action不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + StoreStorageTicket storageTicket = storeStorageTicketService.get(tenantId, ticketId); + if (storageTicket == null) { + response.setStatus(0); + response.setMessage("单据不存在"); + response.setErrCode(CommonErrorCode.error21.getCode()); + response.setErrMessage(CommonErrorCode.error21.getMessage()); + return response; + } + + int status = storageTicket.getStatus();// 单据状态(0-新建;1-驳回;2-审核通过;3-已作废;) + String ticketNo = storageTicket.getNo(); + StoreStorageTicket ticket = null; + StoreStorageTicketLog ticketLog = null; + Map data = null; + + switch (action) { + case 1:// 驳回 + if (status != 0) { + response.setStatus(0); + response.setMessage("只有新建状态的单据才能驳回"); + response.setErrCode(CommonErrorCode.error22.getCode()); + response.setErrMessage(CommonErrorCode.error22.getMessage()); + return response; + } + + // 驳回 + ticket = new StoreStorageTicket(); + ticket.setId(storageTicket.getId()); + ticket.setStatus(1);// 单据状态(0-新建;1-驳回;2-审核通过;3-已作废;) + ticket.setCheckDate(new Date()); + ticket.setCheckMan(operator); + + ticketLog = new StoreStorageTicketLog(); + ticketLog.setTicketId(ticketId); + ticketLog.setTicketNo(ticketNo); + ticketLog.setType(2);// 操作类型(0-新建;1-修改;2-审核;3-作废;4-反审核;) + ticketLog.setStatus(1); + ticketLog.setDescription(StringUtils.isNotBlank(reason) ? reason : "驳回该单据"); + ticketLog.setCreateUser(operator); + ticketLog.setTenantId(tenantId); + storeStorageTicketService.updateTicketStatus(tenantId, ticket, ticketLog); + response.setStatus(1); + response.setMessage("操作成功"); + data = new HashMap<>(); + data.put("ticketId", ticketId); + response.setData(data); + break; + case 2:// 审核通过 + if (status != 0) { + response.setStatus(0); + response.setMessage("只有新建状态的单据才能审核"); + response.setErrCode(CommonErrorCode.error22.getCode()); + response.setErrMessage(CommonErrorCode.error22.getMessage()); + return response; + } + + // 审核通过 + ticket = new StoreStorageTicket(); + ticket.setId(storageTicket.getId()); + ticket.setStatus(2);// 单据状态(0-新建;1-驳回;2-审核通过;3-已作废;) + ticket.setCheckDate(new Date()); + ticket.setCheckMan(operator); + + ticketLog = new StoreStorageTicketLog(); + ticketLog.setTicketId(ticketId); + ticketLog.setTicketNo(ticketNo); + ticketLog.setType(2);// 操作类型(0-新建;1-修改;2-审核;3-作废;4-反审核;) + ticketLog.setStatus(1); + ticketLog.setDescription(StringUtils.isNotBlank(reason) ? reason : "审核该单据"); + ticketLog.setCreateUser(operator); + ticketLog.setTenantId(tenantId); + storeStorageTicketService.updateTicketStatus(tenantId, ticket, ticketLog); + response.setStatus(1); + response.setMessage("操作成功"); + data = new HashMap<>(); + data.put("ticketId", ticketId); + response.setData(data); + break; + case 3:// 作废 + if (status == 0 || status == 1) { + // 作废 + ticket = new StoreStorageTicket(); + ticket.setId(storageTicket.getId()); + ticket.setStatus(3);// 单据状态(0-新建;1-驳回;2-审核通过;3-已作废;) + ticket.setCheckDate(new Date()); + ticket.setCheckMan(operator); + + ticketLog = new StoreStorageTicketLog(); + ticketLog.setTicketId(ticketId); + ticketLog.setTicketNo(ticketNo); + ticketLog.setType(3);// 操作类型(0-新建;1-修改;2-审核;3-作废;4-反审核;) + ticketLog.setStatus(1); + ticketLog.setDescription(StringUtils.isNotBlank(reason) ? reason : "作废该单据"); + ticketLog.setCreateUser(operator); + ticketLog.setTenantId(tenantId); + storeStorageTicketService.updateTicketStatus(tenantId, ticket, ticketLog); + response.setStatus(1); + response.setMessage("操作成功"); + data = new HashMap<>(); + data.put("ticketId", ticketId); + response.setData(data); + } else { + response.setStatus(0); + response.setMessage("只有新建或已驳回状态的单据才能作废"); + response.setErrCode(CommonErrorCode.error22.getCode()); + response.setErrMessage(CommonErrorCode.error22.getMessage()); + return response; + } + break; + case 4:// 反审核 + response.setStatus(0); + response.setMessage("该操作类型暂不支持"); + response.setErrCode(CommonErrorCode.error22.getCode()); + response.setErrMessage(CommonErrorCode.error22.getMessage()); + break; + default: + response.setStatus(0); + response.setMessage("操作类型不存在"); + response.setErrCode(CommonErrorCode.error22.getCode()); + response.setErrMessage(CommonErrorCode.error22.getMessage()); + break; + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 门店入库单列表 + */ + @ServiceMethod(method = "store.storage.ticket.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店入库单列表") + @Override + public Object storeStorageTicketList(StoreStorageTicketListRequest request) { + String info = "门店入库单列表"; + logger.debug("info:" + info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String type = request.getType();// 入库类型 + String property = request.getProperty();// 搜索属性 + String keyword = request.getKeyword();// 搜索关键字 + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + Integer status = request.getStatus();// 单据状态 + String startTime = request.getStartTime();// 开始时间 + String endTime = request.getEndTime();// 结束时间 + + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + if (StringUtils.isNotBlank(type)) { + criteria.add(Restrictions.eq("type", type)); + } + if (StringUtils.isNotBlank(property) && StringUtils.isNotBlank(keyword)) { + criteria.add(Restrictions.like(property, "%" + keyword + "%")); + } + if (StringUtils.isNotBlank(startTime)) { + criteria.add(Restrictions.ge("setDate", startTime)); + } + if (StringUtils.isNotBlank(endTime)) { + criteria.add(Restrictions.le("setDate", endTime)); + } + if (null != status && status > -1) { + criteria.add(Restrictions.eq("status", status)); + } + criteria.add(Restrictions.order("createDate", "desc")); + pager = storeStorageTicketService.getPager(tenantId, criteria, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + Map ticketTypeMap = new HashMap<>();// 入库类型 + for (StoreStorageTicketType ticketType : StoreStorageTicketType.values()) { + ticketTypeMap.put(ticketType.getSign(), ticketType); + } + + List dataList = (List) pager.getList(); + for (StoreStorageTicket data : dataList) { + Map map = new HashMap<>(); + map.put("tenantId", data.getTenantId()); + map.put("id", data.getId()); + map.put("no", data.getNo());// 单据编号 + map.put("storeId", data.getStoreId());// 门店ID + map.put("storeNo", data.getStoreNo());// 门店编号 + map.put("storeName", data.getStoreName());// 门店名称 + map.put("type", data.getType());// 入库类型 + map.put("typeName", ticketTypeMap.get("" + data.getType()) == null ? "ERR" : ticketTypeMap.get("" + data.getType()).getDescription());// 入库类型 + map.put("storageId", data.getStorageId());// 仓库ID + map.put("storageName", data.getStorageName());// 仓库名称 + map.put("description", data.getDescription());// 备注信息 + map.put("status", data.getStatus());// 单据状态 + map.put("setMan", data.getSetMan());// 制单人 + map.put("setDate", formatYMDHMS(data.getSetDate()));// 制单日期 + map.put("checkMan", data.getCheckMan());// 审核人 + map.put("checkDate", formatYMDHMS(data.getCheckDate()));// 审核日期 + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 门店入库单明细 + */ + @ServiceMethod(method = "store.storage.ticket.detail", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店入库单明细") + @Override + public Object storeStorageTicketDetail(StoreStorageTicketDetailRequest request) { + String info = "门店入库单明细"; + logger.debug("info:" + info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String ticketId = request.getTicketId();// 单据ID + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + if (StringUtils.isBlank(ticketId)) { + response.setStatus(0); + response.setMessage("参数ticketId不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketId", ticketId)); + criteria.add(Restrictions.order("productNo", "asc")); + pager = storeStorageTicketDetailService.getPager(tenantId, criteria, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List dataList = (List) pager.getList(); + for (StoreStorageTicketDetail data : dataList) { + Map map = new HashMap<>(); + map.put("tenantId", data.getTenantId()); + map.put("id", data.getId()); + map.put("ticketId", data.getTicketId());// 主单ID + map.put("ticketNo", data.getTicketNo());// 主单编号 + map.put("productId", data.getProductId());// 原料ID + map.put("productNo", data.getProductNo());// 原料编号 + map.put("productName", data.getProductName());// 原料名称 + map.put("specId", data.getSpecId());// 规格ID + map.put("specName", data.getSpecName());// 规格名称 + map.put("productDescription", data.getProductDescription());// 原料说明 + map.put("stockUnitId", data.getStockUnitId());// 库存单位ID + map.put("stockUnitName", data.getStockUnitName());// 库存单位名称 + map.put("amount", doubleFormat(data.getAmount()));// 入库数量 + map.put("price", doubleFormat(data.getPrice()));// 价格 + map.put("money", doubleFormat(data.getMoney()));// 金额 + map.put("description", data.getDescription());// 备注说明 + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 门店出库单新增 + */ + @ServiceMethod(method = "store.storage.out.ticket.add", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店出库单新增") + @Override + public Object storeStorageOutTicketAdd(StoreStorageOutTicketAddRequest request) { + String info = "门店出库单新增"; + logger.debug("info:" + info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId();// 门店ID + String jsonString = request.getJsonString();// 出库单数据 + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + if (StringUtils.isBlank(jsonString)) { + response.setStatus(0); + response.setMessage("参数jsonString不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + Store store = storeService.get(tenantId, storeId); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + StoreStorageOutTicketEntity ticketEntity = null; + try { + ticketEntity = JSONUtil.parseObject(jsonString, StoreStorageOutTicketEntity.class); + } catch (Exception e) { + logger.error(info + "参数jsonString转换成对象失败"); + response.setStatus(0); + response.setMessage("参数jsonString转换成对象失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + Map validResult = vaildParam(ticketEntity); + if (validResult != null && (Integer) validResult.get("status") == 0) { + response.setStatus(0); + response.setMessage(validResult.get("message").toString()); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + String createUser = Constant.CREATE_USER; + StoreStorageOutTicket ticket = new StoreStorageOutTicket(); + ticket.setNo(ticketEntity.getNo()); + ticket.setStoreId(storeId); + ticket.setStoreNo(store.getNo()); + ticket.setStoreName(store.getName()); + ticket.setType(ticketEntity.getType());// 出库类型 + ticket.setStorageId(ticketEntity.getStorageId());// 仓库ID + ticket.setStorageName(ticketEntity.getStorageName());// 仓库名称 + ticket.setDescription(ticketEntity.getDescription());// 备注信息 + ticket.setStatus(0);// 单据状态(0-新建;1-驳回;2-审核通过;3-已作废;) + ticket.setSetMan(ticketEntity.getSetMan());// 制单人 + ticket.setSetDate(DateUtils.parseDate(ticketEntity.getSetDate(), DateUtils.SHOW_DATETIME_FORMAT));// 制单日期 + ticket.setCreateUser(createUser); + + List detailList = new ArrayList<>(); + for (StoreStorageOutTicketDetailEntity detailEntity : ticketEntity.getDetailList()) { + StoreStorageOutTicketDetail detail = new StoreStorageOutTicketDetail(); + detail.setProductId(detailEntity.getProductId());// 原料ID + detail.setProductNo(detailEntity.getProductNo());// 原料编号 + detail.setProductName(detailEntity.getProductName());// 原料名称 + detail.setSpecId(detailEntity.getSpecId());// 规格ID + detail.setSpecName(detailEntity.getSpecName());// 规格名称 + detail.setProductDescription(detailEntity.getProductDescription());// 原料说明 + detail.setStockUnitId(detailEntity.getStockUnitId());// 库存单位 + detail.setStockUnitName(detailEntity.getStockUnitName());// 库存单位名称 + detail.setAmount(detailEntity.getAmount());// 出库数量 + detail.setPrice(detailEntity.getPrice());// 价格 + detail.setMoney(detailEntity.getMoney());// 金额 + detail.setDescription(detailEntity.getDescription());// 备注说明 + detail.setCreateUser(createUser); + detailList.add(detail); + } + + StoreStorageOutTicketLog ticketLog = new StoreStorageOutTicketLog(); + ticketLog.setType(0);// 操作类型(0-新建;1-修改;2-审核;3-作废;4-反审核;) + ticketLog.setStatus(ticket.getStatus()); + ticketLog.setDescription("新建单据"); + ticketLog.setCreateUser(ticket.getSetMan()); + ticketLog.setTenantId(tenantId); + + StoreStorageOutTicket storageOutTicket = storeStorageOutTicketService.saveTicket(tenantId, ticket, detailList, ticketLog); + String ticketId = storageOutTicket.getId(); + response.setStatus(1); + response.setMessage("操作成功"); + Map data = new HashMap<>(); + data.put("ticketId", ticketId); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 业务参数校验 + */ + private Map vaildParam(StoreStorageOutTicketEntity ticket) { + Map validResult = new HashMap<>(); + if (StringUtils.isBlank(ticket.getNo())) { + validResult.put("status", 0); + validResult.put("message", "单据编号不能为空"); + return validResult; + } + + validResult.put("status", 1); + validResult.put("message", "校验通过"); + return validResult; + } + + /** + * 门店出库单修改 + */ + @ServiceMethod(method = "store.storage.out.ticket.edit", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店出库单修改") + @Override + public Object storeStorageOutTicketEdit(StoreStorageOutTicketEditRequest request) { + String info = "门店出库单修改"; + logger.debug("info:" + info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId();// 门店ID + String jsonString = request.getJsonString();// 出库单数据 + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + if (StringUtils.isBlank(jsonString)) { + response.setStatus(0); + response.setMessage("参数jsonString不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + Store store = storeService.get(tenantId, storeId); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + StoreStorageOutTicketEntity ticketEntity = null; + try { + ticketEntity = JSONUtil.parseObject(jsonString, StoreStorageOutTicketEntity.class); + } catch (Exception e) { + logger.error(info + "参数jsonString转换成对象失败"); + response.setStatus(0); + response.setMessage("参数jsonString转换成对象失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + if (StringUtils.isBlank(ticketEntity.getId())) { + response.setStatus(0); + response.setMessage("单据ID不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + Map validResult = vaildParam(ticketEntity); + if (validResult != null && (Integer) validResult.get("status") == 0) { + response.setStatus(0); + response.setMessage(validResult.get("message").toString()); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + StoreStorageOutTicket storeStorageOutTicket = storeStorageOutTicketService.get(tenantId, ticketEntity.getId()); + if (storeStorageOutTicket == null) { + response.setStatus(0); + response.setMessage("单据信息不存在"); + response.setErrCode(CommonErrorCode.error23.getCode()); + response.setErrMessage(CommonErrorCode.error23.getMessage()); + return response; + } + if (!StringUtils.equalsIgnoreCase(storeStorageOutTicket.getNo(), ticketEntity.getNo())) { + response.setStatus(0); + response.setMessage("单据信息不一致"); + response.setErrCode(CommonErrorCode.error24.getCode()); + response.setErrMessage(CommonErrorCode.error24.getMessage()); + return response; + } + if (storeStorageOutTicket.getStatus() != 0 && storeStorageOutTicket.getStatus() != 1) { + response.setStatus(0); + response.setMessage("只有新建或已驳回状态的单据才能修改"); + response.setErrCode(CommonErrorCode.error22.getCode()); + response.setErrMessage(CommonErrorCode.error22.getMessage()); + return response; + } + + String createUser = Constant.CREATE_USER; + StoreStorageOutTicket ticket = new StoreStorageOutTicket(); + ticket.setId(ticketEntity.getId()); + ticket.setNo(ticketEntity.getNo()); + ticket.setStoreId(storeId); + ticket.setStoreNo(store.getNo()); + ticket.setStoreName(store.getName()); + ticket.setType(ticketEntity.getType());// 出库类型 + ticket.setStorageId(ticketEntity.getStorageId());// 仓库ID + ticket.setStorageName(ticketEntity.getStorageName());// 仓库名称 + ticket.setDescription(ticketEntity.getDescription());// 备注信息 + ticket.setStatus(0);// 单据状态(0-新建;1-驳回;2-审核通过;3-已作废;) + ticket.setSetMan(ticketEntity.getSetMan());// 制单人 + ticket.setSetDate(DateUtils.parseDate(ticketEntity.getSetDate(), DateUtils.SHOW_DATETIME_FORMAT));// 制单日期 + ticket.setModifyUser(createUser); + ticket.setModifyDate(new Date()); + + List detailList = new ArrayList<>(); + for (StoreStorageOutTicketDetailEntity detailEntity : ticketEntity.getDetailList()) { + StoreStorageOutTicketDetail detail = new StoreStorageOutTicketDetail(); + detail.setProductId(detailEntity.getProductId());// 原料ID + detail.setProductNo(detailEntity.getProductNo());// 原料编号 + detail.setProductName(detailEntity.getProductName());// 原料名称 + detail.setSpecId(detailEntity.getSpecId());// 规格ID + detail.setSpecName(detailEntity.getSpecName());// 规格名称 + detail.setProductDescription(detailEntity.getProductDescription());// 原料说明 + detail.setStockUnitId(detailEntity.getStockUnitId());// 库存单位 + detail.setStockUnitName(detailEntity.getStockUnitName());// 库存单位名称 + detail.setAmount(detailEntity.getAmount());// 出库数量 + detail.setPrice(detailEntity.getPrice());// 价格 + detail.setMoney(detailEntity.getMoney());// 金额 + detail.setDescription(detailEntity.getDescription());// 备注说明 + detail.setCreateUser(createUser); + detailList.add(detail); + } + + StoreStorageOutTicketLog ticketLog = new StoreStorageOutTicketLog(); + ticketLog.setType(1);// 操作类型(0-新建;1-修改;2-审核;3-作废;4-反审核;) + ticketLog.setStatus(ticket.getStatus()); + ticketLog.setDescription("修改单据"); + ticketLog.setCreateUser(ticket.getSetMan()); + ticketLog.setTenantId(tenantId); + + storeStorageOutTicketService.updateTicket(tenantId, ticket, detailList, ticketLog); + String ticketId = ticket.getId(); + response.setStatus(1); + response.setMessage("操作成功"); + Map data = new HashMap<>(); + data.put("ticketId", ticketId); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 门店出库单状态调整 + */ + @ServiceMethod(method = "store.storage.out.ticket.status.change", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店出库单状态调整") + @Override + public Object storeStorageOutTicketStatusChange(StoreStorageOutTicketStatusChangeRequest request) { + String info = "门店出库单状态调整"; + logger.debug("info:" + info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId();// 门店ID + String ticketId = request.getTicketId();// 单据编号 + Integer action = request.getAction();// 操作类型(1-驳回;2-审核通过;3-作废;4-反审核;) + String operator = request.getOperator();// 操作员 + String reason = request.getReason();// 原因 + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + if (StringUtils.isBlank(operator)) { + response.setStatus(0); + response.setMessage("参数operator不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (StringUtils.isBlank(operator)) { + response.setStatus(0); + response.setMessage("参数operator不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (action == null) { + response.setStatus(0); + response.setMessage("参数action不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + StoreStorageOutTicket storageOutTicket = storeStorageOutTicketService.get(tenantId, ticketId); + if (storageOutTicket == null) { + response.setStatus(0); + response.setMessage("单据不存在"); + response.setErrCode(CommonErrorCode.error21.getCode()); + response.setErrMessage(CommonErrorCode.error21.getMessage()); + return response; + } + + int status = storageOutTicket.getStatus();// 单据状态(0-新建;1-驳回;2-审核通过;3-已作废;) + String ticketNo = storageOutTicket.getNo(); + StoreStorageOutTicket ticket = null; + StoreStorageOutTicketLog ticketLog = null; + Map data = null; + + switch (action) { + case 1:// 驳回 + if (status != 0) { + response.setStatus(0); + response.setMessage("只有新建状态的单据才能驳回"); + response.setErrCode(CommonErrorCode.error22.getCode()); + response.setErrMessage(CommonErrorCode.error22.getMessage()); + return response; + } + + // 驳回 + ticket = new StoreStorageOutTicket(); + ticket.setId(storageOutTicket.getId()); + ticket.setStatus(1);// 单据状态(0-新建;1-驳回;2-审核通过;3-已作废;) + ticket.setCheckDate(new Date()); + ticket.setCheckMan(operator); + + ticketLog = new StoreStorageOutTicketLog(); + ticketLog.setTicketId(ticketId); + ticketLog.setTicketNo(ticketNo); + ticketLog.setType(2);// 操作类型(0-新建;1-修改;2-审核;3-作废;4-反审核;) + ticketLog.setStatus(1); + ticketLog.setDescription(StringUtils.isNotBlank(reason) ? reason : "驳回该单据"); + ticketLog.setCreateUser(operator); + ticketLog.setTenantId(tenantId); + storeStorageOutTicketService.updateTicketStatus(tenantId, ticket, ticketLog); + response.setStatus(1); + response.setMessage("操作成功"); + data = new HashMap<>(); + data.put("ticketId", ticketId); + response.setData(data); + break; + case 2:// 审核通过 + if (status != 0) { + response.setStatus(0); + response.setMessage("只有新建状态的单据才能审核"); + response.setErrCode(CommonErrorCode.error22.getCode()); + response.setErrMessage(CommonErrorCode.error22.getMessage()); + return response; + } + + // 审核通过 + ticket = new StoreStorageOutTicket(); + ticket.setId(storageOutTicket.getId()); + ticket.setStatus(2);// 单据状态(0-新建;1-驳回;2-审核通过;3-已作废;) + ticket.setCheckDate(new Date()); + ticket.setCheckMan(operator); + + ticketLog = new StoreStorageOutTicketLog(); + ticketLog.setTicketId(ticketId); + ticketLog.setTicketNo(ticketNo); + ticketLog.setType(2);// 操作类型(0-新建;1-修改;2-审核;3-作废;4-反审核;) + ticketLog.setStatus(1); + ticketLog.setDescription(StringUtils.isNotBlank(reason) ? reason : "审核该单据"); + ticketLog.setCreateUser(operator); + ticketLog.setTenantId(tenantId); + storeStorageOutTicketService.updateTicketStatus(tenantId, ticket, ticketLog); + response.setStatus(1); + response.setMessage("操作成功"); + data = new HashMap<>(); + data.put("ticketId", ticketId); + response.setData(data); + break; + case 3:// 作废 + if (status == 0 || status == 1) { + // 作废 + ticket = new StoreStorageOutTicket(); + ticket.setId(storageOutTicket.getId()); + ticket.setStatus(3);// 单据状态(0-新建;1-驳回;2-审核通过;3-已作废;) + ticket.setCheckDate(new Date()); + ticket.setCheckMan(operator); + + ticketLog = new StoreStorageOutTicketLog(); + ticketLog.setTicketId(ticketId); + ticketLog.setTicketNo(ticketNo); + ticketLog.setType(3);// 操作类型(0-新建;1-修改;2-审核;3-作废;4-反审核;) + ticketLog.setStatus(1); + ticketLog.setDescription(StringUtils.isNotBlank(reason) ? reason : "作废该单据"); + ticketLog.setCreateUser(operator); + ticketLog.setTenantId(tenantId); + storeStorageOutTicketService.updateTicketStatus(tenantId, ticket, ticketLog); + response.setStatus(1); + response.setMessage("操作成功"); + data = new HashMap<>(); + data.put("ticketId", ticketId); + response.setData(data); + } else { + response.setStatus(0); + response.setMessage("只有新建或已驳回状态的单据才能作废"); + response.setErrCode(CommonErrorCode.error22.getCode()); + response.setErrMessage(CommonErrorCode.error22.getMessage()); + return response; + } + break; + case 4:// 反审核 + response.setStatus(0); + response.setMessage("该操作类型暂不支持"); + response.setErrCode(CommonErrorCode.error22.getCode()); + response.setErrMessage(CommonErrorCode.error22.getMessage()); + break; + default: + response.setStatus(0); + response.setMessage("操作类型不存在"); + response.setErrCode(CommonErrorCode.error22.getCode()); + response.setErrMessage(CommonErrorCode.error22.getMessage()); + break; + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 门店出库单列表 + */ + @ServiceMethod(method = "store.storage.out.ticket.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店出库单列表") + @Override + public Object storeStorageOutTicketList(StoreStorageOutTicketListRequest request) { + String info = "门店出库单列表"; + logger.debug("info:" + info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String type = request.getType();// 出库类型 + String property = request.getProperty();// 搜索属性 + String keyword = request.getKeyword();// 搜索关键字 + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + Integer status = request.getStatus();// 单据状态 + String startTime = request.getStartTime();// 开始时间 + String endTime = request.getEndTime();// 结束时间 + + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + if (StringUtils.isNotBlank(type)) { + criteria.add(Restrictions.eq("type", type)); + } + if (StringUtils.isNotBlank(property) && StringUtils.isNotBlank(keyword)) { + criteria.add(Restrictions.like(property, "%" + keyword + "%")); + } + if (StringUtils.isNotBlank(startTime)) { + criteria.add(Restrictions.ge("setDate", startTime)); + } + if (StringUtils.isNotBlank(endTime)) { + criteria.add(Restrictions.le("setDate", endTime)); + } + if (null != status && status > -1) { + criteria.add(Restrictions.eq("status", status)); + } + criteria.add(Restrictions.order("createDate", "desc")); + pager = storeStorageOutTicketService.getPager(tenantId, criteria, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + Map ticketTypeMap = new HashMap<>();// 出库类型 + for (StoreStorageOutTicketType ticketType : StoreStorageOutTicketType.values()) { + ticketTypeMap.put(ticketType.getSign(), ticketType); + } + + List dataList = (List) pager.getList(); + for (StoreStorageOutTicket data : dataList) { + Map map = new HashMap<>(); + map.put("tenantId", data.getTenantId()); + map.put("id", data.getId()); + map.put("no", data.getNo());// 单据编号 + map.put("storeId", data.getStoreId());// 门店ID + map.put("storeNo", data.getStoreNo());// 门店编号 + map.put("storeName", data.getStoreName());// 门店名称 + map.put("type", data.getType());// 出库类型 + map.put("typeName", ticketTypeMap.get("" + data.getType()) == null ? "ERR" : ticketTypeMap.get("" + data.getType()).getDescription());// 出库类型 + map.put("storageId", data.getStorageId());// 仓库ID + map.put("storageName", data.getStorageName());// 仓库名称 + map.put("description", data.getDescription());// 备注信息 + map.put("status", data.getStatus());// 单据状态 + map.put("setMan", data.getSetMan());// 制单人 + map.put("setDate", formatYMDHMS(data.getSetDate()));// 制单日期 + map.put("checkMan", data.getCheckMan());// 审核人 + map.put("checkDate", formatYMDHMS(data.getCheckDate()));// 审核日期 + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 门店出库单明细 + */ + @ServiceMethod(method = "store.storage.out.ticket.detail", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店出库单明细") + @Override + public Object storeStorageOutTicketDetail(StoreStorageOutTicketDetailRequest request) { + String info = "门店出库单明细"; + logger.debug("info:" + info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String ticketId = request.getTicketId();// 单据ID + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + if (StringUtils.isBlank(ticketId)) { + response.setStatus(0); + response.setMessage("参数ticketId不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketId", ticketId)); + criteria.add(Restrictions.order("productNo", "asc")); + pager = storeStorageOutTicketDetailService.getPager(tenantId, criteria, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List dataList = (List) pager.getList(); + for (StoreStorageOutTicketDetail data : dataList) { + Map map = new HashMap<>(); + map.put("tenantId", data.getTenantId()); + map.put("id", data.getId()); + map.put("ticketId", data.getTicketId());// 主单ID + map.put("ticketNo", data.getTicketNo());// 主单编号 + map.put("productId", data.getProductId());// 原料ID + map.put("productNo", data.getProductNo());// 原料编号 + map.put("productName", data.getProductName());// 原料名称 + map.put("specId", data.getSpecId());// 规格ID + map.put("specName", data.getSpecName());// 规格名称 + map.put("productDescription", data.getProductDescription());// 原料说明 + map.put("stockUnitId", data.getStockUnitId());// 库存单位ID + map.put("stockUnitName", data.getStockUnitName());// 库存单位名称 + map.put("amount", doubleFormat(data.getAmount()));// 出库数量 + map.put("price", doubleFormat(data.getPrice()));// 价格 + map.put("money", doubleFormat(data.getMoney()));// 金额 + map.put("description", data.getDescription());// 备注说明 + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/store/CouponServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/store/CouponServiceImpl.java new file mode 100644 index 0000000..5571d06 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/store/CouponServiceImpl.java @@ -0,0 +1,220 @@ +package com.jwsaas.api.service.impl.store; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import com.jwsaas.api.request.store.StoreCouponCheckOutRequest; +import com.jwsaas.api.request.store.StoreCouponCheckRequest; +import com.jwsaas.api.request.store.StoreCouponListRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.response.mode.CommonPagerResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.store.CouponService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.Coupon; +import com.jwsaas.entity.food.CouponCodeDetail; +import com.jwsaas.entity.food.Store; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.pager.Pager; +import com.jwsaas.utils.AppKeyUtil; + +@ServiceMethodBean(version = "1.0") +public class CouponServiceImpl extends WopServiceImpl implements CouponService { + + private static final long serialVersionUID = 5307965695654005651L; + private static final String className = "CouponServiceImpl"; + + @Resource + private com.jwsaas.service.food.StoreService storeService; + + @Resource + private com.jwsaas.service.food.CouponService couponService; + + @Resource + private com.jwsaas.service.food.CouponCodeDetailService couponCodeDetailService; + + @ServiceMethod(method = "store.coupon.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店优惠券列表") + @Override + public Object storeCouponList(StoreCouponListRequest request) { + String info = "门店优惠券列表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("status", 2));// 状态,status,状态(0-待审核,1-待投放,2-已投放,3-已暂停,4-已下架) + pager = couponService.getPagerByStoreId(tenantId, storeId, criteria, pager); + + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List dataList = (List) pager.getList(); + for (Coupon data : dataList) { + Map map = new HashMap<>(); + map.put("id", data.getId()); + map.put("tenantId", data.getTenantId()); + map.put("name", data.getName());// 优惠券名称 + map.put("startDate", data.getStartDate());// 开始日期 + map.put("endDate", data.getEndDate());// 结束日期 + map.put("startTime", data.getStartTime());// 开始时间 + map.put("endTime", data.getEndTime());// 结束时间 + map.put("weekDays", data.getWeekDays());// 星期 + map.put("validMonth", data.getValidMonth());// 月频 + map.put("description", data.getDescription());// 备注说明 + map.put("type", data.getType());// 类型 + map.put("rule", data.getRule());// 使用规则 + map.put("allStore", data.getAllStore());// 适用门店 + map.put("allBrand", data.getAllBrand());// 适用品牌 + map.put("allCategory", data.getAllCategory());// 适用品类 + map.put("allGoods", data.getAllGoods());// 适用商品 + map.put("status", data.getStatus());// 状态 + map.put("voucherFlag", data.getVoucherFlag());// 是否验券0否1是 + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + + return response; + } + + @ServiceMethod(method = "store.coupon.check", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店优惠券核销") + @Override + public Object storeCouponCheck(StoreCouponCheckRequest request) { + String info = "门店优惠券核销"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String couponCode = request.getCouponCode(); + String busNo = request.getBusNo(); + String storeName = request.getStoreName(); + String storeNo = request.getStoreNo(); + String workerNo = request.getWorkerNo(); + String posNo = request.getPosNo(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Integer status = couponCodeDetailService.updateCouponCodeCheck(tenantId, couponCode, storeId, storeName, storeNo, workerNo, posNo, busNo); + switch (status) { + case 0: + response.setStatus(1); + response.setMessage("核销成功"); + break; + case 1: + response.setStatus(0); + response.setMessage("券码错误"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + break; + case 2: + response.setStatus(0); + response.setMessage("优惠券已使用或已过期"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + break; + default: + break; + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.coupon.checkout", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店优惠券核销校验") + @Override + public Object storeCouponCheckOut(StoreCouponCheckOutRequest request) { + String info = "门店优惠券核销校验"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String couponCode = request.getCouponCode(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + int status = 0; + CouponCodeDetail couponCodeDetail = couponCodeDetailService.find(tenantId, "couponCode", couponCode); + if (couponCodeDetail == null) { + status = 1;// 找不到券码 + } + if (couponCodeDetail.getStatus() != 0) { + status = 2;// 优惠券已使用或已过期 + } + switch (status) { + case 0: + response.setStatus(1); + response.setMessage("核销校验成功"); + break; + case 1: + response.setStatus(0); + response.setMessage("券码错误"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + break; + case 2: + response.setStatus(0); + response.setMessage("优惠券已使用或已过期"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + break; + default: + break; + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/store/ProgramBusinessTicketServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/store/ProgramBusinessTicketServiceImpl.java new file mode 100644 index 0000000..9c18228 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/store/ProgramBusinessTicketServiceImpl.java @@ -0,0 +1,82 @@ +package com.jwsaas.api.service.impl.store; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.google.gson.JsonObject; +import com.jwsaas.api.request.upload.BusinessOrderUploadRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.store.ProgramBusinessTicketService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.ProgramStoreBusinessTicket; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.utils.AppKeyUtil; + +import javax.annotation.Resource; +import java.util.*; + +/** + * @Author 37962 + * @Date 2023/11/23 + */ +public class ProgramBusinessTicketServiceImpl extends WopServiceImpl implements ProgramBusinessTicketService { + + @Resource + private com.jwsaas.service.food.ProgramStoreBusinessTicketService storeBusinessTicket; + + + @ServiceMethod(method = "store.businessTicket.ids", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "根据时间段返回销售单收据id接口") + @Override + public Object ProgramStoreBusinessTickets(BusinessOrderUploadRequest request) { + String info = "根据时间段返回销售单收据id接口"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + CommonDataResponse response = null; + String jsonString = request.getJsonString(); + System.out.println("jsonString:"+jsonString); + try { + response = new CommonDataResponse(); + JSONObject obj = JSON.parseObject(jsonString); + String startTime= obj.getString("startTime"); + String endTime=obj.getString("endTime"); + String storeId=obj.getString("storeId"); + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.ge("saleDate", startTime)); + criteria.add(Restrictions.le("saleDate", endTime)); + List list =storeBusinessTicket.getList(tenantId,criteria); + List ids=new ArrayList<>(); + for(ProgramStoreBusinessTicket tTicket:list){ + ids.add(tTicket.getId()); + } + + Map data = new HashMap<>(); + data.put("ticketId", new Date().getTime()); + data.put("ids",ids); + response.setMessage("估清数据更新成功"); + response.setStatus(1); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + logger.error("jsonString:" + jsonString); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "BUSINESS_ORDER_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/store/StoreAccountServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/store/StoreAccountServiceImpl.java new file mode 100644 index 0000000..29f9af8 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/store/StoreAccountServiceImpl.java @@ -0,0 +1,1728 @@ +package com.jwsaas.api.service.impl.store; + +import java.math.BigDecimal; +import java.util.*; +import java.util.concurrent.TimeUnit; + +import javax.annotation.Resource; + +import com.jwsaas.http.HttpTool; +import com.jwsaas.weixin.SignUtil; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.http.HttpResponse; +import org.redisson.api.RMapCache; +import org.redisson.api.RedissonClient; +import org.springframework.beans.factory.annotation.Autowired; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.jwsaas.Constant; +import com.jwsaas.StoreAccountBusType; +import com.jwsaas.api.request.store.StoreAccountDetailInfoRequest; +import com.jwsaas.api.request.store.StoreAccountDetailInfoRequest2; +import com.jwsaas.api.request.store.StoreAccountDetailListRequest; +import com.jwsaas.api.request.store.StoreAccountEnchashmentApplyRequest; +import com.jwsaas.api.request.store.StoreAccountEnchashmentCancelRequest; +import com.jwsaas.api.request.store.StoreAccountEnchashmentInfoRequest; +import com.jwsaas.api.request.store.StoreAccountEnchashmentListRequest; +import com.jwsaas.api.request.store.StoreAccountGetRequest; +import com.jwsaas.api.request.store.StoreAccountRechargeParameterRequest; +import com.jwsaas.api.request.store.StoreAccountRechargeRequest; +import com.jwsaas.api.request.store.StoreAccountRechargeWeixinPayOrderQueryRequest; +import com.jwsaas.api.request.store.StoreAccountRechargeWeixinPayOrderQueryRequest2; +import com.jwsaas.api.request.store.StoreAccountRechargeWeixinPayUnifiedorderRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.response.mode.CommonPagerResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.store.StoreAccountService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.Store; +import com.jwsaas.entity.food.StoreAccount; +import com.jwsaas.entity.food.StoreAccountDetail; +import com.jwsaas.entity.food.StoreAccountRechargeParameter; +import com.jwsaas.entity.food.StoreAccountRechargeRecord; +import com.jwsaas.entity.food.StoreEnchashmentRecord; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.pager.Pager; +import com.jwsaas.pay.weixin.api.WeiXinPayApi; +import com.jwsaas.pay.weixin.request.QueryOrderRequest; +import com.jwsaas.pay.weixin.request.UnifiedOrderRequest; +import com.jwsaas.pay.weixin.response.QueryOrderResponse; +import com.jwsaas.pay.weixin.response.UnifiedOrderResponse; +import com.jwsaas.pay.weixin.utils.SecurityUtils; +import com.jwsaas.properties.WxyhProperties; +import com.jwsaas.util.DigestUtils; +import com.jwsaas.util.JSONUtil; +import com.jwsaas.util.RandomUtils; +import com.jwsaas.utils.AppKeyUtil; +import com.jwsaas.utils.DateUtils; +import com.jwsaas.utils.MathUtil; + +@ServiceMethodBean(version = "1.0") +public class StoreAccountServiceImpl extends WopServiceImpl implements StoreAccountService { + + private static final long serialVersionUID = -2633821874523174001L; + + @Autowired + private WxyhProperties wxyhProperties; + + @Resource + private RedissonClient redissonClient; + + @Resource + private com.jwsaas.service.food.StoreService storeService; + @Resource + private com.jwsaas.service.food.StoreAccountService storeAccountService; + @Resource + private com.jwsaas.service.food.StoreAccountDetailService storeAccountDetailService; + @Resource + private com.jwsaas.service.food.StoreEnchashmentRecordService storeEnchashmentRecordService; + @Resource + private com.jwsaas.service.food.StoreAccountRechargeParameterService storeAccountRechargeParameterService; + @Resource + private com.jwsaas.service.food.StoreAccountRechargeRecordService storeAccountRechargeRecordService; + + /** + * 获取门店余额账户 + */ + @ServiceMethod(method = "store.account.get", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "获取门店余额账户") + @Override + public Object getStoreAccount(StoreAccountGetRequest request) { + String info = "获取门店余额账户"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Store store = storeService.get(tenantId, storeId); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + StoreAccount storeAccount = storeAccountService.find(tenantId, "storeId", storeId); + if (storeAccount == null) { + // 没有账户的,先创建一个 + storeAccount = new StoreAccount(); + storeAccount.setNo(tenantId + store.getNo());// 编号 + storeAccount.setStoreId(store.getId());// 门店ID + storeAccount.setStoreNo(store.getNo());// 门店编号 + storeAccount.setStatus(1);// 状态(1-正常;2-冻结;) + storeAccount.setPayPwd(null);// 支付密码 + storeAccount.setDescription(null);// 备注 + storeAccount.setAmount(0D);// 余额 + storeAccount.setFreezeAmount(0D);// 冻结余额 + storeAccount.setCreateDate(new Date()); + storeAccount.setCreateUser(Constant.CREATE_USER); + storeAccount = storeAccountService.save(tenantId, storeAccount); + } + + Map data = new HashMap<>(); + data.put("tenantId", store.getTenantId()); + data.put("storeId", storeAccount.getStoreId());// 门店ID + data.put("storeNo", storeAccount.getStoreNo());// 门店编号 + data.put("storeName", store.getName());// 门店名称 + data.put("accountId", storeAccount.getId());// 账户ID + data.put("accountNo", storeAccount.getNo());// 账户编号 + data.put("status", storeAccount.getStatus());// 状态(1-正常;2-冻结;) + data.put("description", storeAccount.getDescription());// 备注 + data.put("amount", new BigDecimal(storeAccount.getAmount()-storeAccount.getFreezeAmount()).setScale(2,BigDecimal.ROUND_UP));// 余额 + data.put("freezeAmount", storeAccount.getFreezeAmount());// 冻结余额 + response.setData(data); + response.setStatus(1); + response.setMessage("获取成功"); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", + request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 获取门店余额账户明细列表 + */ + @ServiceMethod(method = "store.account.detail.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "获取门店余额账户明细列表") + @Override + public Object getStoreAccountDetailList(StoreAccountDetailListRequest request) { + String info = "获取门店余额账户明细列表"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String accountId = request.getAccountId();// 账户ID + String type = request.getType();// 收支类型(1-收入;2-支出;) + String busType = request.getBusType();// 业务类型 + String startTime = request.getStartTime(); + String endTime = request.getEndTime(); + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + if (StringUtils.isBlank(storeId)) { + response.setStatus(0); + response.setMessage("参数storeId不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (StringUtils.isBlank(accountId)) { + response.setStatus(0); + response.setMessage("参数accountId不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + if (pageSize > 100) { + pageSize = 100; + } + +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + StoreAccount storeAccount = storeAccountService.get(tenantId, accountId); + if (storeAccount == null) { + response.setStatus(0); + response.setMessage("门店余额账户不存在"); + response.setErrCode(CommonErrorCode.error26.getCode()); + response.setErrMessage(CommonErrorCode.error26.getMessage()); + return response; + } + + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("accountId", accountId)); + if (StringUtils.isNotBlank(type)) { + criteria.add(Restrictions.eq("type", type)); + } + if (StringUtils.isNotBlank(busType)) { + criteria.add(Restrictions.eq("busType", busType)); + } + if (StringUtils.isNotBlank(startTime)) { + criteria.add(Restrictions.ge("busTime", startTime)); + } + if (StringUtils.isNotBlank(endTime)) { + criteria.add(Restrictions.le("busTime", endTime)); + } + criteria.add(Restrictions.order("createDate", "desc")); + pager = storeAccountDetailService.getPager(tenantId, criteria, pager); + + List> resultDataList = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + Map busTypeMap = new HashMap<>();// 业务类型 + for (StoreAccountBusType tempBusType : StoreAccountBusType.values()) { + busTypeMap.put(tempBusType.getSign(), tempBusType); + } + + List dataList = (List) pager.getList(); + for (StoreAccountDetail data : dataList) { + Map map = new HashMap<>(); + map.put("id", data.getId()); + map.put("tenantId", data.getTenantId()); + // map.put("storeId", data.getStoreId());// 门店ID + // map.put("storeNo", data.getStoreNo());// 门店编号 + map.put("type", data.getType());// 收支类型(1-收入;2-支出;) + map.put("busType", data.getBusType());// 业务类型 + map.put("busTypeName", busTypeMap.get("" + data.getBusType()) == null ? "ERR" + : busTypeMap.get("" + data.getBusType()).getDescription());// 业务类型名称 + map.put("busNo", data.getBusNo());// 业务单号 + map.put("busTime", DateUtils.format(data.getBusTime(), DateUtils.SHOW_DATETIME_FORMAT));// 交易时间 + map.put("payType", data.getPayType());// 支付方式 + map.put("voucherNo", data.getVoucherNo());// 凭证号 + map.put("status", data.getStatus());// 状态 + map.put("amount", doubleFormat(data.getAmount()));// 发生金额 + map.put("aftAmount", doubleFormat(data.getAftAmount()));// 发生后余额 + map.put("workerNo", data.getWorkerNo());// 工号 + map.put("posNo", data.getPosNo());// POS编号/设备编号 + map.put("sourceSign", data.getSourceSign());// 来源标识 + map.put("description", data.getDescription());// 备注 + resultDataList.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(resultDataList); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", + request.getWopRequestContext().getLocale()); + } + + return response; + } + + /** + * 查询门店余额账户明细信息 + */ + @ServiceMethod(method = "store.account.detail.info", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "查询门店余额账户明细信息") + @Override + public Object getStoreAccountDetailInfo(StoreAccountDetailInfoRequest request) { + String info = "查询门店余额账户明细信息"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String detailId = request.getDetailId();// 明细ID + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + StoreAccountDetail detail = storeAccountDetailService.get(tenantId, detailId); + if (detail == null) { + response.setStatus(0); + response.setMessage("明细信息不存在"); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + + Map busTypeMap = new HashMap<>();// 业务类型 + for (StoreAccountBusType tempBusType : StoreAccountBusType.values()) { + busTypeMap.put(tempBusType.getSign(), tempBusType); + } + + Map data = new HashMap<>(); + data.put("tenantId", tenantId); + data.put("id", detail.getId()); + data.put("tenantId", detail.getTenantId()); + // data.put("storeId", detail.getStoreId());// 门店ID + // data.put("storeNo", detail.getStoreNo());// 门店编号 + data.put("type", detail.getType());// 收支类型(1-收入;2-支出;) + data.put("busType", detail.getBusType());// 业务类型 + data.put("busTypeName", busTypeMap.get("" + detail.getBusType()) == null ? "ERR" + : busTypeMap.get("" + detail.getBusType()).getDescription());// 业务类型名称 + data.put("busNo", detail.getBusNo());// 业务单号 + data.put("busTime", DateUtils.format(detail.getBusTime(), DateUtils.SHOW_DATETIME_FORMAT));// 交易时间 + data.put("payType", detail.getPayType());// 支付方式 + data.put("voucherNo", detail.getVoucherNo());// 凭证号 + data.put("status", detail.getStatus());// 状态 + data.put("amount", doubleFormat(detail.getAmount()));// 发生金额 + data.put("aftAmount", doubleFormat(detail.getAftAmount()));// 发生后余额 + data.put("workerNo", detail.getWorkerNo());// 工号 + data.put("posNo", detail.getPosNo());// POS编号/设备编号 + data.put("sourceSign", detail.getSourceSign());// 来源标识 + data.put("description", detail.getDescription());// 备注 + response.setData(data); + response.setStatus(1); + response.setMessage("获取成功"); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", + request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 查询门店余额账户明细信息 + */ + @ServiceMethod(method = "store.account.detail.info2", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "查询门店余额账户明细信息") + @Override + public Object getStoreAccountDetailInfo2(StoreAccountDetailInfoRequest2 request) { + String info = "查询门店余额账户明细信息"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String voucherNo = request.getVoucherNo(); + String detailId = request.getDetailId();// 明细ID + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + if(StringUtils.isBlank(voucherNo) && StringUtils.isNotBlank(detailId)){ + response.setStatus(0); + response.setMessage("voucherNo和detailId不能同时为空"); + response.setErrCode(CommonErrorCode.error21.getCode()); + response.setErrMessage(CommonErrorCode.error21.getMessage()); + return response; + } + + StoreAccountDetail detail = null; + if(StringUtils.isNotBlank(voucherNo)){ + detail = storeAccountDetailService.find(tenantId,"voucherNo", voucherNo); + } + if(StringUtils.isNotBlank(detailId)){ + detail = storeAccountDetailService.get(tenantId, detailId); + } + if (detail == null) { + response.setStatus(0); + response.setMessage("充值明细信息不存在"); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + + Map busTypeMap = new HashMap<>();// 业务类型 + for (StoreAccountBusType tempBusType : StoreAccountBusType.values()) { + busTypeMap.put(tempBusType.getSign(), tempBusType); + } + + Map data = new HashMap<>(); + data.put("tenantId", tenantId); + data.put("id", detail.getId()); + data.put("tenantId", detail.getTenantId()); + // data.put("storeId", detail.getStoreId());// 门店ID + // data.put("storeNo", detail.getStoreNo());// 门店编号 + data.put("type", detail.getType());// 收支类型(1-收入;2-支出;) + data.put("busType", detail.getBusType());// 业务类型 + data.put("busTypeName", busTypeMap.get("" + detail.getBusType()) == null ? "ERR" + : busTypeMap.get("" + detail.getBusType()).getDescription());// 业务类型名称 + data.put("busNo", detail.getBusNo());// 业务单号 + data.put("busTime", DateUtils.format(detail.getBusTime(), DateUtils.SHOW_DATETIME_FORMAT));// 交易时间 + data.put("payType", detail.getPayType());// 支付方式 + data.put("voucherNo", detail.getVoucherNo());// 凭证号 + data.put("status", detail.getStatus());// 状态 + data.put("amount", doubleFormat(detail.getAmount()));// 发生金额 + data.put("aftAmount", doubleFormat(detail.getAftAmount()));// 发生后余额 + data.put("workerNo", detail.getWorkerNo());// 工号 + data.put("posNo", detail.getPosNo());// POS编号/设备编号 + data.put("sourceSign", detail.getSourceSign());// 来源标识 + data.put("description", detail.getDescription());// 备注 + response.setData(data); + response.setStatus(1); + response.setMessage("获取成功"); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", + request.getWopRequestContext().getLocale()); + } + return response; + } + + + /** + * 门店余额账户充值 + */ + @ServiceMethod(method = "store.account.recharge", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店余额账户充值") + @Override + public Object rechargeStoreAccount(StoreAccountRechargeRequest request) { + String info = "门店余额账户充值"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String sourceSign = request.getSourceSign();// 来源标识 + String accountId = request.getAccountId();// 账户ID + Integer busType = request.getBusType();// 业务类型 + String busNo = request.getBusNo();// 业务单号 + String busTime = request.getBusTime();// 交易时间 + Double amount = request.getAmount();// 充值金额 + String payType = request.getPayType();// 支付方式,0-银行卡充值1-支付宝充值2-微信支付充值3-配送扣款4-配送退款 + String voucherNo = request.getVoucherNo();// 凭证号 + String workerNo = request.getWorkerNo();// 操作员工号 + String posNo = request.getPosNo();// 设备编号 + String memo = request.getMemo();// 备注说明 + logger.error(info + " busNo:{} voucherNo:{}"); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + // 需要联调 暂不升级 + String clientSign = "wxyh:recharge:" + busNo; + RMapCache rechargeMap = redissonClient.getMapCache(clientSign); + if (rechargeMap.keySet().size() > 0) { + logger.error(info + " ,tenantId:{} busNo:{}", tenantId, busNo); + response.setStatus(0); + response.setMessage("正在充值中"); + response.setErrCode(CommonErrorCode.error27.getCode()); + response.setErrMessage(CommonErrorCode.error27.getMessage()); + return response; + } + // 十分钟过期 + rechargeMap.put(clientSign, clientSign, 10, TimeUnit.MINUTES); + rechargeMap.expire(10, TimeUnit.MINUTES); + + Map busTypeMap = new HashMap<>();// 业务类型 + for (StoreAccountBusType tempBusType : StoreAccountBusType.values()) { + busTypeMap.put(tempBusType.getSign(), tempBusType); + } + + if (busTypeMap.get("" + busType) == null) { + response.setStatus(0); + response.setMessage("参数busType不正确"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + if (StringUtils.equals("" + busType, StoreAccountBusType.RECHARGE.getSign())) { + if (payType == null) {// 支付方式 + response.setStatus(0); + response.setMessage("充值业务参数payType不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (StringUtils.isBlank(voucherNo)) {// 凭证号 + response.setStatus(0); + response.setMessage("充值业务参数voucherNo不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + } + + Store store = storeService.get(tenantId, storeId); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + StoreAccount storeAccount = storeAccountService.get(tenantId, accountId); + if (storeAccount == null) { + response.setStatus(0); + response.setMessage("门店余额账户不存在"); + response.setErrCode(CommonErrorCode.error26.getCode()); + response.setErrMessage(CommonErrorCode.error26.getMessage()); + return response; + } + + if (!StringUtils.equals(storeAccount.getStoreId(), store.getId())) { + response.setStatus(0); + response.setMessage("信息不一致"); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + + if (amount == null) { + response.setStatus(0); + response.setMessage("参数amount不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + // 查询充值订单状态 + StoreAccountRechargeRecord record = storeAccountRechargeRecordService.find(tenantId,"ticketNo", busNo); + if (null == record) { + logger.error(info+"时发生异常 订单["+busNo+"]不存在"); + response.setStatus(0); + response.setMessage("订单不存在"); + response.setErrCode(CommonErrorCode.error20.getCode()); + response.setErrMessage(CommonErrorCode.error20.getMessage()); + return response; + } + // 校验订单状态 + if (record.getRechargeStatus() == 2) { + // 订单已充值 查询充值详情返回前台 + StoreAccountDetail detail = storeAccountDetailService.find(tenantId, "voucherNo", + record.getPayVoucherNo()); + Map data = new HashMap<>(); + if (null != detail) { + data = JSONUtil.parseObject(JSONUtil.toJSONString(detail), Map.class); + } else { + logger.error(info + " 异常,充值成功 没有查询到充值订单详情 voucherNo:" + voucherNo); + } + response.setStatus(0); + response.setData(data); + response.setMessage("订单已充值"); + response.setErrCode(CommonErrorCode.error22.getCode()); + response.setErrMessage(CommonErrorCode.error22.getMessage()); + return response; + } + + StoreAccountDetail detail = storeAccountDetailService.find(tenantId, "voucherNo", record.getPayVoucherNo()); + if (null != detail) { + Map data = JSONUtil.parseObject(JSONUtil.toJSONString(detail), Map.class); + response.setStatus(0); + response.setData(data); + response.setMessage("订单已充值"); + response.setErrCode(CommonErrorCode.error22.getCode()); + response.setErrMessage(CommonErrorCode.error22.getMessage()); + return response; + } + + detail = new StoreAccountDetail(); + detail.setAccountId(accountId);// 账户ID + detail.setStoreId(storeId);// 门店Id + detail.setStoreNo(store.getNo());// 门店编号 + detail.setType(1);// 收支类型(1-收入;2-支出;) + detail.setBusType(busType);// 业务类型 + detail.setBusNo(busNo);// 业务单号 + detail.setBusTime(DateUtils.parseDate(busTime, DateUtils.SHOW_DATETIME_FORMAT));// 交易时间 + detail.setPayType(payType);// 支付方式,0-银行卡充值1-支付宝充值2-微信支付充值3-配送扣款4-配送退款 + detail.setVoucherNo(record.getPayVoucherNo());// 支付单号 + detail.setStatus(1);// 0-待确认;1-成功;2-失败; + detail.setAmount(amount);// 发生金额 + detail.setAftAmount( + MathUtil.add(new BigDecimal(storeAccount.getAmount()), new BigDecimal(amount)).doubleValue());// 发生后余额 + detail.setWorkerNo(workerNo);// 工号 + detail.setPosNo(posNo);// 设备编号 + detail.setSourceSign(sourceSign);// 来源标识 + detail.setDescription(memo);// 备注 + detail.setCreateUser(Constant.CREATE_USER); + storeAccount = storeAccountService.save4Recharge(tenantId, storeId, accountId, detail); + + Map data = JSONUtil.parseObject(JSONUtil.toJSONString(storeAccount), Map.class); + + // 修改充值订单状态为已支付并且充值 + record.setStatus(2); // 已支付 + record.setRechargeStatus(2);// 已充值 + record.setModifyUser(Constant.CREATE_USER); + storeAccountRechargeRecordService.update(tenantId, record); + + logger.error(info + " ,tenantId:{} busNo:{} 充值成功", tenantId, busNo); + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", + request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 门店余额提现申请 + */ + @ServiceMethod(method = "store.account.enchashment.apply", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店余额提现申请") + @Override + public Object applyStoreAccountEnchashment(StoreAccountEnchashmentApplyRequest request) { + String info = "门店余额提现申请"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String accountId = request.getAccountId();// 账户ID + Double amount = request.getAmount();// 提现金额 + String workerNo = request.getWorkerNo();// 操作员工号 + String sourceSign = request.getSourceSign();// 来源标识 + String memo = request.getMemo();// 备注说明 + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Store store = storeService.get(tenantId, storeId); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + StoreAccount storeAccount = storeAccountService.get(tenantId, accountId); + if (storeAccount == null) { + response.setStatus(0); + response.setMessage("门店余额账户不存在"); + response.setErrCode(CommonErrorCode.error26.getCode()); + response.setErrMessage(CommonErrorCode.error26.getMessage()); + return response; + } + + if (!StringUtils.equals(storeAccount.getStoreId(), store.getId())) { + response.setStatus(0); + response.setMessage("信息不一致"); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + + if (amount == null) { + response.setStatus(0); + response.setMessage("参数amount不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + BigDecimal availableAmount = MathUtil.subtract(new BigDecimal(String.valueOf(storeAccount.getAmount())), + MathUtil.add(new BigDecimal(String.valueOf(storeAccount.getFreezeAmount())), + new BigDecimal(String.valueOf(amount)))); + if (MathUtil.lt(availableAmount, BigDecimal.ZERO)) { + response.setStatus(0); + response.setMessage("门店余额账户可用余额不足"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + StoreEnchashmentRecord record = new StoreEnchashmentRecord(); + record.setStoreId(store.getId()); + record.setStoreNo(store.getNo()); + record.setAccountId(accountId);// 账户ID + record.setBusType(1);// 业务类型(1-提现;) + record.setAmount(amount);// 发生金额 + record.setStatus(0);// 状态(0-待处理;1-已取消;2-已审核/处理中;3-处理成功;4-处理失败;) + record.setApplyWorkerNo(workerNo);// 申请人工号 + record.setApplyDate(new Date()); + record.setSourceSign(sourceSign);// 来源标识 + record.setDescription(memo);// 备注 + record.setCreateDate(new Date()); + record.setCreateUser(Constant.CREATE_USER); + record = storeEnchashmentRecordService.save4Apply(tenantId, record); + + Map data = JSONUtil.parseObject(JSONUtil.toJSONString(record), Map.class); + + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + String error = e.getMessage(); + if (error.contains("余额不足")) { + response.setStatus(0); + response.setMessage("门店余额账户可用余额不足"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", + request.getWopRequestContext().getLocale()); + } + } + return response; + } + + /** + * 取消门店余额提现申请 + */ + @ServiceMethod(method = "store.account.enchashment.cancel", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "取消门店余额提现申请") + @Override + public Object cancelStoreAccountEnchashment(StoreAccountEnchashmentCancelRequest request) { + String info = "取消门店余额提现申请"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String accountId = request.getAccountId();// 账户ID + String recordId = request.getRecordId();// 申请记录ID + String workerNo = request.getWorkerNo();// 操作员工号 + String sourceSign = request.getSourceSign();// 来源标识 + String cancelReason = request.getCancelReason();// 取消原因 + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + StoreAccount storeAccount = storeAccountService.get(tenantId, accountId); + if (storeAccount == null) { + response.setStatus(0); + response.setMessage("门店余额账户不存在"); + response.setErrCode(CommonErrorCode.error26.getCode()); + response.setErrMessage(CommonErrorCode.error26.getMessage()); + return response; + } + + StoreEnchashmentRecord record = storeEnchashmentRecordService.get(tenantId, recordId); + if (record == null) { + response.setStatus(0); + response.setMessage("提现记录不存在"); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + + if (!StringUtils.equals(storeAccount.getId(), record.getAccountId())) { + response.setStatus(0); + response.setMessage("信息不一致"); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + + storeEnchashmentRecordService.update4Cancel(tenantId, accountId, recordId, workerNo, sourceSign, + cancelReason); + + Map data = new HashMap<>(); + response.setData(data); + response.setStatus(1); + response.setMessage("操作成功"); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", + request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 获取门店余额账户提现列表 + */ + @ServiceMethod(method = "store.account.enchashment.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "获取门店余额账户提现列表") + @Override + public Object getStoreAccountEnchashmentList(StoreAccountEnchashmentListRequest request) { + String info = "获取门店余额账户提现列表"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String accountId = request.getAccountId();// 账户ID + String startTime = request.getStartTime(); + String endTime = request.getEndTime(); + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + if (StringUtils.isBlank(storeId)) { + response.setStatus(0); + response.setMessage("参数storeId不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (StringUtils.isBlank(accountId)) { + response.setStatus(0); + response.setMessage("参数accountId不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + if (pageSize > 100) { + pageSize = 100; + } + +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + StoreAccount storeAccount = storeAccountService.get(tenantId, accountId); + if (storeAccount == null) { + response.setStatus(0); + response.setMessage("门店余额账户不存在"); + response.setErrCode(CommonErrorCode.error26.getCode()); + response.setErrMessage(CommonErrorCode.error26.getMessage()); + return response; + } + + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("accountId", accountId)); + if (StringUtils.isNotBlank(startTime) && StringUtils.isNotBlank(endTime)) { + criteria.add(Restrictions.between("createDate", startTime, endTime)); + } + criteria.add(Restrictions.order("createDate", "desc")); + pager = storeEnchashmentRecordService.getPager(tenantId, criteria, pager); + + List> resultDataList = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List dataList = (List) pager.getList(); + for (StoreEnchashmentRecord data : dataList) { + Map map = new HashMap<>(); + map.put("id", data.getId()); + map.put("tenantId", data.getTenantId()); + // map.put("storeId", data.getStoreId());// 门店ID + // map.put("storeNo", data.getStoreNo());// 门店编号 + map.put("accountId", data.getAccountId());// 账户ID + map.put("busType", data.getBusType());// 业务类型 + map.put("amount", doubleFormat(data.getAmount()));// 发生金额 + map.put("status", data.getStatus());// 状态 + map.put("payType", data.getPayType());// 支付方式 + map.put("voucherNo", data.getVoucherNo());// 凭证号 + map.put("aftAmount", doubleFormat(data.getAftAmount()));// 发生后余额 + map.put("applyWorkerNo", data.getApplyWorkerNo());// 申请人工号 + map.put("applyDate", DateUtils.format(data.getApplyDate(), DateUtils.SHOW_DATETIME_FORMAT));// 申请时间 + map.put("description", data.getDescription());// 备注 + map.put("sourceSign", data.getSourceSign());// 来源标识 + map.put("cancelWorkerNo", data.getCancelWorkerNo());// 取消人工号 + map.put("cancelReason", data.getCancelReason());// 取消原因 + map.put("cancelDate", data.getCancelDate() == null ? null + : DateUtils.format(data.getCancelDate(), DateUtils.SHOW_DATETIME_FORMAT));// 取消时间 + map.put("auditWorkerNo", data.getAuditWorkerNo());// 审核人工号 + map.put("auditReason", data.getAuditReason());// 审核原因 + map.put("auditDate", data.getAuditDate() == null ? null + : DateUtils.format(data.getAuditDate(), DateUtils.SHOW_DATETIME_FORMAT));// 审核时间 + map.put("settleWorkerNo", data.getSettleWorkerNo());// 结算人工号 + map.put("settleDate", data.getSettleDate() == null ? null + : DateUtils.format(data.getSettleDate(), DateUtils.SHOW_DATETIME_FORMAT));// 结算时间 + resultDataList.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(resultDataList); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", + request.getWopRequestContext().getLocale()); + } + + return response; + } + + /** + * 查询门店余额账户提现信息详情 + */ + @ServiceMethod(method = "store.account.enchashment.info", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "查询门店余额账户提现信息详情") + @Override + public Object getStoreAccountEnchashmentInfo(StoreAccountEnchashmentInfoRequest request) { + String info = "查询门店余额账户提现信息详情"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String recordId = request.getRecordId();// 申请记录ID + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + StoreEnchashmentRecord record = storeEnchashmentRecordService.get(tenantId, recordId); + if (record == null) { + response.setStatus(0); + response.setMessage("提现记录不存在"); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + + Map busTypeMap = new HashMap<>();// 业务类型 + for (StoreAccountBusType tempBusType : StoreAccountBusType.values()) { + busTypeMap.put(tempBusType.getSign(), tempBusType); + } + + Map data = new HashMap<>(); + data.put("id", record.getId()); + data.put("tenantId", record.getTenantId()); + // data.put("storeId", record.getStoreId());// 门店ID + // data.put("storeNo", record.getStoreNo());// 门店编号 + data.put("accountId", record.getAccountId());// 账户ID + data.put("busType", record.getBusType());// 业务类型 + data.put("amount", doubleFormat(record.getAmount()));// 发生金额 + data.put("status", record.getStatus());// 状态 + data.put("payType", record.getPayType());// 支付方式 + data.put("voucherNo", record.getVoucherNo());// 凭证号 + data.put("aftAmount", doubleFormat(record.getAftAmount()));// 发生后余额 + data.put("applyWorkerNo", record.getApplyWorkerNo());// 申请人工号 + data.put("applyDate", DateUtils.format(record.getApplyDate(), DateUtils.SHOW_DATETIME_FORMAT));// 申请时间 + data.put("description", record.getDescription());// 备注 + data.put("sourceSign", record.getSourceSign());// 来源标识 + data.put("cancelWorkerNo", record.getCancelWorkerNo());// 取消人工号 + data.put("cancelReason", record.getCancelReason());// 取消原因 + data.put("cancelDate", record.getCancelDate() == null ? null + : DateUtils.format(record.getCancelDate(), DateUtils.SHOW_DATETIME_FORMAT));// 取消时间 + data.put("auditWorkerNo", record.getAuditWorkerNo());// 审核人工号 + data.put("auditReason", record.getAuditReason());// 审核原因 + data.put("auditDate", record.getAuditDate() == null ? null + : DateUtils.format(record.getAuditDate(), DateUtils.SHOW_DATETIME_FORMAT));// 审核时间 + data.put("settleWorkerNo", record.getSettleWorkerNo());// 结算人工号 + data.put("settleDate", record.getSettleDate() == null ? null + : DateUtils.format(record.getSettleDate(), DateUtils.SHOW_DATETIME_FORMAT));// 结算时间 + response.setData(data); + response.setStatus(1); + response.setMessage("获取成功"); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", + request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 获取门店账户充值参数 + */ + @ServiceMethod(method = "store.account.recharge.parameter", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "获取门店账户充值参数") + @Override + public Object getStoreAccountRechargeParameter(StoreAccountRechargeParameterRequest request) { + String info = "获取门店账户充值参数"; + logger.info("info:" + info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("enabled", 1)); + List dataList = storeAccountRechargeParameterService.getList(tenantId, + criteria); + if (CollectionUtils.isEmpty(dataList)) { + response.setStatus(0); + response.setMessage("尚未配置充值参数"); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + if (dataList.size() > 1) { + response.setStatus(0); + response.setMessage("充值参数不唯一"); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + + Map dataMap = null; + for (StoreAccountRechargeParameter data : dataList) { + dataMap = new HashMap<>(); + dataMap.put("tenantId", data.getTenantId()); + dataMap.put("id", data.getId()); + dataMap.put("no", data.getNo());// 编号 + dataMap.put("name", data.getName());// 方案名称 + dataMap.put("sign", data.getSign());// 支付类型 + dataMap.put("pbody", data.getPbody());// 支付参数 + // dataMap.put("enabled", data.getEnabled());// 是否启用 + dataMap.put("certText", data.getCertText());// 证书内容 + } + + response.setStatus(1); + response.setMessage("获取成功"); + response.setData(dataMap); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", + request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 门店余额账户充值,微信统一下单 启用微信支付异步通知充值 + */ + @ServiceMethod(method = "store.account.recharge.wxpay.unifiedorder", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店余额账户充值,微信统一下单") + @Override + public Object storeAccountRechargeWeixinPayUnifiedorder(StoreAccountRechargeWeixinPayUnifiedorderRequest request) { + String info = "门店余额账户充值,微信统一下单"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String sourceSign = request.getSourceSign();// 来源标识 + String appId = request.getAppid();// + String openId = request.getOpenId();// 来源标识 + String accountId = request.getAccountId();// 账户ID + Double amount = request.getAmount();// 充值金额 + String ip = request.getIp(); + String tradeNo = request.getTradeNo(); + String workerNo = request.getWorkerNo();// 操作员工号 + String posNo = request.getPosNo();// 设备编号 + String memo = request.getMemo();// 备注说明 + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Store store = storeService.get(tenantId, storeId); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + StoreAccount storeAccount = storeAccountService.get(tenantId, accountId); + if (storeAccount == null) { + response.setStatus(0); + response.setMessage("门店余额账户不存在"); + response.setErrCode(CommonErrorCode.error26.getCode()); + response.setErrMessage(CommonErrorCode.error26.getMessage()); + return response; + } + + if (!StringUtils.equals(storeAccount.getStoreId(), store.getId())) { + response.setStatus(0); + response.setMessage("信息不一致"); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + + if (amount == null) { + response.setStatus(0); + response.setMessage("参数amount不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + BigDecimal payAmount = new BigDecimal(String.valueOf(amount)); + if (payAmount.compareTo(BigDecimal.ZERO) <= 0) { + response.setStatus(0); + response.setMessage("支付金额非法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + // 校验充值单号是否已存在 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketNo", tradeNo)); + List records = storeAccountRechargeRecordService.getList(tenantId, criteria); + if (CollectionUtils.isNotEmpty(records)) { + response.setStatus(0); + response.setMessage("充值单号已存在"); + response.setErrCode(CommonErrorCode.error20.getCode()); + response.setErrMessage(CommonErrorCode.error20.getMessage()); + return response; + } + + // 检验支付参数 + criteria = new Criteria(); + criteria.add(Restrictions.eq("enabled", 1)); + List dataList = storeAccountRechargeParameterService.getList(tenantId, + criteria); + if (CollectionUtils.isEmpty(dataList)) { + response.setStatus(0); + response.setMessage("尚未配置充值参数"); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + if (dataList.size() > 1) { + response.setStatus(0); + response.setMessage("充值参数不唯一"); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + + // 支付参数 + Map payMap = new HashMap<>(); + Map payParam = new HashMap<>(); + for (StoreAccountRechargeParameter data : dataList) { + payMap.put("tenantId", data.getTenantId()); + payMap.put("id", data.getId()); + payMap.put("no", data.getNo());// 编号 + payMap.put("name", data.getName());// 方案名称 + payMap.put("sign", data.getSign());// 支付类型 + payMap.put("pbody", data.getPbody());// 支付参数 + payParam = JSONUtil.parseObject(data.getPbody(), Map.class); + // dataMap.put("enabled", data.getEnabled());// 是否启用 + payMap.put("certText", data.getCertText());// 证书内容 + } + logger.info(info + " 支付参数 payParam:" + JSONUtil.toJSONString(payParam)); + Map data = new HashMap<>(); + + if("wxpay".equals(payMap.get("sign"))||"subwxpay".equals(payMap.get("sign"))){ + UnifiedOrderRequest unifiedOrderRequest = new UnifiedOrderRequest(); + if (StringUtils.isNotBlank(payParam.get("submchid").toString())) { + unifiedOrderRequest.setAppid(payParam.get("appid").toString());// 微信分配的公众账号ID + unifiedOrderRequest.setMchId(payParam.get("mchid").toString());// 微信支付分配的商户号 + unifiedOrderRequest.setSubAppid(appId); // 小程序appId + unifiedOrderRequest.setSubMchId(payParam.get("submchid").toString());// 微信支付分配的子商户号 + unifiedOrderRequest.setSubOpenid(openId);// 小程序openId + } else { + unifiedOrderRequest.setAppid(appId); // 小程序appId + unifiedOrderRequest.setOpenid(openId);// 小程序openId + unifiedOrderRequest.setMchId(payParam.get("mchid").toString());// 微信支付分配的商户号 + } + String secret = payParam.get("appsecret").toString(); + + unifiedOrderRequest.setDeviceInfo("WEB"); + unifiedOrderRequest.setNonceStr(RandomUtils.generateString(32)); + + String detail = store.getName() + "-云管家-账户余额充值微信支付"; + String outTradeNo = store.getNo() + "_" + tradeNo; + + JSONObject attatch = new JSONObject(); + attatch.put("tenantId", tenantId); + attatch.put("tradeNo", tradeNo); + unifiedOrderRequest.setAttach(attatch.toJSONString()); + unifiedOrderRequest.setBody(detail); + unifiedOrderRequest.setDetail(detail); + unifiedOrderRequest.setTimeStart(DateUtils.format(new Date(), "yyyyMMddHHmmss")); + unifiedOrderRequest.setOutTradeNo(outTradeNo); + unifiedOrderRequest.setFeeType("CNY"); + // 支付金额 + BigDecimal fee = new BigDecimal(amount); + long totalFee = fee.multiply(new BigDecimal(100)).longValue(); + unifiedOrderRequest.setTotalFee(totalFee); + + unifiedOrderRequest.setSpbillCreateIp(ip); + // 异步通知地址 + unifiedOrderRequest.setNotifyUrl(wxyhProperties.getApiUrl() + "/weixinnotify"); + unifiedOrderRequest.setTradeType("JSAPI"); + unifiedOrderRequest.setLimitPay("no_credit"); + unifiedOrderRequest.setProductId("999999"); + + String sign = SecurityUtils.sign(secret, unifiedOrderRequest); + unifiedOrderRequest.setSign(sign); + + logger.info("微信下单请求 unifiedOrderRequest:{}", unifiedOrderRequest); + WeiXinPayApi payService = new WeiXinPayApi(); + UnifiedOrderResponse unifiedOrderResponse = payService.unifiedOrder(unifiedOrderRequest); + logger.info("微信下单结果 unifiedOrderResponse {}", unifiedOrderResponse); + + + if ("SUCCESS".equals(unifiedOrderResponse.getResultCode())) { + data.put("appId", appId); + data.put("timeStamp", String.valueOf(System.currentTimeMillis() / 1000)); + data.put("nonceStr", RandomUtils.generateString(32)); + data.put("package", "prepay_id=" + unifiedOrderResponse.getPrepayId()); + data.put("signType", "MD5"); + // MD5加密 + String paySign = genWithAmple(data, secret); + data.put("paySign", paySign); + + data.put("outTradeNo", outTradeNo); + + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + + // 记录账户余额充值订单 + StoreAccountRechargeRecord record = new StoreAccountRechargeRecord(); + record.setStoreId(storeId); + record.setStoreNo(store.getNo());// 门店编号 + record.setAccountId(accountId);// 账户ID + record.setSourceSign(sourceSign);// 来源标识 + record.setTicketNo(tradeNo);// 单据编号 + record.setAmount(amount);// 金额 + record.setStatus(0);// 状态 0-待支付;1-支付失败;2-支付成功; + record.setRechargeStatus(0);// 充值状态 0-待处理;1-充值失败;2-充值成功; + record.setDescription("统一下单成功 tradeNo:" + tradeNo + " prepayId:" + unifiedOrderResponse.getPrepayId());// 备注 + record.setPayType(4);// 支付方式 1-现金;2-银行转账;3-支付宝;4-微信;99-其他; + record.setPayVoucherNo(unifiedOrderResponse.getPrepayId());//支付凭证号 + record.setPayDate(new Date());// 支付时间 + record.setPayAccount("");// 支付账号 + record.setTitle(detail);// 订单标题 + + Map conten = new HashMap(); + conten.put("workerNo", workerNo); + conten.put("sourceSign", sourceSign); + conten.put("payNo", outTradeNo); + record.setContent(JSONUtil.toJSONString(conten));// 订单内容 + + record.setDeviceInfo("WEB");// 设备信息 + record.setAttach(attatch.toJSONString());// 附加信息 + record.setReqStr(JSONUtil.toJSONString(unifiedOrderRequest));// 请求信息 + record.setRespStr(JSONUtil.toJSONString(unifiedOrderResponse));// 请求响应信息 + record.setCreateUser(workerNo); + storeAccountRechargeRecordService.save(tenantId, record); + } else { + response.setStatus(0); + response.setMessage(unifiedOrderResponse.getReturnMsg()); + } + // 统一下单结束 在充值订单中记录统一下单结果 + }else if("saobei".equals(payMap.get("sign"))){ + + String payMode = "saobei"; + Map paramMap = new LinkedHashMap<>(); + paramMap.put("pay_ver","100"); + paramMap.put("pay_type","010"); + paramMap.put("service_id","015"); + paramMap.put("merchant_no",payParam.get("merchant_no").toString()); + paramMap.put("terminal_id",payParam.get("terminal_id").toString()); + paramMap.put("terminal_trace",tradeNo); + paramMap.put("terminal_time", com.jwsaas.util.DateUtils.format(new Date(), "yyyyMMddHHmmss")); + String total_fee_int = new BigDecimal(amount).multiply(new BigDecimal(100)).intValue()+""; + paramMap.put("total_fee",total_fee_int); + + //String paraStrs = SignUtil.getSignCheckContent(paramMap); + String signKey = "&access_token="+(payParam.get("signKey").toString()); + String sign = SignUtil.createSign(paramMap,signKey); + paramMap.put("sub_appid",appId); + paramMap.put("open_id",openId); + paramMap.put("order_body","扫呗支付"); + paramMap.put("notify_url",wxyhProperties.getApiUrl() + "/saobeistoreaccountrechargenotify"); + paramMap.put("attach",tenantId+"_"+storeId+"_"+tradeNo); + paramMap.put("key_sign",sign); + HttpResponse httpResponse = HttpTool.url(payParam.get("gatewayUrl").toString()+"/pay/100/minipay").contentType("application/json").body(JSON.toJSONString(paramMap)).post(); + String content = HttpTool.getResponseAsString(httpResponse); + JSONObject jsonObject = JSON.parseObject(content); + if (StringUtils.isNotBlank(jsonObject.getString("return_code")) && "01".equals(jsonObject.getString("return_code"))) { + if(StringUtils.isNotBlank(jsonObject.getString("result_code")) && "01".equals(jsonObject.getString("result_code"))){ + data.put("appId", jsonObject.getString("appId")); + data.put("timeStamp", jsonObject.getString("timeStamp")); + data.put("nonceStr", jsonObject.getString("nonceStr")); + data.put("package", jsonObject.getString("package_str")); + data.put("signType", jsonObject.getString("signType")); + data.put("paySign", jsonObject.getString("paySign")); + data.put("out_trade_no", jsonObject.getString("out_trade_no")); + data.put("payMode",payMode); + + String detail = store.getName() + "-云管家-账户余额充值微信支付"; + String outTradeNo = store.getNo() + "_" + tradeNo; + data.put("outTradeNo", outTradeNo); + + // 记录账户余额充值订单 + StoreAccountRechargeRecord record = new StoreAccountRechargeRecord(); + record.setStoreId(storeId); + record.setStoreNo(store.getNo());// 门店编号 + record.setAccountId(accountId);// 账户ID + record.setSourceSign(sourceSign);// 来源标识 + record.setTicketNo(tradeNo);// 单据编号 + record.setAmount(amount);// 金额 + record.setStatus(0);// 状态 0-待支付;1-支付失败;2-支付成功; + record.setRechargeStatus(0);// 充值状态 0-待处理;1-充值失败;2-充值成功; + record.setDescription("统一下单成功 tradeNo:" + tradeNo + " prepayId:" + jsonObject.getString("package_str"));// 备注 + record.setPayType(4);// 支付方式 1-现金;2-银行转账;3-支付宝;4-微信;99-其他; + record.setPayVoucherNo(jsonObject.getString("out_trade_no"));//支付凭证号 + record.setPayDate(new Date());// 支付时间 + record.setPayAccount("");// 支付账号 + record.setTitle(detail);// 订单标题 + + Map conten = new HashMap(); + conten.put("workerNo", workerNo); + conten.put("sourceSign", sourceSign); + conten.put("payNo", outTradeNo); + record.setContent(JSONUtil.toJSONString(conten));// 订单内容 + + record.setDeviceInfo("WEB");// 设备信息 + record.setAttach(JSON.toJSONString(tenantId+"_"+storeId+"_"+tradeNo));// 附加信息 + record.setReqStr(JSONUtil.toJSONString(paramMap));// 请求信息 + record.setRespStr(JSONUtil.toJSONString(jsonObject));// 请求响应信息 + record.setCreateUser(workerNo); + storeAccountRechargeRecordService.save(tenantId, record); + + + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + }else{ + response.setStatus(0); + response.setMessage(jsonObject.getString("return_msg")); + } + }else{ + response.setStatus(0); + response.setMessage(jsonObject.getString("return_msg")); + } + } + + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", + request.getWopRequestContext().getLocale()); + } + return response; + } + + public String genWithAmple(Map params, String key) { + StringBuffer sb = new StringBuffer(); + for (String paramKey : params.keySet()) { + sb.append(paramKey + "=" + params.get(paramKey) + ","); + } + String result = sb.toString(); + result = result.substring(0, result.length() - 1); + return genWithAmple(result.split(","), key); + } + + private String genWithAmple(String[] arr, String key) { + Arrays.sort(arr); + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < arr.length; i++) { + String a = arr[i]; + sb.append(a); + if (i != arr.length - 1) { + sb.append('&'); + } + } + if (StringUtils.isNotEmpty(key)) { + sb.append("&key="); + sb.append(key); + } + return DigestUtils.MD5(sb.toString()).toUpperCase(); + } + + /** + * 门店余额账户充值,微信查询订单 + */ + @ServiceMethod(method = "store.account.recharge.wxpay.orderquery", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店余额账户充值,微信查询订单") + @Override + public Object storeAccountRechargeWeixinPayOrderQuery(StoreAccountRechargeWeixinPayOrderQueryRequest request) { + String info = "门店余额账户充值,微信查询订单"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String tradeNo = request.getTradeNo(); + String appId = request.getAppid();// + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + // 检验支付参数 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("enabled", 1)); + List dataList = storeAccountRechargeParameterService.getList(tenantId, + criteria); + if (CollectionUtils.isEmpty(dataList)) { + response.setStatus(0); + response.setMessage("尚未配置充值参数"); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + if (dataList.size() > 1) { + response.setStatus(0); + response.setMessage("充值参数不唯一"); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + // 支付参数 + Map payMap = new HashMap<>(); + Map payParam = new HashMap<>(); + for (StoreAccountRechargeParameter data : dataList) { + payMap.put("tenantId", data.getTenantId()); + payMap.put("id", data.getId()); + payMap.put("no", data.getNo());// 编号 + payMap.put("name", data.getName());// 方案名称 + payMap.put("sign", data.getSign());// 支付类型 + payMap.put("pbody", data.getPbody());// 支付参数 + payParam = JSONUtil.parseObject(data.getPbody(), Map.class); + // dataMap.put("enabled", data.getEnabled());// 是否启用 + payMap.put("certText", data.getCertText());// 证书内容 + } + logger.info(info + " 支付参数 payParam:" + JSONUtil.toJSONString(payParam)); + + QueryOrderRequest queryOrderRequest = new QueryOrderRequest(); + queryOrderRequest.setAppid(payParam.get("appid").toString());// 微信分配的公众账号ID + queryOrderRequest.setMchId(payParam.get("mchid").toString());// 微信支付分配的商户号 + String secret = payParam.get("appsecret").toString(); + // 如果是子商户发起的支付 配置子商户商户号和发起支付的小程序appId + if (StringUtils.isNotBlank(payParam.get("submchid").toString())) { + queryOrderRequest.setSubAppid(appId); + queryOrderRequest.setSubMchId(payParam.get("submchid").toString());// 微信支付分配的子商户号 + } + queryOrderRequest.setNonceStr(RandomUtils.generateString(32)); + queryOrderRequest.setOutTradeNo(tradeNo); + String sign = SecurityUtils.sign(secret, queryOrderRequest); + queryOrderRequest.setSign(sign); + + // 查询是否已支付 + WeiXinPayApi payService = new WeiXinPayApi(); + QueryOrderResponse queryOrderResponse = payService.queryOrder(queryOrderRequest); + + logger.info(info + "queryOrderResponse {}", JSON.toJSONString(queryOrderResponse)); + String resutlCode = queryOrderResponse.getResultCode(); + String returnCode = queryOrderResponse.getReturnCode(); + String tradeState = queryOrderResponse.getTradeState(); + Map data = new HashMap(); + if ("SUCCESS".equals(resutlCode) && "SUCCESS".equals(returnCode) && "SUCCESS".equals(tradeState)) { + data.put("status", 1); + data.put("message", ""); + data.put("tradeNo", queryOrderResponse.getOutTradeNo()); + data.put("prepayId", queryOrderResponse.getTransactionId()); + } else { + data.put("status", 0); + data.put("message", queryOrderResponse.getReturnMsg()); + logger.error(info + " 失败" + queryOrderResponse.getReturnMsg()); + } + + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", + request.getWopRequestContext().getLocale()); + } + return response; + } + + + /** + * 门店余额账户充值,微信查询订单 + * busNo:业务订单号 + */ + @ServiceMethod(method = "store.account.recharge.wxpay.orderquery2", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店余额账户充值,微信查询订单2") + @Override + public Object storeAccountRechargeWeixinPayOrderQuery2(StoreAccountRechargeWeixinPayOrderQueryRequest2 request) { + String info = "门店余额账户充值,微信查询订单2"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String outTradeNo = request.getOutTradeNo(); + String tradeNo = request.getTradeNo(); + String appId = request.getAppid();// + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + // 检验支付参数 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("enabled", 1)); + List dataList = storeAccountRechargeParameterService.getList(tenantId, + criteria); + if (CollectionUtils.isEmpty(dataList)) { + response.setStatus(0); + response.setMessage("尚未配置充值参数"); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + if (dataList.size() > 1) { + response.setStatus(0); + response.setMessage("充值参数不唯一"); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + // 支付参数 + Map payMap = new HashMap<>(); + Map payParam = new HashMap<>(); + for (StoreAccountRechargeParameter data : dataList) { + payMap.put("tenantId", data.getTenantId()); + payMap.put("id", data.getId()); + payMap.put("no", data.getNo());// 编号 + payMap.put("name", data.getName());// 方案名称 + payMap.put("sign", data.getSign());// 支付类型 + payMap.put("pbody", data.getPbody());// 支付参数 + payParam = JSONUtil.parseObject(data.getPbody(), Map.class); + // dataMap.put("enabled", data.getEnabled());// 是否启用 + payMap.put("certText", data.getCertText());// 证书内容 + } + logger.info(info + " 支付参数 payParam:" + JSONUtil.toJSONString(payParam)); + Map data = new HashMap(); + + if("wxpay".equals(payMap.get("sign"))||"subwxpay".equals(payMap.get("sign"))){ + QueryOrderRequest queryOrderRequest = new QueryOrderRequest(); + queryOrderRequest.setAppid(payParam.get("appid").toString());// 微信分配的公众账号ID + queryOrderRequest.setMchId(payParam.get("mchid").toString());// 微信支付分配的商户号 + String secret = payParam.get("appsecret").toString(); + // 如果是子商户发起的支付 配置子商户商户号和发起支付的小程序appId + if(StringUtils.isNotBlank(payParam.get("submchid").toString())){ + queryOrderRequest.setSubAppid(appId); + queryOrderRequest.setSubMchId(payParam.get("submchid").toString());// 微信支付分配的子商户号 + } + queryOrderRequest.setNonceStr(RandomUtils.generateString(32)); + queryOrderRequest.setOutTradeNo(outTradeNo); + String sign = SecurityUtils.sign(secret, queryOrderRequest); + queryOrderRequest.setSign(sign); + + // 查询是否已支付 + WeiXinPayApi payService = new WeiXinPayApi(); + QueryOrderResponse queryOrderResponse = payService.queryOrder(queryOrderRequest); + + logger.info(info + "queryOrderResponse {}", JSON.toJSONString(queryOrderResponse)); + String resutlCode = queryOrderResponse.getResultCode(); + String returnCode = queryOrderResponse.getReturnCode(); + String tradeState = queryOrderResponse.getTradeState(); + + if ("SUCCESS".equals(resutlCode) && "SUCCESS".equals(returnCode) && "SUCCESS".equals(tradeState)) { + // 更新充值记录 + StoreAccountRechargeRecord record = storeAccountRechargeRecordService.find(tenantId,"ticketNo", tradeNo); + if(null == record){ + response.setStatus(0); + response.setMessage("订单号"+tradeNo+"不存在"); + response.setErrCode(CommonErrorCode.error21.getCode()); + response.setErrMessage(CommonErrorCode.error21.getMessage()); + return response; + } + record.setPayVoucherNo(queryOrderResponse.getTransactionId()); + record.setModifyUser(record.getCreateUser()); + storeAccountRechargeRecordService.update(tenantId, record); + + data.put("status", 1); + data.put("message", ""); + data.put("tradeNo", queryOrderResponse.getOutTradeNo()); + data.put("prepayId", queryOrderResponse.getTransactionId()); + } else { + data.put("status", 0); + data.put("message", queryOrderResponse.getReturnMsg()); + logger.error(info + " 失败" + queryOrderResponse.getReturnMsg()); + } + }else if("saobei".equals(payMap.get("sign"))){ + String payMode = "saobei"; + if(StringUtils.isNotEmpty(outTradeNo)){ + //WeixinOrderPay order = weixinOrderPayService.find(tenantId,"orderNo",tradeNo); + HashMap paramMap = new LinkedHashMap<>(); + paramMap.put("pay_ver","100"); + paramMap.put("pay_type","010"); + paramMap.put("service_id","020"); + paramMap.put("merchant_no",payParam.get("merchant_no").toString()); + paramMap.put("terminal_id",payParam.get("terminal_id").toString()); + paramMap.put("terminal_trace",tradeNo); + paramMap.put("terminal_time", com.jwsaas.util.DateUtils.format(new Date(), "yyyyMMddHHmmss")); + paramMap.put("out_trade_no",outTradeNo); + String signKey = "&access_token="+payParam.get("signKey").toString(); + String sign = SignUtil.createSign(paramMap,signKey); + paramMap.put("pay_trace",""); + paramMap.put("pay_time", com.jwsaas.util.DateUtils.format(new Date(), "yyyyMMddHHmmss")); + paramMap.put("key_sign",sign); + HttpResponse httpResponse = HttpTool.url(payParam.get("gatewayUrl").toString()+"/pay/100/query").contentType("application/json").body(JSON.toJSONString(paramMap)).post(); + String content = HttpTool.getResponseAsString(httpResponse); + JSONObject jsonObject = JSON.parseObject(content); + if (StringUtils.isNotBlank(jsonObject.getString("return_code")) && "01".equals(jsonObject.getString("return_code"))) { + if("01".equals(jsonObject.getString("result_code"))){ + if(StringUtils.isNotBlank(jsonObject.getString("trade_state")) && "SUCCESS".equals(jsonObject.getString("trade_state"))){ + data.put("status", 1); + data.put("message", ""); + data.put("tradeNo", jsonObject.getString("terminal_trace")); + data.put("prepayId", jsonObject.getString("out_trade_no")); + data.put("payMode",payMode); + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + }else{ + response.setStatus(0); + response.setMessage(jsonObject.getString("return_msg")); + } + }else{ + response.setStatus(0); + response.setMessage(jsonObject.getString("return_msg")); + } + }else{ + response.setStatus(0); + response.setMessage(jsonObject.getString("return_msg")); + } + }else{ + response.setStatus(0); + response.setMessage("参数错误"); + } + } + + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", + request.getWopRequestContext().getLocale()); + } + return response; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/store/StoreAdjustPriceServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/store/StoreAdjustPriceServiceImpl.java new file mode 100644 index 0000000..fa2d88c --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/store/StoreAdjustPriceServiceImpl.java @@ -0,0 +1,785 @@ +package com.jwsaas.api.service.impl.store; + + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.fasterxml.jackson.core.type.TypeReference; +import com.jwsaas.Constant; +import com.jwsaas.api.request.store.AdjustPriceDetailRequest; +import com.jwsaas.api.request.store.AdjustPriceTicketAddRequest; +import com.jwsaas.api.request.store.AdjustPriceTicketAuditRequest; +import com.jwsaas.api.request.store.AdjustPriceTicketEditRequest; +import com.jwsaas.api.request.store.AdjustPriceTicketRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.response.mode.CommonPagerResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.store.StoreAdjustPriceService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.AdjustPriceProduct; +import com.jwsaas.entity.food.AdjustPriceStore; +import com.jwsaas.entity.food.AdjustPriceTicket; +import com.jwsaas.entity.food.Store; +import com.jwsaas.entity.food.StoreProduct; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.pager.Pager; +import com.jwsaas.util.DateUtils; +import com.jwsaas.util.JSONUtil; +import com.jwsaas.utils.AppKeyUtil; + +import freemarker.template.SimpleDate; + + + +@ServiceMethodBean(version = "1.0") +public class StoreAdjustPriceServiceImpl extends WopServiceImpl implements StoreAdjustPriceService { + + private static final long serialVersionUID = -1605461072453112374L; + + @Resource + private com.jwsaas.service.food.StoreService storeService; + + @Resource + private com.jwsaas.service.food.AdjustPriceProductService adjustPriceProductService; + + @Resource + private com.jwsaas.service.food.AdjustPriceTicketService adjustPriceTicketService; + + @Resource + private com.jwsaas.service.food.AdjustPriceStoreService adjustPriceStoreService; + + @Resource + private com.jwsaas.service.food.StoreProductService storeProductService; + + @ServiceMethod(method = "store.adjustPrice.ticket", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店调价单信息") + @Override + public Object adjustPriceTicket(AdjustPriceTicketRequest request) { + String info = "门店调价单"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + Integer status = request.getStatus();// 单据状态 + String storeId = request.getStoreId(); + String no = request.getNo();// 单号 + String startTime = request.getStartTime();// 开始时间 + String endTime = request.getEndTime();// 结束时间 + + logger.info(info+" storeId:"+storeId+" no:"+no); + + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + if (StringUtils.isNotEmpty(no)) { + // 单据编号 + criteria.add(Restrictions.eq("apt.no", no)); + } + if (StringUtils.isNotEmpty(startTime)) { + // 开始时间 + criteria.add(Restrictions.ge("apt.createDate", startTime)); + } + if (StringUtils.isNotEmpty(endTime)) { + // 结束时间 + criteria.add(Restrictions.le("apt.createDate", endTime)); + } + if (null != status && status > -1) { + // 单据状态 + criteria.add(Restrictions.eq("apt.status", status)); + } + criteria.add(Restrictions.eq("aps.storeId", request.getStoreId())); + criteria.add(Restrictions.order("aps.createDate", "desc")); + + pager = adjustPriceTicketService.getPagerByStoreId(tenantId, criteria, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + list = (List>) pager.getList(); + for(Map map :list){ + String createDate = ""; + if(null != map.get("createDate") && StringUtils.isNotBlank(map.get("createDate").toString())){ + Date date = sdf.parse(map.get("createDate").toString()); + createDate = DateUtils.format(date, DateUtils.SHOW_DATETIME_FORMAT); + } + map.put("createDate", createDate); + String effectDate = ""; + if(null != map.get("effectDate") && StringUtils.isNotBlank(map.get("effectDate").toString())){ + Date date = sdf.parse(map.get("effectDate").toString()); + effectDate = DateUtils.format(date, DateUtils.SHOW_DATETIME_FORMAT); + } + map.put("effectDate", effectDate); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "STORE_ADJUSTPRICE_TICKET_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /*** + * 调价单明细 + */ + @ServiceMethod(method = "store.adjustPrice.detail", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "调价单明细") + @Override + public Object adjustPriceDetail(AdjustPriceDetailRequest request) { + String info = "调价单明细"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + String storeId = request.getStoreId(); + String ticketId = request.getTicketId();// 要货单ID + + logger.info(info+" storeId:"+storeId+" ticketId:"+ticketId); + + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + if (StringUtils.isBlank(ticketId)) { + response.setStatus(0); + response.setMessage("参数ticketId不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketId", ticketId)); + criteria.add(Restrictions.order("productNo", "asc")); + pager = adjustPriceProductService.getPagerExtend(tenantId, criteria, pager); + + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (AdjustPriceProduct product : source) { + Map map = new HashMap<>(); + map.put("tenantId", product.getTenantId()); + map.put("id", product.getId()); + map.put("ticketId", product.getTicketId()); + map.put("ticketNo", product.getTicketNo()); + map.put("productId", product.getProductId()); + map.put("productNo", product.getProductNo()); + map.put("productName", product.getProductName()); + map.put("specId", product.getSpecId()); + map.put("specName", product.getSpecName()); + map.put("oldPrice", product.getOldPrice()); + map.put("oldMinPrice", product.getOldMinPrice()); + map.put("oldMemberPrice", product.getOldMemberPrice()); + map.put("oldOtherPrice", product.getOldOtherPrice()); + map.put("price", product.getPrice()); + map.put("minPrice", product.getMinPrice()); + map.put("memberPrice", product.getMemberPrice()); + map.put("otherPrice", product.getOtherPrice()); + list.add(map); + } + } + + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "STORE_ADJUSTPRICE_DETAIL_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /*** + * 新增门店调价单 + */ + @ServiceMethod(method = "store.adjustPrice.add", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "新增门店调价单") + @Override + public Object adjustPriceTicketAdd(AdjustPriceTicketAddRequest request) { + String info = "新增门店调价单"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId();// 门店ID + String no = request.getNo();// 调价单号 + String effectString = request.getEffectDate();// 生效时间 + String workerNo = request.getWorkerNo(); + String description = request.getDescription(); + String storeString = request.getStoreString(); + String productString = request.getProductString(); + + logger.info(info+" storeId:"+storeId+" no:"+no+" workerNo:"+workerNo); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + // 世界茶饮 和 南鸭榜 暂不开通调价权限 + if(StringUtils.equals(tenantId, "210008") || StringUtils.equals(tenantId, "771028")){ + response.setStatus(0); + response.setMessage("抱歉,未开通此服务"); + response.setErrCode(CommonErrorCode.error9.getCode()); + response.setErrMessage(CommonErrorCode.error9.getMessage()); + return response; + } + +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + AdjustPriceTicket ticket = new AdjustPriceTicket(); + if (StringUtils.isEmpty(no)) { + response.setStatus(0); + response.setMessage("调价单号不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (StringUtils.isEmpty(no) || no.length() > 32) { + response.setStatus(0); + response.setMessage("调价单号参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ticket.setNo(no); + + if(StringUtils.isBlank(effectString)){ + response.setStatus(0); + response.setMessage("生效时间不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + Date effectDate = DateUtils.parseDate(effectString, "yyyy-MM-dd HH:mm:ss"); + ticket.setEffectDate(effectDate); + ticket.setDescription(description); + ticket.setCreateUser(workerNo); + + List ticketList = adjustPriceTicketService.findList(tenantId, "no", ticket.getNo()); + if (CollectionUtils.isNotEmpty(ticketList)) { + response.setStatus(0); + response.setMessage("调价单单据号已存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + //调价门店 + if (StringUtils.isBlank(storeString)) { + response.setStatus(0); + response.setMessage("门店信息不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + List storeList = new ArrayList(); + JSONArray storeArray = JSONArray.parseArray(storeString); + for (int i = 0; i < storeArray.size(); i++) { + AdjustPriceStore adStore = JSONUtil.parseObject(storeArray.get(i).toString(), new TypeReference() {}); + if (StringUtils.isBlank(adStore.getStoreId())) { + response.setStatus(0); + response.setMessage("调价门店Id不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (StringUtils.isBlank(adStore.getStoreNo())) { + response.setStatus(0); + response.setMessage("调价门店编号不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + adStore.setTicketNo(ticket.getNo()); + storeList.add(adStore); + } + + //调价商品 + if (StringUtils.isBlank(productString)) { + response.setStatus(0); + response.setMessage("商品信息不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + List productList = new ArrayList(); + JSONArray productArray = JSONArray.parseArray(productString); + for (int i = 0; i < productArray.size(); i++) { + AdjustPriceProduct adProduct = JSONUtil.parseObject(productArray.get(i).toString(), new TypeReference() {}); + if (null == adProduct.getProductId()) { + response.setStatus(0); + response.setMessage("调价商品不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (null == adProduct.getOldPrice()) { + response.setStatus(0); + response.setMessage("商品"+adProduct.getProductName()+"原售价不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (null == adProduct.getOldMinPrice()) { + response.setStatus(0); + response.setMessage("商品"+adProduct.getProductName()+"原最低售价不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (null == adProduct.getOldMemberPrice()) { + response.setStatus(0); + response.setMessage("商品"+adProduct.getProductName()+"原会员价不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (null == adProduct.getOldOtherPrice()) { + response.setStatus(0); + response.setMessage("商品"+adProduct.getProductName()+"原第三方价不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (null == adProduct.getPrice()) { + response.setStatus(0); + response.setMessage("商品"+adProduct.getProductName()+"新售价不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (null == adProduct.getMinPrice()) { + response.setStatus(0); + response.setMessage("商品"+adProduct.getProductName()+"新最低售价不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (null == adProduct.getMemberPrice()) { + response.setStatus(0); + response.setMessage("商品"+adProduct.getProductName()+"新会员价不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (null == adProduct.getOtherPrice()) { + response.setStatus(0); + response.setMessage("商品"+adProduct.getProductName()+"新第三方价不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + productList.add(adProduct); + } + + ticket = adjustPriceTicketService.saveTicket(tenantId, ticket, storeList, productList); + + response.setStatus(1); + response.setMessage("调价单新建成功"); + Map data = new HashMap<>(); + data.put("ticketId", ticket.getId()); + response.setData(data); + + System.out.println("end "+DateUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss:SSS")); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "STORE_ADJUSTPRICE_ADD_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 门店调价单编辑 + */ + @ServiceMethod(method = "store.adjustPrice.edit", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店调价单编辑") + @Override + public Object adjustPriceTicketEdit(AdjustPriceTicketEditRequest request) { + String info = "门店调价单编辑"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId();// 门店ID + String ticketId = request.getTicketId();// 调价单号 + String effectString = request.getEffectDate();// 生效时间 + String workerNo = request.getWorkerNo(); + String description = request.getDescription(); + String storeString = request.getStoreString(); + String productString = request.getProductString(); + logger.info(info+" storeId:"+storeId+" ticketId:"+ticketId+" workerNo:"+workerNo); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + if (StringUtils.isBlank(ticketId)) { + response.setStatus(0); + response.setMessage("单据ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + AdjustPriceTicket ticket = adjustPriceTicketService.get(tenantId, ticketId); + if(null == ticket){ + response.setStatus(0); + response.setMessage("单据不存在"); + response.setErrCode(CommonErrorCode.error23.getCode()); + response.setErrMessage(CommonErrorCode.error23.getMessage()); + return response; + } + + if(StringUtils.isBlank(effectString)){ + response.setStatus(0); + response.setMessage("生效时间不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + Date effectDate = DateUtils.parseDate(effectString, "yyyy-MM-dd HH:mm:ss"); + ticket.setEffectDate(effectDate); + ticket.setDescription(description); + ticket.setModifyUser(workerNo); + + //调价门店 + if (StringUtils.isBlank(storeString)) { + response.setStatus(0); + response.setMessage("门店信息不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + List storeList = new ArrayList(); + JSONArray storeArray = JSONArray.parseArray(storeString); + for (int i = 0; i < storeArray.size(); i++) { + AdjustPriceStore adStore = JSONUtil.parseObject(storeArray.get(i).toString(), new TypeReference() {}); + if (StringUtils.isBlank(adStore.getStoreId())) { + response.setStatus(0); + response.setMessage("调价门店Id不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (StringUtils.isBlank(adStore.getStoreNo())) { + response.setStatus(0); + response.setMessage("调价门店编号不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + adStore.setTicketNo(ticket.getNo()); + storeList.add(adStore); + } + + //调价商品 + if (StringUtils.isBlank(productString)) { + response.setStatus(0); + response.setMessage("商品信息不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + List productList = new ArrayList(); + JSONArray productArray = JSONArray.parseArray(productString); + for (int i = 0; i < productArray.size(); i++) { + AdjustPriceProduct adProduct = JSONUtil.parseObject(productArray.get(i).toString(), new TypeReference() {}); + if (null == adProduct.getProductId()) { + response.setStatus(0); + response.setMessage("调价商品不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (null == adProduct.getOldPrice()) { + response.setStatus(0); + response.setMessage("商品"+adProduct.getProductName()+"原售价不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (null == adProduct.getOldMinPrice()) { + response.setStatus(0); + response.setMessage("商品"+adProduct.getProductName()+"原最低售价不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (null == adProduct.getOldMemberPrice()) { + response.setStatus(0); + response.setMessage("商品"+adProduct.getProductName()+"原会员价不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (null == adProduct.getOldOtherPrice()) { + response.setStatus(0); + response.setMessage("商品"+adProduct.getProductName()+"原第三方价不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (null == adProduct.getPrice()) { + response.setStatus(0); + response.setMessage("商品"+adProduct.getProductName()+"新售价不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (null == adProduct.getMinPrice()) { + response.setStatus(0); + response.setMessage("商品"+adProduct.getProductName()+"新最低售价不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (null == adProduct.getMemberPrice()) { + response.setStatus(0); + response.setMessage("商品"+adProduct.getProductName()+"新会员价不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (null == adProduct.getOtherPrice()) { + response.setStatus(0); + response.setMessage("商品"+adProduct.getProductName()+"新第三方价不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + productList.add(adProduct); + } + + int count = adjustPriceTicketService.updateTicket(tenantId, ticket, storeList, productList); + + response.setStatus(1); + response.setMessage("调价单新建成功"); + Map data = new HashMap<>(); + data.put("ticketId", ticket.getId()); + response.setData(data); + + System.out.println("end "+DateUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss:SSS")); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "STORE_ADJUSTPRICE_EDIT_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /*** + * 审核门店调价单 + */ + @ServiceMethod(method = "store.adjustPrice.audit", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "审核门店调价单") + @Override + public Object adjustPriceTicketAudit(AdjustPriceTicketAuditRequest request) { + String info = "审核门店调价单"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId();// 门店ID + String ticketId = request.getTicketId();// 调价单号 + String workerNo = request.getWorkerNo(); + logger.info(info+" storeId:"+storeId+" ticketId:"+ticketId +" workerNo:"+workerNo); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + if (StringUtils.isBlank(ticketId)) { + response.setStatus(0); + response.setMessage("单据ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + if(StringUtils.isBlank(workerNo)){ + response.setStatus(0); + response.setMessage("员工工号不存在"); + response.setErrCode(CommonErrorCode.error6.getCode()); + response.setErrMessage(CommonErrorCode.error6.getMessage()); + return response; + } + + AdjustPriceTicket ticket = adjustPriceTicketService.get(tenantId, ticketId); + if(null == ticket){ + response.setStatus(0); + response.setMessage("单据不存在"); + response.setErrCode(CommonErrorCode.error23.getCode()); + response.setErrMessage(CommonErrorCode.error23.getMessage()); + return response; + } + + if(ticket.getStatus() != 0){ + response.setStatus(0); + response.setMessage("单据状态非法"); + response.setErrCode(CommonErrorCode.error22.getCode()); + response.setErrMessage(CommonErrorCode.error22.getMessage()); + return response; + } + // 调价门店 + List storeList = adjustPriceStoreService.findList(tenantId, "ticketId", ticket.getId()); + String adStoreId = ""; + if(CollectionUtils.isNotEmpty(storeList)){ + adStoreId = storeList.get(0).getStoreId(); + }else{ + response.setStatus(0); + response.setMessage("调价门店不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + // 调价商品 + List productList = adjustPriceProductService.findList(tenantId, "ticketId", ticket.getId()); + List specIds = new ArrayList(); + for(AdjustPriceProduct product:productList){ + specIds.add(product.getSpecId()); + } + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId",adStoreId)); + criteria.add(Restrictions.in("specId", specIds)); + List storeProductList = storeProductService.getList(tenantId, criteria); + + Map storeProductMap = new HashMap(); + for(StoreProduct product:storeProductList){ + storeProductMap.put(product.getSpecId(),product ); + } + + Date modifyDate = new Date(); + String key = null; + List updateStoreProducts = new ArrayList(); + + for(AdjustPriceProduct product:productList){ + if(null != storeProductMap.get(product.getSpecId())){ + StoreProduct storeProduct = new StoreProduct(); + storeProduct.setId(storeProductMap.get(product.getSpecId()).getId()); + storeProduct.setStoreId(storeId); + storeProduct.setProductId(product.getProductId()); + storeProduct.setSpecId(product.getSpecId()); + storeProduct.setPrice(product.getPrice()); + storeProduct.setMemberPrice(product.getMemberPrice()); + storeProduct.setOtherPrice(product.getMemberPrice()); + storeProduct.setMinPrice(product.getMinPrice()); + storeProduct.setModifyUser(Constant.CREATE_USER); + storeProduct.setModifyDate(modifyDate); + + updateStoreProducts.add(storeProduct); + } + } + + int count = storeProductService.update(tenantId, updateStoreProducts); + logger.info(info+"调价完成 ---> storeId:"+storeId+" size:" + updateStoreProducts.size()); + + ticket.setCheckPeople(workerNo); + ticket.setCheckDate(new Date()); + ticket.setStatus(3); + ticket.setModifyUser(workerNo); + ticket.setModifyDate(modifyDate); + adjustPriceTicketService.update(tenantId, ticket); + logger.info(info+"单据状态更改成功 ok"); + + response.setStatus(1); + response.setMessage("调价单审核成功"); + Map data = new HashMap<>(); + data.put("ticketId", ticket.getId()); + response.setData(data); + + System.out.println("end "+DateUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss:SSS")); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "STORE_ADJUSTPRICE_AUDIT_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/store/StoreDispatchSettleServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/store/StoreDispatchSettleServiceImpl.java new file mode 100644 index 0000000..f5f9c1b --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/store/StoreDispatchSettleServiceImpl.java @@ -0,0 +1,104 @@ +package com.jwsaas.api.service.impl.store; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import org.apache.commons.collections4.CollectionUtils; + +import com.jwsaas.api.request.store.StoreDispatchSettlePlanGetRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.store.StoreDispatchSettleService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.entity.food.DispatchSettlePlan; +import com.jwsaas.entity.food.Store; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.utils.AppKeyUtil; + +@ServiceMethodBean(version = "1.0") +public class StoreDispatchSettleServiceImpl extends WopServiceImpl implements StoreDispatchSettleService { + + private static final long serialVersionUID = 8363217226611766625L; + + @Resource + private com.jwsaas.service.food.StoreService storeService; + @Resource + private com.jwsaas.service.food.DispatchSettlePlanService dispatchSettlePlanService; + + /** + * 获取门店配送结算方案 + */ + @ServiceMethod(method = "store.dispatch.settle.plan", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "获取门店配送结算方案") + @Override + public Object getStoreDispatchSettlePlan(StoreDispatchSettlePlanGetRequest request) { + String info = "获取门店配送结算方案"; + logger.debug("info:" + info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } +// + Criteria criteria = new Criteria(); + List dataList = dispatchSettlePlanService.getListByStoreId(tenantId, storeId, criteria); + if (CollectionUtils.isEmpty(dataList)) { + response.setStatus(0); + response.setMessage("尚未配置门店配送结算方案"); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + if (dataList.size() > 1) { + response.setStatus(0); + response.setMessage("门店配送结算方案不唯一"); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + + Map dataMap = null; + for (DispatchSettlePlan data : dataList) { + dataMap = new HashMap<>(); + dataMap.put("tenantId", data.getTenantId()); + dataMap.put("id", data.getId()); + dataMap.put("no", data.getNo());// 方案编号 + dataMap.put("name", data.getName());// 方案名称 + dataMap.put("balanceMode", data.getBalanceMode());// 结算模式 + dataMap.put("creditType", data.getCreditType());// 允许欠费 + dataMap.put("advanceType", data.getAdvanceType());//预付款类型 + dataMap.put("advanceValue", data.getAdvanceValue());//预付款值 + } + + response.setStatus(1); + response.setMessage("获取成功"); + response.setData(dataMap); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/store/StoreInfoServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/store/StoreInfoServiceImpl.java new file mode 100644 index 0000000..d5233a5 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/store/StoreInfoServiceImpl.java @@ -0,0 +1,196 @@ +package com.jwsaas.api.service.impl.store; + +import java.util.HashMap; +import java.util.Map; + +import javax.annotation.Resource; + +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; + +import com.alibaba.fastjson.JSON; +import com.jwsaas.api.request.store.StoreInfoRequest; +import com.jwsaas.api.request.store.StoreRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.store.StoreInfoService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.controller.open.BaiDuLbsController; +import com.jwsaas.entity.food.Store; +import com.jwsaas.entity.food.WxStore; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.properties.BaiduhProperties; +import com.jwsaas.properties.WxyhProperties; +import com.jwsaas.reactor.event.EventKeys; +import com.jwsaas.util.JSONUtil; +import com.jwsaas.utils.AppKeyUtil; + +import reactor.bus.Event; + +/*** + * 门店信息相关接口 + * @author louxutao + * + */ +@ServiceMethodBean(version = "1.0") +public class StoreInfoServiceImpl extends WopServiceImpl implements StoreInfoService { + + private static final long serialVersionUID = 1298413939117831826L; + + @Autowired + private BaiduhProperties baiduhProperties; + + + + @Resource + private com.jwsaas.service.food.StoreService storeService; + + @Resource + private com.jwsaas.service.food.WxStoreService wxStoreService; + + + /*** + * 修改门店信息 + */ + @ServiceMethod(method = "store.info.update", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "修改门店信息") + @Override + public Object updateStoreInfo(StoreInfoRequest request) { + String info = "修改门店信息"; + logger.info(">>>>>>>>>> "+info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String appSign = request.getAppSign();// 应用 + String storeId = request.getStoreId();// 门店Id + String workerNo = request.getWorkerNo();// 操作员工号 + String storeInfoJson = request.getStoreInfoJson(); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Store newStore = JSONUtil.parseObject(storeInfoJson, Store.class); + if(StringUtils.isBlank(newStore.getName())){ + response.setStatus(0); + response.setMessage("门店名称不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if(StringUtils.isBlank(newStore.getPrintName())){ + response.setStatus(0); + response.setMessage("门店打印名称不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + newStore.setModifyUser(workerNo); + logger.info("newStore:" + newStore); + // 修改门店信息 + storeService.update(tenantId, newStore); + // 获取门店信息 + newStore = storeService.get(tenantId, storeId); + + Map storeMap = JSON.parseObject(JSON.toJSONString(newStore), Map.class); + response.setStatus(1); + response.setMessage("获取成功"); + response.setData(storeMap); + + // 修改门店成功 -异步修改百度门店信息 + Map eventData = new HashMap<>(); + eventData.put("appKey", appKey); + eventData.put("appId", appId); + eventData.put("appSign", appSign); + eventData.put("tenantCode", tenantCode); + eventData.put("appCode", appCode); + eventData.put("tenantId", tenantId); + eventData.put("store", newStore); + eventBus.notify(EventKeys.WXYH_UPDATE_BAIDU_STORE, Event.wrap(eventData)); + + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", + request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 从百度地图删除指定门店 + */ + @ServiceMethod(method = "store.baiduStore.delete", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "修改门店信息") + @Override + public Object deleteBaiduStore(StoreRequest request) { + String info = "从百度地图删除指定门店"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); +// String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); +// String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String appSign = request.getAppSign();// 应用 + String wxStoreId = request.getWxStoreId(); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + // 校验微信门店Id + if(StringUtils.isBlank(wxStoreId)){ + response.setStatus(0); + response.setMessage("微信门店Id不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + // 校验微信门店 + WxStore wxStore = wxStoreService.get(tenantId, wxStoreId); + if (wxStore == null) { + response.setStatus(0); + response.setMessage("微信门店不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + // 删除对应百度门店 + Map dataMap = BaiDuLbsController.deleteStore(tenantId, appSign, wxStoreId,baiduhProperties.getBaiduV4ak(),baiduhProperties.getBakduTableId()); + if("1".equals(dataMap.get("status"))){ + Map data = new HashMap(); + data.put("id", dataMap.get("data").toString()); + response.setStatus(1); + response.setMessage("获取成功"); + response.setData(data); + + }else{ + response.setStatus(0); + response.setMessage(dataMap.get("message").toString()); + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", + request.getWopRequestContext().getLocale()); + } + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/store/StoreRechargeServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/store/StoreRechargeServiceImpl.java new file mode 100644 index 0000000..0f24099 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/store/StoreRechargeServiceImpl.java @@ -0,0 +1,101 @@ +package com.jwsaas.api.service.impl.store; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import org.apache.commons.collections4.CollectionUtils; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.jwsaas.api.request.store.StoreRechargeParameterListRequest; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.response.mode.CommonListResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.store.StoreRechargeService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.RechargeParameter; +import com.jwsaas.entity.food.Store; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.util.JSONUtil; +import com.jwsaas.utils.AppKeyUtil; + +@ServiceMethodBean(version = "1.0") +public class StoreRechargeServiceImpl extends WopServiceImpl implements StoreRechargeService { + + private static final long serialVersionUID = 3112568704251738488L; + + @Resource + private com.jwsaas.service.food.StoreService storeService; + @Resource + private com.jwsaas.service.food.RechargeParameterService rechargeParameterService; + + /** + * 获取门店充值参数方案列表 + */ + @ServiceMethod(method = "store.recharge.parameter.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "获取门店充值参数方案列表") + @Override + public Object storeRechargeParameterList(StoreRechargeParameterListRequest request) { + String info = "获取门店充值参数方案列表"; + logger.debug("info:" + info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + CommonListResponse response = null; + try { + response = new CommonListResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("r.enabled", 1)); + List dataList = rechargeParameterService.getListByStoreId(tenantId, storeId, criteria); + List> list = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(dataList)) { + for (RechargeParameter data : dataList) { + Map map = new HashMap<>(); + map.put("tenantId", data.getTenantId()); + map.put("id", data.getId()); + map.put("no", data.getNo());// 编号 + map.put("name", data.getName());// 方案名称 + map.put("sign", data.getSign());// 支付类型 + + Map pbodyMap = JSONUtil.parseObject(data.getPbody(), new TypeReference>() { + }); + map.put("pbody", pbodyMap);// 支付参数 + + // map.put("pbody", data.getPbody());// 支付参数 + // map.put("enabled", data.getEnabled());// 是否启用 + map.put("certText", data.getCertText());// 证书内容 + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/store/StoreSalesOrderServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/store/StoreSalesOrderServiceImpl.java new file mode 100644 index 0000000..adf941d --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/store/StoreSalesOrderServiceImpl.java @@ -0,0 +1,837 @@ +package com.jwsaas.api.service.impl.store; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import com.alibaba.fastjson.JSONArray; +import com.jwsaas.api.request.store.StoreSalesDayProductSummaryRequest; +import com.jwsaas.entity.food.StoreOrderProduct; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; + +import com.alibaba.fastjson.JSONObject; +import com.jwsaas.api.request.store.SalesOrderSummaryRequest; +import com.jwsaas.api.request.store.StoreSalesDaySummaryRequest; +import com.jwsaas.api.request.store.StoreSalesOrderListRequest; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.response.mode.CommonListResponse; +import com.jwsaas.api.response.mode.CommonPagerResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.store.StoreSalesOrderService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.Store; +import com.jwsaas.entity.food.StoreBusinessTicket; +import com.jwsaas.entity.food.StorePay; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.pager.Pager; +import com.jwsaas.utils.AppKeyUtil; +import com.jwsaas.utils.DateUtils; + +/** + * 门店销售相关接口 + */ +@ServiceMethodBean(version = "1.0") +public class StoreSalesOrderServiceImpl extends WopServiceImpl implements StoreSalesOrderService { + + private static final long serialVersionUID = 6626398176685904478L; + private static final String className = "StoreSalesOrderServiceImpl"; + + @Resource + private com.jwsaas.service.food.StoreService storeService; + @Resource + private com.jwsaas.service.food.StoreBusinessTicketService storeBusinessTicketService; + @Resource + private com.jwsaas.service.food.StoreOrderProductService storeOrderProductService; + @Resource + private com.jwsaas.service.food.StorePayService storePayService; + + /** + * 门店销售订单列表 + */ + @ServiceMethod(method = "store.sales.order.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店销售订单列表") + @Override + public Object salesOrderList(StoreSalesOrderListRequest request) { + String info = "门店销售订单列表"; + logger.debug("info:" + info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeNo = request.getStoreNo(); + String startDate = request.getStartDate(); + String endDate = request.getEndDate(); + String no = request.getNo();// 单据编号 + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + if (StringUtils.isBlank(storeNo)) { + response.setStatus(0); + response.setMessage("参数storeNo不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (StringUtils.isBlank(startDate)) { + response.setStatus(0); + response.setMessage("参数startDate不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (StringUtils.isBlank(endDate)) { + response.setStatus(0); + response.setMessage("参数endDate不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (pageSize > 100) { + pageSize = 100; + } + + Store store = storeService.find(tenantId, "no", storeNo); + if (store == null) { + response.setStatus(0); + response.setMessage("门店信息不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.ge("saleDate", startDate)); + criteria.add(Restrictions.le("saleDate", endDate)); + criteria.add(Restrictions.eq("isInvalid", 0)); + criteria.add(Restrictions.eq("storeId", store.getId())); + if (StringUtils.isNotBlank(no)) { + criteria.add(Restrictions.eq("no", no)); + } + criteria.add(Restrictions.order("saleDate", "asc")); + pager = storeBusinessTicketService.getPager(tenantId, criteria, pager); + + List> resultDataList = new ArrayList<>(); + Map> resultDataMap = new HashMap<>(); + List resultDataIdList = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List dataList = (List) pager.getList(); + for (StoreBusinessTicket data : dataList) { + Map map = new HashMap<>(); + map.put("id", data.getId()); + map.put("tenantId", data.getTenantId()); + map.put("storeId", data.getStoreId());// 门店ID + map.put("storeNo", data.getStoreNo());// 门店编号 + map.put("storeName", data.getStoreName());// 门店名称 + map.put("no", data.getNo());// 单据编号 + map.put("status", data.getStatus());// 单据状态 + map.put("saleDate", DateUtils.format(data.getSaleDate(), DateUtils.SHOW_DATETIME_FORMAT));// 销售时间 + map.put("tableNo", data.getTableNo());// 餐桌号 + map.put("people", data.getPeople());// 人数 + map.put("busMode", data.getBusMode());// 营业模式 + map.put("amount", doubleFormat(data.getAmount()));// 消费金额 + map.put("discountTotal", doubleFormat(data.getDiscountTotal()));// 优惠额 + map.put("receivable", doubleFormat(data.getReceivable()));// 应收金额 + map.put("maling", doubleFormat(data.getMaling()));// 抹零金额 + map.put("paid", doubleFormat(data.getPaid()));// 实收金额 + map.put("noOrg", data.getNoOrg());// 原单号 + map.put("backCause", data.getBackCause());// 退单原因 + map.put("workNo", data.getWorkNo());// 操作员工号 + map.put("posNo", data.getPosNo());// POS编号 + map.put("pays", new ArrayList>());// 付款信息 + resultDataList.add(map); + resultDataMap.put(data.getId(), map); + resultDataIdList.add(data.getId()); + } + + // 支付信息 + criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", store.getId())); + criteria.add(Restrictions.eq("isInvalid", 0)); + criteria.add(Restrictions.in("ticketId", resultDataIdList)); + List storePayList = storePayService.getList(tenantId, criteria); + List> payList = null; + for (StorePay storePay : storePayList) { + Map ticketInfoMap = resultDataMap.get(storePay.getTicketId()); + payList = (List>) ticketInfoMap.get("pays"); + Map payInfo = new HashMap<>(); + payInfo.put("id", storePay.getId()); + payInfo.put("payNo", storePay.getPayNo());// 付款单号 + payInfo.put("ticketId", storePay.getTicketId());// 销售单ID + payInfo.put("ticketNo", storePay.getBusNo());// 销售单号 + payInfo.put("payTypeNo", storePay.getPayTypeNo());// 付款方式编号 + payInfo.put("payType", storePay.getPayType());// 付款方式 + payInfo.put("paid", doubleFormat(storePay.getPaid()));// 实收金额 + payInfo.put("rchange", doubleFormat(storePay.getRchange()));// 找零金额 + payInfo.put("money", doubleFormat(storePay.getMoney()));// 已收金额 + payInfo.put("overAmount", doubleFormat(storePay.getOverAmount()));// 溢出金额 + payInfo.put("voucherNo", storePay.getVoucherNo());// 凭证号 + payInfo.put("payDate", DateUtils.format(storePay.getPayDate(), DateUtils.SHOW_DATETIME_FORMAT));// 付款时间 + payInfo.put("memo", storePay.getMemo());// 备注 + payList.add(payInfo); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(resultDataList); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + + return response; + } + + /** + * 门店销售订单详情列表 + */ + @ServiceMethod(method = "store.sales.order.detail.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店销售订单列表") + @Override + public Object salesOrderDetailList(StoreSalesOrderListRequest request) { + String info = "门店销售订单详情列表"; + logger.debug("info:" + info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeNo = request.getStoreNo(); + String startDate = request.getStartDate(); + String endDate = request.getEndDate(); + String no = request.getNo();// 单据编号 + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + if (StringUtils.isBlank(storeNo)) { + response.setStatus(0); + response.setMessage("参数storeNo不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (StringUtils.isBlank(startDate)) { + response.setStatus(0); + response.setMessage("参数startDate不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (StringUtils.isBlank(endDate)) { + response.setStatus(0); + response.setMessage("参数endDate不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (pageSize > 100) { + pageSize = 100; + } + + Store store = storeService.find(tenantId, "no", storeNo); + if (store == null) { + response.setStatus(0); + response.setMessage("门店信息不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.ge("saleDate", startDate)); + criteria.add(Restrictions.le("saleDate", endDate)); + criteria.add(Restrictions.eq("isInvalid", 0)); + criteria.add(Restrictions.eq("storeId", store.getId())); + if (StringUtils.isNotBlank(no)) { + criteria.add(Restrictions.eq("no", no)); + } + criteria.add(Restrictions.order("saleDate", "asc")); + pager = storeBusinessTicketService.getPager(tenantId, criteria, pager); + + List> resultDataList = new ArrayList<>(); + Map> resultDataMap = new HashMap<>(); + List resultDataIdList = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List dataList = (List) pager.getList(); + for (StoreBusinessTicket data : dataList) { + Map map = new HashMap<>(); + map.put("id", data.getId()); + map.put("tenantId", data.getTenantId()); + map.put("storeId", data.getStoreId());// 门店ID + map.put("storeNo", data.getStoreNo());// 门店编号 + map.put("storeName", data.getStoreName());// 门店名称 + map.put("no", data.getNo());// 单据编号 + map.put("status", data.getStatus());// 单据状态 + map.put("saleDate", DateUtils.format(data.getSaleDate(), DateUtils.SHOW_DATETIME_FORMAT));// 销售时间 + map.put("tableNo", data.getTableNo());// 餐桌号 + map.put("people", data.getPeople());// 人数 + map.put("busMode", data.getBusMode());// 营业模式 + map.put("amount", doubleFormat(data.getAmount()));// 消费金额 + map.put("discountTotal", doubleFormat(data.getDiscountTotal()));// 优惠额 + map.put("receivable", doubleFormat(data.getReceivable()));// 应收金额 + map.put("maling", doubleFormat(data.getMaling()));// 抹零金额 + map.put("paid", doubleFormat(data.getPaid()));// 实收金额 + map.put("noOrg", data.getNoOrg());// 原单号 + map.put("backCause", data.getBackCause());// 退单原因 + map.put("workNo", data.getWorkNo());// 操作员工号 + map.put("posNo", data.getPosNo());// POS编号 + map.put("pays", new ArrayList>());// 付款信息 + map.put("products", new ArrayList>());// 商品信息 + resultDataList.add(map); + resultDataMap.put(data.getId(), map); + resultDataIdList.add(data.getId()); + } + + //商品信息 + criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", store.getId())); + criteria.add(Restrictions.eq("isInvalid", 0)); + criteria.add(Restrictions.in("ticketId", resultDataIdList)); + List storeProductList = storeOrderProductService.getList(tenantId, criteria); + List> productList = null; + for (StoreOrderProduct storeOrderProduct : storeProductList) { + Map ticketInfoMap = resultDataMap.get(storeOrderProduct.getTicketId()); + productList = (List>) ticketInfoMap.get("products"); + Map productInfo = new HashMap<>(); + productInfo.put("id", storeOrderProduct.getId()); + productInfo.put("ticketId", storeOrderProduct.getTicketId());// 销售单ID + productInfo.put("ticketNo", storeOrderProduct.getBusNo());// 销售单号 + productInfo.put("productNo", storeOrderProduct.getProductNo());// + productInfo.put("productName", storeOrderProduct.getProductName());// + productInfo.put("specName", storeOrderProduct.getProductName());// + productInfo.put("productUnitName", storeOrderProduct.getProductName());// 单位名称 + productInfo.put("seriesName", storeOrderProduct.getProductName());// 大类 + productInfo.put("typeName", storeOrderProduct.getProductName());// 小类 + productInfo.put("count", doubleFormat(storeOrderProduct.getCount()));// 点餐数量 + productInfo.put("rcount", doubleFormat(storeOrderProduct.getRcount()));// 退菜数量 + productInfo.put("isSuit", storeOrderProduct.getIsSuit());// 1.普通菜 2 主菜 3 明细菜 + productInfo.put("priceOrg", doubleFormat(storeOrderProduct.getPriceOrg()));//原价 + productInfo.put("price", doubleFormat(storeOrderProduct.getPrice()));//售价 + productInfo.put("discountPrice", doubleFormat(storeOrderProduct.getDiscountPrice()));//折后价 + productInfo.put("amountTotal", doubleFormat(storeOrderProduct.getAmountTotal()));//消费额 + productInfo.put("discountTotal", doubleFormat(storeOrderProduct.getDiscountTotal()));//优惠额 + productInfo.put("amountAddTotal", doubleFormat(storeOrderProduct.getAmountAddTotal()));//加价额 + productInfo.put("receivableTotal", doubleFormat(storeOrderProduct.getReceivableTotal()));//应收额 + productList.add(productInfo); + } + + + // 支付信息 + criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", store.getId())); + criteria.add(Restrictions.eq("isInvalid", 0)); + criteria.add(Restrictions.in("ticketId", resultDataIdList)); + List storePayList = storePayService.getList(tenantId, criteria); + List> payList = null; + for (StorePay storePay : storePayList) { + Map ticketInfoMap = resultDataMap.get(storePay.getTicketId()); + payList = (List>) ticketInfoMap.get("pays"); + Map payInfo = new HashMap<>(); + payInfo.put("id", storePay.getId()); + payInfo.put("payNo", storePay.getPayNo());// 付款单号 + payInfo.put("ticketId", storePay.getTicketId());// 销售单ID + payInfo.put("ticketNo", storePay.getBusNo());// 销售单号 + payInfo.put("payTypeNo", storePay.getPayTypeNo());// 付款方式编号 + payInfo.put("payType", storePay.getPayType());// 付款方式 + payInfo.put("paid", doubleFormat(storePay.getPaid()));// 实收金额 + payInfo.put("rchange", doubleFormat(storePay.getRchange()));// 找零金额 + payInfo.put("money", doubleFormat(storePay.getMoney()));// 已收金额 + payInfo.put("overAmount", doubleFormat(storePay.getOverAmount()));// 溢出金额 + payInfo.put("voucherNo", storePay.getVoucherNo());// 凭证号 + payInfo.put("payDate", DateUtils.format(storePay.getPayDate(), DateUtils.SHOW_DATETIME_FORMAT));// 付款时间 + payInfo.put("memo", storePay.getMemo());// 备注 + payList.add(payInfo); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(resultDataList); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + + return response; + } + + @ServiceMethod(method = "store.sales.order.summary", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店销售订单列表") + @Override + public Object salesOrderSummary(SalesOrderSummaryRequest request) { + String info = "门店销售订单列表"; + logger.debug("info:" + info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String workerNo = request.getWorkerNo(); + String typeIds = request.getTypeIds(); + String startDate = request.getStartDate(); + String endDate = request.getEndDate(); + CommonListResponse response = null; + try { + response = new CommonListResponse(); + if (StringUtils.isBlank(storeId)) { + response.setStatus(0); + response.setMessage("参数storeId不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (StringUtils.isBlank(startDate)) { + response.setStatus(0); + response.setMessage("参数startDate不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (StringUtils.isBlank(endDate)) { + response.setStatus(0); + response.setMessage("参数endDate不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + StringBuffer sb = new StringBuffer(); + sb.append(" SELECT typeId,productId,specId,typeName ,productName,specName, "); + sb.append(" productNo,SUM(count - rcount) AS count, "); + sb.append(" sum(case when isSuit = 3 then count- rcount else 0 end) as suitQuantity, "); + sb.append(" sum(case when isSuit != 3 then receivableTotal else 0 end) as amount "); + sb.append(" FROM cy_store_order_product "); + sb.append(" WHERE isInvalid = 0 and "); + sb.append(" tenantId = '" + tenantId + "' "); + if (!StringUtils.isBlank(workerNo)) { + sb.append(" and workerNo = '" + workerNo + "' "); + } + if (!StringUtils.isBlank(typeIds)) { + sb.append(" and typeId in (" + typeIds + ") "); + } + sb.append(" and storeId = '" + storeId + "' "); + sb.append(" and saleDate >= '" + startDate + "' "); + sb.append(" and saleDate <= '" + endDate + "' "); + sb.append(" GROUP BY productId , specId "); + sb.append(" ORDER BY typeId,productNo "); + sb.append(" LIMIT 0,20000 "); + List> source = storeOrderProductService.selectList(tenantId, sb.toString()); + List> list = new ArrayList<>(); + for (Map map: source) { + Map summary = new HashMap<>(); + summary.put("typeId", map.get("typeId")); + summary.put("typeName", map.get("typeName")); + summary.put("productNo", map.get("productNo")); + summary.put("productName", map.get("productName")); + summary.put("specName", map.get("specName")); + summary.put("count", map.get("count")); + summary.put("suitQuantity", map.get("suitQuantity")); + summary.put("amount", map.get("amount")); + list.add(summary); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.sales.day.summary", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店日营业额汇总") + @Override + public Object salesDaySummary(StoreSalesDaySummaryRequest request) { + String info = "门店日营业额汇总"; + logger.debug("info:" + info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String storeNo = request.getStoreNo(); + String startDate = request.getStartDate(); + String endDate = request.getEndDate(); + CommonListResponse response = null; + try { + response = new CommonListResponse(); + if (StringUtils.isBlank(storeNo)) { + response.setStatus(0); + response.setMessage("参数storeNo不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (StringUtils.isBlank(startDate)) { + response.setStatus(0); + response.setMessage("参数startDate不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (StringUtils.isBlank(endDate)) { + response.setStatus(0); + response.setMessage("参数endDate不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + Store store = storeService.find(tenantId, "no", storeNo); + if (store == null) { + response.setStatus(0); + response.setMessage("门店信息不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + StringBuffer sb = new StringBuffer(); + sb.append(" SELECT DATE_FORMAT(saleDate, '%Y-%m-%d') AS dayTime, count(id) AS ticketCount, sum(amount) AS amount, "); + sb.append(" sum(discountTotal) AS discountTotal, sum(receivable) AS receivable FROM `cy_store_business_ticket` "); + sb.append(" WHERE "); + sb.append(" tenantId = '" + tenantId + "' "); + sb.append(" and storeId = '" + store.getId() + "' "); + sb.append(" and saleDate >= '" + startDate + "' "); + sb.append(" and saleDate <= '" + endDate + "' "); + sb.append(" GROUP BY dayTime "); + sb.append(" ORDER BY dayTime "); + List> source = storeBusinessTicketService.selectList(tenantId, sb.toString()); + List> list = new ArrayList<>(); + for (Map map: source) { + Map summary = new HashMap<>(); + summary.put("dayTime", map.get("dayTime")); + summary.put("ticketCount", map.get("ticketCount")); + summary.put("amount", map.get("amount")); + summary.put("discountTotal", map.get("discountTotal")); + summary.put("receivable", map.get("receivable")); + list.add(summary); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + + + /** + * 门店销售订单列表 + */ + @ServiceMethod(method = "store.sales.order.create.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店销售订单列表") + @Override + public Object salesOrderCreateList(StoreSalesOrderListRequest request) { + String info = "门店销售订单列表"; + logger.debug("info:" + info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeNo = request.getStoreNo(); + String startDate = request.getStartDate(); + String endDate = request.getEndDate(); + String no = request.getNo();// 单据编号 + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + if (StringUtils.isBlank(storeNo)) { + response.setStatus(0); + response.setMessage("参数storeNo不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (StringUtils.isBlank(startDate)) { + response.setStatus(0); + response.setMessage("参数startDate不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (StringUtils.isBlank(endDate)) { + response.setStatus(0); + response.setMessage("参数endDate不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (pageSize > 100) { + pageSize = 100; + } + + Store store = storeService.find(tenantId, "no", storeNo); + if (store == null) { + response.setStatus(0); + response.setMessage("门店信息不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.ge("createDate", startDate)); + criteria.add(Restrictions.le("createDate", endDate)); + criteria.add(Restrictions.eq("isInvalid", 0)); + criteria.add(Restrictions.eq("storeId", store.getId())); + if (StringUtils.isNotBlank(no)) { + criteria.add(Restrictions.eq("no", no)); + } + criteria.add(Restrictions.order("createDate", "asc")); + pager = storeBusinessTicketService.getPager(tenantId, criteria, pager); + + List> resultDataList = new ArrayList<>(); + Map> resultDataMap = new HashMap<>(); + List resultDataIdList = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List dataList = (List) pager.getList(); + for (StoreBusinessTicket data : dataList) { + Map map = new HashMap<>(); + map.put("id", data.getId()); + map.put("tenantId", data.getTenantId()); + map.put("storeId", data.getStoreId());// 门店ID + map.put("storeNo", data.getStoreNo());// 门店编号 + map.put("storeName", data.getStoreName());// 门店名称 + map.put("no", data.getNo());// 单据编号 + map.put("status", data.getStatus());// 单据状态 + map.put("saleDate", DateUtils.format(data.getSaleDate(), DateUtils.SHOW_DATETIME_FORMAT));// 销售时间 + map.put("createDate", DateUtils.format(data.getCreateDate(), DateUtils.SHOW_DATETIME_FORMAT));// 销售时间 + map.put("tableNo", data.getTableNo());// 餐桌号 + map.put("people", data.getPeople());// 人数 + map.put("busMode", data.getBusMode());// 营业模式 + map.put("amount", doubleFormat(data.getAmount()));// 消费金额 + map.put("discountTotal", doubleFormat(data.getDiscountTotal()));// 优惠额 + map.put("receivable", doubleFormat(data.getReceivable()));// 应收金额 + map.put("maling", doubleFormat(data.getMaling()));// 抹零金额 + map.put("paid", doubleFormat(data.getPaid()));// 实收金额 + map.put("noOrg", data.getNoOrg());// 原单号 + map.put("backCause", data.getBackCause());// 退单原因 + map.put("workNo", data.getWorkNo());// 操作员工号 + map.put("posNo", data.getPosNo());// POS编号 + map.put("pays", new ArrayList>());// 付款信息 + resultDataList.add(map); + resultDataMap.put(data.getId(), map); + resultDataIdList.add(data.getId()); + } + + // 支付信息 + criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", store.getId())); + criteria.add(Restrictions.eq("isInvalid", 0)); + criteria.add(Restrictions.in("ticketId", resultDataIdList)); + List storePayList = storePayService.getList(tenantId, criteria); + List> payList = null; + for (StorePay storePay : storePayList) { + Map ticketInfoMap = resultDataMap.get(storePay.getTicketId()); + payList = (List>) ticketInfoMap.get("pays"); + Map payInfo = new HashMap<>(); + payInfo.put("id", storePay.getId()); + payInfo.put("payNo", storePay.getPayNo());// 付款单号 + payInfo.put("ticketId", storePay.getTicketId());// 销售单ID + payInfo.put("ticketNo", storePay.getBusNo());// 销售单号 + payInfo.put("payTypeNo", storePay.getPayTypeNo());// 付款方式编号 + payInfo.put("payType", storePay.getPayType());// 付款方式 + payInfo.put("paid", doubleFormat(storePay.getPaid()));// 实收金额 + payInfo.put("rchange", doubleFormat(storePay.getRchange()));// 找零金额 + payInfo.put("money", doubleFormat(storePay.getMoney()));// 已收金额 + payInfo.put("overAmount", doubleFormat(storePay.getOverAmount()));// 溢出金额 + payInfo.put("voucherNo", storePay.getVoucherNo());// 凭证号 + payInfo.put("payDate", DateUtils.format(storePay.getPayDate(), DateUtils.SHOW_DATETIME_FORMAT));// 付款时间 + payInfo.put("memo", storePay.getMemo());// 备注 + payList.add(payInfo); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(resultDataList); +// logger.error("门店销售订单列表返回数据>>>>> appKey:"+appKey+" startDate:"+startDate+" endDate:"+endDate+"===== tenantId:"+tenantId+"storeNo:"+storeNo+"JSON:"+JSONObject.toJSONString(response)); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + + return response; + } + + @ServiceMethod(method = "store.sales.day.product.summary", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店营业日菜品明细销售统计") + @Override + public Object storeSalesDayProductSummary(StoreSalesDayProductSummaryRequest request) { + String info = "门店营业日菜品明细销售统计"; + logger.debug("info:" + info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + String startDate = request.getStartDate(); + String endDate = request.getEndDate(); + String seriesId = request.getSeriesId(); + String productNo = request.getProductNo(); + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + if (StringUtils.isBlank(storeId)) { + response.setStatus(0); + response.setMessage("参数storeId不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (StringUtils.isBlank(startDate)) { + response.setStatus(0); + response.setMessage("参数startDate不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (StringUtils.isBlank(endDate)) { + response.setStatus(0); + response.setMessage("参数endDate不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + + Store store = storeService.get(tenantId, storeId); + if (store == null) { + response.setStatus(0); + response.setMessage("门店信息不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.ge("saleDate", startDate)); + criteria.add(Restrictions.le("saleDate", endDate)); + criteria.add(Restrictions.eq("isInvalid", 0)); + criteria.add(Restrictions.eq("storeId", storeId)); + if (StringUtils.isNotBlank(seriesId)) { + criteria.add(Restrictions.eq("seriesId", seriesId)); + } + if (StringUtils.isNotBlank(productNo)) { + criteria.add(Restrictions.eq("productNo", productNo)); + } + criteria.add(Restrictions.group("specId")); + criteria.add(Restrictions.group("DATE_FORMAT(saleDate,'%Y-%m-%d')")); + criteria.add(Restrictions.order("productNo", "asc")); + criteria.add(Restrictions.order("saleDate", "asc")); + pager = storeOrderProductService.getPagerForSalesDayProductSummary(tenantId, criteria, pager); + List> mapList = new ArrayList<>(); + int listCounts = 0; + //获取总数量,总金额; + if(CollectionUtils.isNotEmpty(pager.getList())){ + String countSql = "select specId,DATE_FORMAT(saleDate, '%Y-%m-%d') AS date from cy_store_order_product " + + "WHERE saleDate >= '"+startDate+"' AND saleDate <= '"+endDate+"' " + + "AND isInvalid = 0 AND storeId = '"+storeId+"' AND tenantId = '"+tenantId+"' " ; + if(StringUtils.isNotEmpty(productNo)){ + countSql += " and productNo = '"+productNo+"' "; + } + if(StringUtils.isNotEmpty(seriesId)){ + countSql += " and seriesId = '"+seriesId+"' "; + } + countSql += " GROUP BY specId, DATE_FORMAT(saleDate, '%Y-%m-%d') LIMIT 0 ,100000"; + + List> countList = storeOrderProductService.selectList(tenantId,countSql); + + listCounts = countList.size(); + + String sql = "SELECT SUM(count)as count,SUM(rcount) as rcount,SUM(amount) as amount from cy_store_order_product \n" + + "WHERE tenantId = '"+tenantId+"' and isInvalid = 0 and storeId = '"+storeId+"' " + + "and saleDate >= '"+startDate+"' and saleDate <= '"+endDate+"' "; + if(StringUtils.isNotEmpty(productNo)){ + sql += " and productNo = '"+productNo+"' "; + } + if(StringUtils.isNotEmpty(seriesId)){ + sql += " and seriesId = '"+seriesId+"' "; + } + Map map = storeOrderProductService.selectOne(tenantId,sql); + BigDecimal totalCount = (BigDecimal) map.get("count"); + BigDecimal totalRcount = (BigDecimal) map.get("rcount"); + BigDecimal totalCounts = totalCount.subtract(totalRcount); + BigDecimal totalAmount = (BigDecimal) map.get("amount"); + List> list = (List>) pager.getList(); + for(Map so : list){ + Map object = new HashMap<>(); + object.put("productId",so.get("productId")+""); + object.put("productNo",so.get("productNo")+""); + object.put("productName",so.get("productName")); + object.put("specId",so.get("specId")+""); + object.put("specName",so.get("specName")); + object.put("date",so.get("date")); + BigDecimal count = (BigDecimal) so.get("count"); + BigDecimal rcount = (BigDecimal) so.get("rcount"); + BigDecimal counts = count.subtract(rcount); + object.put("count",counts.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); + object.put("countRate",counts.divide(totalCounts,4,BigDecimal.ROUND_HALF_UP).doubleValue()); + BigDecimal amount = (BigDecimal) so.get("amount"); + BigDecimal discountTotal = (BigDecimal) so.get("discountTotal"); + BigDecimal receivable = (BigDecimal) so.get("receivable"); + object.put("amount",amount.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); + object.put("amountRate",amount.divide(totalAmount,4,BigDecimal.ROUND_HALF_UP).doubleValue()); + object.put("discountTotal",discountTotal.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); + object.put("receivable",receivable.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); + mapList.add(object); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(listCounts%pageSize == 0 ? listCounts/pageSize : (listCounts/pageSize)+1); + response.setTotalCount(listCounts); + response.setList(mapList); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/store/StoreServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/store/StoreServiceImpl.java new file mode 100644 index 0000000..fb5d0b7 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/store/StoreServiceImpl.java @@ -0,0 +1,1282 @@ +package com.jwsaas.api.service.impl.store; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.jwsaas.Constants; +import com.jwsaas.api.request.store.BrandRequest; +import com.jwsaas.api.request.store.StoreAdvertCaptionRequest; +import com.jwsaas.api.request.store.StoreAdvertPictureRequest; +import com.jwsaas.api.request.store.StoreBusinessPlanDetailRequest; +import com.jwsaas.api.request.store.StoreBusinessPlanRequest; +import com.jwsaas.api.request.store.StoreFeeItemListRequest; +import com.jwsaas.api.request.store.StoreListRequest; +import com.jwsaas.api.request.store.StoreMessageRequest; +import com.jwsaas.api.request.store.StorePayModeRequest; +import com.jwsaas.api.request.store.StorePayTypeRequest; +import com.jwsaas.api.request.store.StorePosListRequest; +import com.jwsaas.api.request.store.StorePrintImageRequest; +import com.jwsaas.api.request.store.StoreProductCouponListRequest; +import com.jwsaas.api.request.store.StoretableAreaRequest; +import com.jwsaas.api.request.store.StoretableRequest; +import com.jwsaas.api.request.store.StoretableTypeRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.response.mode.CommonListResponse; +import com.jwsaas.api.response.mode.CommonPagerResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.store.StoreService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.AdvertCaption; +import com.jwsaas.entity.food.AdvertPicture; +import com.jwsaas.entity.food.Brand; +import com.jwsaas.entity.food.BusinessPlan; +import com.jwsaas.entity.food.BusinessPlanDetail; +import com.jwsaas.entity.food.FeeItem; +import com.jwsaas.entity.food.PayMode; +import com.jwsaas.entity.food.PayType; +import com.jwsaas.entity.food.PaymentParameter; +import com.jwsaas.entity.food.PosInfo; +import com.jwsaas.entity.food.PrintImage; +import com.jwsaas.entity.food.Store; +import com.jwsaas.entity.food.Storetable; +import com.jwsaas.entity.food.StoretableArea; +import com.jwsaas.entity.food.StoretableType; +import com.jwsaas.entity.food.YunposSet; +import com.jwsaas.entity.food.YunposSetStore; +import com.jwsaas.entity.ops.TenantStoreAuth; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.pager.Pager; +import com.jwsaas.properties.FdfsClientProperties; +import com.jwsaas.service.food.PosInfoService; +import com.jwsaas.service.food.YunposSetService; +import com.jwsaas.service.food.YunposSetStoreService; +import com.jwsaas.service.ops.TenantStoreAuthService; +import com.jwsaas.util.DateUtils; +import com.jwsaas.util.JSONUtil; +import com.jwsaas.utils.AppKeyUtil; + +@ServiceMethodBean(version = "1.0") +public class StoreServiceImpl extends WopServiceImpl implements StoreService { + + private static final long serialVersionUID = 5844796738519228402L; + + private static final String className = "StoreServiceImpl"; + + @Resource + private TenantStoreAuthService tenantStoreAuthService; + @Resource + private com.jwsaas.service.food.StoreService storeService; + @Resource + private com.jwsaas.service.food.PayTypeService payTypeService; + @Resource + private com.jwsaas.service.food.PayModeService payModeService; + @Resource + private com.jwsaas.service.food.PaymentParameterService paymentParameterService; + @Resource + private com.jwsaas.service.food.BusinessPlanService businessPlanService; + @Resource + private com.jwsaas.service.food.BusinessPlanDetailService businessPlanDetailService; + @Resource + private com.jwsaas.service.food.StoretableAreaService storetableAreaService; + @Resource + private com.jwsaas.service.food.StoretableTypeService storetableTypeService; + @Resource + private com.jwsaas.service.food.StoretableService storetableService; + @Resource + private com.jwsaas.service.food.MakeTypeService makeTypeService; + @Resource + private com.jwsaas.service.food.MakeDetailService makeDetailService; + @Resource + private com.jwsaas.service.food.BrandService brandService; + @Resource + private com.jwsaas.service.food.AdvertPictureService advertPictureService; + @Resource + private com.jwsaas.service.food.AdvertCaptionService advertCaptionService; + @Resource + private com.jwsaas.service.food.PrintImageService printImageService; + @Autowired + private FdfsClientProperties fdfsClientProperties; + @Resource + private PosInfoService posInfoService; + @Resource + private com.jwsaas.service.food.FeeItemService feeItemService; + @Resource + private com.jwsaas.service.food.CouponTicketProductService couponTicketProductService; + @Resource + private YunposSetStoreService yunposSetStoreService; + @Resource + private YunposSetService yunposSetService; + + + @ServiceMethod(method = "store.yun.set", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "POS注册接口") + @Override + public Object storeSet(StorePayTypeRequest request) { + String info = "门店云参数设置"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", request.getStoreId())); + criteria.add(Restrictions.eq("tenantId", tenantId)); + List list2 = yunposSetStoreService.getList(tenantId, criteria); + if (CollectionUtils.isNotEmpty(list2)) { + YunposSetStore yunposSetStore = list2.get(0); + YunposSet yunposSet = this.yunposSetService.get(tenantId, yunposSetStore.getSetId()); + if (yunposSet != null) { + response.setData(com.jwsaas.utils.BeanUtils.convertObjToMap(yunposSet)); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "PAYTYPE_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.message", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店资料") + @Override + public Object storeMessage(StoreMessageRequest request) { + String info = "门店资料"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Store store = storeService.get(tenantId, request.getStoreId()); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + String dfsAccessDomain = fdfsClientProperties.getAccessDomain(); + Map data = new HashMap<>(); + data.put("tenantId", store.getTenantId()); + data.put("id", store.getId()); + data.put("no", store.getNo());// 门店编号 + data.put("name", store.getName());// 门店名称 + data.put("manager", store.getManager());// 负责人 + data.put("tel", store.getTel());// 联系电话 + data.put("mobile", store.getMobile());// 手机号码 + data.put("orderTel", store.getOrderTel());// 订餐电话 + data.put("printName", store.getPrintName());// 打印名称 + data.put("address", store.getAddress());// 地址 + data.put("mail", store.getMail());// 电子邮箱 + data.put("stapleFlag", store.getStapleFlag());// 是否按主食统计人数 + data.put("width", store.getWidth());// 图片宽度 + data.put("height", store.getHeight());// 图片高度 + data.put("longitude", store.getLongitude());// 经度 + data.put("latitude", store.getLatitude());// 纬度 + data.put("storageFileName", store.getStorageFileName());// 存储文件名 + data.put("groupName", store.getGroupName());// 存储组名 + data.put("dfsAccessDomain", dfsAccessDomain);// 文件服务器地址 + data.put("ext1",store.getExt1()); + if(StringUtils.contains(store.getStorageFileName(),"http:")){ + data.put("groupName", "");// 存储组名 + data.put("dfsAccessDomain", "");// 文件服务器地址 + } + data.put("maxOffLine", store.getMaxOffLine());// 最大离线天数 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", request.getStoreId())); + criteria.add(Restrictions.eq("tenantCode", tenantId)); + criteria.add(Restrictions.eq("appSign", "cy2")); + List storeAuthList = tenantStoreAuthService.getList(Constants.DEFAULT_DB_SIGN, criteria); + if (storeAuthList != null && storeAuthList.size() > 0) { + TenantStoreAuth tenantStoreAuth = storeAuthList.get(0); + int costMode = tenantStoreAuth.getCostMode();// 计费模式 + String dueDate = tenantStoreAuth.getDueDate();// 到期时间 + data.put("costMode", costMode);// 计费模式 + data.put("dueDate", dueDate);// 到期时间 + } else { + data.put("costMode", 1);// 计费模式 + data.put("dueDate", "");// 到期时间 + } + data.put("storeTaxRateFlag", store.getStoreTaxRateFlag());//是否启用门店税率; + data.put("saleTax", store.getSaleTax());//销项税; + data.put("lyRate", store.getLyRate());//联营扣率; + data.put("storeRate", store.getStoreRate());//门店扣点; + //品牌美团优惠券核销信息; + List source = brandService.getListBystoreId(tenantId, request.getStoreId()); + Map pbody = new HashMap<>(); + if(CollectionUtils.isNotEmpty(source)){ + Brand brand = source.get(0); + pbody.put("meituanAppKey",brand.getExt1()); + pbody.put("meituanAppSecret",brand.getExt2()); + } + data.put("pbody",pbody); + response.setData(data); + response.setStatus(1); + response.setMessage("获取成功"); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "MESSAGE_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.paytype", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "POS注册接口") + @Override + public Object storePayType(StorePayTypeRequest request) { + String info = "POS注册接口"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + CommonListResponse response = null; + try { + response = new CommonListResponse(); + // Store store = storeService.get(tenantId, request.getStoreId()); + // if (store == null) { + // response.setStatus(0); + // response.setMessage("门店ID不存在"); + // response.setErrCode(CommonErrorCode.error3.getCode()); + // response.setErrMessage(CommonErrorCode.error3.getMessage()); + // return response; + // } + Criteria criteria = new Criteria(); + List source = payTypeService.getList(tenantId, criteria); + List> list = new ArrayList<>(); + for (PayType payType : source) { + Map map = new HashMap<>(); + map.put("tenantId", payType.getTenantId()); + map.put("id", payType.getId()); + map.put("no", payType.getNo()); + map.put("name", payType.getName()); + map.put("sign", payType.getSign()); + list.add(map); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "PAYTYPE_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.paymode", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店收银方式") + @Override + public Object storePayMode(StorePayModeRequest request) { + String info = "门店收银方式"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + CommonListResponse response = null; + try { + response = new CommonListResponse(); + // Store store = storeService.get(tenantId, request.getStoreId()); + // if (store == null) { + // response.setStatus(0); + // response.setMessage("门店ID不存在"); + // response.setErrCode(CommonErrorCode.error3.getCode()); + // response.setErrMessage(CommonErrorCode.error3.getMessage()); + // return response; + // } + List parameterList = this.paymentParameterService.getPaymentParameterByStoreId(tenantId, request.getStoreId()); + // 支付宝 + PaymentParameter alipay = new PaymentParameter(); + // 微信 + PaymentParameter wxpay = new PaymentParameter(); + // 云闪付 + PaymentParameter ysf = new PaymentParameter(); + // 03-银行卡 + PaymentParameter bank = new PaymentParameter(); + if (CollectionUtils.isNotEmpty(parameterList)) { + for (PaymentParameter paymentParameter : parameterList) { + if ("alipay".equals(paymentParameter.getSign()) || "subalipay".equals(paymentParameter.getSign())) { + alipay = paymentParameter; + } else if ("wxpay".equals(paymentParameter.getSign()) || "subwxpay".equals(paymentParameter.getSign())) { + wxpay = paymentParameter; + } else if (StringUtils.equalsIgnoreCase("ylswpos", paymentParameter.getSign())) {// 银联商务POS通 + alipay = paymentParameter; + wxpay = paymentParameter; + } else if (StringUtils.equalsIgnoreCase("kszf", paymentParameter.getSign())) {// 快收支付 + alipay = paymentParameter; + wxpay = paymentParameter; + } else if (StringUtils.equalsIgnoreCase("fbzf", paymentParameter.getSign())) {// 付呗支付 + alipay = paymentParameter; + wxpay = paymentParameter; + } else if (StringUtils.equalsIgnoreCase("ccb", paymentParameter.getSign())) {// 建行支付 + alipay = paymentParameter; + wxpay = paymentParameter; + ysf = paymentParameter; + } else if (StringUtils.equalsIgnoreCase("abc", paymentParameter.getSign())) {// 农行支付 + alipay = paymentParameter; + wxpay = paymentParameter; + ysf = paymentParameter; + } else if (StringUtils.equalsIgnoreCase("ylswmis", paymentParameter.getSign())) {// 银联商务MIS-ylswmis + bank = paymentParameter; + } else if (StringUtils.equalsIgnoreCase("yoo", paymentParameter.getSign())) {// 掌游宝 + alipay = paymentParameter; + wxpay = paymentParameter; + ysf = paymentParameter; + } else if (StringUtils.equalsIgnoreCase("duolabao", paymentParameter.getSign())) {// 哆啦宝 + alipay = paymentParameter; + wxpay = paymentParameter; + } else if (StringUtils.equalsIgnoreCase("fuyou", paymentParameter.getSign())) {// 富有支付 + alipay = paymentParameter; + ysf = paymentParameter; + wxpay = paymentParameter; + } else if (StringUtils.equalsIgnoreCase("upay", paymentParameter.getSign())) {// 银联商务支付 + alipay = paymentParameter; + wxpay = paymentParameter; + } else if (StringUtils.equalsIgnoreCase("saobei", paymentParameter.getSign())) {// 扫呗支付参数 + alipay = paymentParameter; + ysf = paymentParameter; + if (wxpay == null || wxpay.getId() == null) { + wxpay = paymentParameter; + } + } else if (StringUtils.equalsIgnoreCase("leshua", paymentParameter.getSign())) {// 乐刷支付 + alipay = paymentParameter; + wxpay = paymentParameter; + } + } + } + List source = payModeService.getListByStoreId(tenantId, storeId); + List> list = new ArrayList<>(); + for (PayMode payMode : source) { + Map map = new HashMap<>(); + map.put("tenantId", payMode.getTenantId()); + map.put("id", payMode.getId()); + map.put("no", payMode.getNo()); + map.put("name", payMode.getName()); + map.put("typeId", payMode.getTypeId()); + map.put("shortcut", payMode.getShortcut()); + map.put("pointFlag", payMode.getPointFlag()); + map.put("frontFlag", payMode.getFrontFlag()); + map.put("rechargeFlag", payMode.getRechargeFlag()); + map.put("discount", doubleFormat(payMode.getDiscount())); + map.put("fixeAmount", doubleFormat(payMode.getFixeAmount())); + map.put("incomeFlag", payMode.getIncomeFlag()); + map.put("otherRateType", payMode.getOtherRateType());// 三方扣费类型 + map.put("otherRateValue", payMode.getOtherRateValue());// 三方费值 + map.put("otherNo", payMode.getOtherNo());// 第三方编号 + if ("04".equals(payMode.getNo()) && alipay.getPbody() != null) {// 支付宝 + Map pbodyMap = JSONUtil.parseObject(alipay.getPbody(), new TypeReference>() { + }); + map.put("pbody", pbodyMap); + map.put("certText", alipay.getCertText()); + } else if ("05".equals(payMode.getNo()) && wxpay.getPbody() != null) {// 微信 + Map pbodyMap = JSONUtil.parseObject(wxpay.getPbody(), new TypeReference>() { + }); + map.put("pbody", pbodyMap); + map.put("certText", wxpay.getCertText()); + } else if ("07".equals(payMode.getNo()) && ysf.getPbody() != null) {// 云闪付 + Map pbodyMap = JSONUtil.parseObject(ysf.getPbody(), new TypeReference>() { + }); + map.put("pbody", pbodyMap); + map.put("certText", ysf.getCertText()); + } else if ("03".equals(payMode.getNo()) && bank.getPbody() != null) {// 03-银行卡 + Map pbodyMap = JSONUtil.parseObject(bank.getPbody(), new TypeReference>() { + }); + map.put("pbody", pbodyMap); + map.put("certText", bank.getCertText()); + } else {// 通用 + Map pbodyMap = new HashMap<>(); + map.put("pbody", pbodyMap); + map.put("certText", null); + } + list.add(map); + + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "PAYMODE_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.period.discount.paymode", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店不同时间扣率的收银方式") + @Override + public Object storePayModeWithPeriodDiscount(StorePayModeRequest request) { + String info = "门店不同时间扣率的收银方式"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + CommonListResponse response = null; + try { + response = new CommonListResponse(); + // Store store = storeService.get(tenantId, request.getStoreId()); + // if (store == null) { + // response.setStatus(0); + // response.setMessage("门店ID不存在"); + // response.setErrCode(CommonErrorCode.error3.getCode()); + // response.setErrMessage(CommonErrorCode.error3.getMessage()); + // return response; + // } + List parameterList = this.paymentParameterService.getPaymentParameterByStoreId(tenantId, request.getStoreId()); + // 支付宝 + PaymentParameter alipay = new PaymentParameter(); + // 微信 + PaymentParameter wxpay = new PaymentParameter(); + // 云闪付 + PaymentParameter ysf = new PaymentParameter(); + // 03-银行卡 + PaymentParameter bank = new PaymentParameter(); + if (CollectionUtils.isNotEmpty(parameterList)) { + for (PaymentParameter paymentParameter : parameterList) { + if ("alipay".equals(paymentParameter.getSign()) || "subalipay".equals(paymentParameter.getSign())) { + alipay = paymentParameter; + } else if ("wxpay".equals(paymentParameter.getSign()) || "subwxpay".equals(paymentParameter.getSign())) { + wxpay = paymentParameter; + } else if (StringUtils.equalsIgnoreCase("ylswpos", paymentParameter.getSign())) {// 银联商务POS通 + alipay = paymentParameter; + wxpay = paymentParameter; + } else if (StringUtils.equalsIgnoreCase("kszf", paymentParameter.getSign())) {// 快收支付 + alipay = paymentParameter; + wxpay = paymentParameter; + } else if (StringUtils.equalsIgnoreCase("fbzf", paymentParameter.getSign())) {// 付呗支付 + alipay = paymentParameter; + wxpay = paymentParameter; + } else if (StringUtils.equalsIgnoreCase("ccb", paymentParameter.getSign())) {// 建行支付 + alipay = paymentParameter; + wxpay = paymentParameter; + ysf = paymentParameter; + } else if (StringUtils.equalsIgnoreCase("abc", paymentParameter.getSign())) {// 农行支付 + alipay = paymentParameter; + wxpay = paymentParameter; + ysf = paymentParameter; + } else if (StringUtils.equalsIgnoreCase("ylswmis", paymentParameter.getSign())) {// 银联商务MIS-ylswmis + bank = paymentParameter; + } else if (StringUtils.equalsIgnoreCase("yoo", paymentParameter.getSign())) {// 掌游宝 + alipay = paymentParameter; + wxpay = paymentParameter; + ysf = paymentParameter; + } else if (StringUtils.equalsIgnoreCase("duolabao", paymentParameter.getSign())) {// 哆啦宝 + alipay = paymentParameter; + wxpay = paymentParameter; + } else if (StringUtils.equalsIgnoreCase("fuyou", paymentParameter.getSign())) {// 富有支付 + alipay = paymentParameter; + ysf = paymentParameter; + wxpay = paymentParameter; + } else if (StringUtils.equalsIgnoreCase("upay", paymentParameter.getSign())) {// 银联商务支付 + alipay = paymentParameter; + wxpay = paymentParameter; + } else if (StringUtils.equalsIgnoreCase("saobei", paymentParameter.getSign())) {// 扫呗支付参数 + alipay = paymentParameter; + ysf = paymentParameter; + if (wxpay == null || wxpay.getId() == null) { + wxpay = paymentParameter; + } + } else if (StringUtils.equalsIgnoreCase("leshua", paymentParameter.getSign())) {// 乐刷支付 + alipay = paymentParameter; + wxpay = paymentParameter; + } + } + } + List source = payModeService.getListByStoreId(tenantId, storeId); + List> list = new ArrayList<>(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String today = sdf.format(new Date()); + Long todayTime = sdf.parse(today).getTime(); + for (PayMode payMode : source) { + Map map = new HashMap<>(); + map.put("tenantId", payMode.getTenantId()); + map.put("id", payMode.getId()); + map.put("no", payMode.getNo()); + map.put("name", payMode.getName()); + map.put("typeId", payMode.getTypeId()); + map.put("shortcut", payMode.getShortcut()); + map.put("pointFlag", payMode.getPointFlag()); + map.put("frontFlag", payMode.getFrontFlag()); + map.put("rechargeFlag", payMode.getRechargeFlag()); + map.put("discount", doubleFormat(payMode.getDiscount())); + map.put("fixeAmount", doubleFormat(payMode.getFixeAmount())); + map.put("incomeFlag", payMode.getIncomeFlag()); + map.put("otherRateType", payMode.getOtherRateType());// 三方扣费类型 + map.put("otherRateValue", payMode.getOtherRateValue());// 三方费值 + map.put("otherNo", payMode.getOtherNo());// 第三方编号 + JSONArray periodDiscountArray = JSONArray.parseArray(payMode.getPeriodDiscount()); + JSONArray newPeriodDiscountArray = new JSONArray(); + if(CollectionUtils.isNotEmpty(periodDiscountArray)){ + for(Object obj : periodDiscountArray){ + JSONObject jsonObject = JSON.parseObject(obj+""); + //Long startDate = sdf.parse(jsonObject.getString("startDate") + " 00:00:00").getTime(); + String startDates = jsonObject.getString("startDate"); + String endDates = jsonObject.getString("endDate"); + String discount = jsonObject.getString("discount"); + if(StringUtils.isNotEmpty(startDates) && StringUtils.isNotEmpty(endDates) && StringUtils.isNotEmpty(discount)){ + Long endDate = sdf.parse(endDates +" 23:59:59").getTime(); + if(todayTime < endDate){ + newPeriodDiscountArray.add(jsonObject); + } + } + + } + } + map.put("periodDiscount", newPeriodDiscountArray);// 时间扣率; + if ("04".equals(payMode.getNo()) && alipay.getPbody() != null) {// 支付宝 + Map pbodyMap = JSONUtil.parseObject(alipay.getPbody(), new TypeReference>() { + }); + map.put("pbody", pbodyMap); + map.put("certText", alipay.getCertText()); + } else if ("05".equals(payMode.getNo()) && wxpay.getPbody() != null) {// 微信 + Map pbodyMap = JSONUtil.parseObject(wxpay.getPbody(), new TypeReference>() { + }); + map.put("pbody", pbodyMap); + map.put("certText", wxpay.getCertText()); + } else if ("07".equals(payMode.getNo()) && ysf.getPbody() != null) {// 云闪付 + Map pbodyMap = JSONUtil.parseObject(ysf.getPbody(), new TypeReference>() { + }); + map.put("pbody", pbodyMap); + map.put("certText", ysf.getCertText()); + } else if ("03".equals(payMode.getNo()) && bank.getPbody() != null) {// 03-银行卡 + Map pbodyMap = JSONUtil.parseObject(bank.getPbody(), new TypeReference>() { + }); + map.put("pbody", pbodyMap); + map.put("certText", bank.getCertText()); + } else {// 通用 + Map pbodyMap = new HashMap<>(); + map.put("pbody", pbodyMap); + map.put("certText", null); + } + list.add(map); + + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "PAYMODE_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.businessplan", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店营业方案") + @Override + public Object storeBusinessPlan(StoreBusinessPlanRequest request) { + String info = "门店营业方案"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + // Store store = storeService.get(tenantId, request.getStoreId()); + // if (store == null) { + // response.setStatus(0); + // response.setMessage("门店ID不存在"); + // response.setErrCode(CommonErrorCode.error3.getCode()); + // response.setErrMessage(CommonErrorCode.error3.getMessage()); + // return response; + // } + List list = businessPlanService.getBusinessPlanByStoreId(tenantId, storeId); + if (list != null && list.size() > 0) { + BusinessPlan plan = list.get(0); + response.setStatus(1); + response.setMessage("门店营业方案获取成功"); + Map map = new HashMap<>(); + map.put("tenantId", plan.getTenantId()); + map.put("id", plan.getId()); + map.put("no", plan.getNo()); + map.put("name", plan.getName()); + map.put("startType", plan.getStartType()); + map.put("startTime", formatHM(plan.getStartTime())); + map.put("endType", plan.getEndType()); + map.put("endTime", formatHM(plan.getEndTime())); + response.setData(map); + return response; + } else { + response.setStatus(0); + response.setMessage("门店营业方案未定义"); + response.setErrCode(CommonErrorCode.error4.getCode()); + response.setErrMessage(CommonErrorCode.error4.getMessage()); + return response; + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "BUSINESSPLAN_ERROR", request.getWopRequestContext().getLocale()); + } + } + + @ServiceMethod(method = "store.businessplan.detail", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店营业班次") + @Override + public Object storeBusinessPlanDetail(StoreBusinessPlanDetailRequest request) { + String info = "门店营业班次"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + CommonListResponse response = null; + String storeId = request.getStoreId(); + try { + response = new CommonListResponse(); + // Store store = storeService.get(tenantId, request.getStoreId()); + // if (store == null) { + // response.setStatus(0); + // response.setMessage("门店ID不存在"); + // response.setErrCode(CommonErrorCode.error3.getCode()); + // response.setErrMessage(CommonErrorCode.error3.getMessage()); + // return response; + // } + List source = businessPlanDetailService.getBusinessPlanDetailByStoreId(tenantId, storeId); + List> list = new ArrayList<>(); + for (BusinessPlanDetail businessPlanDetail : source) { + Map map = new HashMap<>(); + map.put("tenantId", businessPlanDetail.getTenantId()); + map.put("id", businessPlanDetail.getId()); + map.put("planId", businessPlanDetail.getPlanId()); + map.put("name", businessPlanDetail.getName()); + map.put("startType", businessPlanDetail.getStartType()); + map.put("startTime", formatHM(businessPlanDetail.getStartTime())); + map.put("endType", businessPlanDetail.getEndType()); + map.put("endTime", formatHM(businessPlanDetail.getEndTime())); + list.add(map); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "BUSINESSPLAN_DETAIL_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.table.area", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店餐桌区域") + @Override + public Object storetableArea(StoretableAreaRequest request) { + String info = "POS注册接口"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + CommonListResponse response = null; + try { + response = new CommonListResponse(); + // Store store = storeService.get(tenantId, request.getStoreId()); + // if (store == null) { + // response.setStatus(0); + // response.setMessage("门店ID不存在"); + // response.setErrCode(CommonErrorCode.error3.getCode()); + // response.setErrMessage(CommonErrorCode.error3.getMessage()); + // return response; + // } + List source = storetableAreaService.getListByStoreId(tenantId, request.getStoreId()); + List> list = new ArrayList<>(); + for (StoretableArea storetableArea : source) { + Map map = new HashMap<>(); + map.put("tenantId", storetableArea.getTenantId()); + map.put("id", storetableArea.getId()); + map.put("no", storetableArea.getNo()); + map.put("name", storetableArea.getName()); + list.add(map); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "TABLE_AREA_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.table.type", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店餐桌类型") + @Override + public Object storetableType(StoretableTypeRequest request) { + String info = "POS注册接口"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + CommonListResponse response = null; + try { + response = new CommonListResponse(); + // Store store = storeService.get(tenantId, request.getStoreId()); + // if (store == null) { + // response.setStatus(0); + // response.setMessage("门店ID不存在"); + // response.setErrCode(CommonErrorCode.error3.getCode()); + // response.setErrMessage(CommonErrorCode.error3.getMessage()); + // return response; + // } + List source = storetableTypeService.getListByStoreId(tenantId, request.getStoreId()); + List> list = new ArrayList<>(); + for (StoretableType storetableType : source) { + Map map = new HashMap<>(); + map.put("tenantId", storetableType.getTenantId()); + map.put("id", storetableType.getId()); + map.put("no", storetableType.getNo()); + map.put("name", storetableType.getName()); + map.put("color", storetableType.getColor()); + list.add(map); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "TABLE_TYPE_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.table", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店餐桌信息") + @Override + public Object storeTable(StoretableRequest request) { + String info = "POS注册接口"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + CommonListResponse response = null; + try { + response = new CommonListResponse(); + // Store store = storeService.get(tenantId, request.getStoreId()); + // if (store == null) { + // response.setStatus(0); + // response.setMessage("门店ID不存在"); + // response.setErrCode(CommonErrorCode.error3.getCode()); + // response.setErrMessage(CommonErrorCode.error3.getMessage()); + // return response; + // } + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", request.getStoreId())); + criteria.add(Restrictions.eq("deleteFlag", 0)); + List source = storetableService.getList(tenantId, criteria); + List> list = new ArrayList<>(); + for (Storetable storetable : source) { + Map map = new HashMap<>(); + map.put("tenantId", storetable.getTenantId()); + map.put("id", storetable.getId()); + map.put("storeId", storetable.getStoreId()); + map.put("areaId", storetable.getAreaId()); + map.put("typeId", storetable.getTypeId()); + map.put("no", storetable.getNo()); + map.put("name", storetable.getName()); + map.put("number", storetable.getNumber()); + map.put("aliasName", storetable.getAliasName());// 别名 + map.put("description", storetable.getDescription());// 备注 + list.add(map); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "TABLE_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.brand", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店品牌信息") + @Override + public Object storeBrand(BrandRequest request) { + String info = "门店品牌信息"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + CommonListResponse response = null; + try { + response = new CommonListResponse(); + // Store store = storeService.get(tenantId, request.getStoreId()); + // if (store == null) { + // response.setStatus(0); + // response.setMessage("门店ID不存在"); + // response.setErrCode(CommonErrorCode.error3.getCode()); + // response.setErrMessage(CommonErrorCode.error3.getMessage()); + // return response; + // } + List source = brandService.getListBystoreId(tenantId, request.getStoreId()); + List> list = new ArrayList<>(); + for (Brand brand : source) { + Map map = new HashMap<>(); + map.put("tenantId", brand.getTenantId()); + map.put("id", brand.getId()); + map.put("no", brand.getNo()); + map.put("name", brand.getName()); + map.put("description", brand.getDescription()); + list.add(map); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "BRAND_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.advert.picture", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店广告图片") + @Override + public Object storeAdvertPicture(StoreAdvertPictureRequest request) { + String info = "门店广告图片"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + CommonListResponse response = null; + try { + response = new CommonListResponse(); + // Store store = storeService.get(tenantId, request.getStoreId()); + // if (store == null) { + // response.setStatus(0); + // response.setMessage("门店ID不存在"); + // response.setErrCode(CommonErrorCode.error3.getCode()); + // response.setErrMessage(CommonErrorCode.error3.getMessage()); + // return response; + // } + String dfsAccessDomain = fdfsClientProperties.getAccessDomain(); + List source = advertPictureService.getListBystoreId(tenantId, request.getStoreId()); + List> list = new ArrayList<>(); + for (AdvertPicture advertPicture : source) { + Map map = new HashMap<>(); + map.put("tenantId", advertPicture.getTenantId()); + map.put("id", advertPicture.getId()); + map.put("orderNo", advertPicture.getOrderNo()); + map.put("width", advertPicture.getWidth()); + map.put("height", advertPicture.getHeight()); + map.put("storageFileName", advertPicture.getStorageFileName()); + map.put("groupName", advertPicture.getGroupName()); + map.put("dfsAccessDomain", dfsAccessDomain);// 文件服务器地址 + //2023-05-08判断图片路径是否是包含http + if(StringUtils.contains(advertPicture.getStorageFileName(),"http:")){ + map.put("groupName", ""); + map.put("dfsAccessDomain", ""); + } + + map.put("name", advertPicture.getName()); + list.add(map); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "ADVERT_PICTURE_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.advert.caption", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店广告字幕") + @Override + public Object storeAdvertCaption(StoreAdvertCaptionRequest request) { + + String info = "门店广告字幕"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + CommonListResponse response = null; + try { + response = new CommonListResponse(); + // Store store = storeService.get(tenantId, request.getStoreId()); + // if (store == null) { + // response.setStatus(0); + // response.setMessage("门店ID不存在"); + // response.setErrCode(CommonErrorCode.error3.getCode()); + // response.setErrMessage(CommonErrorCode.error3.getMessage()); + // return response; + // } + List source = advertCaptionService.getListBystoreId(tenantId, request.getStoreId()); + List> list = new ArrayList<>(); + for (AdvertCaption advertCaption : source) { + Map map = new HashMap<>(); + map.put("tenantId", advertCaption.getTenantId()); + map.put("id", advertCaption.getId()); + map.put("name", advertCaption.getName()); + map.put("content", advertCaption.getContent()); + list.add(map); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "ADVERT_CAPTION_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + + } + + @ServiceMethod(method = "store.print.image", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店小票图片") + @Override + public Object storePrintImage(StorePrintImageRequest request) { + String info = "门店小票图片"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + CommonListResponse response = null; + try { + response = new CommonListResponse(); + // Store store = storeService.get(tenantId, request.getStoreId()); + // if (store == null) { + // response.setStatus(0); + // response.setMessage("门店ID不存在"); + // response.setErrCode(CommonErrorCode.error3.getCode()); + // response.setErrMessage(CommonErrorCode.error3.getMessage()); + // return response; + // } + String dfsAccessDomain = fdfsClientProperties.getAccessDomain(); + List source = printImageService.getListBystoreId(tenantId, request.getStoreId()); + List> list = new ArrayList<>(); + for (PrintImage printImage : source) { + Map map = new HashMap<>(); + map.put("id", printImage.getId()); + map.put("tenantId", printImage.getTenantId()); + map.put("type", printImage.getType()); + map.put("name", printImage.getName()); + map.put("width", printImage.getWidth()); + map.put("height", printImage.getHeight()); + map.put("groupName", printImage.getGroupName()); + map.put("dfsAccessDomain", dfsAccessDomain);// 文件服务器地址 + map.put("storageFileName", printImage.getStorageFileName()); + if(StringUtils.contains(printImage.getStorageFileName(),"http:")){ + map.put("dfsAccessDomain", ""); + map.put("groupName", ""); + } + map.put("description", printImage.getDescription()); + list.add(map); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "PRINT_IMAGE_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.pos.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店POS列表") + @Override + public Object storePosList(StorePosListRequest request) { + String info = "门店POS列表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String terminalType = request.getTerminalType(); + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + // Store store = storeService.get(tenantId, request.getStoreId()); + // if (store == null) { + // response.setStatus(0); + // response.setMessage("门店ID不存在"); + // response.setErrCode(CommonErrorCode.error3.getCode()); + // response.setErrMessage(CommonErrorCode.error3.getMessage()); + // return response; + // } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + if (StringUtils.isNotBlank(terminalType)) { + criteria.add(Restrictions.eq("terminalType", terminalType)); + } + criteria.add(Restrictions.eq("deleteFlag", 0)); + criteria.add(Restrictions.eq("storeId", request.getStoreId())); + pager = posInfoService.getPager(tenantId, criteria, pager); + + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List dataList = (List) pager.getList(); + for (PosInfo data : dataList) { + Map map = new HashMap<>(); + map.put("id", data.getId()); + map.put("tenantId", data.getTenantId()); + map.put("terminalType", data.getTerminalType()); + map.put("storeId", data.getStoreId());// 注册门店 + map.put("storeNo", data.getStoreNo());// 注册门店编号 + map.put("posNo", data.getPosNo());// POS编号 + map.put("name", data.getName());// 计算机名称 + map.put("macAddress", data.getMACAddress());// MAC地址 + map.put("description", data.getDescription());// 备注说明 + map.put("aliasName", data.getAliasName());// 别名 + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + + return response; + } + + @ServiceMethod(method = "store.feeitem.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店费用项目列表") + @Override + public Object storeFeeItemList(StoreFeeItemListRequest request) { + String info = "门店费用项目列表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + CommonListResponse response = null; + try { + response = new CommonListResponse(); + // Store store = storeService.get(tenantId, storeId); + // if (store == null) { + // response.setStatus(0); + // response.setMessage("门店ID不存在"); + // response.setErrCode(CommonErrorCode.error3.getCode()); + // response.setErrMessage(CommonErrorCode.error3.getMessage()); + // return response; + // } + + Criteria criteria = new Criteria(); + List dataList = feeItemService.getList(tenantId, criteria); + + if (CollectionUtils.isEmpty(dataList)) { + // 系统默认初始化的值 + List defDataList = new ArrayList<>(); + + FeeItem feeItem01 = new FeeItem(); + feeItem01.setName("营业外收入"); + feeItem01.setType(0); + feeItem01.setEnabled(1); + feeItem01.setOrderNo("1"); + feeItem01.setCreateUser("system"); + defDataList.add(feeItem01); + + FeeItem feeItem02 = new FeeItem(); + feeItem02.setName("营业外支出"); + feeItem02.setType(1); + feeItem02.setEnabled(1); + feeItem02.setOrderNo("2"); + feeItem02.setCreateUser("system"); + defDataList.add(feeItem02); + + feeItemService.save(tenantId, defDataList); + + criteria = new Criteria(); + dataList = feeItemService.getList(tenantId, criteria); + } + + List> list = new ArrayList<>(); + for (FeeItem data : dataList) { + Map map = new HashMap<>(); + map.put("tenantId", data.getTenantId()); + map.put("id", data.getId()); + map.put("name", data.getName());// 名称 + map.put("type", data.getType());// 类型 + map.put("enabled", data.getEnabled());// 是否启用 + map.put("orderNo", data.getOrderNo());// 显示序号 + list.add(map); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "store.product.coupon.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店商品优惠券") + @Override + public Object storeProductCouponList(StoreProductCouponListRequest request) { + String info = "门店商品优惠券"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + // Store store = storeService.get(tenantId, storeId); + // if (store == null) { + // response.setStatus(0); + // response.setMessage("门店ID不存在"); + // response.setErrCode(CommonErrorCode.error3.getCode()); + // response.setErrMessage(CommonErrorCode.error3.getMessage()); + // return response; + // } + + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.ge("ct.endDate", DateUtils.format(new Date(), DateUtils.SHOW_DATE_FORMAT))); + criteria.add(Restrictions.eq("ct.status", 1));// 已审核 + pager = couponTicketProductService.getPagerByStoreId(tenantId, storeId, criteria, pager); + + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List> dataList = (List>) pager.getList(); + for (Map data : dataList) { + Map map = new HashMap<>(); + map.put("id", data.get("id")); + map.put("tenantId", data.get("tenantId")); + map.put("ticketId", data.get("ticketId")); + map.put("ticketNo", data.get("ticketNo")); + // map.put("no", data.get("no")); + map.put("storeId", storeId); + map.put("productId", data.get("productId")); + map.put("specId", data.get("specId")); + map.put("couponPrice", data.get("couponPrice")); + map.put("description", data.get("description")); + map.put("startDate", data.get("startDate")); + map.put("startTime", data.get("startTime")); + map.put("endDate", data.get("endDate")); + map.put("endTime", data.get("endTime")); + map.put("weekDays", data.get("weekDays")); + // map.put("status", data.get("status")); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + + return response; + } + + @ServiceMethod(method = "store.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店列表") + @Override + public Object storeList(StoreListRequest request) { + String info = "门店列表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + CommonListResponse response = null; + try { + response = new CommonListResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("deleteFlag", 0)); + criteria.add(Restrictions.limit("0", "20000")); + List source = storeService.getList(tenantId, criteria); + List> list = new ArrayList<>(); + for (Store store : source) { + Map map = new HashMap<>(); + map.put("tenantId", store.getTenantId()); + map.put("id", store.getId()); + map.put("no", store.getNo());// 门店编号 + map.put("name", store.getName());// 门店名称 + list.add(map); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/store/StoreShelfServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/store/StoreShelfServiceImpl.java new file mode 100644 index 0000000..d1fe7c3 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/store/StoreShelfServiceImpl.java @@ -0,0 +1,424 @@ +package com.jwsaas.api.service.impl.store; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import org.apache.commons.lang3.StringUtils; + +import com.alibaba.fastjson.JSON; +import com.jwsaas.Constant; +import com.jwsaas.api.request.store.StoreGoodsRequest; +import com.jwsaas.api.request.store.StoreShelfRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.response.mode.CommonPagerResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.store.StoreShelfService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.ProductKitPlan; +import com.jwsaas.entity.food.ProductSpec; +import com.jwsaas.entity.food.ProductType; +import com.jwsaas.entity.food.StoreProduct; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.pager.Pager; +import com.jwsaas.util.JSONUtil; +import com.jwsaas.utils.AppKeyUtil; + +@ServiceMethodBean(version = "1.0") +public class StoreShelfServiceImpl extends WopServiceImpl implements StoreShelfService { + private static final long serialVersionUID = 1L; + + private static final String className = "StoreShelfServiceImpl"; + + @Resource + private com.jwsaas.service.food.StoreService storeService; + @Resource + private com.jwsaas.service.food.BrandService brandService; + @Resource + private com.jwsaas.service.food.ProductTypeService productTypeService; + @Resource + private com.jwsaas.service.food.ProductSpecService productSpecService; + @Resource + private com.jwsaas.service.food.StoreProductService storeProductService; + @Resource + private com.jwsaas.service.food.ProductKitPlanService productKitPlanService; + + /*** + * 门店已上架商品信息列表 + */ + @SuppressWarnings("unchecked") + @ServiceMethod(method = "store.onShelfed.goods", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店已上架商品信息列表") + @Override + public Object storeOnShelfedGoods(StoreGoodsRequest request) { + String info = "门店已上架商品信息列表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + String categoryId = request.getCategoryId(); + String brandIds = request.getBrandIds(); + String property = request.getProperty(); + String keyword = request.getKeyword(); + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + + // 查询商品 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("p.deleteFlag", 0)); + if (StringUtils.isNotBlank(keyword)) { + criteria.add(Restrictions.or(Restrictions.or(Restrictions.like("p.name", "%" + keyword + "%"), Restrictions.like("p.spell", "%" + keyword + "%")), Restrictions.or(Restrictions.like("p.no", "%" + keyword + "%"), Restrictions.like("p.barCode", "%" + keyword + "%")))); + } + if (StringUtils.isNotBlank(categoryId)) { + ProductType productType = productTypeService.get(tenantId, categoryId); + if (productType != null) { + criteria.add(Restrictions.like("sp.typePath", productType.getPath() + "%")); + } + } + if (StringUtils.isNotBlank(brandIds)) { + criteria.add(Restrictions.eq("p.brandId", brandIds)); + } + + criteria.add(Restrictions.eq("p.stopFlag", 0)); + criteria.add(Restrictions.lt("p.type", 10)); + criteria.add(Restrictions.eq("sp.storeId", storeId)); + criteria.add(Restrictions.eq("ps.deleteFlag", 0)); + criteria.add(Restrictions.order("p.no", "asc")); + criteria.add(Restrictions.order("ps.no", "asc")); + pager = storeProductService.getPagerExtend(tenantId, criteria, pager); + List productList = (List) pager.getList(); + + // 筛选指定品牌商品 + List> list = new ArrayList>(); + for (StoreProduct product : productList) { + Map map = JSONUtil.parseObject(JSON.toJSONString(product), Map.class); + map.put("name", product.getProductName()); + list.add(map); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /*** + * 门店未上架商品信息 + */ + @ServiceMethod(method = "store.unShelf.goods", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店未上架商品信息") + @Override + public Object storeUnShelfGoods(StoreGoodsRequest request) { + String info = "门店未上架商品信息"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + String categoryId = request.getCategoryId(); + String brandIds = request.getBrandIds(); + String property = request.getProperty(); + String keyword = request.getKeyword(); + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + + // 查询商品 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("p.deleteFlag", 0)); + //criteria.add(Restrictions.eq("p.selfFlag", 0));查找门店自制商品,和未上架公共商品; + criteria.add(Restrictions.or(Restrictions.eq("p.storeId",storeId),Restrictions.eq("p.selfFlag", 0))); + if (StringUtils.isNotBlank(keyword)) { + criteria.add(Restrictions.or(Restrictions.or(Restrictions.like("p.name", "%" + keyword + "%"), Restrictions.like("p.spell", "%" + keyword + "%")), Restrictions.or(Restrictions.like("p.no", "%" + keyword + "%"), Restrictions.like("p.barCode", "%" + keyword + "%")))); + } + if (StringUtils.isNotBlank(categoryId)) { + ProductType productType = productTypeService.get(tenantId, categoryId); + if (productType != null) { + criteria.add(Restrictions.like("p.typePath", productType.getPath() + "%")); + } + } + if (StringUtils.isNotBlank(brandIds)) { + criteria.add(Restrictions.eq("p.brandId", brandIds)); + } + criteria.add(Restrictions.eq("p.stopFlag", 0)); + criteria.add(Restrictions.lt("p.type", 10)); + criteria.add(Restrictions.eq("ps.deleteFlag", 0)); + criteria.add(Restrictions.order("p.no", "asc")); + criteria.add(Restrictions.order("ps.no", "asc")); + pager = productSpecService.getPagerOffShelfBySteps(tenantId, storeId, criteria, pager); + // 筛选指定品牌商品 + List productSpecList = (List) pager.getList(); + List> list = new ArrayList>(); + for (ProductSpec productSpec : productSpecList) { + Map map = JSONUtil.parseObject(JSON.toJSONString(productSpec), Map.class); + map.put("specId", productSpec.getId()); + map.put("specName", productSpec.getName()); + map.put("name", productSpec.getProductName()); + list.add(map); + } + + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 商品上架 + */ + @ServiceMethod(method = "store.goods.onShelf", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "商品上架") + @Override + public Object storeGoodsOnShelf(StoreShelfRequest request) { + String info = "商品上架"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + int isAll = request.getIsAll(); + String ids = request.getIds(); + logger.debug(info + " storeId:" + storeId); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + + // 世界茶饮 和 南鸭榜 暂不开通调价权限 + if (StringUtils.equals(tenantId, "210008") || StringUtils.equals(tenantId, "771028")) { + response.setStatus(0); + response.setMessage("抱歉,未开通此服务"); + response.setErrCode(CommonErrorCode.error9.getCode()); + response.setErrMessage(CommonErrorCode.error9.getMessage()); + return response; + } + +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } +// logger.debug(info + " storeNo:" + store.getNo() + " storeName:" + store.getName()); + boolean flag = isAll == 1 ? true : false; + logger.debug("isAll:" + flag); + logger.debug("productSpecIds:" + ids); + + List productSpecIdList = Arrays.asList(StringUtils.split(ids, ",")); + storeProductService.saveStoreProductWithStoreId(tenantId, storeId, flag, productSpecIdList, Constant.CREATE_USER); + logger.debug(info + " 完成"); + response.setStatus(1); + response.setMessage("上架成功"); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "MESSAGE_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 商品下架 + */ + @ServiceMethod(method = "store.goods.offShelf", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "商品下架") + @Override + public Object storeGoodsOffShelf(StoreShelfRequest request) { + String info = "商品下架"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + int isAll = request.getIsAll(); + String ids = request.getIds(); + logger.debug(info + " storeId:" + storeId); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + + // 世界茶饮 和 南鸭榜 暂不开通调价权限 + if (StringUtils.equals(tenantId, "210008") || StringUtils.equals(tenantId, "771028")) { + response.setStatus(0); + response.setMessage("抱歉,未开通此服务"); + response.setErrCode(CommonErrorCode.error9.getCode()); + response.setErrMessage(CommonErrorCode.error9.getMessage()); + return response; + } + +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } +// logger.debug(info + " storeNo:" + store.getNo() + " storeName:" + store.getName()); + boolean flag = isAll == 1 ? true : false; + logger.debug("isAll:" + flag); + logger.debug("productSpecIds:" + ids); + + List storeProductIdList = Arrays.asList(StringUtils.split(ids, ",")); + + storeProductService.deleteStoreProductWithStoreId(tenantId, storeId, flag, storeProductIdList, Constant.CREATE_USER); + + logger.debug(info + " 完成"); + response.setStatus(1); + response.setMessage("上架成功"); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "MESSAGE_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /*** + * 门店已上架商品信息列表 + */ + @SuppressWarnings("unchecked") + @ServiceMethod(method = "store.shelfed.goods", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店自建商品信息列表") + @Override + public Object storeShelfedGoods(StoreGoodsRequest request) { + String info = "门店已上架商品信息列表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + String categoryId = request.getCategoryId(); + String brandIds = request.getBrandIds(); + String property = request.getProperty(); + String keyword = request.getKeyword(); + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + + // 查询商品 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("p.deleteFlag", 0)); + if (StringUtils.isNotBlank(keyword)) { + criteria.add(Restrictions.or(Restrictions.or(Restrictions.like("p.name", "%" + keyword + "%"), Restrictions.like("p.spell", "%" + keyword + "%")), Restrictions.or(Restrictions.like("p.no", "%" + keyword + "%"), Restrictions.like("p.barCode", "%" + keyword + "%")))); + } + if (StringUtils.isNotBlank(categoryId)) { + ProductType productType = productTypeService.get(tenantId, categoryId); + if (productType != null) { + criteria.add(Restrictions.like("sp.typePath", productType.getPath() + "%")); + } + } + if (StringUtils.isNotBlank(brandIds)) { + criteria.add(Restrictions.eq("p.brandId", brandIds)); + } + + criteria.add(Restrictions.eq("p.stopFlag", 0)); + criteria.add(Restrictions.lt("p.type", 10)); + criteria.add(Restrictions.eq("sp.storeId", storeId)); + criteria.add(Restrictions.eq("ps.deleteFlag", 0)); + criteria.add(Restrictions.order("p.no", "asc")); + criteria.add(Restrictions.order("ps.no", "asc")); + criteria.add(Restrictions.eq("p.storeId", storeId)); + criteria.add(Restrictions.eq("p.selfFlag", 1)); + pager = storeProductService.getPagerExtend(tenantId, criteria, pager); + List productList = (List) pager.getList(); + + // 筛选指定品牌商品 + List> list = new ArrayList>(); + for (StoreProduct product : productList) { + Map map = JSONUtil.parseObject(JSON.toJSONString(product), Map.class); + criteria = new Criteria(); + criteria.add(Restrictions.eq("productId", product.getProductId())); + criteria.add(Restrictions.eq("storeId", storeId)); + List kitPlanList = productKitPlanService.getList(tenantId, criteria); + if(kitPlanList!=null && kitPlanList.size()>0){ + map.put("kitPlanId", kitPlanList.get(0).getChuda()); + }else{ + map.put("kitPlanId", ""); + } + map.put("name", product.getProductName()); + list.add(map); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/upload/UploadExtendServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/upload/UploadExtendServiceImpl.java new file mode 100644 index 0000000..b97a887 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/upload/UploadExtendServiceImpl.java @@ -0,0 +1,999 @@ +package com.jwsaas.api.service.impl.upload; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; + +import com.alibaba.fastjson.JSONObject; +import com.jwsaas.api.entity.upload.StoreBusinessTicketDeliveryEntity; +import com.jwsaas.api.entity.upload.StoreBusinessTicketExtendEntity; +import com.jwsaas.api.entity.upload.StoreBusinessTicketInfoExtendEntity; +import com.jwsaas.api.entity.upload.StoreBusinessTicketTableEntity; +import com.jwsaas.api.entity.upload.StoreOrderProductExtendEntity; +import com.jwsaas.api.entity.upload.StoreOrderProductInfoExtendEntity; +import com.jwsaas.api.entity.upload.StoreOrderProductMakeExtendEntity; +import com.jwsaas.api.entity.upload.StorePayExtendEntity; +import com.jwsaas.api.request.upload.BusinessOrderUploadExtendRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.upload.UploadExtendService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.BusinessOrderUpload; +import com.jwsaas.entity.food.ProductType; +import com.jwsaas.entity.food.Store; +import com.jwsaas.entity.food.StoreBusinessTicket; +import com.jwsaas.entity.food.StoreBusinessTicketDelivery; +import com.jwsaas.entity.food.StoreBusinessTicketInfo; +import com.jwsaas.entity.food.StoreBusinessTicketTable; +import com.jwsaas.entity.food.StoreOrderProduct; +import com.jwsaas.entity.food.StoreOrderProductInfo; +import com.jwsaas.entity.food.StoreOrderProductMake; +import com.jwsaas.entity.food.StorePay; +import com.jwsaas.entity.food.TicketPrintSetting; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.reactor.event.EventKeys; +import com.jwsaas.service.food.TicketPrintSettingService; +import com.jwsaas.util.JSONUtil; +import com.jwsaas.utils.AppKeyUtil; +import com.jwsaas.utils.MathUtil; + +import reactor.bus.Event; + +@ServiceMethodBean(version = "1.0") +public class UploadExtendServiceImpl extends WopServiceImpl implements UploadExtendService { + + private static final long serialVersionUID = -8534303548361409418L; + + @Resource + private com.jwsaas.service.food.StoreService storeService; + @Resource + private com.jwsaas.service.food.StoreBusinessTicketService storeBusinessTicketService; + @Resource + private TicketPrintSettingService settingService; + @Resource + private com.jwsaas.service.food.ProductTypeService productTypeService; + + @ServiceMethod(method = "upload.business.order.extend", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "销售单上传接口(扩展)") + @Override + public Object businessOrderUploadExtend(BusinessOrderUploadExtendRequest request) { + String info = "销售单上传接口(扩展)"; + logger.debug(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + CommonDataResponse response = null; + BusinessOrderUpload businessOrderUpload = new BusinessOrderUpload(); + try { + response = new CommonDataResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error998.getCode()); +// response.setErrMessage(CommonErrorCode.error998.getMessage()); +// return response; +// } + String jsonString = request.getJsonString(); + JSONObject json = JSONObject.parseObject(jsonString); + logger.debug("jsonString:" + jsonString); + logger.debug("json.json:" + JSONUtil.toJSONString(json)); + + // 销售单据校验开始 + StoreBusinessTicketExtendEntity entity = new StoreBusinessTicketExtendEntity(json); + StoreBusinessTicket storeBusinessTicket = new StoreBusinessTicket(); + Date createDate = new Date(); + storeBusinessTicket.setCreateDate(createDate); + storeBusinessTicket.setCreateUser("open-api"); + if (entity.getClientId() == null || "".equals(entity.getClientId()) || entity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("前台系统ID参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setClientId(entity.getClientId()); + } + if (entity.getNo() == null || "".equals(entity.getNo()) || entity.getNo().length() > 32) { + response.setStatus(0); + response.setMessage("主单No参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setNo(entity.getNo()); + } + //去掉id长度不能大于18的校验 2020-04-29 11:17 + //if (entity.getStoreId() == null || "".equals(entity.getStoreId()) || entity.getStoreId().length() > 18) { + if (entity.getStoreId() == null || "".equals(entity.getStoreId())) { + response.setStatus(0); + response.setMessage("主单storeId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setStoreId(entity.getStoreId()); + } + if (entity.getStoreNo() != null && entity.getStoreNo().length() > 32) { + response.setStatus(0); + response.setMessage("主单storeNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setStoreNo(entity.getStoreNo()); + } + if (entity.getStoreName() != null && entity.getStoreName().length() > 500) { + response.setStatus(0); + response.setMessage("主单storeName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setStoreName(entity.getStoreName()); + } + storeBusinessTicket.setStatus(entity.getStatus()); + if (entity.getWorkNo() != null && entity.getWorkNo().length() > 16) { + response.setStatus(0); + response.setMessage("主单WorkNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setWorkNo(entity.getWorkNo()); + } + storeBusinessTicket.setSaleDate(entity.getSaleDate()); + if (entity.getTableNo() != null && entity.getTableNo().length() > 16) { + response.setStatus(0); + response.setMessage("主单TableNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setTableNo(entity.getTableNo()); + storeBusinessTicket.setTableName(entity.getTableName()); + } + storeBusinessTicket.setPeople(entity.getPeople()); + storeBusinessTicket.setBusMode(entity.getBusMode()); + if (entity.getShiftNo() != null && entity.getShiftNo().length() > 16) { + response.setStatus(0); + response.setMessage("主单shiftNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setShiftNo(entity.getShiftNo()); + } + if (entity.getShiftName() != null && entity.getShiftName().length() > 32) { + response.setStatus(0); + response.setMessage("主单shiftName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setShiftName(entity.getShiftName()); + } + storeBusinessTicket.setAmount(entity.getAmount()); + storeBusinessTicket.setDiscount(entity.getDiscount()); + storeBusinessTicket.setDiscountTotal(entity.getDiscountTotal()); + storeBusinessTicket.setReceivable(entity.getReceivable()); + storeBusinessTicket.setMaling(entity.getMaling()); + if (entity.getPaid() == null || entity.getPaid() == 0) { + storeBusinessTicket.setPaid(entity.getReceivable() - entity.getMaling()); + } else { + storeBusinessTicket.setPaid(entity.getPaid()); + } + if (entity.getNoOrg() != null && entity.getNoOrg().length() > 32) { + response.setStatus(0); + response.setMessage("主单NoOrg参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setNoOrg(entity.getNoOrg()); + } + if (entity.getBackCause() != null && entity.getBackCause().length() > 128) { + response.setStatus(0); + response.setMessage("主单BackCause参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setBackCause(entity.getBackCause()); + } + storeBusinessTicket.setIsMember(entity.getIsMember()); + if (entity.getMemberNo() != null && entity.getMemberNo().length() > 32) { + response.setStatus(0); + response.setMessage("主MemberNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setMemberNo(entity.getMemberNo()); + } + storeBusinessTicket.setMemberJifen(entity.getMemberJifen()); + if (entity.getDeviceName() != null && entity.getDeviceName().length() > 64) { + response.setStatus(0); + response.setMessage("主DeviceName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setDeviceName(entity.getDeviceName()); + } + if (entity.getPosNo() != null && entity.getPosNo().length() > 64) { + response.setStatus(0); + response.setMessage("主PosNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setPosNo(entity.getPosNo()); + } + if (entity.getDeviceIp() != null && entity.getDeviceIp().length() > 256) { + response.setStatus(0); + response.setMessage("主deviceIp参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setDeviceIp(entity.getDeviceIp()); + } + if (entity.getDeviceMac() != null && entity.getDeviceMac().length() > 1024) { + response.setStatus(0); + response.setMessage("主deviceMac参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setDeviceMac(entity.getDeviceMac()); + } + + /** ------2017-12-21 增加当日流水号以及成本等信息 Begin------ **/ + storeBusinessTicket.setSeqNo(entity.getSeqNo());// 当日流水号 + storeBusinessTicket.setWeather(entity.getWeather());// 天气 + storeBusinessTicket.setWeeker(entity.getWeeker());// 星期 + storeBusinessTicket.setEstimatedCost(entity.getEstimatedCost() == null ? 0D : entity.getEstimatedCost());// 预估成本 + storeBusinessTicket.setEstimatedProfitAmount(entity.getEstimatedProfitAmount() == null ? storeBusinessTicket.getPaid() : entity.getEstimatedProfitAmount());// 预估毛利金额 + if (entity.getEstimatedProfitMargin() == null) { + if (MathUtil.eq(BigDecimal.ZERO, new BigDecimal(storeBusinessTicket.getReceivable()))) { + storeBusinessTicket.setEstimatedProfitMargin(0D);// 预估毛利率 + } else { + storeBusinessTicket.setEstimatedProfitMargin( + MathUtil.multiply(new BigDecimal(100), MathUtil.divide(new BigDecimal(storeBusinessTicket.getEstimatedProfitAmount()), new BigDecimal(storeBusinessTicket.getReceivable())), + 4, BigDecimal.ROUND_HALF_UP).doubleValue());// 预估毛利率 + } + } else { + storeBusinessTicket.setEstimatedProfitMargin(entity.getEstimatedProfitMargin());// 预估毛利率 + } + storeBusinessTicket.setTotalCost(entity.getTotalCost() == null ? storeBusinessTicket.getEstimatedCost() : entity.getTotalCost());// 实际成本 + storeBusinessTicket.setProfitAmount(entity.getProfitAmount() == null ? storeBusinessTicket.getEstimatedProfitAmount() : entity.getProfitAmount());// 实际毛利金额 + storeBusinessTicket.setProfitMargin(entity.getProfitMargin() == null ? storeBusinessTicket.getEstimatedProfitMargin() : entity.getProfitMargin());// 实际毛利率 + /** ------2017-12-21 增加当日流水号以及成本等信息 End------ **/ + + // 前台销售单优惠明细校验开始 + List ticketInfoList = new ArrayList<>(); + List storeBusinessTicketInfoEntityList = entity.getTicketInfo(); + if (storeBusinessTicketInfoEntityList != null && storeBusinessTicketInfoEntityList.size() > 0) { + for (StoreBusinessTicketInfoExtendEntity storeBusinessTicketInfoEntity : storeBusinessTicketInfoEntityList) { + StoreBusinessTicketInfo storeBusinessTicketInfo = new StoreBusinessTicketInfo(); + storeBusinessTicketInfo.setCreateDate(createDate); + storeBusinessTicketInfo.setCreateUser("open-api"); + if (storeBusinessTicketInfoEntity.getClientId() == null || "".equals(storeBusinessTicketInfoEntity.getClientId()) || storeBusinessTicketInfoEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("销售单优惠ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicketInfo.setClientId(storeBusinessTicketInfoEntity.getClientId()); + } + storeBusinessTicketInfo.setStoreId(entity.getStoreId()); + storeBusinessTicketInfo.setBusNo(entity.getNo()); + storeBusinessTicketInfo.setType(storeBusinessTicketInfoEntity.getType()); + if (storeBusinessTicketInfoEntity.getInfo() != null && storeBusinessTicketInfoEntity.getInfo().length() > 256) { + response.setStatus(0); + response.setMessage("销售单优惠Info参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicketInfo.setInfo(storeBusinessTicketInfoEntity.getInfo()); + } + storeBusinessTicketInfo.setDiscountMoney(storeBusinessTicketInfoEntity.getDiscountMoney()); + storeBusinessTicketInfo.setSaleDate(entity.getSaleDate()); + // 前台销售单优惠明细扩展信息,2018-04-20 + // storeBusinessTicketInfo.setTableNo(StringUtils.isBlank(storeBusinessTicketInfoEntity.getTableNo()) ? null : storeBusinessTicketInfoEntity.getTableNo()); + // storeBusinessTicketInfo.setTableName(StringUtils.isBlank(storeBusinessTicketInfoEntity.getTableName()) ? null : storeBusinessTicketInfoEntity.getTableName()); + storeBusinessTicketInfo.setExt1(StringUtils.isBlank(storeBusinessTicketInfoEntity.getExt1()) ? null : storeBusinessTicketInfoEntity.getExt1()); + storeBusinessTicketInfo.setExt2(StringUtils.isBlank(storeBusinessTicketInfoEntity.getExt2()) ? null : storeBusinessTicketInfoEntity.getExt2()); + storeBusinessTicketInfo.setExt3(StringUtils.isBlank(storeBusinessTicketInfoEntity.getExt3()) ? null : storeBusinessTicketInfoEntity.getExt3()); + ticketInfoList.add(storeBusinessTicketInfo); + } + } + // 门店菜品销售记录校验开始 + List orderProductList = new ArrayList<>(); + List storeOrderProductEntityList = entity.getOrderProduct(); + // 销售明细优惠 + List orderProductInfoList = new ArrayList<>(); + // 销售明细做法 + List makeList = new ArrayList<>(); + if (storeOrderProductEntityList != null && storeOrderProductEntityList.size() > 0) { + int lineNo = 0; + for (StoreOrderProductExtendEntity storeOrderProductEntity : storeOrderProductEntityList) { + StoreOrderProduct storeOrderProduct = new StoreOrderProduct(); + storeOrderProduct.setCreateDate(createDate); + storeOrderProduct.setCreateUser("open-api"); + if (storeOrderProductEntity.getClientId() == null || "".equals(storeOrderProductEntity.getClientId()) || storeOrderProductEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ID参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setClientId(storeOrderProductEntity.getClientId()); + } + if (storeOrderProductEntity.getParentId() != null && storeOrderProductEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ParentId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setParentId(storeOrderProductEntity.getParentId()); + } + storeOrderProduct.setBusNo(entity.getNo()); + storeOrderProduct.setStoreId(entity.getStoreId()); + storeOrderProduct.setStoreNo(entity.getStoreNo()); + storeOrderProduct.setStoreName(entity.getStoreName()); + //去掉id长度不能大于18的校验 2020-04-29 11:17 +// if (storeOrderProductEntity.getProductId() == null || "".equals(storeOrderProductEntity.getProductId()) || storeOrderProductEntity.getProductId().length() > 18 +// || Long.parseLong(storeOrderProductEntity.getProductId()) < 0) { + if (storeOrderProductEntity.getProductId() == null || "".equals(storeOrderProductEntity.getProductId()) || Long.parseLong(storeOrderProductEntity.getProductId()) < 0) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductId(storeOrderProductEntity.getProductId()); + } + if (storeOrderProductEntity.getProductNo() != null && storeOrderProductEntity.getProductNo().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductNo(storeOrderProductEntity.getProductNo()); + } + if (storeOrderProductEntity.getProductName() == null || "".equals(storeOrderProductEntity.getProductName()) || storeOrderProductEntity.getProductName().length() > 128) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductName(storeOrderProductEntity.getProductName()); + } + if (storeOrderProductEntity.getProductUnitId() != null && storeOrderProductEntity.getProductUnitId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductUnitId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductUnitId(storeOrderProductEntity.getProductUnitId()); + } + if (storeOrderProductEntity.getProductUnitName() != null && storeOrderProductEntity.getProductUnitName().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductUnitName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductUnitName(storeOrderProductEntity.getProductUnitName()); + } + if (storeOrderProductEntity.getTypeId() != null && storeOrderProductEntity.getTypeId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录TypeId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setTypeId(storeOrderProductEntity.getTypeId()); + } + // =======2018-10-10 根据分类ID补全分类所属大类的ID、大类的名称、类别路径 + if (storeOrderProductEntity.getSeriesId() != null && storeOrderProductEntity.getSeriesId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SeriesId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSeriesId(storeOrderProductEntity.getSeriesId()); + } + if (storeOrderProductEntity.getSeriesName()!= null && storeOrderProductEntity.getSeriesName().length() > 64) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SeriesName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSeriesName(storeOrderProductEntity.getSeriesName()); + } + if (storeOrderProductEntity.getTypePath()!= null && storeOrderProductEntity.getTypePath().length() > 256) { + response.setStatus(0); + response.setMessage("门店菜品销售记录TypePath参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setTypePath(storeOrderProductEntity.getTypePath()); + } + // ===============END + if (storeOrderProductEntity.getTypeName() != null && storeOrderProductEntity.getTypeName().length() > 64) { + response.setStatus(0); + response.setMessage("门店菜品销售记录TypeName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setTypeName(storeOrderProductEntity.getTypeName()); + } + if (storeOrderProductEntity.getSpecId() != null && storeOrderProductEntity.getSpecId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SpecId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSpecId(storeOrderProductEntity.getSpecId()); + } + if (storeOrderProductEntity.getSpecName() != null && storeOrderProductEntity.getSpecName().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SpecName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSpecName(storeOrderProductEntity.getSpecName()); + } + storeOrderProduct.setCount(storeOrderProductEntity.getCount()); + storeOrderProduct.setRcount(storeOrderProductEntity.getRcount()); + storeOrderProduct.setPrice(storeOrderProductEntity.getPrice()); + storeOrderProduct.setDiscountPrice(storeOrderProductEntity.getDiscountPrice()); + storeOrderProduct.setPriceOrg(storeOrderProductEntity.getPriceOrg()); + storeOrderProduct.setIsSuit(storeOrderProductEntity.getIsSuit()); + if (storeOrderProductEntity.getSuitId() != null && storeOrderProductEntity.getSuitId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SuitId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSuitId(storeOrderProductEntity.getSuitId()); + } + if (storeOrderProductEntity.getSuitId() != null && storeOrderProductEntity.getSuitId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SuitId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSuitId(storeOrderProductEntity.getSuitId()); + } + storeOrderProduct.setWorkerNo(entity.getWorkNo()); + storeOrderProduct.setSaleDate(entity.getSaleDate());// 订单时间和销售时间一致 + storeOrderProduct.setDeviceName(entity.getDeviceName()); + storeOrderProduct.setDeviceMac(entity.getDeviceMac()); + storeOrderProduct.setDeviceIp(entity.getDeviceIp()); + storeOrderProduct.setPosNo(entity.getPosNo()); + storeOrderProduct.setAmount(storeOrderProductEntity.getAmount()); + storeOrderProduct.setDiscount(storeOrderProductEntity.getDiscount()); + storeOrderProduct.setDiscountTotal(storeOrderProductEntity.getDiscountTotal()); + storeOrderProduct.setReceivable(storeOrderProductEntity.getReceivable()); + storeOrderProduct.setAddPriceTotal(storeOrderProductEntity.getAddPriceTotal()); + storeOrderProduct.setDiscountAddTotal(storeOrderProductEntity.getDiscountAddTotal()); + storeOrderProduct.setAmountAddTotal(storeOrderProductEntity.getAmountAddTotal()); + storeOrderProduct.setAmountTotal(storeOrderProductEntity.getAmountTotal()); + storeOrderProduct.setReceivableTotal(storeOrderProductEntity.getReceivableTotal()); + storeOrderProduct.setIsMember(entity.getIsMember()); + storeOrderProduct.setMemberNo(entity.getMemberNo()); + + /** ------2017-12-21 增加当日流水号以及成本等信息 Begin------ **/ + lineNo++; + storeOrderProduct.setSeqNo(storeBusinessTicket.getSeqNo());// 当日流水号 + storeOrderProduct.setWeather(storeBusinessTicket.getWeather());// 天气 + storeOrderProduct.setWeeker(storeBusinessTicket.getWeeker());// 星期 + storeOrderProduct.setLineNo(storeOrderProductEntity.getLineNo() == null ? lineNo : storeOrderProductEntity.getLineNo());// 行号 + storeOrderProduct.setEstimatedCost(storeOrderProductEntity.getEstimatedCost() == null ? 0D : storeOrderProductEntity.getEstimatedCost());// 预估成本 + storeOrderProduct.setEstimatedProfitAmount( + storeOrderProductEntity.getEstimatedProfitAmount() == null ? storeOrderProduct.getReceivableTotal() : storeOrderProductEntity.getEstimatedProfitAmount());// 预估毛利金额 + if (storeOrderProductEntity.getEstimatedProfitMargin() == null) { + if (MathUtil.eq(BigDecimal.ZERO, new BigDecimal(storeOrderProductEntity.getReceivableTotal()))) { + storeOrderProduct.setEstimatedProfitMargin(0D);// 预估毛利率 + } else { + storeOrderProduct.setEstimatedProfitMargin(MathUtil.multiply(new BigDecimal(100), + MathUtil.divide(new BigDecimal(storeOrderProduct.getEstimatedProfitAmount()), new BigDecimal(storeOrderProduct.getReceivableTotal())), 4, BigDecimal.ROUND_HALF_UP) + .doubleValue());// 预估毛利率 + } + } else { + storeOrderProduct.setEstimatedProfitMargin(storeOrderProductEntity.getEstimatedProfitMargin());// 预估毛利率 + } + storeOrderProduct.setTotalCost(storeOrderProductEntity.getTotalCost() == null ? storeOrderProduct.getEstimatedCost() : storeOrderProductEntity.getTotalCost());// 实际成本 + storeOrderProduct.setProfitAmount(storeOrderProductEntity.getProfitAmount() == null ? storeOrderProduct.getEstimatedProfitAmount() : storeOrderProductEntity.getProfitAmount());// 实际毛利金额 + storeOrderProduct.setProfitMargin(storeOrderProductEntity.getProfitMargin() == null ? storeOrderProduct.getEstimatedProfitMargin() : storeOrderProductEntity.getProfitMargin());// 实际毛利率 + /** ------2017-12-21 增加当日流水号以及成本等信息 End------ **/ + + /** ------2018-04-20 增加餐桌名称以及扩展信息 Begin------ **/ + storeOrderProduct.setTableNo(StringUtils.isBlank(storeOrderProductEntity.getTableNo()) ? null : storeOrderProductEntity.getTableNo()); + storeOrderProduct.setTableName(StringUtils.isBlank(storeOrderProductEntity.getTableName()) ? null : storeOrderProductEntity.getTableName()); + storeOrderProduct.setExt1(StringUtils.isBlank(storeOrderProductEntity.getExt1()) ? null : storeOrderProductEntity.getExt1()); + storeOrderProduct.setExt2(StringUtils.isBlank(storeOrderProductEntity.getExt2()) ? null : storeOrderProductEntity.getExt2()); + storeOrderProduct.setExt3(StringUtils.isBlank(storeOrderProductEntity.getExt3()) ? null : storeOrderProductEntity.getExt3()); + /** ------2018-04-20 增加餐桌名称以及扩展信息 End------ **/ + + orderProductList.add(storeOrderProduct); + List storeOrderProductInfoEntityList = storeOrderProductEntity.getProductInfo(); + // 门店菜品销售记录优惠明细校验开始 + if (storeOrderProductInfoEntityList != null && storeOrderProductInfoEntityList.size() > 0) { + for (StoreOrderProductInfoExtendEntity storeOrderProductInfoEntity : storeOrderProductInfoEntityList) { + StoreOrderProductInfo storeOrderProductInfo = new StoreOrderProductInfo(); + storeOrderProductInfo.setCreateDate(createDate); + storeOrderProductInfo.setCreateUser("open-api"); + if (storeOrderProductInfoEntity.getClientId() == null || "".equals(storeOrderProductInfoEntity.getClientId()) || storeOrderProductInfoEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("销售单记录优惠ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductInfo.setClientId(storeOrderProductInfoEntity.getClientId()); + } + + if (storeOrderProductInfoEntity.getOrderItemId() != null && storeOrderProductInfoEntity.getOrderItemId().length() > 64) { + response.setStatus(0); + response.setMessage("销售单记录优惠OrderItemId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductInfo.setOrderItemId(storeOrderProductInfoEntity.getOrderItemId()); + } + storeOrderProductInfo.setStoreId(entity.getStoreId()); + storeOrderProductInfo.setBusNo(entity.getNo()); + storeOrderProductInfo.setType(storeOrderProductInfoEntity.getType()); + if (storeOrderProductInfoEntity.getInfo() != null && storeOrderProductInfoEntity.getInfo().length() > 256) { + response.setStatus(0); + response.setMessage("销售单优惠记录Info参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductInfo.setInfo(storeOrderProductInfoEntity.getInfo()); + } + storeOrderProductInfo.setDiscountMoney(storeOrderProductInfoEntity.getDiscountMoney()); + storeOrderProductInfo.setSaleDate(entity.getSaleDate()); + + /** ------2018-04-20 增加餐桌名称以及扩展信息 Begin------ **/ + storeOrderProductInfo.setTableNo(StringUtils.isBlank(storeOrderProductInfoEntity.getTableNo()) ? null : storeOrderProductInfoEntity.getTableNo()); + storeOrderProductInfo.setTableName(StringUtils.isBlank(storeOrderProductInfoEntity.getTableName()) ? null : storeOrderProductInfoEntity.getTableName()); + storeOrderProductInfo.setExt1(StringUtils.isBlank(storeOrderProductInfoEntity.getExt1()) ? null : storeOrderProductInfoEntity.getExt1()); + storeOrderProductInfo.setExt2(StringUtils.isBlank(storeOrderProductInfoEntity.getExt2()) ? null : storeOrderProductInfoEntity.getExt2()); + storeOrderProductInfo.setExt3(StringUtils.isBlank(storeOrderProductInfoEntity.getExt3()) ? null : storeOrderProductInfoEntity.getExt3()); + /** ------2018-04-20 增加餐桌名称以及扩展信息 End------ **/ + + orderProductInfoList.add(storeOrderProductInfo); + } + } + List storeOrderProductMakeEntityList = storeOrderProductEntity.getProductMake(); + // 门店菜品做法明细校验开始 + if (storeOrderProductMakeEntityList != null && storeOrderProductMakeEntityList.size() > 0) { + for (StoreOrderProductMakeExtendEntity storeOrderProductMakeEntity : storeOrderProductMakeEntityList) { + StoreOrderProductMake storeOrderProductMake = new StoreOrderProductMake(); + storeOrderProductMake.setCreateDate(createDate); + storeOrderProductMake.setCreateUser("open-api"); + if (storeOrderProductMakeEntity.getClientId() == null || "".equals(storeOrderProductMakeEntity.getClientId()) || storeOrderProductMakeEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("菜品做法ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductMake.setClientId(storeOrderProductMakeEntity.getClientId()); + } + if (storeOrderProductMakeEntity.getOrderItemId() != null && storeOrderProductMakeEntity.getOrderItemId().length() > 64) { + response.setStatus(0); + response.setMessage("菜品做法OrderItemId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductMake.setOrderItemId(storeOrderProductMakeEntity.getOrderItemId()); + } + storeOrderProductMake.setStoreId(entity.getStoreId()); + storeOrderProductMake.setStoreNo(entity.getStoreNo()); + storeOrderProductMake.setStoreName(entity.getStoreName()); + storeOrderProductMake.setBusNo(entity.getNo()); + if (storeOrderProductMakeEntity.getMakeId() != null && storeOrderProductMakeEntity.getMakeId().length() > 32) { + response.setStatus(0); + response.setMessage("菜品做法makeId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductMake.setMakeId(storeOrderProductMakeEntity.getMakeId()); + } + if (storeOrderProductMakeEntity.getMakeName() != null && storeOrderProductMakeEntity.getMakeName().length() > 32) { + response.setStatus(0); + response.setMessage("菜品做法makeName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductMake.setMakeName(storeOrderProductMakeEntity.getMakeName()); + } + storeOrderProductMake.setAddPrice(storeOrderProductMakeEntity.getAddPrice()); + storeOrderProductMake.setDiscountPrice(storeOrderProductMakeEntity.getDiscountPrice()); + storeOrderProductMake.setCount(storeOrderProductMakeEntity.getCount()); + storeOrderProductMake.setRcount(storeOrderProductMakeEntity.getRcount()); + storeOrderProductMake.setAddTotal(storeOrderProductMakeEntity.getAddTotal()); + storeOrderProductMake.setDiscountAddTotal(storeOrderProductMakeEntity.getDiscountAddTotal()); + storeOrderProductMake.setDiscount(storeOrderProductMakeEntity.getDiscount()); + storeOrderProductMake.setQtyFlag(storeOrderProductMakeEntity.getQtyFlag()); + storeOrderProductMake.setHand(storeOrderProductMakeEntity.getHand()); + storeOrderProductMake.setSaleDate(entity.getSaleDate()); + + /** ------2018-04-20 增加餐桌名称以及扩展信息 Begin------ **/ + storeOrderProductMake.setTableNo(StringUtils.isBlank(storeOrderProductMakeEntity.getTableNo()) ? null : storeOrderProductMakeEntity.getTableNo()); + storeOrderProductMake.setTableName(StringUtils.isBlank(storeOrderProductMakeEntity.getTableName()) ? null : storeOrderProductMakeEntity.getTableName()); + storeOrderProductMake.setExt1(StringUtils.isBlank(storeOrderProductMakeEntity.getExt1()) ? null : storeOrderProductMakeEntity.getExt1()); + storeOrderProductMake.setExt2(StringUtils.isBlank(storeOrderProductMakeEntity.getExt2()) ? null : storeOrderProductMakeEntity.getExt2()); + storeOrderProductMake.setExt3(StringUtils.isBlank(storeOrderProductMakeEntity.getExt3()) ? null : storeOrderProductMakeEntity.getExt3()); + /** ------2018-04-20 增加餐桌名称以及扩展信息 End------ **/ + + makeList.add(storeOrderProductMake); + } + } + } + } + // 门店菜品销售记录优惠明细校验开始 + List payList = new ArrayList<>(); + List storePayEntityList = entity.getPay(); + if (storePayEntityList != null && storePayEntityList.size() > 0) { + for (StorePayExtendEntity storePayEntity : storePayEntityList) { + StorePay storePay = new StorePay(); + storePay.setCreateDate(createDate); + storePay.setCreateUser("open-api"); + if (storePayEntity.getClientId() == null || "".equals(storePayEntity.getClientId()) || storePayEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("支付记录ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setClientId(storePayEntity.getClientId()); + } + storePay.setStoreId(entity.getStoreId()); + storePay.setStoreNo(entity.getStoreNo()); + storePay.setStoreName(entity.getStoreName()); + storePay.setBusNo(entity.getNo()); + if (storePayEntity.getPayNo() == null || "".equals(storePayEntity.getPayNo()) || storePayEntity.getPayNo().length() > 32) { + response.setStatus(0); + response.setMessage("支付记录BusNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setPayNo(storePayEntity.getPayNo()); + } + if (storePayEntity.getPayTypeNo() == null || "".equals(storePayEntity.getPayTypeNo()) || storePayEntity.getPayTypeNo().length() > 32) { + response.setStatus(0); + response.setMessage("支付记录PayTypeNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setPayTypeNo(storePayEntity.getPayTypeNo()); + } + if (storePayEntity.getPayType() != null && storePayEntity.getPayType().length() > 16) { + response.setStatus(0); + response.setMessage("支付记录payType参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setPayType(storePayEntity.getPayType()); + } + storePay.setPaid(storePayEntity.getPaid()); + storePay.setRchange(storePayEntity.getRchange()); + storePay.setMoney(storePayEntity.getMoney()); + storePay.setOverAmount(storePayEntity.getOverAmount()); + storePay.setWorkNo(entity.getWorkNo()); + storePay.setDeviceName(entity.getDeviceName()); + storePay.setDeviceMac(entity.getDeviceMac()); + storePay.setDeviceIp(entity.getDeviceIp()); + storePay.setPosNo(entity.getPosNo()); + if (storePayEntity.getVoucherNo() != null && storePayEntity.getVoucherNo().length() > 128) { + response.setStatus(0); + response.setMessage("支付记录VoucherNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setVoucherNo(storePayEntity.getVoucherNo()); + } + storePay.setPayDate(entity.getSaleDate());// 订单时间和销售时间一致 + if (storePayEntity.getCardno() != null && storePayEntity.getCardno().length() > 32) { + response.setStatus(0); + response.setMessage("支付记录Cardno参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setCardno(storePayEntity.getCardno()); + } + storePay.setCardYe(storePayEntity.getCardYe()); + storePay.setCardJf(storePayEntity.getCardJf()); + storePay.setIncomeFlag(storePayEntity.getIncomeFlag()); + storePay.setOtherRateType(storePayEntity.getOtherRateType()); + storePay.setOtherRateValue(storePayEntity.getOtherRateValue()); + storePay.setOtherRate(storePayEntity.getOtherRate()); + storePay.setPayChannel(storePayEntity.getPayChannel()); + if (storePayEntity.getMemo() != null && storePayEntity.getMemo().length() > 256) { + response.setStatus(0); + response.setMessage("支付记录Memo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setMemo(storePayEntity.getMemo()); + } + + /** ------2018-04-20 增加餐桌名称以及扩展信息 Begin------ **/ + storePay.setTableNo(StringUtils.isBlank(storePayEntity.getTableNo()) ? null : storePayEntity.getTableNo()); + storePay.setTableName(StringUtils.isBlank(storePayEntity.getTableName()) ? null : storePayEntity.getTableName()); + storePay.setExt1(StringUtils.isBlank(storePayEntity.getExt1()) ? null : storePayEntity.getExt1()); + storePay.setExt2(StringUtils.isBlank(storePayEntity.getExt2()) ? null : storePayEntity.getExt2()); + storePay.setExt3(StringUtils.isBlank(storePayEntity.getExt3()) ? null : storePayEntity.getExt3()); + /** ------2018-04-20 增加餐桌名称以及扩展信息 End------ **/ + + payList.add(storePay); + } + } + + // 前台销售单外送信息校验开始,2017-12-23 + List deliveryList = new ArrayList<>(); + List deliveryEntityList = entity.getDeliveryInfo(); + if (CollectionUtils.isNotEmpty(deliveryEntityList)) { + for (StoreBusinessTicketDeliveryEntity deliveryEntity : deliveryEntityList) { + StoreBusinessTicketDelivery delivery = new StoreBusinessTicketDelivery(); + delivery.setCreateDate(createDate); + delivery.setCreateUser("open-api"); + if (deliveryEntity.getClientId() == null || "".equals(deliveryEntity.getClientId()) || deliveryEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("外送信息ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + delivery.setClientId(deliveryEntity.getClientId()); + } + delivery.setStoreId(entity.getStoreId());// 门店ID + // private String ticketId;// 销售单ID + delivery.setBusNo(entity.getNo());// 单据编号 + // private Integer isInvalid;// 是否失效 + delivery.setOrderTime(deliveryEntity.getOrderTime());// 订餐时间 + delivery.setVisitorName(deliveryEntity.getVisitorName());// 订餐人 + delivery.setOrderTel(deliveryEntity.getOrderTel());// 订餐电话 + delivery.setRecipientName(deliveryEntity.getRecipientName());// 收货人名称 + delivery.setRecipientPhone(deliveryEntity.getRecipientPhone());// 收货人电话 + delivery.setRecipientAddress(deliveryEntity.getRecipientAddress());// 收货人地址 + delivery.setDeliveryWorkerNo(deliveryEntity.getDeliveryWorkerNo());// 送餐员工号 + delivery.setDeliveryWorkerName(deliveryEntity.getDeliveryWorkerName());// 送餐员名称 + delivery.setAdvanceAmount(deliveryEntity.getAdvanceAmount());// 预支金额 + delivery.setDistributionFee(deliveryEntity.getDistributionFee());// 加收服务费 + delivery.setDeliveryBeginTime(deliveryEntity.getDeliveryBeginTime());// 送出时间 + delivery.setDeliveryEndTime(deliveryEntity.getDeliveryEndTime());// 送达时间 + delivery.setSettlementTime(deliveryEntity.getSettlementTime());// 交账时间 + deliveryList.add(delivery); + } + } + + // 前台销售单主单扩展信息,2018-04-18 + storeBusinessTicket.setExt1(StringUtils.isBlank(entity.getExt1()) ? null : entity.getExt1()); + storeBusinessTicket.setExt2(StringUtils.isBlank(entity.getExt2()) ? null : entity.getExt2()); + storeBusinessTicket.setExt3(StringUtils.isBlank(entity.getExt3()) ? null : entity.getExt3()); + + // 前台销售单桌台信息,2018-04-17 + List tableList = new ArrayList<>(); + List tableEntityList = entity.getTableList(); + if (CollectionUtils.isNotEmpty(tableEntityList)) { + for (StoreBusinessTicketTableEntity tableEntity : tableEntityList) { + StoreBusinessTicketTable table = new StoreBusinessTicketTable(); + table.setCreateDate(createDate); + table.setCreateUser("open-api"); + if (tableEntity.getClientId() == null || "".equals(tableEntity.getClientId()) || tableEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("桌台信息ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + table.setClientId(tableEntity.getClientId());// 前台系统ID + } + table.setStoreId(entity.getStoreId());// 门店ID + // private String ticketId;// 销售单ID + table.setBusNo(entity.getNo());// 单据编号 + // private Integer isInvalid;// 是否失效 + table.setTableId(StringUtils.isBlank(tableEntity.getTableId()) ? null : tableEntity.getTableId());// 桌台ID + table.setTableNo(tableEntity.getTableNo());// 桌台编号 + table.setTableName(tableEntity.getTableName());// 桌台名称 + table.setTypeId(StringUtils.isBlank(tableEntity.getTypeId()) ? null : tableEntity.getTypeId());// 桌台类型ID + table.setTypeNo(tableEntity.getTypeNo());// 桌台类型编号 + table.setTypeName(tableEntity.getTypeName());// 桌台类型名称 + table.setAreaId(StringUtils.isBlank(tableEntity.getAreaId()) ? null : tableEntity.getAreaId());// 桌台区域ID + table.setAreaNo(tableEntity.getAreaNo());// 桌台区域编号 + table.setAreaName(tableEntity.getAreaName());// 桌台区域名称 + table.setTableStatus(tableEntity.getTableStatus());// 桌台状态 + table.setOpenTime(tableEntity.getOpenTime());// 开台时间 + table.setOpenUser(tableEntity.getOpenUser());// 开台操作员 + table.setSerialNo(tableEntity.getSerialNo());// 桌台分组标签 + table.setSeatNumber(tableEntity.getSeatNumber());// 座位数 + table.setPeopleNumber(tableEntity.getPeopleNumber());// 人数 + table.setExcessFlag(tableEntity.getExcessFlag());// 是否超额 + table.setTotalAmount(tableEntity.getTotalAmount());// 消费金额 + table.setTotalRefund(tableEntity.getTotalRefund());// 退菜数量 + table.setTotalQuantity(tableEntity.getTotalQuantity());// 菜品数量 + table.setDiscountAmount(tableEntity.getDiscountAmount());// 优惠金额 + table.setDiscountRate(tableEntity.getDiscountRate());// 优惠率 + table.setReceivableAmount(tableEntity.getReceivableAmount());// 应收金额 + table.setPaidAmount(tableEntity.getPaidAmount());// 实收金额 + table.setMalingAmount(tableEntity.getMalingAmount());// 抹零金额 + table.setMasterTable(tableEntity.getMasterTable());// 主台标识 + table.setPerCapitaAmount(tableEntity.getPerCapitaAmount());// 人均金额 + table.setPosNo(tableEntity.getPosNo());// 开台POS + table.setPayNo(tableEntity.getPayNo());// 结账单号 + table.setFinishTime(tableEntity.getFinishTime());// 完成时间 + // 前台销售单主单扩展信息,2018-04-19 + table.setExt1(StringUtils.isBlank(tableEntity.getExt1()) ? null : tableEntity.getExt1()); + table.setExt2(StringUtils.isBlank(tableEntity.getExt2()) ? null : tableEntity.getExt2()); + table.setExt3(StringUtils.isBlank(tableEntity.getExt3()) ? null : tableEntity.getExt3()); + tableList.add(table); + } + } + + businessOrderUpload.setTicket(storeBusinessTicket); + businessOrderUpload.setTicketInfos(ticketInfoList); + businessOrderUpload.setProducts(orderProductList); + businessOrderUpload.setProductInfos(orderProductInfoList); + businessOrderUpload.setPays(payList); + businessOrderUpload.setMakes(makeList); + businessOrderUpload.setDeliveryInfos(deliveryList); + businessOrderUpload.setTables(tableList); + + /** ------2017-12-25------ **/ + Map extData = new HashMap<>(); + if (businessOrderUpload.getTicket().getBusMode() == 2) { + // 门店外送单 + // 营业模式,busMode,0 柜台-1 外带-2 电话外卖 3-餐桌4-美团外卖5-饿了么6-百度外卖7-微信点餐 + // 单据状态,status,0等待付款1已支付2已退单3已取消4已完成 + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", businessOrderUpload.getTicket().getStoreId())); + criteria.add(Restrictions.eq("`no`", businessOrderUpload.getTicket().getNo())); + criteria.add(Restrictions.order("saleDate", "DESC")); + List ticketList = storeBusinessTicketService.getList(tenantId, criteria); + logger.debug("============ticketList:" + JSONUtil.toJSONString(ticketList)); + + List ticketIdList = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(ticketList)) { + for (StoreBusinessTicket ticket : ticketList) { + ticketIdList.add(ticket.getId()); + } + } + extData.put("ticketIdList", ticketIdList); + } + + logger.debug("============businessOrderUpload:" + JSONUtil.toJSONString(businessOrderUpload)); + String ticketId = storeBusinessTicketService.saveBusinessTicketExtend(tenantId, businessOrderUpload, extData); + + Map data = new HashMap<>(); + data.put("busNo", storeBusinessTicket.getNo()); + data.put("ticketId", ticketId); + response.setStatus(1); + response.setMessage("销售数据上传成功"); + response.setData(data); + + // 保存成功之后的事件处理 + if (businessOrderUpload.getTicket().getBusMode() == 2) { + if (businessOrderUpload.getTicket().getStatus() != 0) { + +// boolean enableZdhl = validEnableZdhl(tenantId); +// if (enableZdhl) { +// Map eventData = new HashMap<>(); +// eventData.put("tenantId", tenantId); +// eventData.put("ticketId", ticketId); +// eventBus.notify(EventKeys.SALES_ORDER_CREATE, Event.wrap(eventData)); +// } + // 在这儿处理门店外送(外卖)订单重复上传的问题 + List ticketIdList = (List) extData.get("ticketIdList"); + if (CollectionUtils.isNotEmpty(ticketIdList)) { + String storeId = storeBusinessTicket.getStoreId(); + String ticketNo = storeBusinessTicket.getNo(); + for (String tempTicketId : ticketIdList) { + try { + storeBusinessTicketService.updateTicketToInvalid(tenantId, storeId, tempTicketId, ticketNo); + } catch (Exception e) { + logger.error(info + "(updateTicketToInvalid操作),发生异常[{},{},{},{}]", tenantId, storeId, tempTicketId, ticketNo); + logger.error(info + "(updateTicketToInvalid操作),发生异常", e); + } + } + } + } + } else { + // 查看设置,是否开启自动耗料处理 +// boolean enableZdhl = validEnableZdhl(tenantId); +// if (enableZdhl && StringUtils.isNotBlank(ticketId)) { +// logger.debug("启用自动耗料:[" + tenantId + "]"); +// Map eventData = new HashMap<>(); +// eventData.put("tenantId", tenantId); +// eventData.put("ticketId", ticketId); +// eventBus.notify(EventKeys.SALES_ORDER_CREATE, Event.wrap(eventData)); +// } + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + + /** + * 验证是否启用自动耗料 + */ + private boolean validEnableZdhl(String tenantId) { + String info = "验证[" + tenantId + "]是否启用自动耗料"; + logger.debug(">>>>>>>" + info + "。。。"); + boolean result = false; + try { + // 可引入缓存,验证结果放入缓存10分钟后失效 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketSign", "storeStock")); + List settinglist = settingService.getList(tenantId, criteria); + Map settingMap = new HashMap<>(); + for (TicketPrintSetting setting : settinglist) { + settingMap.put(setting.getKey(), setting); + } + result = settingMap.get("zdhl") != null && StringUtils.equalsIgnoreCase("1", settingMap.get("zdhl").getValue()); + } catch (Exception ex) { + logger.error(info + "时,发生异常", ex); + } + logger.debug(">>>>>>>" + info + "。。。result:" + result); + return result; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/upload/UploadServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/upload/UploadServiceImpl.java new file mode 100644 index 0000000..449a94d --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/upload/UploadServiceImpl.java @@ -0,0 +1,2598 @@ +package com.jwsaas.api.service.impl.upload; + +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.*; + +import javax.annotation.Resource; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.amqp.rabbit.support.CorrelationData; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.jwsaas.api.entity.upload.StoreBusinessLogEntity; +import com.jwsaas.api.entity.upload.StoreBusinessOrderBurdenEntity; +import com.jwsaas.api.entity.upload.StoreBusinessTicketDeliveryEntity; +import com.jwsaas.api.entity.upload.StoreBusinessTicketEntity; +import com.jwsaas.api.entity.upload.StoreBusinessTicketInfoEntity; +import com.jwsaas.api.entity.upload.StoreCostRevenueEntity; +import com.jwsaas.api.entity.upload.StoreHandoverDetailEntity; +import com.jwsaas.api.entity.upload.StoreHandoverDetailPartEntity; +import com.jwsaas.api.entity.upload.StoreHandoverDetailPayEntity; +import com.jwsaas.api.entity.upload.StoreHandoverEntity; +import com.jwsaas.api.entity.upload.StoreOperationLogEntity; +import com.jwsaas.api.entity.upload.StoreOrderBurdenEntity; +import com.jwsaas.api.entity.upload.StoreOrderProductEntity; +import com.jwsaas.api.entity.upload.StoreOrderProductInfoEntity; +import com.jwsaas.api.entity.upload.StoreOrderProductMakeEntity; +import com.jwsaas.api.entity.upload.StorePayEntity; +import com.jwsaas.api.request.upload.BusinessHandoverUploadRequest; +import com.jwsaas.api.request.upload.BusinessLogUploadRequest; +import com.jwsaas.api.request.upload.BusinessOrderBurdenUploadRequest; +import com.jwsaas.api.request.upload.BusinessOrderUploadRequest; +import com.jwsaas.api.request.upload.BusinessRevenueUploadRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.upload.UploadService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.cache.data.ProductUnitCache; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.config.MQMessageSender; +import com.jwsaas.entity.food.BusinessOrderUpload; +import com.jwsaas.entity.food.Product; +import com.jwsaas.entity.food.ProductRatio; +import com.jwsaas.entity.food.ProductSpec; +import com.jwsaas.entity.food.ProductStoreStockLog; +import com.jwsaas.entity.food.ProductUnit; +import com.jwsaas.entity.food.StoreBusinessTicket; +import com.jwsaas.entity.food.StoreBusinessTicketDelivery; +import com.jwsaas.entity.food.StoreBusinessTicketInfo; +import com.jwsaas.entity.food.StoreCostRevenue; +import com.jwsaas.entity.food.StoreHandover; +import com.jwsaas.entity.food.StoreHandoverDetail; +import com.jwsaas.entity.food.StoreHandoverDetailPart; +import com.jwsaas.entity.food.StoreHandoverDetailPay; +import com.jwsaas.entity.food.StoreOperationLog; +import com.jwsaas.entity.food.StoreOrderProduct; +import com.jwsaas.entity.food.StoreOrderProductInfo; +import com.jwsaas.entity.food.StoreOrderProductMake; +import com.jwsaas.entity.food.StorePay; +import com.jwsaas.entity.food.StoreStorage; +import com.jwsaas.entity.food.TicketPrintSetting; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.reactor.event.EventKeys; +import com.jwsaas.service.food.ProductStoreStockService; +import com.jwsaas.service.food.TicketPrintSettingService; +import com.jwsaas.util.JSONUtil; +import com.jwsaas.utils.AppKeyUtil; +import com.jwsaas.utils.IdWorkerUtils; +import com.jwsaas.utils.MathUtil; + +import reactor.bus.Event; + +@ServiceMethodBean(version = "1.0") +public class UploadServiceImpl extends WopServiceImpl implements UploadService { + + private static final long serialVersionUID = -4072449412690990747L; + + @Resource + private com.jwsaas.service.food.StoreService storeService; + @Resource + private com.jwsaas.service.food.StoreBusinessTicketService storeBusinessTicketService; + @Resource + private com.jwsaas.service.food.StoreCostRevenueService storeCostRevenueService; + @Resource + private com.jwsaas.service.food.StoreHandoverService storeHandoverService; + @Resource + private TicketPrintSettingService settingService; + @Resource + private com.jwsaas.service.food.ProductTypeService productTypeService; + @Resource + private com.jwsaas.service.food.ProductService productService; + @Resource + private com.jwsaas.service.food.ProductSpecService productSpecService; + @Resource + private com.jwsaas.service.food.ProductRatioService productRatioService; + @Resource + private ProductUnitCache productUnitCache; + @Resource + private com.jwsaas.service.food.StoreStorageService storeStorageService; + + @Resource + private ProductStoreStockService productStoreStockService; + + @Resource + private MQMessageSender mqMessageSender; + + @ServiceMethod(method = "upload.business.order", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "销售单上传接口") + @Override + public Object businessOrderUpload(BusinessOrderUploadRequest request) { + String info = "销售销售单记录"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + CommonDataResponse response = null; + BusinessOrderUpload businessOrderUpload = new BusinessOrderUpload(); + String jsonString = request.getJsonString(); + try { + response = new CommonDataResponse(); + // Store store = storeService.get(tenantId, request.getStoreId()); + // if (store == null) { + // response.setStatus(0); + // response.setMessage("门店ID不存在"); + // response.setErrCode(CommonErrorCode.error998.getCode()); + // response.setErrMessage(CommonErrorCode.error998.getMessage()); + // return response; + // } + JSONObject json = JSONObject.parseObject(jsonString); + + // 销售单据校验开始 + StoreBusinessTicketEntity entity = new StoreBusinessTicketEntity(json); + StoreBusinessTicket storeBusinessTicket = new StoreBusinessTicket(); + Date createDate = new Date(); + storeBusinessTicket.setCreateDate(createDate); + storeBusinessTicket.setCreateUser("open-api"); + if (entity.getClientId() == null || "".equals(entity.getClientId()) || entity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("前台系统ID参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setClientId(entity.getClientId()); + } + if (entity.getNo() == null || "".equals(entity.getNo()) || entity.getNo().length() > 32) { + response.setStatus(0); + response.setMessage("主单No参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setNo(entity.getNo()); + } + //if (entity.getStoreId() == null || "".equals(entity.getStoreId()) || entity.getStoreId().length() > 18) { + //去掉18位限制,2020-02-29 16:00 + if (entity.getStoreId() == null || "".equals(entity.getStoreId())) { + response.setStatus(0); + response.setMessage("主单storeId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setStoreId(entity.getStoreId()); + } + if (entity.getStoreNo() != null && entity.getStoreNo().length() > 32) { + response.setStatus(0); + response.setMessage("主单storeNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setStoreNo(entity.getStoreNo()); + } + if (entity.getStoreName() != null && entity.getStoreName().length() > 500) { + response.setStatus(0); + response.setMessage("主单storeName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setStoreName(entity.getStoreName()); + } + storeBusinessTicket.setStatus(entity.getStatus()); + if (entity.getWorkNo() != null && entity.getWorkNo().length() > 16) { + response.setStatus(0); + response.setMessage("主单WorkNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setWorkNo(entity.getWorkNo()); + } + storeBusinessTicket.setSaleDate(entity.getSaleDate()); + if (entity.getTableNo() != null && entity.getTableNo().length() > 16) { + response.setStatus(0); + response.setMessage("主单TableNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setTableNo(entity.getTableNo()); + } + storeBusinessTicket.setPeople(entity.getPeople()); + storeBusinessTicket.setBusMode(entity.getBusMode()); + if (entity.getShiftNo() != null && entity.getShiftNo().length() > 16) { + response.setStatus(0); + response.setMessage("主单shiftNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setShiftNo(entity.getShiftNo()); + } + if (entity.getShiftName() != null && entity.getShiftName().length() > 32) { + response.setStatus(0); + response.setMessage("主单shiftName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setShiftName(entity.getShiftName()); + } + storeBusinessTicket.setAmount(entity.getAmount()); + storeBusinessTicket.setDiscount(entity.getDiscount()); + storeBusinessTicket.setDiscountTotal(entity.getDiscountTotal()); + storeBusinessTicket.setReceivable(entity.getReceivable()); + storeBusinessTicket.setMaling(entity.getMaling()); + if (entity.getPaid() == null || entity.getPaid() == 0) { + storeBusinessTicket.setPaid(entity.getReceivable() - entity.getMaling()); + } else { + storeBusinessTicket.setPaid(entity.getPaid()); + } + if (entity.getNoOrg() != null && entity.getNoOrg().length() > 32) { + response.setStatus(0); + response.setMessage("主单NoOrg参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setNoOrg(entity.getNoOrg()); + } + if (entity.getBackCause() != null && entity.getBackCause().length() > 128) { + response.setStatus(0); + response.setMessage("主单BackCause参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setBackCause(entity.getBackCause()); + } + storeBusinessTicket.setIsMember(entity.getIsMember()); + if (entity.getMemberNo() != null && entity.getMemberNo().length() > 32) { + response.setStatus(0); + response.setMessage("主MemberNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setMemberNo(entity.getMemberNo()); + } + storeBusinessTicket.setMemberJifen(entity.getMemberJifen()); + if (entity.getDeviceName() != null && entity.getDeviceName().length() > 64) { + response.setStatus(0); + response.setMessage("主DeviceName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setDeviceName(entity.getDeviceName()); + } + if (entity.getPosNo() != null && entity.getPosNo().length() > 64) { + response.setStatus(0); + response.setMessage("主PosNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setPosNo(entity.getPosNo()); + } + if (entity.getDeviceIp() != null && entity.getDeviceIp().length() > 256) { + response.setStatus(0); + response.setMessage("主deviceIp参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setDeviceIp(entity.getDeviceIp()); + } + if (entity.getDeviceMac() != null && entity.getDeviceMac().length() > 1024) { + response.setStatus(0); + response.setMessage("主deviceMac参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setDeviceMac(entity.getDeviceMac()); + } + + /** ------2017-12-21 增加当日流水号以及成本等信息 Begin------ **/ + storeBusinessTicket.setSeqNo(entity.getSeqNo());// 当日流水号 + storeBusinessTicket.setWeather(entity.getWeather());// 天气 + storeBusinessTicket.setWeeker(entity.getWeeker());// 星期 + storeBusinessTicket.setEstimatedCost(entity.getEstimatedCost() == null ? 0D : entity.getEstimatedCost());// 预估成本 + storeBusinessTicket.setEstimatedProfitAmount(entity.getEstimatedProfitAmount() == null ? storeBusinessTicket.getPaid() : entity.getEstimatedProfitAmount());// 预估毛利金额 + if (entity.getEstimatedProfitMargin() == null) { + if (MathUtil.eq(BigDecimal.ZERO, new BigDecimal(storeBusinessTicket.getReceivable()))) { + storeBusinessTicket.setEstimatedProfitMargin(0D);// 预估毛利率 + } else { + storeBusinessTicket.setEstimatedProfitMargin(MathUtil.multiply(new BigDecimal(100), MathUtil.divide(new BigDecimal(storeBusinessTicket.getEstimatedProfitAmount()), new BigDecimal(storeBusinessTicket.getReceivable())), 4, BigDecimal.ROUND_HALF_UP).doubleValue());// 预估毛利率 + } + } else { + storeBusinessTicket.setEstimatedProfitMargin(entity.getEstimatedProfitMargin());// 预估毛利率 + } + storeBusinessTicket.setTotalCost(entity.getTotalCost() == null ? storeBusinessTicket.getEstimatedCost() : entity.getTotalCost());// 实际成本 + storeBusinessTicket.setProfitAmount(entity.getProfitAmount() == null ? storeBusinessTicket.getEstimatedProfitAmount() : entity.getProfitAmount());// 实际毛利金额 + storeBusinessTicket.setProfitMargin(entity.getProfitMargin() == null ? storeBusinessTicket.getEstimatedProfitMargin() : entity.getProfitMargin());// 实际毛利率 + /** ------2017-12-21 增加当日流水号以及成本等信息 End------ **/ + + // 前台销售单优惠明细校验开始 + List ticketInfoList = new ArrayList<>(); + List storeBusinessTicketInfoEntityList = entity.getTicketInfo(); + if (storeBusinessTicketInfoEntityList != null && storeBusinessTicketInfoEntityList.size() > 0) { + for (StoreBusinessTicketInfoEntity storeBusinessTicketInfoEntity : storeBusinessTicketInfoEntityList) { + StoreBusinessTicketInfo storeBusinessTicketInfo = new StoreBusinessTicketInfo(); + storeBusinessTicketInfo.setCreateDate(createDate); + storeBusinessTicketInfo.setCreateUser("open-api"); + if (storeBusinessTicketInfoEntity.getClientId() == null || "".equals(storeBusinessTicketInfoEntity.getClientId()) || storeBusinessTicketInfoEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("销售单优惠ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicketInfo.setClientId(storeBusinessTicketInfoEntity.getClientId()); + } + storeBusinessTicketInfo.setStoreId(entity.getStoreId()); + storeBusinessTicketInfo.setBusNo(entity.getNo()); + storeBusinessTicketInfo.setType(storeBusinessTicketInfoEntity.getType()); + if (storeBusinessTicketInfoEntity.getInfo() != null && storeBusinessTicketInfoEntity.getInfo().length() > 256) { + response.setStatus(0); + response.setMessage("销售单优惠Info参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicketInfo.setInfo(storeBusinessTicketInfoEntity.getInfo()); + } + storeBusinessTicketInfo.setDiscountMoney(storeBusinessTicketInfoEntity.getDiscountMoney()); + storeBusinessTicketInfo.setSaleDate(entity.getSaleDate()); + ticketInfoList.add(storeBusinessTicketInfo); + } + } + // 门店菜品销售记录校验开始 + List orderProductList = new ArrayList<>(); + List storeOrderProductEntityList = entity.getOrderProduct(); + // 销售明细优惠 + List orderProductInfoList = new ArrayList<>(); + // 销售明细做法 + List makeList = new ArrayList<>(); + if (storeOrderProductEntityList != null && storeOrderProductEntityList.size() > 0) { + int lineNo = 0; + for (StoreOrderProductEntity storeOrderProductEntity : storeOrderProductEntityList) { + StoreOrderProduct storeOrderProduct = new StoreOrderProduct(); + storeOrderProduct.setCreateDate(createDate); + storeOrderProduct.setCreateUser("open-api"); + if (storeOrderProductEntity.getClientId() == null || "".equals(storeOrderProductEntity.getClientId()) || storeOrderProductEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ID参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setClientId(storeOrderProductEntity.getClientId()); + } + if (storeOrderProductEntity.getParentId() != null && storeOrderProductEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ParentId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setParentId(storeOrderProductEntity.getParentId()); + } + storeOrderProduct.setBusNo(entity.getNo()); + storeOrderProduct.setBusMode(entity.getBusMode()); + storeOrderProduct.setStoreId(entity.getStoreId()); + storeOrderProduct.setStoreNo(entity.getStoreNo()); + storeOrderProduct.setStoreName(entity.getStoreName()); + storeOrderProduct.setTableNo(entity.getTableNo()); + //if (storeOrderProductEntity.getProductId() == null || "".equals(storeOrderProductEntity.getProductId()) || storeOrderProductEntity.getProductId().length() > 18 || Long.parseLong(storeOrderProductEntity.getProductId()) < 0) { + //去掉18位限制,2020-02-29 16:00 + if (storeOrderProductEntity.getProductId() == null || "".equals(storeOrderProductEntity.getProductId()) || Long.parseLong(storeOrderProductEntity.getProductId()) < 0) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductId(storeOrderProductEntity.getProductId()); + } + if (storeOrderProductEntity.getProductNo() != null && storeOrderProductEntity.getProductNo().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductNo(storeOrderProductEntity.getProductNo()); + } + if (storeOrderProductEntity.getProductName() == null || "".equals(storeOrderProductEntity.getProductName()) || storeOrderProductEntity.getProductName().length() > 128) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductName(storeOrderProductEntity.getProductName()); + } + if (storeOrderProductEntity.getProductUnitId() != null && storeOrderProductEntity.getProductUnitId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductUnitId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductUnitId(storeOrderProductEntity.getProductUnitId()); + } + if (storeOrderProductEntity.getProductUnitName() != null && storeOrderProductEntity.getProductUnitName().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductUnitName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductUnitName(storeOrderProductEntity.getProductUnitName()); + } + if (storeOrderProductEntity.getTypeId() != null && storeOrderProductEntity.getTypeId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录TypeId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setTypeId(storeOrderProductEntity.getTypeId()); + } + // =======2018-10-10 根据分类ID补全分类所属大类的ID、大类的名称、类别路径 + if (storeOrderProductEntity.getSeriesId() != null && storeOrderProductEntity.getSeriesId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SeriesId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSeriesId(storeOrderProductEntity.getSeriesId()); + } + if (storeOrderProductEntity.getSeriesName() != null && storeOrderProductEntity.getSeriesName().length() > 64) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SeriesName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSeriesName(storeOrderProductEntity.getSeriesName()); + } + if (storeOrderProductEntity.getTypePath() != null && storeOrderProductEntity.getTypePath().length() > 256) { + response.setStatus(0); + response.setMessage("门店菜品销售记录TypePath参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setTypePath(storeOrderProductEntity.getTypePath()); + } + // ===============END + if (storeOrderProductEntity.getTypeName() != null && storeOrderProductEntity.getTypeName().length() > 64) { + response.setStatus(0); + response.setMessage("门店菜品销售记录TypeName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setTypeName(storeOrderProductEntity.getTypeName()); + } + if (storeOrderProductEntity.getSpecId() != null && storeOrderProductEntity.getSpecId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SpecId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSpecId(storeOrderProductEntity.getSpecId()); + } + if (storeOrderProductEntity.getSpecName() != null && storeOrderProductEntity.getSpecName().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SpecName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSpecName(storeOrderProductEntity.getSpecName()); + } + storeOrderProduct.setCount(storeOrderProductEntity.getCount()); + storeOrderProduct.setRcount(storeOrderProductEntity.getRcount()); + storeOrderProduct.setPrice(storeOrderProductEntity.getPrice()); + storeOrderProduct.setDiscountPrice(storeOrderProductEntity.getDiscountPrice()); + storeOrderProduct.setPriceOrg(storeOrderProductEntity.getPriceOrg()); + storeOrderProduct.setIsSuit(storeOrderProductEntity.getIsSuit()); + if (storeOrderProductEntity.getSuitId() != null && storeOrderProductEntity.getSuitId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SuitId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSuitId(storeOrderProductEntity.getSuitId()); + } + if (storeOrderProductEntity.getSuitId() != null && storeOrderProductEntity.getSuitId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SuitId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSuitId(storeOrderProductEntity.getSuitId()); + } + storeOrderProduct.setWorkerNo(entity.getWorkNo()); + storeOrderProduct.setSaleDate(entity.getSaleDate());// 订单时间和销售时间一致 + storeOrderProduct.setDeviceName(entity.getDeviceName()); + storeOrderProduct.setDeviceMac(entity.getDeviceMac()); + storeOrderProduct.setDeviceIp(entity.getDeviceIp()); + storeOrderProduct.setPosNo(entity.getPosNo()); + storeOrderProduct.setAmount(storeOrderProductEntity.getAmount()); + storeOrderProduct.setDiscount(storeOrderProductEntity.getDiscount()); + storeOrderProduct.setDiscountTotal(storeOrderProductEntity.getDiscountTotal()); + storeOrderProduct.setReceivable(storeOrderProductEntity.getReceivable()); + storeOrderProduct.setAddPriceTotal(storeOrderProductEntity.getAddPriceTotal()); + storeOrderProduct.setDiscountAddTotal(storeOrderProductEntity.getDiscountAddTotal()); + storeOrderProduct.setAmountAddTotal(storeOrderProductEntity.getAmountAddTotal()); + storeOrderProduct.setAmountTotal(storeOrderProductEntity.getAmountTotal()); + storeOrderProduct.setReceivableTotal(storeOrderProductEntity.getReceivableTotal()); + storeOrderProduct.setIsMember(entity.getIsMember()); + storeOrderProduct.setMemberNo(entity.getMemberNo()); + + /** ------2017-12-21 增加当日流水号以及成本等信息 Begin------ **/ + lineNo++; + storeOrderProduct.setSeqNo(storeBusinessTicket.getSeqNo());// 当日流水号 + storeOrderProduct.setWeather(storeBusinessTicket.getWeather());// 天气 + storeOrderProduct.setWeeker(storeBusinessTicket.getWeeker());// 星期 + storeOrderProduct.setLineNo(storeOrderProductEntity.getLineNo() == null ? lineNo : storeOrderProductEntity.getLineNo());// 行号 + storeOrderProduct.setEstimatedCost(storeOrderProductEntity.getEstimatedCost() == null ? 0D : storeOrderProductEntity.getEstimatedCost());// 预估成本 + storeOrderProduct.setEstimatedProfitAmount(storeOrderProductEntity.getEstimatedProfitAmount() == null ? storeOrderProduct.getReceivableTotal() : storeOrderProductEntity.getEstimatedProfitAmount());// 预估毛利金额 + if (storeOrderProductEntity.getEstimatedProfitMargin() == null) { + if (MathUtil.eq(BigDecimal.ZERO, new BigDecimal(storeOrderProductEntity.getReceivableTotal()))) { + storeOrderProduct.setEstimatedProfitMargin(0D);// 预估毛利率 + } else { + storeOrderProduct.setEstimatedProfitMargin(MathUtil.multiply(new BigDecimal(100), MathUtil.divide(new BigDecimal(storeOrderProduct.getEstimatedProfitAmount()), new BigDecimal(storeOrderProduct.getReceivableTotal())), 4, BigDecimal.ROUND_HALF_UP).doubleValue());// 预估毛利率 + } + } else { + storeOrderProduct.setEstimatedProfitMargin(storeOrderProductEntity.getEstimatedProfitMargin());// 预估毛利率 + } + storeOrderProduct.setTotalCost(storeOrderProductEntity.getTotalCost() == null ? storeOrderProduct.getEstimatedCost() : storeOrderProductEntity.getTotalCost());// 实际成本 + storeOrderProduct.setProfitAmount(storeOrderProductEntity.getProfitAmount() == null ? storeOrderProduct.getEstimatedProfitAmount() : storeOrderProductEntity.getProfitAmount());// 实际毛利金额 + storeOrderProduct.setProfitMargin(storeOrderProductEntity.getProfitMargin() == null ? storeOrderProduct.getEstimatedProfitMargin() : storeOrderProductEntity.getProfitMargin());// 实际毛利率 + /** ------2017-12-21 增加当日流水号以及成本等信息 End------ **/ + + orderProductList.add(storeOrderProduct); + List storeOrderProductInfoEntityList = storeOrderProductEntity.getProductInfo(); + // 门店菜品销售记录优惠明细校验开始 + if (storeOrderProductInfoEntityList != null && storeOrderProductInfoEntityList.size() > 0) { + for (StoreOrderProductInfoEntity storeOrderProductInfoEntity : storeOrderProductInfoEntityList) { + StoreOrderProductInfo storeOrderProductInfo = new StoreOrderProductInfo(); + storeOrderProductInfo.setCreateDate(createDate); + storeOrderProductInfo.setCreateUser("open-api"); + if (storeOrderProductInfoEntity.getClientId() == null || "".equals(storeOrderProductInfoEntity.getClientId()) || storeOrderProductInfoEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("销售单记录优惠ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductInfo.setClientId(storeOrderProductInfoEntity.getClientId()); + } + + if (storeOrderProductInfoEntity.getOrderItemId() != null && storeOrderProductInfoEntity.getOrderItemId().length() > 64) { + response.setStatus(0); + response.setMessage("销售单记录优惠OrderItemId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductInfo.setOrderItemId(storeOrderProductInfoEntity.getOrderItemId()); + } + storeOrderProductInfo.setStoreId(entity.getStoreId()); + storeOrderProductInfo.setBusNo(entity.getNo()); + storeOrderProductInfo.setType(storeOrderProductInfoEntity.getType()); + if (storeOrderProductInfoEntity.getInfo() != null && storeOrderProductInfoEntity.getInfo().length() > 256) { + response.setStatus(0); + response.setMessage("销售单优惠记录Info参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductInfo.setInfo(storeOrderProductInfoEntity.getInfo()); + } + storeOrderProductInfo.setDiscountMoney(storeOrderProductInfoEntity.getDiscountMoney()); + storeOrderProductInfo.setSaleDate(entity.getSaleDate()); + orderProductInfoList.add(storeOrderProductInfo); + } + } + List storeOrderProductMakeEntityList = storeOrderProductEntity.getProductMake(); + // 门店菜品做法明细校验开始 + if (storeOrderProductMakeEntityList != null && storeOrderProductMakeEntityList.size() > 0) { + for (StoreOrderProductMakeEntity storeOrderProductMakeEntity : storeOrderProductMakeEntityList) { + StoreOrderProductMake storeOrderProductMake = new StoreOrderProductMake(); + storeOrderProductMake.setCreateDate(createDate); + storeOrderProductMake.setCreateUser("open-api"); + if (storeOrderProductMakeEntity.getClientId() == null || "".equals(storeOrderProductMakeEntity.getClientId()) || storeOrderProductMakeEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("菜品做法ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductMake.setClientId(storeOrderProductMakeEntity.getClientId()); + } + if (storeOrderProductMakeEntity.getOrderItemId() != null && storeOrderProductMakeEntity.getOrderItemId().length() > 64) { + response.setStatus(0); + response.setMessage("菜品做法OrderItemId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductMake.setOrderItemId(storeOrderProductMakeEntity.getOrderItemId()); + } + storeOrderProductMake.setStoreId(entity.getStoreId()); + storeOrderProductMake.setStoreNo(entity.getStoreNo()); + storeOrderProductMake.setStoreName(entity.getStoreName()); + storeOrderProductMake.setBusNo(entity.getNo()); + if (storeOrderProductMakeEntity.getMakeId() != null && storeOrderProductMakeEntity.getMakeId().length() > 32) { + response.setStatus(0); + response.setMessage("菜品做法makeId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductMake.setMakeId(storeOrderProductMakeEntity.getMakeId()); + } + if (storeOrderProductMakeEntity.getMakeName() != null && storeOrderProductMakeEntity.getMakeName().length() > 32) { + response.setStatus(0); + response.setMessage("菜品做法makeName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductMake.setMakeName(storeOrderProductMakeEntity.getMakeName()); + } + storeOrderProductMake.setAddPrice(storeOrderProductMakeEntity.getAddPrice()); + storeOrderProductMake.setDiscountPrice(storeOrderProductMakeEntity.getDiscountPrice()); + storeOrderProductMake.setCount(storeOrderProductMakeEntity.getCount()); + storeOrderProductMake.setRcount(storeOrderProductMakeEntity.getRcount()); + storeOrderProductMake.setAddTotal(storeOrderProductMakeEntity.getAddTotal()); + storeOrderProductMake.setDiscountAddTotal(storeOrderProductMakeEntity.getDiscountAddTotal()); + storeOrderProductMake.setDiscount(storeOrderProductMakeEntity.getDiscount()); + storeOrderProductMake.setQtyFlag(storeOrderProductMakeEntity.getQtyFlag()); + storeOrderProductMake.setHand(storeOrderProductMakeEntity.getHand()); + storeOrderProductMake.setSaleDate(entity.getSaleDate()); + makeList.add(storeOrderProductMake); + } + } + } + } + // 门店菜品销售记录优惠明细校验开始 + List payList = new ArrayList<>(); + List storePayEntityList = entity.getPay(); + if (storePayEntityList != null && storePayEntityList.size() > 0) { + for (StorePayEntity storePayEntity : storePayEntityList) { + StorePay storePay = new StorePay(); + storePay.setCreateDate(createDate); + storePay.setCreateUser("open-api"); + if (storePayEntity.getClientId() == null || "".equals(storePayEntity.getClientId()) || storePayEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("支付记录ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setClientId(storePayEntity.getClientId()); + } + storePay.setStoreId(entity.getStoreId()); + storePay.setStoreNo(entity.getStoreNo()); + storePay.setStoreName(entity.getStoreName()); + storePay.setBusNo(entity.getNo()); + storePay.setBusMode(entity.getBusMode()); + if (storePayEntity.getPayNo() == null || "".equals(storePayEntity.getPayNo()) || storePayEntity.getPayNo().length() > 32) { + response.setStatus(0); + response.setMessage("支付记录BusNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setPayNo(storePayEntity.getPayNo()); + } + storePay.setTableNo(entity.getTableNo()); + if (storePayEntity.getPayTypeNo() == null || "".equals(storePayEntity.getPayTypeNo()) || storePayEntity.getPayTypeNo().length() > 32) { + response.setStatus(0); + response.setMessage("支付记录PayTypeNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setPayTypeNo(storePayEntity.getPayTypeNo()); + } + if (storePayEntity.getPayType() != null && storePayEntity.getPayType().length() > 16) { + response.setStatus(0); + response.setMessage("支付记录payType参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setPayType(storePayEntity.getPayType()); + } + storePay.setPaid(storePayEntity.getPaid()); + storePay.setRchange(storePayEntity.getRchange()); + storePay.setMoney(storePayEntity.getMoney()); + storePay.setOverAmount(storePayEntity.getOverAmount()); + storePay.setWorkNo(entity.getWorkNo()); + storePay.setDeviceName(entity.getDeviceName()); + storePay.setDeviceMac(entity.getDeviceMac()); + storePay.setDeviceIp(entity.getDeviceIp()); + storePay.setPosNo(entity.getPosNo()); + if (storePayEntity.getVoucherNo() != null && storePayEntity.getVoucherNo().length() > 128) { + response.setStatus(0); + response.setMessage("支付记录VoucherNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setVoucherNo(storePayEntity.getVoucherNo()); + } + storePay.setPayDate(entity.getSaleDate());// 订单时间和销售时间一致 + if (storePayEntity.getCardno() != null && storePayEntity.getCardno().length() > 32) { + response.setStatus(0); + response.setMessage("支付记录Cardno参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setCardno(storePayEntity.getCardno()); + } + storePay.setCardYe(storePayEntity.getCardYe()); + storePay.setCardJf(storePayEntity.getCardJf()); + storePay.setIncomeFlag(storePayEntity.getIncomeFlag()); + storePay.setOtherRateType(storePayEntity.getOtherRateType()); + storePay.setOtherRateValue(storePayEntity.getOtherRateValue()); + storePay.setOtherRate(storePayEntity.getOtherRate()); + storePay.setPayChannel(storePayEntity.getPayChannel()); + if (storePayEntity.getMemo() != null && storePayEntity.getMemo().length() > 256) { + response.setStatus(0); + response.setMessage("支付记录Memo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setMemo(storePayEntity.getMemo()); + } + payList.add(storePay); + } + } + + // 前台销售单外送信息校验开始,2017-12-23 + List deliveryList = new ArrayList<>(); + List deliveryEntityList = entity.getDeliveryInfo(); + if (CollectionUtils.isNotEmpty(deliveryEntityList)) { + for (StoreBusinessTicketDeliveryEntity deliveryEntity : deliveryEntityList) { + StoreBusinessTicketDelivery delivery = new StoreBusinessTicketDelivery(); + delivery.setCreateDate(createDate); + delivery.setCreateUser("open-api"); + if (deliveryEntity.getClientId() == null || "".equals(deliveryEntity.getClientId()) || deliveryEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("外送信息ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + delivery.setClientId(deliveryEntity.getClientId()); + } + delivery.setStoreId(entity.getStoreId());// 门店ID + // private String ticketId;// 销售单ID + delivery.setBusNo(entity.getNo());// 单据编号 + // private Integer isInvalid;// 是否失效 + delivery.setOrderTime(deliveryEntity.getOrderTime());// 订餐时间 + delivery.setVisitorName(deliveryEntity.getVisitorName());// 订餐人 + delivery.setOrderTel(deliveryEntity.getOrderTel());// 订餐电话 + delivery.setRecipientName(deliveryEntity.getRecipientName());// 收货人名称 + delivery.setRecipientPhone(deliveryEntity.getRecipientPhone());// 收货人电话 + delivery.setRecipientAddress(deliveryEntity.getRecipientAddress());// 收货人地址 + delivery.setDeliveryWorkerNo(deliveryEntity.getDeliveryWorkerNo());// 送餐员工号 + delivery.setDeliveryWorkerName(deliveryEntity.getDeliveryWorkerName());// 送餐员名称 + delivery.setAdvanceAmount(deliveryEntity.getAdvanceAmount());// 预支金额 + delivery.setDistributionFee(deliveryEntity.getDistributionFee());// 加收服务费 + delivery.setDeliveryBeginTime(deliveryEntity.getDeliveryBeginTime());// 送出时间 + delivery.setDeliveryEndTime(deliveryEntity.getDeliveryEndTime());// 送达时间 + delivery.setSettlementTime(deliveryEntity.getSettlementTime());// 交账时间 + deliveryList.add(delivery); + } + } + + businessOrderUpload.setTicket(storeBusinessTicket); + businessOrderUpload.setTicketInfos(ticketInfoList); + businessOrderUpload.setProducts(orderProductList); + businessOrderUpload.setProductInfos(orderProductInfoList); + businessOrderUpload.setPays(payList); + businessOrderUpload.setMakes(makeList); + businessOrderUpload.setDeliveryInfos(deliveryList); + + /** ------2017-12-25------ **/ + Map extData = new HashMap<>(); + if (businessOrderUpload.getTicket().getBusMode() == 2) { + // 门店外送单 + // 营业模式,busMode,0 柜台-1 外带-2 电话外卖 3-餐桌4-美团外卖5-饿了么6-百度外卖7-微信点餐 + // 单据状态,status,0等待付款1已支付2已退单3已取消4已完成 + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", businessOrderUpload.getTicket().getStoreId())); + criteria.add(Restrictions.eq("`no`", businessOrderUpload.getTicket().getNo())); + criteria.add(Restrictions.order("saleDate", "DESC")); + List ticketList = storeBusinessTicketService.getList(tenantId, criteria); + logger.debug("============ticketList:" + JSONUtil.toJSONString(ticketList)); + + List ticketIdList = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(ticketList)) { + for (StoreBusinessTicket ticket : ticketList) { + ticketIdList.add(ticket.getId()); + } + } + extData.put("ticketIdList", ticketIdList); + } + + String ticketId = storeBusinessTicketService.saveBusinessTicket(tenantId, businessOrderUpload, extData); + Map data = new HashMap<>(); + data.put("busNo", storeBusinessTicket.getNo()); + data.put("ticketId", ticketId); + response.setStatus(1); + response.setMessage("销售数据上传成功"); + response.setData(data); + + // 保存成功之后的事件处理 + if (businessOrderUpload.getTicket().getBusMode() == 2) { + if (businessOrderUpload.getTicket().getStatus() != 0) { + // boolean enableZdhl = validEnableZdhl(tenantId); + // if (enableZdhl && StringUtils.isNotBlank(ticketId)) { + // Map eventData = new HashMap<>(); + // eventData.put("tenantId", tenantId); + // eventData.put("ticketId", ticketId); + // eventBus.notify(EventKeys.SALES_ORDER_CREATE, + // Event.wrap(eventData)); + // } + // 在这儿处理门店外送(外卖)订单重复上传的问题 + List ticketIdList = (List) extData.get("ticketIdList"); + if (CollectionUtils.isNotEmpty(ticketIdList)) { + String storeId = storeBusinessTicket.getStoreId(); + String ticketNo = storeBusinessTicket.getNo(); + for (String tempTicketId : ticketIdList) { + try { + storeBusinessTicketService.updateTicketToInvalid(tenantId, storeId, tempTicketId, ticketNo); + } catch (Exception e) { + logger.error(info + "(updateTicketToInvalid操作),发生异常[{},{},{},{}]", tenantId, storeId, tempTicketId, ticketNo); + logger.error(info + "(updateTicketToInvalid操作),发生异常", e); + } + } + } + } + } else { + // 查看设置,是否开启自动耗料处理 + // boolean enableZdhl = validEnableZdhl(tenantId); + // if (enableZdhl && StringUtils.isNotBlank(ticketId)) { + // logger.debug("启用自动耗料:[" + tenantId + "]"); + // Map eventData = new HashMap<>(); + // eventData.put("tenantId", tenantId); + // eventData.put("ticketId", ticketId); + // eventBus.notify(EventKeys.SALES_ORDER_CREATE, + // Event.wrap(eventData)); + // } + + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + logger.error("jsonString:" + jsonString); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "BUSINESS_ORDER_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "upload.business.revenue", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "非营业收入支出数据上传接口") + @Override + public Object businessRevenueUpload(BusinessRevenueUploadRequest request) { + String info = "非营业收入支出数据上传"; + logger.debug(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + // Store store = storeService.get(tenantId, request.getStoreId()); + // if (store == null) { + // response.setStatus(1); + // response.setMessage("门店ID不存在"); + // return response; + // } + String jsonString = request.getJsonString(); + JSONObject json = JSONObject.parseObject(jsonString); + // 销售单据校验开始 + StoreCostRevenueEntity entity = new StoreCostRevenueEntity(json); + StoreCostRevenue storeCostRevenue = new StoreCostRevenue(); + storeCostRevenue.setCreateDate(new Date()); + storeCostRevenue.setCreateUser("open-api"); + //if (entity.getStoreId() == null || "".equals(entity.getStoreId()) || entity.getStoreId().length() > 18) { + //去掉18位限制,2020-02-29 16:00 + if (entity.getStoreId() == null || "".equals(entity.getStoreId())) { + response.setStatus(1); + response.setMessage("storeId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeCostRevenue.setStoreId(entity.getStoreId()); + } + if (entity.getStoreNo() != null && entity.getStoreNo().length() > 32) { + response.setStatus(1); + response.setMessage("storeNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeCostRevenue.setStoreNo(entity.getStoreNo()); + } + if (entity.getStoreName() != null && entity.getStoreName().length() > 500) { + response.setStatus(1); + response.setMessage("storeName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeCostRevenue.setStoreName(entity.getStoreName()); + } + + //if (entity.getWorkId() != null && entity.getWorkId().length() > 18) { + //去掉18位限制,2020-02-29 16:00 + if (entity.getWorkId() == null) { + response.setStatus(1); + response.setMessage("WorkId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeCostRevenue.setWorkId(entity.getWorkId()); + } + + //根据workId+inputDate 判断在2020-02-29 00:00:00,2020-03-06 23:59:59 之间的上传的数据是否重复 + String startDate = "2020-02-29 00:00:00"; + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Long startTime = sdf.parse(startDate).getTime(); + String endDate = "2020-03-06 23:59:59"; + Long endTime = sdf.parse(endDate).getTime(); + String inputDate = entity.getInputDate(); + Long inputTime = sdf.parse(inputDate).getTime(); + if(inputTime > startTime && inputTime < endTime){ + logger.error(" 判断登记时间是否 在 2020-02-29 00:00:00 ,2020-03-06 23:59:59之间"); + logger.error(" storeId >>>>>>> " + entity.getStoreId()); + logger.error(" workId >>>>>> " + entity.getWorkId()); + logger.error(" inputDate >>>>>> " + entity.getInputDate()); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId",entity.getStoreId())); + criteria.add(Restrictions.eq("workId",entity.getWorkId())); + criteria.add(Restrictions.eq("inputDate",entity.getInputDate())); + List handovers = storeCostRevenueService.getList(tenantId,criteria); + if(handovers != null && handovers.size() > 0){ + logger.error(" 非营业收入支付数据重复 >>>>>>>> storeId :"+entity.getStoreId()+" workId >>>>> "+entity.getWorkId()+" inputDate >>>"+entity.getInputDate() ); + response.setStatus(1); + response.setMessage("单据已存在"); + response.setErrCode(CommonErrorCode.error20.getCode()); + response.setErrMessage(CommonErrorCode.error20.getMessage()); + return response; + } + } + + + if (entity.getWorkNo() != null && entity.getWorkNo().length() > 32) { + response.setStatus(1); + response.setMessage("WorkNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeCostRevenue.setWorkNo(entity.getWorkNo()); + } + if (entity.getWorkName() != null && entity.getWorkName().length() > 64) { + response.setStatus(1); + response.setMessage("WorkName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeCostRevenue.setWorkName(entity.getWorkName()); + } + if (entity.getShiftNo() != null && entity.getShiftNo().length() > 16) { + response.setStatus(1); + response.setMessage("ShiftNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeCostRevenue.setShiftNo(entity.getShiftNo()); + } + if (entity.getShiftName() != null && entity.getShiftName().length() > 32) { + response.setStatus(1); + response.setMessage("ShiftName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeCostRevenue.setShiftName(entity.getShiftName()); + } + if (entity.getPosNo() != null && entity.getPosNo().length() > 16) { + response.setStatus(1); + response.setMessage("posNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeCostRevenue.setPosNo(entity.getPosNo()); + } + if (entity.getName() == null || "".equals(entity.getName()) || entity.getName().length() > 32) { + response.setStatus(1); + response.setMessage("Name参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeCostRevenue.setName(entity.getName()); + } + storeCostRevenue.setMoney(entity.getMoney()); + storeCostRevenue.setType(entity.getType()); + if (entity.getDescription() != null && entity.getDescription().length() > 256) { + response.setStatus(1); + response.setMessage("Description参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeCostRevenue.setDescription(entity.getDescription()); + } + if (entity.getMemo() != null && entity.getMemo().length() > 256) { + response.setStatus(1); + response.setMessage("memo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeCostRevenue.setMemo(entity.getMemo()); + } + if (entity.getInputDate() != null && entity.getInputDate().length() > 32) { + response.setStatus(1); + response.setMessage("InputDate参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeCostRevenue.setInputDate(entity.getInputDate()); + } + if (entity.getDeviceName() != null && entity.getDeviceName().length() > 256) { + response.setStatus(1); + response.setMessage("deviceName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeCostRevenue.setDeviceName(entity.getDeviceName()); + } + + if (entity.getDeviceMac() != null && entity.getDeviceMac().length() > 512) { + response.setStatus(1); + response.setMessage("deviceMac参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeCostRevenue.setDeviceMac(entity.getDeviceMac()); + } + if (entity.getDeviceIp() != null && entity.getDeviceIp().length() > 512) { + response.setStatus(1); + response.setMessage("deviceIp参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeCostRevenue.setDeviceIp(entity.getDeviceIp()); + } + storeCostRevenue = storeCostRevenueService.save(tenantId, storeCostRevenue); + Map data = new HashMap<>(); + data.put("revenueId", storeCostRevenue.getId()); + response.setData(data); + response.setStatus(1); + response.setMessage("非营业收入数据上传成功"); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "BUSINESS_REVENUE_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "upload.business.handover", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "交班数据上传接口") + @Override + public Object businessHandoverUpload(BusinessHandoverUploadRequest request) { + String info = "交班数据上传"; + logger.debug(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + // Store store = storeService.get(tenantId, request.getStoreId()); + // if (store == null) { + // response.setStatus(1); + // response.setMessage("门店ID不存在"); + // return response; + // } + String jsonString = request.getJsonString(); + logger.debug("jsonString:" + jsonString); + JSONObject json = JSONObject.parseObject(jsonString); + StoreHandover handover = new StoreHandover(); + handover.setCreateDate(new Date()); + handover.setCreateUser("open-api"); + StoreHandoverEntity storeHandoverEntity = new StoreHandoverEntity(json); + if (storeHandoverEntity.getClientId() == null || "".equals(storeHandoverEntity.getClientId()) || storeHandoverEntity.getClientId().length() > 64) { + response.setStatus(1); + response.setMessage("前台系统ID参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + handover.setClientId(storeHandoverEntity.getClientId()); + } + if (storeHandoverEntity.getNo() == null || "".equals(storeHandoverEntity.getNo()) || storeHandoverEntity.getNo().length() > 32) { + response.setStatus(1); + response.setMessage("no参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + handover.setNo(storeHandoverEntity.getNo()); + } + + //if (storeHandoverEntity.getStoreId() == null || "".equals(storeHandoverEntity.getStoreId()) || storeHandoverEntity.getStoreId().length() > 18) { + //去掉18位限制,2020-02-29 16:00 + if (storeHandoverEntity.getStoreId() == null || "".equals(storeHandoverEntity.getStoreId())) { + response.setStatus(1); + response.setMessage("storeId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + handover.setStoreId(storeHandoverEntity.getStoreId()); + } + + //判断交班时间; + String startDate = "2020-02-29 00:00:00"; + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + Long startTime = sdf.parse(startDate).getTime(); + String endDate = "2020-03-06 23:59:59"; + Long endTime = sdf.parse(endDate).getTime(); + Long shiftTime = storeHandoverEntity.getDatetimeShift().getTime(); + if(shiftTime > startTime && shiftTime < endTime){ + logger.error(" 判断交班时间是否 在 2020-02-29 00:00:00 ,2020-03-06 23:59:59之间"); + logger.error(" storeId >>>>>>> " + storeHandoverEntity.getStoreId()); + logger.error(" no >>>>>> " + storeHandoverEntity.getNo()); + logger.error(" shiftTime >>>>>> " + storeHandoverEntity.getDatetimeShift()); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId",storeHandoverEntity.getStoreId())); + criteria.add(Restrictions.eq("no",storeHandoverEntity.getNo())); + List handovers = storeHandoverService.getList(tenantId,criteria); + if(handovers != null && handovers.size() > 0){ + logger.error("判断交班单据 单据号已存在 >>>>>> " + storeHandoverEntity.getNo()); + response.setStatus(1); + response.setMessage("单据号已存在"); + response.setErrCode(CommonErrorCode.error20.getCode()); + response.setErrMessage(CommonErrorCode.error20.getMessage()); + return response; + } + } + + if (storeHandoverEntity.getStoreNo() != null && storeHandoverEntity.getStoreNo().length() > 32) { + response.setStatus(1); + response.setMessage("storeNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + handover.setStoreNo(storeHandoverEntity.getStoreNo()); + } + if (storeHandoverEntity.getStoreName() != null && storeHandoverEntity.getStoreName().length() > 500) { + response.setStatus(1); + response.setMessage("storeName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + handover.setStoreName(storeHandoverEntity.getStoreName()); + } + //if (storeHandoverEntity.getWorkId() != null && storeHandoverEntity.getWorkId().length() > 18) { + //去掉18位限制,2020-02-29 16:00 + if (storeHandoverEntity.getWorkId() == null) { + response.setStatus(1); + response.setMessage("WorkId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + handover.setWorkId(storeHandoverEntity.getWorkId()); + } + if (storeHandoverEntity.getWorkNo() != null && storeHandoverEntity.getWorkNo().length() > 32) { + response.setStatus(1); + response.setMessage("WorkNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + handover.setWorkNo(storeHandoverEntity.getWorkNo()); + } + if (storeHandoverEntity.getWorkName() != null && storeHandoverEntity.getWorkName().length() > 64) { + response.setStatus(1); + response.setMessage("WorkName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + handover.setWorkName(storeHandoverEntity.getWorkName()); + } + if (storeHandoverEntity.getShiftNo() != null && storeHandoverEntity.getShiftNo().length() > 16) { + response.setStatus(1); + response.setMessage("ShiftNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + handover.setShiftNo(storeHandoverEntity.getShiftNo()); + } + if (storeHandoverEntity.getShiftName() != null && storeHandoverEntity.getShiftName().length() > 32) { + response.setStatus(1); + response.setMessage("ShiftName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + handover.setShiftName(storeHandoverEntity.getShiftName()); + } + handover.setDatetimeBegin(storeHandoverEntity.getDatetimeBegin()); + handover.setDatetimeEnd(storeHandoverEntity.getDatetimeEnd()); + handover.setDatetimeShift(storeHandoverEntity.getDatetimeShift()); + if (storeHandoverEntity.getAcceptWorkerNo() != null && storeHandoverEntity.getAcceptWorkerNo().length() > 64) { + response.setStatus(1); + response.setMessage("AcceptWorkerNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + handover.setAcceptWorkerNo(storeHandoverEntity.getAcceptWorkerNo()); + } + if (storeHandoverEntity.getPosNo() != null && storeHandoverEntity.getPosNo().length() > 16) { + response.setStatus(1); + response.setMessage("posNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + handover.setPosNo(storeHandoverEntity.getPosNo()); + } + if (storeHandoverEntity.getMemo() != null && storeHandoverEntity.getMemo().length() > 128) { + response.setStatus(1); + response.setMessage("memo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + handover.setMemo(storeHandoverEntity.getMemo()); + } + handover.setTicketCount(storeHandoverEntity.getTicketCount()); + handover.setDealAmount(storeHandoverEntity.getDealAmount()); + handover.setDealTicketCount(storeHandoverEntity.getDealTicketCount()); + handover.setBackAmount(storeHandoverEntity.getBackAmount()); + handover.setBackTicketCount(storeHandoverEntity.getBackTicketCount()); + handover.setShiftAmount(storeHandoverEntity.getShiftAmount()); + handover.setPeopleCount(storeHandoverEntity.getPeopleCount()); + handover.setAmount(storeHandoverEntity.getAmount()); + handover.setDiscountMoney(storeHandoverEntity.getDiscountMoney()); + handover.setCouponDiscountMoney(storeHandoverEntity.getCouponDiscountMoney()); + handover.setOtherDiscountMoney(storeHandoverEntity.getOtherDiscountMoney()); + handover.setReceivable(storeHandoverEntity.getReceivable()); + handover.setMaling(storeHandoverEntity.getMaling() == null ? 0D : storeHandoverEntity.getMaling()); + handover.setPaid(storeHandoverEntity.getPaid() == null ? storeHandoverEntity.getReceivable() : storeHandoverEntity.getPaid()); + handover.setCardCount(storeHandoverEntity.getCardCount()); + handover.setCardRealMoney(storeHandoverEntity.getCardRealMoney()); + handover.setCardRefundCount(storeHandoverEntity.getCardRefundCount()); + handover.setCardRefundMoney(storeHandoverEntity.getCardRefundMoney()); + handover.setSumRealMoney(storeHandoverEntity.getSumRealMoney()); + handover.setImprest(storeHandoverEntity.getImprest()); + handover.setInmoney(storeHandoverEntity.getInmoney()); + handover.setOutmoney(storeHandoverEntity.getOutmoney()); + handover.setDistributionFee(storeHandoverEntity.getDistributionFee()); + if (storeHandoverEntity.getDeviceName() != null && storeHandoverEntity.getDeviceName().length() > 256) { + response.setStatus(1); + response.setMessage("deviceName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + handover.setDeviceName(storeHandoverEntity.getDeviceName()); + } + + if (storeHandoverEntity.getDeviceMac() != null && storeHandoverEntity.getDeviceMac().length() > 512) { + response.setStatus(1); + response.setMessage("deviceMac参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + handover.setDeviceMac(storeHandoverEntity.getDeviceMac()); + } + if (storeHandoverEntity.getDeviceIp() != null && storeHandoverEntity.getDeviceIp().length() > 512) { + response.setStatus(1); + response.setMessage("deviceIp参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + handover.setDeviceIp(storeHandoverEntity.getDeviceIp()); + } + List detail = new ArrayList<>(); + if (json.containsKey("detail")) { + JSONArray detailJson = json.getJSONArray("detail"); + for (int i = 0; i < detailJson.size(); i++) { + StoreHandoverDetailEntity storeHandoverDetailEntity = new StoreHandoverDetailEntity(detailJson.getJSONObject(i)); + StoreHandoverDetail storeHandoverDetail = new StoreHandoverDetail(); + storeHandoverDetail.setCreateDate(new Date()); + storeHandoverDetail.setCreateUser("open-api"); + if (storeHandoverDetailEntity.getClientId() == null || "".equals(storeHandoverDetailEntity.getClientId()) || storeHandoverDetailEntity.getClientId().length() > 64) { + response.setStatus(1); + response.setMessage("交班明细ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeHandoverDetail.setClientId(storeHandoverDetailEntity.getClientId()); + } + storeHandoverDetail.setStoreId(storeHandoverEntity.getStoreId()); + storeHandoverDetail.setBusNo(storeHandoverEntity.getNo()); + storeHandoverDetail.setTicketId(storeHandoverEntity.getClientId()); + storeHandoverDetail.setPosNo(storeHandoverEntity.getPosNo()); + storeHandoverDetail.setDeviceIp(storeHandoverEntity.getDeviceIp()); + storeHandoverDetail.setDeviceMac(storeHandoverEntity.getDeviceMac()); + storeHandoverDetail.setDeviceName(storeHandoverEntity.getDeviceName()); + if (storeHandoverDetailEntity.getPayModeNo() != null && storeHandoverDetailEntity.getPayModeNo().length() > 32) { + response.setStatus(1); + response.setMessage("交班明细PayModeNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeHandoverDetail.setPayModeNo(storeHandoverDetailEntity.getPayModeNo()); + } + if (storeHandoverDetailEntity.getPayModeName() != null && storeHandoverDetailEntity.getPayModeName().length() > 32) { + response.setStatus(1); + response.setMessage("交班明细PayModeName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeHandoverDetail.setPayModeName(storeHandoverDetailEntity.getPayModeName()); + } + storeHandoverDetail.setCount(storeHandoverDetailEntity.getCount()); + storeHandoverDetail.setMoney(storeHandoverDetailEntity.getMoney()); + storeHandoverDetail.setHandsMoney(storeHandoverDetailEntity.getHandsMoney()); + storeHandoverDetail.setCardCount(storeHandoverDetailEntity.getCardCount()); + storeHandoverDetail.setCardMoney(storeHandoverDetailEntity.getCardMoney()); + storeHandoverDetail.setSumMoney(storeHandoverDetailEntity.getSumMoney()); + detail.add(storeHandoverDetail); + } + } + List part = new ArrayList<>(); + if (json.containsKey("part")) { + JSONArray partJson = json.getJSONArray("part"); + for (int i = 0; i < partJson.size(); i++) { + StoreHandoverDetailPartEntity storeHandoverDetailPartEntity = new StoreHandoverDetailPartEntity(partJson.getJSONObject(i)); + StoreHandoverDetailPart storeHandoverDetailPart = new StoreHandoverDetailPart(); + storeHandoverDetailPart.setCreateDate(new Date()); + storeHandoverDetailPart.setCreateUser("open-api"); + if (storeHandoverDetailPartEntity.getClientId() == null || "".equals(storeHandoverDetailPartEntity.getClientId()) || storeHandoverDetailPartEntity.getClientId().length() > 64) { + response.setStatus(1); + response.setMessage("交班明细(扩展)ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeHandoverDetailPart.setClientId(storeHandoverDetailPartEntity.getClientId()); + } + storeHandoverDetailPart.setStoreId(storeHandoverEntity.getStoreId()); + storeHandoverDetailPart.setBusNo(storeHandoverEntity.getNo()); + storeHandoverDetailPart.setTicketId(storeHandoverEntity.getClientId()); + storeHandoverDetailPart.setPosNo(storeHandoverEntity.getPosNo()); + storeHandoverDetailPart.setDeviceIp(storeHandoverEntity.getDeviceIp()); + storeHandoverDetailPart.setDeviceMac(storeHandoverEntity.getDeviceMac()); + storeHandoverDetailPart.setDeviceName(storeHandoverEntity.getDeviceName()); + if (storeHandoverDetailPartEntity.getSpecName() != null && storeHandoverDetailPartEntity.getSpecName().length() > 64) { + response.setStatus(1); + response.setMessage("交班明细(扩展)SpecName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeHandoverDetailPart.setSpecName(storeHandoverDetailPartEntity.getSpecName()); + } + storeHandoverDetailPart.setPreCount(storeHandoverDetailPartEntity.getPreCount()); + storeHandoverDetailPart.setCount(storeHandoverDetailPartEntity.getCount()); + storeHandoverDetailPart.setHandsCount(storeHandoverDetailPartEntity.getHandsCount()); + storeHandoverDetailPart.setDifCount(storeHandoverDetailPartEntity.getDifCount()); + part.add(storeHandoverDetailPart); + } + } + + // 门店交班支付方式明细表,2018-04-19 + List payList = new ArrayList<>(); + if (json.containsKey("pay")) { + JSONArray payJson = json.getJSONArray("pay"); + for (int i = 0; i < payJson.size(); i++) { + StoreHandoverDetailPayEntity payEntity = new StoreHandoverDetailPayEntity(payJson.getJSONObject(i)); + StoreHandoverDetailPay pay = new StoreHandoverDetailPay(); + pay.setCreateDate(new Date()); + pay.setCreateUser("open-api"); + if (payEntity.getClientId() == null || "".equals(payEntity.getClientId()) || payEntity.getClientId().length() > 64) { + response.setStatus(1); + response.setMessage("交班明细(支付方式)ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + pay.setClientId(payEntity.getClientId()); + } + pay.setStoreId(storeHandoverEntity.getStoreId()); + pay.setTicketId(storeHandoverEntity.getClientId()); + pay.setBusNo(storeHandoverEntity.getNo()); + pay.setPayModeNo(payEntity.getPayModeNo()); + pay.setPayModeName(payEntity.getPayModeName()); + pay.setBusMode(payEntity.getBusMode()); + pay.setMoney(payEntity.getMoney()); + pay.setCount(payEntity.getCount()); + pay.setBusType(payEntity.getBusType()); + pay.setPosNo(storeHandoverEntity.getPosNo()); + pay.setDeviceIp(storeHandoverEntity.getDeviceIp()); + pay.setDeviceMac(storeHandoverEntity.getDeviceMac()); + pay.setDeviceName(storeHandoverEntity.getDeviceName()); + payList.add(pay); + } + } + + String handoverId = storeHandoverService.saveHandoverExtend(tenantId, handover, detail, part, payList); + Map data = new HashMap<>(); + data.put("handoverId", handoverId); + data.put("busNo", handover.getNo()); + response.setData(data); + response.setStatus(1); + response.setMessage("交班数据上传成功"); + + // 交班后汇总交班信息计入门店余额事件 + logger.debug(">>>>>>>交班后汇总交班信息计入门店余额事件"); + Map eventData = new HashMap<>(); + eventData.put("tenantCode", tenantCode); + eventData.put("tenantId", tenantId); + eventData.put("storeId", handover.getStoreId()); + eventData.put("storeNo", handover.getStoreNo()); + eventData.put("handoverId", handoverId); + eventData.put("busNo", handover.getNo()); + eventBus.notify(EventKeys.BUSINESS_HANDOVER_STORE_ACCOUNT_RECHARGE, Event.wrap(eventData)); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "BUSINESS_HANDOVER_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "upload.business.order.plus", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "销售单上传接口") + @Override + public Object businessOrderUploadPlus(BusinessOrderUploadRequest request) { + String info = "销售销售单记录(加强版)"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + CommonDataResponse response = null; + String jsonString = request.getJsonString(); + try { + response = new CommonDataResponse(); + JSONObject json = JSONObject.parseObject(jsonString); + // 销售单据校验开始 + StoreBusinessTicketEntity entity = new StoreBusinessTicketEntity(json); + StoreBusinessTicket storeBusinessTicket = new StoreBusinessTicket(); + Date createDate = new Date(); + storeBusinessTicket.setCreateDate(createDate); + storeBusinessTicket.setCreateUser("open-api"); + if (entity.getClientId() == null || "".equals(entity.getClientId()) || entity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("前台系统ID参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setClientId(entity.getClientId()); + } + if (entity.getNo() == null || "".equals(entity.getNo()) || entity.getNo().length() > 32) { + response.setStatus(0); + response.setMessage("主单No参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setNo(entity.getNo()); + } + //if (entity.getStoreId() == null || "".equals(entity.getStoreId()) || entity.getStoreId().length() > 18) { + //去掉18位限制,2020-02-29 16:00 + if (entity.getStoreId() == null || "".equals(entity.getStoreId())) { + response.setStatus(0); + response.setMessage("主单storeId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setStoreId(entity.getStoreId()); + } + if (entity.getStoreNo() != null && entity.getStoreNo().length() > 32) { + response.setStatus(0); + response.setMessage("主单storeNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setStoreNo(entity.getStoreNo()); + } + if (entity.getStoreName() != null && entity.getStoreName().length() > 500) { + response.setStatus(0); + response.setMessage("主单storeName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setStoreName(entity.getStoreName()); + } + storeBusinessTicket.setStatus(entity.getStatus()); + if (entity.getWorkNo() != null && entity.getWorkNo().length() > 16) { + response.setStatus(0); + response.setMessage("主单WorkNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setWorkNo(entity.getWorkNo()); + } + storeBusinessTicket.setSaleDate(entity.getSaleDate()); + if (entity.getTableNo() != null && entity.getTableNo().length() > 16) { + response.setStatus(0); + response.setMessage("主单TableNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setTableNo(entity.getTableNo()); + } + storeBusinessTicket.setPeople(entity.getPeople()); + storeBusinessTicket.setBusMode(entity.getBusMode()); + if (entity.getShiftNo() != null && entity.getShiftNo().length() > 16) { + response.setStatus(0); + response.setMessage("主单shiftNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setShiftNo(entity.getShiftNo()); + } + if (entity.getShiftName() != null && entity.getShiftName().length() > 32) { + response.setStatus(0); + response.setMessage("主单shiftName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setShiftName(entity.getShiftName()); + } + storeBusinessTicket.setAmount(entity.getAmount()); + storeBusinessTicket.setDiscount(entity.getDiscount()); + storeBusinessTicket.setDiscountTotal(entity.getDiscountTotal()); + storeBusinessTicket.setReceivable(entity.getReceivable()); + storeBusinessTicket.setMaling(entity.getMaling()); + if (entity.getPaid() == null || entity.getPaid() == 0) { + storeBusinessTicket.setPaid(entity.getReceivable() - entity.getMaling()); + } else { + storeBusinessTicket.setPaid(entity.getPaid()); + } + if (entity.getNoOrg() != null && entity.getNoOrg().length() > 32) { + response.setStatus(0); + response.setMessage("主单NoOrg参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setNoOrg(entity.getNoOrg()); + } + if (entity.getBackCause() != null && entity.getBackCause().length() > 128) { + response.setStatus(0); + response.setMessage("主单BackCause参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setBackCause(entity.getBackCause()); + } + storeBusinessTicket.setIsMember(entity.getIsMember()); + if (entity.getMemberNo() != null && entity.getMemberNo().length() > 32) { + response.setStatus(0); + response.setMessage("主MemberNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setMemberNo(entity.getMemberNo()); + } + storeBusinessTicket.setMemberJifen(entity.getMemberJifen()); + if (entity.getDeviceName() != null && entity.getDeviceName().length() > 64) { + response.setStatus(0); + response.setMessage("主DeviceName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setDeviceName(entity.getDeviceName()); + } + if (entity.getPosNo() != null && entity.getPosNo().length() > 64) { + response.setStatus(0); + response.setMessage("主PosNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setPosNo(entity.getPosNo()); + } + if (entity.getDeviceIp() != null && entity.getDeviceIp().length() > 256) { + response.setStatus(0); + response.setMessage("主deviceIp参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setDeviceIp(entity.getDeviceIp()); + } + if (entity.getDeviceMac() != null && entity.getDeviceMac().length() > 1024) { + response.setStatus(0); + response.setMessage("主deviceMac参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setDeviceMac(entity.getDeviceMac()); + } + storeBusinessTicket.setSeqNo(entity.getSeqNo());// 当日流水号 + storeBusinessTicket.setWeather(entity.getWeather());// 天气 + storeBusinessTicket.setWeeker(entity.getWeeker());// 星期 + storeBusinessTicket.setEstimatedCost(entity.getEstimatedCost() == null ? 0D : entity.getEstimatedCost());// 预估成本 + storeBusinessTicket.setEstimatedProfitAmount(entity.getEstimatedProfitAmount() == null ? storeBusinessTicket.getPaid() : entity.getEstimatedProfitAmount());// 预估毛利金额 + if (entity.getEstimatedProfitMargin() == null) { + if (MathUtil.eq(BigDecimal.ZERO, new BigDecimal(storeBusinessTicket.getReceivable()))) { + storeBusinessTicket.setEstimatedProfitMargin(0D);// 预估毛利率 + } else { + storeBusinessTicket.setEstimatedProfitMargin(MathUtil.multiply(new BigDecimal(100), MathUtil.divide(new BigDecimal(storeBusinessTicket.getEstimatedProfitAmount()), new BigDecimal(storeBusinessTicket.getReceivable())), 4, BigDecimal.ROUND_HALF_UP).doubleValue());// 预估毛利率 + } + } else { + storeBusinessTicket.setEstimatedProfitMargin(entity.getEstimatedProfitMargin());// 预估毛利率 + } + storeBusinessTicket.setTotalCost(entity.getTotalCost() == null ? storeBusinessTicket.getEstimatedCost() : entity.getTotalCost());// 实际成本 + storeBusinessTicket.setProfitAmount(entity.getProfitAmount() == null ? storeBusinessTicket.getEstimatedProfitAmount() : entity.getProfitAmount());// 实际毛利金额 + storeBusinessTicket.setProfitMargin(entity.getProfitMargin() == null ? storeBusinessTicket.getEstimatedProfitMargin() : entity.getProfitMargin());// 实际毛利率 + if(entity.getExt2() != null){ + storeBusinessTicket.setExt2(entity.getExt2()); + } + + // 前台销售单优惠明细校验开始 + List ticketInfoList = new ArrayList<>(); + List storeBusinessTicketInfoEntityList = entity.getTicketInfo(); + if (storeBusinessTicketInfoEntityList != null && storeBusinessTicketInfoEntityList.size() > 0) { + for (StoreBusinessTicketInfoEntity storeBusinessTicketInfoEntity : storeBusinessTicketInfoEntityList) { + StoreBusinessTicketInfo storeBusinessTicketInfo = new StoreBusinessTicketInfo(); + storeBusinessTicketInfo.setCreateDate(createDate); + storeBusinessTicketInfo.setCreateUser("open-api"); + if (storeBusinessTicketInfoEntity.getClientId() == null || "".equals(storeBusinessTicketInfoEntity.getClientId()) || storeBusinessTicketInfoEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("销售单优惠ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicketInfo.setClientId(storeBusinessTicketInfoEntity.getClientId()); + } + storeBusinessTicketInfo.setStoreId(entity.getStoreId()); + storeBusinessTicketInfo.setBusNo(entity.getNo()); + storeBusinessTicketInfo.setType(storeBusinessTicketInfoEntity.getType()); + if (storeBusinessTicketInfoEntity.getInfo() != null && storeBusinessTicketInfoEntity.getInfo().length() > 256) { + response.setStatus(0); + response.setMessage("销售单优惠Info参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicketInfo.setInfo(storeBusinessTicketInfoEntity.getInfo()); + } + storeBusinessTicketInfo.setDiscountMoney(storeBusinessTicketInfoEntity.getDiscountMoney()); + storeBusinessTicketInfo.setSaleDate(entity.getSaleDate()); + ticketInfoList.add(storeBusinessTicketInfo); + } + } + // 门店菜品销售记录校验开始 + List orderProductList = new ArrayList<>(); + List storeOrderProductEntityList = entity.getOrderProduct(); + // 销售明细优惠 + List orderProductInfoList = new ArrayList<>(); + // 销售明细做法 + List makeList = new ArrayList<>(); + if (storeOrderProductEntityList != null && storeOrderProductEntityList.size() > 0) { + int lineNo = 0; + for (StoreOrderProductEntity storeOrderProductEntity : storeOrderProductEntityList) { + StoreOrderProduct storeOrderProduct = new StoreOrderProduct(); + storeOrderProduct.setCreateDate(createDate); + storeOrderProduct.setCreateUser("open-api"); + if (storeOrderProductEntity.getClientId() == null || "".equals(storeOrderProductEntity.getClientId()) || storeOrderProductEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ID参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setClientId(storeOrderProductEntity.getClientId()); + } + if (storeOrderProductEntity.getParentId() != null && storeOrderProductEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ParentId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setParentId(storeOrderProductEntity.getParentId()); + } + storeOrderProduct.setBusNo(entity.getNo()); + storeOrderProduct.setBusMode(entity.getBusMode()); + storeOrderProduct.setStoreId(entity.getStoreId()); + storeOrderProduct.setStoreNo(entity.getStoreNo()); + storeOrderProduct.setStoreName(entity.getStoreName()); + storeOrderProduct.setTableNo(entity.getTableNo()); + + //if (storeOrderProductEntity.getProductId() == null || "".equals(storeOrderProductEntity.getProductId()) || storeOrderProductEntity.getProductId().length() > 18 || Long.parseLong(storeOrderProductEntity.getProductId()) < 0) { + //去掉18位限制,2020-02-29 16:00 + if (storeOrderProductEntity.getProductId() == null || "".equals(storeOrderProductEntity.getProductId()) || Long.parseLong(storeOrderProductEntity.getProductId()) < 0) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductId(storeOrderProductEntity.getProductId()); + } + if (storeOrderProductEntity.getProductNo() != null && storeOrderProductEntity.getProductNo().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductNo(storeOrderProductEntity.getProductNo()); + } + if (storeOrderProductEntity.getProductName() == null || "".equals(storeOrderProductEntity.getProductName()) || storeOrderProductEntity.getProductName().length() > 128) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductName(storeOrderProductEntity.getProductName()); + } + if (storeOrderProductEntity.getProductUnitId() != null && storeOrderProductEntity.getProductUnitId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductUnitId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductUnitId(storeOrderProductEntity.getProductUnitId()); + } + if (storeOrderProductEntity.getProductUnitName() != null && storeOrderProductEntity.getProductUnitName().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductUnitName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductUnitName(storeOrderProductEntity.getProductUnitName()); + } + if (storeOrderProductEntity.getTypeId() != null && storeOrderProductEntity.getTypeId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录TypeId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setTypeId(storeOrderProductEntity.getTypeId()); + } + // =======2018-10-10 根据分类ID补全分类所属大类的ID、大类的名称、类别路径 + if (storeOrderProductEntity.getSeriesId() != null && storeOrderProductEntity.getSeriesId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SeriesId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSeriesId(storeOrderProductEntity.getSeriesId()); + } + if (storeOrderProductEntity.getSeriesName() != null && storeOrderProductEntity.getSeriesName().length() > 64) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SeriesName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSeriesName(storeOrderProductEntity.getSeriesName()); + } + if (storeOrderProductEntity.getTypePath() != null && storeOrderProductEntity.getTypePath().length() > 256) { + response.setStatus(0); + response.setMessage("门店菜品销售记录TypePath参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setTypePath(storeOrderProductEntity.getTypePath()); + } + // ===============END + if (storeOrderProductEntity.getTypeName() != null && storeOrderProductEntity.getTypeName().length() > 64) { + response.setStatus(0); + response.setMessage("门店菜品销售记录TypeName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setTypeName(storeOrderProductEntity.getTypeName()); + } + if (storeOrderProductEntity.getSpecId() != null && storeOrderProductEntity.getSpecId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SpecId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSpecId(storeOrderProductEntity.getSpecId()); + } + if (storeOrderProductEntity.getSpecName() != null && storeOrderProductEntity.getSpecName().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SpecName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSpecName(storeOrderProductEntity.getSpecName()); + } + storeOrderProduct.setCount(storeOrderProductEntity.getCount()); + storeOrderProduct.setRcount(storeOrderProductEntity.getRcount()); + storeOrderProduct.setPrice(storeOrderProductEntity.getPrice()); + storeOrderProduct.setDiscountPrice(storeOrderProductEntity.getDiscountPrice()); + storeOrderProduct.setPriceOrg(storeOrderProductEntity.getPriceOrg()); + storeOrderProduct.setIsSuit(storeOrderProductEntity.getIsSuit()); + if (storeOrderProductEntity.getSuitId() != null && storeOrderProductEntity.getSuitId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SuitId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSuitId(storeOrderProductEntity.getSuitId()); + } + if (storeOrderProductEntity.getSuitId() != null && storeOrderProductEntity.getSuitId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SuitId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSuitId(storeOrderProductEntity.getSuitId()); + } + storeOrderProduct.setWorkerNo(entity.getWorkNo()); + storeOrderProduct.setSaleDate(entity.getSaleDate());// 订单时间和销售时间一致 + storeOrderProduct.setDeviceName(entity.getDeviceName()); + storeOrderProduct.setDeviceMac(entity.getDeviceMac()); + storeOrderProduct.setDeviceIp(entity.getDeviceIp()); + storeOrderProduct.setPosNo(entity.getPosNo()); + storeOrderProduct.setAmount(storeOrderProductEntity.getAmount()); + storeOrderProduct.setDiscount(storeOrderProductEntity.getDiscount()); + storeOrderProduct.setDiscountTotal(storeOrderProductEntity.getDiscountTotal()); + storeOrderProduct.setReceivable(storeOrderProductEntity.getReceivable()); + storeOrderProduct.setAddPriceTotal(storeOrderProductEntity.getAddPriceTotal()); + storeOrderProduct.setDiscountAddTotal(storeOrderProductEntity.getDiscountAddTotal()); + storeOrderProduct.setAmountAddTotal(storeOrderProductEntity.getAmountAddTotal()); + storeOrderProduct.setAmountTotal(storeOrderProductEntity.getAmountTotal()); + storeOrderProduct.setReceivableTotal(storeOrderProductEntity.getReceivableTotal()); + storeOrderProduct.setIsMember(entity.getIsMember()); + storeOrderProduct.setMemberNo(entity.getMemberNo()); + lineNo++; + storeOrderProduct.setSeqNo(storeBusinessTicket.getSeqNo());// 当日流水号 + storeOrderProduct.setWeather(storeBusinessTicket.getWeather());// 天气 + storeOrderProduct.setWeeker(storeBusinessTicket.getWeeker());// 星期 + storeOrderProduct.setLineNo(storeOrderProductEntity.getLineNo() == null ? lineNo : storeOrderProductEntity.getLineNo());// 行号 + storeOrderProduct.setEstimatedCost(storeOrderProductEntity.getEstimatedCost() == null ? 0D : storeOrderProductEntity.getEstimatedCost());// 预估成本 + storeOrderProduct.setEstimatedProfitAmount(storeOrderProductEntity.getEstimatedProfitAmount() == null ? storeOrderProduct.getReceivableTotal() : storeOrderProductEntity.getEstimatedProfitAmount());// 预估毛利金额 + if (storeOrderProductEntity.getEstimatedProfitMargin() == null) { + if (MathUtil.eq(BigDecimal.ZERO, new BigDecimal(storeOrderProductEntity.getReceivableTotal()))) { + storeOrderProduct.setEstimatedProfitMargin(0D);// 预估毛利率 + } else { + storeOrderProduct.setEstimatedProfitMargin(MathUtil.multiply(new BigDecimal(100), MathUtil.divide(new BigDecimal(storeOrderProduct.getEstimatedProfitAmount()), new BigDecimal(storeOrderProduct.getReceivableTotal())), 4, BigDecimal.ROUND_HALF_UP).doubleValue());// 预估毛利率 + } + } else { + storeOrderProduct.setEstimatedProfitMargin(storeOrderProductEntity.getEstimatedProfitMargin());// 预估毛利率 + } + storeOrderProduct.setTotalCost(storeOrderProductEntity.getTotalCost() == null ? storeOrderProduct.getEstimatedCost() : storeOrderProductEntity.getTotalCost());// 实际成本 + storeOrderProduct.setProfitAmount(storeOrderProductEntity.getProfitAmount() == null ? storeOrderProduct.getEstimatedProfitAmount() : storeOrderProductEntity.getProfitAmount());// 实际毛利金额 + storeOrderProduct.setProfitMargin(storeOrderProductEntity.getProfitMargin() == null ? storeOrderProduct.getEstimatedProfitMargin() : storeOrderProductEntity.getProfitMargin());// 实际毛利率 + orderProductList.add(storeOrderProduct); + List storeOrderProductInfoEntityList = storeOrderProductEntity.getProductInfo(); + // 门店菜品销售记录优惠明细校验开始 + if (storeOrderProductInfoEntityList != null && storeOrderProductInfoEntityList.size() > 0) { + for (StoreOrderProductInfoEntity storeOrderProductInfoEntity : storeOrderProductInfoEntityList) { + StoreOrderProductInfo storeOrderProductInfo = new StoreOrderProductInfo(); + storeOrderProductInfo.setCreateDate(createDate); + storeOrderProductInfo.setCreateUser("open-api"); + if (storeOrderProductInfoEntity.getClientId() == null || "".equals(storeOrderProductInfoEntity.getClientId()) || storeOrderProductInfoEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("销售单记录优惠ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductInfo.setClientId(storeOrderProductInfoEntity.getClientId()); + } + + if (storeOrderProductInfoEntity.getOrderItemId() != null && storeOrderProductInfoEntity.getOrderItemId().length() > 64) { + response.setStatus(0); + response.setMessage("销售单记录优惠OrderItemId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductInfo.setOrderItemId(storeOrderProductInfoEntity.getOrderItemId()); + } + storeOrderProductInfo.setStoreId(entity.getStoreId()); + storeOrderProductInfo.setBusNo(entity.getNo()); + storeOrderProductInfo.setType(storeOrderProductInfoEntity.getType()); + if (storeOrderProductInfoEntity.getInfo() != null && storeOrderProductInfoEntity.getInfo().length() > 256) { + response.setStatus(0); + response.setMessage("销售单优惠记录Info参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductInfo.setInfo(storeOrderProductInfoEntity.getInfo()); + } + storeOrderProductInfo.setDiscountMoney(storeOrderProductInfoEntity.getDiscountMoney()); + storeOrderProductInfo.setSaleDate(entity.getSaleDate()); + orderProductInfoList.add(storeOrderProductInfo); + } + } + List storeOrderProductMakeEntityList = storeOrderProductEntity.getProductMake(); + // 门店菜品做法明细校验开始 + if (storeOrderProductMakeEntityList != null && storeOrderProductMakeEntityList.size() > 0) { + for (StoreOrderProductMakeEntity storeOrderProductMakeEntity : storeOrderProductMakeEntityList) { + StoreOrderProductMake storeOrderProductMake = new StoreOrderProductMake(); + storeOrderProductMake.setCreateDate(createDate); + storeOrderProductMake.setCreateUser("open-api"); + if (storeOrderProductMakeEntity.getClientId() == null || "".equals(storeOrderProductMakeEntity.getClientId()) || storeOrderProductMakeEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("菜品做法ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductMake.setClientId(storeOrderProductMakeEntity.getClientId()); + } + if (storeOrderProductMakeEntity.getOrderItemId() != null && storeOrderProductMakeEntity.getOrderItemId().length() > 64) { + response.setStatus(0); + response.setMessage("菜品做法OrderItemId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductMake.setOrderItemId(storeOrderProductMakeEntity.getOrderItemId()); + } + storeOrderProductMake.setStoreId(entity.getStoreId()); + storeOrderProductMake.setStoreNo(entity.getStoreNo()); + storeOrderProductMake.setStoreName(entity.getStoreName()); + storeOrderProductMake.setBusNo(entity.getNo()); + if (storeOrderProductMakeEntity.getMakeId() != null && storeOrderProductMakeEntity.getMakeId().length() > 32) { + response.setStatus(0); + response.setMessage("菜品做法makeId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductMake.setMakeId(storeOrderProductMakeEntity.getMakeId()); + } + if (storeOrderProductMakeEntity.getMakeName() != null && storeOrderProductMakeEntity.getMakeName().length() > 32) { + response.setStatus(0); + response.setMessage("菜品做法makeName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductMake.setMakeName(storeOrderProductMakeEntity.getMakeName()); + } + storeOrderProductMake.setAddPrice(storeOrderProductMakeEntity.getAddPrice()); + storeOrderProductMake.setDiscountPrice(storeOrderProductMakeEntity.getDiscountPrice()); + storeOrderProductMake.setCount(storeOrderProductMakeEntity.getCount()); + storeOrderProductMake.setRcount(storeOrderProductMakeEntity.getRcount()); + storeOrderProductMake.setAddTotal(storeOrderProductMakeEntity.getAddTotal()); + storeOrderProductMake.setDiscountAddTotal(storeOrderProductMakeEntity.getDiscountAddTotal()); + storeOrderProductMake.setDiscount(storeOrderProductMakeEntity.getDiscount()); + storeOrderProductMake.setQtyFlag(storeOrderProductMakeEntity.getQtyFlag()); + storeOrderProductMake.setHand(storeOrderProductMakeEntity.getHand()); + storeOrderProductMake.setSaleDate(entity.getSaleDate()); + makeList.add(storeOrderProductMake); + } + } + } + } else { + Map data = new HashMap<>(); + data.put("busNo", storeBusinessTicket.getNo()); + data.put("ticketId", new Date().getTime()); + response.setStatus(1); + response.setMessage("销售数据上传成功"); + response.setData(data); + logger.error("无销售明细的数据上传jsonString:" + tenantId + "" + storeBusinessTicket.getStoreNo()); + return response; + } + // 门店菜品销售记录优惠明细校验开始 + List payList = new ArrayList<>(); + List storePayEntityList = entity.getPay(); + if (storePayEntityList != null && storePayEntityList.size() > 0) { + for (StorePayEntity storePayEntity : storePayEntityList) { + StorePay storePay = new StorePay(); + storePay.setCreateDate(createDate); + storePay.setCreateUser("open-api"); + if (storePayEntity.getClientId() == null || "".equals(storePayEntity.getClientId()) || storePayEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("支付记录ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setClientId(storePayEntity.getClientId()); + } + storePay.setStoreId(entity.getStoreId()); + storePay.setStoreNo(entity.getStoreNo()); + storePay.setStoreName(entity.getStoreName()); + storePay.setBusNo(entity.getNo()); + storePay.setBusMode(entity.getBusMode()); + if (storePayEntity.getPayNo() == null || "".equals(storePayEntity.getPayNo()) || storePayEntity.getPayNo().length() > 32) { + response.setStatus(0); + response.setMessage("支付记录BusNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setPayNo(storePayEntity.getPayNo()); + } + storePay.setTableNo(entity.getTableNo()); + if (storePayEntity.getPayTypeNo() == null || "".equals(storePayEntity.getPayTypeNo()) || storePayEntity.getPayTypeNo().length() > 32) { + response.setStatus(0); + response.setMessage("支付记录PayTypeNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setPayTypeNo(storePayEntity.getPayTypeNo()); + } + if (storePayEntity.getPayType() != null && storePayEntity.getPayType().length() > 16) { + response.setStatus(0); + response.setMessage("支付记录payType参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setPayType(storePayEntity.getPayType()); + } + storePay.setPaid(storePayEntity.getPaid()); + storePay.setRchange(storePayEntity.getRchange()); + storePay.setMoney(storePayEntity.getMoney()); + storePay.setOverAmount(storePayEntity.getOverAmount()); + storePay.setWorkNo(entity.getWorkNo()); + storePay.setDeviceName(entity.getDeviceName()); + storePay.setDeviceMac(entity.getDeviceMac()); + storePay.setDeviceIp(entity.getDeviceIp()); + storePay.setPosNo(entity.getPosNo()); + if (storePayEntity.getVoucherNo() != null && storePayEntity.getVoucherNo().length() > 128) { + response.setStatus(0); + response.setMessage("支付记录VoucherNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setVoucherNo(storePayEntity.getVoucherNo()); + } + storePay.setPayDate(entity.getSaleDate());// 订单时间和销售时间一致 + if (storePayEntity.getCardno() != null && storePayEntity.getCardno().length() > 32) { + response.setStatus(0); + response.setMessage("支付记录Cardno参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setCardno(storePayEntity.getCardno()); + } + storePay.setCardYe(storePayEntity.getCardYe()); + storePay.setCardJf(storePayEntity.getCardJf()); + storePay.setIncomeFlag(storePayEntity.getIncomeFlag()); + storePay.setOtherRateType(storePayEntity.getOtherRateType()); + storePay.setOtherRateValue(storePayEntity.getOtherRateValue()); + storePay.setOtherRate(storePayEntity.getOtherRate()); + storePay.setPayChannel(storePayEntity.getPayChannel()); + if (storePayEntity.getMemo() != null && storePayEntity.getMemo().length() > 256) { + response.setStatus(0); + response.setMessage("支付记录Memo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setMemo(storePayEntity.getMemo()); + } + if(StringUtils.isNotEmpty(storePayEntity.getExt1())){ + storePay.setExt1(storePayEntity.getExt1()); + } + if(StringUtils.isNotEmpty(storePayEntity.getExt2())){ + storePay.setExt2(storePayEntity.getExt2()); + } + payList.add(storePay); + } + } + + // 前台销售单外送信息校验开始,2017-12-23 + List deliveryList = new ArrayList<>(); + List deliveryEntityList = entity.getDeliveryInfo(); + if (CollectionUtils.isNotEmpty(deliveryEntityList)) { + for (StoreBusinessTicketDeliveryEntity deliveryEntity : deliveryEntityList) { + StoreBusinessTicketDelivery delivery = new StoreBusinessTicketDelivery(); + delivery.setCreateDate(createDate); + delivery.setCreateUser("open-api"); + if (deliveryEntity.getClientId() == null || "".equals(deliveryEntity.getClientId()) || deliveryEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("外送信息ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + delivery.setClientId(deliveryEntity.getClientId()); + } + delivery.setStoreId(entity.getStoreId());// 门店ID + delivery.setBusNo(entity.getNo());// 单据编号 + delivery.setOrderTime(deliveryEntity.getOrderTime());// 订餐时间 + delivery.setVisitorName(deliveryEntity.getVisitorName());// 订餐人 + delivery.setOrderTel(deliveryEntity.getOrderTel());// 订餐电话 + delivery.setRecipientName(deliveryEntity.getRecipientName());// 收货人名称 + delivery.setRecipientPhone(deliveryEntity.getRecipientPhone());// 收货人电话 + delivery.setRecipientAddress(deliveryEntity.getRecipientAddress());// 收货人地址 + delivery.setDeliveryWorkerNo(deliveryEntity.getDeliveryWorkerNo());// 送餐员工号 + delivery.setDeliveryWorkerName(deliveryEntity.getDeliveryWorkerName());// 送餐员名称 + delivery.setAdvanceAmount(deliveryEntity.getAdvanceAmount());// 预支金额 + delivery.setDistributionFee(deliveryEntity.getDistributionFee());// 加收服务费 + delivery.setDeliveryBeginTime(deliveryEntity.getDeliveryBeginTime());// 送出时间 + delivery.setDeliveryEndTime(deliveryEntity.getDeliveryEndTime());// 送达时间 + delivery.setSettlementTime(deliveryEntity.getSettlementTime());// 交账时间 + deliveryList.add(delivery); + } + } + try { + long ticketId = IdWorkerUtils.getInstance().nextId(); + storeBusinessTicket.setId(String.valueOf(ticketId)); + // 放入消息队列 + Map message = new HashMap<>(); + message.put("type", "businessorderplus"); + message.put("storeBusinessTicket", storeBusinessTicket); + message.put("ticketInfoList", ticketInfoList); + message.put("orderProductList", orderProductList); + message.put("orderProductInfoList", orderProductInfoList); + message.put("payList", payList); + message.put("makeList", makeList); + message.put("deliveryList", deliveryList); + CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString()); + this.mqMessageSender.send4businessorderplus(tenantId, message, correlationData); + Map data = new HashMap<>(); + data.put("busNo", storeBusinessTicket.getNo()); + data.put("ticketId", ticketId); + response.setStatus(1); + response.setMessage("销售数据上传成功"); + response.setData(data); + } catch (Exception ex) { + logger.error("数据上传(加强版)放入消息队列时发生异常", ex); + Map data = new HashMap<>(); + data.put("busNo", storeBusinessTicket.getNo()); + data.put("ticketId", ""); + response.setStatus(2); + response.setMessage("服务器繁忙,请稍后再传"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + response.setData(data); + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + logger.error("jsonString:" + jsonString); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 验证是否启用自动耗料 + */ + private boolean validEnableZdhl(String tenantId) { + String info = "验证[" + tenantId + "]是否启用自动耗料"; + logger.debug(">>>>>>>" + info + "。。。"); + boolean result = false; + try { + // 可引入缓存,验证结果放入缓存10分钟后失效 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketSign", "storeStock")); + List settinglist = settingService.getList(tenantId, criteria); + Map settingMap = new HashMap<>(); + for (TicketPrintSetting setting : settinglist) { + settingMap.put(setting.getKey(), setting); + } + result = settingMap.get("zdhl") != null && StringUtils.equalsIgnoreCase("1", settingMap.get("zdhl").getValue()); + } catch (Exception ex) { + logger.error(info + "时,发生异常", ex); + } + logger.debug(">>>>>>>" + info + "。。。result:" + result); + return result; + } + + @ServiceMethod(method = "upload.business.order.burden", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "销售耗料数据上传") + @Override + public Object businessOrderBurdenUpload(BusinessOrderBurdenUploadRequest request) { + String info = "销售耗料数据上传"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + CommonDataResponse response = null; + String jsonString = request.getJsonString(); + String storeId = request.getStoreId(); + try { + response = new CommonDataResponse(); + // Store store = storeService.get(tenantId, request.getStoreId()); + // if (store == null) { + // response.setStatus(0); + // response.setMessage("门店ID不存在"); + // response.setErrCode(CommonErrorCode.error998.getCode()); + // response.setErrMessage(CommonErrorCode.error998.getMessage()); + // return response; + // } + boolean enableZdhl = validEnableZdhl(tenantId); + if (!enableZdhl) { + Map data = new HashMap<>(); + response.setStatus(1); + response.setMessage("未启用自动耗料"); + response.setData(data); + return response; + } + // 查询门店仓库 + List storeStorageList = storeStorageService.getListByStoreId(tenantId, storeId); + if (CollectionUtils.isEmpty(storeStorageList)) { + logger.debug("销售订单所属门店没有仓库信息:[" + tenantId + "," + storeId + "]"); + Map data = new HashMap<>(); + response.setStatus(1); + response.setMessage("门店没有仓库信息"); + response.setData(data); + return response; + } + JSONArray array = JSONObject.parseArray(jsonString); + StoreBusinessOrderBurdenEntity entity = new StoreBusinessOrderBurdenEntity(array); + Map result = new HashMap<>(); + if (entity.getList() != null && entity.getList().size() > 0) { + List stockList = new ArrayList(); + // 出库仓库 + StoreStorage storeStorage = storeStorageList.get(0); + for (StoreOrderBurdenEntity burdenEntity : entity.getList()) { + ProductStoreStockLog productStoreStockLog = new ProductStoreStockLog(); + Map productUnitMap = productUnitCache.getAllMap(tenantId); + + ProductRatio productRatio = productRatioService.find(tenantId, "productId", burdenEntity.getBurdenProductId()); + if (productRatio == null) { + logger.debug("没有库存系数:[" + tenantId + "," + storeId + "]"); + continue; + } + BigDecimal quantity = new BigDecimal(burdenEntity.getSalesAmount()); + Product product = productService.get(tenantId, burdenEntity.getBurdenProductId()); + if (product == null) { + logger.debug("销售订单所属门店没有仓库信息:[" + tenantId + "," + storeId + "]"); + continue; + } + ProductSpec productSpec = productSpecService.get(tenantId, burdenEntity.getBurdenSpecId()); + if (productSpec == null) { + logger.debug("销售订单所属门店没有仓库信息:[" + tenantId + "," + storeId + "]"); + continue; + } + BigDecimal money = new BigDecimal(productSpec.getCostPrice()); + BigDecimal price = BigDecimal.ZERO; + // 门店库存单位 + // 单位换算,1包装单位=xx销售单位(psScale),1配送单位=xx包装单位(dpScale) + if (!StringUtils.equalsIgnoreCase(productRatio.getSalesUnitId(), productRatio.getPackUnitId())) { + // 出库数量 + quantity = MathUtil.divide(quantity, new BigDecimal(productRatio.getPsScale()), 4, BigDecimal.ROUND_HALF_UP);// 4位小数,四舍五入 + // 出库单价 + price = MathUtil.eq(quantity, BigDecimal.ZERO) ? BigDecimal.ZERO : MathUtil.divide(money, quantity, 4, BigDecimal.ROUND_HALF_UP);// 4位小数,四舍五入 + } + productStoreStockLog.setTenantId(tenantId); + productStoreStockLog.setStoreId(storeId);// 门店ID + productStoreStockLog.setStorageName(storeStorage.getName());// 仓库名称 + productStoreStockLog.setStorageId(storeStorage.getId());// 仓库ID + productStoreStockLog.setSpecName(productSpec.getName());// 规格名称 + productStoreStockLog.setSpecId(burdenEntity.getBurdenSpecId());// 规格ID + productStoreStockLog.setProductNo(product.getNo());// 商品编号 + productStoreStockLog.setProductName(product.getName());// 商品名称 + productStoreStockLog.setProductId(burdenEntity.getBurdenProductId());// 商品ID + productStoreStockLog.setProductDescription(product.getDescription());// 商品说明 + productStoreStockLog.setPrice(MathUtil.subtract(BigDecimal.ZERO, price).doubleValue());// 商品价格 + productStoreStockLog.setPackUnitName(productUnitMap.get(productRatio.getPackUnitId()) != null ? productUnitMap.get(productRatio.getPackUnitId()).getName() : "");// 包装单位名称 + productStoreStockLog.setPackUnitId(productRatio.getPackUnitId());// 包装单位ID + productStoreStockLog.setOrderTypeName("销售出库");// 单据类型 + productStoreStockLog.setOrderType(4);// 单据类型 + productStoreStockLog.setOrderNo(burdenEntity.getTradeNo());// 单号 + productStoreStockLog.setMoney(MathUtil.subtract(BigDecimal.ZERO, money).doubleValue());// 金额 + productStoreStockLog.setDispatchUnitName(productUnitMap.get(productRatio.getDispatchUnitId()) != null ? productUnitMap.get(productRatio.getDispatchUnitId()).getName() : "");// 配送单位名称 + productStoreStockLog.setDispatchUnitId(productRatio.getDispatchUnitId());// 配送单位ID + productStoreStockLog.setAmount(quantity.doubleValue());// 发生数量 + productStoreStockLog.setId(burdenEntity.getClientId()); + stockList.add(productStoreStockLog); + } + try { + // 放入消息队列 + Map message = new HashMap<>(); + message.put("type", "orderburden"); + message.put("stockList", stockList); + CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString()); + this.mqMessageSender.send4orderburden(tenantId, message, correlationData); + response.setStatus(1); + response.setMessage("操作成功"); + Map data = new HashMap<>(); + response.setData(data); + } catch (Exception ex) { + logger.error("库存耗料放入消息队列时发生异常", ex); + response.setStatus(0); + response.setMessage("操作失败"); + Map data = new HashMap<>(); + response.setData(data); + } + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + logger.error("jsonString:" + jsonString); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "upload.business.log", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "销售耗料数据上传") + @Override + public Object businessLogUpload(BusinessLogUploadRequest request) { + String info = "上传错误日志"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + CommonDataResponse response = null; + String jsonString = request.getJsonString(); + String storeId = request.getStoreId(); + try { + response = new CommonDataResponse(); + + JSONArray array = JSONObject.parseArray(jsonString); + StoreBusinessLogEntity entity = new StoreBusinessLogEntity(array); + Map result = new HashMap<>(); + if (entity.getList() != null && entity.getList().size() > 0) { + + List logList = new ArrayList(); + for (StoreOperationLogEntity logEntity : entity.getList()) { + StoreOperationLog operationLog = new StoreOperationLog(); + operationLog.setTenantId(tenantId); + operationLog.setStoreId(storeId);// 门店ID + if (logEntity.getStoreNo() != null && logEntity.getStoreNo().length() > 32) { + response.setStatus(0); + response.setMessage("主单storeNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + operationLog.setStoreNo(logEntity.getStoreNo()); + } + if (logEntity.getStoreName() != null && logEntity.getStoreName().length() > 500) { + response.setStatus(0); + response.setMessage("主单storeName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + operationLog.setStoreName(logEntity.getStoreName()); + } + if (logEntity.getWorkerNo() != null && logEntity.getWorkerNo().length() > 32) { + response.setStatus(0); + response.setMessage("主单WorkerNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + operationLog.setWorkerNo(logEntity.getWorkerNo()); + } + if (logEntity.getShiftNo() != null && logEntity.getShiftNo().length() > 16) { + response.setStatus(0); + response.setMessage("主单ShiftNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + operationLog.setShiftNo(logEntity.getShiftNo()); + } + if (logEntity.getShiftName() != null && logEntity.getShiftName().length() > 32) { + response.setStatus(0); + response.setMessage("主单ShiftName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + operationLog.setShiftName(logEntity.getShiftName()); + } + if (logEntity.getDeviceName() != null && logEntity.getDeviceName().length() > 64) { + response.setStatus(0); + response.setMessage("主单DeviceName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + operationLog.setDeviceName(logEntity.getDeviceName()); + } + if (logEntity.getDeviceMac() != null && logEntity.getDeviceMac().length() > 32) { + response.setStatus(0); + response.setMessage("主单DeviceMac参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + operationLog.setDeviceMac(logEntity.getDeviceMac()); + } + if (logEntity.getDeviceIp() != null && logEntity.getDeviceIp().length() > 256) { + response.setStatus(0); + response.setMessage("主单DeviceIp参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + operationLog.setDeviceIp(logEntity.getDeviceIp()); + } + if (logEntity.getPosNo() != null && logEntity.getPosNo().length() > 16) { + response.setStatus(0); + response.setMessage("主单PosNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + operationLog.setPosNo(logEntity.getPosNo()); + } + if (logEntity.getOperationTime() != null && logEntity.getOperationTime().length() > 32) { + response.setStatus(0); + response.setMessage("主单OperationTime参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + operationLog.setOperationTime(logEntity.getOperationTime()); + } + if (logEntity.getType() != null && logEntity.getType().length() > 32) { + response.setStatus(0); + response.setMessage("主单Type参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + operationLog.setType(logEntity.getType()); + } + if (logEntity.getTypeTxt() != null && logEntity.getTypeTxt().length() > 32) { + response.setStatus(0); + response.setMessage("主单TypeTxt参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + operationLog.setTypeTxt(logEntity.getTypeTxt()); + } + operationLog.setMemo(logEntity.getMemo()); + logList.add(operationLog); + } + try { + // 放入消息队列 + Map message = new HashMap<>(); + message.put("type", "buslog"); + message.put("buslog", logList); + CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString()); + this.mqMessageSender.send4buslog(tenantId, message, correlationData); + response.setStatus(1); + response.setMessage("操作成功"); + Map data = new HashMap<>(); + response.setData(data); + } catch (Exception ex) { + logger.error("操作日志数据上传数据放入消息队列时发生异常", ex); + response.setStatus(0); + response.setMessage("操作失败"); + Map data = new HashMap<>(); + response.setData(data); + } + } + + } catch (Exception e) { + logger.error(info + ",发生异常", e); + logger.error("jsonString:" + jsonString); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/worker/WorkerServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/worker/WorkerServiceImpl.java new file mode 100644 index 0000000..2e12f22 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/impl/worker/WorkerServiceImpl.java @@ -0,0 +1,528 @@ +package com.jwsaas.api.service.impl.worker; + +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; + +import com.jwsaas.Constant; +import com.jwsaas.api.request.worker.WorkerListRequest; +import com.jwsaas.api.request.worker.WorkerLoginRequest; +import com.jwsaas.api.request.worker.WorkerPosModuleRequest; +import com.jwsaas.api.request.worker.WorkerPosRoleRequest; +import com.jwsaas.api.request.worker.WorkerUpdatePwdRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.response.mode.CommonListResponse; +import com.jwsaas.api.response.mode.CommonPagerResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.worker.WorkerService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.PosInfo; +import com.jwsaas.entity.food.PosRole; +import com.jwsaas.entity.food.Store; +import com.jwsaas.entity.food.StoreLoginLog; +import com.jwsaas.entity.food.StoreWorker; +import com.jwsaas.entity.food.StoreWorkerExt; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.open.session.SimpleSession; +import com.jwsaas.open.utils.WopUtils; +import com.jwsaas.pager.Pager; +import com.jwsaas.reactor.event.EventKeys; +import com.jwsaas.utils.AppKeyUtil; +import com.jwsaas.utils.BCrypt; + +import reactor.bus.Event; + +@ServiceMethodBean(version = "1.0") +public class WorkerServiceImpl extends WopServiceImpl implements WorkerService { + + private static final long serialVersionUID = 876398783413648003L; + + @Resource + private com.jwsaas.service.food.StoreService storeService; + @Resource + private com.jwsaas.service.food.PosInfoService posInfoService; + @Resource + private com.jwsaas.service.food.StoreWorkerService storeWorkerService; + @Resource + private com.jwsaas.service.food.StoreLoginLogService storeLoginLogService; + @Resource + private com.jwsaas.service.food.PosRoleService posRoleService; + @Resource + private com.jwsaas.service.food.StoreWorkerExtService storeWorkerExtService; + + @ServiceMethod(method = "worker.login", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "员工登录接口") + @Override + public Object workerLogin(WorkerLoginRequest request) { + String info = "POS登陆接口"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Store store = storeService.get(tenantId, request.getStoreId()); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + if (store.getAuthFlag() == 0) { + response.setStatus(0); + response.setMessage("门店未授权开通"); + response.setErrCode(CommonErrorCode.error9.getCode()); + response.setErrMessage(CommonErrorCode.error9.getMessage()); + return response; + } + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("posNo", request.getPosNo())); + criteria.add(Restrictions.eq("storeId", request.getStoreId())); + List posInfoList = posInfoService.getList(tenantId, criteria); + if (posInfoList == null || posInfoList.size() <= 0) { + response.setStatus(0); + response.setMessage("POS编号不存在,请联系管理员"); + response.setErrCode(CommonErrorCode.error5.getCode()); + response.setErrMessage(CommonErrorCode.error5.getMessage()); + return response; + } + StoreWorker storeWorker = storeWorkerService.find(tenantId, "no", request.getUserName()); + if (storeWorker == null) { + response.setStatus(0); + response.setMessage("员工工号不存在"); + response.setErrCode(CommonErrorCode.error6.getCode()); + response.setErrMessage(CommonErrorCode.error6.getMessage()); + return response; + } + if (storeWorker.getDeleteFlag() == 1) { + response.setStatus(0); + // response.setMessage("员工已被删除"); + response.setMessage("员工信息不存在"); + response.setErrCode(CommonErrorCode.error6.getCode()); + response.setErrMessage(CommonErrorCode.error6.getMessage()); + return response; + } + boolean flag = storeWorkerService.isStoreWorker(tenantId, storeWorker.getId(), request.getStoreId()); + if (!flag) { + response.setStatus(0); + response.setMessage("此员工无权登录当前门店"); + response.setErrCode(CommonErrorCode.error8.getCode()); + response.setErrMessage(CommonErrorCode.error8.getMessage()); + return response; + } + + // 校验门店登陆密码 + // 获取员工门店扩展信息 + criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", store.getId()));// 门店ID + criteria.add(Restrictions.eq("workerNo", request.getUserName()));// 员工工号 + List workerExtList = storeWorkerExtService.getList(tenantId, criteria); + + String passwd = getDecryptStr(request.getPassword()); + String passwdHash = null; + if (CollectionUtils.isEmpty(workerExtList)) { + passwdHash = storeWorker.getPasswd(); + } else { + if (workerExtList.size() >= 1) { + passwdHash = workerExtList.get(0).getPasswd(); + } + } + + // 校验密码 + if (passwdHash == null || !BCrypt.checkpw(passwd, passwdHash)) { + response.setStatus(0); + response.setMessage("员工登录密码错误"); + response.setErrCode(CommonErrorCode.error7.getCode()); + response.setErrMessage(CommonErrorCode.error7.getMessage()); + return response; + } + + // 密码校验成功后的操作 + SimpleSession session = new SimpleSession(); + session.setAttribute("appKey", appKey); + session.setAttribute("appId", appId); + session.setAttribute("tenantCode", tenantId); + session.setAttribute("appCode", appCode); + session.setAttribute("storeId", request.getStoreId()); + session.setAttribute("workerNo", request.getUserName()); + session.setAttribute("posNo", request.getPosNo()); + String sessionId = WopUtils.getUUID(); + request.getWopRequestContext().addSession(sessionId, session); + // 登录成功记录操作日志 + StoreLoginLog storeLoginLog = new StoreLoginLog(); + storeLoginLog.setTenantId(tenantId); + storeLoginLog.setWorkerNo(request.getUserName()); + storeLoginLog.setStoreNo(store.getNo()); + storeLoginLog.setStoreName(store.getName()); + storeLoginLog.setLoginTime(new Date()); + storeLoginLog.setType(1);// 登录门店前台 + storeLoginLog.setPosNo(request.getPosNo()); + storeLoginLog.setCreateDate(new Date()); + storeLoginLog.setCreateUser("open-api"); + storeLoginLogService.save(tenantId, storeLoginLog); + Map map = new HashMap<>(); + map.put("session", sessionId); + map.put("id", storeWorker.getId()); + map.put("storeId", storeWorker.getStoreId()); + map.put("departmentId", storeWorker.getDepartmentId()); + map.put("no", storeWorker.getNo()); + map.put("name", storeWorker.getName()); + map.put("sex", storeWorker.getSex()); + map.put("birthday", storeWorker.getBirthday()); + map.put("email", storeWorker.getEmail()); + map.put("mobile", storeWorker.getMobile()); + map.put("passwd", passwdHash);// map.put("passwd", storeWorker.getPasswd()); + map.put("description", storeWorker.getDescription()); + response.setData(map); + response.setStatus(1); + response.setMessage("验证成功"); + + // 登陆成功之后的事件处理 + Map eventData = new HashMap<>(); + eventData.put("appKey", appKey); + eventData.put("appId", appId); + eventData.put("tenantCode", tenantCode); + eventData.put("appCode", appCode); + eventData.put("tenantId", tenantId); + eventData.put("storeId", store.getId()); + eventData.put("storeNo", store.getNo()); + eventData.put("storeName", store.getName()); + eventData.put("workId", storeWorker.getId()); + eventData.put("workNo", storeWorker.getNo()); + eventData.put("workName", storeWorker.getName()); + eventData.put("posNo", request.getPosNo()); + eventData.put("loginTime", storeLoginLog.getLoginTime()); + eventData.put("posInfo", posInfoList.get(0)); + eventBus.notify(EventKeys.WORKER_LOGIN, Event.wrap(eventData)); + + // POS最后活跃时间事件 + eventData = new HashMap<>(); + eventData.put("appKey", appKey); + eventData.put("appId", appId); + eventData.put("tenantCode", tenantCode); + eventData.put("appCode", appCode); + eventData.put("tenantId", tenantId); + eventData.put("storeId", store.getId()); + eventData.put("posNo", request.getPosNo()); + eventBus.notify(EventKeys.POS_LAST_ACTIVE_TIME, Event.wrap(eventData)); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "LOGIN_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "worker.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店可登陆员工列表") + @Override + public Object workerList(WorkerListRequest request) { + String info = "门店可登陆员工列表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + CommonListResponse response = null; + try { + response = new CommonListResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + List workerList = storeWorkerService.getStoreWorkerList(tenantId, storeId); + + // 获取员工扩展信息 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId));// 门店ID + List workerExtList = storeWorkerExtService.getList(tenantId, criteria); + Map workerExtMap = new HashMap<>(); + for (StoreWorkerExt workerExt : workerExtList) { + workerExtMap.put(workerExt.getWorkerId(), workerExt); + } + + // 组织返回结果 + List> list = new ArrayList<>(); + for (StoreWorker storeWorker : workerList) { + if (storeWorker.getDeleteFlag() == 1) { + continue; + } + + Map map = new HashMap<>(); + map.put("tenantId", storeWorker.getTenantId()); + map.put("id", storeWorker.getId()); + map.put("storeId", storeWorker.getStoreId()); + map.put("departmentId", storeWorker.getDepartmentId()); + map.put("no", storeWorker.getNo()); + map.put("name", storeWorker.getName()); + map.put("sex", storeWorker.getSex()); + map.put("birthday", storeWorker.getBirthday()); + map.put("email", storeWorker.getEmail()); + map.put("mobile", storeWorker.getMobile()); + map.put("passwd", storeWorker.getPasswd()); + map.put("description", storeWorker.getDescription()); + + // 获取门店登陆密码 + if (workerExtMap.get(storeWorker.getId()) != null) { + map.put("passwd", workerExtMap.get(storeWorker.getId()).getPasswd()); + } + + list.add(map); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "LIST_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "worker.posrole", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店员工POS折扣免单权限") + @Override + public Object workerPosRole(WorkerPosRoleRequest request) { + String info = "门店可登陆员工列表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + pager = posRoleService.getStoreWorkerPosRole(tenantId, request.getStoreId(), pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (PosRole posRole : source) { + Map map = new HashMap<>(); + map.put("tenantId", posRole.getTenantId()); + map.put("storeId", request.getStoreId()); + map.put("workerId", posRole.getWorkerId()); + map.put("roleId", posRole.getRoleId()); + map.put("discount", doubleFormat(posRole.getDiscount())); + map.put("free", doubleFormat(posRole.getFree())); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "POSROLE_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "worker.posmodule", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店员工POS模块权限") + @Override + public Object workerPosModule(WorkerPosModuleRequest request) { + String info = "门店可登陆员工列表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + pager = posRoleService.getStoreWorkerPosModule(tenantId, request.getStoreId(), pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (PosRole posRole : source) { + Map map = new HashMap<>(); + map.put("tenantId", posRole.getTenantId()); + map.put("storeId", request.getStoreId()); + map.put("workerId", posRole.getWorkerId()); + map.put("moduleNo", posRole.getModuleNo()); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "POSMODULE_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "worker.update.pwd", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "员工修改门店登陆密码") + @Override + public Object workerUpdatePwd(WorkerUpdatePwdRequest request) { + String info = "员工修改门店登陆密码"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + // String posNo = request.getPosNo();// POS编号 + String workerId = request.getWorkerId();// 员工ID + String workerNo = request.getWorkerNo();// 员工工号 + String passwd = request.getPasswd();// 密码 + String newPasswd = request.getNewPasswd();// 新密码 + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Store store = storeService.get(tenantId, request.getStoreId()); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + if (store.getAuthFlag() == 0) { + response.setStatus(0); + response.setMessage("门店未授权开通"); + response.setErrCode(CommonErrorCode.error9.getCode()); + response.setErrMessage(CommonErrorCode.error9.getMessage()); + return response; + } + + boolean flag = storeWorkerService.isStoreWorker(tenantId, workerId, request.getStoreId()); + if (!flag) { + response.setStatus(0); + response.setMessage("此员工无权登录当前门店"); + response.setErrCode(CommonErrorCode.error8.getCode()); + response.setErrMessage(CommonErrorCode.error8.getMessage()); + return response; + } + + newPasswd = getDecryptStr(newPasswd); + String hashed = BCrypt.hashpw(newPasswd, BCrypt.gensalt()); + Map dataMap = new HashMap<>(); + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId));// 门店ID + criteria.add(Restrictions.eq("workerId", workerId));// 员工工号 + List workerExtList = storeWorkerExtService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(workerExtList)) { + // 为空新增一条记录 + StoreWorkerExt saveObj = new StoreWorkerExt(); + saveObj.setWorkerId(workerId);// 员工ID + saveObj.setWorkerNo(workerNo);// 员工工号 + saveObj.setStoreId(storeId);// 门店ID + saveObj.setStoreNo(store.getNo());// 门店编号 + saveObj.setPasswd(hashed);// 登录密码 + saveObj.setDescription(null);// 备注 + saveObj.setCreateDate(new Date()); + saveObj.setCreateUser(Constant.CREATE_USER); + storeWorkerExtService.save(tenantId, saveObj); + + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(dataMap); + return response; + } + + StoreWorkerExt workerExt = workerExtList.get(0); + if (StringUtils.isNotBlank(passwd)) { + passwd = getDecryptStr(passwd); + if (!BCrypt.checkpw(passwd, workerExt.getPasswd())) { + response.setStatus(0); + response.setMessage("员工登录密码错误"); + response.setErrCode(CommonErrorCode.error7.getCode()); + response.setErrMessage(CommonErrorCode.error7.getMessage()); + return response; + } + } + + StoreWorkerExt updateObj = new StoreWorkerExt(); + updateObj.setId(workerExt.getId()); + updateObj.setPasswd(hashed); + updateObj.setModifyDate(new Date()); + updateObj.setModifyUser(Constant.CREATE_USER); + storeWorkerExtService.update(tenantId, updateObj); + + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(dataMap); + + // 员工密码修改后,掌柜查询需重新登陆 + logger.debug(">>>>>>>员工密码修改后,掌柜查询需重新登陆"); + Map eventData = new HashMap<>(); + eventData.put("tenantCode", tenantCode); + eventData.put("tenantId", tenantId); + eventData.put("storeNo", store.getNo()); + eventData.put("workerNo", workerNo); + eventBus.notify(EventKeys.ZGCX_LOGIN_OUT, Event.wrap(eventData)); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/intelligence/IntelligenceGoodsService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/intelligence/IntelligenceGoodsService.java new file mode 100644 index 0000000..2ce47bb --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/intelligence/IntelligenceGoodsService.java @@ -0,0 +1,22 @@ +package com.jwsaas.api.service.intelligence; + +import com.jwsaas.api.request.storage.ProductStockRequest; +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.api.service.WopService; + +/** + * 建行互联网支付相关接口 + */ +public interface IntelligenceGoodsService extends WopService { + + /** + * 获取预估营业额 + */ + Object getPredictionTurnover(StoreBaseRequest request); + + /** + * 获取门店商品库存数量 + */ + Object getProductStockByPids(ProductStockRequest request); + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/jwygj/StoreYgjProductService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/jwygj/StoreYgjProductService.java new file mode 100644 index 0000000..80b8f00 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/jwygj/StoreYgjProductService.java @@ -0,0 +1,104 @@ +package com.jwsaas.api.service.jwygj; + +import com.jwsaas.api.request.jwygj.YgjAddProductCheckRequest; +import com.jwsaas.api.request.jwygj.YgjAddProductRequest; +import com.jwsaas.api.request.jwygj.YgjAddSuitRequest; +import com.jwsaas.api.request.jwygj.YgjEditProductRequest; +import com.jwsaas.api.request.jwygj.YgjProductTypeRequest; +import com.jwsaas.api.request.product.ProductTypeRequest; +import com.jwsaas.api.request.wxyh.WxyhGoodsRequest; +import com.jwsaas.api.service.WopService; + +public interface StoreYgjProductService extends WopService { + + /** + * 新建商品校验 + * + * @param request + * @return + */ + Object ygjAddProductCheck(YgjAddProductCheckRequest request); + + /** + * 新建商品 + * + * @param request + * @return + */ + Object ygjAddProduct(YgjAddProductRequest request); + + /** + * 新建商品 + * + * @param request + * @return + */ + Object ygjAddProductSpecs(YgjAddProductRequest request); + + /** + * 新建套餐 + * + * @param request + * @return + */ + Object ygjAddSuit(YgjAddSuitRequest request); + + /** + * 修改商品信息 + * + * @param request + * @return + */ + Object ygjEditProduct(YgjEditProductRequest request); + + /** + * 修改规格商品信息 + * + * @param request + * @return + */ + Object ygjEditProductSpec(YgjEditProductRequest request); + + /** + * 云管家商品类别(商品下架、商品调价) + * @param request + * @return + */ + Object ygjProductType(YgjProductTypeRequest request); + + + /** + * 云管家自建商品类别 + * @param request + * @return + */ + Object ygjSelfProductType(ProductTypeRequest request); + + /** + * 云管家商品类别(原料要货) + * @param request + * @return + */ + Object ygjMaterialType(YgjProductTypeRequest request); + + /** + * 云管家商品类别(商品上架) + * @param request + * @return + */ + Object ygjProductTypeMore(YgjProductTypeRequest request); + + /** + * 云管家商品类别(盘点) + * @param request + * @return + */ + Object ygjProductTypeCheck(YgjProductTypeRequest request); + + /** + * 云管家商品查询(盘点) + * @param request + * @return + */ + Object ygjProductStockCheck(WxyhGoodsRequest request); +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/jwygj/StoreYgjWorkerService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/jwygj/StoreYgjWorkerService.java new file mode 100644 index 0000000..ad53177 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/jwygj/StoreYgjWorkerService.java @@ -0,0 +1,34 @@ +package com.jwsaas.api.service.jwygj; + +import com.jwsaas.api.request.jwygj.YgjStoreAccountSummaryRequest; +import com.jwsaas.api.request.jwygj.YgjStoreSetRequest; +import com.jwsaas.api.request.jwygj.YgjWorkerModuleRequest; +import com.jwsaas.api.service.WopService; + +public interface StoreYgjWorkerService extends WopService { + + /** + * 云管家门店设置 + * + * @param request + * @return + */ + Object ygjStoreSet(YgjStoreSetRequest request); + + /** + * 云管家员工权限 + * + * @param request + * @return + */ + Object ygjWorkerModule(YgjWorkerModuleRequest request); + + /** + * 云管家金额变动汇总 + * + * @param request + * @return + */ + Object ygjStoreAccountSummary(YgjStoreAccountSummaryRequest request); + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/kds/KdsService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/kds/KdsService.java new file mode 100644 index 0000000..470fac0 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/kds/KdsService.java @@ -0,0 +1,24 @@ +package com.jwsaas.api.service.kds; + +import com.jwsaas.api.request.kds.KdsPlanRequest; +import com.jwsaas.api.request.kds.KdsProductRequest; +import com.jwsaas.api.service.WopService; + +public interface KdsService extends WopService { + + /** + * 厨房显示方案 + * + * @param request + * @return + */ + Object kdsPlan(KdsPlanRequest request); + + /** + * 商品厨显方案 + * + * @param request + * @return + */ + Object kdsProduct(KdsProductRequest request); +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/kit/KitService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/kit/KitService.java new file mode 100644 index 0000000..8f293e0 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/kit/KitService.java @@ -0,0 +1,24 @@ +package com.jwsaas.api.service.kit; + +import com.jwsaas.api.request.kit.KitPlanRequest; +import com.jwsaas.api.request.kit.KitProductRequest; +import com.jwsaas.api.service.WopService; + +public interface KitService extends WopService { + + /** + * 厨房打印方案 + * + * @param request + * @return + */ + Object kitPlan(KitPlanRequest request); + + /** + * 商品厨打印方案 + * + * @param request + * @return + */ + Object kitProduct(KitProductRequest request); +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/kms/KmsService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/kms/KmsService.java new file mode 100644 index 0000000..fc6f75f --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/kms/KmsService.java @@ -0,0 +1,16 @@ +package com.jwsaas.api.service.kms; + +import com.jwsaas.api.request.kms.ProductSalesInfoRequest; +import com.jwsaas.api.service.WopService; + +/** + * 厨房管理相关接口 + */ +public interface KmsService extends WopService { + + /** + * 商品销售信息 + */ + Object productSalesInfo(ProductSalesInfoRequest request); + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/liteappdc/LiteAppdcService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/liteappdc/LiteAppdcService.java new file mode 100644 index 0000000..a52e535 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/liteappdc/LiteAppdcService.java @@ -0,0 +1,76 @@ +package com.jwsaas.api.service.liteappdc; + +import com.jwsaas.api.request.liteappdc.LiteAppOrderCreateRequest; +import com.jwsaas.api.request.liteappdc.LiteAppSalesOrderCreateRequest; +import com.jwsaas.api.request.liteappdc.LiteAppWxdcSalesOrderCreateRequest; +import com.jwsaas.api.request.liteappdc.LiteAppWxdcSalesPayDataRequest; +import com.jwsaas.api.request.store.StoreAccountRechargeWeixinPayOrderQueryRequest; +import com.jwsaas.api.request.wxdc.WeixinPayUnifiedorderRequest; +import com.jwsaas.api.service.WopService; + +/*** + * 小程序点餐接口 + * @author louxutao + * + */ +public interface LiteAppdcService extends WopService{ + + /*** + * 微信订单创建 + * @return + */ + Object orderCreate(LiteAppOrderCreateRequest request); + + /*** + * 统一下单 + * @return + */ + Object liteAppdcUnifiedorder(WeixinPayUnifiedorderRequest request); + + /*** + * 统一下单 + * @return + */ + Object liteAppdcUnifiedorders(WeixinPayUnifiedorderRequest request); + + /*** + * 查询支付结果 + * @return + */ + Object liteAppdcPayOrderquery(StoreAccountRechargeWeixinPayOrderQueryRequest request); + + /*** + * 查询支付结果 + * @return + */ + Object liteAppdcPayOrderquerys(StoreAccountRechargeWeixinPayOrderQueryRequest request); + + /*** + * 查询支付结果 + * @return + */ + Object liteAppdcPayOrderqueryss(StoreAccountRechargeWeixinPayOrderQueryRequest request); + + + /*** + * 销售订单创建 + * @return + */ + Object liteAppdcSalesOrderCreate(LiteAppSalesOrderCreateRequest request); + + /** + * 微信点餐小程序订单创建; + * @return + */ + Object liteAppWxdcSalesOrderCreate(LiteAppWxdcSalesOrderCreateRequest request); + + /** + * 微信点餐小程序支付成功后,修改订单状态; + * @param request + * @return + */ + Object liteAppWxdcSalesOrderPayDataUpload(LiteAppWxdcSalesPayDataRequest request); + + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/liteappdc/impl/LiteAppdcServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/liteappdc/impl/LiteAppdcServiceImpl.java new file mode 100644 index 0000000..bfd4843 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/liteappdc/impl/LiteAppdcServiceImpl.java @@ -0,0 +1,2130 @@ +package com.jwsaas.api.service.liteappdc.impl; + +import java.math.BigDecimal; +import java.net.URLDecoder; +import java.net.URLEncoder; +import java.util.*; + +import javax.annotation.Resource; + +import com.alibaba.fastjson.JSONArray; +import com.jwsaas.api.request.liteappdc.LiteAppWxdcSalesOrderCreateRequest; +import com.jwsaas.api.request.liteappdc.LiteAppWxdcSalesPayDataRequest; +import com.jwsaas.entity.food.*; +import com.jwsaas.http.HttpTool; +import com.jwsaas.service.food.*; +import com.jwsaas.util.*; +import com.jwsaas.weixin.SignUtil; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.http.HttpResponse; +import org.dom4j.Document; +import org.dom4j.DocumentHelper; +import org.dom4j.Element; +import org.springframework.beans.factory.annotation.Autowired; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.fasterxml.jackson.core.type.TypeReference; +import com.jwsaas.Constant; +import com.jwsaas.OrderPromotionType; +import com.jwsaas.SuitType; +import com.jwsaas.api.request.liteappdc.LiteAppOrderCreateRequest; +import com.jwsaas.api.request.liteappdc.LiteAppSalesOrderCreateRequest; +import com.jwsaas.api.request.store.StoreAccountRechargeWeixinPayOrderQueryRequest; +import com.jwsaas.api.request.wxdc.WeixinPayUnifiedorderRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.liteappdc.LiteAppdcService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.wxdc.Order; +import com.jwsaas.entity.wxdc.OrderItem; +import com.jwsaas.entity.wxdc.OrderItemMake; +import com.jwsaas.entity.wxdc.ProductPromotion; +import com.jwsaas.entity.wxdc.WeixinOrderPay; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.pay.weixin.api.WeiXinPayApi; +import com.jwsaas.pay.weixin.request.QueryOrderRequest; +import com.jwsaas.pay.weixin.request.UnifiedOrderRequest; +import com.jwsaas.pay.weixin.response.QueryOrderResponse; +import com.jwsaas.pay.weixin.response.UnifiedOrderResponse; +import com.jwsaas.pay.weixin.utils.SecurityUtils; +import com.jwsaas.properties.WxyhProperties; +import com.jwsaas.reactor.event.EventKeys; +import com.jwsaas.utils.AppKeyUtil; +import com.jwsaas.utils.IdWorkerUtils; +import com.jwsaas.utils.PreciseCompute; + +import reactor.bus.Event; + +@ServiceMethodBean(version = "1.0") +public class LiteAppdcServiceImpl extends WopServiceImpl implements LiteAppdcService { + + private static final long serialVersionUID = 1L; + + @Autowired + private WxyhProperties wxyhProperties; + @Resource + private com.jwsaas.service.food.StoreService storeService; + @Resource + private com.jwsaas.service.food.WxStoreService wxStoreService; + @Resource + private com.jwsaas.service.wxdc.WeixinOrderPayService weixinOrderPayService; + @Resource + private com.jwsaas.service.food.WxPaymentParameterService wxPaymentParameterService; + @Resource + private com.jwsaas.service.food.StoreAccountRechargeParameterService storeAccountRechargeParameterService; + @Resource + private com.jwsaas.service.food.WxSalesOrderService wxSalesOrderService; + @Resource + private WxSalesOrderLogService wxSalesOrderLogService; + @Resource + private WxSalesPaymentService wxSalesPaymentService; + + + /** + * 微信点餐-创建微信订单 + */ + @ServiceMethod(method = "liteappdc.order.create", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "微信点餐-创建微信订单") + @Override + public Object orderCreate(LiteAppOrderCreateRequest request) { + String info = "微信点餐-创建微信订单"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + String wid = request.getWid(); + String userId = request.getUserId(); + String openId = request.getOpenId(); + String orderInfoJson = request.getOrderInfoJson(); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + + if (StringUtils.isBlank(wid)) { + response.setStatus(0); + response.setMessage("wid不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + WxStore wxStore = wxStoreService.get(tenantId, storeId); + if (wxStore == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + Store store = storeService.get(tenantId, wxStore.getStoreId()); + if (store == null) { + response.setStatus(0); + response.setMessage("erp门店不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + // 组装订单数据 + Order order = processOrderData(orderInfoJson); + logger.debug("order:" + JSON.toJSONString(order)); + + WeixinOrderPay weixinOrder = null; + if (null != order) { + double totalNum = 0; + for (OrderItem item : order.getItems()) { + if (item.getIsSuit() != 3) { + totalNum += item.getCount(); + } + } + // 生成单号 + String orderNo = String.valueOf(IdWorkerUtils.getInstance().nextId()); + String tradeNo = store.getNo() + "_" + orderNo; + logger.info(info + " tenantId:" + tenantId + " orderNo:" + orderNo + " tradeNo:" + tradeNo); + + weixinOrder = new WeixinOrderPay(); + weixinOrder.setWid(wid); + weixinOrder.setUserId(userId); + weixinOrder.setOpenId(openId); + weixinOrder.setMemberId(""); + weixinOrder.setTenantId(tenantId); + + weixinOrder.setOrderNo(orderNo); + weixinOrder.setOutTradeNo(tradeNo); + weixinOrder.setPayway(order.getPayMode()); + weixinOrder.setBusMode(order.getBusMode().toString()); + weixinOrder.setMode(order.getBusMode()); + weixinOrder.setStoreId(order.getStoreId()); + weixinOrder.setStoreNo(order.getStoreNo()); + weixinOrder.setStoreName(order.getStoreName()); + weixinOrder.setPosNo(order.getPosNo()); + weixinOrder.setWorkerNo(order.getWorkerNo()); + weixinOrder.setTableId(order.getTableId()); + weixinOrder.setTableNo(order.getTableNo()); + weixinOrder.setTableName(order.getTableName()); + weixinOrder.setBoxFee(order.getBoxFee()); + weixinOrder.setReceiveName(order.getReceiveName()); + weixinOrder.setReceiveMobile(order.getReceiveMobile()); + weixinOrder.setReceiveAddress(order.getReceiveAddress()); + weixinOrder.setDistributionFee(order.getDistributionFee()); + weixinOrder.setNum(totalNum); + weixinOrder.setBookMobile(order.getPhone()); + weixinOrder.setDetails(JSON.toJSONString(order.getItems())); + weixinOrder.setOrderTime(DateUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss")); + weixinOrder.setStatus(0);// 待支付 + weixinOrder.setAmount(order.getAmount()); + weixinOrder.setMemberMoney(order.getMemberCash()); + weixinOrder.setDiscountAmount(order.getDiscountTotal()); + weixinOrder.setReceiveAmount(order.getReceivable()); + weixinOrder.setDescription(order.getDescription()); + weixinOrder.setCreateDate(new Date()); + weixinOrder.setCreateUser(Constant.CREATE_USER); + weixinOrder = weixinOrderPayService.save(Constant.DEFAULT_DB_SIGN, weixinOrder); + + Map data = new HashMap<>(); + data.put("order", weixinOrder); + + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + } else { + response.setStatus(0); + response.setMessage("提交订单失败,订单信息不能为空"); + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 微信点餐-微信统一下单 + */ + @ServiceMethod(method = "liteappdc.pay.unifiedorder", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "微信点餐-微信统一下单") + @Override + public Object liteAppdcUnifiedorder(WeixinPayUnifiedorderRequest request) { + String info = "微信点餐-微信统一下单"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String operatorType = request.getOperatorType(); + // String sourceSign = request.getSourceSign();// 来源标识 + String appId = request.getAppid();// + String openId = request.getOpenId();// 来源标识 + Double amount = request.getAmount();// 充值金额 + String tradeNo = request.getTradeNo(); + String ip = request.getIp(); + // String orderNo = request.getOrderNo(); + // String workerNo = request.getWorkerNo();// 操作员工号 + // String posNo = request.getPosNo();// 设备编号 + // String memo = request.getMemo();// 备注说明 + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + WxStore wxStore = wxStoreService.get(tenantId, storeId); + if (wxStore == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + Store store = storeService.get(tenantId, wxStore.getStoreId()); + if (store == null) { + response.setStatus(0); + response.setMessage("erp门店不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + if (amount == null) { + response.setStatus(0); + response.setMessage("参数amount不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + BigDecimal payAmount = new BigDecimal(String.valueOf(amount)); + if (payAmount.compareTo(BigDecimal.ZERO) <= 0) { + response.setStatus(0); + response.setMessage("支付金额非法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + // 获取支付参数 + List source = wxPaymentParameterService.getPaymentParameterByStoreId(tenantId, wxStore.getId()); + List> payParamList = new ArrayList<>(); + for (WxPaymentParameter paymentParameter : source) { + Map map = new HashMap<>(); + map.put("tenantId", paymentParameter.getTenantId()); + map.put("id", paymentParameter.getId()); + map.put("no", paymentParameter.getNo()); + map.put("name", paymentParameter.getName()); + map.put("sign", paymentParameter.getSign()); + Map pbodyMap = JSONUtil.parseObject(paymentParameter.getPbody(), new TypeReference>() { + }); + map.put("pbody", pbodyMap); + map.put("certText", paymentParameter.getCertText()); + if ((StringUtils.equalsIgnoreCase("wxpay", paymentParameter.getSign()) || StringUtils.equalsIgnoreCase("subwxpay", paymentParameter.getSign()))) { + payParamList.add(map); + } + } + if (CollectionUtils.isEmpty(payParamList)) { + response.setStatus(0); + response.setMessage("尚未配置支付参数"); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + // 如果子商户非空 取子商户参数 + List subResults = new ArrayList(); + for (Map payParam : payParamList) { + JSONObject body = JSON.parseObject(JSON.toJSONString(payParam.get("pbody"))); + if (StringUtils.isNotBlank(body.getString("submchid"))) { + subResults.add(body); + } + } + Map payParam = new HashMap(); + if (subResults.size() > 0) { + payParam = subResults.get(0); + } else { + payParam = payParamList.get(0); + } + logger.info(info + " >>>>>>> payParam" + JSONUtil.toJSONString(payParam)); + + /************ 测试数据 **************/ + UnifiedOrderRequest unifiedOrderRequest = new UnifiedOrderRequest(); + if (null != payParam.get("submchid") && StringUtils.isNotBlank(payParam.get("submchid").toString())) { + unifiedOrderRequest.setAppid(payParam.get("appid").toString());// 微信分配的公众账号ID + unifiedOrderRequest.setMchId(payParam.get("mchid").toString());// 微信支付分配的商户号 + unifiedOrderRequest.setSubAppid(appId); // 小程序appId + unifiedOrderRequest.setSubMchId(payParam.get("submchid").toString());// 微信支付分配的子商户号 + unifiedOrderRequest.setSubOpenid(openId);// 小程序openId + } else { + unifiedOrderRequest.setAppid(appId); // 小程序appId + unifiedOrderRequest.setOpenid(openId);// 小程序openId + unifiedOrderRequest.setMchId(payParam.get("mchid").toString());// 微信支付分配的商户号 + } + String secret = payParam.get("appsecret").toString(); + + JSONObject attatch = new JSONObject(); + attatch.put("tenantId", tenantId); + attatch.put("tradeNo", tradeNo); + attatch.put("sign", operatorType); + unifiedOrderRequest.setAttach(attatch.toJSONString()); + unifiedOrderRequest.setDeviceInfo("WEB"); + unifiedOrderRequest.setNonceStr(RandomUtils.generateString(32)); + String detail = store.getName() + "-微信点餐"; + unifiedOrderRequest.setBody(detail); + unifiedOrderRequest.setDetail(detail); + unifiedOrderRequest.setTimeStart(DateUtils.format(new Date(), "yyyyMMddHHmmss")); + // 微信支付订单号加标识 + unifiedOrderRequest.setOutTradeNo(tradeNo); + unifiedOrderRequest.setFeeType("CNY"); + // 支付金额 + BigDecimal fee = new BigDecimal(String.valueOf(amount)); + long totalFee = fee.multiply(new BigDecimal(100)).longValue(); + unifiedOrderRequest.setTotalFee(totalFee); + unifiedOrderRequest.setSpbillCreateIp(ip); + // 异步通知地址 + unifiedOrderRequest.setNotifyUrl(wxyhProperties.getApiUrl() + "/wxdcwxnotify"); + unifiedOrderRequest.setTradeType("JSAPI"); + unifiedOrderRequest.setLimitPay("no_credit"); + unifiedOrderRequest.setProductId("123123"); + // 签名 + String sign = SecurityUtils.sign(secret, unifiedOrderRequest); + unifiedOrderRequest.setSign(sign); + // 统一下单 + logger.info("微信下单请求 unifiedOrderRequest:{}", unifiedOrderRequest); + WeiXinPayApi payService = new WeiXinPayApi(); + UnifiedOrderResponse unifiedOrderResponse = payService.unifiedOrder(unifiedOrderRequest); + logger.info("微信下单结果 unifiedOrderResponse {}", unifiedOrderResponse); + + Map data = new HashMap<>(); + if ("SUCCESS".equals(unifiedOrderResponse.getResultCode())) { + data.put("appId", appId); + data.put("timeStamp", String.valueOf(System.currentTimeMillis() / 1000)); + data.put("nonceStr", RandomUtils.generateString(32)); + data.put("package", "prepay_id=" + unifiedOrderResponse.getPrepayId()); + data.put("signType", "MD5"); + // MD5加密 + String paySign = genWithAmple(data, secret); + data.put("paySign", paySign); + + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + } else { + response.setStatus(0); + response.setMessage(unifiedOrderResponse.getReturnMsg()); + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + + /** + * 微信点餐-微信统一下单(新) + */ + @ServiceMethod(method = "liteappdc.pay.unifiedorders", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "微信点餐-微信统一下单") + @Override + public Object liteAppdcUnifiedorders(WeixinPayUnifiedorderRequest request) { + String info = "微信点餐-微信统一下单"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String operatorType = request.getOperatorType(); + String appId = request.getAppid();// + String openId = request.getOpenId();// 来源标识 + Double amount = request.getAmount();// 充值金额 + String tradeNo = request.getTradeNo(); + String ip = request.getIp(); + CommonDataResponse response = null; + Map data = new HashMap<>(); + String payMode = ""; + try { + response = new CommonDataResponse(); + WxStore wxStore = wxStoreService.get(tenantId, storeId); + if (wxStore == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + Store store = storeService.get(tenantId, wxStore.getStoreId()); + if (store == null) { + response.setStatus(0); + response.setMessage("erp门店不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + if (amount == null) { + response.setStatus(0); + response.setMessage("参数amount不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + BigDecimal payAmount = new BigDecimal(String.valueOf(amount)); + if (payAmount.compareTo(BigDecimal.ZERO) <= 0) { + response.setStatus(0); + response.setMessage("支付金额非法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + // 获取支付参数 + List source = wxPaymentParameterService.getPaymentParameterByStoreId(tenantId, wxStore.getId()); + List> payParamList = new ArrayList<>(); + for (WxPaymentParameter paymentParameter : source) { + Map map = new HashMap<>(); + map.put("tenantId", paymentParameter.getTenantId()); + map.put("id", paymentParameter.getId()); + map.put("no", paymentParameter.getNo()); + map.put("name", paymentParameter.getName()); + map.put("sign", paymentParameter.getSign()); + Map pbodyMap = JSONUtil.parseObject(paymentParameter.getPbody(), new TypeReference>() { + }); + map.put("pbody", pbodyMap); + map.put("certText", paymentParameter.getCertText()); + if ((StringUtils.equalsIgnoreCase("wxpay", paymentParameter.getSign()) || StringUtils.equalsIgnoreCase("subwxpay", paymentParameter.getSign()) || StringUtils.equalsIgnoreCase("fuyou", paymentParameter.getSign()) || StringUtils.equalsIgnoreCase("saobei", paymentParameter.getSign()))) { + payParamList.add(map); + } + } + if (CollectionUtils.isEmpty(payParamList)) { + response.setStatus(0); + response.setMessage("尚未配置支付参数"); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + // 如果子商户非空 取子商户参数 + List subResults = new ArrayList(); + for (Map payParam : payParamList) { + JSONObject body = JSON.parseObject(JSON.toJSONString(payParam.get("pbody"))); + if (StringUtils.isNotBlank(body.getString("submchid"))) { + body.put("sign",body.getString("channel")); + subResults.add(body); + } + } + Map payParam = new HashMap(); + if (subResults.size() > 0) { + payParam = subResults.get(0); + } else { + payParam = payParamList.get(0); + } + logger.info(info + " >>>>>>> payParam" + JSONUtil.toJSONString(payParam)); + + if(payParam.get("sign").toString().contains("wxpay")){ + payMode = "wxpay"; + UnifiedOrderRequest unifiedOrderRequest = new UnifiedOrderRequest(); + if (null != payParam.get("submchid") && StringUtils.isNotBlank(payParam.get("submchid").toString())) { + unifiedOrderRequest.setAppid(payParam.get("appid").toString());// 微信分配的公众账号ID + unifiedOrderRequest.setMchId(payParam.get("mchid").toString());// 微信支付分配的商户号 + unifiedOrderRequest.setSubAppid(appId); // 小程序appId + unifiedOrderRequest.setSubMchId(payParam.get("submchid").toString());// 微信支付分配的子商户号 + unifiedOrderRequest.setSubOpenid(openId);// 小程序openId + } else { + unifiedOrderRequest.setAppid(appId); // 小程序appId + unifiedOrderRequest.setOpenid(openId);// 小程序openId + unifiedOrderRequest.setMchId(payParam.get("mchid").toString());// 微信支付分配的商户号 + } + String secret = payParam.get("appsecret").toString(); + + JSONObject attatch = new JSONObject(); + attatch.put("tenantId", tenantId); + attatch.put("tradeNo", tradeNo); + attatch.put("sign", operatorType); + unifiedOrderRequest.setAttach(attatch.toJSONString()); + unifiedOrderRequest.setDeviceInfo("WEB"); + unifiedOrderRequest.setNonceStr(RandomUtils.generateString(32)); + String detail = store.getName() + "-微信点餐"; + unifiedOrderRequest.setBody(detail); + unifiedOrderRequest.setDetail(detail); + unifiedOrderRequest.setTimeStart(DateUtils.format(new Date(), "yyyyMMddHHmmss")); + // 微信支付订单号加标识 + unifiedOrderRequest.setOutTradeNo(tradeNo); + unifiedOrderRequest.setFeeType("CNY"); + // 支付金额 + BigDecimal fee = new BigDecimal(String.valueOf(amount)); + long totalFee = fee.multiply(new BigDecimal(100)).longValue(); + unifiedOrderRequest.setTotalFee(totalFee); + unifiedOrderRequest.setSpbillCreateIp(ip); + // 异步通知地址 + unifiedOrderRequest.setNotifyUrl(wxyhProperties.getApiUrl() + "/wxdcwxnotify"); + unifiedOrderRequest.setTradeType("JSAPI"); + unifiedOrderRequest.setLimitPay("no_credit"); + unifiedOrderRequest.setProductId("123123"); + // 签名 + String sign = SecurityUtils.sign(secret, unifiedOrderRequest); + unifiedOrderRequest.setSign(sign); + // 统一下单 + logger.info("微信下单请求 unifiedOrderRequest:{}", unifiedOrderRequest); + WeiXinPayApi payService = new WeiXinPayApi(); + UnifiedOrderResponse unifiedOrderResponse = payService.unifiedOrder(unifiedOrderRequest); + logger.info("微信下单结果 unifiedOrderResponse {}", unifiedOrderResponse); + + + if ("SUCCESS".equals(unifiedOrderResponse.getResultCode())) { + data.put("appId", appId); + data.put("timeStamp", String.valueOf(System.currentTimeMillis() / 1000)); + data.put("nonceStr", RandomUtils.generateString(32)); + data.put("package", "prepay_id=" + unifiedOrderResponse.getPrepayId()); + data.put("signType", "MD5"); + // MD5加密 + String paySign = genWithAmple(data, secret); + data.put("paySign", paySign); + data.put("outTradeNo", ""); + + data.put("payMode",payMode); + + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + } else { + response.setStatus(0); + response.setMessage(unifiedOrderResponse.getReturnMsg()); + } + }else if(payParam.get("sign").toString().equals("fuyou")){ + payMode = "fuyou"; + TreeMap paramMap = new TreeMap<>(); + paramMap.put("version", "1.0"); + paramMap.put("ins_cd", ((Map)payParam.get("pbody")).get("ins_cd").toString()); //机构号,接入机构在富友的唯一代码 + paramMap.put("mchnt_cd", ((Map)payParam.get("pbody")).get("mchnt_cd").toString()); //商户号, 富友分配给二级商户的商户号 + paramMap.put("term_id", "88888888");//终端号(没有真实终端号统一填88888888) + paramMap.put("random_str", RandomUtils.generateString(32)); + paramMap.put("sign",""); + paramMap.put("goods_des","小程序点餐");//商品描述, 商品或支付单简要描述 + paramMap.put("goods_detail","");//商品详情, 商品名称明细 + paramMap.put("goods_tag","");//商品标记 + paramMap.put("product_id","");//商品标识 + paramMap.put("addn_inf",tenantCode);//附加数据 + paramMap.put("mchnt_order_no","1225"+tradeNo);//商户订单号, 商户系统内部的订单号(5到30个字符、 只能包含字母数字,区分大小写) + paramMap.put("curr_type","");//货币类型,默认人民币:CNY + paramMap.put("order_amt",((Double)(amount*100)).intValue()+"");//总金额, 订单总金额,单位为分 + paramMap.put("term_ip",ip);//终端IP + paramMap.put("txn_begin_ts",DateUtils.format(new Date(), "yyyyMMddHHmmss"));//交易起始时间, 订单生成时间,格式为yyyyMMddHHmmss + paramMap.put("notify_url", wxyhProperties.getApiUrl() + "/fuyouwxnotify");//通知地址, 接收富友异步通知回调地址,通知url必须为直接可访问的url,不能携带参数主扫时必填 + paramMap.put("limit_pay","");//限制支付,no_credit:不能使用信用卡 + paramMap.put("trade_type","LETPAY");//JSAPI--公众号支付、APP--app支付、FWC--支付宝服务窗、QQ--QQ页面支付、QQJSAPI--QQJSAPI、LETPAY-小程序 + paramMap.put("openid",openId);//用户标识(微信公众号服务商模式必填,其他不填) + paramMap.put("sub_openid",openId);//子商户用户标识支付宝服务窗为用户buyer_id(此场景必填)微信公众号为用户的openid(非服务商模式必填) + paramMap.put("sub_appid",appId);//子商户公众号id,微信交易为商户的app_id(非服务商模式必填) + + /* + * 采用1024bit长度密钥的RSA签名方式,加密算法使用MD5WithRSA, + * 计算签名和验签的时候的需要使用GBK编码。 + */ + String paraStrs = SignUtil.getSignCheckContent(paramMap); + String privateKey = ((Map)payParam.get("pbody")).get("privateKey").toString(); + String sign = SignUtil.rsaSign(paraStrs,privateKey,"GBK"); + paramMap.put("sign",sign); + + paramMap.put("reserved_expire_minute","15");//交易关闭时间,如不设置,默认填0单位:分钟 最大值为1440 例如:1天=1440 + paramMap.put("reserved_fy_term_id","");//富友终端号(如果不是用的富友的POS终端,此字段千万不要填,不然会影响清算) + paramMap.put("reserved_fy_term_type","");//0:其他 1:富友终端 2:POS机 3:台卡 4:PC软件 + paramMap.put("Reserved_txn_bonus","");// 积分抵扣金额,单位为分 + paramMap.put("reserved_fy_term_sn","");//终端序列号 + + + + Map nvs = new HashMap<>(); + Document doc = DocumentHelper.createDocument(); + Element root = doc.addElement("xml"); + Iterator it= paramMap.keySet().iterator(); + while(it.hasNext()){ + String key = it.next().toString(); + String value = paramMap.get(key)+""; + root.addElement(key).addText(value); + } + String reqBody = "" + doc.getRootElement().asXML(); + reqBody = URLEncoder.encode(reqBody, "GBK"); + nvs.put("req", reqBody); + StringBuffer results = new StringBuffer(""); + + HttpUtils httpUtils = new HttpUtils(); + httpUtils.post("http://spay-mc.fuioupay.com/wxPreCreate", nvs, results); + String content = URLDecoder.decode(results.toString(), "GBK"); + + Document docs = DocumentHelper.parseText(content); // 将字符串转为XML + Element rootElt = docs.getRootElement(); // 获取根节点 + + String result_code = rootElt.elementTextTrim("result_code"); // 结果编码 + String result_msg = rootElt.elementTextTrim("result_msg"); // 错误描述 + String reserved_fy_order_no = rootElt.elementTextTrim("reserved_fy_order_no"); // 富友生成的订单号 + String reserved_transaction_id = rootElt.elementTextTrim("reserved_transaction_id"); // 渠道交易流水号, trade_type为FWC时返回(用于调起支付) + String sdk_appid = rootElt.elementTextTrim("sdk_appid");//公众号id + String sdk_timestamp = rootElt.elementTextTrim("sdk_timestamp");//时间戳,自1970年1月1日 0点0分0秒以来的秒数 + String sdk_package = rootElt.elementTextTrim("sdk_package");//订单性情扩展字符串 + String sdk_noncestr = rootElt.elementTextTrim("sdk_noncestr");//随机字符串 + String sdk_signtype = rootElt.elementTextTrim("sdk_signtype");//签名方式 + String sdk_paysign = rootElt.elementTextTrim("sdk_paysign");//签名 + + // 更新订单支付方式和会员Idno + if (StringUtils.isNotBlank(result_code) && "000000".equals(result_code)) { + + data.put("appId", sdk_appid); + data.put("timeStamp", sdk_timestamp); + data.put("nonceStr", sdk_noncestr); + data.put("package", sdk_package); + data.put("signType", sdk_signtype); + data.put("paySign", sdk_paysign); + data.put("outTradeNo", ""); + data.put("payMode",payMode); + + WeixinOrderPay order = weixinOrderPayService.find(Constant.DEFAULT_DB_SIGN,"outTradeNo",tradeNo); + if(order != null){ + order.setPayway("07"); + weixinOrderPayService.update(Constant.DEFAULT_DB_SIGN,order); + } + + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + + }else{ + response.setStatus(0); + response.setMessage(result_msg); + } + }else if (payParam.get("sign").toString().equals("saobei")){ + payMode = "saobei"; + Map paramMap = new LinkedHashMap<>(); + paramMap.put("pay_ver","100"); + paramMap.put("pay_type","010"); + paramMap.put("service_id","015"); + paramMap.put("merchant_no",((Map)payParam.get("pbody")).get("merchant_no").toString()); + paramMap.put("terminal_id",((Map)payParam.get("pbody")).get("terminal_id").toString()); + paramMap.put("terminal_trace",tradeNo); + paramMap.put("terminal_time",DateUtils.format(new Date(), "yyyyMMddHHmmss")); + paramMap.put("total_fee",((Double)(amount*100)).intValue()+""); + + //String paraStrs = SignUtil.getSignCheckContent(paramMap); + String signKey = "&access_token="+((Map)payParam.get("pbody")).get("signKey").toString(); + String sign = SignUtil.createSign(paramMap,signKey); + paramMap.put("sub_appid",appId); + paramMap.put("open_id",openId); + paramMap.put("order_body","扫呗支付"); + paramMap.put("notify_url",wxyhProperties.getApiUrl() + "/saobeiwxnotify"); + paramMap.put("attach",tenantId+"_"+storeId+"_"+tradeNo); + paramMap.put("key_sign",sign); + HttpResponse httpResponse = HttpTool.url(((Map)payParam.get("pbody")).get("gatewayUrl").toString()+"/pay/100/minipay").contentType("application/json").body(JSON.toJSONString(paramMap)).post(); + String content = HttpTool.getResponseAsString(httpResponse); + JSONObject jsonObject = JSON.parseObject(content); + if (StringUtils.isNotBlank(jsonObject.getString("return_code")) && "01".equals(jsonObject.getString("return_code"))) { + if(StringUtils.isNotBlank(jsonObject.getString("result_code")) && "01".equals(jsonObject.getString("result_code"))){ + data.put("appId", jsonObject.getString("appId")); + data.put("timeStamp", jsonObject.getString("timeStamp")); + data.put("nonceStr", jsonObject.getString("nonceStr")); + data.put("package", jsonObject.getString("package_str")); + data.put("signType", jsonObject.getString("signType")); + data.put("paySign", jsonObject.getString("paySign")); + data.put("outTradeNo", jsonObject.getString("out_trade_no")); + data.put("payMode",payMode); + + WeixinOrderPay order = weixinOrderPayService.find(Constant.DEFAULT_DB_SIGN,"outTradeNo",tradeNo); + if(order != null){ + order.setBusNo(jsonObject.getString("out_trade_no")); + order.setPayway("09"); + weixinOrderPayService.update(Constant.DEFAULT_DB_SIGN,order); + } + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + }else{ + response.setStatus(0); + response.setMessage(jsonObject.getString("return_msg")); + } + }else{ + response.setStatus(0); + response.setMessage(jsonObject.getString("return_msg")); + } + + + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + + public String genWithAmple(Map params, String key) { + StringBuffer sb = new StringBuffer(); + for (String paramKey : params.keySet()) { + sb.append(paramKey + "=" + params.get(paramKey) + ","); + } + String result = sb.toString(); + result = result.substring(0, result.length() - 1); + return genWithAmple(result.split(","), key); + } + + private String genWithAmple(String[] arr, String key) { + Arrays.sort(arr); + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < arr.length; i++) { + String a = arr[i]; + sb.append(a); + if (i != arr.length - 1) { + sb.append('&'); + } + } + if (StringUtils.isNotEmpty(key)) { + sb.append("&key="); + sb.append(key); + } + return DigestUtils.MD5(sb.toString()).toUpperCase(); + } + + /** + * 微信支付查询支付结果 + */ + @ServiceMethod(method = "liteAppdc.pay.orderquery", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "微信支付查询支付结果") + @Override + public Object liteAppdcPayOrderquery(StoreAccountRechargeWeixinPayOrderQueryRequest request) { + String info = "微信支付查询支付结果"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String tradeNo = request.getTradeNo(); + String appId = request.getAppid();// + logger.info(info + "storeId:" + storeId + " tradeNo:" + tradeNo); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + WxStore wxStore = wxStoreService.get(tenantId, storeId); + if (wxStore == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + // 检验支付参数 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("enabled", 1)); + List dataList = storeAccountRechargeParameterService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(dataList)) { + response.setStatus(0); + response.setMessage("尚未配置充值参数"); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + if (dataList.size() > 1) { + response.setStatus(0); + response.setMessage("充值参数不唯一"); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + // 支付参数 + Map payMap = new HashMap<>(); + Map payParam = new HashMap<>(); + for (StoreAccountRechargeParameter data : dataList) { + payMap.put("tenantId", data.getTenantId()); + payMap.put("id", data.getId()); + payMap.put("no", data.getNo());// 编号 + payMap.put("name", data.getName());// 方案名称 + payMap.put("sign", data.getSign());// 支付类型 + payMap.put("pbody", data.getPbody());// 支付参数 + payParam = JSONUtil.parseObject(data.getPbody(), Map.class); + // dataMap.put("enabled", data.getEnabled());// 是否启用 + payMap.put("certText", data.getCertText());// 证书内容 + } + logger.info(info + " 支付参数 payParam:" + JSONUtil.toJSONString(payParam)); + + QueryOrderRequest queryOrderRequest = new QueryOrderRequest(); + + /******** 测试数据 ***********/ + queryOrderRequest.setAppid(payParam.get("appid").toString());// 微信分配的公众账号ID + + // queryOrderRequest.setAppid(payParam.get("appid").toString());// + // 微信分配的公众账号ID + queryOrderRequest.setMchId(payParam.get("mchid").toString());// + // 微信支付分配的商户号 + String secret = payParam.get("appsecret").toString(); + + // 如果是子商户发起的支付 配置子商户商户号和发起支付的小程序appId + if (StringUtils.isNotBlank(payParam.get("submchid").toString())) { + queryOrderRequest.setSubAppid(appId); + queryOrderRequest.setSubMchId(payParam.get("submchid").toString());// 微信支付分配的子商户号 + } + queryOrderRequest.setNonceStr(RandomUtils.generateString(32)); + queryOrderRequest.setOutTradeNo(tradeNo); + String sign = SecurityUtils.sign(secret, queryOrderRequest); + queryOrderRequest.setSign(sign); + + // 查询是否已支付 + WeiXinPayApi payService = new WeiXinPayApi(); + QueryOrderResponse queryOrderResponse = payService.queryOrder(queryOrderRequest); + + logger.info(info + "queryOrderResponse {}", JSON.toJSONString(queryOrderResponse)); + String resutlCode = queryOrderResponse.getResultCode(); + String returnCode = queryOrderResponse.getReturnCode(); + String tradeState = queryOrderResponse.getTradeState(); + Map data = new HashMap(); + if ("SUCCESS".equals(resutlCode) && "SUCCESS".equals(returnCode) && "SUCCESS".equals(tradeState)) { + data.put("status", 1); + data.put("message", ""); + data.put("tradeNo", queryOrderResponse.getOutTradeNo()); + data.put("prepayId", queryOrderResponse.getTransactionId()); + } else { + data.put("status", 0); + data.put("message", queryOrderResponse.getReturnMsg()); + logger.error(info + " 失败" + queryOrderResponse.getReturnMsg()); + } + + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + + /** + * 微信支付查询支付结果 + */ + @ServiceMethod(method = "liteAppdc.pay.orderquerys", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "微信支付查询支付结果") + @Override + public Object liteAppdcPayOrderquerys(StoreAccountRechargeWeixinPayOrderQueryRequest request) { + String info = "微信支付查询支付结果"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String tradeNo = request.getTradeNo(); + String appId = request.getAppid();// + String outTradeNo = request.getOutTradeNo(); + logger.info(info + "storeId:" + storeId + " tradeNo:" + tradeNo); + + CommonDataResponse response = null; + String payMode = ""; + try { + response = new CommonDataResponse(); + WxStore wxStore = wxStoreService.get(tenantId, storeId); + if (wxStore == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + // 检验支付参数 + List source = wxPaymentParameterService.getPaymentParameterByStoreId(tenantId, wxStore.getId()); + if (CollectionUtils.isEmpty(source)) { + response.setStatus(0); + response.setMessage("尚未配置充值参数"); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + if (source.size() > 1) { + response.setStatus(0); + response.setMessage("充值参数不唯一"); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + // 支付参数 + Map payMap = new HashMap<>(); + Map payParam = new HashMap<>(); + for (WxPaymentParameter data : source) { + payMap.put("tenantId", data.getTenantId()); + payMap.put("id", data.getId()); + payMap.put("no", data.getNo());// 编号 + payMap.put("name", data.getName());// 方案名称 + payMap.put("sign", data.getSign());// 支付类型 + payMap.put("pbody", data.getPbody());// 支付参数 + payParam = JSONUtil.parseObject(data.getPbody(), Map.class); + // dataMap.put("enabled", data.getEnabled());// 是否启用 + payMap.put("certText", data.getCertText());// 证书内容 + } + logger.info(info + " 支付参数 payParam:" + JSONUtil.toJSONString(payParam)); + + if(payMap.get("sign").toString().contains("wxpay")){ + payMode = "wxpay"; + QueryOrderRequest queryOrderRequest = new QueryOrderRequest(); + + /******** 测试数据 ***********/ +// queryOrderRequest.setAppid(payParam.get("appid").toString());// 微信分配的公众账号ID + String secret = payParam.get("appsecret").toString(); + + // queryOrderRequest.setAppid(payParam.get("appid").toString());// + // 微信分配的公众账号ID + // queryOrderRequest.setMchId(payParam.get("mchid").toString());// + // 微信支付分配的商户号 + + + // 如果是子商户发起的支付 配置子商户商户号和发起支付的小程序appId + if (StringUtils.isNotBlank(payParam.get("submchid").toString())) { + queryOrderRequest.setSubAppid(appId); + queryOrderRequest.setSubMchId(payParam.get("submchid").toString());// 微信支付分配的子商户号 + } + queryOrderRequest.setNonceStr(RandomUtils.generateString(32)); + queryOrderRequest.setOutTradeNo(tradeNo); + String sign = SecurityUtils.sign(secret, queryOrderRequest); + queryOrderRequest.setSign(sign); + // 查询是否已支付 + WeiXinPayApi payService = new WeiXinPayApi(); + QueryOrderResponse queryOrderResponse = payService.queryOrder(queryOrderRequest); + logger.info(info + "queryOrderResponse {}", JSON.toJSONString(queryOrderResponse)); + String resutlCode = queryOrderResponse.getResultCode(); + String returnCode = queryOrderResponse.getReturnCode(); + String tradeState = queryOrderResponse.getTradeState(); + Map data = new HashMap(); + if ("SUCCESS".equals(resutlCode) && "SUCCESS".equals(returnCode) && "SUCCESS".equals(tradeState)) { + data.put("status", 1); + data.put("message", ""); + data.put("tradeNo", queryOrderResponse.getOutTradeNo()); + data.put("prepayId", queryOrderResponse.getTransactionId()); + data.put("payMode",payMode); + } else { + data.put("status", 0); + data.put("message", queryOrderResponse.getReturnMsg()); + logger.error(info + " 失败" + queryOrderResponse.getReturnMsg()); + } + }else if(payMap.get("sign").toString().contains("fuyou")){ + payMode = "fuyou"; + + TreeMap paramMap = new TreeMap<>(); + paramMap.put("version", "1.0"); + paramMap.put("ins_cd", payParam.get("ins_cd").toString()); //机构号,接入机构在富友的唯一代码 + paramMap.put("mchnt_cd", payParam.get("mchnt_cd").toString()); //商户号, 富友分配给二级商户的商户号 + paramMap.put("term_id", "88888888");//终端号(没有真实终端号统一填88888888) + paramMap.put("order_type", "WECHAT");//订单类型:ALIPAY (统一下单、条码支付、服务窗支付), WECHAT(统一下单、条码支付,公众号支付),QQ(QQ钱包),UNIONPAY,BESTPAY(翼支付) + paramMap.put("mchnt_order_no", "1225"+tradeNo);//商户订单号, 商户系统内部的订单号(5到30个字符、 只能包含字母数字,区分大小写) + paramMap.put("random_str", RandomUtils.generateString(32)); + paramMap.put("sign",""); + String paraStrs = SignUtil.getSignCheckContent(paramMap); + String sign = SignUtil.rsaSign(paraStrs,payParam.get("privateKey").toString(),"GBK"); + paramMap.put("sign",sign); + Map nvs = new HashMap<>(); + Document doc = DocumentHelper.createDocument(); + Element root = doc.addElement("xml"); + Iterator it= paramMap.keySet().iterator(); + while(it.hasNext()){ + String key = it.next().toString(); + String value = paramMap.get(key)+""; + root.addElement(key).addText(value); + } + String reqBody = "" + doc.getRootElement().asXML(); + reqBody = URLEncoder.encode(reqBody, "GBK"); + nvs.put("req", reqBody); + StringBuffer results = new StringBuffer(""); + HttpUtils httpUtils = new HttpUtils(); + httpUtils.post("http://spay-mc.fuioupay.com/commonQuery", nvs, results); + String content = URLDecoder.decode(results.toString(), "GBK"); + Map map = new HashMap<>(); + Document docs = DocumentHelper.parseText(content); // 将字符串转为XML + Element rootElt = docs.getRootElement(); // 获取根节点 + String result_code = rootElt.elementTextTrim("result_code"); // 结果编码 + map.put("result_code", result_code); + String result_msg = rootElt.elementTextTrim("result_msg"); // 错误描述 + map.put("result_msg", result_msg); + String trans_stat = rootElt.elementTextTrim("trans_stat"); // 交易状态;SUCCESS—支付成功;REFUND—转入退款;NOTPAY—未支付;CLOSED—已关闭(交易以关闭);REVOKED—已撤销(刷卡支付);USERPAYING--用户支付中;PAYERROR--支付失败(其他原因,如银行返回失败) + map.put("trans_stat", trans_stat); + String transaction_id = rootElt.elementTextTrim("transaction_id"); // 渠道交易流水号, trade_type为FWC时返回(用于调起支付) + map.put("transaction_id", transaction_id); + String mchnt_order_no = rootElt.elementTextTrim("mchnt_order_no"); // 商户订单号, 商户系统内部的订单号(5到30个字符、 只能包含字母数字,区分大小写) + map.put("mchnt_order_no", mchnt_order_no); + Map data = new HashMap(); + if ("000000".equals(result_code) && "SUCCESS".equals(trans_stat)) { + data.put("status", 1); + data.put("message", ""); + data.put("tradeNo", mchnt_order_no.substring(4,mchnt_order_no.length())); + data.put("prepayId", transaction_id); + data.put("payMode",payMode); + } else { + data.put("status", 0); + data.put("message", result_msg); + logger.error(info + " 失败" + result_msg); + } + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + + }else if(payMap.get("sign").toString().contains("saobei")){ + payMode = "saobei"; + if(StringUtils.isNotEmpty(outTradeNo)){ + //WeixinOrderPay order = weixinOrderPayService.find(tenantId,"orderNo",tradeNo); + HashMap paramMap = new LinkedHashMap<>(); + paramMap.put("pay_ver","100"); + paramMap.put("pay_type","010"); + paramMap.put("service_id","020"); + paramMap.put("merchant_no",payParam.get("merchant_no").toString()); + paramMap.put("terminal_id",payParam.get("terminal_id").toString()); + paramMap.put("terminal_trace",tradeNo); + paramMap.put("terminal_time",DateUtils.format(new Date(), "yyyyMMddHHmmss")); + paramMap.put("out_trade_no",outTradeNo); + String signKey = "&access_token="+payParam.get("signKey").toString(); + String sign = SignUtil.createSign(paramMap,signKey); + paramMap.put("pay_trace",""); + paramMap.put("pay_time",DateUtils.format(new Date(), "yyyyMMddHHmmss")); + paramMap.put("key_sign",sign); + HttpResponse httpResponse = HttpTool.url(payParam.get("gatewayUrl").toString()+"/pay/100/query").contentType("application/json").body(JSON.toJSONString(paramMap)).post(); + String content = HttpTool.getResponseAsString(httpResponse); + JSONObject jsonObject = JSON.parseObject(content); + Map data = new HashMap(); + if (StringUtils.isNotBlank(jsonObject.getString("return_code")) && "01".equals(jsonObject.getString("return_code"))) { + if("01".equals(jsonObject.getString("result_code"))){ + if(StringUtils.isNotBlank(jsonObject.getString("trade_state")) && "SUCCESS".equals(jsonObject.getString("trade_state"))){ + data.put("status", 1); + data.put("message", ""); + data.put("tradeNo", jsonObject.getString("terminal_trace")); + data.put("prepayId", jsonObject.getString("out_trade_no")); + data.put("payMode",payMode); + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + }else{ + response.setStatus(0); + response.setMessage(jsonObject.getString("return_msg")); + } + }else{ + response.setStatus(0); + response.setMessage(jsonObject.getString("return_msg")); + } + }else{ + response.setStatus(0); + response.setMessage(jsonObject.getString("return_msg")); + } + }else{ + response.setStatus(0); + response.setMessage("参数错误"); + } + + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 微信支付查询支付结果 + */ + @ServiceMethod(method = "liteAppdc.pay.orderqueryss", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "微信支付查询支付结果") + @Override + public Object liteAppdcPayOrderqueryss(StoreAccountRechargeWeixinPayOrderQueryRequest request) { + String info = "微信支付查询支付结果"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String tradeNo = request.getTradeNo(); + String appId = request.getAppid();// + String outTradeNo = request.getOutTradeNo(); + logger.info(info + "storeId:" + storeId + " tradeNo:" + tradeNo); + + CommonDataResponse response = null; + String payMode = ""; + try { + response = new CommonDataResponse(); + WxStore wxStore = wxStoreService.get(tenantId, storeId); + if (wxStore == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + // 检验支付参数 + List source = wxPaymentParameterService.getPaymentParameterByStoreId(tenantId, wxStore.getId()); + if (CollectionUtils.isEmpty(source)) { + response.setStatus(0); + response.setMessage("尚未配置充值参数"); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + if (source.size() > 1) { + response.setStatus(0); + response.setMessage("充值参数不唯一"); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + // 支付参数 + Map payMap = new HashMap<>(); + Map payParam = new HashMap<>(); + for (WxPaymentParameter data : source) { + payMap.put("tenantId", data.getTenantId()); + payMap.put("id", data.getId()); + payMap.put("no", data.getNo());// 编号 + payMap.put("name", data.getName());// 方案名称 + payMap.put("sign", data.getSign());// 支付类型 + payMap.put("pbody", data.getPbody());// 支付参数 + payParam = JSONUtil.parseObject(data.getPbody(), Map.class); + // dataMap.put("enabled", data.getEnabled());// 是否启用 + payMap.put("certText", data.getCertText());// 证书内容 + } + logger.info(info + " 支付参数 payParam:" + JSONUtil.toJSONString(payParam)); + + if(payMap.get("sign").toString().contains("wxpay")){ + payMode = "wxpay"; + QueryOrderRequest queryOrderRequest = new QueryOrderRequest(); + + /******** 测试数据 ***********/ +// queryOrderRequest.setAppid(payParam.get("appid").toString());// 微信分配的公众账号ID + String secret = payParam.get("appsecret").toString(); + + // queryOrderRequest.setAppid(payParam.get("appid").toString());// + // 微信分配的公众账号ID + // queryOrderRequest.setMchId(payParam.get("mchid").toString());// + // 微信支付分配的商户号 + + + // 如果是子商户发起的支付 配置子商户商户号和发起支付的小程序appId + if (StringUtils.isNotBlank(payParam.get("submchid").toString())) { + queryOrderRequest.setSubAppid(appId); + queryOrderRequest.setSubMchId(payParam.get("submchid").toString());// 微信支付分配的子商户号 + } + queryOrderRequest.setNonceStr(RandomUtils.generateString(32)); + queryOrderRequest.setOutTradeNo(tradeNo); + String sign = SecurityUtils.sign(secret, queryOrderRequest); + queryOrderRequest.setSign(sign); + // 查询是否已支付 + WeiXinPayApi payService = new WeiXinPayApi(); + QueryOrderResponse queryOrderResponse = payService.queryOrder(queryOrderRequest); + logger.info(info + "queryOrderResponse {}", JSON.toJSONString(queryOrderResponse)); + String resutlCode = queryOrderResponse.getResultCode(); + String returnCode = queryOrderResponse.getReturnCode(); + String tradeState = queryOrderResponse.getTradeState(); + Map data = new HashMap(); + if ("SUCCESS".equals(resutlCode) && "SUCCESS".equals(returnCode) && "SUCCESS".equals(tradeState)) { + data.put("status", 1); + data.put("message", ""); + data.put("tradeNo", queryOrderResponse.getOutTradeNo()); + data.put("prepayId", queryOrderResponse.getTransactionId()); + data.put("payMode",payMode); + } else { + data.put("status", 0); + data.put("message", queryOrderResponse.getReturnMsg()); + logger.error(info + " 失败" + queryOrderResponse.getReturnMsg()); + } + }else if(payMap.get("sign").toString().contains("fuyou")){ + payMode = "fuyou"; + Map data = new HashMap(); + + WeixinOrderPay weixinOrder = weixinOrderPayService.find(Constant.DEFAULT_DB_SIGN, "outTradeNo",tradeNo); + if(weixinOrder != null){ + if(2 == weixinOrder.getStatus()){ + data.put("status", 1); + data.put("message", "支付成功,订单已上传"); + data.put("payMode",payMode); + }else{ + data.put("status", 0); + data.put("message", "订单未上传"); + } + }else{ + data.put("status", 0); + data.put("message", "订单未上传"); + } + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + }else if(payMap.get("sign").toString().contains("saobei")){ + payMode = "saobei"; + if(StringUtils.isNotEmpty(outTradeNo)){ + //WeixinOrderPay order = weixinOrderPayService.find(tenantId,"orderNo",tradeNo); + HashMap paramMap = new LinkedHashMap<>(); + paramMap.put("pay_ver","100"); + paramMap.put("pay_type","010"); + paramMap.put("service_id","020"); + paramMap.put("merchant_no",payParam.get("merchant_no").toString()); + paramMap.put("terminal_id",payParam.get("terminal_id").toString()); + paramMap.put("terminal_trace",tradeNo); + paramMap.put("terminal_time",DateUtils.format(new Date(), "yyyyMMddHHmmss")); + paramMap.put("out_trade_no",outTradeNo); + String signKey = "&access_token="+payParam.get("signKey").toString(); + String sign = SignUtil.createSign(paramMap,signKey); + paramMap.put("pay_trace",""); + paramMap.put("pay_time",DateUtils.format(new Date(), "yyyyMMddHHmmss")); + paramMap.put("key_sign",sign); + HttpResponse httpResponse = HttpTool.url(payParam.get("gatewayUrl").toString()+"/pay/100/query").contentType("application/json").body(JSON.toJSONString(paramMap)).post(); + String content = HttpTool.getResponseAsString(httpResponse); + JSONObject jsonObject = JSON.parseObject(content); + Map data = new HashMap(); + if (StringUtils.isNotBlank(jsonObject.getString("return_code")) && "01".equals(jsonObject.getString("return_code"))) { + if("01".equals(jsonObject.getString("result_code"))){ + if(StringUtils.isNotBlank(jsonObject.getString("trade_state")) && "SUCCESS".equals(jsonObject.getString("trade_state"))){ + data.put("status", 1); + data.put("message", ""); + data.put("tradeNo", jsonObject.getString("terminal_trace")); + data.put("prepayId", jsonObject.getString("out_trade_no")); + data.put("payMode",payMode); + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + }else{ + response.setStatus(0); + response.setMessage(jsonObject.getString("return_msg")); + } + }else{ + response.setStatus(0); + response.setMessage(jsonObject.getString("return_msg")); + } + }else{ + response.setStatus(0); + response.setMessage(jsonObject.getString("return_msg")); + } + }else{ + response.setStatus(0); + response.setMessage("参数错误"); + } + + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + + + /** + * 微信点餐-创建销售订单(本地测试使用,生产是在微信支付异步通知成功后上传订单) + */ + @ServiceMethod(method = "liteAppdc.salesOrder.create", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "微信点餐-创建销售订单") + @Override + public Object liteAppdcSalesOrderCreate(LiteAppSalesOrderCreateRequest request) { + String info = "微信点餐-创建销售订单"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String prepayId = request.getPrepayId(); + String tradeNo = request.getTradeNo(); + String memberId = request.getMemberId(); + String memo = request.getMemo(); + logger.info(info + " storeId:" + storeId + " tradeNo:" + tradeNo); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + WxStore wxStore = wxStoreService.get(tenantId, storeId); + if (wxStore == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + if (StringUtils.isBlank(tradeNo)) { + response.setStatus(0); + response.setMessage("订单号不能为空"); + response.setErrCode(CommonErrorCode.error21.getCode()); + response.setErrMessage(CommonErrorCode.error21.getMessage()); + return response; + } + // 查询微信订单是否已存在 + WeixinOrderPay weixinOrder = weixinOrderPayService.find(Constant.DEFAULT_DB_SIGN, "outTradeNo", tradeNo); + if (null == weixinOrder) { + response.setStatus(0); + response.setMessage("订单[" + tradeNo + "]不存在"); + response.setErrCode(CommonErrorCode.error23.getCode()); + response.setErrMessage(CommonErrorCode.error23.getMessage()); + return response; + } + boolean ifChange = false; + if(StringUtils.isNotEmpty(memberId)) { + weixinOrder.setMemberId(memberId); + ifChange = true; + } + if(StringUtils.isNotEmpty(memo)) { + if(StringUtils.isNotEmpty(weixinOrder.getDescription())) { + weixinOrder.setDescription(weixinOrder.getDescription() + " + " + memo); + }else{ + weixinOrder.setDescription(memo); + } + ifChange = true; + } + if(ifChange){ + weixinOrderPayService.update(Constant.DEFAULT_DB_SIGN,weixinOrder); + } + + Map data = new HashMap(); + // 查询订单是否已上传 未上传调用异步上传订单 + WxSalesOrder saleOrder = wxSalesOrderService.find(tenantId, "no", weixinOrder.getOrderNo()); + if (null == saleOrder) { + + // 订单未上传 异步上传订单 + Map eventData = new HashMap<>(); + eventData.put("tenantId", tenantId); + eventData.put("tradeNo", weixinOrder.getOutTradeNo()); + eventData.put("prepayId", prepayId); + eventData.put("notifyResponse", ""); + eventData.put("memberId",memberId); + eventData.put("memo",memo); + eventBus.notify(EventKeys.WXDC_WEIXINPAY_NOTIFY, Event.wrap(eventData)); + + data.put("status", 1); + data.put("orderNo", weixinOrder.getOrderNo()); + data.put("storeId", weixinOrder.getStoreId()); + } else { + // 订单已上传 + data.put("status", 2); + data.put("orderNo", weixinOrder.getOrderNo()); + data.put("storeId", weixinOrder.getStoreId()); + } + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "liteapp.wxdc.order.create", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "微信点餐小程序-创建订单") + @Override + public Object liteAppWxdcSalesOrderCreate(LiteAppWxdcSalesOrderCreateRequest request) { + String info = "微信点餐小程序-创建订单"; + + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + String wid = request.getWid(); + String userId = request.getUserId(); + String openId = request.getOpenId(); + String phone = request.getPhone(); + String daySeq = request.getDaySeq(); + String takeNo = request.getTakeNo(); + String tableNo = request.getTableNo(); + String tableName = request.getTableName(); + Integer people = request.getPeople(); + Integer busMode = request.getBusMode(); + Double amount = request.getAmount(); + Double discountTotal = request.getDiscountTotal(); + Double receivable = request.getReceivable(); + Double maling = request.getMaling(); + Double paid = request.getPaid(); + String saleDate = request.getSaleDate(); + Integer isMember = request.getIsMember(); + String description = request.getDescription(); + String payMode = request.getPayMode(); + String receiveName = request.getReceiveName(); + String receiveMobile = request.getReceiveMobile(); + String receiveAddress =request.getReceiveAddress(); + Double boxFee = request.getBoxFee(); + Double distributionFee = request.getDistributionFee(); + String orderInfoJson = request.getOrderInfoJson(); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + + if (StringUtils.isBlank(wid)) { + response.setStatus(0); + response.setMessage("wid不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + WxStore wxStore = wxStoreService.get(tenantId, storeId); + if (wxStore == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + Store store = storeService.get(tenantId, wxStore.getStoreId()); + if (store == null) { + response.setStatus(0); + response.setMessage("erp门店不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + // 生成单号 + String orderNo = String.valueOf(IdWorkerUtils.getInstance().nextId()); + String tradeNo = store.getNo() + "_" + orderNo; + logger.info(info + " tenantId:" + tenantId + " orderNo:" + orderNo + " tradeNo:" + tradeNo); + + WeixinOrderPay weixinOrder = new WeixinOrderPay(); + weixinOrder.setWid(wid); + weixinOrder.setUserId(userId); + weixinOrder.setOpenId(openId); + weixinOrder.setMemberId(""); + weixinOrder.setTenantId(tenantId); + + weixinOrder.setOrderNo(orderNo); + weixinOrder.setOutTradeNo(tradeNo); + weixinOrder.setPayway(payMode); + weixinOrder.setBusMode(busMode+""); + weixinOrder.setMode(busMode); + weixinOrder.setStoreId(wxStore.getId()); + weixinOrder.setStoreNo(wxStore.getNo()); + weixinOrder.setStoreName(wxStore.getName()); + weixinOrder.setPosNo(""); + weixinOrder.setWorkerNo(""); + weixinOrder.setTableId(""); + weixinOrder.setTableNo(tableNo); + weixinOrder.setTableName(tableName); + weixinOrder.setBoxFee(boxFee); + weixinOrder.setReceiveName(receiveName); + weixinOrder.setReceiveMobile(receiveMobile); + weixinOrder.setReceiveAddress(receiveAddress); + weixinOrder.setDistributionFee(distributionFee); + + orderInfoJson = URLDecoder.decode(orderInfoJson, "UTF-8"); + Map dataMap = JSON.parseObject(orderInfoJson, Map.class); + JSONArray orderItems = JSON.parseArray(dataMap.get("order_item").toString()); + JSONArray orderItemMakes = null; + if(dataMap.get("order_item_make") != null && !"".equals(dataMap.get("order_item_make").toString())){ + orderItemMakes = JSON.parseArray(dataMap.get("order_item_make").toString()); + } + JSONArray orderItemDiscount = null; + if(dataMap.get("order_item_discount") != null && !"".equals(dataMap.get("order_item_discount").toString())){ + orderItemDiscount = JSON.parseArray(dataMap.get("order_item_discount").toString()); + } + + Map orderItemMap = new HashMap<>(); + Map> itemMakeMap = new HashMap<>(); + Map wxPromoMap = new HashMap<>(); + + //组装做法明细; + if(orderItemMakes != null && orderItemMakes.size() > 0){ + for(int i = 0; i < orderItemMakes.size() ; i++){ + JSONObject obj = JSON.parseObject(orderItemMakes.get(i).toString()); + WxSalesOrderItemMake make = new WxSalesOrderItemMake(); + String key = obj.get("goodsId").toString(); + List list = itemMakeMap.get(key); + make.setMakeId(obj.get("makeId").toString()); + make.setMakeName(obj.get("makeName").toString()); + make.setAddPrice(Double.parseDouble(obj.get("addPrice").toString())); + make.setDiscountPrice(Double.parseDouble(obj.get("discountPrice").toString())); + make.setCount(Double.parseDouble(obj.get("count").toString())); + make.setAddTotal(Double.parseDouble(obj.get("addTotal").toString())); + make.setDiscountAddTotal(Double.parseDouble(obj.get("discountAddTotal").toString())); + make.setQtyFlag(0); + if(list == null || list.size() == 0){ + list = new ArrayList<>(); + list.add(make); + }else{ + list.add(make); + } + itemMakeMap.put(key,list); + } + } + + if(orderItemDiscount != null && orderItemDiscount.size() > 0){ + for(int i = 0; i < orderItemDiscount.size() ; i++){ + JSONObject object = JSONObject.parseObject(orderItemDiscount.get(i).toString()); + WxSalesOrderItemPromo promo = new WxSalesOrderItemPromo(); + String key = object.get("goodsId").toString(); + promo.setType(Integer.parseInt(object.get("type").toString())); + promo.setInfo(object.get("info").toString()); + promo.setDiscountMoney(Double.parseDouble(object.get("discountMoney").toString())); + wxPromoMap.put(key,promo); + } + + } + + List itemList = new ArrayList<>(); + //组装订单明细; + for(int i = 0; i < orderItems.size() ; i++){ + WxSalesOrderItem orderItem = JSON.parseObject(orderItems.get(i).toString(),WxSalesOrderItem.class); + orderItem.setSaleDate(DateUtils.parseDate(saleDate,"yyyy-MM-dd HH:mm:ss")); + OrderItem item = new OrderItem(); + item.setProductId(orderItem.getProductId()); + item.setProductNo(orderItem.getProductNo()); + item.setGoodsId(orderItem.getGoodsId()); + item.setGoodsName(orderItem.getGoodsName()); + item.setCategoryId(orderItem.getCategoryId()); + item.setProductUnitId(orderItem.getProductUnitId()); + item.setSpecId(orderItem.getSpecId()); + item.setSpecName(orderItem.getSpecName()); + item.setCount(orderItem.getCount()); + item.setPrice(orderItem.getPrice()); + item.setDiscountPrice(orderItem.getDiscountPrice()); + item.setPriceOrg(orderItem.getPriceOrg()); + item.setAmount(orderItem.getAmount()); + item.setDiscountTotal(orderItem.getDiscountTotal()); + item.setDiscountAddTotal(orderItem.getDiscountAddTotal()); + item.setReceivable(orderItem.getReceivable()); + item.setAddPriceTotal(orderItem.getAddPriceTotal()); + item.setAmountAddTotal(orderItem.getAmountAddTotal()); + item.setAmountTotal(orderItem.getAmountTotal()); + item.setReceivableTotal(orderItem.getReceivableTotal()); + item.setLineNo(i+1); + item.setIsSuit(orderItem.getIsSuit()); + item.setSuitId(orderItem.getSuitId()); + item.setParentId(orderItem.getParentId()); + item.setBoxNum(orderItem.getBoxNum()); + item.setBoxPrice(orderItem.getBoxPrice()); + + List salesOrderItemMakes = itemMakeMap.get(item.getGoodsId()); + if(CollectionUtils.isNotEmpty(salesOrderItemMakes)){ + List makeList = new ArrayList<>(); + for(WxSalesOrderItemMake make : salesOrderItemMakes){ + OrderItemMake orderItemMake = new OrderItemMake(); + orderItemMake.setMakeId(make.getId()); + orderItemMake.setMakeName(make.getMakeName()); + orderItemMake.setAddPrice(make.getAddPrice()); + orderItemMake.setDiscountPrice(make.getDiscountPrice()); + orderItemMake.setCount(make.getCount()); + orderItemMake.setAddTotal(make.getAddTotal()); + orderItemMake.setDiscountAddTotal(make.getDiscountAddTotal()); + orderItemMake.setMngNum(0); + makeList.add(orderItemMake); + } + item.setMakes(makeList); + } + + WxSalesOrderItemPromo promo = wxPromoMap.get(item.getGoodsId()); + if(promo != null){ + List productPromotions = new ArrayList<>(); + ProductPromotion pp = new ProductPromotion(); + pp.setType(promo.getType()); + pp.setInfo(promo.getInfo()); + pp.setDiscountMoney(promo.getDiscountMoney()); + productPromotions.add(pp); + item.setPromotions(productPromotions); + } + itemList.add(item); + + } + + + + + weixinOrder.setNum(Double.parseDouble(orderItemMap.size()+"")); + weixinOrder.setBookMobile(phone); + weixinOrder.setDetails(JSON.toJSONString(itemList)); + weixinOrder.setOrderTime(DateUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss")); + weixinOrder.setStatus(0);// 待支付 + weixinOrder.setAmount(amount); + weixinOrder.setMemberMoney(isMember == 1 ? amount:0.0); + weixinOrder.setDiscountAmount(discountTotal); + weixinOrder.setReceiveAmount(receivable); + weixinOrder.setDescription(description); + weixinOrder.setCreateDate(new Date()); + weixinOrder.setCreateUser(Constant.CREATE_USER); + weixinOrder = weixinOrderPayService.save(Constant.DEFAULT_DB_SIGN, weixinOrder); + + Map data = new HashMap<>(); + data.put("orderNo", weixinOrder.getOrderNo()); + data.put("tradeNo", weixinOrder.getOutTradeNo()); + data.put("order", weixinOrder); + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + + //return null; + } + + @ServiceMethod(method = "liteapp.wxdc.orderpayData.upload", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "微信点餐小程序-创建订单") + @Override + public Object liteAppWxdcSalesOrderPayDataUpload(LiteAppWxdcSalesPayDataRequest request) { + String info = "微信点餐小程序-支付成功后修改订单状态"; + + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String wid = request.getWid(); + String orderId = request.getOrderId(); + String payDate = request.getPayDate(); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + + if (StringUtils.isBlank(orderId)) { + response.setStatus(0); + response.setMessage("订单号不能为空"); + response.setErrCode(CommonErrorCode.error21.getCode()); + response.setErrMessage(CommonErrorCode.error21.getMessage()); + return response; + } + + WxSalesOrder order = wxSalesOrderService.get(tenantId, orderId); + if (orderId == null) { + response.setStatus(0); + response.setMessage("单据信息不存在"); + response.setErrCode(CommonErrorCode.error23.getCode()); + response.setErrMessage(CommonErrorCode.error23.getMessage()); + return response; + } + order.setStatus(1); + order.setPayDate(DateUtils.parseDate(payDate,"yyyy-MM-dd HH:mm:ss")); + order.setModifyUser(Constant.CREATE_USER); + order.setModifyDate(new Date()); + wxSalesOrderService.update(tenantId,order); + + //微信销售订单操作记录; + WxSalesOrderLog log = new WxSalesOrderLog(); + log.setTenantId(tenantId); + log.setTicketId(order.getId()); + log.setTicketNo(order.getNo()); + log.setType(3); + log.setStatus(1); + log.setDescription("微信点餐小程序"); + log.setCreateUser(Constant.CREATE_USER); + log.setCreateDate(new Date()); + wxSalesOrderLogService.save(tenantId,log); + + WxSalesPayment payment = wxSalesPaymentService.find(tenantId,"ticketId",orderId); + if(payment == null){ + WxSalesPayment pay = new WxSalesPayment(); + pay.setTenantId(tenantId); + pay.setStoreId(order.getStoreId()); + pay.setTicketId(order.getId()); + pay.setBusNo(order.getNo()); + pay.setPayNo(String.valueOf(IdWorkerUtils.getInstance().nextId())); + pay.setPayType("1"); + pay.setPayMode(order.getPayMode()); + pay.setStatus(1); + pay.setPaid(order.getPaid()); + pay.setRchange(0.0); + pay.setMoney(order.getReceivable()); + pay.setMemo("微信点餐小程序支付"); + pay.setPayDate(DateUtils.parseDate(payDate,"yyyy-MM-dd HH:mm:ss")); + pay.setCreateDate(new Date()); + pay.setCreateUser(Constant.CREATE_USER); + wxSalesPaymentService.save(tenantId,payment); + }else{ + payment.setPayDate(DateUtils.parseDate(payDate,"yyyy-MM-dd HH:mm:ss")); + payment.setStatus(1); + payment.setModifyDate(new Date()); + payment.setModifyUser(Constant.CREATE_USER); + wxSalesPaymentService.update(tenantId,payment); + } + response.setStatus(1); + response.setMessage("操作成功"); + + + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + + return response; + } + + + /*** + * 组装订单数据 + * + * @param jsonstring + * @return + */ + public Order processOrderData(String jsonstring) { + Order salesOrder = null; + try { + if (StringUtils.isNotBlank(jsonstring)) { + jsonstring = URLDecoder.decode(jsonstring, "UTF-8"); + Map dataMap = JSON.parseObject(jsonstring, Map.class); + logger.info(">>>>>>" + jsonstring); + + boolean isCardPay = false; + // + String memberId = dataMap.get("memberId").toString(); + String paymode = null == dataMap.get("paymode") ? "" : dataMap.get("paymode").toString();// 支付方式 + + // 订单信息 + salesOrder = new Order(); + salesOrder.setChannel("2");// 销售渠道,1-微信点餐 2:云店点餐 + salesOrder.setPeople(1);// 人数 + salesOrder.setBusMode(Integer.valueOf(dataMap.get("busMode").toString()));// 营业模式,0-堂食;1-外带; + salesOrder.setStoreId(dataMap.get("storeId").toString()); + salesOrder.setStoreNo(dataMap.get("storeNo").toString()); + salesOrder.setStoreName(dataMap.get("storeName").toString()); + salesOrder.setPosNo(dataMap.get("posNo").toString()); + salesOrder.setWorkerNo(dataMap.get("workerNo").toString()); + salesOrder.setPayType(1);// 在线支付 + // 02:会员卡支付 05:微信支付 + if (("02").equals(paymode)) { + isCardPay = true; + salesOrder.setMemberId(memberId); + } + salesOrder.setPayMode(paymode);// 微信支付 + salesOrder.setTableId(null == dataMap.get("tableId") ? "" : dataMap.get("tableId").toString()); + salesOrder.setTableNo(null == dataMap.get("tableNo") ? "" : dataMap.get("tableNo").toString()); + salesOrder.setTableName(null == dataMap.get("tableName") ? "" : dataMap.get("tableName").toString()); + salesOrder.setPhone(dataMap.get("mobile").toString()); + salesOrder.setReceiveName(null == dataMap.get("receiveName") ? "" : dataMap.get("receiveName").toString()); + salesOrder.setReceiveMobile(null == dataMap.get("receiveMobile") ? "" : dataMap.get("receiveMobile").toString()); + salesOrder.setReceiveAddress(null == dataMap.get("receiveAddress") ? "" : dataMap.get("receiveAddress").toString()); + salesOrder.setBoxFee(null == dataMap.get("boxFee") ? 0.00 : Double.parseDouble(dataMap.get("boxFee").toString())); + salesOrder.setDistributionFee(null == dataMap.get("distributionFee") ? 0.00 : Double.parseDouble(dataMap.get("distributionFee").toString())); + Double orderAmount = 0.00; // 订单消费金额 + Double orderProAmount = 0.00; // 订单优惠金额 + Double orderMemberCash = 0.00; // 订单应付金额(会员卡) + Double memberProAmount = 0.00; // 订单会员价优惠总额(用于计算如果刷卡支付的话优惠金额) + Integer lineNo = 0; // 行号 + + List itemList = new ArrayList(); + // 购物车商品列表 + Map dishes = (Map) dataMap.get("dishes"); + for (String dishKey : dishes.keySet()) { + Map dishsMap = (Map) dishes.get(dishKey); + + // 处理购物车明细 + // 如果是套餐 计算套餐分摊 套餐加价,套餐做法金额(做为主菜加价) + Map dishWithMakeMap = (Map) dishsMap.get("specs"); + for (String dwmKey : dishWithMakeMap.keySet()) { + Map dishWithMake = (Map) dishWithMakeMap.get(dwmKey); + String goodsId = dishWithMake.get("goodsId").toString(); + String productId = dishWithMake.get("productId").toString(); + Double num = Double.valueOf(dishWithMake.get("num").toString()); + Double price = Double.valueOf(dishWithMake.get("price").toString()); + Double memberPrice = Double.valueOf(dishWithMake.get("memberPrice").toString()); + String parentId = String.valueOf(IdWorkerUtils.getInstance().nextId()); + OrderItem item = new OrderItem(); + item.setId(parentId); + item.setLineNo(lineNo); + item.setGoodsId(goodsId); + item.setGoodsName(dishWithMake.get("name").toString()); + item.setCategoryId(dishWithMake.get("categoryId").toString()); + item.setProductId(productId); + item.setProductNo(dishWithMake.get("productNo").toString()); + item.setSpecId(dishWithMake.get("specId").toString()); + item.setSpecName(dishWithMake.get("specName").toString()); + item.setCount(num); + item.setPriceOrg(price); + item.setPrice(price); + // 如果是会员卡支付 + if (isCardPay) { + item.setDiscountPrice(memberPrice); + } else { + item.setDiscountPrice(price); + } + + item.setProductUnitId(null == dishsMap.get("unitId") ? "" : dishsMap.get("unitId").toString()); + itemList.add(item); + lineNo++; + // 处理套餐明细 + // 1:计算套餐明细分摊,并记录套餐优惠 + // 循环套餐明细 计算明细消费总金额和明细加价总金额 ,在计算完明细分摊之后 ,加价总金额需要加在主菜的售价上 + // 2:记录套餐明细做法,并累加主菜做法金额 + // 明细做法总金额做为主菜加价金额, + // 做法加价总额 套餐 = 明细做法金额汇总 ;非套餐 = 商品做法金额 + double makeAmount = 0.00; + // 套餐明细加价总额 = 明细加价汇总 + double detailAddPrice = 0.00; + // 商品类型 + int suitType = SuitType.NORMAL.getSign(); + + if ("true".equals(dishWithMake.get("isSuit").toString())) { + // 主菜类型 + suitType = SuitType.SUIT.getSign(); + // 明细菜 + String[] suitArray = JSON.parseObject(dishWithMake.get("suitDetails").toString(), String[].class); + if (suitArray.length > 0) { + // 明细已分摊金额 + double fentanAmount = 0.00; + // 道菜明细总金额(不包含做法) + double detailAmount = 0.00; + // 循环套餐明细 计算套餐商品总额和加价总金额 + for (int i = 0; i < suitArray.length; i++) { + Map suitMap = JSON.parseObject(suitArray[i], Map.class); + double detailNum = Double.valueOf(suitMap.get("num").toString()); + double detailPrice = Double.valueOf(suitMap.get("price").toString()); + double addPrice = Double.valueOf(suitMap.get("addPrice").toString()); + double addPriceAmount = PreciseCompute.mul(detailNum, addPrice); + double suitAmount = PreciseCompute.mul(detailNum, detailPrice); + // 明细消费总金额 + detailAmount = PreciseCompute.add(detailAmount, suitAmount); + // 明细加价总金额 + detailAddPrice = PreciseCompute.add(detailAddPrice, addPriceAmount); + } + + // 循环套餐明细 组装套餐明细对象 + for (int i = 0; i < suitArray.length; i++) { + Map suitMap = JSON.parseObject(suitArray[i], Map.class); + double suitNum = Double.valueOf(suitMap.get("num").toString()); + double suitPrice = Double.valueOf(suitMap.get("price").toString()); + double addPrice = Double.valueOf(suitMap.get("addPrice").toString()); + + // 明细消费金额 = 明细数量 * 明细价格 + double suitAmount = PreciseCompute.mul(suitNum, suitPrice); + // 分摊金额 + double receiveAmount = 0.00; + if (i == suitArray.length - 1) { + // 如果是套餐最后一个明细 分摊金额 = 主菜价格 - 其他明细已分摊金额 + receiveAmount = PreciseCompute.sub(item.getDiscountPrice(), fentanAmount); + } else { + if (detailAmount > 0) { + // 分摊金额 = 明细消费金额 / 明细消费总金额 * 主菜优惠价 + receiveAmount = PreciseCompute.mul(PreciseCompute.div(suitAmount, detailAmount), item.getDiscountPrice(), 2); + } + } + fentanAmount = PreciseCompute.add(fentanAmount, receiveAmount); + // 明细应收金额 = 明细分摊金额 + 明细加价金额 + receiveAmount = PreciseCompute.add(receiveAmount, addPrice); + + // 明细优惠价 = 明细分摊金额(明细应收金额 + 明细加价) / 明细数量 + double discountPrice = PreciseCompute.div(receiveAmount, suitNum, 2); + // 明细优惠金额 = 明细金额 - 明细应收金额 (分摊金额) + double promotionAmount = PreciseCompute.sub(suitAmount, receiveAmount); + String orderItemId = String.valueOf(IdWorkerUtils.getInstance().nextId()); + OrderItem suitItem = new OrderItem(); + suitItem.setId(orderItemId); + suitItem.setSuitId(productId); + suitItem.setIsSuit(SuitType.SUITDETAIL.getSign()); // 套菜明细 + suitItem.setParentId(parentId); + suitItem.setLineNo(lineNo); + suitItem.setGoodsId(null == suitMap.get("goodsId") ? "" : suitMap.get("goodsId").toString()); + suitItem.setGoodsName(suitMap.get("name").toString()); + suitItem.setCategoryId(null == suitMap.get("categoryId") ? "" : suitMap.get("categoryId").toString()); + suitItem.setProductId(suitMap.get("productId").toString()); + suitItem.setProductNo(suitMap.get("productNo").toString()); + suitItem.setSpecId(suitMap.get("specId").toString()); + suitItem.setSpecName(suitMap.get("specName").toString()); + suitItem.setCount(suitNum); + suitItem.setPrice(suitPrice); + suitItem.setPriceOrg(suitPrice); + suitItem.setDiscountPrice(discountPrice); + suitItem.setProductUnitId(suitMap.get("unitId").toString()); + + // 套餐明细优惠 + ProductPromotion promotion = new ProductPromotion(); + promotion.setId(null); + promotion.setOrderItemId(orderItemId); + promotion.setType(OrderPromotionType.SUITDISCOUNT.getSign()); + promotion.setDiscountMoney(promotionAmount); + promotion.setInfo("套餐商品[" + suitMap.get("name").toString() + " " + suitMap.get("specName").toString() + "] 套餐分摊优惠金额 :" + promotionAmount); + List promotions = new ArrayList(); + promotions.add(promotion); + + suitItem.setPromotions(promotions); + + double suitMakeAmount = 0.00; + // 处理套餐明细做法 + List suitItemMakes = new ArrayList(); + if (null != suitMap.get("makeId") && StringUtils.isNotBlank(suitMap.get("makeId").toString())) { + String[] makeIds = suitMap.get("makeId").toString().split(","); + String[] makeNames = suitMap.get("makeName").toString().split(","); + String[] makePrices = suitMap.get("makePrice").toString().split(","); + for (int j = 0; j < makeIds.length; j++) { + String makeName = makeNames[j]; + String makeId = makeIds[j]; + double makeItemPrice = Double.valueOf(makePrices[j]); + // 做法加价金额 + double addTotal = PreciseCompute.mul(suitNum, makeItemPrice); + // 明细做法总金额(做为明细加价金额) + suitMakeAmount = PreciseCompute.add(suitMakeAmount, addTotal); + // 做法优惠金额 + double makeItemDiscount = 0.00; + // // 做法加价 = 做法金额 - 做法优惠金额 + // double discountAmount = + // PreciseCompute.sub(addTotal, + // makeItemDiscount); + + OrderItemMake itemMake = new OrderItemMake(); + itemMake.setMakeId(makeId); + itemMake.setMakeName(makeName); + itemMake.setAddPrice(makeItemPrice); + itemMake.setDiscountPrice(makeItemPrice); + itemMake.setCount(num); + itemMake.setAddTotal(addTotal); + itemMake.setDiscountAddTotal(makeItemDiscount); + itemMake.setMngNum(0); + suitItemMakes.add(itemMake); + makeAmount = PreciseCompute.add(makeAmount, addTotal); + } + } + suitItem.setMakes(suitItemMakes); + + // 明细消费金额 + suitItem.setAmount(suitAmount); + // 明细优惠金额 + suitItem.setDiscountTotal(promotionAmount); + // 明细应收金额 + suitItem.setReceivable(receiveAmount); + + // 明细加价金额 + suitItem.setAddPriceTotal(suitMakeAmount); + // 明细加价优惠金额 + double suitAddDstTotal = 0.00; + suitItem.setDiscountAddTotal(0.00); + // 明细加价应收金额 = 明细加价金额 - 明细加价优惠金额 + double suitAddTotal = PreciseCompute.sub(suitMakeAmount, suitAddDstTotal); + suitItem.setAmountAddTotal(suitAddTotal); + + // 明细消费总额 = 明细消费金额 + 明细加价总额 + suitAmount = PreciseCompute.add(suitAmount, suitMakeAmount); + suitItem.setAmountTotal(suitAmount); + // 明细应收总额 = 明细消费金额 + 明细加价应收金额 + receiveAmount = PreciseCompute.add(receiveAmount, suitAddTotal); + suitItem.setReceivableTotal(receiveAmount); + + itemList.add(suitItem); + lineNo++; + } + } else { + logger.error("保存订单异常 套餐[" + goodsId + "] 明细为空"); + } + } + /******** 套餐明细结束 ********/ + + /************ 商品做法 ***************/ + + // 套餐售价 = 套餐原价 + 套餐明细加价 + price = PreciseCompute.add(item.getPrice(), detailAddPrice); + // 套餐会员价 = 套餐会员原价 + 套餐明细加价 + memberPrice = PreciseCompute.add(memberPrice, detailAddPrice); + + // 套餐优惠价默认是商品售价 如果是会员卡支付 优惠价 = 优惠价 + 套餐明细加价 + double discountPrice = price; + if (isCardPay) { + discountPrice = PreciseCompute.add(item.getDiscountPrice(), detailAddPrice); + } + item.setPrice(price); + item.setDiscountPrice(discountPrice); + item.setIsSuit(suitType); // 菜品类型 + + // 做法优惠总额 + double makePromotion = 0.00; + // 商品做法 + List itemMakes = new ArrayList(); + // 处理商品做法 + if (null != dishWithMake.get("makeId") && StringUtils.isNotBlank(dishWithMake.get("makeId").toString())) { + String[] makeNames = dishWithMake.get("makeName").toString().split(","); + String[] makeIds = dishWithMake.get("makeId").toString().split(","); + String[] makePrices = dishWithMake.get("makePrice").toString().split(","); + for (int i = 0; i < makeIds.length; i++) { + String makeName = makeNames[i]; + String makeId = makeIds[i]; + double makeItemPrice = Double.valueOf(makePrices[i]); + double makeItemAmount = PreciseCompute.mul(num, makeItemPrice); + double makeItemDiscount = 0.00; + // 做法加价 = 做法金额 - 做法优惠金额 + // double discountAmount = + // PreciseCompute.sub(makeItemAmount, + // makeItemDiscount); + OrderItemMake itemMake = new OrderItemMake(); + itemMake.setMakeId(makeId); + itemMake.setMakeName(makeName); + itemMake.setAddPrice(makeItemPrice); + itemMake.setDiscountPrice(makeItemPrice); + itemMake.setCount(num); + itemMake.setAddTotal(makeItemAmount); + itemMake.setDiscountAddTotal(makeItemDiscount); + itemMake.setMngNum(0); + itemMakes.add(itemMake); + + makePromotion = PreciseCompute.add(makePromotion, makeItemDiscount); + makeAmount = PreciseCompute.add(makeAmount, makeItemAmount); + } + } + item.setMakes(itemMakes); + item.setPromotions(new ArrayList<>()); + + // 商品消费金额 + Double goodsAmount = PreciseCompute.mul(item.getPrice(), item.getCount()); + // 商品优惠后金额 = 商品优惠价 * 商品数量 + double discountAmount = PreciseCompute.mul(item.getDiscountPrice(), item.getCount()); + // 商品优惠金额 = 商品消费金额 - 商品优惠后金额 + Double promotionAmount = PreciseCompute.sub(goodsAmount, discountAmount); + // 商品应收金额 = 消费金额 - 优惠金额 + // Double goodsReceivable = + // PreciseCompute.sub(goodsAmount, promotionAmount); + Double goodsReceivable = discountAmount; + + // 餐盒费 + item.setBoxNum(item.getCount()); + item.setBoxPrice(null == dishsMap.get("boxPrice") ? 0.00 : Double.parseDouble(dishsMap.get("boxPrice").toString())); + double boxMoney = 0.00; + if(salesOrder.getBusMode()==1 || salesOrder.getBusMode()==2){ + boxMoney = PreciseCompute.mul(item.getCount(), item.getBoxPrice()); + } + goodsAmount = goodsAmount + boxMoney; + goodsReceivable = goodsReceivable +boxMoney; + // 商品消费金额 + item.setAmount(goodsAmount); + // 商品优惠金额 + item.setDiscountTotal(promotionAmount); + // 商品应收金额 + item.setReceivable(goodsReceivable); + // 加价金额 + item.setAddPriceTotal(makeAmount); + // 加价优惠金额 + item.setDiscountAddTotal(makePromotion); + // 加价应收金额 = 加价金额 - 加价优惠金额 + Double addPriceReceivable = PreciseCompute.sub(makeAmount, makePromotion); + item.setAmountAddTotal(addPriceReceivable); + + // 商品消费总额 = 商品消费金额 + 做法金额 + Double totalAmount = PreciseCompute.add(goodsAmount, makeAmount); + // 消费总额 + item.setAmountTotal(totalAmount); + // 应收总额 = 商品应收 - 加价应收 + // Double receivableAmount = + // PreciseCompute.sub(totalAmount, promotionAmount); + Double receivableAmount = PreciseCompute.add(goodsReceivable, addPriceReceivable); + // 应收总额 + item.setReceivableTotal(receivableAmount); + + // 订单消费总额 + orderAmount = PreciseCompute.add(orderAmount, totalAmount); + // 订单优惠总额 + orderProAmount = PreciseCompute.add(orderProAmount, promotionAmount); + + // 会员商品应收金额(刷卡支付) = 会员价 * 商品数量 + 做法金额 + double memberItemAmount = PreciseCompute.mul(memberPrice, item.getCount()); + memberItemAmount = PreciseCompute.add(memberItemAmount, makeAmount); + // 订单会员优惠金额 = 商品消费金额 - 会员商品应收金额 + double memberItemPro = PreciseCompute.sub(goodsAmount, memberItemAmount); + memberProAmount = PreciseCompute.add(memberProAmount, memberItemPro); + // 订单会员应收金额 + orderMemberCash = PreciseCompute.add(orderMemberCash, memberItemAmount); + } + } + salesOrder.setItems(itemList); + // 订单会员应付金额 + salesOrder.setMemberCash(orderMemberCash); + // 订单会员优惠金额 + salesOrder.setMemberProAmount(memberProAmount); + double amount = 0.00; + if(salesOrder.getBusMode()==2){ + // 订单消费金额+配送费+餐盒费 + amount = orderAmount + salesOrder.getDistributionFee(); + }else{ + amount = orderAmount; + } + // 订单消费金额 + salesOrder.setAmount(amount); + // 订单优惠总额 + salesOrder.setDiscountTotal(orderProAmount); + // 订单应收金额 = 订单消费金额 - 订单优惠总额 + Double orderReceive = PreciseCompute.sub(amount, orderProAmount); + salesOrder.setReceivable(orderReceive); + // 备注说明 + salesOrder.setDescription(dataMap.get("description").toString()); + } + } catch (Exception ex) { + logger.error("组装订单数据错误 ", ex); + } + return salesOrder; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/ops/CityInfoService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/ops/CityInfoService.java new file mode 100644 index 0000000..8a376f6 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/ops/CityInfoService.java @@ -0,0 +1,10 @@ +package com.jwsaas.api.service.ops; + +import com.jwsaas.api.request.ops.CityInfoListRequest; +import com.jwsaas.api.service.WopService; + +public interface CityInfoService extends WopService { + + Object getList(CityInfoListRequest request); + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/pay/PayService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/pay/PayService.java new file mode 100644 index 0000000..ece0feb --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/pay/PayService.java @@ -0,0 +1,15 @@ +package com.jwsaas.api.service.pay; + +import com.jwsaas.api.request.pay.PaymentParameterRequest; +import com.jwsaas.api.service.WopService; + +public interface PayService extends WopService { + + /** + * 获取门店支付参数列表 + * + * @param request + * @return + */ + Object getParameter(PaymentParameterRequest request); +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/peripheral/PeripheralService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/peripheral/PeripheralService.java new file mode 100644 index 0000000..0dfe240 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/peripheral/PeripheralService.java @@ -0,0 +1,25 @@ +package com.jwsaas.api.service.peripheral; + +import com.jwsaas.api.request.peripheral.CardReaderInfoRequest; +import com.jwsaas.api.request.peripheral.PrinterInfoRequest; +import com.jwsaas.api.service.WopService; + +public interface PeripheralService extends WopService { + + /** + * 读卡器信息 + * + * @param request + * @return + */ + Object cardReaderInfo(CardReaderInfoRequest request); + + /** + * 打印机信息 + * + * @param request + * @return + */ + Object printerInfo(PrinterInfoRequest request); + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/pos/ErpPosService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/pos/ErpPosService.java new file mode 100644 index 0000000..3b9186e --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/pos/ErpPosService.java @@ -0,0 +1,14 @@ +package com.jwsaas.api.service.pos; + +import com.jwsaas.api.request.pos.ErpPosSetRequest; +import com.jwsaas.api.service.WopService; + +public interface ErpPosService extends WopService { + + /** + * ErpPos设置 + * @param request + * @return + */ + Object getPosSet(ErpPosSetRequest request); +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/pos/PosSaleClearService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/pos/PosSaleClearService.java new file mode 100644 index 0000000..37303c9 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/pos/PosSaleClearService.java @@ -0,0 +1,45 @@ +package com.jwsaas.api.service.pos; + +import com.jwsaas.api.request.split.SplitFoodAccountRequest; +import com.jwsaas.api.request.split.SplitShopAccountRequest; +import com.jwsaas.api.request.upload.BusinessOrderUploadRequest; +import com.jwsaas.api.service.WopService; + +/** + * 前台业务上传相关接口 + */ +public interface PosSaleClearService extends WopService { + + /** + * 上传接口 + * + * @param request + * @return + */ + Object businessSaleClearUpload(BusinessOrderUploadRequest request); + + /** + * 库存修改接口 + * + * @param request + * @return + */ + Object businessSaleClearUploadkc(BusinessOrderUploadRequest request); + + /** + * 列表接口 + * + * @param request + * @return + */ + Object businessSaleClearList(SplitShopAccountRequest request); + + + /** + * 列表接口 + * + * @param request + * @return + */ + Object businessSaleClearFood(BusinessOrderUploadRequest request); +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/pos/PosService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/pos/PosService.java new file mode 100644 index 0000000..05e553d --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/pos/PosService.java @@ -0,0 +1,76 @@ +package com.jwsaas.api.service.pos; + +import com.jwsaas.api.request.pos.*; +import com.jwsaas.api.service.WopService; + +/** + * 基础服务相关接口 + */ +public interface PosService extends WopService { + + /** + * Pos注册接口 + * + * @param request + * @return + */ + Object posRegister(PosRegisterRequest request); + + /** + * POS监控 + */ + Object posMonitor(PosMonitorRequest request); + + /** + * POS注册接口(V1升级V2) + */ + Object posRegisterV1ToV2(PosRegisterV1ToV2Request request); + + /** + * POS校验 + * + * @param request + * @return + */ + Object posAuth(PosAuthRequest request); + + /** + * 产品注册 + * + * @param request + * @return + */ + Object TenantLineAuth(TenantLineAuthRequest request); + + /** + * POS方案列表 + * + * @param request + * @return + */ + Object posSetPlan(PosSetPlanRequest request); + + /** + * 参数设置上传 + * + * @param request + * @return + */ + Object posSetPlanUp(PosSetPlanUpRequest request); + + /** + * 参数设置下载 + * + * @param request + * @return + */ + Object posSetPlanDown(PosSetPlanDownRequest request); + + /** + * 服务数据版本信息对比; + * @param request + * @return + */ + Object serverDataVersionComparison(ServerDataVersionRequest request); + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/product/ProductService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/product/ProductService.java new file mode 100644 index 0000000..b4018ed --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/product/ProductService.java @@ -0,0 +1,146 @@ +package com.jwsaas.api.service.product; + +import com.jwsaas.api.request.product.MakeBurdenRequest; +import com.jwsaas.api.request.product.ProductBrandRequest; +import com.jwsaas.api.request.product.ProductBurdenRequest; +import com.jwsaas.api.request.product.ProductImageRequest; +import com.jwsaas.api.request.product.ProductMakeDetailRequest; +import com.jwsaas.api.request.product.ProductRatioRequest; +import com.jwsaas.api.request.product.ProductRequest; +import com.jwsaas.api.request.product.ProductSpecRequest; +import com.jwsaas.api.request.product.ProductSuitDetailRequest; +import com.jwsaas.api.request.product.ProductSuitRequest; +import com.jwsaas.api.request.product.ProductTypeRequest; +import com.jwsaas.api.request.product.ProductUnitRequest; +import com.jwsaas.api.request.product.StoreMakeDetailRequest; +import com.jwsaas.api.request.product.StoreMakeTypeRequest; +import com.jwsaas.api.request.wxyh.WxyhCategoryRequest; +import com.jwsaas.api.service.WopService; + +public interface ProductService extends WopService { + + /** + * 门店做法类型 + * + * @param request + * @return + */ + Object storeMakeType(StoreMakeTypeRequest request); + + /** + * 门店做法资料 + * + * @param request + * @return + */ + Object storeMakeDetail(StoreMakeDetailRequest request); + + /** + * 商品单位 + * + * @param request + * @return + */ + Object productUnit(ProductUnitRequest request); + + /** + * 商品类别 + * + * @param request + * @return + */ + Object productType(ProductTypeRequest request); + + /** + * 商品资料 + * + * @param request + * @return + */ + Object productList(ProductRequest request); + + /** + * 商品规格资料 + * + * @param request + * @return + */ + Object productSpec(ProductSpecRequest request); + + /** + * 商品图片信息 + * + * @param request + * @return + */ + Object productImage(ProductImageRequest request); + + /** + * 商品套菜资料 + * + * @param request + * @return + */ + Object productSuit(ProductSuitRequest request); + + /** + * 商品套菜明细资料 + * + * @param request + * @return + */ + Object productSuitDetail(ProductSuitDetailRequest request); + + /** + * 商品套菜明细资料 + * + * @param request + * @return + */ + Object productRatio(ProductRatioRequest request); + + /** + * 商品私有做法信息 + * + * @param request + * @return + */ + Object productMakeDetail(ProductMakeDetailRequest request); + + /** + * 所有商品品牌信息 + * + * @param request + * @return + */ + Object productBrand(ProductBrandRequest request); + + /*** + * 门店品牌 + * @param request + * @return + */ + Object productStoreBrand(ProductBrandRequest request); + + /*** + * 门店商品品牌 + * @param request + * @return + */ + Object storeProductBrand(WxyhCategoryRequest request); + + + /*** + * 下载门店商品配方 + * @param request + * @return + */ + Object storeProductBurden(ProductBurdenRequest request); + + /*** + * 下载门店做法配方 + * @param request + * @return + */ + Object storeMakeBurdenRequest(MakeBurdenRequest request); +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/ProgramAdvPictureAndEvaluateService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/ProgramAdvPictureAndEvaluateService.java new file mode 100644 index 0000000..3db2db8 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/ProgramAdvPictureAndEvaluateService.java @@ -0,0 +1,34 @@ +package com.jwsaas.api.service.program; + +import com.jwsaas.api.request.program.ProgramAdvPictureRequest; +import com.jwsaas.api.request.program.ProgramEvaluateDownloadRequest; +import com.jwsaas.api.request.program.ProgramEvaluateUploadRequest; +import com.jwsaas.api.service.WopService; + +/** + * Created by Administrator on 2019\7\9 0009. + */ +public interface ProgramAdvPictureAndEvaluateService extends WopService { + + /** + * 广告图片; + * @param request + * @return + */ + Object programAdvPictureDownload(ProgramAdvPictureRequest request); + + /** + * 评价上传; + * @param request + * @return + */ + Object programEvaluateUpload(ProgramEvaluateUploadRequest request); + + /** + * 评价查看; + * @param request + * @return + */ + Object programEvaluateDownload(ProgramEvaluateDownloadRequest request); + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/ProgramOrderDispatchService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/ProgramOrderDispatchService.java new file mode 100644 index 0000000..f95817d --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/ProgramOrderDispatchService.java @@ -0,0 +1,17 @@ +package com.jwsaas.api.service.program; + +import com.jwsaas.api.request.program.ProgramOrderQueryByBusNoRequest; +import com.jwsaas.api.service.WopService; + +public interface ProgramOrderDispatchService extends WopService { + + /** + * 向餐道平台同步订单; + * @param request + * @return + */ + Object dispatchOrderSync(ProgramOrderQueryByBusNoRequest request); + + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/ProgramOrderService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/ProgramOrderService.java new file mode 100644 index 0000000..0b944f3 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/ProgramOrderService.java @@ -0,0 +1,161 @@ +package com.jwsaas.api.service.program; + +import com.jwsaas.api.request.program.*; +import com.jwsaas.api.service.WopService; + +public interface ProgramOrderService extends WopService { + + + + /** + * 订单创建 + * + * @param request + * @return + */ + Object ProgramOrderCreate(ProgramOrderCreateRequest request); + + + /** + * 订单列表 + * + * @param request + * @return + */ + Object ProgramOrderList(ProgramOrderListRequest request); + + /** + * 订单详情 + * + * @param request + * @return + */ + Object ProgramOrderDetail(ProgramOrderDetailRequest request); + + + /*** + * 微信小程序统一下单 + * + * @return + */ + Object ProgramWeixinPay(ProgramWeixinPayRequest request); + + /*** + * 订单支付状态查询接口 + * + * @return + */ + Object ProgramWeixinPayQuery(ProgramWeixinPayQueryRequest request); + + /** + * 根据单号查询订单 + * @param request + * @return + */ + Object ProgramOrderQueryByBusNo(ProgramOrderQueryByBusNoRequest request); + + /** + * 商家确认接单 + * @param request + * @return + */ + Object ProgramOrderConfirm(ProgramOrderConfirmRequest request); + + /** + * 商家取消订单 + * @param request + * @return + */ + Object ProgramOrderCancel(ProgramOrderCancelRequest request); + + /** + * 订单同意退款 + * @param request + * @return + */ + Object ProgramOrderRefundAgree(ProgramOrderRefundAgreeRequest request); + + /** + * 通联订单同意退款 + * @param request + * @return + */ + Object ProgramOrderTlRefundAgree(ProgramOrderRefundAgreeRequest request); + + /** + * 订单拒绝退款 + * @param request + * @return + */ + Object ProgramOrderRefundReject(ProgramOrderRefundRejectRequest request); + + + /** + * 获取饿了么待处理订单列表 + * @param request + * @return + */ + Object ProgramHandleOrder(ProgramOrderHandleRequest request); + + /** + * 获取饿了么所有订单列表 + * @param request + * @return + */ + Object ProgramListOrder(ProgramListOrderRequest request); + + + /*** + * 支付信息上传(会员卡支付) + * + * @return + */ + Object ProgramOrderPay(ProgramOrderPayRequest request); + + + /*** + * 用户申请退款 + * + * @return + */ + Object ProgramOrderRefundApply(ProgramOrderRefundApplyRequest request); + + /** + * 订单创建(同步专用) + * + * @param request + * @return + */ + Object ProgramOrderCreateSync(ProgramOrderCreateSyncRequest request); + + /** + * 订单修改 + * + * @param request + * @return + */ + Object ProgramOrderEdit(ProgramOrderEditRequest request); + + + /** + * 时间段内未处理的订单 + * @param request + * @return + */ + Object ProgramHandleOrderPeriod(ProgramOrderHandlePeriodRequest request); + + + /** + * 查询订单配送状态信息; + * @param request + * @return + */ + Object ProgramDeliverInfoQuery(ProgramOrderQueryByBusNoRequest request); + + /** + * 查询通联订单状态信息; + * @param request + * @return + */ + Object getOrderDetail(ProgramWeixinPayQueryRequest request); +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/ProgramProductService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/ProgramProductService.java new file mode 100644 index 0000000..c9feaea --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/ProgramProductService.java @@ -0,0 +1,39 @@ +package com.jwsaas.api.service.program; + +import com.jwsaas.api.request.program.ProgramProductRequest; +import com.jwsaas.api.request.program.ProgramProductSaleStatusRequest; +import com.jwsaas.api.request.program.ProgramProductStockRequest; +import com.jwsaas.api.service.WopService; + +public interface ProgramProductService extends WopService { + + /** + * 门店商品资料 + * + * @param request + * @return + */ + Object ProgramProductCategory(ProgramProductRequest request); + + + /** + * 商品数量查询 + * @param request + * @return + */ + Object ProgramProductStock(ProgramProductStockRequest request); + + /** + * 设置巨为小程序商品售罄; + * @param request + * @return + */ + Object ProgramProductSaleOut(ProgramProductSaleStatusRequest request); + + /** + * 设置巨为小程序商品售卖; + * @param request + * @return + */ + Object ProgramProductSaleIn(ProgramProductSaleStatusRequest request); +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/ProgramProductSpecService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/ProgramProductSpecService.java new file mode 100644 index 0000000..2687160 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/ProgramProductSpecService.java @@ -0,0 +1,17 @@ +package com.jwsaas.api.service.program; + +import com.jwsaas.api.request.program.ProgramProductDetailRequest; +import com.jwsaas.api.service.WopService; + +/** + * Created by Administrator on 2019\9\11 0011. + */ +public interface ProgramProductSpecService extends WopService { + + /** + * 单个小程序商品详细信息 + * @param request + * @return + */ + Object ProgramProductSpecDetailInfo(ProgramProductDetailRequest request); +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/ProgramStoreService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/ProgramStoreService.java new file mode 100644 index 0000000..8ca8306 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/ProgramStoreService.java @@ -0,0 +1,80 @@ +package com.jwsaas.api.service.program; + +import com.jwsaas.api.request.program.ProgramStoreDetailRequest; +import com.jwsaas.api.request.program.ProgramStoreListRequest; +import com.jwsaas.api.request.program.ProgramStoreListSyncRequest; +import com.jwsaas.api.request.program.ProgramStoreOpenRequest; +import com.jwsaas.api.request.program.ProgramStoreStopRequest; +import com.jwsaas.api.service.WopService; + +public interface ProgramStoreService extends WopService { + + /** + * 小程序门店列表(第三方同步使用) + * + * @param request + * @return + */ + Object ProgramStoreListSync(ProgramStoreListSyncRequest request); + + /** + * 小程序门店列表 + * + * @param request + * @return + */ + Object ProgramStoreList(ProgramStoreListRequest request); + + /** + * 小程门店详情 + * + * @param request + * @return + */ + Object ProgramStoreDetail(ProgramStoreDetailRequest request); + + /** + * 门店停业 + * + * @param request + * @return + */ + Object ProgramStoreStop(ProgramStoreStopRequest request); + + /** + * 门店开业 + * + * @param request + * @return + */ + Object ProgramStoreOpen(ProgramStoreOpenRequest request); + + + /** + * 门店图片 + * @param request + * @return + */ + Object ProgramStorePicture(ProgramStoreDetailRequest request); + + /** + * 门店备注自定义标签信息; + * @param request + * @return + */ + Object ProgramStoreMemoTags(ProgramStoreDetailRequest request); + + /** + * 巨为小程序门店开启自动呼叫配送; + * @param request + * @return + */ + Object ProgramStoreAutoDeliveryOpen(ProgramStoreOpenRequest request); + + /** + * 巨为小程序门店关闭自动呼叫配送; + * @param request + * @return + */ + Object ProgramStoreAutoDeliveryClose(ProgramStoreOpenRequest request); +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/ProgramUserService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/ProgramUserService.java new file mode 100644 index 0000000..8d0b145 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/ProgramUserService.java @@ -0,0 +1,51 @@ +package com.jwsaas.api.service.program; + +import com.jwsaas.api.request.program.ProgramUserAddressCreateRequest; +import com.jwsaas.api.request.program.ProgramUserAddressDeleteRequest; +import com.jwsaas.api.request.program.ProgramUserAddressListRequest; +import com.jwsaas.api.request.program.ProgramUserAddressUpdateRequest; +import com.jwsaas.api.request.program.ProgramUserWeixinFormIdRequest; +import com.jwsaas.api.service.WopService; + +public interface ProgramUserService extends WopService { + + /** + * 用户收货地址新增 + * + * @param request + * @return + */ + Object ProgramUserAddressCreate(ProgramUserAddressCreateRequest request); + + /** + * 用户收货地址修改 + * + * @param request + * @return + */ + Object ProgramUserAddressUpdate(ProgramUserAddressUpdateRequest request); + + /** + * 用户收货地址删除 + * + * @param request + * @return + */ + Object ProgramUserAddressDelete(ProgramUserAddressDeleteRequest request); + + /** + * 用户收货地址列表 + * + * @param request + * @return + */ + Object ProgramUserAddressList(ProgramUserAddressListRequest request); + + /** + * 上传用户openId + * + * @param request + * @return + */ + Object ProgramUserWeixinFormId(ProgramUserWeixinFormIdRequest request); +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/SplitStorePayService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/SplitStorePayService.java new file mode 100644 index 0000000..6e16683 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/SplitStorePayService.java @@ -0,0 +1,19 @@ +package com.jwsaas.api.service.program; + +import com.jwsaas.api.request.program.*; +import com.jwsaas.api.service.WopService; + +public interface SplitStorePayService extends WopService { + + + + /** + * 分帐当天销售记录 + * + * @param + * @return + */ + Object DivideOrder(); + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/impl/ProgramAdvPictureAndEvaluateServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/impl/ProgramAdvPictureAndEvaluateServiceImpl.java new file mode 100644 index 0000000..f3de6e2 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/impl/ProgramAdvPictureAndEvaluateServiceImpl.java @@ -0,0 +1,329 @@ +package com.jwsaas.api.service.program.impl; + +import com.jwsaas.Constant; +import com.jwsaas.api.request.program.ProgramAdvPictureRequest; +import com.jwsaas.api.request.program.ProgramEvaluateDownloadRequest; +import com.jwsaas.api.request.program.ProgramEvaluateUploadRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.response.mode.CommonPagerResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.program.ProgramAdvPictureAndEvaluateService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.cache.data.ProgramProductInfoCache; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.ProgramAdPicture; +import com.jwsaas.entity.food.ProgramEvaluate; +import com.jwsaas.entity.food.Store; +import com.jwsaas.entity.wxdc.WeixinUser; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.pager.Pager; +import com.jwsaas.service.food.ProgramAdPictureService; +import com.jwsaas.service.food.ProgramEvaluateService; +import com.jwsaas.service.food.StoreService; +import com.jwsaas.service.wxdc.WeixinUserService; +import com.jwsaas.utils.AppKeyUtil; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; + +import javax.annotation.Resource; +import java.text.SimpleDateFormat; +import java.util.*; + +/** + * Created by Administrator on 2019\7\9 0009. + */ +@ServiceMethodBean(version = "1.0") +public class ProgramAdvPictureAndEvaluateServiceImpl extends WopServiceImpl implements ProgramAdvPictureAndEvaluateService{ + + + private static final long serialVersionUID = -4813052913282286165L; + + @Resource + private ProgramAdPictureService programAdPictureService; + @Resource + private ProgramEvaluateService programEvaluateService; + @Resource + private StoreService storeService; + @Resource + private WeixinUserService weixinUserService; + @Resource + private ProgramProductInfoCache programProductInfoCache; + + + + @ServiceMethod(method = "program.advpicture.download.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "巨为小程序-广告图片信息") + @Override + public Object programAdvPictureDownload(ProgramAdvPictureRequest request) { + String info = "巨为小程序-广告图片信息"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + String programId = request.getProgramId(); + int pageNumber = request.getPageNumber()== null ? 1 : request.getPageNumber(); + int pageSize = request.getPageSize() == null ? 10 : request.getPageSize(); + String orderType = request.getOrderType(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + if (StringUtils.isEmpty(programId)) { + response.setStatus(0); + response.setMessage("缺少必要参数(programId)"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if(pageNumber == 1 && pageSize == 10){ + pager = programProductInfoCache.getProgramAdPictures(tenantId,programId); + if(pager == null || pager.getList().size() <= 0){ + pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("programId", programId)); + criteria.add(Restrictions.eq("deleteFlag", 0)); + if (StringUtils.isEmpty(orderType)) { + orderType = "asc"; + } + criteria.add(Restrictions.order("orderNo", orderType)); + + pager = programAdPictureService.getPager(tenantId, criteria, pager); + + if (CollectionUtils.isEmpty(pager.getList())) { + response.setStatus(0); + response.setMessage("图片信息不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + programProductInfoCache.setProgramAdPictures(tenantId,programId,pager); + } + }else{ + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("programId", programId)); + criteria.add(Restrictions.eq("deleteFlag", 0)); + if (StringUtils.isEmpty(orderType)) { + orderType = "asc"; + } + criteria.add(Restrictions.order("orderNo", orderType)); + + pager = programAdPictureService.getPager(tenantId, criteria, pager); + + if (CollectionUtils.isEmpty(pager.getList())) { + response.setStatus(0); + response.setMessage("图片信息不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + programProductInfoCache.setProgramAdPictures(tenantId,programId,pager); + + } + + + List> list = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(pager.getList())) { + List pictures = (List) pager.getList(); + for (ProgramAdPicture picture : pictures) { + Map map = new HashMap<>(); + map.put("orderNo", picture.getOrderNo()); + map.put("name", picture.getName()); + map.put("linkUrl", picture.getLinkUrl()); + list.add(map); + } + } + + response.setStatus(1); + response.setMessage("获取图片成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "program.evaluate.upload", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "巨为小程序评价上传") + @Override + public Object programEvaluateUpload(ProgramEvaluateUploadRequest request) { + String info = "巨为小程序评价上传"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + + String openId = request.getOpenId(); + String storeId = request.getStoreId(); + String memberId = request.getMemberId(); + String mobile = request.getMobile(); + String programId = request.getProgramId(); + String touxiang = request.getTouxiang(); + String memberName = request.getMemberName(); + String memo = request.getMemo(); + Integer storeLevel = request.getStoreLevel(); + Integer productLevel = request.getProductLevel(); + Integer serverLevel = request.getServerLevel(); + String tickingTime = request.getTickingTime(); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Store store = storeService.get(tenantId, storeId); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + if (StringUtils.isEmpty(memo)) { + response.setStatus(0); + response.setMessage("评价不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + + + ProgramEvaluate evaluate = new ProgramEvaluate(); + evaluate.setTenantId(tenantId); + evaluate.setProgramId(programId); + evaluate.setMemberId(memberId); + evaluate.setOpenId(openId); + evaluate.setMobile(mobile); + evaluate.setStoreId(storeId); + evaluate.setStoreNo(store.getNo()); + evaluate.setStoreName(store.getName()); + // 头像图片来自于微信头像; + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("openid", openId)); + List weixinUsers = weixinUserService.getList(Constant.DEFAULT_DB_SIGN, criteria); + if (CollectionUtils.isNotEmpty(weixinUsers)) { + evaluate.setTouxiang(weixinUsers.get(0).getHeadimgurl()); + } + evaluate.setMemberName(memberName); + evaluate.setMemo(memo); + evaluate.setStoreLevel(storeLevel); + evaluate.setProductLevel(productLevel); + evaluate.setServerLevel(serverLevel); + evaluate.setTickingTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(tickingTime)); + evaluate.setStatus(0); + evaluate.setCreateDate(new Date()); + evaluate.setCreateUser("openApi"); + programEvaluateService.save(tenantId, evaluate); + + Map data = new HashMap<>(); + response.setStatus(1); + response.setMessage("上传成功"); + response.setData(data); + + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "program.evaluate.download", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "小程序评价查看") + @Override + public Object programEvaluateDownload(ProgramEvaluateDownloadRequest request) { + String info = "小程序评价查看"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + String programId = request.getProgramId(); + String openId = request.getOpenId(); + String storeId = request.getStoreId(); + int pageNumber = request.getPageNumber() == null ? 1 : request.getPageNumber(); + int pageSize = request.getPageSize() == null ? 10 : request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("a.programId", programId)); + if (StringUtils.isNotEmpty(storeId)) { + criteria.add(Restrictions.eq("a.storeId", storeId)); + } + criteria.add(Restrictions.order("a.tickingTime", "desc")); + pager = programEvaluateService.getPager4ApiDownload(tenantId, openId, criteria, pager); + List> list = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(pager.getList())) { + List evaluates = (List) pager.getList(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd"); + for (ProgramEvaluate evaluate : evaluates) { + Map map = new HashMap<>(); + map.put("programId", evaluate.getProgramId()); + map.put("memberId", evaluate.getMemberId()); + map.put("openId", evaluate.getOpenId()); + map.put("mobile", evaluate.getMobile()); + map.put("storeId", evaluate.getStoreId()); + map.put("storeNo", evaluate.getStoreNo()); + map.put("storeName", evaluate.getStoreName()); + map.put("touxiang", evaluate.getTouxiang()); + map.put("memberName", evaluate.getMemberName()); + map.put("memo", evaluate.getMemo()); + map.put("storeLevel", evaluate.getServerLevel()); + map.put("productLevel", evaluate.getProductLevel()); + map.put("serviceLevel", evaluate.getServerLevel()); + map.put("tickingTime", sdf.format(evaluate.getTickingTime())); + map.put("status", evaluate.getStatus()); + list.add(map); + } + } + + response.setStatus(1); + response.setMessage("获取评价信息成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/impl/ProgramOrderDispatchServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/impl/ProgramOrderDispatchServiceImpl.java new file mode 100644 index 0000000..3a1ea0f --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/impl/ProgramOrderDispatchServiceImpl.java @@ -0,0 +1,161 @@ +package com.jwsaas.api.service.program.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.jwsaas.api.request.program.ProgramOrderQueryByBusNoRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.program.ProgramOrderDispatchService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.ProgramStoreBusinessTicket; +import com.jwsaas.entity.food.ProgramStoreBusinessTicketDeliver; +import com.jwsaas.entity.food.ProgramStoreOrderProduct; +import com.jwsaas.http.HttpTool; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.properties.CandaoProperties; +import com.jwsaas.service.food.ProgramStoreBusinessTicketDeliverService; +import com.jwsaas.util.HttpUtils; +import com.jwsaas.util.StringUtils; +import com.jwsaas.utils.AppKeyUtil; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.http.HttpResponse; +import org.springframework.beans.factory.annotation.Autowired; + +import javax.annotation.Resource; +import java.text.SimpleDateFormat; +import java.util.*; + +@ServiceMethodBean(version = "1.0") +public class ProgramOrderDispatchServiceImpl extends WopServiceImpl implements ProgramOrderDispatchService { + + @Resource + private com.jwsaas.service.food.ProgramStoreBusinessTicketService programStoreBusinessTicketService; + @Resource + private com.jwsaas.service.food.ProgramStoreOrderProductService programStoreOrderProductService; + @Resource + private ProgramStoreBusinessTicketDeliverService programStoreBusinessTicketDeliverService; + @Autowired + private CandaoProperties candaoProperties; + + + + @ServiceMethod(method = "program.order.dispatch.sync", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "向餐道平台同步订单") + @Override + public Object dispatchOrderSync(ProgramOrderQueryByBusNoRequest request) { + String info = "向餐道平台同步订单"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + CommonDataResponse response = null; + + String storeId = request.getStoreId(); + String no = request.getBusNo(); + try{ + response = new CommonDataResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId",storeId)); + criteria.add(Restrictions.eq("no",no)); + List tickets = programStoreBusinessTicketService.getList(tenantId,criteria); + if(CollectionUtils.isEmpty(tickets)){ + response.setStatus(0); + response.setMessage("订单号不存在"); + response.setErrCode(CommonErrorCode.error21.getCode()); + response.setErrMessage(CommonErrorCode.error21.getMessage()); + return response; + } + ProgramStoreBusinessTicket ticket = tickets.get(0); + criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketId",ticket.getId())); + List products = programStoreOrderProductService.getList(tenantId,criteria); + if(CollectionUtils.isEmpty(products)){ + response.setStatus(0); + response.setMessage("订单明细不存在"); + response.setErrCode(CommonErrorCode.error21.getCode()); + response.setErrMessage(CommonErrorCode.error21.getMessage()); + return response; + } + List delivers = programStoreBusinessTicketDeliverService.getList(tenantId,criteria); + if(CollectionUtils.isEmpty(delivers)){ + response.setStatus(0); + response.setMessage("此单不是外卖单"); + response.setErrCode(CommonErrorCode.error24.getCode()); + response.setErrMessage(CommonErrorCode.error24.getMessage()); + return response; + } + ProgramStoreBusinessTicketDeliver deliver = delivers.get(0); + + Map paramMap = new HashMap<>(); + paramMap.put("orderId",ticket.getId()); + paramMap.put("longitude",deliver.getLongitude()); + paramMap.put("latitude",deliver.getLatitude()); + paramMap.put("storeId",ticket.getStoreId()); + paramMap.put("name",deliver.getName()); + paramMap.put("phone",deliver.getOrderTel()); + paramMap.put("address",deliver.getAddress()); + paramMap.put("orderTime",new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new Date())); + paramMap.put("sendTime",new SimpleDateFormat("yyyy-MM-dd").format(new Date())+" "+ticket.getReserveTime()); + paramMap.put("payType",2); + paramMap.put("orderStatus",ticket.getStatus()); + JSONArray jsonArray = new JSONArray(); + JSONObject json= new JSONObject(); + json.put("money",ticket.getReceivable()); + json.put("typeName","在线支付"); + jsonArray.add(json); + paramMap.put("paymentDetails",JSON.toJSONString(jsonArray)); + JSONArray array = new JSONArray(); + for(ProgramStoreOrderProduct product : products){ + JSONObject jsonObject = new JSONObject(); + String name = product.getProductName(); + if(StringUtils.isNotBlank(product.getSpecName())){ + name = product.getProductName()+"("+product.getSpecName()+")"; + } + jsonObject.put("name",name); + jsonObject.put("price",product.getDiscountPrice()); + jsonObject.put("num",product.getCount()); + jsonObject.put("boxNum",product.getPackageFee() == 0.0 ? 0 : 1); + jsonObject.put("boxPrice",product.getPackageFee()); + array.add(jsonObject); + } + + paramMap.put("products",JSON.toJSONString(array)); + paramMap.put("tenantId",tenantId); + paramMap.put("BusinessType",0); + paramMap.put("opertionPeople","openApi"); + String content = HttpUtils.executePost(candaoProperties.getCandaoDispatchUrl()+"/delivery/addDeliveryOrder",paramMap); + +// HttpResponse httpResponse = HttpTool.url(candaoProperties.getCandaoDispatchUrl()+"/delivery/addDeliveryOrder").form(paramMap).post(); +// String content = HttpTool.getResponseAsString(httpResponse); + if(org.apache.commons.lang3.StringUtils.isNotEmpty(content)){ + Integer status = JSON.parseObject(content).get("status") == null ? 0 : (Integer) JSON.parseObject(content).get("status"); + if(status == 1){ + response.setStatus(1); + response.setMessage("同步订单成功"); + }else{ + String msg = JSON.parseObject(content).get("msg").toString(); + response.setStatus(0); + response.setMessage(msg); + } + } + }catch (Exception e){ + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl.java new file mode 100644 index 0000000..9180b5a --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl.java @@ -0,0 +1,5700 @@ +package com.jwsaas.api.service.program.impl; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.DateFormat; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; +import javax.annotation.Resource; + +import com.jwsaas.api.request.program.*; +import com.jwsaas.config.RabbitConstant; +import com.jwsaas.entity.food.*; +import com.jwsaas.pay.weixin.response.PayNotifyResponse; +import com.jwsaas.properties.CandaoProperties; +import com.jwsaas.properties.TongLianPayProperties; +import com.jwsaas.service.food.ProductStoreStockLogService; +import com.jwsaas.service.food.ProgramPaymentParameterService; +import com.jwsaas.service.food.StoreService; +import com.jwsaas.tonglian.TlCommonConstants; +import com.jwsaas.tonglian.TlHttpClient; +import com.jwsaas.tonglian.bean.AgentCollectApply; +import com.jwsaas.tonglian.bean.OrderRefund; +import com.jwsaas.tonglian.bean.Reqsn; +import com.jwsaas.util.*; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.http.HttpResponse; +import org.redisson.api.RLock; +import org.redisson.api.RMapCache; +import org.redisson.api.RedissonClient; +import org.springframework.amqp.rabbit.support.CorrelationData; +import org.springframework.beans.factory.annotation.Autowired; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.fasterxml.jackson.core.type.TypeReference; +import com.jwsaas.api.entity.program.AuthAccessToken; +import com.jwsaas.api.entity.program.ProgramStoreBusinessTicketDeliverEntity; +import com.jwsaas.api.entity.program.ProgramStoreBusinessTicketEntity; +import com.jwsaas.api.entity.program.ProgramStoreBusinessTicketInfoEntity; +import com.jwsaas.api.entity.program.ProgramStoreBusinessTicketSycnEntity; +import com.jwsaas.api.entity.program.ProgramStoreOrderProductEntity; +import com.jwsaas.api.entity.program.ProgramStoreOrderProductInfoEntity; +import com.jwsaas.api.entity.program.ProgramStoreOrderProductMakeEntity; +import com.jwsaas.api.entity.program.ProgramStorePayEntity; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.response.mode.CommonListResponse; +import com.jwsaas.api.response.mode.CommonPagerResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.program.ProgramOrderService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.config.MQMessageSender; +import com.jwsaas.http.HttpTool; +import com.jwsaas.mqtt.MqttClientExt; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.open.utils.WopUtils; +import com.jwsaas.pager.Pager; +import com.jwsaas.properties.SaoBeiPayProperties; +import com.jwsaas.reactor.event.EventKeys; +import com.jwsaas.utils.AppKeyUtil; +import com.jwsaas.utils.DateUtils; +import com.jwsaas.utils.IdWorkerUtils; +import com.jwsaas.weixin.SignUtil; + +import reactor.bus.Event; + +@ServiceMethodBean(version = "1.0") +public class ProgramOrderServiceImpl extends WopServiceImpl implements ProgramOrderService { + + private static final long serialVersionUID = 8071209717229269556L; + + @Resource + private com.jwsaas.service.food.ProgramSettingService programSettingService; + + @Resource + private com.jwsaas.service.food.ProgramStoreService programStoreService; + + @Resource + private com.jwsaas.service.food.ProductSpecService productSpecService; + + @Resource + private com.jwsaas.service.food.ProgramStoreBusinessTicketService programStoreBusinessTicketService; + + @Resource + private com.jwsaas.service.food.ProgramStoreBusinessTicketInfoService programStoreBusinessTicketInfoService; + + @Resource + private com.jwsaas.service.food.ProgramStoreBusinessTicketDeliverService programStoreBusinessTicketDeliverService; + + @Resource + private com.jwsaas.service.food.ProgramStoreOrderProductService programStoreOrderProductService; + + @Resource + private com.jwsaas.service.food.ProgramStoreOrderProductInfoService programStoreOrderProductInfoService; + + @Resource + private com.jwsaas.service.food.ProgramStoreOrderProductMakeService programStoreOrderProductMakeService; + + @Resource + private com.jwsaas.service.food.ProgramStorePayService programStorePayService; + + @Resource + private com.jwsaas.service.food.SplitShopAccountService splitShopAccountService; + + @Resource + private com.jwsaas.service.food.SplitFoodAccountService splitFoodAccountService; + + @Resource + private com.jwsaas.service.food.PaymentParameterService paymentParameterService; + + @Resource + private ProgramPaymentParameterService programPaymentParameterService; + + @Resource + private com.jwsaas.service.food.PosInfoService posInfoService; + @Resource + private com.jwsaas.service.food.StoreService storeService; + @Autowired + private SaoBeiPayProperties saoBeiPayProperties; + @Autowired + private TongLianPayProperties tongLianPayProperties; + @Resource + private com.jwsaas.cache.CacheService cacheService; + + @Resource + private MqttClientExt mqttClient; + + @Resource + private MQMessageSender mqMessageSender; + + @Autowired + private CandaoProperties candaoProperties; + + @Resource + private ProductStoreStockLogService productStoreStockLogService; + + @Resource + private RedissonClient redissonClient; + + @ServiceMethod(method = "program.order.edit", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "订单修改") + @Override + public Object ProgramOrderEdit(ProgramOrderEditRequest request) { + String info = "订单修改"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + CommonDataResponse response = null; + String openId = request.getOpenId(); + String programId = request.getProgramId(); + String busNo = request.getBusNo(); + + String mobile = request.getMobile(); + String tableNo = request.getTableNo(); + String tableName = request.getTableName(); + Integer people = request.getPeople(); + Integer busMode = request.getBusMode(); + String reserveTime = request.getReserveTime(); + Double deliverFee = request.getDeliverFee(); + Double packageFee = request.getPackageFee(); + String ext2 = request.getExt2(); + String jsonStringDeliver = request.getJsonStringDeliver(); + String jsonStringProduct = request.getJsonStringProduct(); + try { + response = new CommonDataResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("no", busNo)); + criteria.add(Restrictions.eq("openId", openId)); + criteria.add(Restrictions.eq("programId", programId)); + List ticketList = programStoreBusinessTicketService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(ticketList)) { + response.setStatus(0); + response.setMessage("修改失败,订单号不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ProgramStoreBusinessTicket programStoreBusinessTicket = ticketList.get(0); + if (programStoreBusinessTicket.getStatus() != -1) { + response.setStatus(0); + response.setMessage("修改失败,订单状态不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + programStoreBusinessTicket.setMobile(mobile); + programStoreBusinessTicket.setTableNo(tableNo); + programStoreBusinessTicket.setTableName(tableName); + programStoreBusinessTicket.setPeople(people); + programStoreBusinessTicket.setBusMode(busMode); + programStoreBusinessTicket.setReserveTime(reserveTime); + programStoreBusinessTicket.setDeliverFee(deliverFee); + programStoreBusinessTicket.setPackageFee(packageFee); + programStoreBusinessTicket.setExt2(ext2); + ProgramStoreBusinessTicketDeliver storeBusinessTicketDeliver = null; + // 更新配送订单 + if (StringUtils.isNotEmpty(jsonStringDeliver)) { + JSONObject jsonObject = JSONObject.parseObject(jsonStringDeliver); + ProgramStoreBusinessTicketDeliverEntity storeBusinessTicketDeliverEntity = new ProgramStoreBusinessTicketDeliverEntity(jsonObject); + storeBusinessTicketDeliver = new ProgramStoreBusinessTicketDeliver(); + Date createDate = new Date(); + storeBusinessTicketDeliver.setCreateDate(createDate); + storeBusinessTicketDeliver.setCreateUser("open-api"); + storeBusinessTicketDeliver.setTenantId(tenantId); + storeBusinessTicketDeliver.setStoreId(programStoreBusinessTicket.getStoreId()); + storeBusinessTicketDeliver.setProgramId(programId); + storeBusinessTicketDeliver.setBusNo(programStoreBusinessTicket.getNo()); + if (storeBusinessTicketDeliverEntity.getClientId() == null || "".equals(storeBusinessTicketDeliverEntity.getClientId()) || storeBusinessTicketDeliverEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("配送信息ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicketDeliver.setClientId(storeBusinessTicketDeliverEntity.getClientId()); + } + if (storeBusinessTicketDeliverEntity.getOrderTel() != null && storeBusinessTicketDeliverEntity.getOrderTel().length() > 16) { + response.setStatus(0); + response.setMessage("配送信息OrderTel参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicketDeliver.setOrderTel(storeBusinessTicketDeliverEntity.getOrderTel()); + } + if (storeBusinessTicketDeliverEntity.getName() != null && storeBusinessTicketDeliverEntity.getName().length() > 64) { + response.setStatus(0); + response.setMessage("配送信息Name参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicketDeliver.setName(storeBusinessTicketDeliverEntity.getName()); + } + if (storeBusinessTicketDeliverEntity.getAddress() != null && storeBusinessTicketDeliverEntity.getAddress().length() > 64) { + response.setStatus(0); + response.setMessage("配送信息Address参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicketDeliver.setAddress(storeBusinessTicketDeliverEntity.getAddress()); + } + storeBusinessTicketDeliver.setLatitude(storeBusinessTicketDeliverEntity.getLatitude()); + storeBusinessTicketDeliver.setLongitude(storeBusinessTicketDeliverEntity.getLongitude()); + storeBusinessTicketDeliver.setDeliverType(storeBusinessTicketDeliverEntity.getDeliverType()); + storeBusinessTicketDeliver.setDeliverFee(storeBusinessTicketDeliverEntity.getDeliverFee()); + } + List productList = null; + // 更新商品明细 + if (StringUtils.isNotEmpty(jsonStringProduct)) { + JSONArray jsonArray = JSONObject.parseArray(jsonStringProduct); + productList = new ArrayList<>(); + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject productObject = jsonArray.getJSONObject(i); + ProgramStoreOrderProductEntity entity = new ProgramStoreOrderProductEntity(productObject); + ProgramStoreOrderProduct programStoreOrderProduct = new ProgramStoreOrderProduct(); + programStoreOrderProduct.setId(entity.getClientId()); + programStoreOrderProduct.setPackageFee(entity.getPackageFee()); + productList.add(programStoreOrderProduct); + } + } + StoreBusinessTicketCheck ticketCheck = programStoreBusinessTicketService.updateBusinessTicketByNo(tenantId, programStoreBusinessTicket, storeBusinessTicketDeliver, productList); + if ("1".equals(ticketCheck.getStatus())) { + Map data = new HashMap<>(); + data.put("busNo", programStoreBusinessTicket.getNo()); + data.put("ticketId", ticketCheck.getTicketId()); + response.setStatus(1); + response.setMessage("订单修改成功"); + response.setData(data); + } else { + response.setStatus(0); + response.setMessage("订单修改失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + logger.error("jsonStringDeliver:" + jsonStringDeliver); + logger.error("jsonStringProduct:" + jsonStringProduct); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "program.order.create", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "订单创建") + @Override + public Object ProgramOrderCreate(ProgramOrderCreateRequest request) { + String info = "订单创建"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + CommonDataResponse response = null; + String openId = request.getOpenId(); + String programId = request.getProgramId(); + String jsonString = request.getJsonString(); + try { + response = new CommonDataResponse(); + JSONObject json = JSONObject.parseObject(jsonString); + // 销售单据校验开始 + ProgramStoreBusinessTicketEntity entity = new ProgramStoreBusinessTicketEntity(json); + ProgramStoreBusinessTicket storeBusinessTicket = new ProgramStoreBusinessTicket(); + Date createDate = new Date(); + storeBusinessTicket.setCreateDate(createDate); + storeBusinessTicket.setCreateUser("open-api"); + if (entity.getMemberId() != null && entity.getMemberId().length() > 32) { + response.setStatus(0); + response.setMessage("主单MemberId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setMemberId(entity.getMemberId()); + } + storeBusinessTicket.setOpenId(openId); + storeBusinessTicket.setSourceType(entity.getSourceType()); + if (entity.getTouxiang() != null && entity.getTouxiang().length() > 256) { + response.setStatus(0); + response.setMessage("主单touxiang参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setTouxiang(entity.getTouxiang()); + } + if (entity.getMemberName() != null && entity.getMemberName().length() > 32) { + response.setStatus(0); + response.setMessage("主单memberName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setMemberName(entity.getMemberName()); + } + if (entity.getMobile() != null && entity.getMobile().length() > 32) { + response.setStatus(0); + response.setMessage("主单Mobile参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setMobile(entity.getMobile()); + } + storeBusinessTicket.setProgramId(programId); + if (entity.getClientId() == null || "".equals(entity.getClientId()) || entity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("前台系统ID参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setClientId(entity.getClientId()); + } + entity.setNo("B" + String.valueOf(IdWorkerUtils.getInstance().nextId())); + if (entity.getNo() == null || "".equals(entity.getNo()) || entity.getNo().length() > 32) { + response.setStatus(0); + response.setMessage("主单No参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setNo(entity.getNo()); + } + //if (entity.getStoreId() == null || "".equals(entity.getStoreId()) || entity.getStoreId().length() > 18) { + //去掉18位限制条件;2020-02-29-13:08 + if (entity.getStoreId() == null || "".equals(entity.getStoreId()) ) { + response.setStatus(0); + response.setMessage("主单storeId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setStoreId(entity.getStoreId()); + } + + if (entity.getStoreNo() == null || "".equals(entity.getStoreNo()) || entity.getStoreNo().length() > 32) { + response.setStatus(0); + response.setMessage("主单StoreNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setStoreNo(entity.getStoreNo()); + } + if (entity.getStoreName() == null || "".equals(entity.getStoreName()) || entity.getStoreName().length() > 500) { + response.setStatus(0); + response.setMessage("主单StoreName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setStoreName(entity.getStoreName()); + } + storeBusinessTicket.setStatus(-1);// 待接支付状态 + storeBusinessTicket.setDeliverStatus(-1);// 待配送下单 + storeBusinessTicket.setRefundStatus(0); + storeBusinessTicket.setSaleDate(entity.getSaleDate()); + if (entity.getTableNo() != null && entity.getTableNo().length() > 16) { + response.setStatus(0); + response.setMessage("主单TableNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setTableNo(entity.getTableNo()); + } + if (entity.getTableName() != null && entity.getTableName().length() > 32) { + response.setStatus(0); + response.setMessage("主单TableName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setTableName(entity.getTableName()); + } + storeBusinessTicket.setPeople(entity.getPeople()); + storeBusinessTicket.setBusMode(entity.getBusMode()); + storeBusinessTicket.setReserveTime(entity.getReserveTime()); + storeBusinessTicket.setDeliverFee(entity.getDeliverFee()); + storeBusinessTicket.setPackageFee(entity.getPackageFee()); + storeBusinessTicket.setAmount(entity.getAmount()); + storeBusinessTicket.setDiscount(entity.getDiscount()); + storeBusinessTicket.setDiscountTotal(entity.getDiscountTotal()); + storeBusinessTicket.setReceivable(entity.getReceivable()); + storeBusinessTicket.setMaling(entity.getMaling()); + if (entity.getPaid() == null || entity.getPaid() == 0) { + storeBusinessTicket.setPaid(entity.getReceivable() - entity.getMaling()); + } else { + storeBusinessTicket.setPaid(entity.getPaid()); + } + if (entity.getNoOrg() != null && entity.getNoOrg().length() > 32) { + response.setStatus(0); + response.setMessage("主单NoOrg参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setNoOrg(entity.getNoOrg()); + } + if (entity.getBackCause() != null && entity.getBackCause().length() > 128) { + response.setStatus(0); + response.setMessage("主单BackCause参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setBackCause(entity.getBackCause()); + } + storeBusinessTicket.setIsMember(0); + storeBusinessTicket.setMemberNo(""); + storeBusinessTicket.setMemberJifen(0.00); + storeBusinessTicket.setSeqNo("");// 当日流水号 + storeBusinessTicket.setWeather("");// 天气 + storeBusinessTicket.setWeeker(entity.getWeeker());// 星期 + storeBusinessTicket.setDeductionRate(entity.getDeductionRate()); + storeBusinessTicket.setChargeBack(entity.getChargeBack()); + if (entity.getExt2() != null && entity.getExt2().length() > 32) { + response.setStatus(0); + response.setMessage("订单备注不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setExt2(entity.getExt2()); + } + // 配送信息校验 + ProgramStoreBusinessTicketDeliverEntity storeBusinessTicketDeliverEntity = entity.getTicketDeliver(); + ProgramStoreBusinessTicketDeliver storeBusinessTicketDeliver = new ProgramStoreBusinessTicketDeliver(); + if (storeBusinessTicketDeliverEntity != null) { + storeBusinessTicketDeliver.setCreateDate(createDate); + storeBusinessTicketDeliver.setCreateUser("open-api"); + storeBusinessTicketDeliver.setTenantId(tenantId); + storeBusinessTicketDeliver.setStoreId(entity.getStoreId()); + storeBusinessTicketDeliver.setProgramId(programId); + storeBusinessTicketDeliver.setBusNo(entity.getNo()); + if (storeBusinessTicketDeliverEntity.getClientId() == null || "".equals(storeBusinessTicketDeliverEntity.getClientId()) || storeBusinessTicketDeliverEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("配送信息ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicketDeliver.setClientId(storeBusinessTicketDeliverEntity.getClientId()); + } + if (storeBusinessTicketDeliverEntity.getOrderTel() != null && storeBusinessTicketDeliverEntity.getOrderTel().length() > 16) { + response.setStatus(0); + response.setMessage("配送信息OrderTel参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicketDeliver.setOrderTel(storeBusinessTicketDeliverEntity.getOrderTel()); + } + if (storeBusinessTicketDeliverEntity.getName() != null && storeBusinessTicketDeliverEntity.getName().length() > 64) { + response.setStatus(0); + response.setMessage("配送信息Name参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicketDeliver.setName(storeBusinessTicketDeliverEntity.getName()); + } + if (storeBusinessTicketDeliverEntity.getAddress() != null && storeBusinessTicketDeliverEntity.getAddress().length() > 64) { + response.setStatus(0); + response.setMessage("配送信息Address参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicketDeliver.setAddress(storeBusinessTicketDeliverEntity.getAddress()); + } + storeBusinessTicketDeliver.setLatitude(storeBusinessTicketDeliverEntity.getLatitude()); + storeBusinessTicketDeliver.setLongitude(storeBusinessTicketDeliverEntity.getLongitude()); + storeBusinessTicketDeliver.setDeliverType(storeBusinessTicketDeliverEntity.getDeliverType()); + storeBusinessTicketDeliver.setDeliverFee(storeBusinessTicketDeliverEntity.getDeliverFee()); + } + // 前台销售单优惠明细校验开始 + List ticketInfoList = new ArrayList<>(); + List storeBusinessTicketInfoEntityList = entity.getTicketInfo(); + if (storeBusinessTicketInfoEntityList != null && storeBusinessTicketInfoEntityList.size() > 0) { + for (ProgramStoreBusinessTicketInfoEntity storeBusinessTicketInfoEntity : storeBusinessTicketInfoEntityList) { + ProgramStoreBusinessTicketInfo storeBusinessTicketInfo = new ProgramStoreBusinessTicketInfo(); + storeBusinessTicketInfo.setCreateDate(createDate); + storeBusinessTicketInfo.setCreateUser("open-api"); + if (storeBusinessTicketInfoEntity.getClientId() == null || "".equals(storeBusinessTicketInfoEntity.getClientId()) || storeBusinessTicketInfoEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("销售单优惠ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicketInfo.setClientId(storeBusinessTicketInfoEntity.getClientId()); + } + storeBusinessTicketInfo.setStoreId(entity.getStoreId()); + storeBusinessTicketInfo.setProgramId(programId); + storeBusinessTicketInfo.setBusNo(entity.getNo()); + storeBusinessTicketInfo.setType(storeBusinessTicketInfoEntity.getType()); + if (storeBusinessTicketInfoEntity.getInfo() != null && storeBusinessTicketInfoEntity.getInfo().length() > 256) { + response.setStatus(0); + response.setMessage("销售单优惠Info参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicketInfo.setInfo(storeBusinessTicketInfoEntity.getInfo()); + } + storeBusinessTicketInfo.setDiscountMoney(storeBusinessTicketInfoEntity.getDiscountMoney()); + storeBusinessTicketInfo.setSaleDate(entity.getSaleDate()); + ticketInfoList.add(storeBusinessTicketInfo); + } + } + + // 门店菜品销售记录校验开始 + List orderProductList = new ArrayList<>(); + List storeOrderProductEntityList = entity.getOrderProduct(); + // 销售明细优惠 + List orderProductInfoList = new ArrayList<>(); + // 分帐明细 + List splitStorePayList = new ArrayList<>(); + // 销售明细做法 + List makeList = new ArrayList<>(); + + if (storeOrderProductEntityList == null || storeOrderProductEntityList.size() <= 0) { + response.setStatus(0); + response.setMessage("门店菜品销售记录不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + int lineNo = 0; + for (ProgramStoreOrderProductEntity storeOrderProductEntity : storeOrderProductEntityList) { + ProgramStoreOrderProduct storeOrderProduct = new ProgramStoreOrderProduct(); + storeOrderProduct.setCreateDate(createDate); + storeOrderProduct.setCreateUser("open-api"); + if (storeOrderProductEntity.getClientId() == null || "".equals(storeOrderProductEntity.getClientId()) || storeOrderProductEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ID参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setClientId(storeOrderProductEntity.getClientId()); + } + if (storeOrderProductEntity.getParentId() != null && storeOrderProductEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ParentId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setParentId(storeOrderProductEntity.getParentId()); + } + storeOrderProduct.setBusNo(entity.getNo()); + storeOrderProduct.setBusMode(entity.getBusMode()); + storeOrderProduct.setProgramId(programId); + storeOrderProduct.setStoreId(entity.getStoreId()); + storeOrderProduct.setStoreNo(entity.getStoreName()); + storeOrderProduct.setStoreName(entity.getStoreName()); + storeOrderProduct.setTableNo(entity.getTableNo()); + storeOrderProduct.setTableName(entity.getTableName()); + //if (storeOrderProductEntity.getProductId() == null || "".equals(storeOrderProductEntity.getProductId()) || storeOrderProductEntity.getProductId().length() > 18 || Long.parseLong(storeOrderProductEntity.getProductId()) < 0) { + //去掉18位限制条件;2020-02-29-13:08 + if (storeOrderProductEntity.getProductId() == null || "".equals(storeOrderProductEntity.getProductId()) || Long.parseLong(storeOrderProductEntity.getProductId()) < 0) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductId(storeOrderProductEntity.getProductId()); + } + if (storeOrderProductEntity.getProductNo() != null && storeOrderProductEntity.getProductNo().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductNo(storeOrderProductEntity.getProductNo()); + } + if (storeOrderProductEntity.getProductName() == null || "".equals(storeOrderProductEntity.getProductName()) || storeOrderProductEntity.getProductName().length() > 128) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductName(storeOrderProductEntity.getProductName()); + } + if (storeOrderProductEntity.getProductUnitId() != null && storeOrderProductEntity.getProductUnitId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductUnitId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductUnitId(storeOrderProductEntity.getProductUnitId()); + } + if (storeOrderProductEntity.getProductUnitName() != null && storeOrderProductEntity.getProductUnitName().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductUnitName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductUnitName(storeOrderProductEntity.getProductUnitName()); + } + if (storeOrderProductEntity.getProductImageUrl() != null && storeOrderProductEntity.getProductImageUrl().length() > 256) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductImageUrl参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductImageUrl(storeOrderProductEntity.getProductImageUrl()); + } + if (storeOrderProductEntity.getTypeId() != null && storeOrderProductEntity.getTypeId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录TypeId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setTypeId(storeOrderProductEntity.getTypeId()); + } + if (storeOrderProductEntity.getSeriesId() != null && storeOrderProductEntity.getSeriesId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SeriesId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSeriesId(storeOrderProductEntity.getSeriesId()); + } + if (storeOrderProductEntity.getSeriesName() != null && storeOrderProductEntity.getSeriesName().length() > 64) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SeriesName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSeriesName(storeOrderProductEntity.getSeriesName()); + } + if (storeOrderProductEntity.getTypePath() != null && storeOrderProductEntity.getTypePath().length() > 256) { + response.setStatus(0); + response.setMessage("门店菜品销售记录TypePath参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setTypePath(storeOrderProductEntity.getTypePath()); + } + if (storeOrderProductEntity.getTypeName() != null && storeOrderProductEntity.getTypeName().length() > 64) { + response.setStatus(0); + response.setMessage("门店菜品销售记录TypeName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setTypeName(storeOrderProductEntity.getTypeName()); + } + if (storeOrderProductEntity.getSpecId() != null && storeOrderProductEntity.getSpecId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SpecId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSpecId(storeOrderProductEntity.getSpecId()); + } + if (storeOrderProductEntity.getSpecName() != null && storeOrderProductEntity.getSpecName().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SpecName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSpecName(storeOrderProductEntity.getSpecName()); + } + storeOrderProduct.setCount(storeOrderProductEntity.getCount()); + storeOrderProduct.setRcount(storeOrderProductEntity.getRcount()); + storeOrderProduct.setPrice(storeOrderProductEntity.getPrice()); + storeOrderProduct.setDiscountPrice(storeOrderProductEntity.getDiscountPrice()); + storeOrderProduct.setPriceOrg(storeOrderProductEntity.getPriceOrg()); + storeOrderProduct.setIsSuit(storeOrderProductEntity.getIsSuit()); + if (storeOrderProductEntity.getSuitId() != null && storeOrderProductEntity.getSuitId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SuitId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSuitId(storeOrderProductEntity.getSuitId()); + } + if (storeOrderProductEntity.getSuitId() != null && storeOrderProductEntity.getSuitId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SuitId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSuitId(storeOrderProductEntity.getSuitId()); + } + storeOrderProduct.setSaleDate(entity.getSaleDate());// 订单时间和销售时间一致 + storeOrderProduct.setAmount(storeOrderProductEntity.getAmount()); + storeOrderProduct.setDiscount(storeOrderProductEntity.getDiscount()); + storeOrderProduct.setDiscountTotal(storeOrderProductEntity.getDiscountTotal()); + storeOrderProduct.setReceivable(storeOrderProductEntity.getReceivable()); + storeOrderProduct.setAddPriceTotal(storeOrderProductEntity.getAddPriceTotal()); + storeOrderProduct.setDiscountAddTotal(storeOrderProductEntity.getDiscountAddTotal()); + storeOrderProduct.setAmountAddTotal(storeOrderProductEntity.getAmountAddTotal()); + storeOrderProduct.setAmountTotal(storeOrderProductEntity.getAmountTotal()); + storeOrderProduct.setReceivableTotal(storeOrderProductEntity.getReceivableTotal()); + storeOrderProduct.setPackageFee(storeOrderProductEntity.getPackageFee()); + storeOrderProduct.setIsMember(storeBusinessTicket.getIsMember()); + storeOrderProduct.setMemberNo(storeBusinessTicket.getMemberNo()); + lineNo++; + storeOrderProduct.setSeqNo(storeBusinessTicket.getSeqNo());// 当日流水号 + storeOrderProduct.setWeather(storeBusinessTicket.getWeather());// 天气 + storeOrderProduct.setWeeker(storeBusinessTicket.getWeeker());// 星期 + storeOrderProduct.setLineNo(storeOrderProductEntity.getLineNo() == null ? lineNo : storeOrderProductEntity.getLineNo());// 行号 + orderProductList.add(storeOrderProduct); + List storeOrderProductInfoEntityList = storeOrderProductEntity.getProductInfo(); + // 门店菜品销售记录优惠明细校验开始 + if (storeOrderProductInfoEntityList != null && storeOrderProductInfoEntityList.size() > 0) { + for (ProgramStoreOrderProductInfoEntity storeOrderProductInfoEntity : storeOrderProductInfoEntityList) { + ProgramStoreOrderProductInfo storeOrderProductInfo = new ProgramStoreOrderProductInfo(); + storeOrderProductInfo.setCreateDate(createDate); + storeOrderProductInfo.setCreateUser("open-api"); + storeOrderProductInfo.setProgramId(programId); + if (storeOrderProductInfoEntity.getClientId() == null || "".equals(storeOrderProductInfoEntity.getClientId()) || storeOrderProductInfoEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("销售单记录优惠ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductInfo.setClientId(storeOrderProductInfoEntity.getClientId()); + } + + if (storeOrderProductInfoEntity.getOrderItemId() != null && storeOrderProductInfoEntity.getOrderItemId().length() > 64) { + response.setStatus(0); + response.setMessage("销售单记录优惠OrderItemId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductInfo.setOrderItemId(storeOrderProductInfoEntity.getOrderItemId()); + } + storeOrderProductInfo.setStoreId(entity.getStoreId()); + storeOrderProductInfo.setBusNo(entity.getNo()); + storeOrderProductInfo.setType(storeOrderProductInfoEntity.getType()); + if (storeOrderProductInfoEntity.getInfo() != null && storeOrderProductInfoEntity.getInfo().length() > 256) { + response.setStatus(0); + response.setMessage("销售单优惠记录Info参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductInfo.setInfo(storeOrderProductInfoEntity.getInfo()); + } + storeOrderProductInfo.setDiscountMoney(storeOrderProductInfoEntity.getDiscountMoney()); + storeOrderProductInfo.setSaleDate(entity.getSaleDate()); + orderProductInfoList.add(storeOrderProductInfo); + } + } + + List storeOrderProductMakeEntityList = storeOrderProductEntity.getProductMake(); + // 门店菜品做法明细校验开始 + if (storeOrderProductMakeEntityList != null && storeOrderProductMakeEntityList.size() > 0) { + for (ProgramStoreOrderProductMakeEntity storeOrderProductMakeEntity : storeOrderProductMakeEntityList) { + ProgramStoreOrderProductMake storeOrderProductMake = new ProgramStoreOrderProductMake(); + storeOrderProductMake.setCreateDate(createDate); + storeOrderProductMake.setCreateUser("open-api"); + storeOrderProductMake.setProgramId(programId); + if (storeOrderProductMakeEntity.getClientId() == null || "".equals(storeOrderProductMakeEntity.getClientId()) || storeOrderProductMakeEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("菜品做法ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductMake.setClientId(storeOrderProductMakeEntity.getClientId()); + } + if (storeOrderProductMakeEntity.getOrderItemId() != null && storeOrderProductMakeEntity.getOrderItemId().length() > 64) { + response.setStatus(0); + response.setMessage("菜品做法OrderItemId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductMake.setOrderItemId(storeOrderProductMakeEntity.getOrderItemId()); + } + storeOrderProductMake.setStoreId(entity.getStoreId()); + storeOrderProductMake.setStoreNo(entity.getStoreNo()); + storeOrderProductMake.setStoreName(entity.getStoreName()); + storeOrderProductMake.setBusNo(entity.getNo()); + if (storeOrderProductMakeEntity.getMakeId() != null && storeOrderProductMakeEntity.getMakeId().length() > 32) { + response.setStatus(0); + response.setMessage("菜品做法makeId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductMake.setMakeId(storeOrderProductMakeEntity.getMakeId()); + } + if (storeOrderProductMakeEntity.getMakeName() != null && storeOrderProductMakeEntity.getMakeName().length() > 32) { + response.setStatus(0); + response.setMessage("菜品做法makeName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductMake.setMakeName(storeOrderProductMakeEntity.getMakeName()); + } + storeOrderProductMake.setAddPrice(storeOrderProductMakeEntity.getAddPrice()); + storeOrderProductMake.setDiscountPrice(storeOrderProductMakeEntity.getDiscountPrice()); + storeOrderProductMake.setCount(storeOrderProductMakeEntity.getCount()); + storeOrderProductMake.setRcount(storeOrderProductMakeEntity.getRcount()); + storeOrderProductMake.setAddTotal(storeOrderProductMakeEntity.getAddTotal()); + storeOrderProductMake.setDiscountAddTotal(storeOrderProductMakeEntity.getDiscountAddTotal()); + storeOrderProductMake.setDiscount(storeOrderProductMakeEntity.getDiscount()); + storeOrderProductMake.setQtyFlag(storeOrderProductMakeEntity.getQtyFlag()); + storeOrderProductMake.setHand(0); + storeOrderProductMake.setSaleDate(entity.getSaleDate()); + makeList.add(storeOrderProductMake); + } + } + } + ProgramBusinessOrderUpload businessOrderUpload = new ProgramBusinessOrderUpload(); + businessOrderUpload.setTicket(storeBusinessTicket); + if(storeBusinessTicketDeliver != null && storeBusinessTicketDeliver.getStoreId() != null){ + businessOrderUpload.setTicketDeliver(storeBusinessTicketDeliver); + }else{ + businessOrderUpload.setTicketDeliver(null); + } + businessOrderUpload.setTicketInfos(ticketInfoList); + businessOrderUpload.setProducts(orderProductList); + businessOrderUpload.setProductInfos(orderProductInfoList); + businessOrderUpload.setMakes(makeList); + StoreBusinessTicketCheck ticketCheck = programStoreBusinessTicketService.saveBusinessTicket(tenantId, businessOrderUpload); + if ("1".equals(ticketCheck.getStatus())) { + Map data = new HashMap<>(); + data.put("busNo", storeBusinessTicket.getNo()); + data.put("ticketId", ticketCheck.getTicketId()); + response.setStatus(1); + response.setMessage("订单创建成功"); + response.setData(data); + + // 启动定时任务,120分钟订单不支付,订单状态改成已取消 + Map eventDatas = new HashMap<>(); + eventDatas.put("tenantId", tenantId); + eventDatas.put("storeId", entity.getStoreId()); + eventDatas.put("storeNo", entity.getStoreNo()); + eventDatas.put("busNo", entity.getNo()); + eventBus.notify(EventKeys.PROGRAM_ORDER_NO_PAID_AUTO_CANCEL, Event.wrap(eventDatas)); + } else { + response.setStatus(0); + response.setMessage("订单创建失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + logger.error("jsonString:" + jsonString); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "program.order.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "订单查询") + @Override + public Object ProgramOrderList(ProgramOrderListRequest request) { + String info = "订单查询"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String programId = request.getProgramId(); + String openId = request.getOpenId(); + int status = request.getStatus(); + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + // 收银机端专用 + String mobile = request.getMobile(); + String seqNo = request.getSeqNo(); + String startTime = request.getStartTime(); + String endTime = request.getEndTime(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("programId", programId)); + criteria.add(Restrictions.eq("openId", openId)); + if (StringUtils.isNotEmpty(mobile)) { + criteria.add(Restrictions.eq("mobile", mobile)); + } + if (StringUtils.isNotEmpty(seqNo)) { + criteria.add(Restrictions.like("seqNo", "%" + seqNo + "%")); + } + if (StringUtils.isNotEmpty(startTime)) { + criteria.add(Restrictions.ge("createDate", startTime)); + } + if (StringUtils.isNotEmpty(endTime)) { + criteria.add(Restrictions.le("createDate", endTime)); + } + criteria.add(Restrictions.order("createDate", "DESC")); + if (status == 1) { + criteria.add(Restrictions.eq("status", -1)); + } else if (status == 2) { + List statusList = new ArrayList<>(); + statusList.add(0);// 已接单 + statusList.add(1);// 已确认 + statusList.add(2);// 已配送 + statusList.add(3);// 已取消 + statusList.add(4);// 已完成 + criteria.add(Restrictions.in("status", statusList)); + } + pager = programStoreBusinessTicketService.getPager(tenantId, criteria, pager); + DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (ProgramStoreBusinessTicket programStoreBusinessTicket : source) { + Map map = new HashMap<>(); + map.put("id", programStoreBusinessTicket.getId()); + map.put("tenantId", programStoreBusinessTicket.getTenantId()); + map.put("memberId", programStoreBusinessTicket.getMemberId()); + map.put("openId", programStoreBusinessTicket.getOpenId()); + map.put("sourceType", programStoreBusinessTicket.getSourceType()); + map.put("touxiang", programStoreBusinessTicket.getTouxiang()); + map.put("memberName", programStoreBusinessTicket.getMemberName()); + map.put("mobile", programStoreBusinessTicket.getMobile()); + map.put("no", programStoreBusinessTicket.getNo()); + map.put("storeId", programStoreBusinessTicket.getStoreId()); + map.put("storeNo", programStoreBusinessTicket.getStoreNo()); + map.put("storeName", programStoreBusinessTicket.getStoreName()); + map.put("status", programStoreBusinessTicket.getStatus()); + map.put("deliverStatus", programStoreBusinessTicket.getDeliverStatus()); + map.put("refundStatus", programStoreBusinessTicket.getRefundStatus()); + map.put("saleDate", fmt.format(programStoreBusinessTicket.getSaleDate())); + map.put("tableNo", programStoreBusinessTicket.getTableNo()); + map.put("tableName", programStoreBusinessTicket.getTableName()); + map.put("people", programStoreBusinessTicket.getPeople()); + map.put("busMode", programStoreBusinessTicket.getBusMode()); + map.put("reserveTime", programStoreBusinessTicket.getReserveTime()); + map.put("deliverFee", programStoreBusinessTicket.getDeliverFee()); + map.put("packageFee", programStoreBusinessTicket.getPackageFee()); + map.put("amount", programStoreBusinessTicket.getAmount()); + map.put("discount", programStoreBusinessTicket.getDiscount()); + map.put("discountTotal", programStoreBusinessTicket.getDiscountTotal()); + map.put("receivable", programStoreBusinessTicket.getReceivable()); + map.put("maling", programStoreBusinessTicket.getMaling()); + map.put("paid", programStoreBusinessTicket.getPaid()); + map.put("noOrg", programStoreBusinessTicket.getNoOrg()); + map.put("backCause", programStoreBusinessTicket.getBackCause()); + map.put("isMember", programStoreBusinessTicket.getIsMember()); + map.put("memberNo", programStoreBusinessTicket.getMemberNo()); + map.put("memberJifen", programStoreBusinessTicket.getMemberJifen()); + map.put("seqNo", programStoreBusinessTicket.getSeqNo()); + map.put("weather", programStoreBusinessTicket.getWeather()); + map.put("weeker", programStoreBusinessTicket.getWeeker()); + map.put("ext1", programStoreBusinessTicket.getExt1()); + map.put("ext2", programStoreBusinessTicket.getExt2()); + criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketId", programStoreBusinessTicket.getId())); + criteria.add(Restrictions.eq("programId", programId)); + // 获取订单商品信息 + List orderProductList = programStoreOrderProductService.getList(tenantId, criteria); + List> orderProduct = new ArrayList<>(); + for (ProgramStoreOrderProduct item : orderProductList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("clientId", item.getClientId()); + itemMap.put("parentId", item.getParentId()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("productId", item.getProductId()); + itemMap.put("productNo", item.getProductNo()); + itemMap.put("productName", item.getProductName()); + itemMap.put("productUnitId", item.getProductUnitId()); + itemMap.put("productUnitName", item.getProductUnitName()); + itemMap.put("productImageUrl", item.getProductImageUrl()); + itemMap.put("seriesId", item.getSeriesId()); + itemMap.put("seriesName", item.getSeriesName()); + itemMap.put("typePath", item.getTypePath()); + itemMap.put("typeId", item.getTypeId()); + itemMap.put("typeName", item.getTypeName()); + itemMap.put("specId", item.getSpecId()); + itemMap.put("specName", item.getSpecName()); + itemMap.put("count", item.getCount()); + itemMap.put("rcount", item.getRcount()); + itemMap.put("price", item.getPrice()); + itemMap.put("priceOrg", item.getPriceOrg()); + itemMap.put("discountPrice", item.getDiscountPrice()); + itemMap.put("isSuit", item.getIsSuit()); + itemMap.put("suitId", item.getSuitId()); + itemMap.put("amount", item.getAmount()); + itemMap.put("discount", item.getDiscount()); + itemMap.put("discountTotal", item.getDiscountTotal()); + itemMap.put("receivable", item.getReceivable()); + itemMap.put("addPriceTotal", item.getAddPriceTotal()); + itemMap.put("discountAddTotal", item.getDiscountAddTotal()); + itemMap.put("amountAddTotal", item.getAmountAddTotal()); + itemMap.put("amountTotal", item.getAmountTotal()); + itemMap.put("receivableTotal", item.getReceivableTotal()); + itemMap.put("lineNo", item.getLineNo()); + itemMap.put("seqNo", item.getSeqNo()); + orderProduct.add(itemMap); + } + map.put("orderProduct", orderProduct); + // 获取产品做法信息 + List makeList = programStoreOrderProductMakeService.getList(tenantId, criteria); + List> makeInfo = new ArrayList<>(); + for (ProgramStoreOrderProductMake item : makeList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("orderItemId", item.getOrderItemId()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("busNo", item.getBusNo()); + itemMap.put("makeId", item.getMakeId()); + itemMap.put("makeName", item.getMakeName()); + itemMap.put("addPrice", item.getAddPrice()); + itemMap.put("discountPrice", item.getDiscountPrice()); + itemMap.put("count", item.getCount()); + itemMap.put("rcount", item.getRcount()); + itemMap.put("addTotal", item.getAddTotal()); + itemMap.put("discountAddTotal", item.getDiscountAddTotal()); + itemMap.put("discount", item.getDiscount()); + itemMap.put("qtyFlag", item.getQtyFlag()); + itemMap.put("hand", item.getHand()); + makeInfo.add(itemMap); + } + map.put("makeInfo", makeInfo); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "program.order.detail", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "订单详情") + @Override + public Object ProgramOrderDetail(ProgramOrderDetailRequest request) { + String info = "订单详情"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String programId = request.getProgramId(); + String openId = request.getOpenId();// 来源标识 + String tradeNo = request.getTradeNo(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("no", tradeNo)); + criteria.add(Restrictions.eq("openId", openId)); + criteria.add(Restrictions.eq("programId", programId)); + List ticketList = programStoreBusinessTicketService.getList(tenantId, criteria); + DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + if (CollectionUtils.isNotEmpty(ticketList)) { + ProgramStoreBusinessTicket programStoreBusinessTicket = ticketList.get(0); + Map map = new HashMap<>(); + map.put("id", programStoreBusinessTicket.getId()); + map.put("tenantId", programStoreBusinessTicket.getTenantId()); + map.put("memberId", programStoreBusinessTicket.getMemberId()); + map.put("openId", programStoreBusinessTicket.getOpenId()); + map.put("sourceType", programStoreBusinessTicket.getSourceType()); + map.put("touxiang", programStoreBusinessTicket.getTouxiang()); + map.put("memberName", programStoreBusinessTicket.getMemberName()); + map.put("mobile", programStoreBusinessTicket.getMobile()); + map.put("no", programStoreBusinessTicket.getNo()); + map.put("storeId", programStoreBusinessTicket.getStoreId()); + map.put("storeNo", programStoreBusinessTicket.getStoreNo()); + map.put("storeName", programStoreBusinessTicket.getStoreName()); + map.put("status", programStoreBusinessTicket.getStatus()); + map.put("deliverStatus", programStoreBusinessTicket.getDeliverStatus()); + map.put("refundStatus", programStoreBusinessTicket.getRefundStatus()); + map.put("saleDate", fmt.format(programStoreBusinessTicket.getSaleDate())); + map.put("tableNo", programStoreBusinessTicket.getTableNo()); + map.put("tableName", programStoreBusinessTicket.getTableName()); + map.put("people", programStoreBusinessTicket.getPeople()); + map.put("busMode", programStoreBusinessTicket.getBusMode()); + map.put("reserveTime", programStoreBusinessTicket.getReserveTime()); + map.put("deliverFee", programStoreBusinessTicket.getDeliverFee()); + map.put("packageFee", programStoreBusinessTicket.getPackageFee()); + map.put("amount", programStoreBusinessTicket.getAmount()); + map.put("discount", programStoreBusinessTicket.getDiscount()); + map.put("discountTotal", programStoreBusinessTicket.getDiscountTotal()); + map.put("receivable", programStoreBusinessTicket.getReceivable()); + map.put("maling", programStoreBusinessTicket.getMaling()); + map.put("paid", programStoreBusinessTicket.getPaid()); + map.put("noOrg", programStoreBusinessTicket.getNoOrg()); + map.put("backCause", programStoreBusinessTicket.getBackCause()); + map.put("isMember", programStoreBusinessTicket.getIsMember()); + map.put("memberNo", programStoreBusinessTicket.getMemberNo()); + map.put("memberJifen", programStoreBusinessTicket.getMemberJifen()); + map.put("seqNo", programStoreBusinessTicket.getSeqNo()); + map.put("weather", programStoreBusinessTicket.getWeather()); + map.put("weeker", programStoreBusinessTicket.getWeeker()); + map.put("ext1", programStoreBusinessTicket.getExt1()); + map.put("ext2", programStoreBusinessTicket.getExt2()); + criteria = new Criteria(); + criteria.add(Restrictions.eq("programId", programId)); + criteria.add(Restrictions.eq("storeId", programStoreBusinessTicket.getStoreId())); + List programStoreList = programStoreService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(programStoreList)) { + response.setStatus(0); + response.setMessage("门店信息不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ProgramStore programStore = programStoreList.get(0); + map.put("address", programStore.getAddress()); + criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketId", programStoreBusinessTicket.getId())); + criteria.add(Restrictions.eq("programId", programId)); + // 获取主单优惠 + List ticketInfoList = programStoreBusinessTicketInfoService.getList(tenantId, criteria); + List> ticketInfo = new ArrayList<>(); + for (ProgramStoreBusinessTicketInfo item : ticketInfoList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("busNo", item.getBusNo()); + itemMap.put("type", item.getType()); + itemMap.put("info", item.getInfo()); + itemMap.put("discountMoney", item.getDiscountMoney()); + ticketInfo.add(itemMap); + } + map.put("ticketInfo", ticketInfo); + // 获取主单优惠 + List ticketDeliverList = programStoreBusinessTicketDeliverService.getList(tenantId, criteria); + List> ticketDeliver = new ArrayList<>(); + for (ProgramStoreBusinessTicketDeliver item : ticketDeliverList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("busNo", item.getBusNo()); + itemMap.put("orderTel", item.getOrderTel()); + itemMap.put("name", item.getName()); + itemMap.put("address", item.getAddress()); + itemMap.put("latitude", item.getLatitude()); + itemMap.put("longitude", item.getLongitude()); + itemMap.put("deliverType", item.getDeliverType()); + itemMap.put("deliverFee", item.getDeliverFee()); + itemMap.put("logisticsDispatcherMobile", item.getLogisticsDispatcherMobile()); + itemMap.put("logisticsDispatcherName", item.getLogisticsDispatcherName()); + itemMap.put("logisticsReceiptTime", item.getLogisticsReceiptTime()); + itemMap.put("logisticsFetchTime", item.getLogisticsFetchTime()); + itemMap.put("logisticsFinishTime", item.getLogisticsFinishTime()); + ticketDeliver.add(itemMap); + } + map.put("ticketDeliver", ticketDeliver); + // 获取订单商品信息 + List orderProductList = programStoreOrderProductService.getList(tenantId, criteria); + + // 获取商品基础资料信息 + List sepcIds = new ArrayList<>(); + for (ProgramStoreOrderProduct item : orderProductList) { + sepcIds.add(item.getSpecId()); + } + Criteria criteria1 = new Criteria(); + criteria1.add(Restrictions.in("id", sepcIds)); + List specList = productSpecService.getList(tenantId, criteria1); + Map specMap = new HashMap<>(); + for (ProductSpec item : specList) { + specMap.put(item.getId(), item); + } + List> orderProduct = new ArrayList<>(); + for (ProgramStoreOrderProduct item : orderProductList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("clientId", item.getClientId()); + itemMap.put("parentId", item.getParentId()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("productId", item.getProductId()); + itemMap.put("productNo", item.getProductNo()); + itemMap.put("productName", item.getProductName()); + itemMap.put("productUnitId", item.getProductUnitId()); + itemMap.put("productUnitName", item.getProductUnitName()); + itemMap.put("productImageUrl", item.getProductImageUrl()); + itemMap.put("seriesId", item.getSeriesId()); + itemMap.put("seriesName", item.getSeriesName()); + itemMap.put("typePath", item.getTypePath()); + itemMap.put("typeId", item.getTypeId()); + itemMap.put("typeName", item.getTypeName()); + itemMap.put("specId", item.getSpecId()); + itemMap.put("specName", item.getSpecName()); + itemMap.put("count", item.getCount()); + itemMap.put("rcount", item.getRcount()); + itemMap.put("price", item.getPrice()); + itemMap.put("priceOrg", item.getPriceOrg()); + itemMap.put("discountPrice", item.getDiscountPrice()); + itemMap.put("isSuit", item.getIsSuit()); + itemMap.put("suitId", item.getSuitId()); + itemMap.put("amount", item.getAmount()); + itemMap.put("discount", item.getDiscount()); + itemMap.put("discountTotal", item.getDiscountTotal()); + itemMap.put("receivable", item.getReceivable()); + itemMap.put("addPriceTotal", item.getAddPriceTotal()); + itemMap.put("discountAddTotal", item.getDiscountAddTotal()); + itemMap.put("amountAddTotal", item.getAmountAddTotal()); + itemMap.put("amountTotal", item.getAmountTotal()); + itemMap.put("receivableTotal", item.getReceivableTotal()); + itemMap.put("packageFee", item.getPackageFee()); + itemMap.put("lineNo", item.getLineNo()); + itemMap.put("seqNo", item.getSeqNo()); + itemMap.put("basePackageFee", specMap.get(item.getSpecId()).getBoxPrice()); + orderProduct.add(itemMap); + } + map.put("orderProduct", orderProduct); + // 获取产品优惠信息 + List orderProductInfoList = programStoreOrderProductInfoService.getList(tenantId, criteria); + List> orderProductInfo = new ArrayList<>(); + for (ProgramStoreOrderProductInfo item : orderProductInfoList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("orderItemId", item.getOrderItemId()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("type", item.getType()); + itemMap.put("info", item.getInfo()); + itemMap.put("discountMoney", item.getDiscountMoney()); + orderProductInfo.add(itemMap); + } + map.put("orderProductInfo", orderProductInfo); + // 获取产品做法信息 + List makeList = programStoreOrderProductMakeService.getList(tenantId, criteria); + List> makeInfo = new ArrayList<>(); + for (ProgramStoreOrderProductMake item : makeList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("orderItemId", item.getOrderItemId()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("busNo", item.getBusNo()); + itemMap.put("makeId", item.getMakeId()); + itemMap.put("makeName", item.getMakeName()); + itemMap.put("addPrice", item.getAddPrice()); + itemMap.put("discountPrice", item.getDiscountPrice()); + itemMap.put("count", item.getCount()); + itemMap.put("rcount", item.getRcount()); + itemMap.put("addTotal", item.getAddTotal()); + itemMap.put("discountAddTotal", item.getDiscountAddTotal()); + itemMap.put("discount", item.getDiscount()); + itemMap.put("qtyFlag", item.getQtyFlag()); + itemMap.put("hand", item.getHand()); + makeInfo.add(itemMap); + } + map.put("makeInfo", makeInfo); + // 获取产品做法信息 + List payList = programStorePayService.getList(tenantId, criteria); + List> payInfo = new ArrayList<>(); + for (ProgramStorePay item : payList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("payNo", item.getPayNo()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("busNo", item.getBusNo()); + itemMap.put("payTypeNo", item.getPayTypeNo()); + itemMap.put("payType", item.getPayType()); + itemMap.put("paid", item.getPaid()); + itemMap.put("payDate", item.getPayDate() == null ? "" : fmt.format(item.getPayDate())); + itemMap.put("rchange", item.getRchange()); + itemMap.put("money", item.getMoney()); + itemMap.put("overAmount", item.getOverAmount()); + itemMap.put("voucherNo", item.getVoucherNo()); + itemMap.put("cardno", item.getCardno()); + itemMap.put("cardYe", item.getCardYe()); + itemMap.put("cardJf", item.getCardJf()); + itemMap.put("incomeFlag", item.getIncomeFlag()); + itemMap.put("otherRateType", item.getOtherRateType()); + itemMap.put("otherRateValue", item.getOtherRateValue()); + itemMap.put("otherRate", item.getOtherRate()); + itemMap.put("payChannel", item.getPayChannel()); + itemMap.put("memo", item.getMemo()); + payInfo.add(itemMap); + } + map.put("payInfo", payInfo); + response.setStatus(1); + response.setMessage("订单获取成功"); + response.setData(map); + } else { + response.setStatus(0); + response.setMessage("订单不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "program.weixin.pay", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "微信点餐-微信统一下单") + @Override + public Object ProgramWeixinPay(ProgramWeixinPayRequest request) { + String info = "微信点餐-微信统一下单"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String programId = request.getProgramId(); + String appId = request.getAppid();// + String openId = request.getOpenId();// 来源标识 + Double amount = request.getAmount();// 充值金额 + String tradeNo = request.getTradeNo(); + CommonDataResponse response = null; + Map data = new HashMap<>(); + try { + response = new CommonDataResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("programId", programId)); + Store store=storeService.find(tenantId,"id",storeId); + + List storeList = programStoreService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(storeList)) { + response.setStatus(0); + response.setMessage("erp门店不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + ProgramStore programStore = storeList.get(0); + if (amount == null) { + response.setStatus(0); + response.setMessage("参数amount不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + BigDecimal payAmount = new BigDecimal(String.valueOf(amount)); + if (payAmount.compareTo(BigDecimal.ZERO) <= 0) { + response.setStatus(0); + response.setMessage("支付金额非法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + List> payParamList = new ArrayList<>(); + + //判断此门店是否启用独立支付参数; + + List parameters = this.programPaymentParameterService.getPaymentParameterByStoreId(tenantId, request.getStoreId()); + for (ProgramPaymentParameter paymentParameter : parameters) { + Map map = new HashMap<>(); + map.put("tenantId", paymentParameter.getTenantId()); + map.put("id", paymentParameter.getId()); + map.put("no", paymentParameter.getNo()); + map.put("name", paymentParameter.getName()); + map.put("sign", paymentParameter.getSign()); + Map pbodyMap = JSONUtil.parseObject(paymentParameter.getPbody(), new TypeReference>() { + }); + map.put("pbody", pbodyMap); + map.put("certText", paymentParameter.getCertText()); + if (StringUtils.equalsIgnoreCase("saobei", paymentParameter.getSign())) { + payParamList.add(map); + }else if (StringUtils.equalsIgnoreCase("ccb", paymentParameter.getSign())) { + payParamList.add(map); + }else if (StringUtils.equalsIgnoreCase("tonglian", paymentParameter.getSign())) { + payParamList.add(map); + } + } + if(CollectionUtils.isEmpty(payParamList)){ + // 获取支付参数 + List parameterList = this.paymentParameterService.getPaymentParameterByStoreId(tenantId, request.getStoreId()); + for (PaymentParameter paymentParameter : parameterList) { + Map map = new HashMap<>(); + map.put("tenantId", paymentParameter.getTenantId()); + map.put("id", paymentParameter.getId()); + map.put("no", paymentParameter.getNo()); + map.put("name", paymentParameter.getName()); + map.put("sign", paymentParameter.getSign()); + Map pbodyMap = JSONUtil.parseObject(paymentParameter.getPbody(), new TypeReference>() { + }); + map.put("pbody", pbodyMap); + map.put("certText", paymentParameter.getCertText()); + if (StringUtils.equalsIgnoreCase("saobei", paymentParameter.getSign())) { + payParamList.add(map); + }else if (StringUtils.equalsIgnoreCase("ccb", paymentParameter.getSign())) { + payParamList.add(map); + }else if (StringUtils.equalsIgnoreCase("tonglian", paymentParameter.getSign())) { + payParamList.add(map); + } + } + } + + if (CollectionUtils.isEmpty(payParamList)) { + response.setStatus(0); + response.setMessage("尚未配置支付参数"); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + Map payParam = new HashMap(); + payParam = payParamList.get(0); + if (payParam.get("sign").toString().equals("saobei")) { + Map payBoday = (Map) payParam.get("pbody"); + Map paramMap = new LinkedHashMap<>(); + paramMap.put("pay_ver", "100"); + paramMap.put("pay_type", "010"); + paramMap.put("service_id", "015"); + paramMap.put("merchant_no", payBoday.get("merchant_no").toString()); + paramMap.put("terminal_id", payBoday.get("terminal_id").toString()); + paramMap.put("terminal_trace", tradeNo); + paramMap.put("terminal_time", DateUtils.format(new Date(), "yyyyMMddHHmmss")); + paramMap.put("total_fee", RandomUtil.format2(amount * 100).intValue()); + StringBuffer sb = new StringBuffer(); + Set keySet = paramMap.keySet(); + for (String str : keySet) { + sb.append(str + "=" + paramMap.get(str) + "&"); + } + String signKey = "access_token=" + payBoday.get("signKey").toString(); + sb.append(signKey); + String sign = DigestUtils.MD5(sb.toString()).toLowerCase(); + paramMap.put("sub_appid", appId); + paramMap.put("open_id", openId); + paramMap.put("order_body", programStore.getStoreName() + "线上支付"); + paramMap.put("notify_url", saoBeiPayProperties.getApiProgramUrl()); + paramMap.put("attach", tenantId + "_" + storeId + "_" + tradeNo); + paramMap.put("key_sign", sign); + Object json = JSON.toJSON(paramMap); + logger.error("扫呗支付=========>预下单请求参数{}", json); + final HttpResponse res = HttpTool.url(payBoday.get("gatewayUrl").toString() + "pay/100/minipay").contentType("application/json").body(json.toString()).post(); + final String content = HttpTool.getResponseAsString(res); + logger.error("扫呗支付=========>预下单响应参数{}", content); + JSONObject parseObject = JSON.parseObject(content); + String return_code = parseObject.getString("return_code"); + String result_code = parseObject.getString("result_code"); + String return_msg = parseObject.getString("return_msg"); + if (return_code.equals("01") && result_code.equals("01")) { + Map prepay = new HashMap<>(); + prepay.put("appId", parseObject.getString("appId")); + prepay.put("timeStamp", parseObject.getString("timeStamp")); + prepay.put("nonceStr", parseObject.getString("nonceStr")); + prepay.put("package", parseObject.getString("package_str")); + prepay.put("signType", parseObject.getString("signType")); + prepay.put("paySign", parseObject.getString("paySign")); + // 扫呗商户号 + prepay.put("outTradeNo", parseObject.getString("terminal_trace"));// 商户订单号 + prepay.put("saobeiOrderNo", parseObject.getString("out_trade_no"));// 扫呗唯一订单号 + response.setData(prepay); + response.setStatus(1); + response.setMessage("操作成功"); + } else { + response.setStatus(0); + response.setMessage(return_msg); + } + }else if (payParam.get("sign").toString().equals("ccb")) { + //建行支付 + Map payBoday = (Map) payParam.get("pbody"); + Map paramMap = new LinkedHashMap<>(); + paramMap.put("MERCHANTID", payBoday.get("merchantId").toString());// 商户编号 + paramMap.put("POSID", payBoday.get("posId").toString());// 柜台ID + paramMap.put("BRANCHID", payBoday.get("branchId").toString());// 分行ID + paramMap.put("ORDERID", tradeNo);// 订单号 + paramMap.put("PAYMENT", amount);// 支付金额 + paramMap.put("CURCODE", "01");// 币种 + paramMap.put("TXCODE", "530590");// 由建行统一分配为 530590 + paramMap.put("REMARK1", tenantId);// 备注说明(租户编号) + paramMap.put("REMARK2", storeId);// 备注说明(门店编号) + paramMap.put("TYPE", "1");// 防钓鱼接口 + paramMap.put("PUB", payBoday.get("secretKey").toString().substring(payBoday.get("secretKey").toString().length() - 30, payBoday.get("secretKey").toString().length())); + paramMap.put("GATEWAY", "0"); + paramMap.put("CLIENTIP", "127.0.0.1"); + paramMap.put("REGINFO", ""); + paramMap.put("PROINFO", ""); + paramMap.put("REFERER", ""); + paramMap.put("TRADE_TYPE", "MINIPRO");// 小程序支付 + paramMap.put("SUB_APPID", appId);// 小程序APPID + paramMap.put("SUB_OPENID", openId);// 用户子标识 + String mac = getMac(paramMap); + paramMap.put("MAC", mac);// 签名 + HttpResponse httpResponse = HttpTool.url(payBoday.get("wxgateway").toString()).formCCB(paramMap).post(); + String content = HttpTool.getResponseAsString(httpResponse); + JSONObject jsonObject = JSON.parseObject(content); + logger.error(content); + if (StringUtils.isNotBlank(jsonObject.getString("SUCCESS")) && "true".equals(jsonObject.getString("SUCCESS"))) { + String payUrl = jsonObject.getString("PAYURL"); + httpResponse = HttpTool.url(payUrl).post(); + content = HttpTool.getResponseAsString(httpResponse); + logger.error(content); + jsonObject = JSON.parseObject(content); + if (StringUtils.isNotBlank(jsonObject.getString("SUCCESS")) && "true".equals(jsonObject.getString("SUCCESS")) && StringUtils.isNotBlank(jsonObject.getString("ERRCODE")) && "000000".equals(jsonObject.getString("ERRCODE"))) { + data.put("appId", jsonObject.getString("appId"));// 微信分配的 + // APPID + data.put("timeStamp", jsonObject.getString("timeStamp"));// 时间戳 + data.put("nonceStr", jsonObject.getString("nonceStr"));// 随机串 + data.put("package", jsonObject.getString("package"));// 数据包 + data.put("signType", jsonObject.getString("signType"));// 签名方式 + data.put("paySign", jsonObject.getString("paySign"));// 签名数据 + data.put("partnerid", jsonObject.getString("partnerid"));// 子商户的商户号 + data.put("prepayid", jsonObject.getString("prepayid"));// 预支付交易会话ID + data.put("mweb_url", jsonObject.getString("mweb_url"));// 微信 + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + } else { + response.setStatus(0); + response.setMessage(jsonObject.getString("ERRMSG")); + } + } else { + response.setStatus(0); + response.setMessage(jsonObject.getString("ERRMSG")); + } + }else if (payParam.get("sign").toString().equals("tonglian")) { + //通联支付 + String ext1=store.getExt1(); + JSONObject jsone = JSONObject.parseObject(ext1); + String vspCusid=jsone.getString("vspCusid"); + Criteria criteriaa = new Criteria(); + criteriaa.add(Restrictions.eq("storeId", storeId)); + criteriaa.add(Restrictions.eq("busNo", tradeNo)); + logger.info("storeId+busNo:"+storeId+"-"+tenantCode); + List orderProduct=programStoreOrderProductService.getList(tenantId,criteriaa); + String jsont = JSON.toJSONString(orderProduct); + logger.info("小程序产品销售记录jsont:"+jsont); + final HashMap trandetail1 = new HashMap<>(); + for(ProgramStoreOrderProduct product:orderProduct){ + String productId=product.getProductId(); + Double amounttotal=product.getAmountTotal(); + logger.info("amounttotal:"+amounttotal); + BigDecimal btotal=BigDecimal.valueOf(amounttotal); + Criteria criterifa = new Criteria(); + criterifa.add(Restrictions.eq("goodId", productId)); + criterifa.add(Restrictions.eq("storeId", storeId)); + SplitFoodAccount foodAccount=splitFoodAccountService.getList(tenantId,criterifa).get(0); + String shopId=foodAccount.getShopId();//分店id + SplitShopAccount shop=splitShopAccountService.get(tenantId,shopId); + String bizUserId=shop.getBizUserId(); + if(trandetail1.containsKey(bizUserId)) { + BigDecimal bmap= (BigDecimal) trandetail1.get(bizUserId); + BigDecimal amountall=bmap.add(btotal); + trandetail1.put(bizUserId, amountall); + }else{ + trandetail1.put(bizUserId, btotal); + } + } + String trandetail1json = JSON.toJSONString(trandetail1); + logger.info("trandetail1:"+trandetail1json); + + final JSONArray tranlist = new JSONArray(); + BigDecimal b100= BigDecimal.valueOf(100); + for (Map.Entry entry : trandetail1.entrySet()) { + HashMap ttail1 = new HashMap<>(); + ttail1.put("bizUserId", entry.getKey()); + ttail1.put("amount", b100.multiply((BigDecimal) entry.getValue()).intValue()); + tranlist.add(ttail1); + } + BigDecimal a1 = BigDecimal.valueOf(amount); + BigDecimal b1 = BigDecimal.valueOf(100); + BigDecimal result = a1.multiply(b1);// 相乘结果 + int intValue = result.intValue(); + AgentCollectApply param = new AgentCollectApply(); + param.setPayuserid(openId); + param.setReqsn(tradeNo); + param.setAcct(openId); + param.setAmount((long) intValue); + param.setSource("1");// + param.setPaytype("WECHATPAY_MINIPROGRAM_ORG"); + param.setPayuseridtype("weChatMiniProgram"); + param.setVspCusid(vspCusid); + param.setConsumer_ip("10.40.8.35"); + param.setRemark("通联支付"); + param.setBackUrl(tongLianPayProperties.getApiProgramUrl()); + param.setFrontUrl(""); + logger.error("租户编号_门店ID_订单号"+tenantId+"_"+storeId+"_"+tradeNo); + param.setRemark(tenantId+"_"+storeId+"_"+tradeNo); + param.setSubAppid(TlCommonConstants.SUB_APP_ID); + /*final JSONArray tranlist = new JSONArray(); + final HashMap trandetail1 = new HashMap<>(); + trandetail1.put("bizUserId", "ZHTGR_OUT16890642002687211"); + trandetail1.put("amount", intValue); + tranlist.add(trandetail1);*/ + param.setRecieverList(JSON.toJSONString(tranlist)); + param.setLimit_pay("no_credit"); + param.setFee(0L); + String json = JSON.toJSONString(param); + logger.info("通联支付param:"+json); + String content=TlHttpClient.post("order.agentCollectApply", param); + System.out.println("content:"+content); + JSONObject jsonObject = JSON.parseObject(content); + logger.error(content); + if ("10000".equals(jsonObject.getString("code"))&&"OK".equals(jsonObject.getString("subCode"))) { + JSONObject jsonData = JSON.parseObject(jsonObject.getString("data")); + JSONObject perData = JSON.parseObject(jsonData.getString("payInfo")); + System.out.println("perData:"+perData.toJSONString()); + Map prepay = new HashMap<>(); + prepay.put("appId", perData.getString("appId")); + prepay.put("appid", TlCommonConstants.APP_ID); + prepay.put("timeStamp", perData.getString("timeStamp")); + prepay.put("nonceStr", perData.getString("nonceStr")); + prepay.put("package", perData.getString("package")); + prepay.put("signType", perData.getString("signType")); + prepay.put("paySign", perData.getString("paySign")); + prepay.put("outTradeNo", jsonData.getString("bizOrderNo")); + response.setData(prepay); + response.setStatus(1); + response.setMessage("操作成功"); + } else { + response.setStatus(0); + response.setMessage(jsonObject.getString("ERRMSG")); + } + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + public static String getMac(Map form) { + StringBuilder formString = new StringBuilder(); + Iterator> parts = form.entrySet().iterator(); + if (parts.hasNext()) { + Map.Entry entry = parts.next(); + formString.append(URLEncodedUtil.encode(entry.getKey())); + formString.append("="); + formString.append(URLEncodedUtil.encode(entry.getValue().toString())); + while (parts.hasNext()) { + entry = parts.next(); + formString.append("&"); + formString.append(URLEncodedUtil.encode(entry.getKey())); + formString.append("="); + formString.append(URLEncodedUtil.encode(entry.getValue().toString())); + } + } + //System.out.println("http参数-- getMac >>>>>>>" + formString.toString()); + return new Md5Hash(formString.toString()).toHex(); + } + + @ServiceMethod(method = "program.weixin.pay.query", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "微信点餐-微信统一下单") + @Override + public Object ProgramWeixinPayQuery(ProgramWeixinPayQueryRequest request) { + String info = "订单支付状态查询"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String programId = request.getProgramId(); + String tradeNo = request.getTradeNo(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("programId", programId)); + List storeList = programStoreService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(storeList)) { + response.setStatus(0); + response.setMessage("erp门店不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + ProgramStore programStore = storeList.get(0); + if (programStore == null) { + response.setStatus(0); + response.setMessage("erp门店不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + String keysuccess = "programBusNo:" + tenantId + ":" + storeId + ":" + tradeNo; + Object busNoValue = cacheService.get(tenantId, keysuccess); + + if (busNoValue != null && tradeNo.equals(busNoValue.toString().split("_")[0])) { + Map data = new HashMap<>(); + data.put("busNo", tradeNo); + data.put("seqNo", busNoValue.toString().split("_")[1]); + data.put("payType", busNoValue.toString().split("_")[2]); + response.setStatus(1); + response.setMessage("订单支付成功"); + response.setData(data); + } else { + response.setStatus(0); + response.setMessage("未查询到支付成功状态"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + +// @ServiceMethod(method = "program.order.query.bybusno", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "根据订单号获取订单信息") +// @Override +// public Object ProgramOrderQueryByBusNo(ProgramOrderQueryByBusNoRequest request) { +// String info = "根据订单号获取订单信息"; +// logger.info(info); +// String appKey = request.getWopRequestContext().getAppKey(); +// logger.info("appKey=" + appKey); +// AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); +// String tenantCode = appKeyInfo.getTenantCode(); +// String tenantId = tenantCode; +// String storeId = request.getStoreId(); +// String busNo = request.getBusNo(); +// CommonDataResponse response = null; +// try { +// response = new CommonDataResponse(); +// Criteria criteria = new Criteria(); +// criteria.add(Restrictions.eq("no", busNo)); +// criteria.add(Restrictions.eq("storeId", storeId)); +// List ticketList = programStoreBusinessTicketService.getList(tenantId, criteria); +// DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); +// if (CollectionUtils.isNotEmpty(ticketList)) { +// ProgramStoreBusinessTicket programStoreBusinessTicket = ticketList.get(0); +// Map map = new HashMap<>(); +// map.put("id", programStoreBusinessTicket.getId()); +// map.put("tenantId", programStoreBusinessTicket.getTenantId()); +// map.put("memberId", programStoreBusinessTicket.getMemberId()); +// map.put("openId", programStoreBusinessTicket.getOpenId()); +// map.put("sourceType", programStoreBusinessTicket.getSourceType()); +// map.put("touxiang", programStoreBusinessTicket.getTouxiang()); +// map.put("memberName", programStoreBusinessTicket.getMemberName()); +// map.put("mobile", programStoreBusinessTicket.getMobile()); +// map.put("no", programStoreBusinessTicket.getNo()); +// map.put("storeId", programStoreBusinessTicket.getStoreId()); +// map.put("storeNo", programStoreBusinessTicket.getStoreNo()); +// map.put("storeName", programStoreBusinessTicket.getStoreName()); +// map.put("status", programStoreBusinessTicket.getStatus()); +// map.put("deliverStatus", programStoreBusinessTicket.getDeliverStatus()); +// map.put("refundStatus", programStoreBusinessTicket.getRefundStatus()); +// map.put("saleDate", fmt.format(programStoreBusinessTicket.getSaleDate())); +// map.put("tableNo", programStoreBusinessTicket.getTableNo()); +// map.put("tableName", programStoreBusinessTicket.getTableName()); +// map.put("people", programStoreBusinessTicket.getPeople()); +// map.put("busMode", programStoreBusinessTicket.getBusMode()); +// map.put("reserveTime", programStoreBusinessTicket.getReserveTime()); +// map.put("deliverFee", programStoreBusinessTicket.getDeliverFee()); +// map.put("packageFee", programStoreBusinessTicket.getPackageFee()); +// map.put("amount", programStoreBusinessTicket.getAmount()); +// map.put("discount", programStoreBusinessTicket.getDiscount()); +// map.put("discountTotal", programStoreBusinessTicket.getDiscountTotal()); +// map.put("receivable", programStoreBusinessTicket.getReceivable()); +// map.put("maling", programStoreBusinessTicket.getMaling()); +// map.put("paid", programStoreBusinessTicket.getPaid()); +// map.put("noOrg", programStoreBusinessTicket.getNoOrg()); +// map.put("backCause", programStoreBusinessTicket.getBackCause()); +// map.put("isMember", programStoreBusinessTicket.getIsMember()); +// map.put("memberNo", programStoreBusinessTicket.getMemberNo()); +// map.put("memberJifen", programStoreBusinessTicket.getMemberJifen()); +// map.put("seqNo", programStoreBusinessTicket.getSeqNo()); +// map.put("weather", programStoreBusinessTicket.getWeather()); +// map.put("weeker", programStoreBusinessTicket.getWeeker()); +// map.put("ext1", programStoreBusinessTicket.getExt1()); +// map.put("ext2", programStoreBusinessTicket.getExt2()); +// map.put("deductionRate", programStoreBusinessTicket.getDeductionRate()); +// map.put("chargeBack", programStoreBusinessTicket.getChargeBack()); +// +// criteria = new Criteria(); +// criteria.add(Restrictions.eq("ticketId", programStoreBusinessTicket.getId())); +// //criteria.add(Restrictions.eq("storeId", storeId)); +// // 获取主单优惠 +// List ticketInfoList = programStoreBusinessTicketInfoService.getList(tenantId, criteria); +// List> ticketInfo = new ArrayList<>(); +// for (ProgramStoreBusinessTicketInfo item : ticketInfoList) { +// Map itemMap = new HashMap<>(); +// itemMap.put("id", item.getId()); +// itemMap.put("ticketId", item.getTicketId()); +// itemMap.put("busNo", item.getBusNo()); +// itemMap.put("type", item.getType()); +// itemMap.put("info", item.getInfo()); +// itemMap.put("discountMoney", item.getDiscountMoney()); +// ticketInfo.add(itemMap); +// } +// map.put("ticketInfo", ticketInfo); +// // 获取主单优惠 +// List ticketDeliverList = programStoreBusinessTicketDeliverService.getList(tenantId, criteria); +// List> ticketDeliver = new ArrayList<>(); +// for (ProgramStoreBusinessTicketDeliver item : ticketDeliverList) { +// Map itemMap = new HashMap<>(); +// itemMap.put("id", item.getId()); +// itemMap.put("ticketId", item.getTicketId()); +// itemMap.put("busNo", item.getBusNo()); +// itemMap.put("orderTel", item.getOrderTel()); +// itemMap.put("name", item.getName()); +// itemMap.put("address", item.getAddress()); +// itemMap.put("latitude", item.getLatitude()); +// itemMap.put("longitude", item.getLongitude()); +// itemMap.put("deliverType", item.getDeliverType()); +// itemMap.put("deliverFee", item.getDeliverFee()); +// itemMap.put("logisticsDispatcherMobile", item.getLogisticsDispatcherMobile()); +// itemMap.put("logisticsDispatcherName", item.getLogisticsDispatcherName()); +// itemMap.put("logisticsReceiptTime", item.getLogisticsReceiptTime()); +// itemMap.put("logisticsFetchTime", item.getLogisticsFetchTime()); +// itemMap.put("logisticsFinishTime", item.getLogisticsFinishTime()); +// ticketDeliver.add(itemMap); +// } +// map.put("ticketDeliver", ticketDeliver); +// // 获取订单商品信息 +// List orderProductList = programStoreOrderProductService.getList(tenantId, criteria); +// List> orderProduct = new ArrayList<>(); +// for (ProgramStoreOrderProduct item : orderProductList) { +// Map itemMap = new HashMap<>(); +// itemMap.put("id", item.getId()); +// itemMap.put("clientId", item.getClientId()); +// itemMap.put("parentId", item.getParentId()); +// itemMap.put("ticketId", item.getTicketId()); +// itemMap.put("productId", item.getProductId()); +// itemMap.put("productNo", item.getProductNo()); +// itemMap.put("productName", item.getProductName()); +// itemMap.put("productUnitId", item.getProductUnitId()); +// itemMap.put("productUnitName", item.getProductUnitName()); +// itemMap.put("productImageUrl", item.getProductImageUrl()); +// itemMap.put("seriesId", item.getSeriesId()); +// itemMap.put("seriesName", item.getSeriesName()); +// itemMap.put("typePath", item.getTypePath()); +// itemMap.put("typeId", item.getTypeId()); +// itemMap.put("typeName", item.getTypeName()); +// itemMap.put("specId", item.getSpecId()); +// itemMap.put("specName", item.getSpecName()); +// itemMap.put("count", item.getCount()); +// itemMap.put("rcount", item.getRcount()); +// itemMap.put("price", item.getPrice()); +// itemMap.put("priceOrg", item.getPriceOrg()); +// itemMap.put("discountPrice", item.getDiscountPrice()); +// itemMap.put("isSuit", item.getIsSuit()); +// itemMap.put("suitId", item.getSuitId()); +// itemMap.put("amount", item.getAmount()); +// itemMap.put("discount", item.getDiscount()); +// itemMap.put("discountTotal", item.getDiscountTotal()); +// itemMap.put("receivable", item.getReceivable()); +// itemMap.put("addPriceTotal", item.getAddPriceTotal()); +// itemMap.put("discountAddTotal", item.getDiscountAddTotal()); +// itemMap.put("amountAddTotal", item.getAmountAddTotal()); +// itemMap.put("amountTotal", item.getAmountTotal()); +// itemMap.put("receivableTotal", item.getReceivableTotal()); +// itemMap.put("packageFee", item.getPackageFee()); +// itemMap.put("lineNo", item.getLineNo()); +// itemMap.put("seqNo", item.getSeqNo()); +// orderProduct.add(itemMap); +// } +// map.put("orderProduct", orderProduct); +// // 获取产品优惠信息 +// List orderProductInfoList = programStoreOrderProductInfoService.getList(tenantId, criteria); +// List> orderProductInfo = new ArrayList<>(); +// for (ProgramStoreOrderProductInfo item : orderProductInfoList) { +// Map itemMap = new HashMap<>(); +// itemMap.put("id", item.getId()); +// itemMap.put("orderItemId", item.getOrderItemId()); +// itemMap.put("ticketId", item.getTicketId()); +// itemMap.put("type", item.getType()); +// itemMap.put("info", item.getInfo()); +// itemMap.put("discountMoney", item.getDiscountMoney()); +// orderProductInfo.add(itemMap); +// } +// map.put("orderProductInfo", orderProductInfo); +// // 获取产品做法信息 +// List makeList = programStoreOrderProductMakeService.getList(tenantId, criteria); +// List> makeInfo = new ArrayList<>(); +// for (ProgramStoreOrderProductMake item : makeList) { +// Map itemMap = new HashMap<>(); +// itemMap.put("id", item.getId()); +// itemMap.put("orderItemId", item.getOrderItemId()); +// itemMap.put("ticketId", item.getTicketId()); +// itemMap.put("busNo", item.getBusNo()); +// itemMap.put("makeId", item.getMakeId()); +// itemMap.put("makeName", item.getMakeName()); +// itemMap.put("addPrice", item.getAddPrice()); +// itemMap.put("discountPrice", item.getDiscountPrice()); +// itemMap.put("count", item.getCount()); +// itemMap.put("rcount", item.getRcount()); +// itemMap.put("addTotal", item.getAddTotal()); +// itemMap.put("discountAddTotal", item.getDiscountAddTotal()); +// itemMap.put("discount", item.getDiscount()); +// itemMap.put("qtyFlag", item.getQtyFlag()); +// itemMap.put("hand", item.getHand()); +// makeInfo.add(itemMap); +// } +// map.put("makeInfo", makeInfo); +// // 获取产品做法信息 +// List payList = programStorePayService.getList(tenantId, criteria); +// List> payInfo = new ArrayList<>(); +// for (ProgramStorePay item : payList) { +// Map itemMap = new HashMap<>(); +// itemMap.put("id", item.getId()); +// itemMap.put("payNo", item.getPayNo()); +// itemMap.put("ticketId", item.getTicketId()); +// itemMap.put("busNo", item.getBusNo()); +// itemMap.put("payTypeNo", item.getPayTypeNo()); +// itemMap.put("payType", item.getPayType()); +// itemMap.put("paid", item.getPaid()); +// itemMap.put("payDate", item.getPayDate() == null ? "" : fmt.format(item.getPayDate())); +// itemMap.put("rchange", item.getRchange()); +// itemMap.put("money", item.getMoney()); +// itemMap.put("overAmount", item.getOverAmount()); +// itemMap.put("voucherNo", item.getVoucherNo()); +// itemMap.put("cardno", item.getCardno()); +// itemMap.put("cardYe", item.getCardYe()); +// itemMap.put("cardJf", item.getCardJf()); +// itemMap.put("incomeFlag", item.getIncomeFlag()); +// itemMap.put("otherRateType", item.getOtherRateType()); +// itemMap.put("otherRateValue", item.getOtherRateValue()); +// itemMap.put("otherRate", item.getOtherRate()); +// itemMap.put("payChannel", item.getPayChannel()); +// itemMap.put("memo", item.getMemo()); +// itemMap.put("deductionRate", item.getDeductionRate()); +// itemMap.put("chargeBack", item.getChargeBack()); +// itemMap.put("settleFlag", item.getSettleFlag()); +// payInfo.add(itemMap); +// } +// map.put("payInfo", payInfo); +// response.setStatus(1); +// response.setMessage("订单获取成功"); +// response.setData(map); +// } else { +// response.setStatus(0); +// response.setMessage("订单不存在"); +// response.setErrCode(CommonErrorCode.error998.getCode()); +// response.setErrMessage(CommonErrorCode.error998.getMessage()); +// return response; +// } +// } catch (Exception e) { +// logger.error(info + ",发生异常", e); +// return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); +// } +// return response; +// } + + + //TODO 异步方法获取数据 + + @ServiceMethod(method = "program.order.query.bybusno", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "根据订单号获取订单信息") + @Override + public Object ProgramOrderQueryByBusNo(ProgramOrderQueryByBusNoRequest request) { + String info = "根据订单号获取订单信息"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String busNo = request.getBusNo(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Criteria criteri = new Criteria(); + criteri.add(Restrictions.eq("no", busNo)); + criteri.add(Restrictions.eq("storeId", storeId)); + List ticketList = programStoreBusinessTicketService.getList(tenantId, criteri); + DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + if (CollectionUtils.isNotEmpty(ticketList)) { + ProgramStoreBusinessTicket programStoreBusinessTicket = ticketList.get(0); + Map map = new HashMap<>(); + map.put("id", programStoreBusinessTicket.getId()); + map.put("tenantId", programStoreBusinessTicket.getTenantId()); + map.put("memberId", programStoreBusinessTicket.getMemberId()); + map.put("openId", programStoreBusinessTicket.getOpenId()); + map.put("sourceType", programStoreBusinessTicket.getSourceType()); + map.put("touxiang", programStoreBusinessTicket.getTouxiang()); + map.put("memberName", programStoreBusinessTicket.getMemberName()); + map.put("mobile", programStoreBusinessTicket.getMobile()); + map.put("no", programStoreBusinessTicket.getNo()); + map.put("storeId", programStoreBusinessTicket.getStoreId()); + map.put("storeNo", programStoreBusinessTicket.getStoreNo()); + map.put("storeName", programStoreBusinessTicket.getStoreName()); + map.put("status", programStoreBusinessTicket.getStatus()); + map.put("deliverStatus", programStoreBusinessTicket.getDeliverStatus()); + map.put("refundStatus", programStoreBusinessTicket.getRefundStatus()); + map.put("saleDate", fmt.format(programStoreBusinessTicket.getSaleDate())); + map.put("tableNo", programStoreBusinessTicket.getTableNo()); + map.put("tableName", programStoreBusinessTicket.getTableName()); + map.put("people", programStoreBusinessTicket.getPeople()); + map.put("busMode", programStoreBusinessTicket.getBusMode()); + map.put("reserveTime", programStoreBusinessTicket.getReserveTime()); + map.put("deliverFee", programStoreBusinessTicket.getDeliverFee()); + map.put("packageFee", programStoreBusinessTicket.getPackageFee()); + map.put("amount", programStoreBusinessTicket.getAmount()); + map.put("discount", programStoreBusinessTicket.getDiscount()); + map.put("discountTotal", programStoreBusinessTicket.getDiscountTotal()); + map.put("receivable", programStoreBusinessTicket.getReceivable()); + map.put("maling", programStoreBusinessTicket.getMaling()); + map.put("paid", programStoreBusinessTicket.getPaid()); + map.put("noOrg", programStoreBusinessTicket.getNoOrg()); + map.put("backCause", programStoreBusinessTicket.getBackCause()); + map.put("isMember", programStoreBusinessTicket.getIsMember()); + map.put("memberNo", programStoreBusinessTicket.getMemberNo()); + map.put("memberJifen", programStoreBusinessTicket.getMemberJifen()); + map.put("seqNo", programStoreBusinessTicket.getSeqNo()); + map.put("weather", programStoreBusinessTicket.getWeather()); + map.put("weeker", programStoreBusinessTicket.getWeeker()); + map.put("ext1", programStoreBusinessTicket.getExt1()); + map.put("ext2", programStoreBusinessTicket.getExt2()); + map.put("deductionRate", programStoreBusinessTicket.getDeductionRate()); + map.put("chargeBack", programStoreBusinessTicket.getChargeBack()); + + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketId", programStoreBusinessTicket.getId())); + + String result = CompletableFuture.supplyAsync(()->{ + try{ + // 获取主单优惠 + List ticketInfoList = programStoreBusinessTicketInfoService.getList(tenantId, criteria); + List> ticketInfo = new ArrayList<>(); + for (ProgramStoreBusinessTicketInfo item : ticketInfoList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("busNo", item.getBusNo()); + itemMap.put("type", item.getType()); + itemMap.put("info", item.getInfo()); + itemMap.put("discountMoney", item.getDiscountMoney()); + ticketInfo.add(itemMap); + } + map.put("ticketInfo", ticketInfo); + + // 获取配送信息 + List ticketDeliverList = programStoreBusinessTicketDeliverService.getList(tenantId, criteria); + List> ticketDeliver = new ArrayList<>(); + for (ProgramStoreBusinessTicketDeliver item : ticketDeliverList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("busNo", item.getBusNo()); + itemMap.put("orderTel", item.getOrderTel()); + itemMap.put("name", item.getName()); + itemMap.put("address", item.getAddress()); + itemMap.put("latitude", item.getLatitude()); + itemMap.put("longitude", item.getLongitude()); + itemMap.put("deliverType", item.getDeliverType()); + itemMap.put("deliverFee", item.getDeliverFee()); + itemMap.put("logisticsDispatcherMobile", item.getLogisticsDispatcherMobile()); + itemMap.put("logisticsDispatcherName", item.getLogisticsDispatcherName()); + itemMap.put("logisticsReceiptTime", item.getLogisticsReceiptTime()); + itemMap.put("logisticsFetchTime", item.getLogisticsFetchTime()); + itemMap.put("logisticsFinishTime", item.getLogisticsFinishTime()); + ticketDeliver.add(itemMap); + } + map.put("ticketDeliver", ticketDeliver); + }catch (Exception e){ + logger.error(info + ",获取主单优惠、配送信息,发生异常", e); + return "error"; + } + return "ok"; + }).thenCombine(CompletableFuture.supplyAsync(()->{ + try{ + // 获取订单商品信息 + List orderProductList = programStoreOrderProductService.getList(tenantId, criteria); + List> orderProduct = new ArrayList<>(); + for (ProgramStoreOrderProduct item : orderProductList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("clientId", item.getClientId()); + itemMap.put("parentId", item.getParentId()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("productId", item.getProductId()); + itemMap.put("productNo", item.getProductNo()); + itemMap.put("productName", item.getProductName()); + itemMap.put("productUnitId", item.getProductUnitId()); + itemMap.put("productUnitName", item.getProductUnitName()); + itemMap.put("productImageUrl", item.getProductImageUrl()); + itemMap.put("seriesId", item.getSeriesId()); + itemMap.put("seriesName", item.getSeriesName()); + itemMap.put("typePath", item.getTypePath()); + itemMap.put("typeId", item.getTypeId()); + itemMap.put("typeName", item.getTypeName()); + itemMap.put("specId", item.getSpecId()); + itemMap.put("specName", item.getSpecName()); + itemMap.put("count", item.getCount()); + itemMap.put("rcount", item.getRcount()); + itemMap.put("price", item.getPrice()); + itemMap.put("priceOrg", item.getPriceOrg()); + itemMap.put("discountPrice", item.getDiscountPrice()); + itemMap.put("isSuit", item.getIsSuit()); + itemMap.put("suitId", item.getSuitId()); + itemMap.put("amount", item.getAmount()); + itemMap.put("discount", item.getDiscount()); + itemMap.put("discountTotal", item.getDiscountTotal()); + itemMap.put("receivable", item.getReceivable()); + itemMap.put("addPriceTotal", item.getAddPriceTotal()); + itemMap.put("discountAddTotal", item.getDiscountAddTotal()); + itemMap.put("amountAddTotal", item.getAmountAddTotal()); + itemMap.put("amountTotal", item.getAmountTotal()); + itemMap.put("receivableTotal", item.getReceivableTotal()); + itemMap.put("packageFee", item.getPackageFee()); + itemMap.put("lineNo", item.getLineNo()); + itemMap.put("seqNo", item.getSeqNo()); + orderProduct.add(itemMap); + } + map.put("orderProduct", orderProduct); + + // 获取产品优惠信息 + List orderProductInfoList = programStoreOrderProductInfoService.getList(tenantId, criteria); + List> orderProductInfo = new ArrayList<>(); + for (ProgramStoreOrderProductInfo item : orderProductInfoList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("orderItemId", item.getOrderItemId()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("type", item.getType()); + itemMap.put("info", item.getInfo()); + itemMap.put("discountMoney", item.getDiscountMoney()); + orderProductInfo.add(itemMap); + } + map.put("orderProductInfo", orderProductInfo); + }catch (Exception e){ + logger.error(info + ",获取订单商品信息、产品优惠信息,发生异常", e); + return "error"; + } + return "ok"; + }),(s1,s2)->{return s1 + " " + s2;}).thenCombine(CompletableFuture.supplyAsync(()->{ + try{ + // 获取产品做法信息 + List makeList = programStoreOrderProductMakeService.getList(tenantId, criteria); + List> makeInfo = new ArrayList<>(); + for (ProgramStoreOrderProductMake item : makeList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("orderItemId", item.getOrderItemId()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("busNo", item.getBusNo()); + itemMap.put("makeId", item.getMakeId()); + itemMap.put("makeName", item.getMakeName()); + itemMap.put("addPrice", item.getAddPrice()); + itemMap.put("discountPrice", item.getDiscountPrice()); + itemMap.put("count", item.getCount()); + itemMap.put("rcount", item.getRcount()); + itemMap.put("addTotal", item.getAddTotal()); + itemMap.put("discountAddTotal", item.getDiscountAddTotal()); + itemMap.put("discount", item.getDiscount()); + itemMap.put("qtyFlag", item.getQtyFlag()); + itemMap.put("hand", item.getHand()); + makeInfo.add(itemMap); + } + map.put("makeInfo", makeInfo); + + // 获取支付信息 + List payList = programStorePayService.getList(tenantId, criteria); + List> payInfo = new ArrayList<>(); + for (ProgramStorePay item : payList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("payNo", item.getPayNo()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("busNo", item.getBusNo()); + itemMap.put("payTypeNo", item.getPayTypeNo()); + itemMap.put("payType", item.getPayType()); + itemMap.put("paid", item.getPaid()); + itemMap.put("payDate", item.getPayDate() == null ? "" : fmt.format(item.getPayDate())); + itemMap.put("rchange", item.getRchange()); + itemMap.put("money", item.getMoney()); + itemMap.put("overAmount", item.getOverAmount()); + itemMap.put("voucherNo", item.getVoucherNo()); + itemMap.put("cardno", item.getCardno()); + itemMap.put("cardYe", item.getCardYe()); + itemMap.put("cardJf", item.getCardJf()); + itemMap.put("incomeFlag", item.getIncomeFlag()); + itemMap.put("otherRateType", item.getOtherRateType()); + itemMap.put("otherRateValue", item.getOtherRateValue()); + itemMap.put("otherRate", item.getOtherRate()); + itemMap.put("payChannel", item.getPayChannel()); + itemMap.put("memo", item.getMemo()); + itemMap.put("deductionRate", item.getDeductionRate()); + itemMap.put("chargeBack", item.getChargeBack()); + itemMap.put("settleFlag", item.getSettleFlag()); + payInfo.add(itemMap); + } + map.put("payInfo", payInfo); + }catch (Exception e){ + logger.error(info + ",获取产品做法信息,支付信息,发生异常", e); + return "error"; + } + return "ok"; + }), (s1,s2)->{ + return s1+s2; + }).exceptionally(e->{ + logger.error(info + ",获取订单明细信息,发生异常", e); + return "error"; + }).join(); + + response.setStatus(1); + response.setMessage("订单获取成功"); + response.setData(map); + } else { + response.setStatus(0); + response.setMessage("订单不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "program.order.confirm", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "小程序订单接单") + @Override + public Object ProgramOrderConfirm(ProgramOrderConfirmRequest request) { + String info = "小程序订单接单"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String busNo = request.getBusNo(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("no", busNo)); + criteria.add(Restrictions.eq("storeId", storeId)); + List ticketList = programStoreBusinessTicketService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(ticketList)) { + response.setStatus(0); + response.setMessage("订单不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ProgramStoreBusinessTicket programStoreBusinessTicket = ticketList.get(0); + + if (programStoreBusinessTicket.getStatus() != 0) { + response.setStatus(0); + response.setMessage("订单状态不合法,订单接单失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + programStoreBusinessTicket.setStatus(1);// 订单已确认 + programStoreBusinessTicketService.update(tenantId, programStoreBusinessTicket); + // 清理MQTT订单待处理订单缓存 + try { + Object meituanOrderIds = cacheService.get(tenantId, "program_" + storeId); + if (meituanOrderIds != null) { + Map orderIds = (Map) cacheService.get(tenantId, "program_" + storeId); + orderIds.remove(String.valueOf(programStoreBusinessTicket.getNo())); + cacheService.set(tenantId, "program_" + storeId, orderIds, 0); + } else { + Map orderIds = new HashMap<>(); + cacheService.set(tenantId, "program_" + storeId, orderIds, 0); + } + } catch (Exception e) { + logger.error(info + "订单状态推送清理缓存失败>>>>>>>>>>"); + } + // 接单成功发送MQTT + sendOrderMessage("cy2", 1, programStoreBusinessTicket.getNo(), programStoreBusinessTicket.getOpenId()); + // 接单发送模板消息 + sendWxTemplement(tenantId, busNo, 1, programStoreBusinessTicket); + // 启动自动完成定时任务,60分钟以后自动完成订单 + Map eventDatas = new HashMap<>(); + eventDatas.put("tenantId", tenantId); + eventDatas.put("storeId", storeId); + eventDatas.put("busNo", busNo); + eventBus.notify(EventKeys.PROGRAM_ORDER_CONFIRM, Event.wrap(eventDatas)); + // 接单完毕更新库存数据 + // 放入消息队列 + Map stockMessage = new HashMap<>(); + stockMessage.put("type", "confirm"); + stockMessage.put("storeId", storeId); + stockMessage.put("busNo", busNo); + CorrelationData correlationData1 = new CorrelationData(UUID.randomUUID().toString()); + this.mqMessageSender.send4programsalestock(tenantId, stockMessage, correlationData1); + logger.error(info + "接单扣减库存发送成功"); + + Map map = new HashMap<>(); + map.put("busNo", busNo); + map.put("storeId", storeId); + response.setStatus(1); + response.setMessage("订单接单成功"); + response.setData(map); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "program.order.cancel", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "小程序订单取消") + @Override + public Object ProgramOrderCancel(ProgramOrderCancelRequest request) { + String info = "小程序订单取消"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String busNo = request.getBusNo(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("no", busNo)); + criteria.add(Restrictions.eq("storeId", storeId)); + List ticketList = programStoreBusinessTicketService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(ticketList)) { + response.setStatus(0); + response.setMessage("订单不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ProgramStoreBusinessTicket programStoreBusinessTicket = ticketList.get(0); + if (programStoreBusinessTicket.getStatus() != 0) { + response.setStatus(0); + response.setMessage("订单状态不合法,拒绝接单失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + // 支付退款操作 + Map refundMap = OrderRefund(tenantId, storeId, programStoreBusinessTicket.getStoreNo(), busNo); + if (Integer.parseInt(refundMap.get("status").toString()) == 0) { + response.setStatus(0); + response.setMessage("拒绝接单失败,支付退款错误"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + programStoreBusinessTicket.setStatus(3);// 订单被取消 + programStoreBusinessTicket.setRefundStatus(4);// 退款已完成 + programStoreBusinessTicketService.update(tenantId, programStoreBusinessTicket); + // 清理MQTT订单待处理订单缓存 + try { + Object meituanOrderIds = cacheService.get(tenantId, "program_" + storeId); + if (meituanOrderIds != null) { + Map orderIds = (Map) cacheService.get(tenantId, "program_" + storeId); + orderIds.remove(String.valueOf(programStoreBusinessTicket.getNo())); + cacheService.set(tenantId, "program_" + storeId, orderIds, 0); + } else { + Map orderIds = new HashMap<>(); + cacheService.set(tenantId, "program_" + storeId, orderIds, 0); + } + } catch (Exception e) { + logger.error(info + "订单状态推送清理缓存失败>>>>>>>>>>"); + } + // 拒单成功发送MQTT + sendOrderMessage("cy2", 0, programStoreBusinessTicket.getNo(), programStoreBusinessTicket.getOpenId()); + // 拒单发送模板消息 + sendWxTemplement(tenantId, busNo, 0, programStoreBusinessTicket); + + Map map = new HashMap<>(); + map.put("busNo", busNo); + map.put("storeId", storeId); + response.setStatus(1); + response.setMessage("订单拒单成功"); + response.setData(map); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "program.order.refundagree", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "小程序订单同意退款") + @Override + public Object ProgramOrderRefundAgree(ProgramOrderRefundAgreeRequest request) { + String info = "小程序订单同意退款"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String busNo = request.getBusNo(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("no", busNo)); + criteria.add(Restrictions.eq("storeId", storeId)); + List ticketList = programStoreBusinessTicketService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(ticketList)) { + response.setStatus(0); + response.setMessage("订单不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ProgramStoreBusinessTicket programStoreBusinessTicket = ticketList.get(0); + if (programStoreBusinessTicket.getRefundStatus() != 1 && programStoreBusinessTicket.getStatus() != 1) { + response.setStatus(0); + response.setMessage("订单状态不合法,同意退款失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + // 支付退款操作 + Map refundMap = TlOrderRefund(tenantId,programStoreBusinessTicket.getOpenId(), storeId, programStoreBusinessTicket.getStoreNo(), busNo); + if (Integer.parseInt(refundMap.get("status").toString()) == 0) { + response.setStatus(0); + response.setMessage("同意退款失败,支付退款错误"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + programStoreBusinessTicket.setStatus(4);// 订单已完成 + programStoreBusinessTicket.setRefundStatus(4);// 同意退款 + programStoreBusinessTicketService.update(tenantId, programStoreBusinessTicket); + // 清理MQTT订单待处理订单缓存 + try { + Object meituanOrderIds = cacheService.get(tenantId, "program_" + storeId); + if (meituanOrderIds != null) { + Map orderIds = (Map) cacheService.get(tenantId, "program_" + storeId); + orderIds.remove(String.valueOf(programStoreBusinessTicket.getNo())); + cacheService.set(tenantId, "program_" + storeId, orderIds, 0); + } else { + Map orderIds = new HashMap<>(); + cacheService.set(tenantId, "program_" + storeId, orderIds, 0); + } + } catch (Exception e) { + logger.error(info + "订单状态推送清理缓存失败>>>>>>>>>>"); + } + // 拒单发送模板消息 + sendWxTemplement(tenantId, busNo, 3, programStoreBusinessTicket); + // 同意退款发送MQTT + sendOrderMessage("cy2", 2, programStoreBusinessTicket.getNo(), programStoreBusinessTicket.getOpenId()); + // 放入消息队列 + Map stockMessage = new HashMap<>(); + stockMessage.put("type", "refundagree"); + stockMessage.put("storeId", storeId); + stockMessage.put("busNo", busNo); + CorrelationData correlationData1 = new CorrelationData(UUID.randomUUID().toString()); + this.mqMessageSender.send4programsalestock(tenantId, stockMessage, correlationData1); + logger.error(info + "退款完成扣减库存发送成功"); + Map map = new HashMap<>(); + map.put("busNo", busNo); + map.put("storeId", storeId); + response.setStatus(1); + response.setMessage("商家同意退款"); + response.setData(map); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "program.order.tlrefundagree", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "小程序通联订单同意退款") + @Override + public Object ProgramOrderTlRefundAgree(ProgramOrderRefundAgreeRequest request) { + String info = "小程序通联订单同意退款"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String busNo = request.getBusNo(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("no", busNo)); + criteria.add(Restrictions.eq("storeId", storeId)); + List ticketList = programStoreBusinessTicketService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(ticketList)) { + response.setStatus(0); + response.setMessage("订单不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ProgramStoreBusinessTicket programStoreBusinessTicket = ticketList.get(0); + Double paid=programStoreBusinessTicket.getPaid();//实收金额 + BigDecimal pidb=BigDecimal.valueOf(paid); + BigDecimal b100=BigDecimal.valueOf(100); + BigDecimal bigDecimal = pidb.multiply(b100).setScale(0, RoundingMode.HALF_UP);; + long pidValue = bigDecimal.longValue(); + String openid=programStoreBusinessTicket.getOpenId(); + String no=programStoreBusinessTicket.getNo(); + + if (programStoreBusinessTicket.getRefundStatus() != 1 && programStoreBusinessTicket.getStatus() != 1) { + response.setStatus(0); + response.setMessage("订单状态不合法,同意退款失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + // 支付退款操作 + Map refundMap = OrderRefund(tenantId, storeId, programStoreBusinessTicket.getStoreNo(), busNo); + if (Integer.parseInt(refundMap.get("status").toString()) == 0) { + response.setStatus(0); + response.setMessage("同意退款失败,支付退款错误"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + programStoreBusinessTicket.setStatus(4);// 订单已完成 + programStoreBusinessTicket.setRefundStatus(4);// 同意退款 + programStoreBusinessTicketService.update(tenantId, programStoreBusinessTicket); + // 清理MQTT订单待处理订单缓存 + try { + Object meituanOrderIds = cacheService.get(tenantId, "program_" + storeId); + if (meituanOrderIds != null) { + Map orderIds = (Map) cacheService.get(tenantId, "program_" + storeId); + orderIds.remove(String.valueOf(programStoreBusinessTicket.getNo())); + cacheService.set(tenantId, "program_" + storeId, orderIds, 0); + } else { + Map orderIds = new HashMap<>(); + cacheService.set(tenantId, "program_" + storeId, orderIds, 0); + } + } catch (Exception e) { + logger.error(info + "订单状态推送清理缓存失败>>>>>>>>>>"); + } + // 拒单发送模板消息 + sendWxTemplement(tenantId, busNo, 3, programStoreBusinessTicket); + // 同意退款发送MQTT + sendOrderMessage("cy2", 2, programStoreBusinessTicket.getNo(), programStoreBusinessTicket.getOpenId()); + // 放入消息队列 + Map stockMessage = new HashMap<>(); + stockMessage.put("type", "refundagree"); + stockMessage.put("storeId", storeId); + stockMessage.put("busNo", busNo); + CorrelationData correlationData1 = new CorrelationData(UUID.randomUUID().toString()); + this.mqMessageSender.send4programsalestock(tenantId, stockMessage, correlationData1); + /*logger.error(info + "退款完成扣减库存发送成功"); + OrderRefund param=new OrderRefund(); + param.setReqsn("po-" + System.currentTimeMillis()); + param.setOldreqsn(no); + param.setPayuserid(openid); + param.setAmount(pidValue+""); + param.setRefundType("D0"); + final JSONArray tranlist = new JSONArray(); + final HashMap trandetail1 = new HashMap<>(); + trandetail1.put("bizUserId", "ZHTQY_OUT16916554874517117"); + trandetail1.put("amount", pidValue); + tranlist.add(trandetail1); + param.setRefundList(JSON.toJSONString(tranlist)); + param.setBackUrl(""); + param.setRemark(""); + logger.info("param:"+param); + String content=TlHttpClient.post("order.orderRefund", param); + logger.info("通联支付退款申请content:"+content); + JSONObject jsonObject = JSON.parseObject(content); + if("success".equals(jsonObject.getString("status"))==false){ + logger.info("商家退款失败:"+content); + response.setStatus(0); + response.setMessage("同意退款失败,支付退款错误"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + }*/ + Map map = new HashMap<>(); + map.put("busNo", busNo); + map.put("storeId", storeId); + response.setStatus(1); + response.setMessage("商家同意退款"); + response.setData(map); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + + @ServiceMethod(method = "program.order.refundreject", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "小程序订单拒绝退款") + @Override + public Object ProgramOrderRefundReject(ProgramOrderRefundRejectRequest request) { + String info = "小程序订单拒绝退款"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String busNo = request.getBusNo(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("no", busNo)); + criteria.add(Restrictions.eq("storeId", storeId)); + List ticketList = programStoreBusinessTicketService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(ticketList)) { + response.setStatus(0); + response.setMessage("订单不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ProgramStoreBusinessTicket programStoreBusinessTicket = ticketList.get(0); + if (programStoreBusinessTicket.getRefundStatus() != 1 && programStoreBusinessTicket.getStatus() != 1) { + response.setStatus(0); + response.setMessage("订单状态不合法,拒绝退款失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + programStoreBusinessTicket.setRefundStatus(2);// 退款被驳回 + programStoreBusinessTicketService.update(tenantId, programStoreBusinessTicket); + // 清理MQTT订单待处理订单缓存 + try { + Object meituanOrderIds = cacheService.get(tenantId, "program_" + storeId); + if (meituanOrderIds != null) { + Map orderIds = (Map) cacheService.get(tenantId, "program_" + storeId); + orderIds.remove(String.valueOf(programStoreBusinessTicket.getNo())); + cacheService.set(tenantId, "program_" + storeId, orderIds, 0); + } else { + Map orderIds = new HashMap<>(); + cacheService.set(tenantId, "program_" + storeId, orderIds, 0); + } + } catch (Exception e) { + logger.error(info + "订单状态推送清理缓存失败>>>>>>>>>>"); + } + // 同意退款发送MQTT + sendOrderMessage("cy2", 3, programStoreBusinessTicket.getNo(), programStoreBusinessTicket.getOpenId()); + + Map map = new HashMap<>(); + map.put("busNo", busNo); + map.put("storeId", storeId); + response.setStatus(1); + response.setMessage("商家拒绝退款"); + response.setData(map); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "program.handle.order", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "小程序待处理订单") + @Override + public Object ProgramHandleOrder(ProgramOrderHandleRequest request) { + String info = "小程序待处理订单"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + // 收银机端专用 + CommonListResponse response = null; + try { + List> list = new ArrayList<>(); + response = new CommonListResponse(); + Map mapKey = new HashMap<>(); + try { + mapKey = (Map) cacheService.get(tenantId, "program_" + storeId); + } catch (Exception e) { + logger.error(info + "访问缓存失败>>>>>>>>>>"); + } + if (mapKey == null) { + mapKey = new HashMap<>(); + } + List nos = new ArrayList<>(); + for (Map.Entry entry : mapKey.entrySet()) { + nos.add(entry.getValue()); + } + if (CollectionUtils.isEmpty(nos)) { + response.setStatus(1); + response.setMessage("查询成功"); + response.equals(list); + return response; + } + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.or(Restrictions.eq("status", 0), Restrictions.eq("refundStatus", 1))); + criteria.add(Restrictions.in("no", nos)); + List ticketList = programStoreBusinessTicketService.getList(tenantId, criteria); + DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + if (CollectionUtils.isNotEmpty(ticketList)) { + for (ProgramStoreBusinessTicket programStoreBusinessTicket : ticketList) { + Map map = new HashMap<>(); + map.put("id", programStoreBusinessTicket.getId()); + map.put("tenantId", programStoreBusinessTicket.getTenantId()); + map.put("memberId", programStoreBusinessTicket.getMemberId()); + map.put("openId", programStoreBusinessTicket.getOpenId()); + map.put("sourceType", programStoreBusinessTicket.getSourceType()); + map.put("touxiang", programStoreBusinessTicket.getTouxiang()); + map.put("memberName", programStoreBusinessTicket.getMemberName()); + map.put("mobile", programStoreBusinessTicket.getMobile()); + map.put("no", programStoreBusinessTicket.getNo()); + map.put("storeId", programStoreBusinessTicket.getStoreId()); + map.put("storeNo", programStoreBusinessTicket.getStoreNo()); + map.put("storeName", programStoreBusinessTicket.getStoreName()); + map.put("status", programStoreBusinessTicket.getStatus()); + map.put("deliverStatus", programStoreBusinessTicket.getDeliverStatus()); + map.put("refundStatus", programStoreBusinessTicket.getRefundStatus()); + map.put("saleDate", fmt.format(programStoreBusinessTicket.getSaleDate())); + map.put("tableNo", programStoreBusinessTicket.getTableNo()); + map.put("tableName", programStoreBusinessTicket.getTableName()); + map.put("people", programStoreBusinessTicket.getPeople()); + map.put("busMode", programStoreBusinessTicket.getBusMode()); + map.put("reserveTime", programStoreBusinessTicket.getReserveTime()); + map.put("deliverFee", programStoreBusinessTicket.getDeliverFee()); + map.put("packageFee", programStoreBusinessTicket.getPackageFee()); + map.put("amount", programStoreBusinessTicket.getAmount()); + map.put("discount", programStoreBusinessTicket.getDiscount()); + map.put("discountTotal", programStoreBusinessTicket.getDiscountTotal()); + map.put("receivable", programStoreBusinessTicket.getReceivable()); + map.put("maling", programStoreBusinessTicket.getMaling()); + map.put("paid", programStoreBusinessTicket.getPaid()); + map.put("noOrg", programStoreBusinessTicket.getNoOrg()); + map.put("backCause", programStoreBusinessTicket.getBackCause()); + map.put("isMember", programStoreBusinessTicket.getIsMember()); + map.put("memberNo", programStoreBusinessTicket.getMemberNo()); + map.put("memberJifen", programStoreBusinessTicket.getMemberJifen()); + map.put("seqNo", programStoreBusinessTicket.getSeqNo()); + map.put("weather", programStoreBusinessTicket.getWeather()); + map.put("weeker", programStoreBusinessTicket.getWeeker()); + map.put("ext1", programStoreBusinessTicket.getExt1()); + map.put("ext2", programStoreBusinessTicket.getExt2()); + criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketId", programStoreBusinessTicket.getId())); + criteria.add(Restrictions.eq("storeId", storeId)); + // 获取主单优惠 + List ticketInfoList = programStoreBusinessTicketInfoService.getList(tenantId, criteria); + List> ticketInfo = new ArrayList<>(); + for (ProgramStoreBusinessTicketInfo item : ticketInfoList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("busNo", item.getBusNo()); + itemMap.put("type", item.getType()); + itemMap.put("info", item.getInfo()); + itemMap.put("discountMoney", item.getDiscountMoney()); + ticketInfo.add(itemMap); + } + map.put("ticketInfo", ticketInfo); + // 获取主单优惠 + List ticketDeliverList = programStoreBusinessTicketDeliverService.getList(tenantId, criteria); + List> ticketDeliver = new ArrayList<>(); + for (ProgramStoreBusinessTicketDeliver item : ticketDeliverList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("busNo", item.getBusNo()); + itemMap.put("orderTel", item.getOrderTel()); + itemMap.put("name", item.getName()); + itemMap.put("address", item.getAddress()); + itemMap.put("latitude", item.getLatitude()); + itemMap.put("longitude", item.getLongitude()); + itemMap.put("deliverType", item.getDeliverType()); + itemMap.put("deliverFee", item.getDeliverFee()); + itemMap.put("logisticsDispatcherMobile", item.getLogisticsDispatcherMobile()); + itemMap.put("logisticsDispatcherName", item.getLogisticsDispatcherName()); + itemMap.put("logisticsReceiptTime", item.getLogisticsReceiptTime()); + itemMap.put("logisticsFetchTime", item.getLogisticsFetchTime()); + itemMap.put("logisticsFinishTime", item.getLogisticsFinishTime()); + ticketDeliver.add(itemMap); + } + map.put("ticketDeliver", ticketDeliver); + // 获取订单商品信息 + List orderProductList = programStoreOrderProductService.getList(tenantId, criteria); + List> orderProduct = new ArrayList<>(); + for (ProgramStoreOrderProduct item : orderProductList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("clientId", item.getClientId()); + itemMap.put("parentId", item.getParentId()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("productId", item.getProductId()); + itemMap.put("productNo", item.getProductNo()); + itemMap.put("productName", item.getProductName()); + itemMap.put("productUnitId", item.getProductUnitId()); + itemMap.put("productUnitName", item.getProductUnitName()); + itemMap.put("productImageUrl", item.getProductImageUrl()); + itemMap.put("seriesId", item.getSeriesId()); + itemMap.put("seriesName", item.getSeriesName()); + itemMap.put("typePath", item.getTypePath()); + itemMap.put("typeId", item.getTypeId()); + itemMap.put("typeName", item.getTypeName()); + itemMap.put("specId", item.getSpecId()); + itemMap.put("specName", item.getSpecName()); + itemMap.put("count", item.getCount()); + itemMap.put("rcount", item.getRcount()); + itemMap.put("price", item.getPrice()); + itemMap.put("priceOrg", item.getPriceOrg()); + itemMap.put("discountPrice", item.getDiscountPrice()); + itemMap.put("isSuit", item.getIsSuit()); + itemMap.put("suitId", item.getSuitId()); + itemMap.put("amount", item.getAmount()); + itemMap.put("discount", item.getDiscount()); + itemMap.put("discountTotal", item.getDiscountTotal()); + itemMap.put("receivable", item.getReceivable()); + itemMap.put("addPriceTotal", item.getAddPriceTotal()); + itemMap.put("discountAddTotal", item.getDiscountAddTotal()); + itemMap.put("amountAddTotal", item.getAmountAddTotal()); + itemMap.put("amountTotal", item.getAmountTotal()); + itemMap.put("receivableTotal", item.getReceivableTotal()); + itemMap.put("lineNo", item.getLineNo()); + itemMap.put("seqNo", item.getSeqNo()); + orderProduct.add(itemMap); + } + map.put("orderProduct", orderProduct); + // 获取产品做法信息 + List makeList = programStoreOrderProductMakeService.getList(tenantId, criteria); + List> makeInfo = new ArrayList<>(); + for (ProgramStoreOrderProductMake item : makeList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("orderItemId", item.getOrderItemId()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("busNo", item.getBusNo()); + itemMap.put("makeId", item.getMakeId()); + itemMap.put("makeName", item.getMakeName()); + itemMap.put("addPrice", item.getAddPrice()); + itemMap.put("discountPrice", item.getDiscountPrice()); + itemMap.put("count", item.getCount()); + itemMap.put("rcount", item.getRcount()); + itemMap.put("addTotal", item.getAddTotal()); + itemMap.put("discountAddTotal", item.getDiscountAddTotal()); + itemMap.put("discount", item.getDiscount()); + itemMap.put("qtyFlag", item.getQtyFlag()); + itemMap.put("hand", item.getHand()); + makeInfo.add(itemMap); + } + map.put("makeInfo", makeInfo); + // 产品支付明细 + List payList = programStorePayService.getList(tenantId, criteria); + List> payInfo = new ArrayList<>(); + for (ProgramStorePay item : payList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("payNo", item.getPayNo()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("busNo", item.getBusNo()); + itemMap.put("payTypeNo", item.getPayTypeNo()); + itemMap.put("payType", item.getPayType()); + itemMap.put("paid", item.getPaid()); + itemMap.put("payDate", item.getPayDate() == null ? "" : fmt.format(item.getPayDate())); + itemMap.put("rchange", item.getRchange()); + itemMap.put("money", item.getMoney()); + itemMap.put("overAmount", item.getOverAmount()); + itemMap.put("voucherNo", item.getVoucherNo()); + itemMap.put("cardno", item.getCardno()); + itemMap.put("cardYe", item.getCardYe()); + itemMap.put("cardJf", item.getCardJf()); + itemMap.put("incomeFlag", item.getIncomeFlag()); + itemMap.put("otherRateType", item.getOtherRateType()); + itemMap.put("otherRateValue", item.getOtherRateValue()); + itemMap.put("otherRate", item.getOtherRate()); + itemMap.put("payChannel", item.getPayChannel()); + itemMap.put("memo", item.getMemo()); + payInfo.add(itemMap); + } + map.put("payInfo", payInfo); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "program.list.order", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "小程序订单列表") + @Override + public Object ProgramListOrder(ProgramListOrderRequest request) { + String info = "订单查询"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + int status = request.getStatus(); + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + String startTime = request.getStartTime(); + String endTime = request.getEndTime(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + if (StringUtils.isNotEmpty(startTime)) { + criteria.add(Restrictions.ge("createDate", startTime)); + } + if (StringUtils.isNotEmpty(endTime)) { + criteria.add(Restrictions.le("createDate", endTime)); + } + criteria.add(Restrictions.order("createDate", "DESC")); + if (status == 1) { + criteria.add(Restrictions.eq("status", 0)); + } else if (status == 2) { + List statusList = new ArrayList<>(); + statusList.add(1);// 已确认 + statusList.add(2);// 已配送 + statusList.add(3);// 已取消 + statusList.add(4);// 已完成 + criteria.add(Restrictions.in("status", statusList)); + } else { + List statusList = new ArrayList<>(); + statusList.add(0);// 已确认 + statusList.add(1);// 已确认 + statusList.add(2);// 已配送 + statusList.add(3);// 已取消 + statusList.add(4);// 已完成 + criteria.add(Restrictions.in("status", statusList)); + } + pager = programStoreBusinessTicketService.getPager(tenantId, criteria, pager); + DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (ProgramStoreBusinessTicket programStoreBusinessTicket : source) { + Map map = new HashMap<>(); + map.put("id", programStoreBusinessTicket.getId()); + map.put("tenantId", programStoreBusinessTicket.getTenantId()); + map.put("memberId", programStoreBusinessTicket.getMemberId()); + map.put("openId", programStoreBusinessTicket.getOpenId()); + map.put("sourceType", programStoreBusinessTicket.getSourceType()); + map.put("touxiang", programStoreBusinessTicket.getTouxiang()); + map.put("memberName", programStoreBusinessTicket.getMemberName()); + map.put("mobile", programStoreBusinessTicket.getMobile()); + map.put("no", programStoreBusinessTicket.getNo()); + map.put("storeId", programStoreBusinessTicket.getStoreId()); + map.put("storeNo", programStoreBusinessTicket.getStoreNo()); + map.put("storeName", programStoreBusinessTicket.getStoreName()); + map.put("status", programStoreBusinessTicket.getStatus()); + map.put("deliverStatus", programStoreBusinessTicket.getDeliverStatus()); + map.put("refundStatus", programStoreBusinessTicket.getRefundStatus()); + map.put("saleDate", fmt.format(programStoreBusinessTicket.getSaleDate())); + map.put("tableNo", programStoreBusinessTicket.getTableNo()); + map.put("tableName", programStoreBusinessTicket.getTableName()); + map.put("people", programStoreBusinessTicket.getPeople()); + map.put("busMode", programStoreBusinessTicket.getBusMode()); + map.put("reserveTime", programStoreBusinessTicket.getReserveTime()); + map.put("deliverFee", programStoreBusinessTicket.getDeliverFee()); + map.put("packageFee", programStoreBusinessTicket.getPackageFee()); + map.put("amount", programStoreBusinessTicket.getAmount()); + map.put("discount", programStoreBusinessTicket.getDiscount()); + map.put("discountTotal", programStoreBusinessTicket.getDiscountTotal()); + map.put("receivable", programStoreBusinessTicket.getReceivable()); + map.put("maling", programStoreBusinessTicket.getMaling()); + map.put("paid", programStoreBusinessTicket.getPaid()); + map.put("noOrg", programStoreBusinessTicket.getNoOrg()); + map.put("backCause", programStoreBusinessTicket.getBackCause()); + map.put("isMember", programStoreBusinessTicket.getIsMember()); + map.put("memberNo", programStoreBusinessTicket.getMemberNo()); + map.put("memberJifen", programStoreBusinessTicket.getMemberJifen()); + map.put("seqNo", programStoreBusinessTicket.getSeqNo()); + map.put("weather", programStoreBusinessTicket.getWeather()); + map.put("weeker", programStoreBusinessTicket.getWeeker()); + map.put("ext1", programStoreBusinessTicket.getExt1()); + map.put("ext2", programStoreBusinessTicket.getExt2()); + criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketId", programStoreBusinessTicket.getId())); + criteria.add(Restrictions.eq("storeId", storeId)); + // 获取主单优惠 + List ticketInfoList = programStoreBusinessTicketInfoService.getList(tenantId, criteria); + List> ticketInfo = new ArrayList<>(); + for (ProgramStoreBusinessTicketInfo item : ticketInfoList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("busNo", item.getBusNo()); + itemMap.put("type", item.getType()); + itemMap.put("info", item.getInfo()); + itemMap.put("discountMoney", item.getDiscountMoney()); + ticketInfo.add(itemMap); + } + map.put("ticketInfo", ticketInfo); + // 获取主单优惠 + List ticketDeliverList = programStoreBusinessTicketDeliverService.getList(tenantId, criteria); + List> ticketDeliver = new ArrayList<>(); + for (ProgramStoreBusinessTicketDeliver item : ticketDeliverList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("busNo", item.getBusNo()); + itemMap.put("orderTel", item.getOrderTel()); + itemMap.put("name", item.getName()); + itemMap.put("address", item.getAddress()); + itemMap.put("latitude", item.getLatitude()); + itemMap.put("longitude", item.getLongitude()); + itemMap.put("deliverType", item.getDeliverType()); + itemMap.put("deliverFee", item.getDeliverFee()); + itemMap.put("logisticsDispatcherMobile", item.getLogisticsDispatcherMobile()); + itemMap.put("logisticsDispatcherName", item.getLogisticsDispatcherName()); + itemMap.put("logisticsReceiptTime", item.getLogisticsReceiptTime()); + itemMap.put("logisticsFetchTime", item.getLogisticsFetchTime()); + itemMap.put("logisticsFinishTime", item.getLogisticsFinishTime()); + ticketDeliver.add(itemMap); + } + map.put("ticketDeliver", ticketDeliver); + // 获取订单商品信息 + List orderProductList = programStoreOrderProductService.getList(tenantId, criteria); + List> orderProduct = new ArrayList<>(); + for (ProgramStoreOrderProduct item : orderProductList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("clientId", item.getClientId()); + itemMap.put("parentId", item.getParentId()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("productId", item.getProductId()); + itemMap.put("productNo", item.getProductNo()); + itemMap.put("productName", item.getProductName()); + itemMap.put("productUnitId", item.getProductUnitId()); + itemMap.put("productUnitName", item.getProductUnitName()); + itemMap.put("productImageUrl", item.getProductImageUrl()); + itemMap.put("seriesId", item.getSeriesId()); + itemMap.put("seriesName", item.getSeriesName()); + itemMap.put("typePath", item.getTypePath()); + itemMap.put("typeId", item.getTypeId()); + itemMap.put("typeName", item.getTypeName()); + itemMap.put("specId", item.getSpecId()); + itemMap.put("specName", item.getSpecName()); + itemMap.put("count", item.getCount()); + itemMap.put("rcount", item.getRcount()); + itemMap.put("price", item.getPrice()); + itemMap.put("priceOrg", item.getPriceOrg()); + itemMap.put("discountPrice", item.getDiscountPrice()); + itemMap.put("isSuit", item.getIsSuit()); + itemMap.put("suitId", item.getSuitId()); + itemMap.put("amount", item.getAmount()); + itemMap.put("discount", item.getDiscount()); + itemMap.put("discountTotal", item.getDiscountTotal()); + itemMap.put("receivable", item.getReceivable()); + itemMap.put("addPriceTotal", item.getAddPriceTotal()); + itemMap.put("discountAddTotal", item.getDiscountAddTotal()); + itemMap.put("amountAddTotal", item.getAmountAddTotal()); + itemMap.put("amountTotal", item.getAmountTotal()); + itemMap.put("receivableTotal", item.getReceivableTotal()); + itemMap.put("lineNo", item.getLineNo()); + itemMap.put("seqNo", item.getSeqNo()); + orderProduct.add(itemMap); + } + map.put("orderProduct", orderProduct); + // 获取产品做法信息 + List makeList = programStoreOrderProductMakeService.getList(tenantId, criteria); + List> makeInfo = new ArrayList<>(); + for (ProgramStoreOrderProductMake item : makeList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("orderItemId", item.getOrderItemId()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("busNo", item.getBusNo()); + itemMap.put("makeId", item.getMakeId()); + itemMap.put("makeName", item.getMakeName()); + itemMap.put("addPrice", item.getAddPrice()); + itemMap.put("discountPrice", item.getDiscountPrice()); + itemMap.put("count", item.getCount()); + itemMap.put("rcount", item.getRcount()); + itemMap.put("addTotal", item.getAddTotal()); + itemMap.put("discountAddTotal", item.getDiscountAddTotal()); + itemMap.put("discount", item.getDiscount()); + itemMap.put("qtyFlag", item.getQtyFlag()); + itemMap.put("hand", item.getHand()); + makeInfo.add(itemMap); + } + map.put("makeInfo", makeInfo); + // 获取产品支付信息 + List payList = programStorePayService.getList(tenantId, criteria); + List> payInfo = new ArrayList<>(); + for (ProgramStorePay item : payList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("payNo", item.getPayNo()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("busNo", item.getBusNo()); + itemMap.put("payTypeNo", item.getPayTypeNo()); + itemMap.put("payType", item.getPayType()); + itemMap.put("paid", item.getPaid()); + itemMap.put("payDate", item.getPayDate() == null ? "" : fmt.format(item.getPayDate())); + itemMap.put("rchange", item.getRchange()); + itemMap.put("money", item.getMoney()); + itemMap.put("overAmount", item.getOverAmount()); + itemMap.put("voucherNo", item.getVoucherNo()); + itemMap.put("cardno", item.getCardno()); + itemMap.put("cardYe", item.getCardYe()); + itemMap.put("cardJf", item.getCardJf()); + itemMap.put("incomeFlag", item.getIncomeFlag()); + itemMap.put("otherRateType", item.getOtherRateType()); + itemMap.put("otherRateValue", item.getOtherRateValue()); + itemMap.put("otherRate", item.getOtherRate()); + itemMap.put("payChannel", item.getPayChannel()); + itemMap.put("memo", item.getMemo()); + payInfo.add(itemMap); + } + map.put("payInfo", payInfo); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 订单退款 + * + * @param tenantId + * @param storeId + * @param busNo + * @return + */ + private Map OrderRefund(String tenantId,String storeId, String storeNo, String busNo) { + String info = "支付退款"; + logger.debug(info); + Map result = null; + try { + // 根据订单信息进行退款 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("busNo", busNo)); + List payList = programStorePayService.getList(tenantId, criteria); + ProgramStorePay pay = payList.get(0); + switch (pay.getPayTypeNo()) { + case "04": + case "05": + // 微信退款 + // 获取支付参数 +// List parameterList = this.paymentParameterService.getPaymentParameterByStoreId(tenantId, storeId); +// List> payParamList = new ArrayList<>(); +// for (PaymentParameter paymentParameter : parameterList) { +// Map map = new HashMap<>(); +// map.put("tenantId", paymentParameter.getTenantId()); +// map.put("id", paymentParameter.getId()); +// map.put("no", paymentParameter.getNo()); +// map.put("name", paymentParameter.getName()); +// map.put("sign", paymentParameter.getSign()); +// Map pbodyMap = JSONUtil.parseObject(paymentParameter.getPbody(), new TypeReference>() { +// }); +// map.put("pbody", pbodyMap); +// map.put("certText", paymentParameter.getCertText()); +// if (StringUtils.equalsIgnoreCase("saobei", paymentParameter.getSign())) { +// payParamList.add(map); +// } +// } + + List> payParamList = new ArrayList<>(); + + //判断此门店是否启用独立支付参数; + + List parameters = this.programPaymentParameterService.getPaymentParameterByStoreId(tenantId, storeId); + String json = JSON.toJSONString(parameters); + logger.info("判断此门店是否启用独立支付参数param:"+json); + for (ProgramPaymentParameter paymentParameter : parameters) { + Map map = new HashMap<>(); + map.put("tenantId", paymentParameter.getTenantId()); + map.put("id", paymentParameter.getId()); + map.put("no", paymentParameter.getNo()); + map.put("name", paymentParameter.getName()); + map.put("sign", paymentParameter.getSign()); + Map pbodyMap = JSONUtil.parseObject(paymentParameter.getPbody(), new TypeReference>() { + }); + map.put("pbody", pbodyMap); + map.put("certText", paymentParameter.getCertText()); + if (StringUtils.equalsIgnoreCase("saobei", paymentParameter.getSign())) { + payParamList.add(map); + } + } + if(CollectionUtils.isEmpty(payParamList)){ + // 获取支付参数 + List parameterList = this.paymentParameterService.getPaymentParameterByStoreId(tenantId, storeId); + for (PaymentParameter paymentParameter : parameterList) { + Map map = new HashMap<>(); + map.put("tenantId", paymentParameter.getTenantId()); + map.put("id", paymentParameter.getId()); + map.put("no", paymentParameter.getNo()); + map.put("name", paymentParameter.getName()); + map.put("sign", paymentParameter.getSign()); + Map pbodyMap = JSONUtil.parseObject(paymentParameter.getPbody(), new TypeReference>() { + }); + map.put("pbody", pbodyMap); + map.put("certText", paymentParameter.getCertText()); + if (StringUtils.equalsIgnoreCase("saobei", paymentParameter.getSign())) { + payParamList.add(map); + } + } + } + String listjson = JSON.toJSONString(payParamList); + logger.info("payParamList:"+listjson); + Map payParam = new HashMap(); + payParam = payParamList.get(0); + Map payBoday = (Map) payParam.get("pbody"); + String moneyStr = String.valueOf((int) (pay.getPaid() * 100)); + Map paramMap = new LinkedHashMap<>(); + paramMap.put("pay_ver", "100"); + if ("04".equals(pay.getPayTypeNo())) { + paramMap.put("pay_type", "020"); + } else if ("05".equals(pay.getPayTypeNo())) { + paramMap.put("pay_type", "010"); + } + String outRefundNo = "B" + String.valueOf(IdWorkerUtils.getInstance().nextId()); + paramMap.put("service_id", "030"); + paramMap.put("merchant_no", payBoday.get("merchant_no").toString()); + paramMap.put("terminal_id", payBoday.get("terminal_id").toString()); + paramMap.put("terminal_trace", outRefundNo); + paramMap.put("terminal_time", DateUtils.format(new Date(), "yyyyMMddHHmmss")); + paramMap.put("refund_fee", moneyStr); + paramMap.put("out_trade_no", pay.getVoucherNo()); + String signKey = "&access_token=" + payBoday.get("signKey").toString(); + String sign = SignUtil.createSign(paramMap, signKey); + paramMap.put("pay_trace", ""); + paramMap.put("pay_time", ""); + paramMap.put("auth_code", ""); + paramMap.put("key_sign", sign); + HttpResponse httpResponse = HttpTool.url(payBoday.get("gatewayUrl").toString() + "/pay/100/refund").contentType("application/json").body(JSON.toJSONString(paramMap)).post(); + String content = HttpTool.getResponseAsString(httpResponse); + JSONObject response = JSON.parseObject(content); + result = new HashMap<>(); + if ("01".equals(response.get("return_code").toString()) && "01".equals(response.get("result_code"))) { + result.put("status", 1); + result.put("message", "扫呗退款成功"); + logger.error(info + "扫呗退款成功 订单号 orderNo:" + busNo + " 退款单号:" + outRefundNo + " moneyActual:" + pay.getPaid()); + } else { + result.put("status", 0); + result.put("message", "扫呗退款失败"); + logger.error(info + "扫呗退款失败 订单号 orderNo:" + busNo + " 退款单号:" + outRefundNo + " moneyActual:" + pay.getPaid() + " 扫呗退款时发生异常 :" + response.get("return_msg").toString()); + } + break; + case "50": + List> payParamListt = new ArrayList<>(); + //判断此门店是否启用独立支付参数; + List parameterss = this.programPaymentParameterService.getPaymentParameterByStoreId(tenantId, storeId); + String jsonn = JSON.toJSONString(parameterss); + logger.info("判断此门店是否启用独立支付参数param:"+jsonn); + for (ProgramPaymentParameter paymentParameter : parameterss) { + Map map = new HashMap<>(); + map.put("tenantId", paymentParameter.getTenantId()); + map.put("id", paymentParameter.getId()); + map.put("no", paymentParameter.getNo()); + map.put("name", paymentParameter.getName()); + map.put("sign", paymentParameter.getSign()); + Map pbodyMap = JSONUtil.parseObject(paymentParameter.getPbody(), new TypeReference>() { + }); + map.put("pbody", pbodyMap); + map.put("certText", paymentParameter.getCertText()); + if (StringUtils.equalsIgnoreCase("tonglian", paymentParameter.getSign())) { + payParamListt.add(map); + } + } + if(CollectionUtils.isEmpty(payParamListt)){ + // 获取支付参数 + List parameterList = this.paymentParameterService.getPaymentParameterByStoreId(tenantId, storeId); + for (PaymentParameter paymentParameter : parameterList) { + Map map = new HashMap<>(); + map.put("tenantId", paymentParameter.getTenantId()); + map.put("id", paymentParameter.getId()); + map.put("no", paymentParameter.getNo()); + map.put("name", paymentParameter.getName()); + map.put("sign", paymentParameter.getSign()); + Map pbodyMap = JSONUtil.parseObject(paymentParameter.getPbody(), new TypeReference>() { + }); + map.put("pbody", pbodyMap); + map.put("certText", paymentParameter.getCertText()); + if (StringUtils.equalsIgnoreCase("tonglian", paymentParameter.getSign())) { + payParamListt.add(map); + } + } + } + String listjsonn = JSON.toJSONString(payParamListt); + logger.info("payParamList:"+listjsonn); + Map payParamm = new HashMap(); + payParam = payParamListt.get(0); + String moneyStrr = String.valueOf((int) (pay.getPaid() * 100)); + Map paramMapp = new LinkedHashMap<>(); + paramMapp.put("pay_ver", "100"); + OrderRefund param=new OrderRefund(); + String outRefundNoo = "po-" + System.currentTimeMillis(); + param.setReqsn(outRefundNoo); + param.setOldreqsn(pay.getBusNo()); + //param.setPayuserid(openid); + param.setAmount(moneyStrr); + param.setRefundType("D0"); + final JSONArray tranlist = new JSONArray(); + final HashMap trandetail1 = new HashMap<>(); + trandetail1.put("bizUserId", "ZHTGR_OUT16890642002687211"); + trandetail1.put("amount", moneyStrr); + tranlist.add(trandetail1); + param.setRefundList(JSON.toJSONString(tranlist)); + param.setBackUrl(""); + param.setRemark(""); + String jsondn = JSON.toJSONString(param); + logger.info("通联退款param:"+jsondn); + String contentt=TlHttpClient.post("order.orderRefund", param); + logger.info("通联支付退款申请content:"+contentt); + result = new HashMap<>(); + JSONObject jsonObject = JSON.parseObject(contentt); + if("10000".equals(jsonObject.getString("code"))&&"success".equals(jsonObject.getString("subCode"))){ + result.put("status", 1); + result.put("message", "通联退款成功"); + logger.error(info + "通联退款成功 订单号 orderNo:" + busNo + " 退款单号:" + outRefundNoo + " moneyActual:" + pay.getPaid()); + }else{ + result.put("status", 0); + result.put("message", "扫呗退款失败"); + logger.error(info + "通联退款失败 订单号 orderNo:" + busNo + " 退款单号:" + outRefundNoo + " moneyActual:" + pay.getPaid()); + } + + break; + case "02": + + ProgramSetting programSetting = programSettingService.get(tenantId, pay.getProgramId()); + Map pbodyMapMember = JSONUtil.parseObject(programSetting.getCardApi(), new TypeReference>() { + }); + // 会员卡退款 + Map paramMapMember = new HashMap(20); + List ignoreSignParamsMember = new ArrayList(); + // 系统级参数 + paramMapMember.put("appKey", pbodyMapMember.get("appKey").toString()); + paramMapMember.put("method", "jw.trade.cancel"); + paramMapMember.put("v", pbodyMapMember.get("version").toString()); + paramMapMember.put("format", pbodyMapMember.get("format").toString()); + paramMapMember.put("locale", pbodyMapMember.get("locale").toString()); + paramMapMember.put("client", pbodyMapMember.get("client").toString()); + paramMapMember.put("timestamp", String.valueOf(System.currentTimeMillis())); + // 业务参数 + paramMapMember.put("tradeVoucherNo", pay.getVoucherNo()); + paramMapMember.put("tradeNo", busNo); // 业务单据号 + String outRefundNoMember = "B" + String.valueOf(IdWorkerUtils.getInstance().nextId()); + paramMapMember.put("ticketNo", outRefundNoMember); + paramMapMember.put("reason", "用户申请退款"); + paramMapMember.put("shopNo", storeNo); + criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + List posInfoList = posInfoService.getList(tenantId, criteria); + PosInfo posInfo = posInfoList.get(0); + paramMapMember.put("posNo", posInfo.getPosNo()); + paramMapMember.put("workerNo", pbodyMapMember.get("workerNo").toString()); + paramMapMember.put("sourceSign", "web"); + ignoreSignParamsMember.add("reason"); + // 参数签名 + String signValue = this.sign(paramMapMember, ignoreSignParamsMember, pbodyMapMember.get("appSecret").toString()); + paramMapMember.put("sign", signValue); + HttpResponse responseMember = HttpTool.url(pbodyMapMember.get("url").toString()).form(paramMapMember).post(); + String contentMember = HttpTool.getResponseAsString(responseMember); + result = new HashMap<>(); + if (this.isSuccessful(contentMember)) { + JSONObject responseJsonMember = JSON.parseObject(contentMember); + if (responseJsonMember.getInteger("status") == 1) { + result.put("status", 1); + result.put("message", "扫呗退款成功"); + logger.error(info + "会员卡退款成功 订单号 orderNo:" + busNo + " 退款单号:" + outRefundNoMember + " moneyActual:" + pay.getPaid()); + } else { + result.put("status", 0); + result.put("message", "会员卡退款失败"); + logger.error(info + "会员卡退款失败 订单号 orderNo:" + busNo + " 退款单号:" + outRefundNoMember + " moneyActual:" + pay.getPaid() + " 会员退款时发生异常 :" + responseJsonMember.get("message").toString()); + } + } else { + result.put("status", 0); + result.put("message", "会员卡退款失败"); + logger.error(info + "会员卡退款失败 订单号 orderNo:" + busNo + " 退款单号:" + outRefundNoMember + " moneyActual:" + pay.getPaid() + " 会员退款时发生异常 :" + contentMember); + } + break; + default: + break; + } + + } catch (Exception e) { + logger.error(info + "时,发生异常", e); + result.put("status", 0); + result.put("message", "会员卡退款失败"); + logger.error(info + "会员卡退款失败 订单号 orderNo:" + busNo); + } + return result; + } + + /** + * 通联订单退款 + * + * @param tenantId + * @param storeId + * @param busNo + * @return + */ + private Map TlOrderRefund(String tenantId, String openid,String storeId, String storeNo, String busNo) { + String info = "通联支付退款"; + logger.debug(info); + Map result = null; + try { + // 根据订单信息进行退款 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("busNo", busNo)); + List payList = programStorePayService.getList(tenantId, criteria); + ProgramStorePay pay = payList.get(0); + switch (pay.getPayTypeNo()) { + case "04": + case "05": + // 微信退款 + // 获取支付参数 +// List parameterList = this.paymentParameterService.getPaymentParameterByStoreId(tenantId, storeId); +// List> payParamList = new ArrayList<>(); +// for (PaymentParameter paymentParameter : parameterList) { +// Map map = new HashMap<>(); +// map.put("tenantId", paymentParameter.getTenantId()); +// map.put("id", paymentParameter.getId()); +// map.put("no", paymentParameter.getNo()); +// map.put("name", paymentParameter.getName()); +// map.put("sign", paymentParameter.getSign()); +// Map pbodyMap = JSONUtil.parseObject(paymentParameter.getPbody(), new TypeReference>() { +// }); +// map.put("pbody", pbodyMap); +// map.put("certText", paymentParameter.getCertText()); +// if (StringUtils.equalsIgnoreCase("saobei", paymentParameter.getSign())) { +// payParamList.add(map); +// } +// } + + List> payParamList = new ArrayList<>(); + + //判断此门店是否启用独立支付参数; + + List parameters = this.programPaymentParameterService.getPaymentParameterByStoreId(tenantId, storeId); + String json = JSON.toJSONString(parameters); + logger.info("判断此门店是否启用独立支付参数param:"+json); + for (ProgramPaymentParameter paymentParameter : parameters) { + Map map = new HashMap<>(); + map.put("tenantId", paymentParameter.getTenantId()); + map.put("id", paymentParameter.getId()); + map.put("no", paymentParameter.getNo()); + map.put("name", paymentParameter.getName()); + map.put("sign", paymentParameter.getSign()); + Map pbodyMap = JSONUtil.parseObject(paymentParameter.getPbody(), new TypeReference>() { + }); + map.put("pbody", pbodyMap); + map.put("certText", paymentParameter.getCertText()); + if (StringUtils.equalsIgnoreCase("saobei", paymentParameter.getSign())) { + payParamList.add(map); + } + } + if(CollectionUtils.isEmpty(payParamList)){ + // 获取支付参数 + List parameterList = this.paymentParameterService.getPaymentParameterByStoreId(tenantId, storeId); + for (PaymentParameter paymentParameter : parameterList) { + Map map = new HashMap<>(); + map.put("tenantId", paymentParameter.getTenantId()); + map.put("id", paymentParameter.getId()); + map.put("no", paymentParameter.getNo()); + map.put("name", paymentParameter.getName()); + map.put("sign", paymentParameter.getSign()); + Map pbodyMap = JSONUtil.parseObject(paymentParameter.getPbody(), new TypeReference>() { + }); + map.put("pbody", pbodyMap); + map.put("certText", paymentParameter.getCertText()); + if (StringUtils.equalsIgnoreCase("saobei", paymentParameter.getSign())) { + payParamList.add(map); + } + } + } + String listjson = JSON.toJSONString(payParamList); + logger.info("payParamList:"+listjson); + Map payParam = new HashMap(); + payParam = payParamList.get(0); + Map payBoday = (Map) payParam.get("pbody"); + String moneyStr = String.valueOf((int) (pay.getPaid() * 100)); + Map paramMap = new LinkedHashMap<>(); + paramMap.put("pay_ver", "100"); + if ("04".equals(pay.getPayTypeNo())) { + paramMap.put("pay_type", "020"); + } else if ("05".equals(pay.getPayTypeNo())) { + paramMap.put("pay_type", "010"); + } + String outRefundNo = "B" + String.valueOf(IdWorkerUtils.getInstance().nextId()); + paramMap.put("service_id", "030"); + paramMap.put("merchant_no", payBoday.get("merchant_no").toString()); + paramMap.put("terminal_id", payBoday.get("terminal_id").toString()); + paramMap.put("terminal_trace", outRefundNo); + paramMap.put("terminal_time", DateUtils.format(new Date(), "yyyyMMddHHmmss")); + paramMap.put("refund_fee", moneyStr); + paramMap.put("out_trade_no", pay.getVoucherNo()); + String signKey = "&access_token=" + payBoday.get("signKey").toString(); + String sign = SignUtil.createSign(paramMap, signKey); + paramMap.put("pay_trace", ""); + paramMap.put("pay_time", ""); + paramMap.put("auth_code", ""); + paramMap.put("key_sign", sign); + HttpResponse httpResponse = HttpTool.url(payBoday.get("gatewayUrl").toString() + "/pay/100/refund").contentType("application/json").body(JSON.toJSONString(paramMap)).post(); + String content = HttpTool.getResponseAsString(httpResponse); + JSONObject response = JSON.parseObject(content); + result = new HashMap<>(); + if ("01".equals(response.get("return_code").toString()) && "01".equals(response.get("result_code"))) { + result.put("status", 1); + result.put("message", "扫呗退款成功"); + logger.error(info + "扫呗退款成功 订单号 orderNo:" + busNo + " 退款单号:" + outRefundNo + " moneyActual:" + pay.getPaid()); + } else { + result.put("status", 0); + result.put("message", "扫呗退款失败"); + logger.error(info + "扫呗退款失败 订单号 orderNo:" + busNo + " 退款单号:" + outRefundNo + " moneyActual:" + pay.getPaid() + " 扫呗退款时发生异常 :" + response.get("return_msg").toString()); + } + break; + case "50": + List> payParamListt = new ArrayList<>(); + //判断此门店是否启用独立支付参数; + List parameterss = this.programPaymentParameterService.getPaymentParameterByStoreId(tenantId, storeId); + String jsonn = JSON.toJSONString(parameterss); + logger.info("判断此门店是否启用独立支付参数param:"+jsonn); + for (ProgramPaymentParameter paymentParameter : parameterss) { + Map map = new HashMap<>(); + map.put("tenantId", paymentParameter.getTenantId()); + map.put("id", paymentParameter.getId()); + map.put("no", paymentParameter.getNo()); + map.put("name", paymentParameter.getName()); + map.put("sign", paymentParameter.getSign()); + Map pbodyMap = JSONUtil.parseObject(paymentParameter.getPbody(), new TypeReference>() { + }); + map.put("pbody", pbodyMap); + map.put("certText", paymentParameter.getCertText()); + if (StringUtils.equalsIgnoreCase("tonglian", paymentParameter.getSign())) { + payParamListt.add(map); + } + } + if(CollectionUtils.isEmpty(payParamListt)){ + // 获取支付参数 + List parameterList = this.paymentParameterService.getPaymentParameterByStoreId(tenantId, storeId); + for (PaymentParameter paymentParameter : parameterList) { + Map map = new HashMap<>(); + map.put("tenantId", paymentParameter.getTenantId()); + map.put("id", paymentParameter.getId()); + map.put("no", paymentParameter.getNo()); + map.put("name", paymentParameter.getName()); + map.put("sign", paymentParameter.getSign()); + Map pbodyMap = JSONUtil.parseObject(paymentParameter.getPbody(), new TypeReference>() { + }); + map.put("pbody", pbodyMap); + map.put("certText", paymentParameter.getCertText()); + if (StringUtils.equalsIgnoreCase("tonglian", paymentParameter.getSign())) { + payParamListt.add(map); + } + } + } + String listjsonn = JSON.toJSONString(payParamListt); + logger.info("payParamList:"+listjsonn); + Map payParamm = new HashMap(); + payParam = payParamListt.get(0); + String moneyStrr = String.valueOf((int) (pay.getPaid() * 100)); + Map paramMapp = new LinkedHashMap<>(); + paramMapp.put("pay_ver", "100"); + OrderRefund param=new OrderRefund(); + String outRefundNoo = "po-" + System.currentTimeMillis(); + param.setReqsn(outRefundNoo); + param.setOldreqsn(pay.getBusNo()); + param.setPayuserid(openid); + param.setAmount(moneyStrr); + param.setRefundType("D0"); + final JSONArray tranlist = new JSONArray(); + final HashMap trandetail1 = new HashMap<>(); + trandetail1.put("bizUserId", "ZHTGR_OUT16890642002687211"); + trandetail1.put("amount", moneyStrr); + tranlist.add(trandetail1); + param.setRefundList(JSON.toJSONString(tranlist)); + param.setBackUrl(""); + param.setRemark(""); + String jsondn = JSON.toJSONString(param); + logger.info("通联退款param:"+jsondn); + String contentt=TlHttpClient.post("order.orderRefund", param); + logger.info("通联支付退款申请content:"+contentt); + result = new HashMap<>(); + JSONObject jsonObject = JSON.parseObject(contentt); + if("10000".equals(jsonObject.getString("code"))&&"OK".equals(jsonObject.getString("subCode"))){ + result.put("status", 1); + result.put("message", "通联退款成功"); + logger.error(info + "通联退款成功 订单号 orderNo:" + busNo + " 退款单号:" + outRefundNoo + " moneyActual:" + pay.getPaid()); + }else{ + result.put("status", 0); + result.put("message", "扫呗退款失败"); + logger.error(info + "通联退款失败 订单号 orderNo:" + busNo + " 退款单号:" + outRefundNoo + " moneyActual:" + pay.getPaid()); + } + + break; + case "02": + + ProgramSetting programSetting = programSettingService.get(tenantId, pay.getProgramId()); + Map pbodyMapMember = JSONUtil.parseObject(programSetting.getCardApi(), new TypeReference>() { + }); + // 会员卡退款 + Map paramMapMember = new HashMap(20); + List ignoreSignParamsMember = new ArrayList(); + // 系统级参数 + paramMapMember.put("appKey", pbodyMapMember.get("appKey").toString()); + paramMapMember.put("method", "jw.trade.cancel"); + paramMapMember.put("v", pbodyMapMember.get("version").toString()); + paramMapMember.put("format", pbodyMapMember.get("format").toString()); + paramMapMember.put("locale", pbodyMapMember.get("locale").toString()); + paramMapMember.put("client", pbodyMapMember.get("client").toString()); + paramMapMember.put("timestamp", String.valueOf(System.currentTimeMillis())); + // 业务参数 + paramMapMember.put("tradeVoucherNo", pay.getVoucherNo()); + paramMapMember.put("tradeNo", busNo); // 业务单据号 + String outRefundNoMember = "B" + String.valueOf(IdWorkerUtils.getInstance().nextId()); + paramMapMember.put("ticketNo", outRefundNoMember); + paramMapMember.put("reason", "用户申请退款"); + paramMapMember.put("shopNo", storeNo); + criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + List posInfoList = posInfoService.getList(tenantId, criteria); + PosInfo posInfo = posInfoList.get(0); + paramMapMember.put("posNo", posInfo.getPosNo()); + paramMapMember.put("workerNo", pbodyMapMember.get("workerNo").toString()); + paramMapMember.put("sourceSign", "web"); + ignoreSignParamsMember.add("reason"); + // 参数签名 + String signValue = this.sign(paramMapMember, ignoreSignParamsMember, pbodyMapMember.get("appSecret").toString()); + paramMapMember.put("sign", signValue); + HttpResponse responseMember = HttpTool.url(pbodyMapMember.get("url").toString()).form(paramMapMember).post(); + String contentMember = HttpTool.getResponseAsString(responseMember); + result = new HashMap<>(); + if (this.isSuccessful(contentMember)) { + JSONObject responseJsonMember = JSON.parseObject(contentMember); + if (responseJsonMember.getInteger("status") == 1) { + result.put("status", 1); + result.put("message", "扫呗退款成功"); + logger.error(info + "会员卡退款成功 订单号 orderNo:" + busNo + " 退款单号:" + outRefundNoMember + " moneyActual:" + pay.getPaid()); + } else { + result.put("status", 0); + result.put("message", "会员卡退款失败"); + logger.error(info + "会员卡退款失败 订单号 orderNo:" + busNo + " 退款单号:" + outRefundNoMember + " moneyActual:" + pay.getPaid() + " 会员退款时发生异常 :" + responseJsonMember.get("message").toString()); + } + } else { + result.put("status", 0); + result.put("message", "会员卡退款失败"); + logger.error(info + "会员卡退款失败 订单号 orderNo:" + busNo + " 退款单号:" + outRefundNoMember + " moneyActual:" + pay.getPaid() + " 会员退款时发生异常 :" + contentMember); + } + break; + default: + break; + } + + } catch (Exception e) { + logger.error(info + "时,发生异常", e); + result.put("status", 0); + result.put("message", "会员卡退款失败"); + logger.error(info + "会员卡退款失败 订单号 orderNo:" + busNo); + } + return result; + } + + + protected final String ERROR_TOKEN = "@@$-ERROR_TOKEN$-@@"; + + /** + * 对paramValues进行签名 + * + * @param paramValues + * @param secret + * @return + */ + public String sign(Map paramValues, String secret) { + return sign(paramValues, null, secret); + } + + /** + * 对paramValues进行签名,其中ignoreParamNames这些参数不参与签名 + * + * @param paramValues + * @param ignoreParamNames + * @param secret + * @return + */ + public String sign(Map paramValues, List ignoreParamNames, String secret) { + StringBuilder sb = new StringBuilder(); + List paramNames = new ArrayList(paramValues.size()); + paramNames.addAll(paramValues.keySet()); + if (ignoreParamNames != null && ignoreParamNames.size() > 0) { + for (String ignoreParamName : ignoreParamNames) { + paramNames.remove(ignoreParamName); + } + } + Collections.sort(paramNames); + + sb.append(secret); + for (String paramName : paramNames) { + sb.append(paramName).append(paramValues.get(paramName)); + } + sb.append(secret); + + System.out.println(sb.toString()); + + String sign = WopUtils.sign(sb.toString()); + System.out.println(sign); + + return sign; + + } + + protected boolean isSuccessful(String content) { + return !(content.contains(ERROR_TOKEN)); + } + + @ServiceMethod(method = "program.order.pay", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "小程序订单支付信息上传") + @Override + public Object ProgramOrderPay(ProgramOrderPayRequest request) { + String info = "小程序订单支付信息上传"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + CommonDataResponse response = null; + String openId = request.getOpenId(); + String programId = request.getProgramId(); + String busNo = request.getBusNo(); + String jsonString = request.getJsonString(); + logger.error(info+ " >>>>> busNo " + busNo); + RLock lock = redissonClient.getLock(tenantCode+"-"+busNo); + try { + lock.lock(5, TimeUnit.SECONDS); + response = new CommonDataResponse(); + //同步上传 + Object busNoKey = cacheService.get(tenantId,busNo); + if(busNoKey != null && busNo.equals((String)busNoKey)){ + ProgramStoreBusinessTicket programStoreBusinessTicket = programStoreBusinessTicketService.find(tenantId, "no", busNo); + Map data = new HashMap<>(); + data.put("busNo",busNo); + data.put("ticketId", programStoreBusinessTicket.getId()); + response.setStatus(1); + response.setMessage("支付成功"); + response.setData(data); + return response; + }else{ + cacheService.set(tenantId,busNo,busNo,60*60*12); + } + JSONObject json = JSONObject.parseObject(jsonString); + ProgramStorePayEntity storePayEntity = new ProgramStorePayEntity(json); + ProgramStoreBusinessTicket enity = programStoreBusinessTicketService.find(tenantId, "no", busNo); + if (enity == null) { + response.setStatus(0); + response.setMessage("支付信息上传失败,订单不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if(0 == enity.getStatus()){ + Map data = new HashMap<>(); + data.put("busNo", enity.getNo()); + data.put("ticketId", enity.getId()); + response.setStatus(1); + response.setMessage("支付成功"); + response.setData(data); + return response; + } + new DecimalFormat("0.00").format(enity.getReceivable()); + // 支付金额= 订单应收+餐盒费+配送费 + if (!new DecimalFormat("0.00").format(enity.getReceivable() + enity.getPackageFee() + enity.getDeliverFee()).equals(new DecimalFormat("0.00").format(storePayEntity.getPaid()))) { + response.setStatus(0); + response.setMessage("支付信息上传失败,支付金额和订单金额不符"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + // 生成取餐号 + DateFormat fmt = new SimpleDateFormat("yyyyMMdd"); + String day = fmt.format(new Date()); + String key = "wxBus:" + tenantId + ":" + enity.getStoreId() + ":" + day; + cacheService.setQueue(tenantId, key, enity.getNo(), 60 * 60 * 24); + //int random = (int) (Math.random() * 10 + 1); + String datSeq = ""; + //按南宁要求,取餐号为 600-799 2020-04-10 13:49 + if(StringUtils.startsWith(tenantId,"77")){ + int queueSize = cacheService.getQueueSize(tenantId, key); + int daySize = queueSize + 600; + logger.error("单号:" + enity.getNo() + " queueSize =============>" + queueSize); + if(daySize >= 800){ + int index = queueSize / 200; + daySize = daySize-200*index; + logger.error("单号:" + enity.getNo() + " daySize =============>" + daySize); + } + datSeq = daySize+""; + }else{ + String random = "0"; + String busMode = "T"; + if (enity.getBusMode() == 0) { + busMode = "T"; + } else if (enity.getBusMode() == 1) { + busMode = "D"; + } else if (enity.getBusMode() == 2) { + busMode = "Y"; + } else { + busMode = "W"; + } + String suffix = String.format("%0" + 3 + "d", cacheService.getQueueSize(tenantId, key)); + + if(suffix.length() > 3){ + datSeq = busMode + suffix; + }else{ + datSeq = busMode + random + suffix; + } + } + logger.error("单号:" + enity.getNo() + "=============>" + datSeq); + enity.setSeqNo(datSeq);// 取餐号 + enity.setStatus(0);// 更改主单为待接单状态 + enity.setIsMember(1); + // 门店菜品销售记录优惠明细校验开始 + List payList = new ArrayList<>(); + Date createDate = new Date(); + ProgramStorePay storePay = new ProgramStorePay(); + storePay.setProgramId(programId); + storePay.setCreateDate(createDate); + storePay.setCreateUser("open-api"); + storePay.setClientId(enity.getClientId()); + storePay.setStoreId(enity.getStoreId()); + storePay.setStoreNo(enity.getStoreNo()); + storePay.setStoreName(enity.getStoreName()); + storePay.setBusNo(enity.getNo()); + storePay.setBusMode(enity.getBusMode()); + storePay.setPayNo(enity.getNo()); + storePay.setTableNo(enity.getTableNo()); + storePay.setPayTypeNo(storePayEntity.getPayTypeNo()); + storePay.setPayType(storePayEntity.getPayType()); + storePay.setMemo("支付成功"); + storePay.setPayDate(createDate); + storePay.setPaid(storePayEntity.getPaid()); + storePay.setRchange(0.00); + storePay.setMoney(storePayEntity.getMoney()); + storePay.setOverAmount(0.00); + storePay.setVoucherNo(storePayEntity.getVoucherNo()); + storePay.setCardno(storePayEntity.getCardno()); + storePay.setCardYe(storePayEntity.getCardYe()); + storePay.setCardJf(storePayEntity.getCardJf()); + storePay.setIncomeFlag(1); + storePay.setOtherRateType(0); + storePay.setOtherRateValue(0.00); + storePay.setOtherRate(0.00); + storePay.setPayChannel(-1);// 会员卡支付 + storePay.setDeductionRate(enity.getDeductionRate()); + storePay.setChargeBack(enity.getChargeBack()); + storePay.setSettleFlag(0); + payList.add(storePay); + StoreBusinessTicketCheck ticketCheck = programStoreBusinessTicketService.updateBusinessTicket(tenantId, enity, payList); + if ("1".equals(ticketCheck.getStatus())) { + // 门店信消息压进缓存 + try { + Object programOrderIds = cacheService.get(tenantId, "program_" + enity.getStoreId()); + if (programOrderIds != null) { + Map orderIds = (Map) cacheService.get(tenantId, "program_" + enity.getStoreId()); + orderIds.put(String.valueOf(enity.getNo()), String.valueOf(enity.getNo())); + cacheService.set(tenantId, "program_" + enity.getStoreId(), orderIds, 0); + } else { + Map orderIds = new HashMap<>(); + orderIds.put(String.valueOf(enity.getNo()), String.valueOf(enity.getNo())); + cacheService.set(tenantId, "program_" + enity.getStoreId(), orderIds, 0); + } + } catch (Exception e) { + logger.error(info + "创建订单推送创建缓存失败>>>>>>>>>>"); + } + // 前台阿布订阅模型 + sendProgramMessage("cy2", tenantId, enity.getStoreId()); + Map orderMap = new HashMap<>(); + orderMap.put("tenantId",tenantId); + orderMap.put("storeId",enity.getStoreId()); + orderMap.put("orderNo",enity.getNo()); + orderMap.put("reSendNums",0); + this.mqMessageSender.send4jwprogramordermessage(tenantId,orderMap, RabbitConstant.ROUTING_KEY_JW_PROGRAM_ORDER_NOTIFY_DELAY,new CorrelationData(UUID.randomUUID().toString()),1000L*60); + // 启动退款定时任务,3分钟不接单自动退款 + Map eventDatas = new HashMap<>(); + eventDatas.put("tenantId", tenantId); + eventDatas.put("storeId", enity.getStoreId()); + eventDatas.put("busNo", busNo); + eventBus.notify(EventKeys.PROGRAM_ORDER_PAY, Event.wrap(eventDatas)); + Map data = new HashMap<>(); + data.put("busNo", enity.getNo()); + data.put("ticketId", ticketCheck.getTicketId()); + response.setStatus(1); + response.setMessage("支付成功"); + response.setData(data); + logger.error(info + "支付成功,订单信息上传成功"); + } else { + response.setStatus(0); + response.setMessage("会员支付信息上传失败,支付信息保存失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + logger.error("jsonString:" + jsonString); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + }finally { + lock.unlock(); + } + return response; + } + + /** + * 接单成功小程序通知 + * + * @param appSign + * @param type + * 0拒单1接单2同意退款3拒绝退款 + * @param busNo + * @param openId + */ + public void sendOrderMessage(String appSign, int type, String busNo, String openId) { + String info = "小程序通知订阅模型====>"; + try { + Map order = new HashMap<>(); + order.put("busNo", busNo); + order.put("type", type); + mqttClient.Publish("program/" + appSign + "/order/" + openId, JSONUtil.toJSONString(order)); + logger.error(info + "program/" + appSign + "/order/" + openId, JSONUtil.toJSONString(order)); + } catch (Exception e) { + logger.error(info + "程序通知订阅模型时,发生异常", e); + } + } + + /** + * 小程序订单订阅模型 + * + * @param appSign + * @param tenantId + * @param storeId + */ + public void sendProgramMessage(String appSign, String tenantId, String storeId) { + DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String info = "小程序订单订阅模型====>"; + try { + Map orderIds = (Map) cacheService.get(tenantId, "program_" + storeId); + String ids = ""; + for (Map.Entry entry : orderIds.entrySet()) { + ids = ids + entry.getKey() + ","; + } + if (ids.length() > 0) { + ids = ids.substring(0, ids.length() - 1); + } + if (ids != null && !"".equals(ids)) { + Map order = new HashMap<>(); + order.put("program", ids); + order.put("date", fmt.format(new Date())); + mqttClient.Publish("program/" + appSign + "/" + tenantId + "/" + storeId, JSONUtil.toJSONString(order)); + logger.error(info + "program/" + appSign + "/" + tenantId + "/" + storeId, JSONUtil.toJSONString(order)); + } else { + logger.error(info + "未发布"); + } + } catch (Exception e) { + logger.error(info + "发布订阅模型时处理时,发生异常", e); + } + } + + @ServiceMethod(method = "program.order.refundapply", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "小程序(用户)申请退款") + @Override + public Object ProgramOrderRefundApply(ProgramOrderRefundApplyRequest request) { + String info = "小程序(用户)申请退款"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String programId = request.getProgramId(); + String openId = request.getOpenId(); + String busNo = request.getBusNo(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("no", busNo)); + criteria.add(Restrictions.eq("openId", openId)); + criteria.add(Restrictions.eq("programId", programId)); + List ticketList = programStoreBusinessTicketService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(ticketList)) { + response.setStatus(0); + response.setMessage("订单不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ProgramStoreBusinessTicket programStoreBusinessTicket = ticketList.get(0); + if (programStoreBusinessTicket.getStatus() != 1 || programStoreBusinessTicket.getRefundStatus() != 0) { + response.setStatus(0); + response.setMessage("订单状态不合法,申请退款失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if(programStoreBusinessTicket.getRefundStatus() != 0 ){ + response.setStatus(0); + response.setMessage("订单退单状态不合法,申请退款失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if(programStoreBusinessTicket.getBusMode() != 3){ + Long nowTime = new Date().getTime(); + //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Long saleTime = programStoreBusinessTicket.getSaleDate().getTime(); + Long time = 1000*60*60*2L;// + if(saleTime+time <= nowTime){ + response.setStatus(0); + response.setMessage("订单超过2小时,无法申请退款"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + } + programStoreBusinessTicket.setRefundStatus(1);// 申请退款 + programStoreBusinessTicketService.update(tenantId, programStoreBusinessTicket); + // 门店信消息压进缓存 + try { + Object programOrderIds = cacheService.get(tenantId, "program_" + programStoreBusinessTicket.getStoreId()); + if (programOrderIds != null) { + Map orderIds = (Map) cacheService.get(tenantId, "program_" + programStoreBusinessTicket.getStoreId()); + orderIds.put(String.valueOf(busNo), String.valueOf(busNo)); + cacheService.set(tenantId, "program_" + programStoreBusinessTicket.getStoreId(), orderIds, 1200); + } else { + Map orderIds = new HashMap<>(); + orderIds.put(String.valueOf(busNo), String.valueOf(busNo)); + cacheService.set(tenantId, "program_" + programStoreBusinessTicket.getStoreId(), orderIds, 1200); + } + } catch (Exception e) { + logger.error(info + "创建订单推送创建缓存失败>>>>>>>>>>"); + } + // 前台阿布订阅模型 + sendProgramMessage("cy2", tenantId, programStoreBusinessTicket.getStoreId()); + // 返回结果 + Map map = new HashMap<>(); + map.put("busNo", busNo); + map.put("openId", openId); + response.setStatus(1); + response.setMessage("申请退款成功,等待商家处理"); + response.setData(map); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "program.order.create.sync", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "订单创建(同步专用)") + @Override + public Object ProgramOrderCreateSync(ProgramOrderCreateSyncRequest request) { + String info = "订单创建(同步专用)"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + CommonDataResponse response = null; + String openId = request.getOpenId(); + String programId = request.getProgramId(); + String jsonString = request.getJsonString(); + try { + response = new CommonDataResponse(); + JSONObject json = JSONObject.parseObject(jsonString); + // 销售单据校验开始 + ProgramStoreBusinessTicketSycnEntity entity = new ProgramStoreBusinessTicketSycnEntity(json); + ProgramStoreBusinessTicket storeBusinessTicket = new ProgramStoreBusinessTicket(); + Date createDate = new Date(); + storeBusinessTicket.setCreateDate(createDate); + storeBusinessTicket.setCreateUser("open-api"); + if (entity.getMemberId() != null && entity.getMemberId().length() > 32) { + response.setStatus(0); + response.setMessage("主单MemberId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setMemberId(entity.getMemberId()); + } + storeBusinessTicket.setOpenId(openId); + storeBusinessTicket.setSourceType(entity.getSourceType()); + if (entity.getTouxiang() != null && entity.getTouxiang().length() > 256) { + response.setStatus(0); + response.setMessage("主单touxiang参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setTouxiang(entity.getTouxiang()); + } + if (entity.getMemberName() != null && entity.getMemberName().length() > 32) { + response.setStatus(0); + response.setMessage("主单memberName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setMemberName(entity.getMemberName()); + } + if (entity.getMobile() != null && entity.getMobile().length() > 32) { + response.setStatus(0); + response.setMessage("主单Mobile参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setMobile(entity.getMobile()); + } + storeBusinessTicket.setProgramId(programId); + if (entity.getClientId() == null || "".equals(entity.getClientId()) || entity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("前台系统ID参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setClientId(entity.getClientId()); + } + if (entity.getNo() == null || "".equals(entity.getNo()) || entity.getNo().length() > 32) { + response.setStatus(0); + response.setMessage("主单No参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setNo(entity.getNo()); + } + //if (entity.getStoreId() == null || "".equals(entity.getStoreId()) || entity.getStoreId().length() > 18) { + //去掉18位限制条件;2020-02-29-13:08 + if (entity.getStoreId() == null || "".equals(entity.getStoreId()) ) { + response.setStatus(0); + response.setMessage("主单storeId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setStoreId(entity.getStoreId()); + } + + if (entity.getStoreNo() == null || "".equals(entity.getStoreNo()) || entity.getStoreNo().length() > 32) { + response.setStatus(0); + response.setMessage("主单StoreNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setStoreNo(entity.getStoreNo()); + } + if (entity.getStoreName() == null || "".equals(entity.getStoreName()) || entity.getStoreName().length() > 500) { + response.setStatus(0); + response.setMessage("主单StoreName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setStoreName(entity.getStoreName()); + } + storeBusinessTicket.setStatus(0);// 待接支付状态 + storeBusinessTicket.setDeliverStatus(0);// 待配送下单 + storeBusinessTicket.setRefundStatus(0); + storeBusinessTicket.setSaleDate(entity.getSaleDate()); + if (entity.getTableNo() != null && entity.getTableNo().length() > 16) { + response.setStatus(0); + response.setMessage("主单TableNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setTableNo(entity.getTableNo()); + } + if (entity.getTableName() != null && entity.getTableName().length() > 32) { + response.setStatus(0); + response.setMessage("主单TableName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setTableName(entity.getTableName()); + } + storeBusinessTicket.setPeople(entity.getPeople()); + storeBusinessTicket.setBusMode(entity.getBusMode()); + storeBusinessTicket.setReserveTime(entity.getReserveTime()); + storeBusinessTicket.setDeliverFee(entity.getDeliverFee()); + storeBusinessTicket.setPackageFee(entity.getPackageFee()); + storeBusinessTicket.setAmount(entity.getAmount()); + storeBusinessTicket.setDiscount(entity.getDiscount()); + storeBusinessTicket.setDiscountTotal(entity.getDiscountTotal()); + storeBusinessTicket.setReceivable(entity.getReceivable()); + storeBusinessTicket.setMaling(entity.getMaling()); + if (entity.getPaid() == null || entity.getPaid() == 0) { + storeBusinessTicket.setPaid(entity.getReceivable() - entity.getMaling()); + } else { + storeBusinessTicket.setPaid(entity.getPaid()); + } + if (entity.getNoOrg() != null && entity.getNoOrg().length() > 32) { + response.setStatus(0); + response.setMessage("主单NoOrg参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setNoOrg(entity.getNoOrg()); + } + if (entity.getBackCause() != null && entity.getBackCause().length() > 128) { + response.setStatus(0); + response.setMessage("主单BackCause参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setBackCause(entity.getBackCause()); + } + storeBusinessTicket.setIsMember(0); + storeBusinessTicket.setMemberNo(""); + storeBusinessTicket.setMemberJifen(0.00); + storeBusinessTicket.setSeqNo(entity.getSeqNo());// 取餐号 + storeBusinessTicket.setWeather("");// 天气 + storeBusinessTicket.setWeeker(entity.getWeeker());// 星期 + if (entity.getExt2() != null && entity.getExt2().length() > 32) { + response.setStatus(0); + response.setMessage("订单备注不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setExt2(entity.getExt2()); + } + // 配送信息校验 + ProgramStoreBusinessTicketDeliverEntity storeBusinessTicketDeliverEntity = entity.getTicketDeliver(); + ProgramStoreBusinessTicketDeliver storeBusinessTicketDeliver = null; + if (storeBusinessTicketDeliverEntity != null) { + storeBusinessTicketDeliver = new ProgramStoreBusinessTicketDeliver(); + storeBusinessTicketDeliver.setCreateDate(createDate); + storeBusinessTicketDeliver.setCreateUser("open-api"); + storeBusinessTicketDeliver.setTenantId(tenantId); + storeBusinessTicketDeliver.setStoreId(entity.getStoreId()); + storeBusinessTicketDeliver.setProgramId(programId); + storeBusinessTicketDeliver.setBusNo(entity.getNo()); + if (storeBusinessTicketDeliverEntity.getClientId() == null || "".equals(storeBusinessTicketDeliverEntity.getClientId()) || storeBusinessTicketDeliverEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("配送信息ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicketDeliver.setClientId(storeBusinessTicketDeliverEntity.getClientId()); + } + if (storeBusinessTicketDeliverEntity.getOrderTel() != null && storeBusinessTicketDeliverEntity.getOrderTel().length() > 16) { + response.setStatus(0); + response.setMessage("配送信息OrderTel参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicketDeliver.setOrderTel(storeBusinessTicketDeliverEntity.getOrderTel()); + } + if (storeBusinessTicketDeliverEntity.getName() != null && storeBusinessTicketDeliverEntity.getName().length() > 64) { + response.setStatus(0); + response.setMessage("配送信息Name参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicketDeliver.setName(storeBusinessTicketDeliverEntity.getName()); + } + if (storeBusinessTicketDeliverEntity.getAddress() != null && storeBusinessTicketDeliverEntity.getAddress().length() > 64) { + response.setStatus(0); + response.setMessage("配送信息Address参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicketDeliver.setAddress(storeBusinessTicketDeliverEntity.getAddress()); + } + storeBusinessTicketDeliver.setLatitude(storeBusinessTicketDeliverEntity.getLatitude()); + storeBusinessTicketDeliver.setLongitude(storeBusinessTicketDeliverEntity.getLongitude()); + storeBusinessTicketDeliver.setDeliverType(storeBusinessTicketDeliverEntity.getDeliverType()); + storeBusinessTicketDeliver.setDeliverFee(storeBusinessTicketDeliverEntity.getDeliverFee()); + } + // 前台销售单优惠明细校验开始 + List ticketInfoList = new ArrayList<>(); + List storeBusinessTicketInfoEntityList = entity.getTicketInfo(); + if (storeBusinessTicketInfoEntityList != null && storeBusinessTicketInfoEntityList.size() > 0) { + for (ProgramStoreBusinessTicketInfoEntity storeBusinessTicketInfoEntity : storeBusinessTicketInfoEntityList) { + ProgramStoreBusinessTicketInfo storeBusinessTicketInfo = new ProgramStoreBusinessTicketInfo(); + storeBusinessTicketInfo.setCreateDate(createDate); + storeBusinessTicketInfo.setCreateUser("open-api"); + if (storeBusinessTicketInfoEntity.getClientId() == null || "".equals(storeBusinessTicketInfoEntity.getClientId()) || storeBusinessTicketInfoEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("销售单优惠ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicketInfo.setClientId(storeBusinessTicketInfoEntity.getClientId()); + } + storeBusinessTicketInfo.setStoreId(entity.getStoreId()); + storeBusinessTicketInfo.setProgramId(programId); + storeBusinessTicketInfo.setBusNo(entity.getNo()); + storeBusinessTicketInfo.setType(storeBusinessTicketInfoEntity.getType()); + if (storeBusinessTicketInfoEntity.getInfo() != null && storeBusinessTicketInfoEntity.getInfo().length() > 256) { + response.setStatus(0); + response.setMessage("销售单优惠Info参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicketInfo.setInfo(storeBusinessTicketInfoEntity.getInfo()); + } + storeBusinessTicketInfo.setDiscountMoney(storeBusinessTicketInfoEntity.getDiscountMoney()); + storeBusinessTicketInfo.setSaleDate(entity.getSaleDate()); + ticketInfoList.add(storeBusinessTicketInfo); + } + } + + // 门店菜品销售记录校验开始 + List orderProductList = new ArrayList<>(); + List storeOrderProductEntityList = entity.getOrderProduct(); + // 销售明细优惠 + List orderProductInfoList = new ArrayList<>(); + // 销售明细做法 + List makeList = new ArrayList<>(); + + if (storeOrderProductEntityList == null || storeOrderProductEntityList.size() <= 0) { + response.setStatus(0); + response.setMessage("门店菜品销售记录不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + int lineNo = 0; + for (ProgramStoreOrderProductEntity storeOrderProductEntity : storeOrderProductEntityList) { + ProgramStoreOrderProduct storeOrderProduct = new ProgramStoreOrderProduct(); + storeOrderProduct.setCreateDate(createDate); + storeOrderProduct.setCreateUser("open-api"); + if (storeOrderProductEntity.getClientId() == null || "".equals(storeOrderProductEntity.getClientId()) || storeOrderProductEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ID参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setClientId(storeOrderProductEntity.getClientId()); + } + if (storeOrderProductEntity.getParentId() != null && storeOrderProductEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ParentId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setParentId(storeOrderProductEntity.getParentId()); + } + storeOrderProduct.setBusNo(entity.getNo()); + storeOrderProduct.setBusMode(entity.getBusMode()); + storeOrderProduct.setProgramId(programId); + storeOrderProduct.setStoreId(entity.getStoreId()); + storeOrderProduct.setStoreNo(entity.getStoreName()); + storeOrderProduct.setStoreName(entity.getStoreName()); + storeOrderProduct.setTableNo(entity.getTableNo()); + storeOrderProduct.setTableName(entity.getTableName()); + //if (storeOrderProductEntity.getProductId() == null || "".equals(storeOrderProductEntity.getProductId()) || storeOrderProductEntity.getProductId().length() > 18 || Long.parseLong(storeOrderProductEntity.getProductId()) < 0) { + //去掉18位限制条件;2020-02-29-13:08 + if (storeOrderProductEntity.getProductId() == null || "".equals(storeOrderProductEntity.getProductId()) || Long.parseLong(storeOrderProductEntity.getProductId()) < 0) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductId(storeOrderProductEntity.getProductId()); + } + if (storeOrderProductEntity.getProductNo() != null && storeOrderProductEntity.getProductNo().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductNo(storeOrderProductEntity.getProductNo()); + } + if (storeOrderProductEntity.getProductName() == null || "".equals(storeOrderProductEntity.getProductName()) || storeOrderProductEntity.getProductName().length() > 128) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductName(storeOrderProductEntity.getProductName()); + } + if (storeOrderProductEntity.getProductUnitId() != null && storeOrderProductEntity.getProductUnitId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductUnitId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductUnitId(storeOrderProductEntity.getProductUnitId()); + } + if (storeOrderProductEntity.getProductUnitName() != null && storeOrderProductEntity.getProductUnitName().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductUnitName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductUnitName(storeOrderProductEntity.getProductUnitName()); + } + if (storeOrderProductEntity.getProductImageUrl() != null && storeOrderProductEntity.getProductImageUrl().length() > 256) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductImageUrl参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductImageUrl(storeOrderProductEntity.getProductImageUrl()); + } + if (storeOrderProductEntity.getTypeId() != null && storeOrderProductEntity.getTypeId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录TypeId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setTypeId(storeOrderProductEntity.getTypeId()); + } + if (storeOrderProductEntity.getSeriesId() != null && storeOrderProductEntity.getSeriesId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SeriesId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSeriesId(storeOrderProductEntity.getSeriesId()); + } + if (storeOrderProductEntity.getSeriesName() != null && storeOrderProductEntity.getSeriesName().length() > 64) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SeriesName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSeriesName(storeOrderProductEntity.getSeriesName()); + } + if (storeOrderProductEntity.getTypePath() != null && storeOrderProductEntity.getTypePath().length() > 256) { + response.setStatus(0); + response.setMessage("门店菜品销售记录TypePath参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setTypePath(storeOrderProductEntity.getTypePath()); + } + if (storeOrderProductEntity.getTypeName() != null && storeOrderProductEntity.getTypeName().length() > 64) { + response.setStatus(0); + response.setMessage("门店菜品销售记录TypeName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setTypeName(storeOrderProductEntity.getTypeName()); + } + if (storeOrderProductEntity.getSpecId() != null && storeOrderProductEntity.getSpecId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SpecId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSpecId(storeOrderProductEntity.getSpecId()); + } + if (storeOrderProductEntity.getSpecName() != null && storeOrderProductEntity.getSpecName().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SpecName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSpecName(storeOrderProductEntity.getSpecName()); + } + storeOrderProduct.setCount(storeOrderProductEntity.getCount()); + storeOrderProduct.setRcount(storeOrderProductEntity.getRcount()); + storeOrderProduct.setPrice(storeOrderProductEntity.getPrice()); + storeOrderProduct.setDiscountPrice(storeOrderProductEntity.getDiscountPrice()); + storeOrderProduct.setPriceOrg(storeOrderProductEntity.getPriceOrg()); + storeOrderProduct.setIsSuit(storeOrderProductEntity.getIsSuit()); + if (storeOrderProductEntity.getSuitId() != null && storeOrderProductEntity.getSuitId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SuitId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSuitId(storeOrderProductEntity.getSuitId()); + } + if (storeOrderProductEntity.getSuitId() != null && storeOrderProductEntity.getSuitId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SuitId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSuitId(storeOrderProductEntity.getSuitId()); + } + storeOrderProduct.setSaleDate(entity.getSaleDate());// 订单时间和销售时间一致 + storeOrderProduct.setAmount(storeOrderProductEntity.getAmount()); + storeOrderProduct.setDiscount(storeOrderProductEntity.getDiscount()); + storeOrderProduct.setDiscountTotal(storeOrderProductEntity.getDiscountTotal()); + storeOrderProduct.setReceivable(storeOrderProductEntity.getReceivable()); + storeOrderProduct.setAddPriceTotal(storeOrderProductEntity.getAddPriceTotal()); + storeOrderProduct.setDiscountAddTotal(storeOrderProductEntity.getDiscountAddTotal()); + storeOrderProduct.setAmountAddTotal(storeOrderProductEntity.getAmountAddTotal()); + storeOrderProduct.setAmountTotal(storeOrderProductEntity.getAmountTotal()); + storeOrderProduct.setReceivableTotal(storeOrderProductEntity.getReceivableTotal()); + storeOrderProduct.setPackageFee(storeOrderProductEntity.getPackageFee()); + storeOrderProduct.setIsMember(storeBusinessTicket.getIsMember()); + storeOrderProduct.setMemberNo(storeBusinessTicket.getMemberNo()); + lineNo++; + storeOrderProduct.setSeqNo(storeBusinessTicket.getSeqNo());// 当日流水号 + storeOrderProduct.setWeather(storeBusinessTicket.getWeather());// 天气 + storeOrderProduct.setWeeker(storeBusinessTicket.getWeeker());// 星期 + storeOrderProduct.setLineNo(storeOrderProductEntity.getLineNo() == null ? lineNo : storeOrderProductEntity.getLineNo());// 行号 + orderProductList.add(storeOrderProduct); + List storeOrderProductInfoEntityList = storeOrderProductEntity.getProductInfo(); + // 门店菜品销售记录优惠明细校验开始 + if (storeOrderProductInfoEntityList != null && storeOrderProductInfoEntityList.size() > 0) { + for (ProgramStoreOrderProductInfoEntity storeOrderProductInfoEntity : storeOrderProductInfoEntityList) { + ProgramStoreOrderProductInfo storeOrderProductInfo = new ProgramStoreOrderProductInfo(); + storeOrderProductInfo.setCreateDate(createDate); + storeOrderProductInfo.setCreateUser("open-api"); + storeOrderProductInfo.setProgramId(programId); + if (storeOrderProductInfoEntity.getClientId() == null || "".equals(storeOrderProductInfoEntity.getClientId()) || storeOrderProductInfoEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("销售单记录优惠ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductInfo.setClientId(storeOrderProductInfoEntity.getClientId()); + } + + if (storeOrderProductInfoEntity.getOrderItemId() != null && storeOrderProductInfoEntity.getOrderItemId().length() > 64) { + response.setStatus(0); + response.setMessage("销售单记录优惠OrderItemId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductInfo.setOrderItemId(storeOrderProductInfoEntity.getOrderItemId()); + } + storeOrderProductInfo.setStoreId(entity.getStoreId()); + storeOrderProductInfo.setBusNo(entity.getNo()); + storeOrderProductInfo.setType(storeOrderProductInfoEntity.getType()); + if (storeOrderProductInfoEntity.getInfo() != null && storeOrderProductInfoEntity.getInfo().length() > 256) { + response.setStatus(0); + response.setMessage("销售单优惠记录Info参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductInfo.setInfo(storeOrderProductInfoEntity.getInfo()); + } + storeOrderProductInfo.setDiscountMoney(storeOrderProductInfoEntity.getDiscountMoney()); + storeOrderProductInfo.setSaleDate(entity.getSaleDate()); + orderProductInfoList.add(storeOrderProductInfo); + } + } + List storeOrderProductMakeEntityList = storeOrderProductEntity.getProductMake(); + // 门店菜品做法明细校验开始 + if (storeOrderProductMakeEntityList != null && storeOrderProductMakeEntityList.size() > 0) { + for (ProgramStoreOrderProductMakeEntity storeOrderProductMakeEntity : storeOrderProductMakeEntityList) { + ProgramStoreOrderProductMake storeOrderProductMake = new ProgramStoreOrderProductMake(); + storeOrderProductMake.setCreateDate(createDate); + storeOrderProductMake.setCreateUser("open-api"); + storeOrderProductMake.setProgramId(programId); + if (storeOrderProductMakeEntity.getClientId() == null || "".equals(storeOrderProductMakeEntity.getClientId()) || storeOrderProductMakeEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("菜品做法ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductMake.setClientId(storeOrderProductMakeEntity.getClientId()); + } + if (storeOrderProductMakeEntity.getOrderItemId() != null && storeOrderProductMakeEntity.getOrderItemId().length() > 64) { + response.setStatus(0); + response.setMessage("菜品做法OrderItemId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductMake.setOrderItemId(storeOrderProductMakeEntity.getOrderItemId()); + } + storeOrderProductMake.setStoreId(entity.getStoreId()); + storeOrderProductMake.setStoreNo(entity.getStoreNo()); + storeOrderProductMake.setStoreName(entity.getStoreName()); + storeOrderProductMake.setBusNo(entity.getNo()); + if (storeOrderProductMakeEntity.getMakeId() != null && storeOrderProductMakeEntity.getMakeId().length() > 32) { + response.setStatus(0); + response.setMessage("菜品做法makeId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductMake.setMakeId(storeOrderProductMakeEntity.getMakeId()); + } + if (storeOrderProductMakeEntity.getMakeName() != null && storeOrderProductMakeEntity.getMakeName().length() > 32) { + response.setStatus(0); + response.setMessage("菜品做法makeName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductMake.setMakeName(storeOrderProductMakeEntity.getMakeName()); + } + storeOrderProductMake.setAddPrice(storeOrderProductMakeEntity.getAddPrice()); + storeOrderProductMake.setDiscountPrice(storeOrderProductMakeEntity.getDiscountPrice()); + storeOrderProductMake.setCount(storeOrderProductMakeEntity.getCount()); + storeOrderProductMake.setRcount(storeOrderProductMakeEntity.getRcount()); + storeOrderProductMake.setAddTotal(storeOrderProductMakeEntity.getAddTotal()); + storeOrderProductMake.setDiscountAddTotal(storeOrderProductMakeEntity.getDiscountAddTotal()); + storeOrderProductMake.setDiscount(storeOrderProductMakeEntity.getDiscount()); + storeOrderProductMake.setQtyFlag(storeOrderProductMakeEntity.getQtyFlag()); + storeOrderProductMake.setHand(0); + storeOrderProductMake.setSaleDate(entity.getSaleDate()); + makeList.add(storeOrderProductMake); + } + } + } + // 支付信息 + List payList = new ArrayList<>(); + List storePayEntityList = entity.getOrderPay(); + if (storePayEntityList != null && storePayEntityList.size() > 0) { + for (ProgramStorePayEntity storePayEntity : storePayEntityList) { + ProgramStorePay storePay = new ProgramStorePay(); + storePay.setCreateDate(createDate); + storePay.setCreateUser("open-api"); + storePay.setProgramId(programId); + if (storePayEntity.getClientId() == null || "".equals(storePayEntity.getClientId()) || storePayEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("支付信息ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setClientId(storePayEntity.getClientId()); + } + storePay.setStoreId(entity.getStoreId()); + storePay.setStoreNo(entity.getStoreNo()); + storePay.setStoreName(entity.getStoreName()); + storePay.setBusNo(entity.getNo()); + storePay.setBusMode(entity.getBusMode()); + if (storePayEntity.getPayNo() == null || "".equals(storePayEntity.getPayNo()) || storePayEntity.getPayNo().length() > 32) { + response.setStatus(0); + response.setMessage("支付信息PayNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setPayNo(storePayEntity.getPayNo()); + } + storePay.setTableNo(entity.getTableNo()); + storePay.setTableName(entity.getTableName()); + if (storePayEntity.getPayTypeNo() == null || "".equals(storePayEntity.getPayTypeNo()) || storePayEntity.getPayTypeNo().length() > 16) { + response.setStatus(0); + response.setMessage("支付信息PayTypeNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setPayTypeNo(storePayEntity.getPayTypeNo()); + } + if (storePayEntity.getPayType() == null || "".equals(storePayEntity.getPayType()) || storePayEntity.getPayType().length() > 16) { + response.setStatus(0); + response.setMessage("支付信息PayTyp参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setPayType(storePayEntity.getPayType()); + } + storePay.setMemo("支付成功"); + storePay.setPayDate(createDate); + storePay.setPaid(storePayEntity.getPaid()); + storePay.setRchange(0.00); + storePay.setMoney(storePayEntity.getMoney()); + storePay.setOverAmount(0.00); + if (storePayEntity.getVoucherNo() == null || "".equals(storePayEntity.getVoucherNo()) || storePayEntity.getVoucherNo().length() > 128) { + response.setStatus(0); + response.setMessage("支付信息VoucherNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setVoucherNo(storePayEntity.getVoucherNo()); + } + storePay.setCardno(storePayEntity.getCardno()); + storePay.setCardYe(storePayEntity.getCardYe()); + storePay.setCardJf(storePayEntity.getCardJf()); + storePay.setIncomeFlag(1); + storePay.setOtherRateType(0); + storePay.setOtherRateValue(0.00); + storePay.setOtherRate(0.00); + storePay.setPayChannel(-1);// 支付渠道 + payList.add(storePay); + } + } + ProgramBusinessOrderUpload businessOrderUpload = new ProgramBusinessOrderUpload(); + businessOrderUpload.setTicket(storeBusinessTicket); + businessOrderUpload.setTicketDeliver(storeBusinessTicketDeliver); + businessOrderUpload.setTicketInfos(ticketInfoList); + businessOrderUpload.setProducts(orderProductList); + businessOrderUpload.setProductInfos(orderProductInfoList); + businessOrderUpload.setMakes(makeList); + businessOrderUpload.setPays(payList); + StoreBusinessTicketCheck ticketCheck = programStoreBusinessTicketService.saveBusinessTicket(tenantId, businessOrderUpload); + if ("1".equals(ticketCheck.getStatus())) { + Map data = new HashMap<>(); + data.put("busNo", storeBusinessTicket.getNo()); + data.put("ticketId", ticketCheck.getTicketId()); + response.setStatus(1); + response.setMessage("订单同步成功"); + response.setData(data); + // 门店信消息压进缓存 + try { + Object programOrderIds = cacheService.get(tenantId, "program_" + entity.getStoreId()); + if (programOrderIds != null) { + Map orderIds = (Map) cacheService.get(tenantId, "program_" + entity.getStoreId()); + orderIds.put(String.valueOf(entity.getNo()), String.valueOf(entity.getNo())); + cacheService.set(tenantId, "program_" + entity.getStoreId(), orderIds, 0); + } else { + Map orderIds = new HashMap<>(); + orderIds.put(String.valueOf(entity.getNo()), String.valueOf(entity.getNo())); + cacheService.set(tenantId, "program_" + entity.getStoreId(), orderIds, 0); + } + } catch (Exception e) { + logger.error(info + "创建订单推送创建缓存失败>>>>>>>>>>"); + } + // 前台阿布订阅模型 + sendProgramMessage("cy2", tenantId, entity.getStoreId()); + } else { + response.setStatus(0); + response.setMessage("订单同步失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + logger.error("jsonString:" + jsonString); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + public void sendWxTemplement(String tenantId, String busNo, int type, ProgramStoreBusinessTicket programStoreBusinessTicket) { + try { + logger.error("发送模板消息=>>>>>" + tenantId); + logger.error("发送模板消息=>>>>>" + busNo); + logger.error("发送模板消息=>>>>>" + type); + logger.error("发送模板消息=>>>>>" + programStoreBusinessTicket); + ProgramSetting programSetting = programSettingService.get(tenantId, programStoreBusinessTicket.getProgramId()); + // 获取access_token + Map pbodyMapWx = JSONUtil.parseObject(programSetting.getWxBoday(), new TypeReference>() { + }); + String appId = pbodyMapWx.get("appId").toString(); + String appSecret = pbodyMapWx.get("appSecret").toString(); + String accessTokenKey = "programAccessToken:" + tenantId + ":" + appId + ":" + appSecret; + Object accessToken = cacheService.get(tenantId, accessTokenKey); + String content = ""; + if (accessToken == null) { + String url = String.format("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s", appId, appSecret); + HttpResponse response = HttpTool.url(url).get(); + content = HttpTool.getResponseAsString(response); + // 缓存 access_token + cacheService.set(tenantId, accessTokenKey, content, 120); + } else { + content = accessToken.toString(); + } + AuthAccessToken token = JSONUtil.parseObject(content, AuthAccessToken.class); + String tokenJson = JSONUtil.toJSONString(token); + logger.error("发送模板消息=>>>>>" + tokenJson); + String sendType = "";// 模板ID获取类型 + if (type == 3) { + sendType = "orderBack"; + } else { + sendType = "orderCreate"; + } + // 获取FormId + String keyFromId = "programFormId:" + tenantId + ":" + programStoreBusinessTicket.getProgramId() + ":" + sendType + ":" + programStoreBusinessTicket.getOpenId() + ":" + busNo; + Object fromId = cacheService.get(tenantId, keyFromId); + Map pbodyMapWxTemplate = JSONUtil.parseObject(programSetting.getWxTemplate(), new TypeReference>() { + }); + // 发送模板消息推送 + String url = "https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send?access_token=" + token.getAccessToken(); + String page = "pages/tabbar/launch"; + // 订单支付成功通知 + Map tem = new HashMap<>(); + switch (type) { + case 0:// 拒单 + tem.put("template_id", pbodyMapWxTemplate.get("orderRefuse").toString()); + break; + case 1:// 接单 + tem.put("template_id", pbodyMapWxTemplate.get("orderCheckSuccess").toString()); + break; + case 2:// 超时通知 + tem.put("template_id", pbodyMapWxTemplate.get("orderOverTime").toString()); + break; + case 3:// 订单退款通知 + tem.put("template_id", pbodyMapWxTemplate.get("orderBack").toString()); + break; + default: + break; + } + tem.put("touser", programStoreBusinessTicket.getOpenId()); + tem.put("page", page); + tem.put("form_id", fromId.toString());// formId 用于发送模板消息 + tem.put("emphasis_keyword", ""); + String busModeTx = "堂食"; + int busMode = programStoreBusinessTicket.getBusMode(); + switch (busMode) { + case 0: + busModeTx = "堂食"; + break; + case 1: + busModeTx = "外带"; + break; + case 2: + busModeTx = "预定"; + break; + case 3: + busModeTx = "外卖"; + break; + default: + break; + } + // 组装页面显示数据 + Map data = new HashMap<>(); + switch (type) { + case 0:// 拒单 + { + Map keyword1 = new HashMap<>(); + keyword1.put("value", busNo); + data.put("keyword1", keyword1);// 订单编号 + Map keyword2 = new HashMap<>(); + keyword2.put("value", "微信点餐(" + busModeTx + ")"); + data.put("keyword2", keyword2);// 订单类型 + Map keyword3 = new HashMap<>(); + keyword3.put("value", DateUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss")); + data.put("keyword3", keyword3);// 拒单时间 + Map keyword4 = new HashMap<>(); + keyword4.put("value", "店家忙不过来,为您带来的不便敬请谅解!"); + data.put("keyword4", keyword4);// 拒单原因 + } + break; + case 1:// 接单 + { + Map keyword1 = new HashMap<>(); + keyword1.put("value", programStoreBusinessTicket.getSeqNo()); + data.put("keyword1", keyword1);// 取餐号 + Map keyword2 = new HashMap<>(); + keyword2.put("value", "微信点餐(" + busModeTx + ")"); + data.put("keyword2", keyword2);// 订单类型 + Map keyword3 = new HashMap<>(); + keyword3.put("value", DateUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss")); + data.put("keyword3", keyword3);// 接单时间 + Map keyword4 = new HashMap<>(); + keyword4.put("value", programStoreBusinessTicket.getStoreName()); + data.put("keyword4", keyword4);// 商家名称 + Map keyword5 = new HashMap<>(); + keyword5.put("value", "您好,商家已成功接单,请留意取餐提醒!"); + data.put("keyword5", keyword5);// 微信提示 + } + break; + case 2:// 超时通知 + { + Map keyword1 = new HashMap<>(); + keyword1.put("value", busNo); + data.put("keyword1", keyword1);// 订单号 + Map keyword2 = new HashMap<>(); + keyword2.put("value", "微信点餐(" + busModeTx + ")"); + data.put("keyword2", keyword2);// 订单类型 + Map keyword3 = new HashMap<>(); + keyword3.put("value", DateUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss")); + data.put("keyword3", keyword3);// 接单时间 + Map keyword4 = new HashMap<>(); + keyword4.put("value", programStoreBusinessTicket.getStoreName()); + data.put("keyword4", keyword4);// 商家名称 + Map keyword5 = new HashMap<>(); + keyword5.put("value", "您好,商家接单超时,支付金额已原路返回,为您带来的不便敬请谅解!"); + data.put("keyword5", keyword5);// 微信提示 + } + break; + case 3:// 订单退款通知 + { + Map keyword1 = new HashMap<>(); + keyword1.put("value", busNo); + data.put("keyword1", keyword1);// 订单号 + Map keyword2 = new HashMap<>(); + keyword2.put("value", "微信点餐(" + busModeTx + ")"); + data.put("keyword2", keyword2);// 订单类型 + Map keyword3 = new HashMap<>(); + keyword3.put("value", DateUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss")); + data.put("keyword3", keyword3);// 退款时间 + Map keyword4 = new HashMap<>(); + keyword4.put("value", new DecimalFormat("0.00").format(programStoreBusinessTicket.getReceivable() + programStoreBusinessTicket.getDeliverFee() + programStoreBusinessTicket.getPackageFee())); + data.put("keyword4", keyword4);// 退款金额 + Map keyword5 = new HashMap<>(); + keyword5.put("value", "您好,商家同意退款,支付金额已原路返回!"); + data.put("keyword5", keyword5);// 退款原因 + } + break; + default: + break; + } + tem.put("data", data); + String json = JSONUtil.toJSONString(tem); + logger.error("发送模板消息=>>>>>:{}:{}模板消息", tenantId, json); + HttpResponse response = HttpTool.url(url).contentType("application/x-www-form-urlencoded").body(json).post(); + content = HttpTool.getResponseAsString(response); + logger.error("发送模板消息=>>>>>:{}:{}模板消息返回", tenantId, content); + } catch (Exception e) { + logger.error("发送模板消息=>>>>>" + ",发生异常", e); + } + } + + + @ServiceMethod(method = "program.handle.order.period", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "时间段内未处理的订单") + @Override + public Object ProgramHandleOrderPeriod(ProgramOrderHandlePeriodRequest request) { + String info = "时间段内巨为小程序待处理订单"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String startTime = request.getStartTime(); + String endTime = request.getEndTime(); + // 收银机端专用 + CommonListResponse response = null; + try { + List> list = new ArrayList<>(); + response = new CommonListResponse(); + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.or(Restrictions.eq("status", 0), Restrictions.eq("refundStatus", 1))); + criteria.add(Restrictions.ge("saleDate",startTime)); + criteria.add(Restrictions.le("saleDate",endTime)); + List ticketList = programStoreBusinessTicketService.getList(tenantId, criteria); + DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + if (CollectionUtils.isNotEmpty(ticketList)) { + for (ProgramStoreBusinessTicket programStoreBusinessTicket : ticketList) { + Map map = new HashMap<>(); + map.put("id", programStoreBusinessTicket.getId()); + map.put("tenantId", programStoreBusinessTicket.getTenantId()); + map.put("memberId", programStoreBusinessTicket.getMemberId()); + map.put("openId", programStoreBusinessTicket.getOpenId()); + map.put("sourceType", programStoreBusinessTicket.getSourceType()); + map.put("touxiang", programStoreBusinessTicket.getTouxiang()); + map.put("memberName", programStoreBusinessTicket.getMemberName()); + map.put("mobile", programStoreBusinessTicket.getMobile()); + map.put("no", programStoreBusinessTicket.getNo()); + map.put("storeId", programStoreBusinessTicket.getStoreId()); + map.put("storeNo", programStoreBusinessTicket.getStoreNo()); + map.put("storeName", programStoreBusinessTicket.getStoreName()); + map.put("status", programStoreBusinessTicket.getStatus()); + map.put("deliverStatus", programStoreBusinessTicket.getDeliverStatus()); + map.put("refundStatus", programStoreBusinessTicket.getRefundStatus()); + map.put("saleDate", fmt.format(programStoreBusinessTicket.getSaleDate())); + map.put("tableNo", programStoreBusinessTicket.getTableNo()); + map.put("tableName", programStoreBusinessTicket.getTableName()); + map.put("people", programStoreBusinessTicket.getPeople()); + map.put("busMode", programStoreBusinessTicket.getBusMode()); + map.put("reserveTime", programStoreBusinessTicket.getReserveTime()); + map.put("deliverFee", programStoreBusinessTicket.getDeliverFee()); + map.put("packageFee", programStoreBusinessTicket.getPackageFee()); + map.put("amount", programStoreBusinessTicket.getAmount()); + map.put("discount", programStoreBusinessTicket.getDiscount()); + map.put("discountTotal", programStoreBusinessTicket.getDiscountTotal()); + map.put("receivable", programStoreBusinessTicket.getReceivable()); + map.put("maling", programStoreBusinessTicket.getMaling()); + map.put("paid", programStoreBusinessTicket.getPaid()); + map.put("noOrg", programStoreBusinessTicket.getNoOrg()); + map.put("backCause", programStoreBusinessTicket.getBackCause()); + map.put("isMember", programStoreBusinessTicket.getIsMember()); + map.put("memberNo", programStoreBusinessTicket.getMemberNo()); + map.put("memberJifen", programStoreBusinessTicket.getMemberJifen()); + map.put("seqNo", programStoreBusinessTicket.getSeqNo()); + map.put("weather", programStoreBusinessTicket.getWeather()); + map.put("weeker", programStoreBusinessTicket.getWeeker()); + map.put("ext1", programStoreBusinessTicket.getExt1()); + map.put("ext2", programStoreBusinessTicket.getExt2()); + criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketId", programStoreBusinessTicket.getId())); + criteria.add(Restrictions.eq("storeId", storeId)); + // 获取主单优惠 + List ticketInfoList = programStoreBusinessTicketInfoService.getList(tenantId, criteria); + List> ticketInfo = new ArrayList<>(); + for (ProgramStoreBusinessTicketInfo item : ticketInfoList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("busNo", item.getBusNo()); + itemMap.put("type", item.getType()); + itemMap.put("info", item.getInfo()); + itemMap.put("discountMoney", item.getDiscountMoney()); + ticketInfo.add(itemMap); + } + map.put("ticketInfo", ticketInfo); + // 获取主单优惠 + List ticketDeliverList = programStoreBusinessTicketDeliverService.getList(tenantId, criteria); + List> ticketDeliver = new ArrayList<>(); + for (ProgramStoreBusinessTicketDeliver item : ticketDeliverList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("busNo", item.getBusNo()); + itemMap.put("orderTel", item.getOrderTel()); + itemMap.put("name", item.getName()); + itemMap.put("address", item.getAddress()); + itemMap.put("latitude", item.getLatitude()); + itemMap.put("longitude", item.getLongitude()); + itemMap.put("deliverType", item.getDeliverType()); + itemMap.put("deliverFee", item.getDeliverFee()); + itemMap.put("logisticsDispatcherMobile", item.getLogisticsDispatcherMobile()); + itemMap.put("logisticsDispatcherName", item.getLogisticsDispatcherName()); + itemMap.put("logisticsReceiptTime", item.getLogisticsReceiptTime()); + itemMap.put("logisticsFetchTime", item.getLogisticsFetchTime()); + itemMap.put("logisticsFinishTime", item.getLogisticsFinishTime()); + ticketDeliver.add(itemMap); + } + map.put("ticketDeliver", ticketDeliver); + // 获取订单商品信息 + List orderProductList = programStoreOrderProductService.getList(tenantId, criteria); + List> orderProduct = new ArrayList<>(); + for (ProgramStoreOrderProduct item : orderProductList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("clientId", item.getClientId()); + itemMap.put("parentId", item.getParentId()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("productId", item.getProductId()); + itemMap.put("productNo", item.getProductNo()); + itemMap.put("productName", item.getProductName()); + itemMap.put("productUnitId", item.getProductUnitId()); + itemMap.put("productUnitName", item.getProductUnitName()); + itemMap.put("productImageUrl", item.getProductImageUrl()); + itemMap.put("seriesId", item.getSeriesId()); + itemMap.put("seriesName", item.getSeriesName()); + itemMap.put("typePath", item.getTypePath()); + itemMap.put("typeId", item.getTypeId()); + itemMap.put("typeName", item.getTypeName()); + itemMap.put("specId", item.getSpecId()); + itemMap.put("specName", item.getSpecName()); + itemMap.put("count", item.getCount()); + itemMap.put("rcount", item.getRcount()); + itemMap.put("price", item.getPrice()); + itemMap.put("priceOrg", item.getPriceOrg()); + itemMap.put("discountPrice", item.getDiscountPrice()); + itemMap.put("isSuit", item.getIsSuit()); + itemMap.put("suitId", item.getSuitId()); + itemMap.put("amount", item.getAmount()); + itemMap.put("discount", item.getDiscount()); + itemMap.put("discountTotal", item.getDiscountTotal()); + itemMap.put("receivable", item.getReceivable()); + itemMap.put("addPriceTotal", item.getAddPriceTotal()); + itemMap.put("discountAddTotal", item.getDiscountAddTotal()); + itemMap.put("amountAddTotal", item.getAmountAddTotal()); + itemMap.put("amountTotal", item.getAmountTotal()); + itemMap.put("receivableTotal", item.getReceivableTotal()); + itemMap.put("lineNo", item.getLineNo()); + itemMap.put("seqNo", item.getSeqNo()); + orderProduct.add(itemMap); + } + map.put("orderProduct", orderProduct); + // 获取产品做法信息 + List makeList = programStoreOrderProductMakeService.getList(tenantId, criteria); + List> makeInfo = new ArrayList<>(); + for (ProgramStoreOrderProductMake item : makeList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("orderItemId", item.getOrderItemId()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("busNo", item.getBusNo()); + itemMap.put("makeId", item.getMakeId()); + itemMap.put("makeName", item.getMakeName()); + itemMap.put("addPrice", item.getAddPrice()); + itemMap.put("discountPrice", item.getDiscountPrice()); + itemMap.put("count", item.getCount()); + itemMap.put("rcount", item.getRcount()); + itemMap.put("addTotal", item.getAddTotal()); + itemMap.put("discountAddTotal", item.getDiscountAddTotal()); + itemMap.put("discount", item.getDiscount()); + itemMap.put("qtyFlag", item.getQtyFlag()); + itemMap.put("hand", item.getHand()); + makeInfo.add(itemMap); + } + map.put("makeInfo", makeInfo); + // 产品支付明细 + List payList = programStorePayService.getList(tenantId, criteria); + List> payInfo = new ArrayList<>(); + for (ProgramStorePay item : payList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("payNo", item.getPayNo()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("busNo", item.getBusNo()); + itemMap.put("payTypeNo", item.getPayTypeNo()); + itemMap.put("payType", item.getPayType()); + itemMap.put("paid", item.getPaid()); + itemMap.put("payDate", item.getPayDate() == null ? "" : fmt.format(item.getPayDate())); + itemMap.put("rchange", item.getRchange()); + itemMap.put("money", item.getMoney()); + itemMap.put("overAmount", item.getOverAmount()); + itemMap.put("voucherNo", item.getVoucherNo()); + itemMap.put("cardno", item.getCardno()); + itemMap.put("cardYe", item.getCardYe()); + itemMap.put("cardJf", item.getCardJf()); + itemMap.put("incomeFlag", item.getIncomeFlag()); + itemMap.put("otherRateType", item.getOtherRateType()); + itemMap.put("otherRateValue", item.getOtherRateValue()); + itemMap.put("otherRate", item.getOtherRate()); + itemMap.put("payChannel", item.getPayChannel()); + itemMap.put("memo", item.getMemo()); + payInfo.add(itemMap); + } + map.put("payInfo", payInfo); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "program.order.delivery.query", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "时间段内未处理的订单") + @Override + public Object ProgramDeliverInfoQuery(ProgramOrderQueryByBusNoRequest request) { + String info = "巨为小程序订单配送信息"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String busNo = request.getBusNo(); + CommonDataResponse response = null; + try{ + response = new CommonDataResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("no", busNo)); + criteria.add(Restrictions.eq("storeId", storeId)); + List ticketList = programStoreBusinessTicketService.getList(tenantId, criteria); + DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + if (CollectionUtils.isNotEmpty(ticketList)) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + ProgramStoreBusinessTicket programStoreBusinessTicket = ticketList.get(0); + Map map = new HashMap<>(); + + map.put("status",programStoreBusinessTicket.getStatus()); + //-1等待付款0待接单1已确认2已配送3已取消4已完成 + map.put("statusDesc",programStoreBusinessTicket.getStatus() == -1? "待付款" : programStoreBusinessTicket.getStatus() == 0? "待接单" : programStoreBusinessTicket.getStatus() == 1? "已确认" : programStoreBusinessTicket.getStatus() == 2 ? "已配送" : programStoreBusinessTicket.getStatus() == 3 ? "已取消" : programStoreBusinessTicket.getStatus() == 4 ? "已完成" : ""); + map.put("orderCreateDate",sdf.format(programStoreBusinessTicket.getCreateDate())); + map.put("orderConfirmDate",sdf.format(programStoreBusinessTicket.getCreateDate())); + criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketId", programStoreBusinessTicket.getId())); + List pays = programStorePayService.getList(tenantId,criteria); + if(CollectionUtils.isNotEmpty(pays)){ + ProgramStorePay storePay = pays.get(0); + map.put("orderPaidDate",sdf.format(storePay.getPayDate())); + } + + //查询订单确认时间,通过扣减库存信息获取; + criteria = new Criteria(); + criteria.add(Restrictions.eq("orderNo",busNo)); + criteria.add(Restrictions.eq("storeId",storeId)); + List logs = productStoreStockLogService.getList(tenantId,criteria); + if(CollectionUtils.isNotEmpty(logs)){ + map.put("orderConfirmDate",sdf.format(logs.get(0).getCreateDate())); + } + + //订单配送信息; + Integer deliverStatus = -1; + String deliverStatusDesc = "待下单"; + map.put("deliverStatus",deliverStatus); + map.put("deliverStatusDesc",deliverStatusDesc); + map.put("riderName",""); + map.put("riderPhone",""); + map.put("deliverySysName",""); + map.put("beginTime",""); + map.put("ongoingTime",""); + map.put("endTime",""); + + //通过外卖餐道接口,获取配送信息; + Map paramMap = new HashMap<>(); + paramMap.put("orderId",programStoreBusinessTicket.getId()); + String content = HttpUtils.executePost(candaoProperties.getCandaoDispatchUrl()+"/delivery/getDeliveryDetailByOrderId",paramMap); + if(org.apache.commons.lang3.StringUtils.isNotEmpty(content)){ + Integer status = JSON.parseObject(content).get("status") == null ? 0 : (Integer) JSON.parseObject(content).get("status"); + if(status == 1){ + JSONObject object1 = JSON.parseObject(content); + JSONObject object = JSON.parseObject(object1.get("data")+""); + Integer candaoDeliveryStatus = (Integer) object.get("deliveryStatus"); + switch (candaoDeliveryStatus){ + case 2: + case -4: + case 4: + case -1: + case -2: + case 8: + deliverStatus = 0; + deliverStatusDesc = "已下单"; + break; + case 5: + case -5: + deliverStatus = 1; + deliverStatusDesc = "骑手已接单"; + break; + case 6: + deliverStatus = 2; + deliverStatusDesc = "骑手已取餐"; + break; + case 7: + deliverStatus = 5; + deliverStatusDesc = "骑手配送中"; + break; + case 10: + deliverStatus = 3; + deliverStatusDesc = "骑手已送达"; + break; + case 15: + deliverStatus = 4; + deliverStatusDesc = "配送取消"; + break; + default: + logger.info(info+"配送其他类型信息,status>>>>>"+status); + break; + } + map.put("deliverStatus",deliverStatus); + map.put("deliverStatusDesc",deliverStatusDesc); + map.put("riderName",object.get("riderName")); + map.put("riderPhone",object.get("riderPhone")); + map.put("deliverySysName",object.get("deliverySysName")); + map.put("beginTime",object.get("beginTime")); + map.put("ongoingTime",object.get("ongoingTime")); + map.put("endTime",object.get("endTime")); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setData(map); + }else{ + response.setStatus(0); + response.setMessage("订单不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + }catch (Exception e){ + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + + return response; + } + + @Override + @ServiceMethod(method = "program.order.getOrderDetail", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "消费/托收/提现/退款查询") + public Object getOrderDetail(ProgramWeixinPayQueryRequest request) { + String info = "消费/托收/提现/退款查询接口"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + RLock lock = null; + //商户订单号 + String reqsnNo=request.getTradeNo(); + logger.info("商户订单号:" + reqsnNo); + Reqsn reqsn = new Reqsn(); + reqsn.setReqsn(reqsnNo); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + String content=TlHttpClient.post("order.getOrderDetail", reqsn); + System.out.println(info+"content:"+content); + JSONObject jsonObject = JSON.parseObject(content); + if ("10000".equals(jsonObject.getString("code"))&&"OK".equals(jsonObject.getString("subCode"))) { + JSONObject jsonData = JSON.parseObject(jsonObject.getString("data")); + String status=jsonData.getString("status"); + String remark=jsonData.getString("remark"); + String total_fee = jsonData.getString("amount");// 支付金额 + String fee = jsonData.getString("fee");// 手续费 + String user_id = jsonData.getString("payuserid");// 手续费 + String merchant_no = jsonData.getString("sybcusid\t");// 商户号 + String terminal_id = jsonData.getString("termno");// 终端号 + String channel_trade_no = jsonData.getString("payInterfaceOutTradeNo");// 通道订单号,微信订单号、支付宝订单号等 + if("4".equals(status)){ + String attachArray[] = remark.split("_"); + String tenantId = attachArray[0];// 租户编号 + String storeId = attachArray[1];// 门店ID + String busNo = attachArray[2];// 订单号 + String keysuccess = "programBusNo:" + tenantId + ":" + storeId + ":" + busNo; + lock = redissonClient.getLock(keysuccess); + lock.lock(5, TimeUnit.SECONDS); + Object busNoValue = cacheService.get(tenantId, keysuccess); + if (busNoValue != null && busNo.equals(busNoValue.toString().split("_")[0])) { + response.setStatus(4); + response.setMessage("支付成功,订单信息上传成功"); + logger.error(info + "支付成功,订单信息上传成功"); + return response; + } + ProgramStoreBusinessTicket enity = programStoreBusinessTicketService.find(tenantId, "no", busNo); + // 支付金额= 订单应收+餐盒费+配送费 + if ((enity.getReceivable() + enity.getPackageFee() + enity.getDeliverFee()) != (Double.parseDouble(total_fee) / 100)) { + response.setStatus(4); + response.setMessage("支付成功,单订金额不符"); + logger.error(info + "支付成功,单订金额不符"); + return response; + } + // 生成取餐号 + DateFormat fmt = new SimpleDateFormat("yyyyMMdd"); + String day = fmt.format(new Date()); + String key = "wxBus:" + tenantId + ":" + storeId + ":" + day; + cacheService.setQueue(tenantId, key, enity.getNo(), 60 * 60 * 24); + //int random = (int) (Math.random() * 10 + 1); + String datSeq = ""; + //按南宁要求,取餐号为 600-799 2020-04-10 13:49 + if (StringUtils.startsWith(tenantId, "77")) { + int queueSize = cacheService.getQueueSize(tenantId, key); + int daySize = queueSize + 600; + logger.error("单号:" + enity.getNo() + " queueSize =============>" + queueSize); + if (daySize >= 800) { + int index = queueSize / 200; + daySize = daySize - 200 * index; + logger.error("单号:" + enity.getNo() + " daySize =============>" + daySize); + } + datSeq = daySize + ""; + } else { + String random = "0"; + String busMode = "T"; + if (enity.getBusMode() == 0) { + busMode = "T"; + } else if (enity.getBusMode() == 1) { + busMode = "D"; + } else if (enity.getBusMode() == 2) { + busMode = "Y"; + } else { + busMode = "W"; + } + String suffix = String.format("%0" + 3 + "d", cacheService.getQueueSize(tenantId, key)); + + if (suffix.length() > 3) { + datSeq = busMode + suffix; + } else { + datSeq = busMode + random + suffix; + } + } + + logger.error("单号:" + enity.getNo() + "=============>" + datSeq); + enity.setSeqNo(datSeq);// 取餐号 + enity.setStatus(0);// 更改主单为待接单状态 + // 门店菜品销售记录优惠明细校验开始 + List payList = new ArrayList<>(); + Date createDate = new Date(); + ProgramStorePay storePay = new ProgramStorePay(); + storePay.setProgramId(enity.getProgramId()); + storePay.setCreateDate(createDate); + storePay.setCreateUser("open-api"); + storePay.setClientId(enity.getClientId()); + storePay.setStoreId(enity.getStoreId()); + storePay.setStoreNo(enity.getStoreNo()); + storePay.setStoreName(enity.getStoreName()); + storePay.setBusNo(enity.getNo()); + storePay.setBusMode(enity.getBusMode()); + storePay.setPayNo(enity.getNo()); + storePay.setTableNo(enity.getTableNo()); + String notifyPayType = ""; + + storePay.setPayTypeNo("05"); + storePay.setPayType("微信支付"); + storePay.setMemo("通联微信支付成功"); + notifyPayType = "WEIXIN"; + + storePay.setPayTypeNo("50"); + storePay.setPayDate(createDate); + storePay.setPaid(Double.parseDouble(total_fee) / 100); + storePay.setRchange(0.00); + storePay.setMoney(Double.parseDouble(total_fee) / 100); + storePay.setOverAmount(0.00); + storePay.setVoucherNo(null); + storePay.setCardno(""); + storePay.setCardYe(0.00); + storePay.setCardJf(0.00); + storePay.setIncomeFlag(1); + storePay.setOtherRateType(0); + storePay.setOtherRateValue(0.00); + storePay.setOtherRate(0.00); + storePay.setPayChannel(8);// 扫呗支付 + storePay.setDeductionRate(enity.getDeductionRate()); + //storePay.setChargeBack(enity.getChargeBack()); + storePay.setChargeBack(Double.parseDouble(fee) / 100); + storePay.setSettleFlag(0); + payList.add(storePay); + StoreBusinessTicketCheck ticketCheck = programStoreBusinessTicketService.updateBusinessTicket(tenantId, enity, payList); + if ("1".equals(ticketCheck.getStatus())) { + try { + // 存储支付成功的Key + cacheService.set(tenantId, keysuccess, busNo + "_" + datSeq + "_" + notifyPayType, 60 * 60 * 24); + // 门店信消息压进缓存 + try { + Object programOrderIds = cacheService.get(tenantId, "program_" + storeId); + if (programOrderIds != null) { + Map orderIds = (Map) cacheService.get(tenantId, "program_" + storeId); + orderIds.put(String.valueOf(enity.getNo()), String.valueOf(enity.getNo())); + cacheService.set(tenantId, "program_" + storeId, orderIds, 1200); + } else { + Map orderIds = new HashMap<>(); + orderIds.put(String.valueOf(enity.getNo()), String.valueOf(enity.getNo())); + cacheService.set(tenantId, "program_" + storeId, orderIds, 1200); + } + } catch (Exception e) { + logger.error(info + "创建订单推送创建缓存失败>>>>>>>>>>"); + } + //前台阿布订阅模型 + sendProgramMessage("cy2", tenantId, storeId); + Map orderMap = new HashMap<>(); + orderMap.put("tenantId", tenantId); + orderMap.put("storeId", storeId); + orderMap.put("orderNo", enity.getNo()); + orderMap.put("reSendNums", 0); + this.mqMessageSender.send4jwprogramordermessage(tenantId, orderMap, RabbitConstant.ROUTING_KEY_JW_PROGRAM_ORDER_NOTIFY_DELAY, new CorrelationData(UUID.randomUUID().toString()), 1000L * 60); + //启动退款定时任务,3分钟不接单自动退款 + Map eventDatas = new HashMap<>(); + eventDatas.put("tenantId", tenantId); + eventDatas.put("storeId", storeId); + eventDatas.put("busNo", busNo); + eventBus.notify(EventKeys.PROGRAM_ORDER_PAY, Event.wrap(eventDatas)); + response.setStatus(4); + response.setMessage("支付成功,订单信息上传成功"); + logger.error(info + "支付成功,订单信息上传成功"); + } catch (Exception ex) { + response.setStatus(3); + response.setMessage("支付失败"); + logger.error(info, ex); + } + } else { + response.setStatus(3); + response.setMessage("支付订单信息保存失败"); + logger.error(info + "支付订单信息保存失败"); + } + + RMapCache stringMapRMapCache = redissonClient.getMapCache("weixin:small:loginKey:session"); + if (stringMapRMapCache.get(user_id) != null) { + String loginKey = stringMapRMapCache.get(user_id); + if (StringUtils.isNotBlank(loginKey)) { + RMapCache> sSessionMap = redissonClient.getMapCache("weixin:small:session"); + if (sSessionMap.get(loginKey) != null) { + Map data = sSessionMap.get(loginKey); + if (data.get("sessionKey") != null && StringUtils.isNotBlank(data.get("sessionKey").toString())) { + logger.info("通联订单上传异步任务:tradeNo" + busNo); + //扫呗订单上传; + Map eventData = new HashMap<>(); + eventData.put("tenantId", tenantId); + eventData.put("ticketId", enity.getId()); + eventData.put("merchant_no", merchant_no); + eventData.put("terminal_id", terminal_id); + eventData.put("out_order_no", null); + eventData.put("transaction_id", channel_trade_no); + eventData.put("user_id", user_id); + eventData.put("session_key", data.get("sessionKey").toString()); + eventData.put("out_trade_no", busNo); + eventData.put("storeNo", enity.getStoreNo()); + eventData.put("storeId", enity.getStoreId()); + eventData.put("total_amount", ((Double) (enity.getAmount() * 100)).intValue()); + eventData.put("discount_amount", ((Double) (enity.getDiscountTotal() * 100)).intValue()); + eventData.put("user_amount", ((Double) (enity.getReceivable() * 100)).intValue()); + + eventBus.notify(EventKeys.PROGRAM_ORDER_SAOBEI_UPLOAD, Event.wrap(eventData)); + } else { + logger.info("通联订单上传异步任务:sessionKey 不存在"); + } + } else { + logger.info("通联订单上传异步任务:sSessionMap 不存在"); + } + } else { + logger.info("通联订单上传异步任务:loginKey" + loginKey + " ---------------- >>>>> 失败"); + } + } else { + logger.info("通联订单上传异步任务:user_id" + user_id + " ---------------- >>>>> 失败"); + } + }else if("99".equals(status)){ + response.setStatus(99); + response.setMessage("订单支付中"); + logger.error(info + "订单支付中"); + return response; + }else if("3".equals(status)){ + response.setStatus(3); + response.setMessage("交易失败"); + logger.error(info + "交易失败"); + return response; + }else if("1".equals(status)){ + response.setStatus(1); + response.setMessage("未支付"); + logger.error(info + "未支付"); + return response; + }else if("5".equals(status)){ + response.setStatus(5); + response.setMessage("交易成功-发生退款"); + logger.error(info + "交易成功-发生退款"); + return response; + }else if("6".equals(status)){ + response.setStatus(6); + response.setMessage("交易关闭"); + logger.error(info + "交易关闭"); + return response; + } + } + + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + public static void main(String[] args) { + /*String content="{\"code\":\"10000\",\"data\":\"{\\\"orderNo\\\":\\\"1701250710462533632\\\",\\\"payInfo\\\":\\\"{\\\\\\\"appId\\\\\\\":\\\\\\\"wxef277996acc166c3\\\\\\\",\\\\\\\"timeStamp\\\\\\\":\\\\\\\"1694444752\\\\\\\",\\\\\\\"nonceStr\\\\\\\":\\\\\\\"3dd210af5b5540aca4b922e9af5358f1\\\\\\\",\\\\\\\"package\\\\\\\":\\\\\\\"prepay_id=wx11230552070033559ae87975f3420a0000\\\\\\\",\\\\\\\"signType\\\\\\\":\\\\\\\"RSA\\\\\\\",\\\\\\\"paySign\\\\\\\":\\\\\\\"q7PsgO8DYScTciTlDYpWzSCpQNaz7PX9JQgNrY+xgNqSSMyHpzfvan/Z/UDys2xKdo0TR7nd4SIbZajlAcO9FIbT2cFLfQYLMXoo48gXNXS68GAdaoPr77dCu2+ontj/gvhd26ELACdGdHUrCZ5rhgVVFfdHZSsfMN382idlYciRZfDjaKsGNA6pyL/jMldNks3ozeNV3syZjPkMTz8DZs4EXv9irAHJb/WnCJ0Ru6WBUE1sO99mhP50ewBP93hOzTSkWYbCyftc4SMVw+c4w/QY1OASIpANVKTs2hU9oSY4n0kpdhN6oFvNrjYLK6QOrGsLwFUk1M3A+MHXygIjEA==\\\\\\\"}\\\",\\\"bizOrderNo\\\":\\\"po-1694444751339\\\"}\",\"msg\":\"服务调用成功\",\"sign\":\"cfb4909575643f1e6949c8246c3484e0\",\"subCode\":\"OK\"}"; + JSONObject jsonObject = JSON.parseObject(content); + if ("10000".equals(jsonObject.getString("code"))&&"OK".equals(jsonObject.getString("subCode"))) { + JSONObject jsonData = JSON.parseObject(jsonObject.getString("data")); + JSONObject perData = JSON.parseObject(jsonData.getString("payInfo")); + + System.out.println(perData.toJSONString()); + Map prepay = new HashMap<>(); + prepay.put("appId", perData.getString("appId")); + prepay.put("timeStamp", perData.getString("timeStamp")); + prepay.put("nonceStr", perData.getString("nonceStr")); + prepay.put("package", perData.getString("package")); + prepay.put("signType", perData.getString("signType")); + prepay.put("paySign", perData.getString("paySign")); + prepay.put("outTradeNo", jsonData.getString("bizOrderNo")); + System.out.println(prepay.toString()); + }*/ + /*SplitShopAmount d1 = new SplitShopAmount(); + d1.setBizUserId("123"); + d1.setAmount(new BigDecimal("5.1")); + SplitShopAmount d2 = new SplitShopAmount(); + d2.setBizUserId("123"); + d2.setAmount(new BigDecimal("5.1")); + SplitShopAmount d3 = new SplitShopAmount(); + d3.setBizUserId("123"); + d3.setAmount(new BigDecimal("5.1")); + SplitShopAmount d4 = new SplitShopAmount(); + d4.setBizUserId("234"); + d4.setAmount(new BigDecimal("5.1")); + SplitShopAmount d5 = new SplitShopAmount(); + d5.setBizUserId("234"); + d5.setAmount(new BigDecimal("5.1")); + List debtCustList = Arrays.asList(new SplitShopAmount[]{d1, d2, d3, d4, d5});*/ + + Map map = new HashMap(); + /*for(SplitShopAmount stu: debtCustList){ + String name = stu.getBizUserId(); + BigDecimal amount= (BigDecimal) stu.getAmount(); + if(map.containsKey(name)){ + BigDecimal bmap= (BigDecimal) map.get(name); + BigDecimal amountall=bmap.add((BigDecimal) stu.getAmount()); + map.put(name, amountall); + }else{ + map.put(name, (BigDecimal) stu.getAmount()); + } + } + String json = JSON.toJSONString(map); + System.out.println(json); + + final JSONArray tranlist = new JSONArray(); + BigDecimal b100=new BigDecimal(100); + for (Map.Entry entry : map.entrySet()) { + HashMap ttail1 = new HashMap<>(); + ttail1.put("bizUserId", entry.getKey()); + ttail1.put("amount", b100.multiply((BigDecimal) entry.getValue()).intValue()); + tranlist.add(ttail1); + } + String j2son=JSON.toJSONString(tranlist); + System.out.println(j2son); + for (Map.Entry entry : map.entrySet()) { + System.out.println("姓名:" + entry.getKey() + ", 分数: " + entry.getValue()); + } +*/ + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/impl/ProgramProductServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/impl/ProgramProductServiceImpl.java new file mode 100644 index 0000000..53a85db --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/impl/ProgramProductServiceImpl.java @@ -0,0 +1,1454 @@ +package com.jwsaas.api.service.program.impl; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.concurrent.CompletableFuture; + +import javax.annotation.Resource; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.jwsaas.api.request.program.ProgramProductSaleStatusRequest; +import com.jwsaas.api.request.program.ProgramProductStockRequest; +import com.jwsaas.cache.data.ProgramProductInfoCache; +import com.jwsaas.entity.food.*; +import com.jwsaas.mqtt.MqttClientExt; +import com.jwsaas.service.food.ProductSpecService; +import com.jwsaas.service.food.ProgramPromotionTaskService; +import com.jwsaas.service.food.ProgramStoreProductService; +import com.jwsaas.util.JSONUtil; +import com.jwsaas.util.StringUtils; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.ArrayUtils; +import org.springframework.beans.factory.annotation.Autowired; + +import com.jwsaas.api.request.program.ProgramProductRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.program.ProgramProductService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.properties.FdfsClientProperties; +import com.jwsaas.utils.AppKeyUtil; + +@ServiceMethodBean(version = "1.0") +public class ProgramProductServiceImpl extends WopServiceImpl implements ProgramProductService { + + private static final long serialVersionUID = 6374707101234781329L; + + @Resource + private com.jwsaas.service.food.ProgramSettingService programSettingService; + + @Resource + private com.jwsaas.service.food.ProgramProductCategoryService programProductCategoryService; + + @Resource + private com.jwsaas.service.food.ProgramStoreService programStoreService; + + @Resource + private com.jwsaas.service.food.StoreProductService storeProductService; + + @Resource + private com.jwsaas.service.food.ProductTypeService productTypeService; + + @Resource + private ProductSpecService productSpecService; + + @Resource + private ProgramStoreProductService programStoreProductService; + + @Autowired + private FdfsClientProperties fdfsClientProperties; + + @Resource + private com.jwsaas.cache.CacheService cacheService; + + @Resource + private MqttClientExt mqttClient; + + @Autowired + private ProgramProductInfoCache programProductInfoCache; + + @Resource + private ProgramPromotionTaskService programPromotionTaskService; + + + @ServiceMethod(method = "program.product", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "订单创建") + @Override + public Object ProgramProductCategory(ProgramProductRequest request) { + String info = "小程序门店信息"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String programId = request.getProgramId(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + ProgramSetting programSetting = programSettingService.get(tenantId, programId); + if (programSetting == null) { + response.setStatus(0); + response.setMessage("小程序设置不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + // 启用线上资料独立 + if (programSetting.getLineFlag() == 1) { + response = getProuctDataStoreLine(response, tenantId, storeId, programId); + } else { + response = getProuctDataStore(response, tenantId, storeId, programId); + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + + + /** + * 获取门店在线资料 + * + * @param response + * @param tenantId + * @param storeId + * @param programId + * @return + * @throws Exception + */ + public CommonDataResponse getProuctDataStoreLine(CommonDataResponse response, String tenantId, String storeId, String programId) throws Exception { + Map data = new HashMap<>(); + + String result = CompletableFuture.supplyAsync(()->{ + StringBuffer sqlBuf = new StringBuffer(); + try { + // 第一步获取分类资料 + List> listCategory = null; + listCategory = programProductInfoCache.getProgramProductCategory(tenantId,storeId); + if(CollectionUtils.isEmpty(listCategory)){ + sqlBuf.append(" SELECT CAST(a.`id` AS CHAR) AS id,a.`tenantId`,CAST(a.`programId` AS CHAR) AS programId,"); + sqlBuf.append(" a.`name`,a.`description`,a.`orderNo`,a.`nameEn` FROM `cy_program_product_category` a"); + sqlBuf.append(" LEFT JOIN `cy_program_store_product` b ON a.typeId = b.`typeId`"); + sqlBuf.append(" WHERE a.`tenantId` ='" + tenantId + "'"); + sqlBuf.append(" AND a.`deleteFlag` = 0"); + sqlBuf.append(" AND a.`programId` = '" + programId + "'"); + sqlBuf.append(" AND b.`storeId`='" + storeId + "'"); + sqlBuf.append(" GROUP BY a.`id`"); + sqlBuf.append(" ORDER BY a.`orderNo`"); + listCategory = programProductCategoryService.selectList(tenantId, sqlBuf.toString()); + programProductInfoCache.putCacheProgramProductCategory(tenantId,storeId,listCategory); + } + Map productTypeMap = programProductInfoCache.getProductTypeMap(tenantId); + if(productTypeMap == null || productTypeMap.size() == 0){ + Criteria criteria = new Criteria(); + criteria.add(Restrictions.isNull("parentId")); + List productTypeList = productTypeService.getList(tenantId, criteria); + productTypeMap = new HashMap<>(); + for (ProductType productType : productTypeList) { + productTypeMap.put(productType.getId(), productType); + } + programProductInfoCache.putCacheProductTypeMap(tenantId,productTypeMap); + } + + data.put("listCategory", listCategory); + + + // 第二部获取商品资料 + + List> listProduct = programProductInfoCache.getProgramProductInfo(tenantId,storeId); + if(CollectionUtils.isEmpty(listProduct)){ + sqlBuf = new StringBuffer(); + sqlBuf.append(" SELECT CAST(sp.`id` AS CHAR) AS id,sp.`tenantId`,CAST(c.`programId` AS CHAR) AS programId ,CAST(c.`id` AS CHAR) AS categoryId, "); + sqlBuf.append(" CAST(p.`id` AS CHAR) AS productId,p.`no` AS `productNo`,p.`name` AS `productName`,CAST(p.`unitId`AS CHAR) AS `productUnitId` ,d.`name` AS `productUnitName`, "); + sqlBuf.append(" p.`typePath`,CAST(p.`typeId` AS CHAR) AS typeId,c.`typeName`,CAST(sp.`specId` AS CHAR) AS specId,ps.`name` AS specName ,p.`description`,sp.`wprice` as `price` , "); + sqlBuf.append(" sp.`wmemberPrice` as memberPrice ,sp.`wprice`,sp.`wmemberPrice`,p.`minCount`,p.`orderNo`, "); + sqlBuf.append(" p.`isNew`,p.`suitFlag`,ps.`boxPrice`,p.groupName AS groupName,p.picture AS `linkUrl`,COUNT(sp.`specId`) AS specCount, "); + sqlBuf.append(" ps.`price` AS `marketPrice`,p.`monthSaleCount`,p.`praise`,p.`saleTimeType`,p.`saleTime` "); + sqlBuf.append(" FROM `cy_program_store_product` sp "); + sqlBuf.append(" LEFT JOIN cy_product p ON (sp.productId=p.id AND sp.tenantId=p.tenantId) "); + sqlBuf.append(" LEFT JOIN cy_product_spec ps ON (sp.specId=ps.id AND sp.tenantId=ps.tenantId) "); + sqlBuf.append(" LEFT JOIN cy_product_unit d ON d.`id` = p.`unitId` "); + sqlBuf.append(" LEFT JOIN `cy_program_product_category` c ON sp.`typeId` = c.`typeId` "); + sqlBuf.append(" WHERE sp.`storeId` = '" + storeId + "' "); + sqlBuf.append(" AND sp.tenantId = '" + tenantId + "' "); + sqlBuf.append(" AND c.`programId` = '" + programId + "' "); + sqlBuf.append(" AND p.`deleteFlag` = 0 "); + sqlBuf.append(" AND c.`deleteFlag` = 0 "); + sqlBuf.append(" AND p.`lineFlag` = 1 "); + sqlBuf.append(" GROUP BY sp.`productId` "); + sqlBuf.append(" ORDER BY c.`orderNo`,c.`id`, p.`orderNo` ASC "); + + listProduct = programProductCategoryService.selectList(tenantId, sqlBuf.toString()); + programProductInfoCache.putCacheProgramProductInfo(tenantId,storeId,listProduct); + } + + + Map taskMap = null; + + List> afterListProduct = new ArrayList<>(); + SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); + long now = sdf.parse(sdf.format(new Date())).getTime(); + if(CollectionUtils.isNotEmpty(listProduct)){ + taskMap = productPromotionMap(tenantId,storeId); + + for (Map map : listProduct) { + //判断商品是否在销售时间内; + boolean notInTimeFlag = false; + if(1 != (Integer)map.get("saleTimeType")){ + String saleTimeStr = map.get("saleTime")+""; + if(map.get("saleTime") != null && StringUtils.isNotBlank(saleTimeStr)){ + String[] saleTimes = saleTimeStr.split(","); + if(ArrayUtils.isNotEmpty(saleTimes)){ + for(String time : saleTimes){ + if(StringUtils.isNotBlank(time)){ + String[] times = time.split("-"); + long startTime = sdf.parse(times[0]).getTime(); + long endTime = sdf.parse(times[1]).getTime(); + if(now >= startTime && now <= endTime){ + notInTimeFlag = true; + } + } + } + } + }else{ + notInTimeFlag = true; + } + }else{ + notInTimeFlag = true; + } + + if(!notInTimeFlag){ + continue; + } + if (map.get("linkUrl") != null) { + if(map.get("groupName") == null || StringUtils.isBlank(map.get("groupName")+"")){ + map.put("linkUrl", map.get("linkUrl")); + }else{ + map.put("linkUrl", fdfsClientProperties.getAccessDomain() + "/" + map.get("groupName") + "/" + map.get("linkUrl")); + } + } else { + map.put("linkUrl", ""); + } + if (map.get("typePath") != null) { + String[] typeIds = map.get("typePath").toString().split(","); + ProductType productType = productTypeMap.get(typeIds[0]); + map.put("seriesId", productType.getId()); + map.put("seriesName", productType.getName()); + } else { + map.put("seriesId", ""); + map.put("seriesName", ""); + } + //促销信息; + if(taskMap.containsKey(map.get("productId"))){ + ProgramPromotionTask task = taskMap.get(map.get("productId")); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("discountType",task.getDiscountType()); + jsonObject.put("discount",task.getDiscountValue()); + map.put("discountRule", JSON.toJSONString(jsonObject)); + map.put("isOnlyMember",task.getIsOnlyMember()); + map.put("isRepeatDiscount",task.getIsRepeatDiscount()); + }else if(taskMap.containsKey("storeId")){ + ProgramPromotionTask task = taskMap.get("storeId"); + String blackList = task.getGoodsBlackList(); + if(!blackList.contains(map.get("id").toString())){ + JSONObject jsonObject = new JSONObject(); + jsonObject.put("discountType",task.getDiscountType()); + jsonObject.put("discount",task.getDiscountValue()); + map.put("discountRule", JSON.toJSONString(jsonObject)); + map.put("isOnlyMember",task.getIsOnlyMember()); + map.put("isRepeatDiscount",task.getIsRepeatDiscount()); + } + } + afterListProduct.add(map); + } + + } + data.put("listProduct", afterListProduct); + + // 第三部扩展获取商品规格信息 + List> listProductSpec = programProductInfoCache.getProgramProductSpecInfo(tenantId,storeId); + if(CollectionUtils.isEmpty(listProductSpec)){ + sqlBuf = new StringBuffer(); + sqlBuf.append(" SELECT CAST(sp.`id` AS CHAR) AS id,sp.`tenantId`,CAST(c.`programId` AS CHAR) AS programId ,CAST(c.`id` AS CHAR) AS categoryId, "); + sqlBuf.append(" CAST(p.`id` AS CHAR) AS productId,p.`no` AS `productNo`,p.`name` AS `productName`,CAST(p.`unitId`AS CHAR) AS `productUnitId` ,d.`name` AS `productUnitName`, "); + sqlBuf.append(" p.`typePath`,CAST(p.`typeId` AS CHAR) AS typeId,c.`typeName`,CAST(sp.`specId` AS CHAR) AS specId,ps.`name` AS specName ,p.`description`,sp.`wprice` AS `price`, "); + sqlBuf.append(" sp.`wmemberPrice` AS `memberPrice`,sp.`wprice`,sp.`wmemberPrice`,p.`minCount`,p.`orderNo`, "); + sqlBuf.append(" p.`isNew`,p.`suitFlag`,ps.`boxPrice`,p.groupName AS groupName,p.picture AS `linkUrl`,p.`saleTimeType`,p.`saleTime` "); + sqlBuf.append(" FROM `cy_program_store_product` sp "); + sqlBuf.append(" LEFT JOIN cy_product p ON (sp.productId=p.id AND sp.tenantId=p.tenantId) "); + sqlBuf.append(" LEFT JOIN cy_product_spec ps ON (sp.specId=ps.id AND sp.tenantId=ps.tenantId) "); + sqlBuf.append(" LEFT JOIN cy_product_unit d ON d.`id` = p.`unitId` "); + sqlBuf.append(" LEFT JOIN `cy_program_product_category` c ON sp.`typeId` = c.`typeId` "); + sqlBuf.append(" WHERE sp.`storeId` = '" + storeId + "' "); + sqlBuf.append(" AND sp.tenantId = '" + tenantId + "' "); + sqlBuf.append(" AND c.`programId` = '" + programId + "' "); + sqlBuf.append(" AND p.`lineFlag` = 1 "); + sqlBuf.append(" AND p.`deleteFlag` = 0 "); + sqlBuf.append(" AND c.`deleteFlag` = 0 "); + sqlBuf.append(" ORDER BY c.`orderNo`,c.`id`, p.`orderNo` ASC "); + listProductSpec = programProductCategoryService.selectList(tenantId, sqlBuf.toString()); + programProductInfoCache.putCacheProgramProductSpecInfo(tenantId,storeId,listProductSpec); + } + + List> afterLitProductSpec = new ArrayList<>(); + for (Map mapProduct : listProductSpec) { + + //判断商品是否在销售时间内; + boolean notInTimeFlags = false; + if(1 != (Integer)mapProduct.get("saleTimeType")){ + String saleTimeStr = mapProduct.get("saleTime")+""; + + //将自定义销售时间,规格商品信息,存入缓存; + String specProductSaleTimeKey = "specProductSaleTimeKey:"+ mapProduct.get("specId").toString(); + cacheService.set(tenantId, specProductSaleTimeKey, saleTimeStr, 60 * 60 * 24*3); + + if(mapProduct.get("saleTime") != null && StringUtils.isNotBlank(saleTimeStr)){ + String[] saleTimes = saleTimeStr.split(","); + if(ArrayUtils.isNotEmpty(saleTimes)){ + for(String time : saleTimes){ + if(StringUtils.isNotBlank(time)){ + String[] times = time.split("-"); + long startTime = sdf.parse(times[0]).getTime(); + long endTime = sdf.parse(times[1]).getTime(); + if(now >= startTime && now <= endTime){ + notInTimeFlags = true; + } + } + } + } + }else{ + notInTimeFlags = true; + } + }else{ + notInTimeFlags = true; + } + + if(!notInTimeFlags){ + continue; + } + + + if (mapProduct.get("linkUrl") != null) { + if(mapProduct.get("groupName") == null || StringUtils.isBlank(mapProduct.get("groupName")+"")){ + mapProduct.put("linkUrl", mapProduct.get("linkUrl")); + }else{ + mapProduct.put("linkUrl", fdfsClientProperties.getAccessDomain() + "/" + mapProduct.get("groupName") + "/" + mapProduct.get("linkUrl")); + } + } else { + mapProduct.put("linkUrl", ""); + } + if (mapProduct.get("typePath") != null) { + String[] typeIds = mapProduct.get("typePath").toString().split(","); + ProductType productType = productTypeMap.get(typeIds[0]); + mapProduct.put("seriesId", productType.getId()); + mapProduct.put("seriesName", productType.getName()); + } else { + mapProduct.put("seriesId", ""); + mapProduct.put("seriesName", ""); + } + String specId = mapProduct.get("specId").toString(); + String productKey = "programKey:" + storeId + ":" + specId; + Object productKeyValue = cacheService.get(tenantId, productKey); + if (productKeyValue == null) { + + productKeyValue = 9999.00; + cacheService.set(tenantId, productKey, productKeyValue, 60 * 60 * 24); + } + mapProduct.put("stock", Double.parseDouble(productKeyValue.toString())); + //促销信息; + if(taskMap.containsKey(specId)){ + ProgramPromotionTask task = taskMap.get(specId); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("discountType",task.getDiscountType()); + jsonObject.put("discount",task.getDiscountValue()); + mapProduct.put("discountRule", JSON.toJSONString(jsonObject)); + mapProduct.put("isOnlyMember",task.getIsOnlyMember()); + mapProduct.put("isRepeatDiscount",task.getIsRepeatDiscount()); + }else if(taskMap.containsKey("storeId")){ + ProgramPromotionTask task = taskMap.get("storeId"); + String blackList = task.getGoodsBlackList(); + if(!blackList.contains(specId)){ + JSONObject jsonObject = new JSONObject(); + jsonObject.put("discountType",task.getDiscountType()); + jsonObject.put("discount",task.getDiscountValue()); + mapProduct.put("discountRule", JSON.toJSONString(jsonObject)); + mapProduct.put("isOnlyMember",task.getIsOnlyMember()); + mapProduct.put("isRepeatDiscount",task.getIsRepeatDiscount()); + } + } + afterLitProductSpec.add(mapProduct); + } + data.put("listProductSpec", afterLitProductSpec); + + } catch (Exception e) { + logger.error("巨为小程序查询商品信息,发生异常", e); + } + return "1-OK"; + }).thenCombine(CompletableFuture.supplyAsync(()->{ + try { + + Criteria criteria1 = new Criteria(); + criteria1.add(Restrictions.eq("storeId",storeId)); + criteria1.add(Restrictions.eq("programId",programId)); + List programStores = programStoreService.getList(tenantId,criteria1); + + StringBuffer sqlBuf = new StringBuffer(); + + // 第四部获取商品加料信息 + List> listProductMake = programProductInfoCache.getProgramProductMake(tenantId,storeId); + if(CollectionUtils.isEmpty(listProductMake)){ + if(CollectionUtils.isEmpty(programStores) || programStores.get(0).getStoreMakeEnabled() == 0 ){ + sqlBuf.append(" SELECT a.`tenantId`,CAST(a.`productId` AS CHAR) AS productId,CAST(e.`programId` AS CHAR) AS programId, "); + sqlBuf.append(" CAST(c.`id` AS CHAR) AS typeId, CAST(a.`makeId` AS CHAR) AS makeId,c.`name` AS typeName ,d.`description` AS makeName, "); + sqlBuf.append(" a.`addPrice`,d.orderNo, c.`isRadio`,c.`isMust` as isMustMake,d.`qtyFlag` FROM `cy_program_product_make` a "); + sqlBuf.append(" LEFT JOIN `cy_program_store_product` b ON a.`productId` = b.`productId`"); + sqlBuf.append(" LEFT JOIN `cy_program_product_category` e ON b.`typeId` = e.`typeId`"); + sqlBuf.append(" LEFT JOIN `cy_make_detail` d ON a.`makeId` = d.`id` "); + sqlBuf.append(" LEFT JOIN `cy_make_type` c ON d.`typeId` = c.`id` "); + sqlBuf.append(" WHERE e.`programId`='" + programId + "' "); + sqlBuf.append(" AND a.`tenantId` = '" + tenantId + "' "); + sqlBuf.append(" AND b.`storeId`='" + storeId + "' "); + sqlBuf.append(" AND e.`deleteFlag` = 0 "); + sqlBuf.append(" GROUP BY a.`productId`, a.`makeId` "); + sqlBuf.append(" ORDER BY (d.`orderNo`+0) "); + }else{ + sqlBuf.append(" select * from "); + sqlBuf.append( " (SELECT a.`tenantId`,CAST(a.`productId` AS CHAR) AS productId,CAST(e.`programId` AS CHAR) AS programId, "); + sqlBuf.append( " CAST(c.`id` AS CHAR) AS typeId, CAST(a.`makeId` AS CHAR) AS makeId,c.`name` AS typeName ,d.`description` AS makeName, "); + sqlBuf.append( " a.`addPrice`,d.orderNo, c.`isRadio`,c.`isMust` as isMustMake,d.`qtyFlag` FROM `cy_program_product_make` a "); + sqlBuf.append( " LEFT JOIN `cy_program_store_product` b ON a.`productId` = b.`productId`"); + sqlBuf.append( " LEFT JOIN `cy_program_product_category` e ON b.`typeId` = e.`typeId`"); + sqlBuf.append( " LEFT JOIN `cy_make_detail` d ON a.`makeId` = d.`id` "); + sqlBuf.append( " LEFT JOIN `cy_make_type` c ON d.`typeId` = c.`id` "); + sqlBuf.append( " WHERE e.`programId`='"+programId+"' "); + sqlBuf.append( " AND a.`tenantId` = '"+tenantId+"' "); + sqlBuf.append( " AND b.`storeId`='"+storeId+"' "); + sqlBuf.append( " AND e.`deleteFlag` = 0 and d.deleteFlag = 0 "); + sqlBuf.append( " GROUP BY a.`productId`, a.`makeId` )product UNION ALL ( SELECT a.`tenantId`,CAST(b.`productId` AS CHAR) AS productId,CAST(e.`programId` AS CHAR) AS programId, "); + sqlBuf.append( " CAST(c.`id` AS CHAR) AS typeId, CAST(a.`makeId` AS CHAR) AS makeId,c.`name` AS typeName ,d.`description` AS makeName, "); + sqlBuf.append( " a.`addPrice`,d.orderNo, c.`isRadio`,c.`isMust` as isMustMake,d.`qtyFlag` FROM `cy_product_make_store` a "); + sqlBuf.append( " LEFT JOIN `cy_program_store_product` b ON a.`storeId` = b.`storeId`"); + sqlBuf.append( " LEFT JOIN `cy_program_product_category` e ON b.`typeId` = e.`typeId`"); + sqlBuf.append( " LEFT JOIN `cy_make_detail` d ON a.`makeId` = d.`id` "); + sqlBuf.append( " LEFT JOIN `cy_make_type` c ON d.`typeId` = c.`id` "); + sqlBuf.append( " WHERE e.`programId`='"+programId+"' "); + sqlBuf.append( " AND b.`tenantId` = '"+tenantId+"' "); + sqlBuf.append( " AND b.`storeId`='"+storeId+"' "); + sqlBuf.append( " AND e.`deleteFlag` = 0 and d.deleteFlag = 0"); + sqlBuf.append( " GROUP BY b.`productId`, a.`makeId` ) ORDER BY productId,typeId,(orderNo+0) "); + } + listProductMake = storeProductService.selectList(tenantId, sqlBuf.toString()); + programProductInfoCache.putCacheProgramProductMake(tenantId,storeId,listProductMake); + } + + data.put("listProductMake", listProductMake); + + // 第五步商品套餐信息 + List> listProductSuit = programProductInfoCache.getProgramProductSuit(tenantId,storeId); + if(CollectionUtils.isEmpty(listProductSuit)){ + sqlBuf = new StringBuffer(); + sqlBuf.append(" SELECT CAST(a.`id` AS CHAR) AS id ,a.`tenantId`, CAST(a.`productId` AS CHAR) AS productId, "); + sqlBuf.append(" a.`no`,a.`name`,a.`quantity` FROM `cy_product_suit` a "); + sqlBuf.append(" LEFT JOIN `cy_program_store_product` b ON a.`productId` = b.`productId` "); + sqlBuf.append(" LEFT JOIN `cy_program_product_category` e ON b.`typeId` = e.`typeId`"); + sqlBuf.append(" WHERE e.`programId`='" + programId + "' "); + sqlBuf.append(" AND a.`tenantId` = '" + tenantId + "' "); + sqlBuf.append(" AND b.`storeId`='" + storeId + "' "); + sqlBuf.append(" AND e.`deleteFlag` = 0 "); + sqlBuf.append(" GROUP BY a.`id` "); + sqlBuf.append(" ORDER BY a.`productId`,a.`no` "); + listProductSuit = storeProductService.selectList(tenantId, sqlBuf.toString()); + programProductInfoCache.putCacheProgramProductSuit(tenantId,storeId,listProductSuit); + } + + data.put("listProductSuit", listProductSuit); + // 第六步商品套餐明细 + List> listProductSuitDetail = programProductInfoCache.getProgramProductSuitDetail(tenantId,storeId); + if(CollectionUtils.isEmpty(listProductSuitDetail)){ + sqlBuf = new StringBuffer(); + sqlBuf.append(" SELECT CAST(a.`id` AS CHAR) AS id,a.`tenantId`,CAST(a.`suitId` AS CHAR) AS suitId, CAST(a.`productId` AS CHAR) AS productId, "); + sqlBuf.append(" CAST(a.`specId` AS CHAR) AS specId,a.`quantity`,a.`addPrice`,a.`defaultflag` FROM `cy_product_suit_detail` a "); + sqlBuf.append(" LEFT JOIN cy_product_suit b ON a.`suitId` = b.`id` "); + sqlBuf.append(" LEFT JOIN cy_program_store_product c ON c.`productId` = b.`productId`"); + sqlBuf.append(" LEFT JOIN cy_program_product_category e ON c.`typeId` = e.`typeId`"); + sqlBuf.append(" WHERE a.`tenantId` = '" + tenantId + "' "); + sqlBuf.append(" AND c.`storeId`='" + storeId + "' "); + sqlBuf.append(" AND e.`programId`='" + programId + "' "); + sqlBuf.append(" AND e.`deleteFlag` = 0 "); + sqlBuf.append(" GROUP BY a.`id` "); + sqlBuf.append(" ORDER BY a.`suitId` "); + listProductSuitDetail = storeProductService.selectList(tenantId, sqlBuf.toString()); + programProductInfoCache.putCacheProgramProductSuitDetail(tenantId,storeId,listProductSuitDetail); + } + data.put("listProductSuitDetail", listProductSuitDetail); + + } catch (Exception e) { + logger.error("巨为小程序查询商品信息,发生异常", e); + } + return "2-OK"; + }), (s1,s2)->{ + return s1+s2; + }).exceptionally(e->{ + e.printStackTrace(); + return "error"; + }).join(); + + response.setStatus(1); + response.setMessage("获取成功"); + response.setData(data); + return response; + } + + /** + * 门店基础资料 + * + * @param response + * @param tenantId + * @param storeId + * @param programId + * @return + * @throws Exception + */ + public CommonDataResponse getProuctDataStore(CommonDataResponse response, String tenantId, String storeId, String programId) throws Exception { + Map data = new HashMap<>(); + String result = CompletableFuture.supplyAsync(()->{ + try { + // 第一步获取分类资料 + StringBuffer sqlBuf = new StringBuffer(); + sqlBuf.append(" SELECT CAST(a.`id` AS CHAR) AS id,a.`tenantId`,CAST(a.`programId` AS CHAR) AS programId,"); + sqlBuf.append(" a.`name`,a.`description`,a.`orderNo`,a.`nameEn` FROM `cy_program_product_category` a"); + sqlBuf.append(" LEFT JOIN `cy_store_product` b ON a.typeId = b.`typeId`"); + sqlBuf.append(" WHERE a.`tenantId` ='" + tenantId + "'"); + sqlBuf.append(" AND a.`deleteFlag` = 0"); + sqlBuf.append(" AND a.`programId` = '" + programId + "'"); + sqlBuf.append(" AND b.`storeId`='" + storeId + "'"); + sqlBuf.append(" GROUP BY a.`id`"); + sqlBuf.append(" ORDER BY a.`orderNo`"); + List> listCategory = programProductCategoryService.selectList(tenantId, sqlBuf.toString()); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.isNull("parentId")); + List productTypeList = productTypeService.getList(tenantId, criteria); + Map productTypeMap = new HashMap<>(); + for (ProductType productType : productTypeList) { + productTypeMap.put(productType.getId(), productType); + } + // 第二部获取商品资料 + sqlBuf = new StringBuffer(); + sqlBuf.append(" SELECT CAST(sp.`id` AS CHAR) AS id,sp.`tenantId`,CAST(c.`programId` AS CHAR) AS programId ,CAST(c.`id` AS CHAR) AS categoryId, "); + sqlBuf.append(" CAST(p.`id` AS CHAR) AS productId,p.`no` AS `productNo`,p.`name` AS `productName`,CAST(p.`unitId`AS CHAR) AS `productUnitId` ,d.`name` AS `productUnitName`, "); + sqlBuf.append(" p.`typePath`,CAST(p.`typeId` AS CHAR) AS typeId,c.`typeName`,CAST(sp.`specId` AS CHAR) AS specId,ps.`name` AS specName ,p.`description`,sp.`price`, "); + sqlBuf.append(" sp.`memberPrice`,sp.`wprice`,sp.`wmemberPrice`,p.`minCount`,p.`orderNo`, "); + sqlBuf.append(" p.`isNew`,p.`suitFlag`,ps.`boxPrice`,p.groupName AS groupName,p.picture AS `linkUrl`,COUNT(sp.`specId`) AS specCount, "); + sqlBuf.append(" ps.`price` AS `marketPrice`,p.`monthSaleCount`,p.`praise`,p.`saleTimeType`,p.`saleTime` "); + sqlBuf.append(" FROM `cy_store_product` sp "); + sqlBuf.append(" LEFT JOIN cy_product p ON (sp.productId=p.id AND sp.tenantId=p.tenantId) "); + sqlBuf.append(" LEFT JOIN cy_product_spec ps ON (sp.specId=ps.id AND sp.tenantId=ps.tenantId) "); + sqlBuf.append(" LEFT JOIN cy_product_unit d ON d.`id` = p.`unitId` "); + sqlBuf.append(" LEFT JOIN `cy_program_product_category` c ON sp.`typeId` = c.`typeId` "); + sqlBuf.append(" WHERE sp.`storeId` = '" + storeId + "' "); + sqlBuf.append(" AND sp.tenantId = '" + tenantId + "' "); + sqlBuf.append(" AND c.`programId` = '" + programId + "' "); + sqlBuf.append(" AND p.`deleteFlag` = 0 "); + sqlBuf.append(" AND c.`deleteFlag` = 0 "); + sqlBuf.append(" AND p.`lineFlag` = 1 "); + sqlBuf.append(" GROUP BY sp.`productId` "); + sqlBuf.append(" ORDER BY c.`orderNo`,c.`id`, p.`orderNo` ASC "); + List> listProduct = programProductCategoryService.selectList(tenantId, sqlBuf.toString()); + Map taskMap = null; + + List> afterListProduct = new ArrayList<>(); + SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); + long now = sdf.parse(sdf.format(new Date())).getTime(); + + if(CollectionUtils.isNotEmpty(listProduct)){ + taskMap = productPromotionMap(tenantId,storeId); + for (Map map : listProduct) { + + boolean notInTimeFlag = false; + if(1 != (Integer)map.get("saleTimeType")){ + String saleTimeStr = map.get("saleTime")+""; + if(map.get("saleTime") != null && StringUtils.isNotBlank(saleTimeStr)){ + String[] saleTimes = saleTimeStr.split(","); + if(ArrayUtils.isNotEmpty(saleTimes)){ + for(String time : saleTimes){ + if(StringUtils.isNotBlank(time)){ + String[] times = time.split("-"); + long startTime = sdf.parse(times[0]).getTime(); + long endTime = sdf.parse(times[1]).getTime(); + if(now >= startTime && now <= endTime){ + notInTimeFlag = true; + } + } + } + } + }else{ + notInTimeFlag = true; + } + }else{ + notInTimeFlag = true; + } + + if(!notInTimeFlag){ + continue; + } + + if (map.get("linkUrl") != null) { + if(map.get("groupName") == null || StringUtils.isBlank(map.get("groupName")+"")){ + map.put("linkUrl", map.get("linkUrl")); + }else{ + map.put("linkUrl", fdfsClientProperties.getAccessDomain() + "/" + map.get("groupName") + "/" + map.get("linkUrl")); + } + } else { + map.put("linkUrl", ""); + } + if (map.get("typePath") != null) { + String[] typeIds = map.get("typePath").toString().split(","); + ProductType productType = productTypeMap.get(typeIds[0]); + map.put("seriesId", productType.getId()); + map.put("seriesName", productType.getName()); + } else { + map.put("seriesId", ""); + map.put("seriesName", ""); + } + + //促销信息; + if(taskMap.containsKey(map.get("productId"))){ + ProgramPromotionTask task = taskMap.get(map.get("productId")); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("discountType",task.getDiscountType()); + jsonObject.put("discount",task.getDiscountValue()); + map.put("discountRule", JSON.toJSONString(jsonObject)); + map.put("isOnlyMember",task.getIsOnlyMember()); + map.put("isRepeatDiscount",task.getIsRepeatDiscount()); + }else if(taskMap.containsKey("storeId")){ + ProgramPromotionTask task = taskMap.get("storeId"); + String blackList = task.getGoodsBlackList(); + if(!blackList.contains(map.get("id").toString())){ + JSONObject jsonObject = new JSONObject(); + jsonObject.put("discountType",task.getDiscountType()); + jsonObject.put("discount",task.getDiscountValue()); + map.put("discountRule", JSON.toJSONString(jsonObject)); + map.put("isOnlyMember",task.getIsOnlyMember()); + map.put("isRepeatDiscount",task.getIsRepeatDiscount()); + } + } + afterListProduct.add(map); + } + } + + // 第三部扩展获取商品规格信息 + sqlBuf = new StringBuffer(); + sqlBuf.append(" SELECT CAST(sp.`id` AS CHAR) AS id,sp.`tenantId`,CAST(c.`programId` AS CHAR) AS programId ,CAST(c.`id` AS CHAR) AS categoryId, "); + sqlBuf.append(" CAST(p.`id` AS CHAR) AS productId,p.`no` AS `productNo`,p.`name` AS `productName`,CAST(p.`unitId`AS CHAR) AS `productUnitId` ,d.`name` AS `productUnitName`, "); + sqlBuf.append(" p.`typePath`,CAST(p.`typeId` AS CHAR) AS typeId,c.`typeName`,CAST(sp.`specId` AS CHAR) AS specId,ps.`name` AS specName ,p.`description`,sp.`price`, "); + sqlBuf.append(" sp.`memberPrice`,sp.`wprice`,sp.`wmemberPrice`,p.`minCount`,p.`orderNo`, "); + sqlBuf.append(" p.`isNew`,p.`suitFlag`,ps.`boxPrice`,p.groupName AS groupName,p.picture AS `linkUrl`,p.`saleTimeType`,p.`saleTime` "); + sqlBuf.append(" FROM `cy_store_product` sp "); + sqlBuf.append(" LEFT JOIN cy_product p ON (sp.productId=p.id AND sp.tenantId=p.tenantId) "); + sqlBuf.append(" LEFT JOIN cy_product_spec ps ON (sp.specId=ps.id AND sp.tenantId=ps.tenantId) "); + sqlBuf.append(" LEFT JOIN cy_product_unit d ON d.`id` = p.`unitId` "); + sqlBuf.append(" LEFT JOIN `cy_program_product_category` c ON sp.`typeId` = c.`typeId` "); + sqlBuf.append(" WHERE sp.`storeId` = '" + storeId + "' "); + sqlBuf.append(" AND sp.tenantId = '" + tenantId + "' "); + sqlBuf.append(" AND c.`programId` = '" + programId + "' "); + sqlBuf.append(" AND p.`lineFlag` = 1 "); + sqlBuf.append(" AND p.`deleteFlag` = 0 "); + sqlBuf.append(" AND c.`deleteFlag` = 0 "); + sqlBuf.append(" ORDER BY c.`orderNo`,c.`id`, p.`orderNo` ASC "); + List> listProductSpec = programProductCategoryService.selectList(tenantId, sqlBuf.toString()); + List> afterListProductSpec = new ArrayList<>(); + for (Map mapProduct : listProductSpec) { + + //判断商品是否在销售时间内; + boolean notInTimeFlags = false; + if(1 != (Integer)mapProduct.get("saleTimeType")){ + String saleTimeStr = mapProduct.get("saleTime")+""; + + //将自定义销售时间,规格商品信息,存入缓存; + String specProductSaleTimeKey = "specProductSaleTimeKey:"+ mapProduct.get("specId").toString(); + cacheService.set(tenantId, specProductSaleTimeKey, saleTimeStr, 60 * 60 * 24*3); + + if(mapProduct.get("saleTime") != null && StringUtils.isNotBlank(saleTimeStr)){ + String[] saleTimes = saleTimeStr.split(","); + if(ArrayUtils.isNotEmpty(saleTimes)){ + for(String time : saleTimes){ + if(StringUtils.isNotBlank(time)){ + String[] times = time.split("-"); + long startTime = sdf.parse(times[0]).getTime(); + long endTime = sdf.parse(times[1]).getTime(); + if(now >= startTime && now <= endTime){ + notInTimeFlags = true; + } + } + } + } + }else{ + notInTimeFlags = true; + } + }else{ + notInTimeFlags = true; + } + + if(!notInTimeFlags){ + continue; + } + + + if (mapProduct.get("linkUrl") != null) { + if(mapProduct.get("groupName") == null || StringUtils.isBlank(mapProduct.get("groupName")+"")){ + mapProduct.put("linkUrl", mapProduct.get("linkUrl")); + }else{ + mapProduct.put("linkUrl", fdfsClientProperties.getAccessDomain() + "/" + mapProduct.get("groupName") + "/" + mapProduct.get("linkUrl")); + } + } else { + mapProduct.put("linkUrl", ""); + } + if (mapProduct.get("typePath") != null) { + String[] typeIds = mapProduct.get("typePath").toString().split(","); + ProductType productType = productTypeMap.get(typeIds[0]); + mapProduct.put("seriesId", productType.getId()); + mapProduct.put("seriesName", productType.getName()); + } else { + mapProduct.put("seriesId", ""); + mapProduct.put("seriesName", ""); + } + String specId = mapProduct.get("specId").toString(); + String productKey = "programKey:" + storeId + ":" + specId; + Object productKeyValue = cacheService.get(tenantId, productKey); + if (productKeyValue == null) { + productKeyValue = 9999.00; + cacheService.set(tenantId, productKey, productKeyValue, 60 * 60 * 24); + } + mapProduct.put("stock", Double.parseDouble(productKeyValue.toString())); + + //促销信息; + if(taskMap.containsKey(specId)){ + ProgramPromotionTask task = taskMap.get(specId); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("discountType",task.getDiscountType()); + jsonObject.put("discount",task.getDiscountValue()); + mapProduct.put("discountRule", JSON.toJSONString(jsonObject)); + mapProduct.put("isOnlyMember",task.getIsOnlyMember()); + mapProduct.put("isRepeatDiscount",task.getIsRepeatDiscount()); + }else if(taskMap.containsKey("storeId")){ + ProgramPromotionTask task = taskMap.get("storeId"); + String blackList = task.getGoodsBlackList(); + if(!blackList.contains(specId)){ + JSONObject jsonObject = new JSONObject(); + jsonObject.put("discountType",task.getDiscountType()); + jsonObject.put("discount",task.getDiscountValue()); + mapProduct.put("discountRule", JSON.toJSONString(jsonObject)); + mapProduct.put("isOnlyMember",task.getIsOnlyMember()); + mapProduct.put("isRepeatDiscount",task.getIsRepeatDiscount()); + } + } + afterListProductSpec.add(mapProduct); + } + data.put("listCategory", listCategory); + data.put("listProduct", afterListProduct); + data.put("listProductSpec", afterListProductSpec); + } catch (Exception e) { + logger.error("巨为小程序查询商品信息,发生异常", e); + } + return "1-OK"; + }).thenCombine(CompletableFuture.supplyAsync(()->{ + try { + // 第四部获取商品加料信息 + StringBuffer sqlBuf = new StringBuffer(); + sqlBuf.append(" SELECT a.`tenantId`,CAST(a.`productId` AS CHAR) AS productId,CAST(e.`programId` AS CHAR) AS programId, "); + sqlBuf.append(" CAST(c.`id` AS CHAR) AS typeId, CAST(a.`makeId` AS CHAR) AS makeId,c.`name` AS typeName ,d.`description` AS makeName, "); + sqlBuf.append(" d.`addPrice`,d.orderNo, c.`isRadio`,c.`isMust` as isMustMake,d.`qtyFlag` FROM `cy_product_make` a "); + sqlBuf.append(" LEFT JOIN `cy_store_product` b ON a.`productId` = b.`productId`"); + sqlBuf.append(" LEFT JOIN `cy_program_product_category` e ON b.`typeId` = e.`typeId`"); + sqlBuf.append(" LEFT JOIN `cy_make_detail` d ON a.`makeId` = d.`id` "); + sqlBuf.append(" LEFT JOIN `cy_make_type` c ON d.`typeId` = c.`id` "); + sqlBuf.append(" WHERE e.`programId`='" + programId + "' "); + sqlBuf.append(" AND a.`tenantId` = '" + tenantId + "' "); + sqlBuf.append(" AND b.`storeId`='" + storeId + "' "); + sqlBuf.append(" AND e.`deleteFlag` = 0 "); + sqlBuf.append(" GROUP BY a.`productId`, a.`makeId` "); + sqlBuf.append(" ORDER BY (d.`orderNo`+0) "); + List> listProductMake = storeProductService.selectList(tenantId, sqlBuf.toString()); + + + // 第五步商品套餐信息 + sqlBuf = new StringBuffer(); + sqlBuf.append(" SELECT CAST(a.`id` AS CHAR) AS id ,a.`tenantId`, CAST(a.`productId` AS CHAR) AS productId, "); + sqlBuf.append(" a.`no`,a.`name`,a.`quantity` FROM `cy_product_suit` a "); + sqlBuf.append(" LEFT JOIN `cy_store_product` b ON a.`productId` = b.`productId` "); + sqlBuf.append(" LEFT JOIN `cy_program_product_category` e ON b.`typeId` = e.`typeId`"); + sqlBuf.append(" WHERE e.`programId`='" + programId + "' "); + sqlBuf.append(" AND a.`tenantId` = '" + tenantId + "' "); + sqlBuf.append(" AND b.`storeId`='" + storeId + "' "); + sqlBuf.append(" AND e.`deleteFlag` = 0 "); + sqlBuf.append(" GROUP BY a.`id` "); + sqlBuf.append(" ORDER BY a.`productId`,a.`no` "); + List> listProductSuit = storeProductService.selectList(tenantId, sqlBuf.toString()); + // 第六步商品套餐明细 + sqlBuf = new StringBuffer(); + sqlBuf.append(" SELECT CAST(a.`id` AS CHAR) AS id,a.`tenantId`,CAST(a.`suitId` AS CHAR) AS suitId, CAST(a.`productId` AS CHAR) AS productId, "); + sqlBuf.append(" CAST(a.`specId` AS CHAR) AS specId,a.`quantity`,a.`addPrice`,a.`defaultflag` FROM `cy_product_suit_detail` a "); + sqlBuf.append(" LEFT JOIN cy_product_suit b ON a.`suitId` = b.`id` "); + sqlBuf.append(" LEFT JOIN cy_store_product c ON c.`productId` = b.`productId`"); + sqlBuf.append(" LEFT JOIN cy_program_product_category e ON c.`typeId` = e.`typeId`"); + sqlBuf.append(" WHERE a.`tenantId` = '" + tenantId + "' "); + sqlBuf.append(" AND c.`storeId`='" + storeId + "' "); + sqlBuf.append(" AND e.`programId`='" + programId + "' "); + sqlBuf.append(" AND e.`deleteFlag` = 0 "); + sqlBuf.append(" GROUP BY a.`id` "); + sqlBuf.append(" ORDER BY a.`suitId` "); + List> listProductSuitDetail = storeProductService.selectList(tenantId, sqlBuf.toString()); + + data.put("listProductMake", listProductMake); + data.put("listProductSuit", listProductSuit); + data.put("listProductSuitDetail", listProductSuitDetail); + + } catch (Exception e) { + logger.error("巨为小程序查询商品信息,发生异常", e); + } + return "2-Ok"; + }), (s1,s2)->{ + return s1+s2; + }).exceptionally(e->{ + e.printStackTrace(); + return "error"; + }).join(); + + response.setStatus(1); + response.setMessage("获取成功"); + response.setData(data); + return response; + } + + /** + * 门店基础资料 + * + * @param response + * @param tenantId + * @param storeId + * @param programId + * @return + * @throws Exception + */ + public CommonDataResponse getProuctDataStoreNew(CommonDataResponse response, String tenantId, String storeId, String programId) throws Exception { + // 第一步获取分类资料 + StringBuffer sqlBuf = new StringBuffer(); + sqlBuf.append(" SELECT CAST(type.`id` AS CHAR) AS id,store.`tenantId`,CAST(store.`programId` AS CHAR) AS programId, type.`name`,"); + sqlBuf.append(" type.`no` as `orderNo`,type.english as `nameEn` from cy_program_store store "); + sqlBuf.append(" LEFT JOIN cy_store_product b on store.storeId = b.storeId "); + sqlBuf.append(" LEFT JOIN cy_product_type type on b.typeId = type.id "); + sqlBuf.append(" WHERE store.`tenantId` ='" + tenantId + "'"); + sqlBuf.append(" AND type.`deleteFlag` = 0"); + sqlBuf.append(" AND store.`programId` = '" + programId + "'"); + sqlBuf.append(" AND store.`storeId`='" + storeId + "' AND type.stopFlag = 0 AND type.sign != 3"); + sqlBuf.append(" AND type.parentId is null "); + sqlBuf.append(" GROUP BY type.`id`"); + sqlBuf.append(" ORDER BY (type.`no` + 0)"); + List> listCategory = programProductCategoryService.selectList(tenantId, sqlBuf.toString()); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.isNull("parentId")); + List productTypeList = productTypeService.getList(tenantId, criteria); + Map productTypeMap = new HashMap<>(); + for (ProductType productType : productTypeList) { + productTypeMap.put(productType.getId(), productType); + } + // 第二部获取商品资料 + sqlBuf = new StringBuffer(); + sqlBuf.append(" select CAST(sp.`id` AS CHAR) AS id,sp.`tenantId`,CAST(store.`programId` AS CHAR) AS programId ,"); + sqlBuf.append(" CAST(c.`id` AS CHAR) AS categoryId, CAST(p.`id` AS CHAR) AS productId,p.`no` AS `productNo`,"); + sqlBuf.append(" p.`name` AS `productName`,CAST(p.`unitId`AS CHAR) AS `productUnitId` ,d.`name` AS `productUnitName`,"); + sqlBuf.append(" p.`typePath`,CAST(p.`typeId` AS CHAR) AS typeId,c.`name` as typeName,CAST(sp.`specId` AS CHAR) AS specId,"); + sqlBuf.append(" ps.`name` AS specName ,p.`description`,sp.`price`, sp.`memberPrice`,sp.`wprice`,sp.`wmemberPrice`,"); + sqlBuf.append(" p.`minCount`,p.`orderNo`, p.`isNew`,p.`suitFlag`,ps.`boxPrice`,p.groupName AS groupName,"); + sqlBuf.append(" p.picture AS `linkUrl`,COUNT(sp.`specId`) AS specCount, ps.`price` AS `marketPrice`,"); + sqlBuf.append(" p.`monthSaleCount`,p.`praise`,p.`saleTimeType`,p.`saleTime`"); + sqlBuf.append(" from cy_program_store store LEFT JOIN cy_store_product sp on store.storeId = sp.storeId "); + sqlBuf.append(" LEFT JOIN cy_product p ON (sp.productId=p.id AND sp.tenantId=p.tenantId) "); + sqlBuf.append(" LEFT JOIN cy_product_spec ps ON (sp.specId=ps.id AND sp.tenantId=ps.tenantId) "); + sqlBuf.append(" LEFT JOIN cy_product_unit d ON d.`id` = p.`unitId` LEFT JOIN cy_product_type c on c.id = p.typeId "); + sqlBuf.append(" where store.programId = '"+programId+"' and sp.`storeId` = '"+storeId+"' AND sp.tenantId = '"+tenantId+"' "); + sqlBuf.append(" AND p.`deleteFlag` = 0 AND c.`deleteFlag` = 0 AND p.`lineFlag` = 1 and c.deleteFlag =0 and c.stopFlag = 0 and "); + sqlBuf.append(" c.parentId is NULL GROUP BY sp.`productId`"); + sqlBuf.append(" ORDER BY c.`orderNo`,c.`id`, p.`orderNo` ASC "); + List> listProduct = programProductCategoryService.selectList(tenantId, sqlBuf.toString()); + for (Map map : listProduct) { + if (map.get("linkUrl") != null) { + if(map.get("groupName") == null || StringUtils.isBlank(map.get("groupName")+"")){ + map.put("linkUrl", map.get("linkUrl")); + }else{ + map.put("linkUrl", fdfsClientProperties.getAccessDomain() + "/" + map.get("groupName") + "/" + map.get("linkUrl")); + } + } else { + map.put("linkUrl", ""); + } + if (map.get("typePath") != null) { + String[] typeIds = map.get("typePath").toString().split(","); + ProductType productType = productTypeMap.get(typeIds[0]); + map.put("seriesId", productType.getId()); + map.put("seriesName", productType.getName()); + } else { + map.put("seriesId", ""); + map.put("seriesName", ""); + } + } + // 第二部扩展获取商品规格信息 + sqlBuf = new StringBuffer(); + sqlBuf.append(" SELECT CAST(sp.`id` AS CHAR) AS id,sp.`tenantId`,CAST(store.`programId` AS CHAR) AS programId ,"); + sqlBuf.append(" CAST(c.`id` AS CHAR) AS categoryId, CAST(p.`id` AS CHAR) AS productId,p.`no` AS `productNo`,"); + sqlBuf.append(" p.`name` AS `productName`,CAST(p.`unitId`AS CHAR) AS `productUnitId` ,d.`name` AS `productUnitName`, "); + sqlBuf.append(" p.`typePath`,CAST(p.`typeId` AS CHAR) AS typeId,c.`name` as typeName,CAST(sp.`specId` AS CHAR) AS specId,"); + sqlBuf.append(" ps.`name` AS specName ,p.`description`,sp.`price`, sp.`memberPrice`,sp.`wprice`,sp.`wmemberPrice`,"); + sqlBuf.append(" p.`minCount`,p.`orderNo`, p.`isNew`,p.`suitFlag`,ps.`boxPrice`,p.groupName AS groupName,"); + sqlBuf.append(" p.picture AS `linkUrl` from cy_program_store store LEFT JOIN cy_store_product sp on store.storeId = sp.storeId "); + sqlBuf.append(" LEFT JOIN cy_product p ON (sp.productId=p.id AND sp.tenantId=p.tenantId) "); + sqlBuf.append(" LEFT JOIN cy_product_spec ps ON (sp.specId=ps.id AND sp.tenantId=ps.tenantId) "); + sqlBuf.append(" LEFT JOIN cy_product_unit d ON d.`id` = p.`unitId` LEFT JOIN cy_product_type c on sp.`typeId` = c.`id` "); + sqlBuf.append(" WHERE sp.`storeId` = '"+storeId+"' AND sp.tenantId = '"+tenantId+"' "); + sqlBuf.append(" AND store.`programId` = '"+programId+"' AND p.`lineFlag` = 1 "); + sqlBuf.append(" AND p.`deleteFlag` = 0 AND c.`deleteFlag` = 0 and c.stopFlag = 0 and c.parentId is null "); + sqlBuf.append(" ORDER BY c.`orderNo`,c.`id`, p.`orderNo` ASC "); + List> listProductSpec = programProductCategoryService.selectList(tenantId, sqlBuf.toString()); + for (Map mapProduct : listProductSpec) { + if (mapProduct.get("linkUrl") != null) { + if(mapProduct.get("groupName") == null || StringUtils.isBlank(mapProduct.get("groupName")+"")){ + mapProduct.put("linkUrl", mapProduct.get("linkUrl")); + }else{ + mapProduct.put("linkUrl", fdfsClientProperties.getAccessDomain() + "/" + mapProduct.get("groupName") + "/" + mapProduct.get("linkUrl")); + } + } else { + mapProduct.put("linkUrl", ""); + } + if (mapProduct.get("typePath") != null) { + String[] typeIds = mapProduct.get("typePath").toString().split(","); + ProductType productType = productTypeMap.get(typeIds[0]); + mapProduct.put("seriesId", productType.getId()); + mapProduct.put("seriesName", productType.getName()); + } else { + mapProduct.put("seriesId", ""); + mapProduct.put("seriesName", ""); + } + String specId = mapProduct.get("specId").toString(); + String productKey = "programKey:" + storeId + ":" + specId; + Object productKeyValue = cacheService.get(tenantId, productKey); + if (productKeyValue == null) { + // Criteria criteria0 = new Criteria(); + // criteria0.add(Restrictions.eq("storeId", storeId)); + // criteria0.add(Restrictions.eq("specId", specId)); + // List stockList = + // storeProductService.getList(tenantId, criteria0); + // if (CollectionUtils.isNotEmpty(stockList)) { + // StoreProduct storeProductSaleStock = stockList.get(0); + //// productKeyValue = storeProductSaleStock.getStock(); + // } else { + // + // } + productKeyValue = 9999.00; + cacheService.set(tenantId, productKey, productKeyValue, 60 * 60 * 24); + } + mapProduct.put("stock", Double.parseDouble(productKeyValue.toString())); + } + // 第三部获取商品加料信息 + sqlBuf = new StringBuffer(); + sqlBuf.append(" SELECT a.`tenantId`,CAST(a.`productId` AS CHAR) AS productId,CAST(e.`programId` AS CHAR) AS programId, "); + sqlBuf.append(" CAST(c.`id` AS CHAR) AS typeId, CAST(a.`makeId` AS CHAR) AS makeId,c.`name` AS typeName ,d.`description` AS makeName, "); + sqlBuf.append(" d.`addPrice`,d.orderNo, c.`isRadio`,c.`isMust` as isMustMake,d.`qtyFlag` FROM `cy_product_make` a "); + sqlBuf.append(" LEFT JOIN `cy_store_product` b ON a.`productId` = b.`productId`"); + sqlBuf.append(" LEFT JOIN `cy_program_product_category` e ON b.`typeId` = e.`typeId`"); + sqlBuf.append(" LEFT JOIN `cy_make_detail` d ON a.`makeId` = d.`id` "); + sqlBuf.append(" LEFT JOIN `cy_make_type` c ON d.`typeId` = c.`id` "); + sqlBuf.append(" WHERE e.`programId`='" + programId + "' "); + sqlBuf.append(" AND a.`tenantId` = '" + tenantId + "' "); + sqlBuf.append(" AND b.`storeId`='" + storeId + "' "); + sqlBuf.append(" AND e.`deleteFlag` = 0 "); + sqlBuf.append(" GROUP BY a.`productId`, a.`makeId` "); + sqlBuf.append(" ORDER BY (d.`orderNo`+0) "); + +// sqlBuf.append(" SELECT * from (SELECT a.`tenantId`,CAST(a.`productId` AS CHAR) AS productId,CAST(e.`programId` AS CHAR) AS programId, "); +// sqlBuf.append(" CAST(c.`id` AS CHAR) AS typeId, CAST(a.`makeId` AS CHAR) AS makeId,c.`name` AS typeName ,d.`description` AS makeName, "); +// sqlBuf.append(" d.`addPrice`,d.orderNo, c.`isRadio`,d.`qtyFlag` FROM `cy_product_make` a "); +// sqlBuf.append(" LEFT JOIN `cy_store_product` b ON a.`productId` = b.`productId`"); +// sqlBuf.append(" LEFT JOIN `cy_program_product_category` e ON b.`typeId` = e.`typeId`"); +// sqlBuf.append(" LEFT JOIN `cy_make_detail` d ON a.`makeId` = d.`id` "); +// sqlBuf.append(" LEFT JOIN `cy_make_type` c ON d.`typeId` = c.`id` "); +// sqlBuf.append(" WHERE e.`programId`='"+programId+"' AND a.`tenantId` = '"+tenantId+"' "); +// sqlBuf.append(" AND b.`storeId`='"+storeId+"' AND e.`deleteFlag` = 0 and d.deleteFlag = 0"); +// sqlBuf.append(" GROUP BY a.`productId`, a.`makeId`) product union ALL (SELECT a.`tenantId`,CAST(b.`productId` AS CHAR) AS productId,CAST(e.`programId` AS CHAR) AS programId, "); +// sqlBuf.append(" CAST(c.`id` AS CHAR) AS typeId, CAST(a.`makeId` AS CHAR) AS makeId,c.`name` AS typeName ,d.`description` AS makeName, "); +// sqlBuf.append(" d.`addPrice`,d.orderNo, c.`isRadio`,d.`qtyFlag` FROM `cy_product_make_store` a "); +// sqlBuf.append(" LEFT JOIN `cy_store_product` b ON a.`storeId` = b.`storeId`"); +// sqlBuf.append(" LEFT JOIN `cy_program_product_category` e ON b.`typeId` = e.`typeId`"); +// sqlBuf.append(" LEFT JOIN `cy_make_detail` d ON a.`makeId` = d.`id` "); +// sqlBuf.append(" LEFT JOIN `cy_make_type` c ON d.`typeId` = c.`id` "); +// sqlBuf.append(" WHERE e.`programId`='"+programId+"' AND a.`tenantId` = '"+tenantId+"' "); +// sqlBuf.append(" AND b.`storeId`='"+storeId+"' AND e.`deleteFlag` = 0 and d.deleteFlag = 0"); +// sqlBuf.append(" GROUP BY b.`productId`, a.`makeId`) ORDER BY productId,typeId,(orderNo+0) "); + List> listProductMake = storeProductService.selectList(tenantId, sqlBuf.toString()); + // 第四步商品套餐信息 + sqlBuf = new StringBuffer(); + sqlBuf.append(" SELECT CAST(a.`id` AS CHAR) AS id ,a.`tenantId`, CAST(a.`productId` AS CHAR) AS productId, "); + sqlBuf.append(" a.`no`,a.`name`,a.`quantity`"); + sqlBuf.append(" from cy_program_store store LEFT JOIN cy_store_product b ON store.storeId = b.storeId "); + sqlBuf.append(" LEFT JOIN `cy_product_suit` a ON a.`productId` = b.`productId`"); + sqlBuf.append(" LEFT JOIN `cy_product_type` e ON b.`typeId` = e.`id` WHERE store.`programId`='"+programId+"' "); + sqlBuf.append(" AND a.`tenantId` = '"+tenantId+"' AND b.`storeId`='"+storeId+"' AND e.`deleteFlag` = 0 "); + sqlBuf.append(" AND e.stopFlag = 0 AND e.parentId is null GROUP BY a.`id` "); + sqlBuf.append(" ORDER BY a.`productId`,a.`no` "); + List> listProductSuit = storeProductService.selectList(tenantId, sqlBuf.toString()); + // 第五步商品套餐明细 + sqlBuf = new StringBuffer(); + sqlBuf.append(" SELECT CAST(a.`id` AS CHAR) AS id,a.`tenantId`,CAST(a.`suitId` AS CHAR) AS suitId, "); + sqlBuf.append(" CAST(a.`productId` AS CHAR) AS productId, CAST(a.`specId` AS CHAR) AS specId,"); + sqlBuf.append(" a.`quantity`,a.`addPrice`,a.`defaultflag` FROM `cy_product_suit_detail` a "); + sqlBuf.append(" LEFT JOIN cy_product_suit b ON a.`suitId` = b.`id` LEFT JOIN cy_store_product c "); + sqlBuf.append(" ON c.`productId` = b.`productId` LEFT JOIN cy_program_store store on store.storeId = c.storeId "); + sqlBuf.append(" LEFT JOIN cy_product_type e ON c.`typeId` = e.`id`"); + sqlBuf.append(" WHERE a.`tenantId` = '"+tenantId+"' AND c.`storeId`='"+storeId+"' AND store.`programId`='"+programId+"' "); + sqlBuf.append(" AND e.`deleteFlag` = 0 and e.stopFlag = 0 and e.sign !=3 and e.parentId is null "); + sqlBuf.append(" GROUP BY a.`id` ORDER BY a.`suitId` "); + List> listProductSuitDetail = storeProductService.selectList(tenantId, sqlBuf.toString()); + Map data = new HashMap<>(); + data.put("listCategory", listCategory); + data.put("listProduct", listProduct); + data.put("listProductSpec", listProductSpec); + data.put("listProductMake", listProductMake); + data.put("listProductSuit", listProductSuit); + data.put("listProductSuitDetail", listProductSuitDetail); + response.setStatus(1); + response.setMessage("获取成功"); + response.setData(data); + return response; + } + + @ServiceMethod(method = "program.spec.stock.check", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "小程序商品库存校验") + @Override + public Object ProgramProductStock(ProgramProductStockRequest request) { + String info = "小程序商品库存校验"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String specIds = request.getSpecIds(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + boolean isChecked = true; + String str = ""; + List specIdList = Arrays.asList(specIds.split(",")); + if(CollectionUtils.isNotEmpty(specIdList)){ + for(String specId : specIdList){ + String productKey = "programKey:" + storeId + ":" + specId; + Object productKeyValue = cacheService.get(tenantId, productKey); + if(productKeyValue != null){ + if(0.0 == Double.parseDouble(productKeyValue.toString())){ + isChecked = false; + ProductSpec spec = productSpecService.getWithProduct(tenantId,specId); + str += spec.getProductName()+","; + break; + } + } + + //判断此商品是否,是自定义销售时间商品; + String specProductSaleTimeKey = "specProductSaleTimeKey:"+ specId; + Object saleTime = cacheService.get(tenantId,specProductSaleTimeKey); + logger.error("saleTime:"+saleTime); + if(saleTime != null){ + SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); + long now = sdf.parse(sdf.format(new Date())).getTime(); + String saleTimeStr = (String) saleTime; + if(StringUtils.isNotBlank(saleTimeStr)){ + String[] saleTimes = saleTimeStr.split(","); + if(ArrayUtils.isNotEmpty(saleTimes)){ + //时间段数量; + int saleTimeLength = saleTimes.length; + //没有匹配上时间段次数; + int timeNotInPeriodTimes = 0; + for(String time : saleTimes){ + if(StringUtils.isNotBlank(time)){ + //String[] times = time.split("-"); + //long startTime = sdf.parse(times[0]).getTime(); + //long endTime = sdf.parse(times[1]).getTime(); + // if(now < startTime || now > endTime){ + //isChecked = false; + timeNotInPeriodTimes++; + ProductSpec spec = productSpecService.getWithProduct(tenantId,specId); + str += spec.getProductName()+","; + //break; + // } + } + } + //如果时间段数量 等于 没有匹配上时间段次数,则不能销售; + if(saleTimeLength == timeNotInPeriodTimes){ + //isChecked = false; + isChecked = true; + + } + } + } + } + } + if(isChecked){ + response.setStatus(1); + response.setMessage("校验通过"); + return response; + }else{ + str = str.substring(0,str.length()-1); + response.setStatus(0); + response.setMessage("商品:"+str+",已售罄(停售)"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + }else{ + response.setStatus(0); + response.setMessage("没有接收到商品规格信息"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + } + + @ServiceMethod(method = "program.product.saleout", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "设置巨为小程序商品售罄") + @Override + public Object ProgramProductSaleOut(ProgramProductSaleStatusRequest request) { + String info = "设置巨为小程序商品售罄"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String productTypeIds = request.getProductTypeIds(); + String specIds = request.getSpecIds(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + + ProgramStore store = programStoreService.find(tenantId,"storeId",storeId); + if(store == null || StringUtils.isBlank(store.getProgramId())){ + response.setStatus(0); + response.setMessage("此门店没有启用巨为小程序"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ProgramSetting setting = programSettingService.get(tenantId,store.getProgramId()); + if(setting == null){ + response.setStatus(0); + response.setMessage("巨为小程序参数设置错误"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + if(StringUtils.isEmpty(productTypeIds) && StringUtils.isEmpty(specIds)){ + //门店商品全部售罄; + if(setting.getLineFlag() == 0){//基础信息; + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("ps.storeId",storeId)); + criteria.add(Restrictions.eq("p.lineFlag",1)); + criteria.add(Restrictions.eq("p.deleteFlag",0)); + List> specList = storeProductService.getUsageList(tenantId,criteria); + if(CollectionUtils.isNotEmpty(specList)){ + for(Map map : specList){ + String productKey = "programKey:" + storeId + ":" + map.get("specId").toString(); + cacheService.set(tenantId, productKey, 0.0, 60 * 60 * 24); + } + } + }else{//小程序信息; + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId",storeId)); + List specList = programStoreProductService.getList(tenantId,criteria); + if(CollectionUtils.isNotEmpty(specList)){ + for(ProgramStoreProduct psp : specList){ + String productKey = "programKey:" + storeId + ":" + psp.getSpecId(); + cacheService.set(tenantId, productKey, 0.0, 60 * 60 * 24); + } + } + } + + }else{ + if(StringUtils.isNotBlank(specIds)){ + List specIdList = Arrays.asList(specIds.split(",")); + if(CollectionUtils.isNotEmpty(specIdList)){ + if(setting.getLineFlag() == 0){//基础信息; + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId",storeId)); + criteria.add(Restrictions.in("specId",specIdList)); + List products = storeProductService.getList(tenantId,criteria); + for(StoreProduct product : products){ + String productKey = "programKey:" + storeId + ":" + product.getSpecId(); + cacheService.set(tenantId, productKey, 0.0, 60 * 60 * 24); + } + }else{//线上信息; + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId",storeId)); + criteria.add(Restrictions.in("specId",specIdList)); + List products = programStoreProductService.getList(tenantId,criteria); + for(ProgramStoreProduct product : products){ + String productKey = "programKey:" + storeId + ":" + product.getSpecId(); + cacheService.set(tenantId, productKey, 0.0, 60 * 60 * 24); + } + } + } + }else{ + if(StringUtils.isNotBlank(productTypeIds)){ + List typeIds = Arrays.asList(productTypeIds.split(",")); + if(setting.getLineFlag() == 0){//基础信息; + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId",storeId)); + criteria.add(Restrictions.in("typeId",typeIds)); + List products = storeProductService.getList(tenantId,criteria); + if(CollectionUtils.isNotEmpty(products)){ + for(StoreProduct sp: products){ + String productKey = "programKey:" + storeId + ":" + sp.getSpecId(); + cacheService.set(tenantId, productKey, 0.0, 60 * 60 * 24); + } + } + }else{//小程序信息; + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId",storeId)); + criteria.add(Restrictions.in("typeId",typeIds)); + List specList = programStoreProductService.getList(tenantId,criteria); + if(CollectionUtils.isNotEmpty(specList)){ + for(ProgramStoreProduct psp : specList){ + String productKey = "programKey:" + storeId + ":" + psp.getSpecId(); + cacheService.set(tenantId, productKey, 0.0, 60 * 60 * 24); + } + } + } + }else{ + response.setStatus(0); + response.setMessage("没有查询到商品信息"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + } + } + // 发布订阅消息 + sendMessage(tenantId,storeId,1,""); + + response.setStatus(1); + response.setMessage("操作成功"); + return response; + + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + } + + @ServiceMethod(method = "program.product.salein", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "设置巨为小程序商品售卖") + @Override + public Object ProgramProductSaleIn(ProgramProductSaleStatusRequest request) { + String info = "设置巨为小程序商品售卖"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String productTypeIds = request.getProductTypeIds(); + String specIds = request.getSpecIds(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + ProgramStore store = programStoreService.find(tenantId,"storeId",storeId); + if(store == null || StringUtils.isBlank(store.getProgramId())){ + response.setStatus(0); + response.setMessage("此门店没有启用巨为小程序"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ProgramSetting setting = programSettingService.get(tenantId,store.getProgramId()); + if(setting == null){ + response.setStatus(0); + response.setMessage("巨为小程序参数设置错误"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + if(StringUtils.isEmpty(productTypeIds) && StringUtils.isEmpty(specIds)){ + //门店商品全部售罄; + if(setting.getLineFlag() == 0){//基础信息; + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("ps.storeId",storeId)); + criteria.add(Restrictions.eq("p.lineFlag",1)); + criteria.add(Restrictions.eq("p.deleteFlag",0)); + List> specList = storeProductService.getUsageList(tenantId,criteria); + if(CollectionUtils.isNotEmpty(specList)){ + for(Map map : specList){ + String productKey = "programKey:" + storeId + ":" + map.get("specId").toString(); + cacheService.set(tenantId, productKey, 99999.0, 60 * 60 * 24); + } + } + }else{//小程序信息; + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId",storeId)); + List specList = programStoreProductService.getList(tenantId,criteria); + if(CollectionUtils.isNotEmpty(specList)){ + for(ProgramStoreProduct psp : specList){ + String productKey = "programKey:" + storeId + ":" + psp.getSpecId(); + cacheService.set(tenantId, productKey, 99999.0, 60 * 60 * 24); + } + } + } + + }else{ + if(StringUtils.isNotBlank(specIds)){ + List specIdList = Arrays.asList(specIds.split(",")); + if(CollectionUtils.isNotEmpty(specIdList)){ + if(setting.getLineFlag() == 0){//基础信息; + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId",storeId)); + criteria.add(Restrictions.in("specId",specIdList)); + List products = storeProductService.getList(tenantId,criteria); + for(StoreProduct product : products){ + String productKey = "programKey:" + storeId + ":" + product.getSpecId(); + cacheService.set(tenantId, productKey, 99999.0, 60 * 60 * 24); + } + }else{//线上信息; + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId",storeId)); + criteria.add(Restrictions.in("specId",specIdList)); + List products = programStoreProductService.getList(tenantId,criteria); + for(ProgramStoreProduct product : products){ + String productKey = "programKey:" + storeId + ":" + product.getSpecId(); + cacheService.set(tenantId, productKey, 99999.0, 60 * 60 * 24); + } + } + } + }else{ + if(StringUtils.isNotBlank(productTypeIds)){ + List typeIds = Arrays.asList(productTypeIds.split(",")); + if(setting.getLineFlag() == 0){//基础信息; + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId",storeId)); + criteria.add(Restrictions.in("typeId",typeIds)); + List products = storeProductService.getList(tenantId,criteria); + if(CollectionUtils.isNotEmpty(products)){ + for(StoreProduct sp: products){ + String productKey = "programKey:" + storeId + ":" + sp.getSpecId(); + cacheService.set(tenantId, productKey, 99999.0, 60 * 60 * 24); + } + } + }else{//小程序信息; + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId",storeId)); + criteria.add(Restrictions.in("typeId",typeIds)); + List specList = programStoreProductService.getList(tenantId,criteria); + if(CollectionUtils.isNotEmpty(specList)){ + for(ProgramStoreProduct psp : specList){ + String productKey = "programKey:" + storeId + ":" + psp.getSpecId(); + cacheService.set(tenantId, productKey, 99999.0, 60 * 60 * 24); + } + } + } + }else{ + response.setStatus(0); + response.setMessage("没有查询到商品信息"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + } + } + + // 发布订阅消息 + sendMessage(tenantId,storeId,2,""); + response.setStatus(1); + response.setMessage("操作成功"); + return response; + + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + } + + + public void sendMessage(String tenantId, String storeId, int type, String productIds) { + DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String info = "巨为小程序订阅模型====>"; + try { + Map message = new HashMap<>(); + message.put("type", type); + message.put("storeId", storeId); + if (productIds == null || "".equals(productIds)) { + message.put("isAll", true); + } else { + message.put("isAll", false); + } + message.put("productIds", productIds); + message.put("date", fmt.format(new Date())); + mqttClient.Publish("wxxcx/sell/" + tenantId + "/" + storeId, JSONUtil.toJSONString(message)); + logger.error(info + "wxxcx/sell/" + tenantId + "/" + storeId, JSONUtil.toJSONString(message)); + } catch (Exception e) { + logger.error(info + "发布订阅模型时处理时,发生异常", e); + } + } + + private Map productPromotionMap(String tenantId,String storeId){ + String info = "门店商品促销"; + Map map = new HashMap<>(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + SimpleDateFormat timeSdf = new SimpleDateFormat("HH:mm:ss"); + try{ + String date = sdf.format(new Date()); + String time = timeSdf.format(new Date()); + Criteria criteria = new Criteria(); + //当天的促销任务; + criteria.add(Restrictions.eq("status",1)); + criteria.add(Restrictions.eq("storeId",storeId)); + criteria.add(Restrictions.eq("startDate",date)); + criteria.add(Restrictions.eq("endDate",date)); + criteria.add(Restrictions.ge("endTime",time)); + criteria.add(Restrictions.le("startTime",time)); + List tasks = programPromotionTaskService.getList(tenantId,criteria); + if(CollectionUtils.isNotEmpty(tasks)){ + for(ProgramPromotionTask task : tasks){ + if(task.getIsAll() == 1){ + map.put("storeId",task); + }else{ + map.put(task.getValueId(),task); + map.put(task.getValueExt1(),task); + } + } + } + }catch (Exception e){ + logger.error(info + "发布订阅模型时处理时,发生异常", e); + } + return map; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/impl/ProgramProductSpecServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/impl/ProgramProductSpecServiceImpl.java new file mode 100644 index 0000000..9ddfda1 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/impl/ProgramProductSpecServiceImpl.java @@ -0,0 +1,403 @@ +package com.jwsaas.api.service.program.impl; + +import com.jwsaas.api.request.program.ProgramProductDetailRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.program.ProgramProductSpecService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.ProductType; +import com.jwsaas.entity.food.ProgramSetting; +import com.jwsaas.entity.food.ProgramStore; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.properties.FdfsClientProperties; +import com.jwsaas.service.food.ProgramStoreService; +import com.jwsaas.utils.AppKeyUtil; +import org.springframework.beans.factory.annotation.Autowired; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Created by Administrator on 2019\9\11 0011. + */ + +@ServiceMethodBean(version = "1.0") +public class ProgramProductSpecServiceImpl extends WopServiceImpl implements ProgramProductSpecService { + + + private static final long serialVersionUID = -2313932697085108349L; + + @Resource + private com.jwsaas.service.food.ProgramSettingService programSettingService; + + @Resource + private com.jwsaas.service.food.ProgramProductCategoryService programProductCategoryService; + + @Resource + private com.jwsaas.service.food.StoreProductService storeProductService; + + @Resource + private com.jwsaas.service.food.ProductTypeService productTypeService; + + @Autowired + private FdfsClientProperties fdfsClientProperties; + + @Resource + private com.jwsaas.cache.CacheService cacheService; + + @Resource + private ProgramStoreService programStoreService; + + + @ServiceMethod(method = "program.productspec.detail", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "小程序商品规格详细") + @Override + public Object ProgramProductSpecDetailInfo(ProgramProductDetailRequest request) { + String info = "小程序商品规格详细"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String productId = request.getProductId(); + String specId = request.getSpecId(); + String storeId = request.getStoreId(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + ProgramStore store = programStoreService.find(tenantId,"storeId",storeId); + if(store == null){ + response.setStatus(0); + response.setMessage("小程序门店不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + ProgramSetting programSetting = programSettingService.get(tenantId, store.getProgramId()); + if (programSetting == null) { + response.setStatus(0); + response.setMessage("小程序设置不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + // 启用线上资料独立 + if (programSetting.getLineFlag() == 1) { + response = getProuctSpecDataStoreLine(response, tenantId, storeId, programSetting.getId(),productId,specId); + } else { + response = getProuctSpecDataStore(response, tenantId, storeId, programSetting.getId(),productId,specId); + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + public CommonDataResponse getProuctSpecDataStore(CommonDataResponse response, String tenantId, + String storeId, String programId, String productId, String specId) throws Exception { + // 第一步获取分类资料 + StringBuffer sqlBuf = null; + + List> listCategory = new ArrayList<>(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.isNull("parentId")); + List productTypeList = productTypeService.getList(tenantId, criteria); + Map productTypeMap = new HashMap<>(); + for (ProductType productType : productTypeList) { + productTypeMap.put(productType.getId(), productType); + } + // 第二部获取商品资料 + sqlBuf = new StringBuffer(); + sqlBuf.append(" SELECT CAST(sp.`id` AS CHAR) AS id,sp.`tenantId`, "); + sqlBuf.append(" CAST(p.`id` AS CHAR) AS productId,p.`no` AS `productNo`,p.`name` AS `productName`,CAST(p.`unitId`AS CHAR) AS `productUnitId` ,d.`name` AS `productUnitName`, "); + sqlBuf.append(" p.`typePath`,CAST(p.`typeId` AS CHAR) AS typeId,CAST(sp.`specId` AS CHAR) AS specId,ps.`name` AS specName ,p.`description`,sp.`price`, "); + sqlBuf.append(" sp.`memberPrice`,sp.`wprice`,sp.`wmemberPrice`,p.`minCount`,p.`orderNo`, "); + sqlBuf.append(" p.`isNew`,p.`suitFlag`,ps.`boxPrice`,p.groupName AS groupName,p.picture AS `linkUrl`,COUNT(sp.`specId`) AS specCount, "); + sqlBuf.append(" ps.`price` AS `marketPrice`,p.`monthSaleCount`,p.`praise`,p.`saleTimeType`,p.`saleTime` "); + sqlBuf.append(" FROM `cy_store_product` sp "); + sqlBuf.append(" LEFT JOIN cy_product p ON (sp.productId=p.id AND sp.tenantId=p.tenantId) "); + sqlBuf.append(" LEFT JOIN cy_product_spec ps ON (sp.specId=ps.id AND sp.tenantId=ps.tenantId) "); + sqlBuf.append(" LEFT JOIN cy_product_unit d ON d.`id` = p.`unitId` "); + sqlBuf.append(" WHERE sp.`storeId` = '" + storeId + "' "); + sqlBuf.append(" AND sp.tenantId = '" + tenantId + "' "); + sqlBuf.append(" AND p.`id` = '" + productId + "' "); + sqlBuf.append(" AND ps.`id` = '" + specId + "' "); + sqlBuf.append(" AND p.`deleteFlag` = 0 "); + sqlBuf.append(" AND p.`lineFlag` = 1 "); + sqlBuf.append(" GROUP BY sp.`productId` "); + sqlBuf.append(" ORDER BY p.`orderNo` ASC "); + List> listProduct = programProductCategoryService.selectList(tenantId, sqlBuf.toString()); + for (Map map : listProduct) { + if (map.get("linkUrl") != null) { + map.put("linkUrl", fdfsClientProperties.getAccessDomain() + "/" + map.get("groupName") + "/" + map.get("linkUrl")); + } else { + map.put("linkUrl", ""); + } + if (map.get("typePath") != null) { + String[] typeIds = map.get("typePath").toString().split(","); + ProductType productType = productTypeMap.get(typeIds[0]); + map.put("seriesId", productType.getId()); + map.put("seriesName", productType.getName()); + } else { + map.put("seriesId", ""); + map.put("seriesName", ""); + } + } + // 第二部扩展获取商品规格信息 + sqlBuf = new StringBuffer(); + sqlBuf.append(" SELECT CAST(sp.`id` AS CHAR) AS id,sp.`tenantId`, "); + sqlBuf.append(" CAST(p.`id` AS CHAR) AS productId,p.`no` AS `productNo`,p.`name` AS `productName`,CAST(p.`unitId`AS CHAR) AS `productUnitId` ,d.`name` AS `productUnitName`, "); + sqlBuf.append(" p.`typePath`,CAST(p.`typeId` AS CHAR) AS typeId,CAST(sp.`specId` AS CHAR) AS specId,ps.`name` AS specName ,p.`description`,sp.`price`, "); + sqlBuf.append(" sp.`memberPrice`,sp.`wprice`,sp.`wmemberPrice`,p.`minCount`,p.`orderNo`, "); + sqlBuf.append(" p.`isNew`,p.`suitFlag`,ps.`boxPrice`,p.groupName AS groupName,p.picture AS `linkUrl` "); + sqlBuf.append(" FROM `cy_store_product` sp "); + sqlBuf.append(" LEFT JOIN cy_product p ON (sp.productId=p.id AND sp.tenantId=p.tenantId) "); + sqlBuf.append(" LEFT JOIN cy_product_spec ps ON (sp.specId=ps.id AND sp.tenantId=ps.tenantId) "); + sqlBuf.append(" LEFT JOIN cy_product_unit d ON d.`id` = p.`unitId` "); + sqlBuf.append(" WHERE sp.`storeId` = '" + storeId + "' "); + sqlBuf.append(" AND sp.tenantId = '" + tenantId + "' "); + sqlBuf.append(" AND p.`id` = '" + productId + "' "); + sqlBuf.append(" AND ps.`id` = '" + specId + "' "); + sqlBuf.append(" AND p.`lineFlag` = 1 "); + sqlBuf.append(" AND p.`deleteFlag` = 0 "); + sqlBuf.append(" ORDER BY p.`orderNo` ASC "); + List> listProductSpec = programProductCategoryService.selectList(tenantId, sqlBuf.toString()); + for (Map mapProduct : listProductSpec) { + if (mapProduct.get("linkUrl") != null) { + mapProduct.put("linkUrl", fdfsClientProperties.getAccessDomain() + "/" + mapProduct.get("groupName") + "/" + mapProduct.get("linkUrl")); + } else { + mapProduct.put("linkUrl", ""); + } + if (mapProduct.get("typePath") != null) { + String[] typeIds = mapProduct.get("typePath").toString().split(","); + ProductType productType = productTypeMap.get(typeIds[0]); + mapProduct.put("seriesId", productType.getId()); + mapProduct.put("seriesName", productType.getName()); + } else { + mapProduct.put("seriesId", ""); + mapProduct.put("seriesName", ""); + } + String specIds = mapProduct.get("specId").toString(); + String productKey = "programKey:" + storeId + ":" + specIds; + Object productKeyValue = cacheService.get(tenantId, productKey); + if (productKeyValue == null) { + productKeyValue = 9999.00; + cacheService.set(tenantId, productKey, productKeyValue, 60 * 60 * 24); + } + mapProduct.put("stock", Double.parseDouble(productKeyValue.toString())); + } + // 第三部获取商品加料信息 + sqlBuf = new StringBuffer(); + sqlBuf.append(" SELECT a.`tenantId`,CAST(a.`productId` AS CHAR) AS productId,"); + sqlBuf.append(" CAST(c.`id` AS CHAR) AS typeId, CAST(a.`makeId` AS CHAR) AS makeId,c.`name` AS typeName ,d.`description` AS makeName, "); + sqlBuf.append(" d.`addPrice`,c.`isRadio`,d.`qtyFlag` FROM `cy_product_make` a "); + sqlBuf.append(" LEFT JOIN `cy_store_product` b ON a.`productId` = b.`productId`"); + sqlBuf.append(" LEFT JOIN `cy_make_detail` d ON a.`makeId` = d.`id` "); + sqlBuf.append(" LEFT JOIN `cy_make_type` c ON d.`typeId` = c.`id` "); + sqlBuf.append(" WHERE b.`productId`='" + productId + "' "); + sqlBuf.append(" AND b.`specId` = '" + specId + "' "); + sqlBuf.append(" AND a.`tenantId` = '" + tenantId + "' "); + sqlBuf.append(" AND b.`storeId`='" + storeId + "' "); + sqlBuf.append(" GROUP BY a.`productId`, a.`makeId` "); + sqlBuf.append(" ORDER BY a.`productId` "); + List> listProductMake = storeProductService.selectList(tenantId, sqlBuf.toString()); + // 第四步商品套餐信息 + sqlBuf = new StringBuffer(); + sqlBuf.append(" SELECT CAST(a.`id` AS CHAR) AS id ,a.`tenantId`, CAST(a.`productId` AS CHAR) AS productId, "); + sqlBuf.append(" a.`no`,a.`name`,a.`quantity` FROM `cy_product_suit` a "); + sqlBuf.append(" LEFT JOIN `cy_store_product` b ON a.`productId` = b.`productId` "); + sqlBuf.append(" WHERE b.`productId`='" + productId + "' "); + sqlBuf.append(" AND b.`specId` = '" + specId + "' "); + sqlBuf.append(" AND a.`tenantId` = '" + tenantId + "' "); + sqlBuf.append(" AND b.`storeId`='" + storeId + "' "); + sqlBuf.append(" GROUP BY a.`id` "); + sqlBuf.append(" ORDER BY a.`productId`,a.`no` "); + List> listProductSuit = storeProductService.selectList(tenantId, sqlBuf.toString()); + // 第五步商品套餐明细 + sqlBuf = new StringBuffer(); + sqlBuf.append(" SELECT CAST(a.`id` AS CHAR) AS id,a.`tenantId`,CAST(a.`suitId` AS CHAR) AS suitId, CAST(a.`productId` AS CHAR) AS productId, "); + sqlBuf.append(" CAST(a.`specId` AS CHAR) AS specId,a.`quantity`,a.`addPrice`,a.`defaultflag` FROM `cy_product_suit_detail` a "); + sqlBuf.append(" LEFT JOIN cy_product_suit b ON a.`suitId` = b.`id` "); + sqlBuf.append(" LEFT JOIN cy_store_product c ON c.`productId` = b.`productId`"); + sqlBuf.append(" WHERE a.`tenantId` = '" + tenantId + "' "); + sqlBuf.append(" AND c.`storeId`='" + storeId + "' "); + sqlBuf.append(" AND c.`productId`='" + productId + "' "); + sqlBuf.append(" AND c.`specId`='" + specId + "' "); + sqlBuf.append(" GROUP BY a.`id` "); + sqlBuf.append(" ORDER BY a.`suitId` "); + List> listProductSuitDetail = storeProductService.selectList(tenantId, sqlBuf.toString()); + Map data = new HashMap<>(); + data.put("listCategory", listCategory); + data.put("listProduct", listProduct); + data.put("listProductSpec", listProductSpec); + data.put("listProductMake", listProductMake); + data.put("listProductSuit", listProductSuit); + data.put("listProductSuitDetail", listProductSuitDetail); + response.setStatus(1); + response.setMessage("获取成功"); + response.setData(data); + return response; + } + + public CommonDataResponse getProuctSpecDataStoreLine(CommonDataResponse response, String tenantId, + String storeId, String programId, String productId, String specId)throws Exception { + // 第一步获取分类资料 + StringBuffer sqlBuf = null; + + List> listCategory = new ArrayList<>(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.isNull("parentId")); + List productTypeList = productTypeService.getList(tenantId, criteria); + Map productTypeMap = new HashMap<>(); + for (ProductType productType : productTypeList) { + productTypeMap.put(productType.getId(), productType); + } + // 第二部获取商品资料 + sqlBuf = new StringBuffer(); + sqlBuf.append(" SELECT CAST(sp.`id` AS CHAR) AS id,sp.`tenantId`, "); + sqlBuf.append(" CAST(p.`id` AS CHAR) AS productId,p.`no` AS `productNo`,p.`name` AS `productName`,CAST(p.`unitId`AS CHAR) AS `productUnitId` ,d.`name` AS `productUnitName`, "); + sqlBuf.append(" p.`typePath`,CAST(p.`typeId` AS CHAR) AS typeId,c.`name` as typeName,CAST(sp.`specId` AS CHAR) AS specId,ps.`name` AS specName ,p.`description`,sp.`wprice` as `price` , "); + sqlBuf.append(" sp.`wmemberPrice` as memberPrice ,sp.`wprice`,sp.`wmemberPrice`,p.`minCount`,p.`orderNo`, "); + sqlBuf.append(" p.`isNew`,p.`suitFlag`,ps.`boxPrice`,p.groupName AS groupName,p.picture AS `linkUrl`,COUNT(sp.`specId`) AS specCount, "); + sqlBuf.append(" ps.`price` AS `marketPrice`,p.`monthSaleCount`,p.`praise`,p.`saleTimeType`,p.`saleTime` "); + sqlBuf.append(" FROM `cy_program_store_product` sp "); + sqlBuf.append(" LEFT JOIN cy_product p ON (sp.productId=p.id AND sp.tenantId=p.tenantId) "); + sqlBuf.append(" LEFT JOIN cy_program_product_category c ON c.typeId = p.typeId "); + sqlBuf.append(" LEFT JOIN cy_product_spec ps ON (sp.specId=ps.id AND sp.tenantId=ps.tenantId) "); + sqlBuf.append(" LEFT JOIN cy_product_unit d ON d.`id` = p.`unitId` "); + sqlBuf.append(" WHERE sp.`storeId` = '" + storeId + "' "); + sqlBuf.append(" AND sp.tenantId = '" + tenantId + "' "); + sqlBuf.append(" AND p.`id` = '" + productId + "' "); + sqlBuf.append(" AND ps.`id` = '" + specId + "' "); + sqlBuf.append(" AND p.`deleteFlag` = 0 "); + sqlBuf.append(" AND p.`lineFlag` = 1 "); + sqlBuf.append(" GROUP BY sp.`productId` "); + sqlBuf.append(" ORDER BY p.`orderNo` ASC "); + List> listProduct = programProductCategoryService.selectList(tenantId, sqlBuf.toString()); + for (Map map : listProduct) { + if (map.get("linkUrl") != null) { + map.put("linkUrl", fdfsClientProperties.getAccessDomain() + "/" + map.get("groupName") + "/" + map.get("linkUrl")); + } else { + map.put("linkUrl", ""); + } + if (map.get("typePath") != null) { + String[] typeIds = map.get("typePath").toString().split(","); + ProductType productType = productTypeMap.get(typeIds[0]); + map.put("seriesId", productType.getId()); + map.put("seriesName", productType.getName()); + } else { + map.put("seriesId", ""); + map.put("seriesName", ""); + } + } + // 第二部扩展获取商品规格信息 + sqlBuf = new StringBuffer(); + sqlBuf.append(" SELECT CAST(sp.`id` AS CHAR) AS id,sp.`tenantId`, "); + sqlBuf.append(" CAST(p.`id` AS CHAR) AS productId,p.`no` AS `productNo`,p.`name` AS `productName`,CAST(p.`unitId`AS CHAR) AS `productUnitId` ,d.`name` AS `productUnitName`, "); + sqlBuf.append(" p.`typePath`,CAST(p.`typeId` AS CHAR) AS typeId,c.`name` as typeName,CAST(sp.`specId` AS CHAR) AS specId,ps.`name` AS specName ,p.`description`,sp.`wprice` AS `price`, "); + sqlBuf.append(" sp.`wmemberPrice` AS `memberPrice`,sp.`wprice`,sp.`wmemberPrice`,p.`minCount`,p.`orderNo`, "); + sqlBuf.append(" p.`isNew`,p.`suitFlag`,ps.`boxPrice`,p.groupName AS groupName,p.picture AS `linkUrl` "); + sqlBuf.append(" FROM `cy_program_store_product` sp "); + sqlBuf.append(" LEFT JOIN cy_product p ON (sp.productId=p.id AND sp.tenantId=p.tenantId) "); + sqlBuf.append(" LEFT JOIN cy_program_product_category c ON c.typeId = p.typeId "); + sqlBuf.append(" LEFT JOIN cy_product_spec ps ON (sp.specId=ps.id AND sp.tenantId=ps.tenantId) "); + sqlBuf.append(" LEFT JOIN cy_product_unit d ON d.`id` = p.`unitId` "); + sqlBuf.append(" WHERE sp.`storeId` = '" + storeId + "' "); + sqlBuf.append(" AND sp.tenantId = '" + tenantId + "' "); + sqlBuf.append(" AND p.`id` = '" + productId + "' "); + sqlBuf.append(" AND ps.`id` = '" + specId + "' "); + sqlBuf.append(" AND p.`lineFlag` = 1 "); + sqlBuf.append(" AND p.`deleteFlag` = 0 "); + sqlBuf.append(" ORDER BY p.`orderNo` ASC "); + List> listProductSpec = programProductCategoryService.selectList(tenantId, sqlBuf.toString()); + for (Map mapProduct : listProductSpec) { + if (mapProduct.get("linkUrl") != null) { + mapProduct.put("linkUrl", fdfsClientProperties.getAccessDomain() + "/" + mapProduct.get("groupName") + "/" + mapProduct.get("linkUrl")); + } else { + mapProduct.put("linkUrl", ""); + } + if (mapProduct.get("typePath") != null) { + String[] typeIds = mapProduct.get("typePath").toString().split(","); + ProductType productType = productTypeMap.get(typeIds[0]); + mapProduct.put("seriesId", productType.getId()); + mapProduct.put("seriesName", productType.getName()); + } else { + mapProduct.put("seriesId", ""); + mapProduct.put("seriesName", ""); + } + String specIds = mapProduct.get("specId").toString(); + String productKey = "programKey:" + storeId + ":" + specIds; + Object productKeyValue = cacheService.get(tenantId, productKey); + if (productKeyValue == null) { + productKeyValue = 9999.00; + cacheService.set(tenantId, productKey, productKeyValue, 60 * 60 * 24); + } + mapProduct.put("stock", Double.parseDouble(productKeyValue.toString())); + } + // 第三部获取商品加料信息 + sqlBuf = new StringBuffer(); + sqlBuf.append(" SELECT a.`tenantId`,CAST(a.`productId` AS CHAR) AS productId, CAST(b.`programId` AS CHAR) AS programId,"); + sqlBuf.append(" CAST(c.`id` AS CHAR) AS typeId, CAST(a.`makeId` AS CHAR) AS makeId,c.`name` AS typeName ,d.`description` AS makeName, "); + sqlBuf.append(" a.`addPrice`,c.`isRadio`,d.`qtyFlag` FROM `cy_program_product_make` a "); + sqlBuf.append(" LEFT JOIN `cy_program_store_product` b ON a.`productId` = b.`productId`"); + sqlBuf.append(" LEFT JOIN `cy_make_detail` d ON a.`makeId` = d.`id` "); + sqlBuf.append(" LEFT JOIN `cy_make_type` c ON d.`typeId` = c.`id` "); + sqlBuf.append(" WHERE b.`programId`='" + programId + "' "); + sqlBuf.append(" AND a.`tenantId` = '" + tenantId + "' "); + sqlBuf.append(" AND b.`storeId`='" + storeId + "' "); + sqlBuf.append(" AND b.`productId`='" + productId + "' "); + sqlBuf.append(" GROUP BY a.`productId`, a.`makeId` "); + sqlBuf.append(" ORDER BY a.`productId` "); + List> listProductMake = storeProductService.selectList(tenantId, sqlBuf.toString()); + + // 第四步商品套餐信息 + sqlBuf = new StringBuffer(); + sqlBuf.append(" SELECT CAST(a.`id` AS CHAR) AS id ,a.`tenantId`, CAST(a.`productId` AS CHAR) AS productId, "); + sqlBuf.append(" a.`no`,a.`name`,a.`quantity` FROM `cy_product_suit` a "); + sqlBuf.append(" LEFT JOIN `cy_program_store_product` b ON a.`productId` = b.`productId` "); + sqlBuf.append(" WHERE b.`programId`='" + programId + "' "); + sqlBuf.append(" AND a.`tenantId` = '" + tenantId + "' "); + sqlBuf.append(" AND b.`storeId`='" + storeId + "' "); + sqlBuf.append(" AND b.`productId`='" + productId + "' "); + sqlBuf.append(" GROUP BY a.`id` "); + sqlBuf.append(" ORDER BY a.`productId`,a.`no` "); + List> listProductSuit = storeProductService.selectList(tenantId, sqlBuf.toString()); + // 第五步商品套餐明细 + sqlBuf = new StringBuffer(); + sqlBuf.append(" SELECT CAST(a.`id` AS CHAR) AS id,a.`tenantId`,CAST(a.`suitId` AS CHAR) AS suitId, CAST(a.`productId` AS CHAR) AS productId, "); + sqlBuf.append(" CAST(a.`specId` AS CHAR) AS specId,a.`quantity`,a.`addPrice`,a.`defaultflag` FROM `cy_product_suit_detail` a "); + sqlBuf.append(" LEFT JOIN cy_product_suit b ON a.`suitId` = b.`id` "); + sqlBuf.append(" LEFT JOIN cy_program_store_product c ON c.`productId` = b.`productId`"); + sqlBuf.append(" WHERE a.`tenantId` = '" + tenantId + "' "); + sqlBuf.append(" AND c.`storeId`='" + storeId + "' "); + sqlBuf.append(" AND c.`productId`='" + productId + "' "); + sqlBuf.append(" AND c.`programId`='" + programId + "' "); + sqlBuf.append(" GROUP BY a.`id` "); + sqlBuf.append(" ORDER BY a.`suitId` "); + List> listProductSuitDetail = storeProductService.selectList(tenantId, sqlBuf.toString()); + Map data = new HashMap<>(); + data.put("listCategory", listCategory); + data.put("listProduct", listProduct); + data.put("listProductSpec", listProductSpec); + data.put("listProductMake", listProductMake); + data.put("listProductSuit", listProductSuit); + data.put("listProductSuitDetail", listProductSuitDetail); + response.setStatus(1); + response.setMessage("获取成功"); + response.setData(data); + return response; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/impl/ProgramStoreServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/impl/ProgramStoreServiceImpl.java new file mode 100644 index 0000000..d6d5a53 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/impl/ProgramStoreServiceImpl.java @@ -0,0 +1,890 @@ +package com.jwsaas.api.service.program.impl; + +import java.text.DecimalFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; + +import javax.annotation.Resource; + +import com.alibaba.dubbo.common.utils.CollectionUtils; +import com.alibaba.dubbo.common.utils.StringUtils; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.jwsaas.api.request.program.ProgramStoreDetailRequest; +import com.jwsaas.api.request.program.ProgramStoreListRequest; +import com.jwsaas.api.request.program.ProgramStoreListSyncRequest; +import com.jwsaas.api.request.program.ProgramStoreOpenRequest; +import com.jwsaas.api.request.program.ProgramStoreStopRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.response.mode.CommonPagerResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.program.ProgramStoreService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.PayMode; +import com.jwsaas.entity.food.ProgramStore; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.pager.Pager; +import com.jwsaas.service.food.PayModeService; +import com.jwsaas.utils.AppKeyUtil; + +@ServiceMethodBean(version = "1.0") +public class ProgramStoreServiceImpl extends WopServiceImpl implements ProgramStoreService { + + private static final long serialVersionUID = -8398338319671928287L; + + @Resource + private com.jwsaas.service.food.ProgramStoreService programStoreService; + @Resource + private PayModeService payModeService; + + + public static double pi = 3.1415926535897932384626; + public static double a = 6378245.0; + public static double ee = 0.00669342162296594323; + + private static final double EARTH_RADIUS = 6378137;// 地球平均半径 + //private static final double EARTH_RADIUS = 6378393;// 地球椭圆半径 + + + @ServiceMethod(method = "program.store.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店列表") + @Override + public Object ProgramStoreList(ProgramStoreListRequest request) { + String info = "小程序门店信息"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String programId = request.getProgramId(); + String keyword = request.getKeyword(); + String longitude = request.getLongitude();// 经度 + String latitude = request.getLatitude();// 纬度 + String busMode = request.getBusMode();//营业模式 + + Integer pageNumber = request.getPageNumber();// 页码 + Integer pageSize = request.getPageSize();// 每页数据 + + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("programId", programId)); + criteria.add(Restrictions.eq("enabled", 1)); + criteria.add(Restrictions.eq("deleteFlag", 0)); + if (StringUtils.isNotEmpty(keyword)) { + criteria.add(Restrictions.like("storeName", '%' + keyword + '%')); + } + if(StringUtils.isNotEmpty(busMode)){ + criteria.add(Restrictions.like("busModes", '%' + busMode + '%')); + } + //criteria.add(Restrictions.order("distance", "asc")); + //List storeList = this.programStoreService.getDistanceList(tenantId, longitude, latitude, criteria); + List storeList = this.programStoreService.getList(tenantId,criteria); + List storeIds = new ArrayList<>(); + if(CollectionUtils.isNotEmpty(storeList)){ + //利用TreeMap,将门店排序; + Map> distanceStoreMap = new TreeMap<>(); + //将小程序 WGS-84 坐标 转成 GCJ-02 坐标 + Double lon = Double.parseDouble(longitude); + Double lat = Double.parseDouble(latitude); + + double[] gcPoint = calWGS84toGCJ02(lat,lon); + double gcLongitude = gcPoint[1];//GCJ-02 坐标 经度 + double gcLatitude = gcPoint[0];//GCJ-02 坐标 纬度; + //计算次坐标与门店坐标距离; + for(ProgramStore store : storeList){ + storeIds.add(store.getStoreId()); + //门店经纬度,没有经纬度的将门店排在最后; + Double storeLongitude = store.getLongitude(); + Double storeLatitude = store.getLatitude(); + Double distance = 99999999.00; + if(storeLongitude != null && storeLatitude != null){ + distance = getDistance(storeLatitude,storeLongitude,gcLatitude,gcLongitude); + //distance = distanceSimplify(storeLongitude,storeLatitude,lon,lat); + } + store.setDistance(String.valueOf(distance)); + if(distanceStoreMap.containsKey(distance)){ + List stores = distanceStoreMap.get(distance); + stores.add(store); + distanceStoreMap.put(distance,stores); + }else{ + List stores = new ArrayList<>(); + stores.add(store); + distanceStoreMap.put(distance,stores); + } + } + Collection> programStoreList =(Collection>)distanceStoreMap.values(); + if(CollectionUtils.isNotEmpty(programStoreList)){ + storeList = new ArrayList<>(); + for(List programStores : programStoreList){ + for(ProgramStore programStore : programStores){ + storeList.add(programStore); + } + } + } + } + + + Map> storeDeductionRateMap = new HashMap<>(); + if(CollectionUtils.isNotEmpty(storeList)){ +// List storeIds = new ArrayList<>(); +// for(ProgramStore programStore : storeList){ +// storeIds.add(programStore.getStoreId()); +// } + if(CollectionUtils.isNotEmpty(storeIds)){ + List payModeNos = new ArrayList<>(); + payModeNos.add("02"); + payModeNos.add("05"); + Criteria criter = new Criteria(); + criter.add(Restrictions.in("store.storeId",storeIds)); + criter.add(Restrictions.in("paymode.no",payModeNos)); + criter.add(Restrictions.eq("paymode.deleteFlag",0)); + criter.add(Restrictions.isNotNull("store.periodDiscount")); + List payModeList = payModeService.getListStorePayModePeriodDiscount(tenantId,criter); + if(CollectionUtils.isNotEmpty(payModeList)){ + Long nowTime = new Date().getTime(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + for(PayMode payMode : payModeList){ + JSONArray periodDiscountArray = JSONArray.parseArray(payMode.getPeriodDiscount()); + if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(periodDiscountArray)){ + for(Object obj : periodDiscountArray){ + JSONObject jsonObject = JSON.parseObject(obj+""); + String startDateStr = jsonObject.getString("startDate"); + String endDateStr = jsonObject.getString("endDate"); + Double deductionRate = jsonObject.getDouble("discount"); + if(StringUtils.isNotEmpty(startDateStr) && StringUtils.isNotEmpty(endDateStr) && deductionRate != null){ + Long startDate = sdf.parse(startDateStr + " 00:00:00").getTime(); + Long endDate = sdf.parse(endDateStr +" 23:59:59").getTime(); + if(nowTime >=startDate && nowTime < endDate){ + logger.debug("deductionRate ---------->>>>>> "+deductionRate); + if(storeDeductionRateMap.containsKey(payMode.getStoreId())){ + Map map = storeDeductionRateMap.get(payMode.getStoreId()); + map.put(payMode.getNo(),deductionRate); + storeDeductionRateMap.put(payMode.getStoreId(),map); + }else{ + Map map = new HashMap<>(); + map.put(payMode.getNo(),deductionRate); + storeDeductionRateMap.put(payMode.getStoreId(),map); + } + + } + } + + } + } + } + } + + } + } + + int totalCount = storeList.size(); + + int startIndex = pageSize * (pageNumber - 1); + int endIndex = pageSize * pageNumber - 1; + if (endIndex >= storeList.size()) { + endIndex = totalCount - 1; + } + List> list = new ArrayList<>(); + for (int i = startIndex; i <= endIndex; i++) { + ProgramStore programStore = storeList.get(i); + Map map = new HashMap<>(); + map.put("tenantId", programStore.getTenantId()); + map.put("id", programStore.getId()); + map.put("storeId", programStore.getStoreId()); + map.put("storeNo", programStore.getStoreNo()); + map.put("storeName", programStore.getStoreName()); + map.put("orderTel", programStore.getOrderTel()); + map.put("address", programStore.getAddress()); + map.put("latitude", programStore.getLatitude()); + map.put("longitude", programStore.getLongitude()); + map.put("distance", programStore.getDistance()); + map.put("noticeInfo", programStore.getNoticeInfo()); + map.put("isOpen", checkStoreOpenStatus(programStore)); + map.put("memberPayEnabled", programStore.getMemberPayEnabled());//门店是否启用会员支付; + map.put("memberPriceEnabled", programStore.getMemberPriceEnabled()); + map.put("openTimeType", programStore.getOpenTimeType()); + map.put("openTime", programStore.getOpenTime()); + map.put("deliverType", programStore.getDeliverType()); + map.put("deliverFee", programStore.getDeliverFee()); + map.put("deliverFeeDiscountType", programStore.getDeliverFeeDiscountType()); + map.put("deliverFeeDiscountRule", programStore.getDeliverFeeDiscountRule()); + map.put("deliverMoney", programStore.getDeliverMoney()); + map.put("deliverKilometre", programStore.getDeliverKilometre()); + map.put("busModes", programStore.getBusModes()); + map.put("linkUrl", programStore.getLinkUrl()); + Double discount = null; + Double memberDeductionRate = null; + if(storeDeductionRateMap.containsKey(programStore.getStoreId())){ + Map rateMap = storeDeductionRateMap.get(programStore.getStoreId()); + if(rateMap.containsKey("05")){ + discount = rateMap.get("05"); + } + if(rateMap.containsKey("02")){ + memberDeductionRate = rateMap.get("02"); + } + + } + map.put("deductionRate", discount);//门店扣率; + map.put("memberDeductionRate", memberDeductionRate);//门店会员卡扣率; + map.put("discomFlag", programStore.getDiscomFlag());//是否第三方配送; + map.put("distributionSelfLimits", programStore.getDistributionSelfLimits());//自配送范围(公里); + map.put("takeOutBoxFeeFlag", programStore.getTakeOutBoxFeeFlag());//外带模式是否收取餐盒费; + map.put("autoDeliveryFlag", programStore.getAutoDeliveryFlag());//是否自动呼叫配送; + list.add(map); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setTotalCount(totalCount); + response.setPageSize(pageSize); + response.setPageCount(totalCount % pageSize == 0 ? totalCount/pageSize : (totalCount/pageSize+1)); + response.setPageNumber(pageNumber); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + + + // 把经纬度转为度(°) + private static double rad(double d) { + return d * Math.PI / 180.0; + } + + private double getDistance(double lat1, double lng1, double lat2, double lng2) { + double radLat1 = rad(lat1); + double radLat2 = rad(lat2); + double a = radLat1 - radLat2; + double b = rad(lng1) - rad(lng2); + double s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + + Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2))); + s = s * EARTH_RADIUS; + //s = s / 1000; + DecimalFormat df = new DecimalFormat("#.00"); + s = Double.parseDouble(df.format(s)); + return s; + } + + + /** + * 地球坐标系 WGS-84 to 火星坐标系 GCJ-02 + * + * @param latitude 纬度 + * @param longitude 经度 + * @return [纬度, 经度] + */ + private double[] calWGS84toGCJ02(double latitude, double longitude) { + double dLat = transformLat(longitude - 105.0, latitude - 35.0); + double dLon = transformLon(longitude - 105.0, latitude - 35.0); + double radLat = latitude / 180.0 * pi; + double magic = Math.sin(radLat); + magic = 1 - ee * magic * magic; + double sqrtMagic = Math.sqrt(magic); + dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi); + dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi); + double mgLat = latitude + dLat; + double mgLon = longitude + dLon; + + return new double[]{mgLat, mgLon}; + } + + private static double transformLat(double x, double y) { + double ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + + 0.2 * Math.sqrt(Math.abs(x)); + ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0; + ret += (20.0 * Math.sin(y * pi) + 40.0 * Math.sin(y / 3.0 * pi)) * 2.0 / 3.0; + ret += (160.0 * Math.sin(y / 12.0 * pi) + 320 * Math.sin(y * pi / 30.0)) * 2.0 / 3.0; + return ret; + } + + private static double transformLon(double x, double y) { + double ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 + * Math.sqrt(Math.abs(x)); + ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0; + ret += (20.0 * Math.sin(x * pi) + 40.0 * Math.sin(x / 3.0 * pi)) * 2.0 / 3.0; + ret += (150.0 * Math.sin(x / 12.0 * pi) + 300.0 * Math.sin(x / 30.0 * pi)) * 2.0 / 3.0; + return ret; + } + + @ServiceMethod(method = "program.store.detail", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店详情") + @Override + public Object ProgramStoreDetail(ProgramStoreDetailRequest request) { + String info = "小程序门店信息"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("enabled", 1)); + criteria.add(Restrictions.eq("deleteFlag", 0)); + List storeList = this.programStoreService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(storeList)) { + response.setStatus(0); + response.setMessage("门店信息不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ProgramStore programStore = storeList.get(0); + Map data = new HashMap<>(); + data.put("tenantId", programStore.getTenantId()); + data.put("id", programStore.getId()); + data.put("storeId", programStore.getStoreId()); + data.put("storeNo", programStore.getStoreNo()); + data.put("storeName", programStore.getStoreName()); + data.put("orderTel", programStore.getOrderTel()); + data.put("address", programStore.getAddress()); + data.put("latitude", programStore.getLatitude()); + data.put("longitude", programStore.getLongitude()); + data.put("noticeInfo", programStore.getNoticeInfo()); + data.put("isOpen", checkStoreOpenStatus(programStore)); + data.put("memberPayEnabled", programStore.getMemberPayEnabled());//门店是否启用会员支付; + data.put("memberPriceEnabled", programStore.getMemberPriceEnabled()); + data.put("openTimeType", programStore.getOpenTimeType()); + data.put("openTime", programStore.getOpenTime()); + data.put("deliverType", programStore.getDeliverType()); + data.put("deliverFee", programStore.getDeliverFee()); + data.put("deliverFeeDiscountType", programStore.getDeliverFeeDiscountType()); + data.put("deliverFeeDiscountRule", programStore.getDeliverFeeDiscountRule()); + data.put("deliverMoney", programStore.getDeliverMoney()); + data.put("deliverKilometre", programStore.getDeliverKilometre()); + data.put("busModes", programStore.getBusModes()); + data.put("linkUrl", programStore.getLinkUrl()); + data.put("programId", programStore.getProgramId()); + + Map> storeDeductionRateMap = new HashMap<>(); + + List payModeNos = new ArrayList<>(); + payModeNos.add("02"); + payModeNos.add("05"); + Criteria criter = new Criteria(); + criter.add(Restrictions.eq("store.storeId",storeId)); + criter.add(Restrictions.in("paymode.no",payModeNos)); + criter.add(Restrictions.eq("paymode.deleteFlag",0)); + criter.add(Restrictions.isNotNull("store.periodDiscount")); + List payModeList = payModeService.getListStorePayModePeriodDiscount(tenantId,criter); + if(CollectionUtils.isNotEmpty(payModeList)){ + Long nowTime = new Date().getTime(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + for(PayMode payMode : payModeList){ + JSONArray periodDiscountArray = JSONArray.parseArray(payMode.getPeriodDiscount()); + if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(periodDiscountArray)){ + for(Object obj : periodDiscountArray){ + JSONObject jsonObject = JSON.parseObject(obj+""); + String startDateStr = jsonObject.getString("startDate"); + String endDateStr = jsonObject.getString("endDate"); + Double deductionRate = jsonObject.getDouble("discount"); + if(StringUtils.isNotEmpty(startDateStr) && StringUtils.isNotEmpty(endDateStr) && deductionRate != null){ + Long startDate = sdf.parse(startDateStr + " 00:00:00").getTime(); + Long endDate = sdf.parse(endDateStr +" 23:59:59").getTime(); + if(nowTime >=startDate && nowTime < endDate){ + logger.debug("deductionRate ---------->>>>>> "+deductionRate); + if(storeDeductionRateMap.containsKey(payMode.getStoreId())){ + Map map = storeDeductionRateMap.get(payMode.getStoreId()); + map.put(payMode.getNo(),deductionRate); + storeDeductionRateMap.put(payMode.getStoreId(),map); + }else{ + Map map = new HashMap<>(); + map.put(payMode.getNo(),deductionRate); + storeDeductionRateMap.put(payMode.getStoreId(),map); + } + } + } + } + } + } + } + + + Double discount = null; + Double memberDeductionRate = null; + if(storeDeductionRateMap.containsKey(programStore.getStoreId())){ + Map rateMap = storeDeductionRateMap.get(programStore.getStoreId()); + if(rateMap.containsKey("05")){ + discount = rateMap.get("05"); + } + if(rateMap.containsKey("02")){ + memberDeductionRate = rateMap.get("02"); + } + + } + data.put("deductionRate", discount);//门店扣率; + data.put("memberDeductionRate", memberDeductionRate);//门店会员卡扣率; + data.put("discomFlag", programStore.getDiscomFlag());//是否第三方配送; + data.put("distributionSelfLimits", programStore.getDistributionSelfLimits());//自配送范围(公里); + data.put("takeOutBoxFeeFlag", programStore.getDistributionSelfLimits());//外带模式是否收取餐盒费; + data.put("autoDeliveryFlag", programStore.getAutoDeliveryFlag());//是否自动呼叫配送; + + response.setStatus(1); + response.setMessage("获取成功"); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "program.store.stop", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店停业") + @Override + public Object ProgramStoreStop(ProgramStoreStopRequest request) { + String info = "小程序门店停业"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("enabled", 1)); + criteria.add(Restrictions.eq("deleteFlag", 0)); + List storeList = this.programStoreService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(storeList)) { + response.setStatus(0); + response.setMessage("门店信息不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ProgramStore programStore = storeList.get(0); + programStore.setIsOpen(0); + programStoreService.update(tenantId, programStore); + response.setStatus(1); + response.setMessage("停业成功"); + Map data = new HashMap<>(); + data.put("tenantId", programStore.getTenantId()); + data.put("storeId", programStore.getStoreId()); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "program.store.open", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店开业") + @Override + public Object ProgramStoreOpen(ProgramStoreOpenRequest request) { + String info = "小程序门店开业"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("enabled", 1)); + criteria.add(Restrictions.eq("deleteFlag", 0)); + List storeList = this.programStoreService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(storeList)) { + response.setStatus(0); + response.setMessage("门店信息不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ProgramStore programStore = storeList.get(0); + programStore.setIsOpen(1); + programStoreService.update(tenantId, programStore); + response.setStatus(1); + response.setMessage("开业成功"); + Map data = new HashMap<>(); + data.put("tenantId", programStore.getTenantId()); + data.put("storeId", programStore.getStoreId()); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "program.store.picture", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "巨为小程序门店图片") + @Override + public Object ProgramStorePicture(ProgramStoreDetailRequest request) { + String info = "巨为小程序门店图片"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("enabled", 1)); + criteria.add(Restrictions.eq("deleteFlag", 0)); + List storeList = this.programStoreService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(storeList)) { + response.setStatus(0); + response.setMessage("门店信息不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ProgramStore programStore = storeList.get(0); + List> maps = new ArrayList<>(); + if(StringUtils.isNotEmpty(programStore.getStorageFileName())){ + List pictureList = Arrays.asList(programStore.getStorageFileName().split(",")); + for(String url : pictureList){ + Map map = new HashMap<>(); + map.put("pictureUrl",url); + maps.add(map); + } + }else{ + if(StringUtils.isNotEmpty(programStore.getLinkUrl())){ + List pictureList = Arrays.asList(programStore.getLinkUrl().split(",")); + for(String url : pictureList){ + Map map = new HashMap<>(); + map.put("pictureUrl",url); + maps.add(map); + } + } + } + + response.setStatus(1); + response.setMessage("获取成功"); + Map data = new HashMap<>(); + data.put("tenantId", programStore.getTenantId()); + data.put("storeId", programStore.getStoreId()); + data.put("programStoreId", programStore.getId()); + data.put("programId", programStore.getProgramId()); + data.put("pictures",maps); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "program.store.memo.tags", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "巨为小程序门店备注自定义标签") + @Override + public Object ProgramStoreMemoTags(ProgramStoreDetailRequest request) { + String info = "巨为小程序门店备注自定义标签"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("enabled", 1)); + criteria.add(Restrictions.eq("deleteFlag", 0)); + List storeList = this.programStoreService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(storeList)) { + response.setStatus(0); + response.setMessage("门店信息不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ProgramStore programStore = storeList.get(0); + + response.setStatus(1); + response.setMessage("获取成功"); + Map data = new HashMap<>(); + data.put("tenantId", programStore.getTenantId()); + data.put("storeId", programStore.getStoreId()); + data.put("programStoreId", programStore.getId()); + data.put("programId", programStore.getProgramId()); + data.put("memoTags",programStore.getMemoTags()); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "program.store.auto.delivery.open", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "小程序门店开启自动呼叫配送") + @Override + public Object ProgramStoreAutoDeliveryOpen(ProgramStoreOpenRequest request) { + String info = "小程序门店开启自动呼叫配送"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("enabled", 1)); + criteria.add(Restrictions.eq("deleteFlag", 0)); + List storeList = this.programStoreService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(storeList)) { + response.setStatus(0); + response.setMessage("门店信息不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ProgramStore programStore = storeList.get(0); + programStore.setAutoDeliveryFlag(1); + programStoreService.update(tenantId, programStore); + response.setStatus(1); + response.setMessage("设置自动呼叫配送成功"); + Map data = new HashMap<>(); + data.put("tenantId", programStore.getTenantId()); + data.put("storeId", programStore.getStoreId()); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "program.store.auto.delivery.close", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "小程序门店关闭自动呼叫配送") + @Override + public Object ProgramStoreAutoDeliveryClose(ProgramStoreOpenRequest request) { + String info = "小程序门店关闭自动呼叫配送"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("enabled", 1)); + criteria.add(Restrictions.eq("deleteFlag", 0)); + List storeList = this.programStoreService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(storeList)) { + response.setStatus(0); + response.setMessage("门店信息不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + ProgramStore programStore = storeList.get(0); + programStore.setAutoDeliveryFlag(0); + programStoreService.update(tenantId, programStore); + response.setStatus(1); + response.setMessage("关闭自动呼叫配送成功"); + Map data = new HashMap<>(); + data.put("tenantId", programStore.getTenantId()); + data.put("storeId", programStore.getStoreId()); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "program.store.list.sync", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "小程序门店列表(第三方同步使用)") + @Override + public Object ProgramStoreListSync(ProgramStoreListSyncRequest request) { + String info = "小程序门店列表(第三方同步使用)"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String programId = request.getProgramId(); + Integer pageNumber = request.getPageNumber();// 页码 + Integer pageSize = request.getPageSize();// 每页数据 + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + if (StringUtils.isNotEmpty(programId)) { + criteria.add(Restrictions.eq("programId", programId)); + } + criteria.add(Restrictions.eq("enabled", 1)); + criteria.add(Restrictions.eq("deleteFlag", 0)); + pager = this.programStoreService.getPager(tenantId, criteria, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (ProgramStore programStore : source) { + Map map = new HashMap<>(); + map.put("tenantId", programStore.getTenantId()); + map.put("id", programStore.getId()); + map.put("storeId", programStore.getStoreId()); + map.put("storeNo", programStore.getStoreNo()); + map.put("storeName", programStore.getStoreName()); + map.put("orderTel", programStore.getOrderTel()); + map.put("address", programStore.getAddress()); + map.put("latitude", programStore.getLatitude()); + map.put("longitude", programStore.getLongitude()); + map.put("noticeInfo", programStore.getNoticeInfo()); + map.put("isOpen", programStore.getIsOpen()); + map.put("openTimeType", programStore.getOpenTimeType()); + map.put("openTime", programStore.getOpenTime()); + map.put("deliverType", programStore.getDeliverType()); + map.put("deliverFee", programStore.getDeliverFee()); + map.put("deliverFeeDiscountType", programStore.getDeliverFeeDiscountType()); + map.put("deliverFeeDiscountRule", programStore.getDeliverFeeDiscountRule()); + map.put("deliverKilometre", programStore.getDeliverKilometre()); + map.put("busModes", programStore.getBusModes()); + map.put("linkUrl", programStore.getLinkUrl()); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + public static int checkStoreOpenStatus(ProgramStore programStore) throws ParseException { + String format = "HH:mm:ss"; + SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); + // 第一步判断营业状态,营业状态未营业直接返回0 + if (programStore.getIsOpen() == 0) { + return 0; + } + // 如果是24小时营业类型,只要当前门店状态营业,就返回营业 + if (programStore.getOpenTimeType() == 1) { + return 1; + } + // 如果指定时间段营业,需要盘点营业时间段 + if (programStore.getOpenTimeType() == 2 && StringUtils.isNotEmpty(programStore.getOpenTime())) { + String times[] = programStore.getOpenTime().split(","); + for (String time : times) { + String start = time.split("-")[0]; + String end = time.split("-")[1]; + Date startTime = new SimpleDateFormat(format).parse(start); + Date endTime = new SimpleDateFormat(format).parse(end); + Date nowTime = new SimpleDateFormat(format).parse(sdf.format( new Date())); + System.out.println("开始时间=======>"+start); + System.out.println("结束时间=======>"+end); + System.out.println("当前时间=======>"+sdf.format( new Date())); + if (isEffectiveDate(nowTime, startTime, endTime)) { + return 1; + } + } + } + return 0; + } + + /** + * 判断当前时间是否在[startTime, endTime]区间,注意时间格式要一致 + * + * @param nowTime + * 当前时间 + * @param startTime + * 开始时间 + * @param endTime + * 结束时间 + * @return + * @author jqlin + */ + public static boolean isEffectiveDate(Date nowTime, Date startTime, Date endTime) { + if (nowTime.getTime() == startTime.getTime() || nowTime.getTime() == endTime.getTime()) { + return true; + } + + Calendar date = Calendar.getInstance(); + date.setTime(nowTime); + + Calendar begin = Calendar.getInstance(); + begin.setTime(startTime); + + Calendar end = Calendar.getInstance(); + end.setTime(endTime); + + if (date.after(begin) && date.before(end)) { + return true; + } else { + return false; + } + } + public static void main(String[] args) { + ProgramStore programStore = new ProgramStore(); + programStore.setIsOpen(1); + programStore.setOpenTimeType(2); + programStore.setOpenTime("10:00:00-12:00:00,14:12:56-20:12:56"); + try { + System.out.println("营业状态=======>"+checkStoreOpenStatus(programStore)); + } catch (ParseException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/impl/ProgramUserServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/impl/ProgramUserServiceImpl.java new file mode 100644 index 0000000..1924aab --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/impl/ProgramUserServiceImpl.java @@ -0,0 +1,311 @@ +package com.jwsaas.api.service.program.impl; + +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import com.alibaba.dubbo.common.utils.StringUtils; +import com.jwsaas.api.request.program.ProgramUserAddressCreateRequest; +import com.jwsaas.api.request.program.ProgramUserAddressDeleteRequest; +import com.jwsaas.api.request.program.ProgramUserAddressListRequest; +import com.jwsaas.api.request.program.ProgramUserAddressUpdateRequest; +import com.jwsaas.api.request.program.ProgramUserWeixinFormIdRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.response.mode.CommonPagerResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.program.ProgramUserService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.ProgramDeliverAddress; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.pager.Pager; +import com.jwsaas.utils.AppKeyUtil; + +@ServiceMethodBean(version = "1.0") +public class ProgramUserServiceImpl extends WopServiceImpl implements ProgramUserService { + + private static final long serialVersionUID = 5353407816151556015L; + + @Resource + private com.jwsaas.service.food.ProgramDeliverAddressService programDeliverAddressService; + + @Resource + private com.jwsaas.cache.CacheService cacheService; + + @ServiceMethod(method = "program.useraddress.create", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "用户门店地址新增") + @Override + public Object ProgramUserAddressCreate(ProgramUserAddressCreateRequest request) { + String info = "小程序地址新增"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String programId = request.getProgramId();// 小程序ID + String openId = request.getOpenId();// 会员openId + String memberId = request.getMemberId();// 会员ID + String mobile = request.getMobile();// 会员手机号 + String receiveName = request.getReceiveName();// 收货人姓名 + String receiveMobile = request.getReceiveMobile();// 收货人手机号 + String receiveAddress = request.getReceiveAddress();// 收货人地址 + String receiveDoor = request.getReceiveDoor();// 收货人门牌号 + String latitude = request.getLatitude();// 纬度 + String longitude = request.getLongitude();// 经度 + Integer defaultFlag = request.getDefaultFlag() == null ? 0 : request.getDefaultFlag();// 是否默认 + // 0否-1是 + Integer addressType = request.getAddressType() == null ? 0 : request.getAddressType();// 地址类型 + // 0公司-1家-2学校 + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + ProgramDeliverAddress programDeliverAddress = new ProgramDeliverAddress(); + programDeliverAddress.setAddressType(addressType); + programDeliverAddress.setCreateDate(new Date()); + programDeliverAddress.setCreateUser("open-api"); + programDeliverAddress.setDefaultFlag(defaultFlag); + if (StringUtils.isNotEmpty(latitude)) { + programDeliverAddress.setLatitude(Double.parseDouble(latitude)); + } + if (StringUtils.isNotEmpty(longitude)) { + programDeliverAddress.setLongitude(Double.parseDouble(longitude)); + } + programDeliverAddress.setMemberId(memberId); + programDeliverAddress.setMobile(mobile); + programDeliverAddress.setOpenId(openId); + programDeliverAddress.setProgramId(programId); + programDeliverAddress.setReceiveAddress(receiveAddress); + programDeliverAddress.setReceiveDoor(receiveDoor); + programDeliverAddress.setReceiveMobile(receiveMobile); + programDeliverAddress.setReceiveName(receiveName); + programDeliverAddress.setTenantId(tenantId); + programDeliverAddressService.saveProgramDeliverAddress(tenantId, programDeliverAddress); + Map data = new HashMap<>(); + data.put("openId", openId); + data.put("programId", programId); + response.setStatus(1); + response.setMessage("新增成功"); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "program.useraddress.update", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "用户门店地址修改") + @Override + public Object ProgramUserAddressUpdate(ProgramUserAddressUpdateRequest request) { + String info = "小程序地址信息变更"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String id = request.getId();// 记录ID + String programId = request.getProgramId();// 小程序ID + String openId = request.getOpenId();// 会员openId + String memberId = request.getMemberId();// 会员ID + String mobile = request.getMobile();// 会员手机号 + String receiveName = request.getReceiveName();// 收货人姓名 + String receiveMobile = request.getReceiveMobile();// 收货人手机号 + String receiveAddress = request.getReceiveAddress();// 收货人地址 + String receiveDoor = request.getReceiveDoor();// 收货人门牌号 + String latitude = request.getLatitude();// 纬度 + String longitude = request.getLongitude();// 经度 + Integer defaultFlag = request.getDefaultFlag() == null ? 0 : request.getDefaultFlag();// 是否默认 + // 0否-1是 + Integer addressType = request.getAddressType() == null ? 0 : request.getAddressType();// 地址类型 + // 0公司-1家-2学校 + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + ProgramDeliverAddress programDeliverAddress = programDeliverAddressService.get(tenantId, id); + if (programDeliverAddress == null) { + response.setStatus(0); + response.setMessage("地址信息不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + programDeliverAddress.setAddressType(addressType); + programDeliverAddress.setCreateDate(new Date()); + programDeliverAddress.setCreateUser("open-api"); + programDeliverAddress.setDefaultFlag(defaultFlag); + if (StringUtils.isNotEmpty(latitude)) { + programDeliverAddress.setLatitude(Double.parseDouble(latitude)); + } + if (StringUtils.isNotEmpty(longitude)) { + programDeliverAddress.setLongitude(Double.parseDouble(longitude)); + } + programDeliverAddress.setMemberId(memberId); + programDeliverAddress.setMobile(mobile); + programDeliverAddress.setOpenId(openId); + programDeliverAddress.setProgramId(programId); + programDeliverAddress.setReceiveAddress(receiveAddress); + programDeliverAddress.setReceiveDoor(receiveDoor); + programDeliverAddress.setReceiveMobile(receiveMobile); + programDeliverAddress.setReceiveName(receiveName); + programDeliverAddress.setTenantId(tenantId); + programDeliverAddressService.updateProgramDeliverAddress(tenantId, programDeliverAddress); + Map data = new HashMap<>(); + data.put("openId", openId); + data.put("programId", programId); + response.setStatus(1); + response.setMessage("修改成功"); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "program.useraddress.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "用户门店地址列表") + @Override + public Object ProgramUserAddressList(ProgramUserAddressListRequest request) { + String info = "用户地址列表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String programId = request.getProgramId();// 小程序ID + String openId = request.getOpenId();// 会员openId + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("openId", openId)); + criteria.add(Restrictions.eq("programId", programId)); + pager = programDeliverAddressService.getPager(tenantId, criteria, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (ProgramDeliverAddress programDeliverAddress : source) { + Map map = new HashMap<>(); + map.put("tenantId", programDeliverAddress.getTenantId()); + map.put("id", programDeliverAddress.getId()); + map.put("programId", programDeliverAddress.getProgramId()); + map.put("memberId", programDeliverAddress.getMemberId()); + map.put("openId", programDeliverAddress.getOpenId()); + map.put("mobile", programDeliverAddress.getMobile()); + map.put("receiveName", programDeliverAddress.getReceiveName()); + map.put("receiveMobile", programDeliverAddress.getReceiveMobile()); + map.put("receiveAddress", programDeliverAddress.getReceiveAddress()); + map.put("receiveDoor", programDeliverAddress.getReceiveDoor()); + map.put("latitude", programDeliverAddress.getLatitude()); + map.put("longitude", programDeliverAddress.getLongitude()); + map.put("defaultFlag", programDeliverAddress.getDefaultFlag()); + map.put("addressType", programDeliverAddress.getAddressType()); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "program.useraddress.delete", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "用户门店地址删除") + @Override + public Object ProgramUserAddressDelete(ProgramUserAddressDeleteRequest request) { + String info = "用户门店地址删除"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String id = request.getId();// 记录ID + String programId = request.getProgramId();// 小程序ID + String openId = request.getOpenId();// 会员openId + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + ProgramDeliverAddress programDeliverAddress = programDeliverAddressService.get(tenantId, id); + if (programDeliverAddress == null) { + response.setStatus(0); + response.setMessage("地址信息不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + programDeliverAddressService.delete(tenantId, id); + Map data = new HashMap<>(); + data.put("openId", openId); + data.put("programId", programId); + response.setStatus(1); + response.setMessage("删除成功"); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "program.userweixin.formid", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "小程序用户OpendId") + @Override + public Object ProgramUserWeixinFormId(ProgramUserWeixinFormIdRequest request) { + String info = "小程序用户OpendId"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String formId = request.getFormId();// formId + String openId = request.getOpenId();// 会员openId + String programId = request.getProgramId();// 小程序ID + String sendType = request.getSendType();// 订单类型 + String busNo = request.getBusNo();// 业务单号 + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + String keyFromId = "programFormId:" + tenantId + ":" + programId + ":" + sendType + ":" + openId + ":" + busNo; + cacheService.set(tenantId, keyFromId, formId, 60 * 30); + Map data = new HashMap<>(); + data.put("openId", openId); + data.put("programId", programId); + response.setStatus(1); + response.setMessage("上传成功"); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/impl/SplitStorePayServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/impl/SplitStorePayServiceImpl.java new file mode 100644 index 0000000..0fb80ab --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/program/impl/SplitStorePayServiceImpl.java @@ -0,0 +1,171 @@ +package com.jwsaas.api.service.program.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.jwsaas.TlData; +import com.jwsaas.TlReturnMsg; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.program.SplitStorePayService; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.SplitShopAccount; +import com.jwsaas.entity.food.SplitStorePay; +import com.jwsaas.entity.tl.member.SingalAgentPay; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.service.food.SplitShopAccountService; +import com.jwsaas.tonglian.TlHttpClient; +import com.jwsaas.util.KeyIdUtil; +import com.jwsaas.utils.PropertiesUtil; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @Author 37962 + * @Date 2023/12/21 + */ +@ServiceMethodBean(version = "1.0") +public class SplitStorePayServiceImpl extends WopServiceImpl implements SplitStorePayService { + + private static final long serialVersionUID = 8071209717229269556L; + + @Resource + private com.jwsaas.service.food.SplitStorePayService splitStorePayService; + @Resource + private SplitShopAccountService splitShopAccountService; + + @ServiceMethod(method = "divide.order", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "订单分帐") + @Override + public Object DivideOrder() { + Map result = null; + String info = "订单分帐"; + logger.info("divide.order" + info); + try { + Date newdate=new Date(); + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); + String datestr=sdf.format(newdate); + //查询所有未分帐记录 + Criteria criter = new Criteria(); + criter.add(Restrictions.ge("payDate", newdate+" 00:00:00")); + criter.add(Restrictions.le("payDate", newdate+" 23:59:59")); + criter.add(Restrictions.eq("isInvalid",0)); + criter.add(Restrictions.eq("payTypeNo","50")); + List payModeList = splitStorePayService.getSplitStorePayList(criter); + for (SplitStorePay splitStorePay : payModeList) { + String json = JSON.toJSONString(splitStorePay); + logger.debug("单笔托管代付:" + "(" + json + ")"); + if (splitStorePay != null) { + int isInvalid = splitStorePay.getIsInvalid();//是否生效 1是0否 + if (isInvalid == 1) { + logger.info("该订单已分帐,分帐失败" + splitStorePay.getId()); + } else { + //订单类型 堂食 = 0,外带 = 1,电话外卖 = 2,餐桌 = 3,美团外卖 = 4,饿了么 = 5,百度外卖 = 6,微信点餐 = 7 + String tenantId=splitStorePay.getTenantId(); + String orderType = splitStorePay.getOrderType(); + String storeId = splitStorePay.getStoreId(); + Double paid = splitStorePay.getPaid();//实收金额 + long fee = splitStorePay.getFee();//手续费 + int isRefund = splitStorePay.getIsRefund();//是否有退款 0否 1有 + Double refundAmount = splitStorePay.getRefundAmount();//退款金额 + String payTyepNo=splitStorePay.getPayTypeNo(); + String id=splitStorePay.getId(); + if("50".equals(payTyepNo)) {//通联支付 + BigDecimal bpaid = new BigDecimal(paid); + BigDecimal brefundAmount = new BigDecimal(refundAmount); + int flag = bpaid.compareTo(brefundAmount); + if (flag == 0) {//相等 + logger.info("分帐失败,退款金额和实收金额相等" + splitStorePay.getId()); + } else if (flag == 1) {//大于 + String splitStoreId = splitStorePay.getSplitStoreId();//分店ID + SplitShopAccount account = splitShopAccountService.get(tenantId, splitStoreId); + String backUrl = PropertiesUtil.getValue("config.properties", "tonglian.signalagentPayotify"); + String bizUserId=account.getBizUserId(); + BigDecimal pidb = bpaid.subtract(brefundAmount); + BigDecimal b100 = new BigDecimal(100); + BigDecimal bigDecimal = pidb.multiply(b100).setScale(0, RoundingMode.HALF_UP); + long moneyValue = bigDecimal.longValue(); + SingalAgentPay pay = new SingalAgentPay(); + //String bizOrderNo = "tl-" + System.currentTimeMillis(); + String bizOrderNo = "tl-" + KeyIdUtil.getUniqueKey(""); + if ("7".equals(orderType)) { + pay.setBizOrderNo(bizOrderNo); + final JSONArray tranlist = new JSONArray(); + final HashMap trandetail1 = new HashMap<>(); + trandetail1.put("bizOrderNo", splitStorePay.getBusNo()); + trandetail1.put("amount", moneyValue); + tranlist.add(trandetail1); + String stranlist = JSON.toJSONString(tranlist); + pay.setCollectPayList(stranlist); + pay.setBizUserId(bizUserId); + pay.setBackUrl(backUrl); + pay.setAmount(moneyValue); + pay.setFee(fee); + pay.setTradeCode("3001"); + logger.error("租户编号_门店ID_订单号" + tenantId + "_" + storeId + "_" + id); + pay.setRemark(tenantId + "_" + storeId + "_" + id); + } else if ("0".equals(orderType) || "1".equals(orderType) || "3".equals(orderType)) { + String fromBizUserId = splitStorePay.getFromBizUserId(); + pay.setBizOrderNo(bizOrderNo); + final JSONArray tranlist = new JSONArray(); + final HashMap trandetail1 = new HashMap<>(); + trandetail1.put("bizOrderNo", splitStorePay.getBusNo()); + trandetail1.put("amount", moneyValue); + tranlist.add(trandetail1); + String stranlist = JSON.toJSONString(tranlist); + pay.setCollectPayList(stranlist); + pay.setBizUserId(fromBizUserId); + pay.setBackUrl(backUrl); + pay.setAmount(moneyValue); + pay.setFee((long) 0); + if(bizUserId.equals(fromBizUserId)==false){ + final JSONArray splitRuleList = new JSONArray(); + final HashMap splitRuletail1 = new HashMap<>(); + splitRuletail1.put("bizUserId", bizUserId); + splitRuletail1.put("amount", moneyValue); + splitRuletail1.put("fee", fee); + splitRuletail1.put("remark", ""); + splitRuleList.add(splitRuletail1); + pay.setSplitRuleList(splitRuleList); + } + pay.setTradeCode("3001"); + logger.error("租户编号_门店ID_订单号" + tenantId + "_" + storeId + "_" + id); + pay.setRemark(tenantId + "_" + storeId + "_" + id); + } + String jsonpay = JSON.toJSONString(pay); + logger.error("单笔托管代付param:" + jsonpay); + String content = TlHttpClient.post("order.signalAgentPay", pay); + System.out.println("单笔托管代付content:" + content); + TlReturnMsg msg = JSON.parseObject(content, TlReturnMsg.class); + String subCode = msg.getSubCode(); + String subMsg = msg.getMsg(); + if ("OK".equals(subCode)) { + String tldata = msg.getData(); + TlData dataa = JSON.parseObject(tldata, TlData.class); + splitStorePay.setBizOrderNo(bizOrderNo); + splitStorePayService.update(tenantId, splitStorePay); + logger.info("操作成功"); + } else if ("FAIL".equals(subCode)) { + logger.info("分帐失败,"+ subMsg); + } + } else { + logger.info("分帐失败,退款金额大于实收金额"); + } + } + } + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return result; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/promotion/PromotionService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/promotion/PromotionService.java new file mode 100644 index 0000000..3c7a093 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/promotion/PromotionService.java @@ -0,0 +1,22 @@ +package com.jwsaas.api.service.promotion; + +import com.jwsaas.api.request.promotion.PromotionTypeListRequest; +import com.jwsaas.api.request.promotion.StorePromotionTaskRequest; +import com.jwsaas.api.service.WopService; + +/** + * 促销相关 + */ +public interface PromotionService extends WopService { + + /** + * 促销类型 + */ + Object promotionTypeList(PromotionTypeListRequest request); + + /** + * 门店促销任务列表 + */ + Object storePromotionTask(StorePromotionTaskRequest request); + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/split/SplitLogService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/split/SplitLogService.java new file mode 100644 index 0000000..8bcee2e --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/split/SplitLogService.java @@ -0,0 +1,21 @@ +package com.jwsaas.api.service.split; + +import com.jwsaas.api.request.split.SplitFoodAccountRequest; +import com.jwsaas.api.request.split.SplitShopAccountRequest; +import com.jwsaas.api.request.split.SplitStorePayRequet; +import com.jwsaas.api.request.upload.BusinessOrderUploadRequest; +import com.jwsaas.api.service.WopService; + +/** + * 前台业务上传相关接口 + */ +public interface SplitLogService extends WopService { + + /** + * 分帐错误日志上传接口 + * + * @param request + * @return + */ + Object splitStorepayLogUpload(BusinessOrderUploadRequest request); +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/split/SplitSaleService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/split/SplitSaleService.java new file mode 100644 index 0000000..fc5af59 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/split/SplitSaleService.java @@ -0,0 +1,57 @@ +package com.jwsaas.api.service.split; + +import com.jwsaas.api.request.split.SplitFoodAccountRequest; +import com.jwsaas.api.request.split.SplitShopAccountRequest; +import com.jwsaas.api.request.split.SplitStorePayRequet; +import com.jwsaas.api.request.upload.BusinessOrderUploadRequest; +import com.jwsaas.api.service.WopService; + +/** + * 前台业务上传相关接口 + */ +public interface SplitSaleService extends WopService { + + /** + * 公司列表接口 + * + * @param request + * @return + */ + Object businessSplitShops(SplitShopAccountRequest request); + + + /** + * 菜品列表接口 + * + * @param request + * @return + */ + Object businessSplitFoods(SplitFoodAccountRequest request); + + + /** + * 订单列表接口 + * + * @param request + * @return + */ + Object businessSplitOrders(SplitStorePayRequet request); + + + /** + * 交接班记录接口 + * + * @param request + * @return + */ + Object businessShiftHandover(SplitStorePayRequet request); + + + /** + * 定时分帐接口 + * + * @param request + * @return + */ + Object businessAutomaticProrateHandover(SplitStorePayRequet request); +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/split/SplitService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/split/SplitService.java new file mode 100644 index 0000000..d8c0c06 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/split/SplitService.java @@ -0,0 +1,65 @@ +package com.jwsaas.api.service.split; + +import com.jwsaas.api.request.product.ProductTypeRequest; +import com.jwsaas.api.request.split.SplitFoodAccountRequest; +import com.jwsaas.api.request.split.SplitShopAccountRequest; +import com.jwsaas.api.request.split.SplitStorePayRequet; +import com.jwsaas.api.request.upload.*; +import com.jwsaas.api.service.WopService; +import com.jwsaas.entity.food.SplitFoodAccount; + +/** + * 前台业务上传相关接口 + */ +public interface SplitService extends WopService { + + /** + * 分店订单上送接口 + * + * @param request + * @return + */ + Object businessSplitOrderUpload(BusinessOrderUploadRequest request); + + /** + * 分店订单修改接口 + * + * @param request + * @return + */ + Object businessSplitOrderUpdate(BusinessOrderUploadRequest request); + /** + * 分店订单上送接口(加强版) + * + * @param request + * @return + */ + Object businessSplitOrderUploadPlus(BusinessOrderUploadRequest request); + + + /** + * 菜品和账户关联数据 + * + * @param request + * @return + */ + Object splitFoodAccount(SplitFoodAccountRequest request); + + + /** + * 店铺分帐户数据 + * + * @param request + * @return + */ + Object splitShopAccount(SplitShopAccountRequest request); + + + /** + * 店铺分帐流水数据 + * + * @param request + * @return + */ + Object splitStorePay(SplitStorePayRequet request); +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/spwxdc/SpWxdcService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/spwxdc/SpWxdcService.java new file mode 100644 index 0000000..a0b972e --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/spwxdc/SpWxdcService.java @@ -0,0 +1,20 @@ +package com.jwsaas.api.service.spwxdc; + +import com.jwsaas.api.request.spwxdc.SpWxdcOrderCreateRequest; +import com.jwsaas.api.service.WopService; + +/** + * 微信点餐小程序 2018-11-10小程序走此接口 ZGT + * + * @author Administrator + * + */ +public interface SpWxdcService extends WopService { + + /*** + * 微信订单创建 + * + * @return + */ + Object orderCreate(SpWxdcOrderCreateRequest request); +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/spwxdc/impl/SpWxdcServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/spwxdc/impl/SpWxdcServiceImpl.java new file mode 100644 index 0000000..d0c443f --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/spwxdc/impl/SpWxdcServiceImpl.java @@ -0,0 +1,89 @@ +package com.jwsaas.api.service.spwxdc.impl; + +import javax.annotation.Resource; + +import org.apache.commons.lang3.StringUtils; + +import com.jwsaas.api.request.spwxdc.SpWxdcOrderCreateRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.spwxdc.SpWxdcService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.entity.food.Store; +import com.jwsaas.entity.food.WxStore; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.utils.AppKeyUtil; + +@ServiceMethodBean(version = "1.0") +public class SpWxdcServiceImpl extends WopServiceImpl implements SpWxdcService { + + private static final long serialVersionUID = 7177515847051499973L; + + @Resource + private com.jwsaas.service.food.StoreService storeService; + @Resource + private com.jwsaas.service.food.WxStoreService wxStoreService; + + /** + * 微信点餐-创建微信订单 + */ + @ServiceMethod(method = "spwxdc.order.create", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "微信点餐-创建微信订单") + @Override + public Object orderCreate(SpWxdcOrderCreateRequest request) { + String info = "微信点餐-创建微信订单"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + String wid = request.getWid(); + String userId = request.getUserId(); + String openId = request.getOpenId(); + String orderInfoJson = request.getOrderInfoJson(); + + CommonDataResponse response = null; + + try { + response = new CommonDataResponse(); + if (StringUtils.isBlank(wid)) { + response.setStatus(0); + response.setMessage("wid不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + WxStore wxStore = wxStoreService.get(tenantId, storeId); + if (wxStore == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + Store store = storeService.get(tenantId, wxStore.getStoreId()); + if (store == null) { + response.setStatus(0); + response.setMessage("erp门店不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/storage/StoreCostTicketService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/storage/StoreCostTicketService.java new file mode 100644 index 0000000..26b5186 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/storage/StoreCostTicketService.java @@ -0,0 +1,47 @@ +package com.jwsaas.api.service.storage; + +import com.jwsaas.api.request.storage.*; +import com.jwsaas.api.service.WopService; + +/** + * 会计经营报表 + * + * @author Administrator + * + */ +public interface StoreCostTicketService extends WopService { + + /** + * 经营会计报表 + */ + Object storeCostTicket(StoreCostTicketRequest request); + + /** + * 经营会计报表详情 + */ + Object storeCostTicketDetail(StoreCostTicketDetailRequest request); + + /** + * 经营会计报表新增 + */ + Object storeCostTicketSave(StoreCostTicketSaveRequest request); + + /** + * 经营会计报表新增 + */ + Object storeCostTicketUpdate(StoreCostTicketUpdateRequest request); + + /** + * 经营会计报表审核、作废 + */ + Object storeCostTicketUpdateStatus(StoreCostTicketUpdateStatusRequest request); + + + /** + * 经营会计报表门店支付方式汇总、大类汇总、门店营业信息; + * @param request + * @return + */ + Object StoreCostTicketSalesInfos(StoreCostTicketSalesInfoRequest request); + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/storage/StoreDispatchService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/storage/StoreDispatchService.java new file mode 100644 index 0000000..d5a057f --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/storage/StoreDispatchService.java @@ -0,0 +1,40 @@ +package com.jwsaas.api.service.storage; + +import com.jwsaas.api.request.storage.DispatchTicketReceiveRequest; +import com.jwsaas.api.request.storage.DispatchTicketDetailRequest; +import com.jwsaas.api.request.storage.DispatchTicketRequest; +import com.jwsaas.api.service.WopService; + +/** + * 门店配送模块 + * + * @author ZhangShuXiang + * + */ +public interface StoreDispatchService extends WopService { + + /** + * 配送单信息 + */ + Object dispatchTicket(DispatchTicketRequest request); + + /** + * 配送单明细 + */ + Object dispatchTicketDetail(DispatchTicketDetailRequest request); + + /** + * 配送单和对应验收单明细 + */ + Object dispatchAndReceiveDetail(DispatchTicketDetailRequest request); + + + /** + * 配送单验收
+ *

+ * 生成配送收货单,生成验收差异,执行商品入库, + *

+ */ + Object dispatchTicketReceive(DispatchTicketReceiveRequest request); + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/storage/StoreStockCheckService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/storage/StoreStockCheckService.java new file mode 100644 index 0000000..311deae --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/storage/StoreStockCheckService.java @@ -0,0 +1,77 @@ +package com.jwsaas.api.service.storage; + +import com.jwsaas.api.request.storage.StoreStockCheckProductValidRequest; +import com.jwsaas.api.request.storage.StoreStockCheckSummaryRequest; +import com.jwsaas.api.request.storage.StoreStockCheckTemplateDetailRequest; +import com.jwsaas.api.request.storage.StoreStockCheckTemplateListRequest; +import com.jwsaas.api.request.storage.StoreStockCheckTicketAddRequest; +import com.jwsaas.api.request.storage.StoreStockCheckTicketDetailDelRequest; +import com.jwsaas.api.request.storage.StoreStockCheckTicketDetailRequest; +import com.jwsaas.api.request.storage.StoreStockCheckTicketRequest; +import com.jwsaas.api.request.storage.StoreStockUnCheckTicketDetailRequest; +import com.jwsaas.api.request.storage.StoreStockUnCheckTicketDetailUpdateRequest; +import com.jwsaas.api.request.storage.StoreStockUnCheckTicketStatusUpdateRequest; +import com.jwsaas.api.service.WopService; + +/** + * 门店库存盘点相关业务 + */ +public interface StoreStockCheckService extends WopService { + + /** + * 门店库存盘点单新增 + */ + Object storeStockCheckTicketAdd(StoreStockCheckTicketAddRequest request); + + /** + * 获取未审核的盘点单明细信息列表 + */ + Object storeStockUnCheckTicketDetail(StoreStockUnCheckTicketDetailRequest request); + + /** + * 门店库存盘点明细删除 + */ + Object storeStockCheckTicketDetailDel(StoreStockCheckTicketDetailDelRequest request); + + /** + * 更新未审核的盘点单明细信息 + */ + Object storeStockUnCheckTicketDetailUpdate(StoreStockUnCheckTicketDetailUpdateRequest request); + + /** + * 更新未审核的盘点单状态 + */ + Object storeStockUnCheckTicketStatusUpdate(StoreStockUnCheckTicketStatusUpdateRequest request); + + /** + * 获取可盘点商品信息列表 + */ + Object storeStockCheckProductValid(StoreStockCheckProductValidRequest request); + + /** + * 获取门店库存盘点模板列表 + */ + Object storeStockCheckTemplateList(StoreStockCheckTemplateListRequest request); + + /** + * 获取门店库存盘点模板明细 + */ + Object storeStockCheckTemplateDetail(StoreStockCheckTemplateDetailRequest request); + + /** + * 门店库存盘点分析 + */ + Object storeStockCheckSummary(StoreStockCheckSummaryRequest request); + + + /** + * 历史盘点列表 + */ + Object storeStockCheckTicket(StoreStockCheckTicketRequest request); + + /** + * 历史盘点明细 + */ + Object storeStockCheckTicketDetail(StoreStockCheckTicketDetailRequest request); + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/storage/StoreStorageService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/storage/StoreStorageService.java new file mode 100644 index 0000000..19c1dd1 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/storage/StoreStorageService.java @@ -0,0 +1,198 @@ +package com.jwsaas.api.service.storage; + +import com.jwsaas.api.request.storage.AskGoodsDetailRemoveRequest; +import com.jwsaas.api.request.storage.AskGoodsDetailRequest; +import com.jwsaas.api.request.storage.AskGoodsTemplateAddRequest; +import com.jwsaas.api.request.storage.AskGoodsTemplateDetailRequest; +import com.jwsaas.api.request.storage.AskGoodsTemplateEditRequest; +import com.jwsaas.api.request.storage.AskGoodsTemplateListRequest; +import com.jwsaas.api.request.storage.AskGoodsTicketAddRequest; +import com.jwsaas.api.request.storage.AskGoodsTicketEditRequest; +import com.jwsaas.api.request.storage.AskGoodsTicketRequest; +import com.jwsaas.api.request.storage.AskGoodsTicketStatusRequest; +import com.jwsaas.api.request.storage.ProductDispatchPriceRequest; +import com.jwsaas.api.request.storage.StoreProductStockOutSummaryRequest; +import com.jwsaas.api.request.storage.StoreProductStockRequest; +import com.jwsaas.api.request.storage.StoreProductStockSumRequest; +import com.jwsaas.api.request.storage.StoreStorageRequest; +import com.jwsaas.api.service.WopService; + +/** + * 门店库存模块 + * + * @author PC1 + * + */ +public interface StoreStorageService extends WopService { + + /** + * 门店仓库 + * + * @param request + * @return + */ + Object storeStorage(StoreStorageRequest request); + + /** + * 门店要货单信息 + * + * @param request + * @return + */ + Object askGoodsTicket(AskGoodsTicketRequest request); + + /** + * 门店要货单信息 + * + * @param request + * @return + */ + Object waitSendAskgoods(AskGoodsTicketRequest request); + + /** + * 门店要货单明细 + * + * @param request + * @return + */ + Object askGoodsDetail(AskGoodsDetailRequest request); + + /** + * 配送验收差异单信息 + * + * @param request + * @return + */ + Object differenceTicket(AskGoodsTicketRequest request); + + /** + * 配送验收差异详情 + * + * @param request + * @return + */ + Object differenceDetail(AskGoodsDetailRequest request); + + + /** + * 门店原料批发价格 + * + * @param request + * @return + */ + Object productDispatchPrice(ProductDispatchPriceRequest request); + + /** + * 门店要货单新增 + * + * @param request + * @return + */ + Object askGoodsTicketAdd(AskGoodsTicketAddRequest request); + + /** + * 门店要货单新增(优化版 减少保存时间) + * + * @param request + * @return + */ + Object askGoodsTicketAdd2(AskGoodsTicketAddRequest request); + + /** + * 门店要货单修改 + * + * @param request + * @return + */ + Object askGoodsTicketEdit(AskGoodsTicketEditRequest request); + + /** + * 门店要货单修改(优化版 减少保存时间) + * + * @param request + * @return + */ + Object askGoodsTicketEdit2(AskGoodsTicketEditRequest request); + + + /** + * 门店要货单作废、审核、驳回、反审核 + * + * @param request + * @return + */ + Object askGoodsTicketStatus(AskGoodsTicketStatusRequest request); + + /** + * 门店要货单作废、审核、驳回、反审核 + * askGoodsTicketStatus 强化版 在校验到商品配送价存在差异或者要货商品下架等情况 不在立即返回结果 而是校验完所有要货商品之后统一返回异常商品信息 + * + * @param request + * @return + */ + Object askGoodsTicketStatus2(AskGoodsTicketStatusRequest request); + + /** + * 门店商品库存 + * + * @param request + * @return + */ + Object storeProductStock(StoreProductStockRequest request); + + + /** + * 门店商品库存不包含已下架商品 + * + * @param request + * @return + */ + Object storeProductStockWithOutOffShelf(StoreProductStockRequest request); + + + /** + * 门店要货模板 + */ + Object askGoodsTemplateList(AskGoodsTemplateListRequest request); + + /** + * 门店要货模板明细 + */ + Object askGoodsTemplateDetail(AskGoodsTemplateDetailRequest request); + + /** + * 门店商品库存总数 + */ + Object storeProductStockSum(StoreProductStockSumRequest request); + + /** + * 门店商品库存消耗(出库)汇总
+ * 门店原物料消耗汇总 + */ + Object storeProductStockOutSummary(StoreProductStockOutSummaryRequest request); + + + /** + * 删除单据详情指定数据 + * @param request + * @return + */ + Object askGoodsTicketDetailRemove(AskGoodsDetailRemoveRequest request); + + + /** + * 门店要货模板新增 + * + * @param request + * @return + */ + Object askGoodsTemplateAdd(AskGoodsTemplateAddRequest request); + + /** + * 门店要货模板修改 + * + * @param request + * @return + */ + Object askGoodsTemplateEdit(AskGoodsTemplateEditRequest request); +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/storage/StoreStorageTicketService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/storage/StoreStorageTicketService.java new file mode 100644 index 0000000..c0e09fd --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/storage/StoreStorageTicketService.java @@ -0,0 +1,76 @@ +package com.jwsaas.api.service.storage; + +import com.jwsaas.api.request.storage.StoreStorageOutTicketAddRequest; +import com.jwsaas.api.request.storage.StoreStorageOutTicketDetailRequest; +import com.jwsaas.api.request.storage.StoreStorageOutTicketEditRequest; +import com.jwsaas.api.request.storage.StoreStorageOutTicketListRequest; +import com.jwsaas.api.request.storage.StoreStorageOutTicketStatusChangeRequest; +import com.jwsaas.api.request.storage.StoreStorageTicketAddRequest; +import com.jwsaas.api.request.storage.StoreStorageTicketDetailRequest; +import com.jwsaas.api.request.storage.StoreStorageTicketEditRequest; +import com.jwsaas.api.request.storage.StoreStorageTicketListRequest; +import com.jwsaas.api.request.storage.StoreStorageTicketStatusChangeRequest; +import com.jwsaas.api.request.storage.StoreStorageTicketTypeRequest; +import com.jwsaas.api.service.WopService; + +/** + * 门店入库/出库相关业务 + */ +public interface StoreStorageTicketService extends WopService { + + /** + * 门店入库/出库类型 + */ + Object storeStorageTicketType(StoreStorageTicketTypeRequest request); + + /** + * 门店入库单新增 + */ + Object storeStorageTicketAdd(StoreStorageTicketAddRequest request); + + /** + * 门店入库单修改 + */ + Object storeStorageTicketEdit(StoreStorageTicketEditRequest request); + + /** + * 门店入库单状态调整 + */ + Object storeStorageTicketStatusChange(StoreStorageTicketStatusChangeRequest request); + + /** + * 门店入库单列表 + */ + Object storeStorageTicketList(StoreStorageTicketListRequest request); + + /** + * 门店入库单明细 + */ + Object storeStorageTicketDetail(StoreStorageTicketDetailRequest request); + + /** + * 门店出库单新增 + */ + Object storeStorageOutTicketAdd(StoreStorageOutTicketAddRequest request); + + /** + * 门店出库单修改 + */ + Object storeStorageOutTicketEdit(StoreStorageOutTicketEditRequest request); + + /** + * 门店出库单状态调整 + */ + Object storeStorageOutTicketStatusChange(StoreStorageOutTicketStatusChangeRequest request); + + /** + * 门店出库单列表 + */ + Object storeStorageOutTicketList(StoreStorageOutTicketListRequest request); + + /** + * 门店出库单明细 + */ + Object storeStorageOutTicketDetail(StoreStorageOutTicketDetailRequest request); + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/store/CouponService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/store/CouponService.java new file mode 100644 index 0000000..9b31675 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/store/CouponService.java @@ -0,0 +1,28 @@ +package com.jwsaas.api.service.store; + +import com.jwsaas.api.request.store.StoreCouponCheckOutRequest; +import com.jwsaas.api.request.store.StoreCouponCheckRequest; +import com.jwsaas.api.request.store.StoreCouponListRequest; +import com.jwsaas.api.service.WopService; + +/** + * 优惠券相关接口 + */ +public interface CouponService extends WopService { + + /** + * 门店优惠券列表 + */ + Object storeCouponList(StoreCouponListRequest request); + + /** + * 门店优惠券核销前校验 + */ + Object storeCouponCheckOut(StoreCouponCheckOutRequest request); + + /** + * 门店优惠券核销 + */ + Object storeCouponCheck(StoreCouponCheckRequest request); + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/store/ProgramBusinessTicketService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/store/ProgramBusinessTicketService.java new file mode 100644 index 0000000..6c7f98f --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/store/ProgramBusinessTicketService.java @@ -0,0 +1,20 @@ +package com.jwsaas.api.service.store; + +import com.jwsaas.api.request.upload.BusinessOrderUploadRequest; +import com.jwsaas.api.service.WopService; +import com.jwsaas.entity.food.ProgramStoreBusinessTicket; + +/** + * 销售记录接口 + * @Author 37962 + * @Date 2023/11/23 + */ +public interface ProgramBusinessTicketService extends WopService { + + /** + * 根据支付时间段查询 + * @param request + * @return + */ + Object ProgramStoreBusinessTickets(BusinessOrderUploadRequest request); +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/store/StoreAccountService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/store/StoreAccountService.java new file mode 100644 index 0000000..3dabe51 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/store/StoreAccountService.java @@ -0,0 +1,88 @@ +package com.jwsaas.api.service.store; + +import com.jwsaas.api.request.store.StoreAccountDetailInfoRequest; +import com.jwsaas.api.request.store.StoreAccountDetailInfoRequest2; +import com.jwsaas.api.request.store.StoreAccountDetailListRequest; +import com.jwsaas.api.request.store.StoreAccountEnchashmentApplyRequest; +import com.jwsaas.api.request.store.StoreAccountEnchashmentCancelRequest; +import com.jwsaas.api.request.store.StoreAccountEnchashmentInfoRequest; +import com.jwsaas.api.request.store.StoreAccountEnchashmentListRequest; +import com.jwsaas.api.request.store.StoreAccountGetRequest; +import com.jwsaas.api.request.store.StoreAccountRechargeParameterRequest; +import com.jwsaas.api.request.store.StoreAccountRechargeRequest; +import com.jwsaas.api.request.store.StoreAccountRechargeWeixinPayOrderQueryRequest; +import com.jwsaas.api.request.store.StoreAccountRechargeWeixinPayOrderQueryRequest2; +import com.jwsaas.api.request.store.StoreAccountRechargeWeixinPayUnifiedorderRequest; +import com.jwsaas.api.service.WopService; + +/** + * 门店余额账户相关接口 + */ +public interface StoreAccountService extends WopService { + + /** + * 获取门店余额账户 + */ + Object getStoreAccount(StoreAccountGetRequest request); + + /** + * 获取门店余额账户明细列表 + */ + Object getStoreAccountDetailList(StoreAccountDetailListRequest request); + + /** + * 查询门店余额账户明细信息 + */ + Object getStoreAccountDetailInfo(StoreAccountDetailInfoRequest request); + + /** + * 查询门店余额账户明细信息2 + */ + Object getStoreAccountDetailInfo2(StoreAccountDetailInfoRequest2 request); + + /** + * 门店余额账户充值 + */ + Object rechargeStoreAccount(StoreAccountRechargeRequest request); + + /** + * 门店余额提现申请 + */ + Object applyStoreAccountEnchashment(StoreAccountEnchashmentApplyRequest request); + + /** + * 取消门店余额提现申请 + */ + Object cancelStoreAccountEnchashment(StoreAccountEnchashmentCancelRequest request); + + /** + * 获取门店余额账户提现列表 + */ + Object getStoreAccountEnchashmentList(StoreAccountEnchashmentListRequest request); + + /** + * 查询门店余额账户提现信息详情 + */ + Object getStoreAccountEnchashmentInfo(StoreAccountEnchashmentInfoRequest request); + + /** + * 获取门店账户充值参数 + */ + Object getStoreAccountRechargeParameter(StoreAccountRechargeParameterRequest request); + + /** + * 门店余额账户充值,微信统一下单 + */ + Object storeAccountRechargeWeixinPayUnifiedorder(StoreAccountRechargeWeixinPayUnifiedorderRequest request); + + /** + * 门店余额账户充值,微信查询订单 + */ + Object storeAccountRechargeWeixinPayOrderQuery(StoreAccountRechargeWeixinPayOrderQueryRequest request); + + /** + * 门店余额账户充值,微信查询订单 + */ + Object storeAccountRechargeWeixinPayOrderQuery2(StoreAccountRechargeWeixinPayOrderQueryRequest2 request); + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/store/StoreAdjustPriceService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/store/StoreAdjustPriceService.java new file mode 100644 index 0000000..483b107 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/store/StoreAdjustPriceService.java @@ -0,0 +1,57 @@ +package com.jwsaas.api.service.store; + +import com.jwsaas.api.request.store.AdjustPriceDetailRequest; +import com.jwsaas.api.request.store.AdjustPriceTicketAddRequest; +import com.jwsaas.api.request.store.AdjustPriceTicketAuditRequest; +import com.jwsaas.api.request.store.AdjustPriceTicketEditRequest; +import com.jwsaas.api.request.store.AdjustPriceTicketRequest; +import com.jwsaas.api.service.WopService; + +/** + * 门店调价 + * + * @author PC1 + * + */ +public interface StoreAdjustPriceService extends WopService { + /** + * 门店调价单 + * + * @param request + * @return + */ + Object adjustPriceTicket(AdjustPriceTicketRequest request); + + /** + * 门店调价单详情 + * + * @param request + * @return + */ + Object adjustPriceDetail(AdjustPriceDetailRequest request); + + /** + * 新增门店调价单 + * + * @param request + * @return + */ + Object adjustPriceTicketAdd(AdjustPriceTicketAddRequest request); + + /** + * 编辑门店调价单 + * + * @param request + * @return + */ + Object adjustPriceTicketEdit(AdjustPriceTicketEditRequest request); + + /** + * 审核门店调价单 + * + * @param request + * @return + */ + Object adjustPriceTicketAudit(AdjustPriceTicketAuditRequest request); + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/store/StoreDispatchSettleService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/store/StoreDispatchSettleService.java new file mode 100644 index 0000000..25ebc8d --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/store/StoreDispatchSettleService.java @@ -0,0 +1,16 @@ +package com.jwsaas.api.service.store; + +import com.jwsaas.api.request.store.StoreDispatchSettlePlanGetRequest; +import com.jwsaas.api.service.WopService; + +/** + * 门店配送结算相关接口 + */ +public interface StoreDispatchSettleService extends WopService { + + /** + * 获取门店配送结算方案 + */ + Object getStoreDispatchSettlePlan(StoreDispatchSettlePlanGetRequest request); + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/store/StoreInfoService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/store/StoreInfoService.java new file mode 100644 index 0000000..e7f6313 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/store/StoreInfoService.java @@ -0,0 +1,29 @@ +package com.jwsaas.api.service.store; + +import com.jwsaas.api.request.store.StoreInfoRequest; +import com.jwsaas.api.request.store.StoreRequest; +import com.jwsaas.api.service.WopService; +import com.jwsaas.entity.food.Store; + +/** + * 门店信息相关接口 + * @date + * @author louxutao + */ +public interface StoreInfoService extends WopService { + + + /*** + * 修改门店信息 + * @return + */ + Object updateStoreInfo(StoreInfoRequest request); + + /*** + * 删除百度门店 + * @return + */ + Object deleteBaiduStore(StoreRequest request); + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/store/StoreRechargeService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/store/StoreRechargeService.java new file mode 100644 index 0000000..01f0dce --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/store/StoreRechargeService.java @@ -0,0 +1,16 @@ +package com.jwsaas.api.service.store; + +import com.jwsaas.api.request.store.StoreRechargeParameterListRequest; +import com.jwsaas.api.service.WopService; + +/** + * 门店充值相关接口 + */ +public interface StoreRechargeService extends WopService { + + /** + * 获取门店充值参数方案列表 + */ + Object storeRechargeParameterList(StoreRechargeParameterListRequest request); + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/store/StoreSalesOrderService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/store/StoreSalesOrderService.java new file mode 100644 index 0000000..1f6ea95 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/store/StoreSalesOrderService.java @@ -0,0 +1,47 @@ +package com.jwsaas.api.service.store; + +import com.jwsaas.api.request.store.SalesOrderSummaryRequest; +import com.jwsaas.api.request.store.StoreSalesDayProductSummaryRequest; +import com.jwsaas.api.request.store.StoreSalesDaySummaryRequest; +import com.jwsaas.api.request.store.StoreSalesOrderListRequest; +import com.jwsaas.api.service.WopService; + +/** + * 门店销售相关接口 + */ +public interface StoreSalesOrderService extends WopService { + + /** + * 门店销售订单列表 + */ + Object salesOrderList(StoreSalesOrderListRequest request); + + /** + * 门店销售订单列表 + */ + Object salesOrderDetailList(StoreSalesOrderListRequest request); + + /** + * 门店销售订单列表 + */ + Object salesOrderCreateList(StoreSalesOrderListRequest request); + + + /** + * 门店单品销售汇总 + */ + Object salesOrderSummary(SalesOrderSummaryRequest request); + + /** + * 门店日营业额汇总 + */ + Object salesDaySummary(StoreSalesDaySummaryRequest request); + + /** + * 门店营业日菜品明细销售统计 + * @return + */ + Object storeSalesDayProductSummary(StoreSalesDayProductSummaryRequest request); + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/store/StoreService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/store/StoreService.java new file mode 100644 index 0000000..5695232 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/store/StoreService.java @@ -0,0 +1,158 @@ +package com.jwsaas.api.service.store; + +import com.jwsaas.api.request.store.BrandRequest; +import com.jwsaas.api.request.store.StoreAdvertCaptionRequest; +import com.jwsaas.api.request.store.StoreAdvertPictureRequest; +import com.jwsaas.api.request.store.StoreBusinessPlanDetailRequest; +import com.jwsaas.api.request.store.StoreBusinessPlanRequest; +import com.jwsaas.api.request.store.StoreFeeItemListRequest; +import com.jwsaas.api.request.store.StoreListRequest; +import com.jwsaas.api.request.store.StoreMessageRequest; +import com.jwsaas.api.request.store.StorePayModeRequest; +import com.jwsaas.api.request.store.StorePayTypeRequest; +import com.jwsaas.api.request.store.StorePosListRequest; +import com.jwsaas.api.request.store.StorePrintImageRequest; +import com.jwsaas.api.request.store.StoreProductCouponListRequest; +import com.jwsaas.api.request.store.StoretableAreaRequest; +import com.jwsaas.api.request.store.StoretableRequest; +import com.jwsaas.api.request.store.StoretableTypeRequest; +import com.jwsaas.api.service.WopService; + +/** + * 基础服务相关接口 + */ +public interface StoreService extends WopService { + + /** + * 门店资料信息 + * + * @param request + * @return + */ + Object storeMessage(StoreMessageRequest request); + + /** + * 门店付款类型 + * + * @param request + * @return + */ + Object storePayType(StorePayTypeRequest request); + + /** + * 门店收银方式 + * + * @param request + * @return + */ + Object storePayMode(StorePayModeRequest request); + + /** + * 门店收银方式(含有各支付方式的时间-扣率) + * + * @param request + * @return + */ + Object storePayModeWithPeriodDiscount(StorePayModeRequest request); + + /** + * 门店营业方案 + * + * @param request + * @return + */ + Object storeBusinessPlan(StoreBusinessPlanRequest request); + + /** + * 门店营业班次 + * + * @param request + * @return + */ + Object storeBusinessPlanDetail(StoreBusinessPlanDetailRequest request); + + /** + * 门店餐桌区域 + * + * @param request + * @return + */ + Object storetableArea(StoretableAreaRequest request); + + /** + * 门店餐桌类型 + * + * @param request + * @return + */ + Object storetableType(StoretableTypeRequest request); + + /** + * 门店餐桌 + * + * @param request + * @return + */ + Object storeTable(StoretableRequest request); + + /** + * 门店加盟品牌 + * + * @param request + * @return + */ + Object storeBrand(BrandRequest request); + + /** + * 门店双屏广告 + * + * @param request + * @return + */ + Object storeAdvertPicture(StoreAdvertPictureRequest request); + + /** + * 门店双屏字幕 + * + * @param request + * @return + */ + Object storeAdvertCaption(StoreAdvertCaptionRequest request); + + /** + * 门店小票图片 + * + * @param request + * @return + */ + Object storePrintImage(StorePrintImageRequest request); + + /** + * 门店POS列表 + */ + Object storePosList(StorePosListRequest request); + + /** + * 门店费用项目列表 + */ + Object storeFeeItemList(StoreFeeItemListRequest request); + + /** + * 门店商品优惠券 + */ + Object storeProductCouponList(StoreProductCouponListRequest request); + + /** + * 门店云参数设置 + */ + Object storeSet(StorePayTypeRequest request); + + /** + * 门店列表 + * + * @param request + * @return + */ + Object storeList(StoreListRequest request); + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/store/StoreShelfService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/store/StoreShelfService.java new file mode 100644 index 0000000..7038993 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/store/StoreShelfService.java @@ -0,0 +1,37 @@ +package com.jwsaas.api.service.store; + +import com.jwsaas.api.request.store.StoreGoodsRequest; +import com.jwsaas.api.request.store.StoreShelfRequest; +import com.jwsaas.api.service.WopService; + +/** + * 门店商品上下架 + */ +public interface StoreShelfService extends WopService { + + /** + * 门店自建商品信息列表 + */ + Object storeShelfedGoods(StoreGoodsRequest request); + + /** + * 门店已上架商品信息 + */ + Object storeOnShelfedGoods(StoreGoodsRequest request); + + /** + * 门店未上架商品信息 + */ + Object storeUnShelfGoods(StoreGoodsRequest request); + + /** + * 门店商品上架 + */ + Object storeGoodsOnShelf(StoreShelfRequest request); + + /** + * 门店商品下架 + */ + Object storeGoodsOffShelf(StoreShelfRequest request); + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/upload/UploadExtendService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/upload/UploadExtendService.java new file mode 100644 index 0000000..9272556 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/upload/UploadExtendService.java @@ -0,0 +1,16 @@ +package com.jwsaas.api.service.upload; + +import com.jwsaas.api.request.upload.BusinessOrderUploadExtendRequest; +import com.jwsaas.api.service.WopService; + +/** + * 前台业务上传相关接口(扩展) + */ +public interface UploadExtendService extends WopService { + + /** + * 前台销售订单上送接口 + */ + Object businessOrderUploadExtend(BusinessOrderUploadExtendRequest request); + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/upload/UploadService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/upload/UploadService.java new file mode 100644 index 0000000..47d6745 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/upload/UploadService.java @@ -0,0 +1,63 @@ +package com.jwsaas.api.service.upload; + +import com.jwsaas.api.request.upload.BusinessHandoverUploadRequest; +import com.jwsaas.api.request.upload.BusinessLogUploadRequest; +import com.jwsaas.api.request.upload.BusinessOrderBurdenUploadRequest; +import com.jwsaas.api.request.upload.BusinessOrderUploadRequest; +import com.jwsaas.api.request.upload.BusinessRevenueUploadRequest; +import com.jwsaas.api.service.WopService; + +/** + * 前台业务上传相关接口 + */ +public interface UploadService extends WopService { + + /** + * 订单上送接口 + * + * @param request + * @return + */ + Object businessOrderUpload(BusinessOrderUploadRequest request); + + /** + * 非营业收入支出登记接口 + * + * @param request + * @return + */ + Object businessRevenueUpload(BusinessRevenueUploadRequest request); + + /** + * 交班数据上传接口 + * + * @param request + * @return + */ + Object businessHandoverUpload(BusinessHandoverUploadRequest request); + + /** + * 订单上送接口(加强版) + * + * @param request + * @return + */ + Object businessOrderUploadPlus(BusinessOrderUploadRequest request); + + /** + * 商品耗料配方上传 + * + * @param request + * @return + */ + Object businessOrderBurdenUpload(BusinessOrderBurdenUploadRequest request); + + /** + * POS操作日志上传 + * + * @param request + * @return + */ + Object businessLogUpload(BusinessLogUploadRequest request); + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/visitor/VisitorService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/visitor/VisitorService.java new file mode 100644 index 0000000..c87058a --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/visitor/VisitorService.java @@ -0,0 +1,49 @@ +package com.jwsaas.api.service.visitor; + +import com.jwsaas.api.request.visitor.VisitorAddRequest; +import com.jwsaas.api.request.visitor.VisitorAddressListRequest; +import com.jwsaas.api.request.visitor.VisitorInfoRequest; +import com.jwsaas.api.request.visitor.VisitorListRequest; +import com.jwsaas.api.request.visitor.VisitorTagListRequest; +import com.jwsaas.api.request.visitor.VisitorUpdateRequest; +import com.jwsaas.api.service.WopService; + +public interface VisitorService extends WopService { + + /** + * 熟客信息 + */ + Object visitorList(VisitorListRequest request); + + /** + * 熟客常用地址 + */ + Object visitorAddressList(VisitorAddressListRequest request); + + /** + * 熟客标签 + */ + Object visitorTagList(VisitorTagListRequest request); + + /** + * 新增熟客信息 + */ + Object visitorAdd(VisitorAddRequest request); + + /** + * 修改熟客信息 + */ + Object visitorUpdate(VisitorUpdateRequest request); + + /** + * 查询熟客信息 + */ + Object visitorInfo(VisitorInfoRequest request); + + + /** + * 修改熟客信息 + */ + Object visitorDelete(VisitorInfoRequest request); + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/visitor/impl/VisitorServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/visitor/impl/VisitorServiceImpl.java new file mode 100644 index 0000000..4a67395 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/visitor/impl/VisitorServiceImpl.java @@ -0,0 +1,839 @@ +package com.jwsaas.api.service.visitor.impl; + +import java.util.*; + +import javax.annotation.Resource; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; + +import com.jwsaas.Constant; +import com.jwsaas.api.entity.visitor.VisitorAddressEntity; +import com.jwsaas.api.entity.visitor.VisitorEntity; +import com.jwsaas.api.entity.visitor.VisitorTagEntity; +import com.jwsaas.api.request.visitor.VisitorAddRequest; +import com.jwsaas.api.request.visitor.VisitorAddressListRequest; +import com.jwsaas.api.request.visitor.VisitorInfoRequest; +import com.jwsaas.api.request.visitor.VisitorListRequest; +import com.jwsaas.api.request.visitor.VisitorTagListRequest; +import com.jwsaas.api.request.visitor.VisitorUpdateRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.response.mode.CommonPagerResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.visitor.VisitorService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.Visitor; +import com.jwsaas.entity.food.VisitorAddress; +import com.jwsaas.entity.food.VisitorTag; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.pager.Pager; +import com.jwsaas.util.DateUtils; +import com.jwsaas.util.JSONUtil; +import com.jwsaas.util.Pinyin4jUtil; +import com.jwsaas.utils.AppKeyUtil; + +@ServiceMethodBean(version = "1.0") +public class VisitorServiceImpl extends WopServiceImpl implements VisitorService { + + private static final long serialVersionUID = 1298475124419315810L; + + @Resource + private com.jwsaas.service.food.StoreService storeService; + @Resource + private com.jwsaas.service.food.VisitorService visitorService; + @Resource + private com.jwsaas.service.food.VisitorAddressService visitorAddressService; + @Resource + private com.jwsaas.service.food.VisitorTagService visitorTagService; + + @SuppressWarnings("unchecked") + @ServiceMethod(method = "visitor.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "熟客信息(分页)") + @Override + public Object visitorList(VisitorListRequest request) { + String info = "熟客信息(分页)"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + String createDate = request.getCreateDate(); + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + // Store store = storeService.get(tenantId, storeId); + // if (store == null) { + // response.setStatus(0); + // response.setMessage("门店ID不存在"); + // response.setErrCode(CommonErrorCode.error3.getCode()); + // response.setErrMessage(CommonErrorCode.error3.getMessage()); + // return response; + // } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("deleteFlag", 0)); + if (StringUtils.isNotEmpty(createDate)) { + criteria.add(Restrictions.gt("createDate", createDate)); + } + criteria.add(Restrictions.order("id", "asc")); + pager = visitorService.getPager(tenantId, criteria, pager); + + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List dataList = (List) pager.getList(); + for (Visitor data : dataList) { + Map map = new HashMap<>(); + map.put("id", data.getId()); + map.put("tenantId", data.getTenantId()); + map.put("storeId", data.getStoreId()); + map.put("no", data.getNo()); + map.put("tel", replaceStr(data.getTel())); + map.put("name", replaceStr(data.getName())); + map.put("spell", replaceStr(data.getSpell())); + map.put("sex", data.getSex()); + map.put("title", replaceStr(data.getTitle()));// 称谓 + map.put("position", replaceStr(data.getPosition()));// 职位 + map.put("fphone", replaceStr(data.getFphone()));// 联系方式一 + map.put("sphone", replaceStr(data.getSphone()));// 联系方式二 + map.put("description", replaceStr(data.getDescription()));// 备注说明 + map.put("createDate", DateUtils.format(data.getCreateDate(), DateUtils.SHOW_DATETIME_FORMAT)); + map.put("createUser", data.getCreateUser()); + map.put("modifyDate", data.getModifyDate() == null ? null : DateUtils.format(data.getModifyDate(), DateUtils.SHOW_DATETIME_FORMAT)); + map.put("modifyUser", data.getModifyUser()); + + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "LIST_ERROR", request.getWopRequestContext().getLocale()); + } + + return response; + } + + @SuppressWarnings("unchecked") + @ServiceMethod(method = "visitor.address.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "熟客常用地址(分页)") + @Override + public Object visitorAddressList(VisitorAddressListRequest request) { + String info = "熟客常用地址(分页)"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + String createDate = request.getCreateDate(); + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + // Store store = storeService.get(tenantId, storeId); + // if (store == null) { + // response.setStatus(0); + // response.setMessage("门店ID不存在"); + // response.setErrCode(CommonErrorCode.error3.getCode()); + // response.setErrMessage(CommonErrorCode.error3.getMessage()); + // return response; + // } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + if (StringUtils.isNotEmpty(createDate)) { + criteria.add(Restrictions.gt("createDate", createDate)); + } + criteria.add(Restrictions.order("id", "asc")); + pager = visitorAddressService.getPager(tenantId, criteria, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List dataList = (List) pager.getList(); + for (VisitorAddress data : dataList) { + Map map = new HashMap<>(); + map.put("id", data.getId()); + map.put("tenantId", data.getTenantId()); + map.put("visitorId", data.getVisitorId()); + map.put("name", replaceStr(data.getName())); + map.put("telephone", replaceStr(data.getTelephone())); + map.put("areaName", replaceStr(data.getAreaName())); + map.put("address", replaceStr(data.getAddress())); + map.put("description", replaceStr(data.getDescription())); + map.put("createDate", DateUtils.format(data.getCreateDate(), DateUtils.SHOW_DATETIME_FORMAT)); + map.put("createUser", data.getCreateUser()); + map.put("modifyDate", data.getModifyDate() == null ? null : DateUtils.format(data.getModifyDate(), DateUtils.SHOW_DATETIME_FORMAT)); + map.put("modifyUser", data.getModifyUser()); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "LIST_ERROR", request.getWopRequestContext().getLocale()); + } + + return response; + } + + @SuppressWarnings("unchecked") + @ServiceMethod(method = "visitor.tag.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "熟客标签(分页)") + @Override + public Object visitorTagList(VisitorTagListRequest request) { + String info = "熟客标签(分页)"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + String createDate = request.getCreateDate(); + + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + // Store store = storeService.get(tenantId, storeId); + // if (store == null) { + // response.setStatus(0); + // response.setMessage("门店ID不存在"); + // response.setErrCode(CommonErrorCode.error3.getCode()); + // response.setErrMessage(CommonErrorCode.error3.getMessage()); + // return response; + // } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + if (StringUtils.isNotEmpty(createDate)) { + criteria.add(Restrictions.gt("createDate", createDate)); + } + pager = visitorTagService.getPager(tenantId, criteria, pager); + + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List dataList = (List) pager.getList(); + for (VisitorTag data : dataList) { + Map map = new HashMap<>(); + map.put("id", data.getId()); + map.put("tenantId", data.getTenantId()); + map.put("visitorId", data.getVisitorId()); + map.put("name", replaceStr(data.getName())); + map.put("createDate", DateUtils.format(data.getCreateDate(), DateUtils.SHOW_DATETIME_FORMAT)); + map.put("createUser", data.getCreateUser()); + map.put("modifyDate", data.getModifyDate() == null ? null : DateUtils.format(data.getModifyDate(), DateUtils.SHOW_DATETIME_FORMAT)); + map.put("modifyUser", data.getModifyUser()); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "LIST_ERROR", request.getWopRequestContext().getLocale()); + } + + return response; + } + + @ServiceMethod(method = "visitor.add", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "新增熟客信息") + @Override + public Object visitorAdd(VisitorAddRequest request) { + String info = "新增熟客信息"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + + String jsonString = request.getJsonString(); + logger.debug("jsonString=" + jsonString); + + String storeId = request.getStoreId(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + if (StringUtils.isBlank(jsonString)) { + response.setStatus(0); + response.setMessage("参数jsonString不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + // Store store = storeService.get(tenantId, storeId); + // if (store == null) { + // response.setStatus(0); + // response.setMessage("门店ID不存在"); + // response.setErrCode(CommonErrorCode.error998.getCode()); + // response.setErrMessage(CommonErrorCode.error998.getMessage()); + // return response; + // } + + VisitorEntity visitorEntity = JSONUtil.parseObject(jsonString, VisitorEntity.class); + logger.debug("visitorEntity.json:" + JSONUtil.toJSONString(visitorEntity)); + + if (StringUtils.isBlank(visitorEntity.getTel())) { + response.setStatus(0); + response.setMessage("来电号码不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + if (StringUtils.isBlank(visitorEntity.getName())) { + response.setStatus(0); + response.setMessage("熟客姓名不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + if (CollectionUtils.isNotEmpty(visitorEntity.getTagList())) { + for (VisitorTagEntity tagEntity : visitorEntity.getTagList()) { + if (StringUtils.isBlank(tagEntity.getName())) { + response.setStatus(0); + response.setMessage("标签名称不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + } + } + + if (CollectionUtils.isNotEmpty(visitorEntity.getAddressList())) { + for (VisitorAddressEntity addressEntity : visitorEntity.getAddressList()) { + if (StringUtils.isBlank(addressEntity.getName())) { + response.setStatus(0); + response.setMessage("地址信息中的联系人不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + if (StringUtils.isBlank(addressEntity.getTelephone())) { + response.setStatus(0); + response.setMessage("地址信息中的联系电话不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + if (StringUtils.isBlank(addressEntity.getAddress())) { + response.setStatus(0); + response.setMessage("地址信息中的详细地址不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + } + } + + Visitor visitor = new Visitor(); +// if(StringUtils.isNotEmpty(visitorEntity.getId())){ +// visitor.setId(visitorEntity.getId()); +// } + visitor.setStoreId(storeId); + visitor.setNo(StringUtils.isBlank(visitorEntity.getNo()) ? null : visitorEntity.getNo());// 编号 + visitor.setTel(replaceStr(visitorEntity.getTel())); + visitor.setName(replaceStr(visitorEntity.getName())); + visitor.setSpell(replaceStr(StringUtils.isBlank(visitorEntity.getSpell()) ? Pinyin4jUtil.getPinYinHeadChar(visitorEntity.getName()) : visitorEntity.getSpell())); + visitor.setSex(visitorEntity.getSex() == null ? 1 : visitorEntity.getSex()); + visitor.setTitle(replaceStr(visitorEntity.getTitle()));// 称谓 + visitor.setPosition(replaceStr(visitorEntity.getPosition()));// 职位 + visitor.setFphone(replaceStr(visitorEntity.getFphone()));// 联系方式一 + visitor.setSphone(replaceStr(visitorEntity.getSphone()));// 联系方式二 + visitor.setDescription(replaceStr(StringUtils.isBlank(visitorEntity.getDescription()) ? null : visitorEntity.getDescription())); + visitor.setCreateDate(StringUtils.isBlank(visitorEntity.getCreateDate()) ? new Date() : DateUtils.parseDate(visitorEntity.getCreateDate(), DateUtils.SHOW_DATETIME_FORMAT)); + visitor.setCreateUser(visitorEntity.getCreateUser() == null ? Constant.CREATE_USER : visitorEntity.getCreateUser()); + visitor.setModifyDate(StringUtils.isBlank(visitorEntity.getModifyDate()) ? null : DateUtils.parseDate(visitorEntity.getModifyDate(), DateUtils.SHOW_DATETIME_FORMAT)); + visitor.setModifyUser(visitorEntity.getModifyUser() == null ? null : visitorEntity.getModifyUser()); + + List tagEntityList = visitorEntity.getTagList(); + List tagList = null; + if (CollectionUtils.isNotEmpty(tagEntityList)) { + tagList = new ArrayList<>(); + for (VisitorTagEntity tagEntity : tagEntityList) { + VisitorTag tag = new VisitorTag(); + tag.setStoreId(storeId); + tag.setVisitorId(null);// 熟客ID + tag.setName(tagEntity.getName());// 标签名称 + tag.setCreateDate(StringUtils.isBlank(tagEntity.getCreateDate()) ? new Date() : DateUtils.parseDate(tagEntity.getCreateDate(), DateUtils.SHOW_DATETIME_FORMAT)); + tag.setCreateUser(tagEntity.getCreateUser() == null ? Constant.CREATE_USER : tagEntity.getCreateUser()); + tag.setModifyDate(StringUtils.isBlank(tagEntity.getModifyDate()) ? null : DateUtils.parseDate(tagEntity.getModifyDate(), DateUtils.SHOW_DATETIME_FORMAT)); + tag.setModifyUser(tagEntity.getModifyUser() == null ? null : tagEntity.getModifyUser()); + tagList.add(tag); + } + } + + List addressEntityList = visitorEntity.getAddressList(); + List addressList = null; + if (CollectionUtils.isNotEmpty(addressEntityList)) { + addressList = new ArrayList<>(); + for (VisitorAddressEntity addressEntity : addressEntityList) { + VisitorAddress address = new VisitorAddress(); + address.setVisitorId(null);// 熟客ID + address.setStoreId(storeId); + address.setName(replaceStr(addressEntity.getName()));// 联系人 + address.setTelephone(replaceStr(addressEntity.getTelephone()));// 联系电话 + address.setAreaName(replaceStr(addressEntity.getAreaName()));// 所在地区 + address.setAddress(replaceStr(addressEntity.getAddress()));// 详细地址 + address.setDescription(replaceStr(addressEntity.getDescription()));// 备注说明 + address.setCreateDate(StringUtils.isBlank(addressEntity.getCreateDate()) ? new Date() : DateUtils.parseDate(addressEntity.getCreateDate(), DateUtils.SHOW_DATETIME_FORMAT)); + address.setCreateUser(addressEntity.getCreateUser() == null ? Constant.CREATE_USER : addressEntity.getCreateUser()); + address.setModifyDate(StringUtils.isBlank(addressEntity.getModifyDate()) ? null : DateUtils.parseDate(addressEntity.getModifyDate(), DateUtils.SHOW_DATETIME_FORMAT)); + address.setModifyUser(addressEntity.getModifyUser() == null ? null : addressEntity.getModifyUser()); + addressList.add(address); + } + } + + visitor = visitorService.saveExtend(tenantId, visitor, tagList, addressList); + + String visitorId = visitor.getId(); + String visitorNo = visitor.getNo(); + + Map data = new HashMap<>(); + data.put("visitorId", visitorId); + data.put("visitorNo", visitorNo); + + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "visitor.update", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "修改熟客信息") + @Override + public Object visitorUpdate(VisitorUpdateRequest request) { + String info = "修改熟客信息"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + + String visitorId = request.getId(); + String jsonString = request.getJsonString(); + String storeId = request.getStoreId(); + + logger.debug("jsonString=" + jsonString); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + if (StringUtils.isBlank(visitorId)) { + response.setStatus(0); + response.setMessage("参数id不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + if (StringUtils.isBlank(jsonString)) { + response.setStatus(0); + response.setMessage("参数jsonString不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + // Store store = storeService.get(tenantId, storeId); + // if (store == null) { + // response.setStatus(0); + // response.setMessage("门店ID不存在"); + // response.setErrCode(CommonErrorCode.error998.getCode()); + // response.setErrMessage(CommonErrorCode.error998.getMessage()); + // return response; + // } + + VisitorEntity visitorEntity = JSONUtil.parseObject(jsonString, VisitorEntity.class); + visitorEntity.setId(visitorId); + logger.debug("visitorEntity.json:" + JSONUtil.toJSONString(visitorEntity)); + + Visitor oldVisitor = visitorService.get(tenantId, visitorEntity.getId()); + if (oldVisitor == null) { + response.setStatus(0); + response.setMessage("熟客信息不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + if (StringUtils.isBlank(visitorEntity.getTel())) { + response.setStatus(0); + response.setMessage("来电号码不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + if (StringUtils.isBlank(visitorEntity.getName())) { + response.setStatus(0); + response.setMessage("熟客姓名不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + if (CollectionUtils.isNotEmpty(visitorEntity.getTagList())) { + for (VisitorTagEntity tagEntity : visitorEntity.getTagList()) { + if (StringUtils.isBlank(tagEntity.getName())) { + response.setStatus(0); + response.setMessage("标签名称不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + } + } + + if (CollectionUtils.isNotEmpty(visitorEntity.getAddressList())) { + for (VisitorAddressEntity addressEntity : visitorEntity.getAddressList()) { + if (StringUtils.isBlank(addressEntity.getName())) { + response.setStatus(0); + response.setMessage("地址信息中的联系人不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + if (StringUtils.isBlank(addressEntity.getTelephone())) { + response.setStatus(0); + response.setMessage("地址信息中的联系电话不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + if (StringUtils.isBlank(addressEntity.getAddress())) { + response.setStatus(0); + response.setMessage("地址信息中的详细地址不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + } + } + + Visitor visitor = new Visitor(); + visitor.setId(visitorEntity.getId()); + visitor.setStoreId(storeId); + visitor.setNo(visitorEntity.getNo());// 编号 + visitor.setTel(visitorEntity.getTel()); + visitor.setName(visitorEntity.getName()); + visitor.setSpell(StringUtils.isBlank(visitorEntity.getSpell()) ? Pinyin4jUtil.getPinYinHeadChar(visitorEntity.getName()) : visitorEntity.getSpell()); + visitor.setSex(visitorEntity.getSex() == null ? 1 : visitorEntity.getSex()); + visitor.setTitle(visitorEntity.getTitle());// 称谓 + visitor.setPosition(visitorEntity.getPosition());// 职位 + visitor.setFphone(visitorEntity.getFphone());// 联系方式一 + visitor.setSphone(visitorEntity.getSphone());// 联系方式二 + visitor.setDescription(StringUtils.isBlank(visitorEntity.getDescription()) ? null : visitorEntity.getDescription()); + visitor.setDescription(StringUtils.isBlank(visitorEntity.getDescription()) ? null : visitorEntity.getDescription()); + visitor.setCreateDate(StringUtils.isBlank(visitorEntity.getCreateDate()) ? new Date() : DateUtils.parseDate(visitorEntity.getCreateDate(), DateUtils.SHOW_DATETIME_FORMAT)); + visitor.setCreateUser(visitorEntity.getCreateUser() == null ? Constant.CREATE_USER : visitorEntity.getCreateUser()); + visitor.setModifyDate(StringUtils.isBlank(visitorEntity.getModifyDate()) ? null : DateUtils.parseDate(visitorEntity.getModifyDate(), DateUtils.SHOW_DATETIME_FORMAT)); + visitor.setModifyUser(visitorEntity.getModifyUser() == null ? null : visitorEntity.getModifyUser()); + + List tagEntityList = visitorEntity.getTagList(); + List tagList = null; + if (CollectionUtils.isNotEmpty(tagEntityList)) { + tagList = new ArrayList<>(); + for (VisitorTagEntity tagEntity : tagEntityList) { + VisitorTag tag = new VisitorTag(); + tag.setStoreId(storeId); + tag.setVisitorId(visitorId);// 熟客ID + tag.setName(tagEntity.getName());// 标签名称 + tag.setCreateDate(StringUtils.isBlank(tagEntity.getCreateDate()) ? new Date() : DateUtils.parseDate(tagEntity.getCreateDate(), DateUtils.SHOW_DATETIME_FORMAT)); + tag.setCreateUser(tagEntity.getCreateUser() == null ? Constant.CREATE_USER : tagEntity.getCreateUser()); + tag.setModifyDate(StringUtils.isBlank(tagEntity.getModifyDate()) ? null : DateUtils.parseDate(tagEntity.getModifyDate(), DateUtils.SHOW_DATETIME_FORMAT)); + tag.setModifyUser(tagEntity.getModifyUser() == null ? null : tagEntity.getModifyUser()); + tagList.add(tag); + } + } + + List addressEntityList = visitorEntity.getAddressList(); + List addressList = null; + if (CollectionUtils.isNotEmpty(addressEntityList)) { + addressList = new ArrayList<>(); + for (VisitorAddressEntity addressEntity : addressEntityList) { + VisitorAddress address = new VisitorAddress(); + address.setStoreId(storeId); + address.setVisitorId(visitorId);// 熟客ID + address.setName(addressEntity.getName());// 联系人 + address.setTelephone(addressEntity.getTelephone());// 联系电话 + address.setAreaName(addressEntity.getAreaName());// 所在地区 + address.setAddress(addressEntity.getAddress());// 详细地址 + address.setDescription(addressEntity.getDescription());// 备注说明 + address.setCreateDate(StringUtils.isBlank(addressEntity.getCreateDate()) ? new Date() : DateUtils.parseDate(addressEntity.getCreateDate(), DateUtils.SHOW_DATETIME_FORMAT)); + address.setCreateUser(addressEntity.getCreateUser() == null ? Constant.CREATE_USER : addressEntity.getCreateUser()); + address.setModifyDate(StringUtils.isBlank(addressEntity.getModifyDate()) ? null : DateUtils.parseDate(addressEntity.getModifyDate(), DateUtils.SHOW_DATETIME_FORMAT)); + address.setModifyUser(addressEntity.getModifyUser() == null ? null : addressEntity.getModifyUser()); + addressList.add(address); + } + } + + visitorService.updateExtend(tenantId, visitor, tagList, addressList); + + String visitorNo = visitor.getNo(); + Map data = new HashMap<>(); + data.put("visitorId", visitorId); + data.put("visitorNo", visitorNo); + + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "visitor.info", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "查询熟客信息") + @Override + public Object visitorInfo(VisitorInfoRequest request) { + String info = "查询熟客信息"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String visitorId = request.getId(); + String storeId = request.getStoreId(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + // Store store = storeService.get(tenantId, storeId); + // if (store == null) { + // response.setStatus(0); + // response.setMessage("门店ID不存在"); + // response.setErrCode(CommonErrorCode.error3.getCode()); + // response.setErrMessage(CommonErrorCode.error3.getMessage()); + // return response; + // } + + Visitor visitor = null; + // visitor = visitorService.get(tenantId, visitorId); + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("id", visitorId)); + criteria.add(Restrictions.eq("deleteFlag", 0)); + List visitorList = visitorService.getList(tenantId, criteria); + if (visitorList == null || visitorList.size() != 1) { + response.setStatus(0); + response.setMessage("熟客信息不存在"); + response.setErrCode(CommonErrorCode.error11.getCode()); + response.setErrMessage(CommonErrorCode.error11.getMessage()); + return response; + } + visitor = visitorList.get(0); + + Map visitorInfo = new HashMap<>(); + visitorInfo.put("id", visitor.getId()); + visitorInfo.put("tenantId", visitor.getTenantId()); + visitorInfo.put("storeId", visitor.getStoreId()); + visitorInfo.put("no", visitor.getNo()); + visitorInfo.put("tel", visitor.getTel()); + visitorInfo.put("name", visitor.getName()); + visitorInfo.put("spell", visitor.getSpell()); + visitorInfo.put("sex", visitor.getSex()); + visitorInfo.put("title", visitor.getTitle());// 称谓 + visitorInfo.put("position", visitor.getPosition());// 职位 + visitorInfo.put("fphone", visitor.getFphone());// 联系方式一 + visitorInfo.put("sphone", visitor.getSphone());// 联系方式二 + visitorInfo.put("description", visitor.getDescription());// 备注说明 + visitorInfo.put("createDate", visitor.getCreateDate() == null ? null : DateUtils.format(visitor.getCreateDate(), DateUtils.SHOW_DATETIME_FORMAT)); + visitorInfo.put("createUser", visitor.getCreateUser()); + visitorInfo.put("modifyDate", visitor.getModifyDate() == null ? null : DateUtils.format(visitor.getModifyDate(), DateUtils.SHOW_DATETIME_FORMAT)); + visitorInfo.put("modifyUser", visitor.getModifyUser()); + + List> addressList = new ArrayList<>(); + criteria = new Criteria(); + criteria.add(Restrictions.eq("visitorId", visitorId)); + List visitorAddressList = visitorAddressService.getList(tenantId, criteria); + if (CollectionUtils.isNotEmpty(visitorAddressList)) { + for (VisitorAddress data : visitorAddressList) { + Map map = new HashMap<>(); + map.put("id", data.getId()); + map.put("tenantId", data.getTenantId()); + map.put("visitorId", data.getVisitorId()); + map.put("name", data.getName()); + map.put("telephone", data.getTelephone()); + map.put("areaName", data.getAreaName()); + map.put("address", data.getAddress()); + map.put("description", data.getDescription()); + map.put("createDate", data.getCreateDate() == null ? null : DateUtils.format(data.getCreateDate(), DateUtils.SHOW_DATETIME_FORMAT)); + map.put("createUser", data.getCreateUser()); + map.put("modifyDate", data.getModifyDate() == null ? null : DateUtils.format(data.getModifyDate(), DateUtils.SHOW_DATETIME_FORMAT)); + map.put("modifyUser", data.getModifyUser()); + + addressList.add(map); + } + } + + List> tagList = new ArrayList<>(); + criteria = new Criteria(); + criteria.add(Restrictions.eq("visitorId", visitorId)); + List visitorTagList = visitorTagService.getList(tenantId, criteria); + if (CollectionUtils.isNotEmpty(visitorTagList)) { + for (VisitorTag data : visitorTagList) { + Map map = new HashMap<>(); + map.put("id", data.getId()); + map.put("tenantId", data.getTenantId()); + map.put("visitorId", data.getVisitorId()); + map.put("name", data.getName()); + map.put("createDate", data.getCreateDate() == null ? null : DateUtils.format(data.getCreateDate(), DateUtils.SHOW_DATETIME_FORMAT)); + map.put("createUser", data.getCreateUser()); + map.put("modifyDate", data.getModifyDate() == null ? null : DateUtils.format(data.getModifyDate(), DateUtils.SHOW_DATETIME_FORMAT)); + map.put("modifyUser", data.getModifyUser()); + tagList.add(map); + } + } + Map data = new HashMap<>(); + data.put("visitor", visitorInfo); + data.put("addressList", addressList); + data.put("tagList", tagList); + + response.setStatus(1); + response.setMessage("获取成功"); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "visitor.delete", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "删除熟客信息") + @Override + public Object visitorDelete(VisitorInfoRequest request) { + String info = "删除熟客信息"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String visitorId = request.getId(); + String storeId = request.getStoreId(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + if(StringUtils.contains(visitorId,",")){ + List visitorIds = Arrays.asList(visitorId.split(",")); + criteria.add(Restrictions.in("id", visitorIds)); + }else{ + criteria.add(Restrictions.eq("id", visitorId)); + } + criteria.add(Restrictions.eq("deleteFlag", 0)); + List visitorList = visitorService.getList(tenantId, criteria); + if (visitorList == null || visitorList.size() == 0) { + response.setStatus(0); + response.setMessage("熟客信息不存在"); + response.setErrCode(CommonErrorCode.error11.getCode()); + response.setErrMessage(CommonErrorCode.error11.getMessage()); + return response; + } + criteria = new Criteria(); + if(StringUtils.contains(visitorId,",")){ + List visitorIds = Arrays.asList(visitorId.split(",")); + criteria.add(Restrictions.in("id", visitorIds)); + visitorAddressService.deleteByCriteria(tenantId,criteria); + visitorTagService.deleteByCriteria(tenantId,criteria); + visitorService.deleteByIds(tenantId,visitorIds); + }else{ + criteria.add(Restrictions.eq("visitorId",visitorId)); + visitorAddressService.deleteByCriteria(tenantId,criteria); + visitorTagService.deleteByCriteria(tenantId,criteria); + visitorService.delete(tenantId,visitorId); + } + + + response.setStatus(1); + response.setMessage("删除成功"); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + + return response; + } + + public static String replaceStr(String str) { + if (StringUtils.isEmpty(str)) { + str = ""; + } else { + str.replace(",", "").replace(";", "").replace("'", ""); + } + return str; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/vpos/VposProductService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/vpos/VposProductService.java new file mode 100644 index 0000000..289ced0 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/vpos/VposProductService.java @@ -0,0 +1,191 @@ +package com.jwsaas.api.service.vpos; + +import com.jwsaas.api.request.vpos.*; +import com.jwsaas.api.service.WopService; + +public interface VposProductService extends WopService { + + /** + * 商品分类标签 + * + * @param request + * @return + */ + Object ProductTypeLabel(VposProductTypeLabelRequest request); + + /** + * 商品大类 + * + * @param request + * @return + */ + Object ProductType(VposProductTypeRequest request); + + /** + * 商品二级分类 + * + * @param request + * @return + */ + Object VposProductTypeTwo(VposProductTypeTwoRequest request); + + /** + * 获取类别信息 + * + * @param request + * @return + */ + Object ProductTypeDetail(ProductTypeDetailRequest request); + + /** + * 商品资料列表 + * + * @param request + * @return + */ + Object VposProduct(VposProductRequest request); + + /** + * 订单创建 + * + * @param request + * @return + */ + Object VposOrderCreate(VposOrderCreateRequest request); + + /** + * 订单修改 + * + * @param request + * @return + */ + Object VposOrderEdit(VposOrderEditRequest request); + + /** + * 订单取消 + * + * @param request + * @return + */ + Object VposOrderCancel(VposOrderCancelRequest request); + + /** + * 订单支付成功上传 + * + * @param request + * @return + */ + Object VposOrderPay(VposOrderPayRequest request); + + /** + * 门店商品库存校验 + * + * @param request + * @return + */ + Object VposProductStock(VposProductStockRequest request); + + /*** + * 微信小程序统一下单 + * + * @return + */ + Object VposWeixinPay(VposWeixinPayRequest request); + + /*** + * 微信小程序统一下单,建行支付分账接口; + * + * @return + */ + Object VposWeixinPayWithCcbfz(VposWeixinPayRequest request); + + /*** + * 聚合支付二维码生成 + * @return + */ + Object VposBarCodePay(VposBarCodePayRequest request); + + /*** + * 聚合支付二维码生成,建行支付分账接口; + * @return + */ + Object VposBarCodePayWithCcbfz(VposBarCodePayRequest request); + + /*** + * 订单支付状态查询接口 + * + * @return + */ + Object VposWeixinPayQuery(VposWeixinPayQueryRequest request); + + /** + * 订单列表 + * + * @param request + * @return + */ + Object VposOrderList(VposOrderListRequest request); + + /** + * 订单详情 + * + * @param request + * @return + */ + Object VposOrderDetail(VposOrderDetailRequest request); + + + /** + * 订单退款 + * + * @param request + * @return + */ + Object VposOrderRefund(VposOrderRefundRequest request); + + /** + * 订单退款(部分退款) + * + * @param request + * @return + */ + Object VposOrderRefundPart(VposOrderRefundPartRequest request); + + + /** + * 广告图片; + * @param request + * @return + */ + Object VposAdPictures(VposAdPictureRequest request); + + /** + * 美食广场商品评价上传; + * @param request + * @return + */ + Object VposProductEvaluateUpload(VposProductEvaluateUploadRequest request); + + /** + * 美食广场商品评价查看; + * @param request + * @return + */ + Object VposProductEvaluateView(VposProductEvaluateViewRequest request); + + /** + * 美食广场商品评价级别查询; + * @param request + * @return + */ + Object VposProductEvaluateLevelView(VposProductEvaluateLevelViewRequest request); + + /** + * 获取美食广场档口商铺建行分账信息; + * @param request + * @return + */ + Object VposWindowsCcbfzInfos(VposWindowsCcbfzInfosRequest request); + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/vpos/impl/VposProductServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/vpos/impl/VposProductServiceImpl.java new file mode 100644 index 0000000..67df8e0 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/vpos/impl/VposProductServiceImpl.java @@ -0,0 +1,4466 @@ +package com.jwsaas.api.service.vpos.impl; + +import java.math.BigDecimal; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.Map.Entry; + +import javax.annotation.Resource; +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; + +import com.jwsaas.api.request.vpos.*; +import com.jwsaas.api.response.mode.CommonListResponse; +import com.jwsaas.entity.food.*; +import com.jwsaas.http.HTTPRequest; +import com.jwsaas.service.food.VposCcbfzAccountService; +import com.jwsaas.util.*; +import com.jwsaas.weixin.SignUtil; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringEscapeUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.tomcat.util.security.MD5Encoder; +import org.springframework.amqp.rabbit.support.CorrelationData; +import org.springframework.beans.factory.annotation.Autowired; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.serializer.SerializerFeature; +import com.fasterxml.jackson.core.type.TypeReference; +import com.jwsaas.Constant; +import com.jwsaas.api.entity.vpos.VposStoreBusinessTicketEntity; +import com.jwsaas.api.entity.vpos.VposStoreBusinessTicketInfoEntity; +import com.jwsaas.api.entity.vpos.VposStoreBusinessTicketRefundPartEntity; +import com.jwsaas.api.entity.vpos.VposStoreOrderProductEntity; +import com.jwsaas.api.entity.vpos.VposStoreOrderProductInfoEntity; +import com.jwsaas.api.entity.vpos.VposStoreOrderProductMakeEntity; +import com.jwsaas.api.entity.vpos.VposStoreOrderProductMakeRefundPartEntity; +import com.jwsaas.api.entity.vpos.VposStoreOrderProductRefundPartEntity; +import com.jwsaas.api.entity.vpos.VposStorePayEntity; +import com.jwsaas.api.entity.vpos.VposStorePayRefundPartEntity; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.response.mode.CommonPagerResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.vpos.VposProductService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.config.MQMessageSender; +import com.jwsaas.entity.wxdc.WeixinUser; +import com.jwsaas.http.HttpTool; +import com.jwsaas.mqtt.MqttClientExt; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.pager.Pager; +import com.jwsaas.properties.SaoBeiPayProperties; +import com.jwsaas.service.food.VposAdPictureService; +import com.jwsaas.service.food.VposProductEvaluateService; +import com.jwsaas.service.wxdc.WeixinUserService; +import com.jwsaas.util.DigestUtils; +import com.jwsaas.util.JSONUtil; +import com.jwsaas.util.Md5Hash; +import com.jwsaas.util.URLEncodedUtil; +import com.jwsaas.utils.AppKeyUtil; +import com.jwsaas.utils.DateUtils; +import com.jwsaas.utils.IdWorkerUtils; +import com.jwsaas.utils.MathUtil; + +@ServiceMethodBean(version = "1.0") +public class VposProductServiceImpl extends WopServiceImpl implements VposProductService { + + private static final long serialVersionUID = -8586108171400982719L; + + @Resource + private com.jwsaas.service.food.ProductTypeLabelInfoService productTypeLabelInfoService; + + @Resource + private com.jwsaas.service.food.ProductTypeService productTypeService; + + @Resource + private com.jwsaas.service.food.ProductService productService; + + @Resource + private com.jwsaas.service.food.ProductUnitService productUnitService; + + @Resource + private com.jwsaas.service.food.ProductSpecService productSpecService; + + @Resource + private com.jwsaas.service.food.StoreProductService storeProductService; + + @Resource + private com.jwsaas.service.food.MakeTypeService makeTypeService; + + @Resource + private com.jwsaas.service.food.MakeDetailService makeDetailService; + + @Resource + private com.jwsaas.service.food.StoreService storeService; + + @Resource + private com.jwsaas.service.food.VposStoreBusinessTicketService vposStoreBusinessTicketService; + + @Resource + private com.jwsaas.service.food.VposStoreBusinessTicketInfoService vposStoreBusinessTicketInfoService; + + @Resource + private com.jwsaas.service.food.VposStoreOrderProductService vposStoreOrderProductService; + + @Resource + private com.jwsaas.service.food.VposStoreOrderProductInfoService vposStoreOrderProductInfoService; + + @Resource + private com.jwsaas.service.food.VposStoreOrderProductMakeService vposStoreOrderProductMakeService; + + @Resource + private com.jwsaas.service.food.VposStorePayService vposStorePayService; + + @Resource + private com.jwsaas.service.food.PaymentParameterService paymentParameterService; + + @Resource + private com.jwsaas.service.food.StoreProductSaleStockService storeProductSaleStockService; + + @Resource + private MQMessageSender mqMessageSender; + + @Resource + private MqttClientExt mqttClient; + + @Resource + private com.jwsaas.cache.CacheService cacheService; + + @Autowired + private SaoBeiPayProperties saoBeiPayProperties; + + @Resource + private VposAdPictureService vposAdPictureService; + + @Resource + private VposProductEvaluateService vposProductEvaluateService; + + @Resource + private WeixinUserService weixinUserService; + + @Resource + private VposCcbfzAccountService vposCcbfzAccountService; + + @ServiceMethod(method = "vpos.product.type.label", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "类别标签") + @Override + public Object ProductTypeLabel(VposProductTypeLabelRequest request) { + String info = "类别标签"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("deleteFlag", 0)); + pager = productTypeLabelInfoService.getPager(tenantId, criteria, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (ProductTypeLabelInfo productTypeLabelInfo : source) { + Map map = new HashMap<>(); + map.put("tenantId", productTypeLabelInfo.getTenantId()); + map.put("id", productTypeLabelInfo.getId()); + map.put("no", productTypeLabelInfo.getNo()); + map.put("name", productTypeLabelInfo.getName()); + map.put("color", productTypeLabelInfo.getColor()); + map.put("imageName", productTypeLabelInfo.getImageName()); + map.put("width", productTypeLabelInfo.getWidth()); + map.put("height", productTypeLabelInfo.getHeight()); + map.put("linkUrl", productTypeLabelInfo.getLinkUrl()); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "vpos.product.type", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "大类信息") + @Override + public Object ProductType(VposProductTypeRequest request) { + String info = "类别标签"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String keyword = request.getKeyword(); + String labelIds = request.getLabelIds(); + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + CommonPagerResponse response = null; + try { + if (StringUtils.isNotEmpty(keyword)) { + keyword = keyword.replace("'", "").replace(";", ""); + } + response = new CommonPagerResponse(); + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("deleteFlag", 0)); + criteria.add(Restrictions.eq("stopFlag", 0)); + criteria.add(Restrictions.isNull("parentId")); + // 获取门店上架商品关联的类别ID + List tempProductList = new ArrayList<>(); + if (StringUtils.isNotEmpty(keyword)) { + Criteria criteria1 = new Criteria(); + criteria1.add(Restrictions.like("p.name", "%" + keyword + "%")); + criteria1.add(Restrictions.eq("p.deleteFlag", 0)); + criteria1.add(Restrictions.group("p.typePath")); + List listProduct = storeProductService.getListExtend(tenantId, criteria1); + for (StoreProduct storeProduct : listProduct) { + if (storeProduct.getTypePath() != null && !"".equals(storeProduct.getTypePath())) { + String type[] = storeProduct.getTypePath().split(","); + tempProductList.add(type[0]); + } + } + } + // 获取标签关键字关联的类别ID + if (StringUtils.isNotEmpty(keyword)) { + Criteria criteria1 = new Criteria(); + criteria1.add(Restrictions.like("name", "%" + keyword + "%")); + criteria1.add(Restrictions.eq("deleteFlag", 0)); + List labelInfoList = productTypeLabelInfoService.getList(tenantId, criteria1); + if (CollectionUtils.isNotEmpty(labelInfoList)) { + String ids = ""; + for (ProductTypeLabelInfo productTypeLabelInfo : labelInfoList) { + ids = ids + productTypeLabelInfo.getId() + ","; + } + if (ids != null && ids.length() > 0) { + ids = ids.substring(0, ids.length() - 1); + } + if (StringUtils.isNoneBlank(labelIds)) { + labelIds = labelIds + "," + ids; + } else { + labelIds = ids; + } + } + } + // 获取标签关联的类别ID + if (StringUtils.isNoneBlank(labelIds)) { + String ids[] = labelIds.split(","); + List idList = Arrays.asList(ids); + List typeIdList = productTypeService.getListTypeIds(tenantId, idList); + // 根据标签ID获取分类ID + if (CollectionUtils.isNotEmpty(typeIdList)) { + for (String typeId : typeIdList) { + tempProductList.add(typeId); + } + }else{ + tempProductList.add("1"); + } + } + if (StringUtils.isNotEmpty(keyword) && !CollectionUtils.isNotEmpty(tempProductList)) { + criteria.add(Restrictions.like("name", "%" + keyword + "%")); + }else if(!StringUtils.isNotEmpty(keyword) && CollectionUtils.isNotEmpty(tempProductList)){ + criteria.add(Restrictions.in("id", tempProductList)); + }else if(StringUtils.isNotEmpty(keyword) && CollectionUtils.isNotEmpty(tempProductList)){ + criteria.add(Restrictions.or(Restrictions.like("name", "%" + keyword + "%"), Restrictions.in("id", tempProductList))); + } + //增加门店排序 + criteria.add(Restrictions.order("orderNo", "asc")); + pager = productTypeService.getPager(tenantId, criteria, pager); + // 加载标签 + criteria = new Criteria(); + List labelList = productTypeLabelInfoService.getList(tenantId, criteria); + Map labelInfoMap = new HashMap<>(); + for (ProductTypeLabelInfo productTypeLabelInfo : labelList) { + labelInfoMap.put(productTypeLabelInfo.getId(), productTypeLabelInfo); + } + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (ProductType dishType : source) { + Map map = new HashMap<>(); + map.put("tenantId", dishType.getTenantId()); + map.put("id", dishType.getId()); + map.put("parentId", dishType.getParentId()); + map.put("path", dishType.getPath()); + map.put("no", dishType.getNo()); + map.put("name", dishType.getName()); + map.put("color", dishType.getColor()); + map.put("groupName", dishType.getGroupName()); + map.put("storageFileName", dishType.getStorageFileName()); + map.put("sign", dishType.getSign());// 标识符 + List> labelInfo = new ArrayList<>(); + List typeLabelIds = productTypeService.getListLabelIds(tenantId, dishType.getId()); + if (CollectionUtils.isNotEmpty(typeLabelIds)) { + for (String labelId : typeLabelIds) { + ProductTypeLabelInfo productTypeLabelInfo = labelInfoMap.get(labelId); + if (productTypeLabelInfo != null) { + Map map1 = new HashMap<>(); + map1.put("tenantId", productTypeLabelInfo.getTenantId()); + map1.put("id", productTypeLabelInfo.getId()); + map1.put("no", productTypeLabelInfo.getNo()); + map1.put("name", productTypeLabelInfo.getName()); + map1.put("color", productTypeLabelInfo.getColor()); + labelInfo.add(map1); + } + } + } + map.put("labelInfo", labelInfo);// 标识符 + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "vpos.product.type.detail", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "分类信息") + @Override + public Object ProductTypeDetail(ProductTypeDetailRequest request) { + String info = "分类信息"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + String typeId = request.getTypeId(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + ProductType productType = productTypeService.get(tenantId, typeId); + if (productType == null) { + response.setStatus(0); + response.setMessage("分类信息不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + Map data = new HashMap<>(); + data.put("id", productType.getId()); + data.put("tenantId", productType.getTenantId()); + data.put("name", productType.getName()); + data.put("no", productType.getNo()); + data.put("color", productType.getColor()); + response.setStatus(1); + response.setMessage("获取成功"); + response.setData(data); + + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "vpos.product.type.two", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "小类信息") + @Override + public Object VposProductTypeTwo(VposProductTypeTwoRequest request) { + String info = "商品类别二级"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + String typeId = request.getTypeId(); + String storeId = request.getStoreId(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("deleteFlag", 0)); + criteria.add(Restrictions.eq("stopFlag", 0)); + criteria.add(Restrictions.eq("parentId", typeId)); + pager = productTypeService.getPager(tenantId, criteria, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (ProductType dishType : source) { + Map map = new HashMap<>(); + map.put("tenantId", dishType.getTenantId()); + map.put("id", dishType.getId()); + map.put("parentId", dishType.getParentId()); + map.put("path", dishType.getPath()); + map.put("no", dishType.getNo()); + map.put("name", dishType.getName()); + map.put("color", dishType.getColor()); + map.put("sign", dishType.getSign());// 标识符 + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "vpos.product", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "商品列表") + @Override + public Object VposProduct(VposProductRequest request) { + String info = "商品类别二级"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + String typeId = request.getTypeId(); + String keyword = request.getKeyword(); + String storeId = request.getStoreId(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + // 查询所有单位 + Map unitMap = new HashMap(); + Criteria criteria1 = new Criteria(); + List unitList = productUnitService.getList(tenantId, criteria1); + for (ProductUnit unit : unitList) { + unitMap.put(unit.getId(), unit); + } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + pager = productService.getPagerByStoreIdMore(tenantId, storeId, typeId, keyword, pager); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (Product product : source) { + Map map = new HashMap<>(); + map.put("tenantId", product.getTenantId()); + map.put("id", product.getId()); + map.put("brandId", product.getBrandId()); + map.put("typeId", product.getTypeId()); + map.put("typePath", product.getTypePath()); + map.put("no", product.getNo()); + map.put("name", product.getName()); + map.put("spell", product.getSpell()); + map.put("assistNo", product.getAssistNo()); + map.put("barCode", product.getBarCode()); + map.put("otherNo", product.getOtherNo()); + map.put("shortName", product.getShortName()); + map.put("english", product.getEnglish()); + map.put("unitId", product.getUnitId()); + map.put("unitName", unitMap.get(product.getUnitId()).getName()); + map.put("description", product.getDescription()); + map.put("commissionType", product.getCommissionType()); + map.put("commissionValue", doubleFormat(product.getCommissionType())); + map.put("discountFlag", product.getDiscountFlag()); + map.put("tapleFlag", product.getTapleFlag()); + map.put("weighFlag", product.getWeighFlag()); + map.put("currentFlag", product.getCurrentFlag()); + map.put("labelPrintFlag", product.getLabelPrintFlag()); + map.put("suitFlag", product.getSuitFlag()); + map.put("mebDiscountFlag", product.getMebDiscountFlag()); + map.put("giveFlag", product.getGiveFlag()); + map.put("promotionFlag", product.getPromotionFlag()); + map.put("type", product.getType()); + map.put("stockFlag", product.getStockFlag()); + map.put("pointType", product.getPointType()); + map.put("pointValue", doubleFormat(product.getPointValue())); + map.put("purchaseTax", doubleFormat(product.getPurchaseTax())); + map.put("saleTax", doubleFormat(product.getSaleTax())); + map.put("lyRate", doubleFormat(product.getLyRate())); + map.put("groupName", product.getGroupName()); + map.put("picture", product.getPicture()); + map.put("stopFlag", product.getStopFlag()); + map.put("price", product.getPrice()); + map.put("memberPrice", doubleFormat(product.getMemberPrice())); + map.put("otherPrice", doubleFormat(product.getOtherPrice())); + map.put("costPrice", doubleFormat(product.getCostPrice())); + map.put("purchasePrice", doubleFormat(product.getPurchasePrice())); + map.put("dispatchPrice", doubleFormat(product.getDispatchPrice())); + map.put("minPrice", doubleFormat(product.getMinPrice())); + map.put("specCount", product.getSpecCount()); + map.put("kdsFlag", product.getKdsFlag()); + List> listSpec = new ArrayList<>(); + // 加载规格明细 + List sourceSpec = productSpecService.getListByStoreIdProduct(tenantId, storeId, product.getId()); + if (CollectionUtils.isNotEmpty(sourceSpec)) { + for (ProductSpec productSpec : sourceSpec) { + Map mapSpec = new HashMap<>(); + mapSpec.put("tenantId", productSpec.getTenantId()); + mapSpec.put("id", productSpec.getId()); + mapSpec.put("productId", productSpec.getProductId()); + mapSpec.put("no", productSpec.getNo()); + mapSpec.put("name", productSpec.getName()); + mapSpec.put("price", doubleFormat(productSpec.getPrice())); + mapSpec.put("memberPrice", doubleFormat(productSpec.getMemberPrice())); + mapSpec.put("minPrice", doubleFormat(productSpec.getMinPrice())); + mapSpec.put("otherPrice", doubleFormat(productSpec.getOtherPrice())); + mapSpec.put("costPrice", doubleFormat(productSpec.getCostPrice())); + mapSpec.put("purchasePrice", doubleFormat(productSpec.getPurchasePrice())); + mapSpec.put("dispatchPrice", doubleFormat(productSpec.getDispatchPrice())); + mapSpec.put("materialRate", doubleFormat(productSpec.getMaterialRate())); + mapSpec.put("isdefault", productSpec.getIsdefault()); + mapSpec.put("deleteFlag", productSpec.getDeleteFlag()); + String productKey = "productKey:" + storeId + ":" + productSpec.getId(); + Object productKeyValue = cacheService.get(tenantId, productKey); + if (productKeyValue == null) { + Criteria criteria0 = new Criteria(); + criteria0.add(Restrictions.eq("storeId", storeId)); + criteria0.add(Restrictions.eq("specId", productSpec.getId())); + List stockList = storeProductSaleStockService.getList(tenantId, criteria0); + if (CollectionUtils.isNotEmpty(stockList)) { + StoreProductSaleStock storeProductSaleStock = stockList.get(0); + productKeyValue = storeProductSaleStock.getStock(); + } else { + productKeyValue = 9999.00; + } + cacheService.set(tenantId, productKey, productKeyValue, 60 * 60 * 6); + } + mapSpec.put("stock", Double.parseDouble(productKeyValue.toString())); + listSpec.add(mapSpec); + } + } + map.put("specInfo", listSpec); + // 加载私有做法明细 + List> listMakes = new ArrayList<>(); + Criteria criteria = new Criteria(); + List sourceMake = makeDetailService.getListByProductId(tenantId, product.getId(), criteria); + if (CollectionUtils.isNotEmpty(sourceMake)) { + List typeIds = new ArrayList<>(); + for (MakeDetail makeDetail : sourceMake) { + typeIds.add(makeDetail.getTypeId()); + } + criteria = new Criteria(); + criteria.add(Restrictions.in("id", typeIds)); + List makeTypeList = makeTypeService.getList(tenantId, criteria); + for (MakeType makeType : makeTypeList) { + Map mapMake = new HashMap<>(); + mapMake.put("tenantId", makeType.getTenantId()); + mapMake.put("id", makeType.getId()); + mapMake.put("no", makeType.getNo()); + mapMake.put("name", makeType.getName()); + mapMake.put("isRadio", makeType.getIsRadio()); + mapMake.put("type", makeType.getType()); + mapMake.put("seqNo", makeType.getSeqNo()); + mapMake.put("color", makeType.getColor()); + List> listDetail = new ArrayList<>(); + for (MakeDetail makeDetail : sourceMake) { + if (makeType.getId().equals(makeDetail.getTypeId())) { + Map mapMakeDetal = new HashMap<>(); + mapMakeDetal.put("tenantId", makeDetail.getTenantId()); + mapMakeDetal.put("id", makeDetail.getId()); + mapMakeDetal.put("no", makeDetail.getNo()); + mapMakeDetal.put("typeId", makeDetail.getTypeId()); + mapMakeDetal.put("description", makeDetail.getDescription()); + mapMakeDetal.put("spell", makeDetail.getSpell()); + mapMakeDetal.put("addPrice", doubleFormat(makeDetail.getAddPrice())); + mapMakeDetal.put("qtyFlag", makeDetail.getQtyFlag()); + mapMakeDetal.put("orderNo", makeDetail.getOrderNo()); + mapMakeDetal.put("color", makeDetail.getColor()); + mapMakeDetal.put("prvFlag", makeDetail.getPrvFlag()); + listDetail.add(mapMakeDetal); + } + } + mapMake.put("makes", listDetail); + listMakes.add(mapMake); + } + } + map.put("makeInfo", listMakes); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "vpos.order.create", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "订单创建") + @Override + public Object VposOrderCreate(VposOrderCreateRequest request) { + String info = "订单创建"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + CommonDataResponse response = null; + String jsonString = request.getJsonString(); + try { + response = new CommonDataResponse(); + JSONObject json = JSONObject.parseObject(jsonString); + + Store store = storeService.get(tenantId, request.getStoreId()); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + // 销售单据校验开始 + VposStoreBusinessTicketEntity entity = new VposStoreBusinessTicketEntity(json); + VposStoreBusinessTicket storeBusinessTicket = new VposStoreBusinessTicket(); + Date createDate = new Date(); + storeBusinessTicket.setCreateDate(createDate); + storeBusinessTicket.setCreateUser("open-api"); + + if (entity.getMemberId() != null && entity.getMemberId().length() > 32) { + response.setStatus(0); + response.setMessage("主单MemberId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setMemberId(entity.getMemberId()); + } + + if (entity.getOpenId() != null && entity.getOpenId().length() > 64) { + response.setStatus(0); + response.setMessage("主单OpenId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setOpenId(entity.getOpenId()); + } + + if (entity.getMobile() != null && entity.getMobile().length() > 32) { + response.setStatus(0); + response.setMessage("主单Mobile参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setMobile(entity.getMobile()); + } + if (entity.getClientId() == null || "".equals(entity.getClientId()) || entity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("前台系统ID参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setClientId(entity.getClientId()); + } + entity.setNo("B" + String.valueOf(IdWorkerUtils.getInstance().nextId())); + if (entity.getNo() == null || "".equals(entity.getNo()) || entity.getNo().length() > 32) { + response.setStatus(0); + response.setMessage("主单No参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setNo(entity.getNo()); + } + if (entity.getStoreId() == null || "".equals(entity.getStoreId()) || entity.getStoreId().length() > 18) { + response.setStatus(0); + response.setMessage("主单storeId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setStoreId(entity.getStoreId()); + } + entity.setStoreNo(store.getNo()); + entity.setStoreName(store.getName()); + if (entity.getWorkNo() == null || "".equals(entity.getWorkNo())) { + entity.setWorkNo("00000"); + } + storeBusinessTicket.setStoreNo(store.getNo()); + storeBusinessTicket.setStoreName(store.getName()); + storeBusinessTicket.setStatus(0); + storeBusinessTicket.setWorkNo(entity.getWorkNo()); + storeBusinessTicket.setSaleDate(entity.getSaleDate()); + if (entity.getTableNo() != null && entity.getTableNo().length() > 16) { + response.setStatus(0); + response.setMessage("主单TableNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setTableNo(entity.getTableNo()); + } + storeBusinessTicket.setPeople(entity.getPeople()); + storeBusinessTicket.setBusMode(entity.getBusMode()); + entity.setShiftNo("000001"); + entity.setShiftName("默认班次"); + storeBusinessTicket.setShiftNo("000001"); + storeBusinessTicket.setShiftName("默认班次"); + storeBusinessTicket.setAmount(entity.getAmount()); + storeBusinessTicket.setDiscount(entity.getDiscount()); + storeBusinessTicket.setDiscountTotal(entity.getDiscountTotal()); + storeBusinessTicket.setReceivable(entity.getReceivable()); + storeBusinessTicket.setMaling(entity.getMaling()); + if (entity.getPaid() == null || entity.getPaid() == 0) { + storeBusinessTicket.setPaid(entity.getReceivable() - entity.getMaling()); + } else { + storeBusinessTicket.setPaid(entity.getPaid()); + } + if (entity.getNoOrg() != null && entity.getNoOrg().length() > 32) { + response.setStatus(0); + response.setMessage("主单NoOrg参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setNoOrg(entity.getNoOrg()); + } + if (entity.getBackCause() != null && entity.getBackCause().length() > 128) { + response.setStatus(0); + response.setMessage("主单BackCause参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setBackCause(entity.getBackCause()); + } + String deviceName = "WX-00001"; + String posNo = "00000"; + String deviceIp = "127.0.0.1"; + String deviceMac = "FF-FF"; + if (entity.getDeviceName() == null || "".equals(entity.getDeviceName())) { + entity.setDeviceName(deviceName); + } + if (entity.getPosNo() == null || "".equals(entity.getPosNo())) { + entity.setPosNo(posNo); + } + if (entity.getDeviceIp() == null || "".equals(entity.getDeviceIp())) { + entity.setDeviceIp(deviceIp); + } + if (entity.getDeviceMac() == null || "".equals(entity.getDeviceMac())) { + entity.setDeviceMac(deviceMac); + } + entity.setIsMember(0); + storeBusinessTicket.setIsMember(0); + storeBusinessTicket.setMemberJifen(0.00); + storeBusinessTicket.setDeviceName(entity.getDeviceName()); + storeBusinessTicket.setPosNo(entity.getPosNo()); + storeBusinessTicket.setDeviceIp(entity.getDeviceIp()); + storeBusinessTicket.setDeviceMac(entity.getDeviceMac()); + storeBusinessTicket.setSeqNo("");// 当日流水号 + storeBusinessTicket.setWeather("");// 天气 + storeBusinessTicket.setWeeker(entity.getWeeker());// 星期 + storeBusinessTicket.setEstimatedCost(0.00);// 预估成本 + storeBusinessTicket.setEstimatedProfitAmount(0.00);// 预估毛利金额 + storeBusinessTicket.setEstimatedProfitMargin(0.00);// 预估毛利率 + storeBusinessTicket.setTotalCost(0.00);// 实际成本 + storeBusinessTicket.setProfitAmount(0.00);// 实际毛利金额 + storeBusinessTicket.setProfitMargin(0.00);// 实际毛利率 + if (entity.getExt2() != null && entity.getExt2().length() > 32) { + response.setStatus(0); + response.setMessage("订单备注不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicket.setExt2(entity.getExt2()); + } + // 前台销售单优惠明细校验开始 + List ticketInfoList = new ArrayList<>(); + List storeBusinessTicketInfoEntityList = entity.getTicketInfo(); + if (storeBusinessTicketInfoEntityList != null && storeBusinessTicketInfoEntityList.size() > 0) { + for (VposStoreBusinessTicketInfoEntity storeBusinessTicketInfoEntity : storeBusinessTicketInfoEntityList) { + VposStoreBusinessTicketInfo storeBusinessTicketInfo = new VposStoreBusinessTicketInfo(); + storeBusinessTicketInfo.setCreateDate(createDate); + storeBusinessTicketInfo.setCreateUser("open-api"); + if (storeBusinessTicketInfoEntity.getClientId() == null || "".equals(storeBusinessTicketInfoEntity.getClientId()) || storeBusinessTicketInfoEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("销售单优惠ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicketInfo.setClientId(storeBusinessTicketInfoEntity.getClientId()); + } + storeBusinessTicketInfo.setStoreId(entity.getStoreId()); + storeBusinessTicketInfo.setBusNo(entity.getNo()); + storeBusinessTicketInfo.setType(storeBusinessTicketInfoEntity.getType()); + if (storeBusinessTicketInfoEntity.getInfo() != null && storeBusinessTicketInfoEntity.getInfo().length() > 256) { + response.setStatus(0); + response.setMessage("销售单优惠Info参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeBusinessTicketInfo.setInfo(storeBusinessTicketInfoEntity.getInfo()); + } + storeBusinessTicketInfo.setDiscountMoney(storeBusinessTicketInfoEntity.getDiscountMoney()); + storeBusinessTicketInfo.setSaleDate(entity.getSaleDate()); + ticketInfoList.add(storeBusinessTicketInfo); + } + } + + // 门店菜品销售记录校验开始 + List orderProductList = new ArrayList<>(); + List storeOrderProductEntityList = entity.getOrderProduct(); + // 销售明细优惠 + List orderProductInfoList = new ArrayList<>(); + // 销售明细做法 + List makeList = new ArrayList<>(); + + if (storeOrderProductEntityList == null || storeOrderProductEntityList.size() <= 0) { + response.setStatus(0); + response.setMessage("门店菜品销售记录不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + int lineNo = 0; + for (VposStoreOrderProductEntity storeOrderProductEntity : storeOrderProductEntityList) { + VposStoreOrderProduct storeOrderProduct = new VposStoreOrderProduct(); + storeOrderProduct.setCreateDate(createDate); + storeOrderProduct.setCreateUser("open-api"); + if (storeOrderProductEntity.getClientId() == null || "".equals(storeOrderProductEntity.getClientId()) || storeOrderProductEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ID参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setClientId(storeOrderProductEntity.getClientId()); + } + if (storeOrderProductEntity.getParentId() != null && storeOrderProductEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ParentId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setParentId(storeOrderProductEntity.getParentId()); + } + storeOrderProduct.setBusNo(entity.getNo()); + storeOrderProduct.setBusMode(entity.getBusMode()); + storeOrderProduct.setStoreId(entity.getStoreId()); + storeOrderProduct.setStoreNo(store.getNo()); + storeOrderProduct.setStoreName(store.getName()); + storeOrderProduct.setTableNo(entity.getTableNo()); + if (storeOrderProductEntity.getProductId() == null || "".equals(storeOrderProductEntity.getProductId()) || storeOrderProductEntity.getProductId().length() > 18 || Long.parseLong(storeOrderProductEntity.getProductId()) < 0) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductId(storeOrderProductEntity.getProductId()); + } + if (storeOrderProductEntity.getProductNo() != null && storeOrderProductEntity.getProductNo().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductNo(storeOrderProductEntity.getProductNo()); + } + if (storeOrderProductEntity.getProductName() == null || "".equals(storeOrderProductEntity.getProductName()) || storeOrderProductEntity.getProductName().length() > 128) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductName(storeOrderProductEntity.getProductName()); + } + if (storeOrderProductEntity.getProductUnitId() != null && storeOrderProductEntity.getProductUnitId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductUnitId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductUnitId(storeOrderProductEntity.getProductUnitId()); + } + if (storeOrderProductEntity.getProductUnitName() != null && storeOrderProductEntity.getProductUnitName().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductUnitName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductUnitName(storeOrderProductEntity.getProductUnitName()); + } + if (storeOrderProductEntity.getProductImageUrl() != null && storeOrderProductEntity.getProductImageUrl().length() > 256) { + response.setStatus(0); + response.setMessage("门店菜品销售记录ProductImageUrl参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setProductImageUrl(storeOrderProductEntity.getProductImageUrl()); + } + if (storeOrderProductEntity.getTypeId() != null && storeOrderProductEntity.getTypeId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录TypeId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setTypeId(storeOrderProductEntity.getTypeId()); + } + // 2019-05-17补全大类补全的问题 + if (storeOrderProductEntity.getSeriesId() == null || "".equals(storeOrderProductEntity.getSeriesId())) { + String typePath[] = storeOrderProductEntity.getTypePath().split(","); + storeOrderProductEntity.setSeriesId(typePath[0]); + ProductType productType = productTypeService.get(tenantId, typePath[0]); + if (productType != null) { + storeOrderProductEntity.setSeriesName(productType.getName()); + } + } + // ====END + if (storeOrderProductEntity.getSeriesId() != null && storeOrderProductEntity.getSeriesId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SeriesId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSeriesId(storeOrderProductEntity.getSeriesId()); + } + if (storeOrderProductEntity.getSeriesName() != null && storeOrderProductEntity.getSeriesName().length() > 64) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SeriesName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSeriesName(storeOrderProductEntity.getSeriesName()); + } + if (storeOrderProductEntity.getTypePath() != null && storeOrderProductEntity.getTypePath().length() > 256) { + response.setStatus(0); + response.setMessage("门店菜品销售记录TypePath参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setTypePath(storeOrderProductEntity.getTypePath()); + } + if (storeOrderProductEntity.getTypeName() != null && storeOrderProductEntity.getTypeName().length() > 64) { + response.setStatus(0); + response.setMessage("门店菜品销售记录TypeName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setTypeName(storeOrderProductEntity.getTypeName()); + } + if (storeOrderProductEntity.getSpecId() != null && storeOrderProductEntity.getSpecId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SpecId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSpecId(storeOrderProductEntity.getSpecId()); + } + if (storeOrderProductEntity.getSpecName() != null && storeOrderProductEntity.getSpecName().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SpecName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSpecName(storeOrderProductEntity.getSpecName()); + } + storeOrderProduct.setCount(storeOrderProductEntity.getCount()); + storeOrderProduct.setRcount(storeOrderProductEntity.getRcount()); + storeOrderProduct.setPrice(storeOrderProductEntity.getPrice()); + storeOrderProduct.setDiscountPrice(storeOrderProductEntity.getDiscountPrice()); + storeOrderProduct.setPriceOrg(storeOrderProductEntity.getPriceOrg()); + storeOrderProduct.setIsSuit(storeOrderProductEntity.getIsSuit()); + if (storeOrderProductEntity.getSuitId() != null && storeOrderProductEntity.getSuitId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SuitId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSuitId(storeOrderProductEntity.getSuitId()); + } + if (storeOrderProductEntity.getSuitId() != null && storeOrderProductEntity.getSuitId().length() > 32) { + response.setStatus(0); + response.setMessage("门店菜品销售记录SuitId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProduct.setSuitId(storeOrderProductEntity.getSuitId()); + } + storeOrderProduct.setWorkerNo(entity.getWorkNo()); + storeOrderProduct.setSaleDate(entity.getSaleDate());// 订单时间和销售时间一致 + storeOrderProduct.setDeviceName(entity.getDeviceName()); + storeOrderProduct.setDeviceMac(entity.getDeviceMac()); + storeOrderProduct.setDeviceIp(entity.getDeviceIp()); + storeOrderProduct.setPosNo(entity.getPosNo()); + storeOrderProduct.setAmount(storeOrderProductEntity.getAmount()); + storeOrderProduct.setDiscount(storeOrderProductEntity.getDiscount()); + storeOrderProduct.setDiscountTotal(storeOrderProductEntity.getDiscountTotal()); + storeOrderProduct.setReceivable(storeOrderProductEntity.getReceivable()); + storeOrderProduct.setAddPriceTotal(storeOrderProductEntity.getAddPriceTotal()); + storeOrderProduct.setDiscountAddTotal(storeOrderProductEntity.getDiscountAddTotal()); + storeOrderProduct.setAmountAddTotal(storeOrderProductEntity.getAmountAddTotal()); + storeOrderProduct.setAmountTotal(storeOrderProductEntity.getAmountTotal()); + storeOrderProduct.setReceivableTotal(storeOrderProductEntity.getReceivableTotal()); + storeOrderProduct.setIsMember(entity.getIsMember()); + storeOrderProduct.setMemberNo(entity.getMemberNo()); + lineNo++; + storeOrderProduct.setSeqNo(storeBusinessTicket.getSeqNo());// 当日流水号 + storeOrderProduct.setWeather(storeBusinessTicket.getWeather());// 天气 + storeOrderProduct.setWeeker(storeBusinessTicket.getWeeker());// 星期 + storeOrderProduct.setLineNo(storeOrderProductEntity.getLineNo() == null ? lineNo : storeOrderProductEntity.getLineNo());// 行号 + storeOrderProduct.setEstimatedCost(0.00);// 预估成本 + storeOrderProduct.setEstimatedProfitAmount(0.00);// 预估毛利金额 + storeOrderProduct.setEstimatedProfitMargin(0.00);// 预估毛利率 + storeOrderProduct.setTotalCost(0.00);// 实际成本 + storeOrderProduct.setProfitAmount(0.00);// 实际毛利金额 + storeOrderProduct.setProfitMargin(0.00);// 实际毛利率 + orderProductList.add(storeOrderProduct); + List storeOrderProductInfoEntityList = storeOrderProductEntity.getProductInfo(); + // 门店菜品销售记录优惠明细校验开始 + if (storeOrderProductInfoEntityList != null && storeOrderProductInfoEntityList.size() > 0) { + for (VposStoreOrderProductInfoEntity storeOrderProductInfoEntity : storeOrderProductInfoEntityList) { + VposStoreOrderProductInfo storeOrderProductInfo = new VposStoreOrderProductInfo(); + storeOrderProductInfo.setCreateDate(createDate); + storeOrderProductInfo.setCreateUser("open-api"); + if (storeOrderProductInfoEntity.getClientId() == null || "".equals(storeOrderProductInfoEntity.getClientId()) || storeOrderProductInfoEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("销售单记录优惠ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductInfo.setClientId(storeOrderProductInfoEntity.getClientId()); + } + + if (storeOrderProductInfoEntity.getOrderItemId() != null && storeOrderProductInfoEntity.getOrderItemId().length() > 64) { + response.setStatus(0); + response.setMessage("销售单记录优惠OrderItemId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductInfo.setOrderItemId(storeOrderProductInfoEntity.getOrderItemId()); + } + storeOrderProductInfo.setStoreId(entity.getStoreId()); + storeOrderProductInfo.setBusNo(entity.getNo()); + storeOrderProductInfo.setType(storeOrderProductInfoEntity.getType()); + if (storeOrderProductInfoEntity.getInfo() != null && storeOrderProductInfoEntity.getInfo().length() > 256) { + response.setStatus(0); + response.setMessage("销售单优惠记录Info参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductInfo.setInfo(storeOrderProductInfoEntity.getInfo()); + } + storeOrderProductInfo.setDiscountMoney(storeOrderProductInfoEntity.getDiscountMoney()); + storeOrderProductInfo.setSaleDate(entity.getSaleDate()); + orderProductInfoList.add(storeOrderProductInfo); + } + } + List storeOrderProductMakeEntityList = storeOrderProductEntity.getProductMake(); + // 门店菜品做法明细校验开始 + if (storeOrderProductMakeEntityList != null && storeOrderProductMakeEntityList.size() > 0) { + for (VposStoreOrderProductMakeEntity storeOrderProductMakeEntity : storeOrderProductMakeEntityList) { + VposStoreOrderProductMake storeOrderProductMake = new VposStoreOrderProductMake(); + storeOrderProductMake.setCreateDate(createDate); + storeOrderProductMake.setCreateUser("open-api"); + if (storeOrderProductMakeEntity.getClientId() == null || "".equals(storeOrderProductMakeEntity.getClientId()) || storeOrderProductMakeEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("菜品做法ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductMake.setClientId(storeOrderProductMakeEntity.getClientId()); + } + if (storeOrderProductMakeEntity.getOrderItemId() != null && storeOrderProductMakeEntity.getOrderItemId().length() > 64) { + response.setStatus(0); + response.setMessage("菜品做法OrderItemId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductMake.setOrderItemId(storeOrderProductMakeEntity.getOrderItemId()); + } + storeOrderProductMake.setStoreId(entity.getStoreId()); + storeOrderProductMake.setStoreNo(entity.getStoreNo()); + storeOrderProductMake.setStoreName(entity.getStoreName()); + storeOrderProductMake.setBusNo(entity.getNo()); + if (storeOrderProductMakeEntity.getMakeId() != null && storeOrderProductMakeEntity.getMakeId().length() > 32) { + response.setStatus(0); + response.setMessage("菜品做法makeId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductMake.setMakeId(storeOrderProductMakeEntity.getMakeId()); + } + if (storeOrderProductMakeEntity.getMakeName() != null && storeOrderProductMakeEntity.getMakeName().length() > 32) { + response.setStatus(0); + response.setMessage("菜品做法makeName参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storeOrderProductMake.setMakeName(storeOrderProductMakeEntity.getMakeName()); + } + storeOrderProductMake.setAddPrice(storeOrderProductMakeEntity.getAddPrice()); + storeOrderProductMake.setDiscountPrice(storeOrderProductMakeEntity.getDiscountPrice()); + storeOrderProductMake.setCount(storeOrderProductMakeEntity.getCount()); + storeOrderProductMake.setRcount(storeOrderProductMakeEntity.getRcount()); + storeOrderProductMake.setAddTotal(storeOrderProductMakeEntity.getAddTotal()); + storeOrderProductMake.setDiscountAddTotal(storeOrderProductMakeEntity.getDiscountAddTotal()); + storeOrderProductMake.setDiscount(storeOrderProductMakeEntity.getDiscount()); + storeOrderProductMake.setQtyFlag(storeOrderProductMakeEntity.getQtyFlag()); + storeOrderProductMake.setHand(0); + storeOrderProductMake.setSaleDate(entity.getSaleDate()); + makeList.add(storeOrderProductMake); + } + } + } + VposBusinessOrderUpload businessOrderUpload = new VposBusinessOrderUpload(); + businessOrderUpload.setTicket(storeBusinessTicket); + businessOrderUpload.setTicketInfos(ticketInfoList); + businessOrderUpload.setProducts(orderProductList); + businessOrderUpload.setProductInfos(orderProductInfoList); + businessOrderUpload.setMakes(makeList); + StoreBusinessTicketCheck ticketCheck = vposStoreBusinessTicketService.saveBusinessTicket(tenantId, businessOrderUpload); + if ("1".equals(ticketCheck.getStatus())) { + Map data = new HashMap<>(); + data.put("busNo", storeBusinessTicket.getNo()); + data.put("ticketId", ticketCheck.getTicketId()); + response.setStatus(1); + response.setMessage("订单创建成功"); + response.setData(data); + } else { + response.setStatus(0); + response.setMessage("订单创建失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + logger.error("jsonString:" + jsonString); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "vpos.order.pay", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "订单支付信息") + @Override + public Object VposOrderPay(VposOrderPayRequest request) { + String info = "订单支付信息"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + CommonDataResponse response = null; + String storeId = request.getStoreId(); + String ticketId = request.getTicketId(); + String jsonString = request.getJsonString(); + try { + response = new CommonDataResponse(); + JSONObject json = JSONObject.parseObject(jsonString); + VposStorePayEntity storePayEntity = new VposStorePayEntity(json); + VposStoreBusinessTicket enity = vposStoreBusinessTicketService.get(tenantId, ticketId); + if (enity == null) { + response.setStatus(0); + response.setMessage("支付失败,订单不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + String keysuccess = "wxBusNo:" + tenantId + ":" + storeId + ":" + enity.getNo(); + Object busNoValue = cacheService.get(tenantId, keysuccess); + if (busNoValue != null && enity.getNo().equals(busNoValue.toString().split("_")[0])) { + response.setStatus(0); + response.setMessage("订单支付上传失败,订单号已存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + Date createDate = new Date(); + // 门店菜品销售记录优惠明细校验开始 + List payList = new ArrayList<>(); + VposStorePay storePay = new VposStorePay(); + storePay.setCreateDate(createDate); + storePay.setCreateUser("open-api"); + if (storePayEntity.getClientId() == null || "".equals(storePayEntity.getClientId()) || storePayEntity.getClientId().length() > 64) { + response.setStatus(0); + response.setMessage("支付记录ClientId参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setClientId(storePayEntity.getClientId()); + } + storePay.setStoreId(enity.getStoreId()); + storePay.setStoreNo(enity.getStoreNo()); + storePay.setStoreName(enity.getStoreName()); + storePay.setBusNo(enity.getNo()); + storePay.setBusMode(enity.getBusMode()); + if (storePayEntity.getPayNo() == null || "".equals(storePayEntity.getPayNo()) || storePayEntity.getPayNo().length() > 32) { + response.setStatus(0); + response.setMessage("支付记录BusNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setPayNo(storePayEntity.getPayNo()); + } + storePay.setTableNo(enity.getTableNo()); + if (storePayEntity.getPayTypeNo() == null || "".equals(storePayEntity.getPayTypeNo()) || storePayEntity.getPayTypeNo().length() > 32) { + response.setStatus(0); + response.setMessage("支付记录PayTypeNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setPayTypeNo(storePayEntity.getPayTypeNo()); + } + if (storePayEntity.getPayType() != null && storePayEntity.getPayType().length() > 16) { + response.setStatus(0); + response.setMessage("支付记录payType参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setPayType(storePayEntity.getPayType()); + } + storePay.setPaid(storePayEntity.getPaid()); + storePay.setRchange(storePayEntity.getRchange()); + storePay.setMoney(storePayEntity.getMoney()); + storePay.setOverAmount(storePayEntity.getOverAmount()); + storePay.setWorkNo(enity.getWorkNo()); + storePay.setDeviceName(enity.getDeviceName()); + storePay.setDeviceMac(enity.getDeviceMac()); + storePay.setDeviceIp(enity.getDeviceIp()); + storePay.setPosNo(enity.getPosNo()); + if (storePayEntity.getVoucherNo() != null && storePayEntity.getVoucherNo().length() > 128) { + response.setStatus(0); + response.setMessage("支付记录VoucherNo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setVoucherNo(storePayEntity.getVoucherNo()); + } + storePay.setPayDate(enity.getSaleDate());// 订单时间和销售时间一致 + if (storePayEntity.getCardno() != null && storePayEntity.getCardno().length() > 32) { + response.setStatus(0); + response.setMessage("支付记录Cardno参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setCardno(storePayEntity.getCardno()); + } + storePay.setCardYe(storePayEntity.getCardYe()); + storePay.setCardJf(storePayEntity.getCardJf()); + storePay.setIncomeFlag(storePayEntity.getIncomeFlag()); + storePay.setOtherRateType(storePayEntity.getOtherRateType()); + storePay.setOtherRateValue(storePayEntity.getOtherRateValue()); + storePay.setOtherRate(storePayEntity.getOtherRate()); + storePay.setPayChannel(storePayEntity.getPayChannel()); + if (storePayEntity.getMemo() != null && storePayEntity.getMemo().length() > 256) { + response.setStatus(0); + response.setMessage("支付记录Memo参数不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } else { + storePay.setMemo(storePayEntity.getMemo()); + } + logger.error("支付成功:" + storePay.getPaid()); + logger.error("订单金额:" + enity.getReceivable()); + // 校验金额 + // if (enity.getReceivable().equals(storePay.getPaid())) { + // logger.error(info + "支付成功,单订金额不符"); + // response.setStatus(0); + // response.setMessage("支付金额和订单金额不一致"); + // response.setErrCode(CommonErrorCode.error998.getCode()); + // response.setErrMessage(CommonErrorCode.error998.getMessage()); + // return response; + // } + payList.add(storePay); + // 生成取餐号 + DateFormat fmt = new SimpleDateFormat("yyyyMMdd"); + String day = fmt.format(new Date()); + String key = "wxBus:" + tenantId + ":" + storeId + ":" + day; + cacheService.setQueue(tenantId, key, enity.getNo(), 60 * 60 * 24); + int random = (int) (Math.random() * 10 + 1); + String busMode = "T"; + if (enity.getBusMode() == 0) { + busMode = "T"; + } else { + busMode = "W"; + } + String datSeq = busMode + random + String.format("%0" + 5 + "d", cacheService.getQueueSize(tenantId, key)); + logger.error("单号:" + enity.getNo() + "=============>" + datSeq); + enity.setSeqNo(datSeq);// 取餐号 + enity.setStatus(4);// 更改主单为支付成功状态 + enity.setIsMember(1);// 是否使用会员卡 + enity.setMemberNo(storePay.getCardno());// 会员卡号 + enity.setMemberJifen(storePay.getCardJf());// 会员积分 + StoreBusinessTicketCheck ticketCheck = vposStoreBusinessTicketService.updateBusinessTicket(tenantId, enity, payList); + if ("1".equals(ticketCheck.getStatus())) { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("busNo", enity.getNo())); + // 获取主单优惠 + List ticketInfoList = vposStoreBusinessTicketInfoService.getList(tenantId, criteria); + // 获取订单商品信息 + List orderProductList = vposStoreOrderProductService.getList(tenantId, criteria); + // 获取产品优惠信息 + List orderProductInfoList = vposStoreOrderProductInfoService.getList(tenantId, criteria); + // 获取产品做法信息 + List makeList = vposStoreOrderProductMakeService.getList(tenantId, criteria); + // 订单进行分单 + sendMessage(tenantId, storeId, enity, orderProductList, makeList); + try { + // 存储支付成功的Key + cacheService.set(tenantId, keysuccess, enity.getNo() + "_" + datSeq + "_cardPay", 60 * 60 * 24); + // 发送支付成功通知 + Map map = new HashMap<>(); + map.put("type", 1);// 支付成功通知 + map.put("openId", enity.getOpenId());// 用户ID + map.put("busNo", enity.getNo());// 业务单号 + map.put("date", new Date());// 日期 + map.put("amount", enity.getReceivable()); + logger.error("weixinpay/" + tenantId + "/" + storeId + "/" + enity.getOpenId()); + logger.error(JSON.toJSONString(map, SerializerFeature.WriteDateUseDateFormat)); + mqttClient.Publish("weixinpay/" + tenantId + "/" + storeId + "/" + enity.getOpenId(), JSON.toJSONString(map, SerializerFeature.WriteDateUseDateFormat)); + // 将时间改为支付时间 + enity.setSaleDate(createDate); + if (CollectionUtils.isNotEmpty(ticketInfoList)) { + for (VposStoreBusinessTicketInfo vposStoreBusinessTicketInfo : ticketInfoList) { + vposStoreBusinessTicketInfo.setSaleDate(createDate); + } + } + if (CollectionUtils.isNotEmpty(orderProductList)) { + for (VposStoreOrderProduct vposStoreOrderProduct : orderProductList) { + vposStoreOrderProduct.setSaleDate(createDate); + } + } + if (CollectionUtils.isNotEmpty(orderProductInfoList)) { + for (VposStoreOrderProductInfo vposStoreOrderProductInfo : orderProductInfoList) { + vposStoreOrderProductInfo.setSaleDate(createDate); + } + } + if (CollectionUtils.isNotEmpty(makeList)) { + for (VposStoreOrderProductMake vposStoreOrderProductMake : makeList) { + vposStoreOrderProductMake.setSaleDate(createDate); + } + } + // 数据上传 + // 放入消息队列 + Map message = new HashMap<>(); + message.put("type", "businessorderplus"); + message.put("storeBusinessTicket", enity); + message.put("ticketInfoList", ticketInfoList); + message.put("orderProductList", orderProductList); + message.put("orderProductInfoList", orderProductInfoList); + message.put("payList", payList); + message.put("makeList", makeList); + message.put("deliveryList", new ArrayList()); + CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString()); + this.mqMessageSender.send4businessorderplus(tenantId, message, correlationData); + logger.error(info + "销售数据上传发送成功"); + // 支付成功减少库存 + // 放入消息队列 + Map stockMessage = new HashMap<>(); + stockMessage.put("type", "productsalestock"); + stockMessage.put("orderProductList", orderProductList); + CorrelationData correlationData1 = new CorrelationData(UUID.randomUUID().toString()); + this.mqMessageSender.send4productsalestock(tenantId, stockMessage, correlationData1); + logger.error(info + "支付扣减库存发送成功"); + Map data = new HashMap<>(); + data.put("busNo", enity.getNo()); + data.put("ticketId", ticketCheck.getTicketId()); + data.put("seqNo", datSeq); + response.setStatus(1); + response.setMessage("支付上传成功"); + response.setData(data); + } catch (Exception ex) { + logger.error(info + ",发生异常", ex); + logger.error("jsonString:" + jsonString); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + } else { + response.setStatus(0); + response.setMessage("支付上传失败"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + logger.error("jsonString:" + jsonString); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "vpos.barcode.pay", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "POS被扫-聚合统一下单") + @Override + public Object VposBarCodePay(VposBarCodePayRequest request) { + String info = "微信点餐-微信统一下单"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + Double amount = request.getAmount();// 充值金额 + String tradeNo = request.getTradeNo(); + CommonDataResponse response = null; + Map data = new HashMap<>(); + try { + response = new CommonDataResponse(); + Store store = storeService.get(tenantId, storeId); + if (store == null) { + response.setStatus(0); + response.setMessage("erp门店不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + if (amount == null) { + response.setStatus(0); + response.setMessage("参数amount不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + BigDecimal payAmount = new BigDecimal(String.valueOf(amount)); + if (payAmount.compareTo(BigDecimal.ZERO) <= 0) { + response.setStatus(0); + response.setMessage("支付金额非法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + // 获取支付参数 + List parameterList = this.paymentParameterService.getPaymentParameterByStoreId(tenantId, request.getStoreId()); + List> payParamList = new ArrayList<>(); + for (PaymentParameter paymentParameter : parameterList) { + Map map = new HashMap<>(); + map.put("tenantId", paymentParameter.getTenantId()); + map.put("id", paymentParameter.getId()); + map.put("no", paymentParameter.getNo()); + map.put("name", paymentParameter.getName()); + map.put("sign", paymentParameter.getSign()); + Map pbodyMap = JSONUtil.parseObject(paymentParameter.getPbody(), new TypeReference>() { + }); + map.put("pbody", pbodyMap); + map.put("certText", paymentParameter.getCertText()); + if (StringUtils.equalsIgnoreCase("ccb", paymentParameter.getSign())) { + payParamList.add(map); + } else if (StringUtils.equalsIgnoreCase("saobei", paymentParameter.getSign())) { + payParamList.add(map); + } + } + if (CollectionUtils.isEmpty(payParamList)) { + response.setStatus(0); + response.setMessage("尚未配置支付参数"); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + Map payParam = new HashMap(); + payParam = payParamList.get(0); + if (payParam.get("sign").toString().equals("ccb")) { + Map payBoday = (Map) payParam.get("pbody"); + Map paramMap = new LinkedHashMap<>(); + paramMap.put("MERCHANTID", payBoday.get("merchantId").toString());// 商户编号 + paramMap.put("POSID", payBoday.get("posId").toString());// 柜台ID + paramMap.put("BRANCHID", payBoday.get("branchId").toString());// 分行ID + paramMap.put("ORDERID", tradeNo);// 订单号 + paramMap.put("PAYMENT", amount);// 支付金额 + paramMap.put("CURCODE", "01");// 币种 + paramMap.put("TXCODE", "530550");// 由建行统一分配为 530590 + paramMap.put("REMARK1", tenantId);// 备注说明(租户编号) + paramMap.put("REMARK2", storeId);// 备注说明(门店编号) + paramMap.put("RETURNTYPE", "3"); + paramMap.put("TIMEOUT", ""); + paramMap.put("PUB", payBoday.get("secretKey").toString().substring(payBoday.get("secretKey").toString().length() - 30, payBoday.get("secretKey").toString().length())); + String mac = getMac(paramMap); + paramMap.put("MAC", mac);// 签名 + HttpResponse httpResponse = HttpTool.url(payBoday.get("wxgateway").toString()).formCCB(paramMap).post(); + String content = HttpTool.getResponseAsString(httpResponse); + JSONObject jsonObject = JSON.parseObject(content); + logger.error(content); + if (StringUtils.isNotBlank(jsonObject.getString("SUCCESS")) && "true".equals(jsonObject.getString("SUCCESS"))) { + String payUrl = jsonObject.getString("PAYURL"); + httpResponse = HttpTool.url(payUrl).post(); + content = HttpTool.getResponseAsString(httpResponse); + logger.error(content); + jsonObject = JSON.parseObject(content); + if (StringUtils.isNotBlank(jsonObject.getString("SUCCESS")) && "true".equals(jsonObject.getString("SUCCESS"))) { + data.put("type", "ccb");// 聚合支付二维码 + data.put("qrurl", jsonObject.getString("QRURL"));// 聚合支付二维码 + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + } else { + response.setStatus(0); + response.setMessage(jsonObject.getString("ERRMSG")); + } + } else { + response.setStatus(0); + response.setMessage(jsonObject.getString("ERRMSG")); + } + } else if (payParam.get("sign").toString().equals("saobei")) { + Map payBoday = (Map) payParam.get("pbody"); + Map paramMap = new LinkedHashMap<>(); + paramMap.put("attach", tenantId + "_" + storeId + "_" + tradeNo); + paramMap.put("merchant_no", payBoday.get("merchant_no").toString()); + paramMap.put("notify_url", saoBeiPayProperties.getApiUrl()); + paramMap.put("pay_type", "000"); + paramMap.put("pay_ver", "110"); + paramMap.put("service_id", "016"); + paramMap.put("terminal_id", payBoday.get("terminal_id").toString()); + paramMap.put("terminal_time", DateUtils.format(new Date(), "yyyyMMddHHmmss")); + paramMap.put("terminal_trace", tradeNo); + paramMap.put("total_fee", new Double(amount * 100).intValue()); + StringBuffer sb = new StringBuffer(); + Set keySet = paramMap.keySet(); + for (String str : keySet) { + sb.append(str + "=" + paramMap.get(str) + "&"); + } + String signKey = "access_token=" + payBoday.get("signKey").toString(); + sb.append(signKey); + String sign = DigestUtils.MD5(sb.toString()).toLowerCase(); + paramMap.put("key_sign", sign); + Object json = JSON.toJSON(paramMap); + logger.error("扫呗扫码支付=========>预下单请求参数{}", json); + final HttpResponse res = HttpTool.url(payBoday.get("gatewayUrl").toString() + "pay/110/qrpay").contentType("application/json").body(json.toString()).post(); + final String content = HttpTool.getResponseAsString(res); + logger.error("扫呗扫码支付=========>预下单响应参数{}", content); + JSONObject parseObject = JSON.parseObject(content); + String return_code = parseObject.getString("return_code"); + String return_msg = parseObject.getString("return_msg"); + String result_code = parseObject.getString("result_code"); + if (return_code.equals("01") && result_code.equals("01")) { + String merchant_name = parseObject.getString("merchant_name"); + String merchant_no = parseObject.getString("merchant_no"); + String terminal_id = parseObject.getString("terminal_id"); + String terminal_trace = parseObject.getString("terminal_trace"); + String terminal_time = parseObject.getString("terminal_time"); + String total_fee = parseObject.getString("total_fee"); + String out_trade_no = parseObject.getString("out_trade_no"); + String qr_url = parseObject.getString("qr_url"); + data.put("type", "saobei");// 聚合支付二维码 + data.put("qrurl", qr_url);// 聚合支付二维码 + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + } else { + response.setStatus(0); + response.setMessage(return_msg); + } + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "vpos.barcode.pay2", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "POS被扫-聚合统一下单,建行支付分账接口") + @Override + public Object VposBarCodePayWithCcbfz(VposBarCodePayRequest request) { + String info = "POS被扫-聚合统一下单,建行支付分账接口"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + Double amount = request.getAmount();// 充值金额 + String tradeNo = request.getTradeNo(); + CommonDataResponse response = null; + Map data = new HashMap<>(); + try { + response = new CommonDataResponse(); + Store store = storeService.get(tenantId, storeId); + if (store == null) { + response.setStatus(0); + response.setMessage("erp门店不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + if (amount == null) { + response.setStatus(0); + response.setMessage("参数amount不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + BigDecimal payAmount = new BigDecimal(String.valueOf(amount)); + if (payAmount.compareTo(BigDecimal.ZERO) <= 0) { + response.setStatus(0); + response.setMessage("支付金额非法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + // 获取支付参数 + List parameterList = this.paymentParameterService.getPaymentParameterByStoreId(tenantId, request.getStoreId()); + List> payParamList = new ArrayList<>(); + for (PaymentParameter paymentParameter : parameterList) { + Map map = new HashMap<>(); + map.put("tenantId", paymentParameter.getTenantId()); + map.put("id", paymentParameter.getId()); + map.put("no", paymentParameter.getNo()); + map.put("name", paymentParameter.getName()); + map.put("sign", paymentParameter.getSign()); + Map pbodyMap = JSONUtil.parseObject(paymentParameter.getPbody(), new TypeReference>() { + }); + map.put("pbody", pbodyMap); + map.put("certText", paymentParameter.getCertText()); + if (StringUtils.equalsIgnoreCase("ccb", paymentParameter.getSign())) { + payParamList.add(map); + } else if (StringUtils.equalsIgnoreCase("saobei", paymentParameter.getSign())) { + payParamList.add(map); + } + } + if (CollectionUtils.isEmpty(payParamList)) { + response.setStatus(0); + response.setMessage("尚未配置支付参数"); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + Map payParam = new HashMap(); + payParam = payParamList.get(0); + if (payParam.get("sign").toString().equals("ccb")) { + + Map payBoday = (Map) payParam.get("pbody"); + if(payBoday.get("ccbfz") != null && "1".equals(payBoday.get("ccbfz").toString())){ + //分账账户信息 + List accounts = vposCcbfzAccountService.getList(tenantId,new Criteria()); + if(CollectionUtils.isNotEmpty(accounts)){ + Map productTypeIdAccountIdMap = new HashMap<>(); + Map accountIdAccountMap = new HashMap<>(); + for(VposCcbfzAccount account : accounts){ + String[] seriesIdArr = account.getSeriesId().split(","); + for(String sereisId : seriesIdArr){ + productTypeIdAccountIdMap.put(sereisId,account.getId()); + } + accountIdAccountMap.put(account.getId(),account); + } + //查询明细,计算分账金额; + Criteria criter = new Criteria(); + criter.add(Restrictions.eq("busNo",tradeNo)); + List orderProducts = vposStoreOrderProductService.getList(tenantId,criter); + if(CollectionUtils.isNotEmpty(orderProducts)) { + Map accountAmountMap = new HashMap<>(); + for (VposStoreOrderProduct orderProduct : orderProducts) { + Double receivableTotal = orderProduct.getReceivableTotal(); + String seriesId = orderProduct.getSeriesId(); + String accountId = productTypeIdAccountIdMap.get(seriesId); + if (accountAmountMap.containsKey(accountId)) { + Double money = accountAmountMap.get(accountId) + receivableTotal; + accountAmountMap.put(accountId, money); + } else { + accountAmountMap.put(accountId, receivableTotal); + } + } + + if(accountAmountMap.size() <= 5) { + String fzInfo = payBoday.get("accountTypeCode").toString() + "!"; + for (String key : accountAmountMap.keySet()) { + Double fzMoney = accountAmountMap.get(key); + VposCcbfzAccount account = accountIdAccountMap.get(key); + fzInfo += account.getReceiveNoType() + "^" + account.getReceiveNo() + "^" + (account.getAcountType() == null ? "" : account.getAcountType()) + "^" + "^" + fzMoney + "^" + account.getRefundSign(); + fzInfo += "#"; + } + fzInfo = escape(fzInfo); + + //System.out.println("fzInfo >>>>>>>>> "+fzInfo); + + Map fzParamMap = new LinkedHashMap<>(); + fzParamMap.put("MERCHANTID", payBoday.get("merchantId").toString());// 商户编号 + fzParamMap.put("POSID", payBoday.get("posId").toString());// 柜台ID + fzParamMap.put("BRANCHID", payBoday.get("branchId").toString());// 分行ID + fzParamMap.put("ORDERID", tradeNo);// 订单号 + fzParamMap.put("PAYMENT", amount);// 支付金额 + fzParamMap.put("CURCODE", "01");// 币种 + fzParamMap.put("TXCODE", "PAY4FZ");// 分账 + fzParamMap.put("FZINFO1", fzInfo);// 分账信息; + fzParamMap.put("PUB", payBoday.get("secretKey").toString().substring(payBoday.get("secretKey").toString().length() - 30, payBoday.get("secretKey").toString().length())); + + String mac = getMacs(fzParamMap); + fzParamMap.put("MAC", mac);// 签名 + HttpResponse httpResponse = HttpTool.url(payBoday.get("wxgateway").toString()).formCCB(fzParamMap).post(); + String content = HttpTool.getResponseAsString(httpResponse); + JSONObject jsonObject = JSON.parseObject(content); + logger.error(content); + if (StringUtils.isNotBlank(jsonObject.getString("SUCCESS")) && "true".equals(jsonObject.getString("SUCCESS"))) { + String payUrl = jsonObject.getString("PAYURL"); + httpResponse = HttpTool.url(payUrl).post(); + content = HttpTool.getResponseAsString(httpResponse); + logger.error(content); + jsonObject = JSON.parseObject(content); + if (StringUtils.isNotBlank(jsonObject.getString("SUCCESS")) && "true".equals(jsonObject.getString("SUCCESS")) + && StringUtils.isNotBlank(jsonObject.getString("ERRCODE")) && "000000".equals(jsonObject.getString("ERRCODE"))) { + + Map paramMap = new LinkedHashMap<>(); + paramMap.put("MERCHANTID", payBoday.get("merchantId").toString());// 商户编号 + paramMap.put("POSID", payBoday.get("posId").toString());// 柜台ID + paramMap.put("BRANCHID", payBoday.get("branchId").toString());// 分行ID + paramMap.put("ORDERID", tradeNo);// 订单号 + paramMap.put("PAYMENT", amount);// 支付金额 + paramMap.put("CURCODE", "01");// 币种 + paramMap.put("TXCODE", "530550");// 由建行统一分配为 530590 + paramMap.put("REMARK1", tenantId);// 备注说明(租户编号) + paramMap.put("REMARK2", storeId);// 备注说明(门店编号) + paramMap.put("RETURNTYPE", "3"); + paramMap.put("TIMEOUT", ""); + paramMap.put("PUB", payBoday.get("secretKey").toString().substring(payBoday.get("secretKey").toString().length() - 30, payBoday.get("secretKey").toString().length())); + mac = getMac(paramMap); + paramMap.put("MAC", mac);// 签名 + httpResponse = HttpTool.url(payBoday.get("wxgateway").toString()).formCCB(paramMap).post(); + content = HttpTool.getResponseAsString(httpResponse); + jsonObject = JSON.parseObject(content); + logger.error(content); + if (StringUtils.isNotBlank(jsonObject.getString("SUCCESS")) && "true".equals(jsonObject.getString("SUCCESS"))) { + payUrl = jsonObject.getString("PAYURL"); + httpResponse = HttpTool.url(payUrl).post(); + content = HttpTool.getResponseAsString(httpResponse); + logger.error(content); + jsonObject = JSON.parseObject(content); + if (StringUtils.isNotBlank(jsonObject.getString("SUCCESS")) && "true".equals(jsonObject.getString("SUCCESS"))) { + data.put("type", "ccb");// 聚合支付二维码 + data.put("qrurl", jsonObject.getString("QRURL"));// 聚合支付二维码 + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + } else { + response.setStatus(0); + response.setMessage(jsonObject.getString("ERRMSG")); + } + } else { + response.setStatus(0); + response.setMessage(jsonObject.getString("ERRMSG")); + } + + }else{ + response.setStatus(0); + response.setMessage(jsonObject.getString("ERRMSG")); + } + + }else{ + response.setStatus(0); + response.setMessage(jsonObject.getString("ERRMSG")); + } + }else{ + response.setStatus(0); + response.setMessage("分账账户数量超过最大值"); + return response; + } + }else{ + response.setStatus(0); + response.setMessage("未查到订单明细"); + return response; + } + + }else{ + response.setStatus(0); + response.setMessage("未查到分账账户信息"); + return response; + } + }else{ + Map paramMap = new LinkedHashMap<>(); + paramMap.put("MERCHANTID", payBoday.get("merchantId").toString());// 商户编号 + paramMap.put("POSID", payBoday.get("posId").toString());// 柜台ID + paramMap.put("BRANCHID", payBoday.get("branchId").toString());// 分行ID + paramMap.put("ORDERID", tradeNo);// 订单号 + paramMap.put("PAYMENT", amount);// 支付金额 + paramMap.put("CURCODE", "01");// 币种 + paramMap.put("TXCODE", "530550");// 由建行统一分配为 530590 + paramMap.put("REMARK1", tenantId);// 备注说明(租户编号) + paramMap.put("REMARK2", storeId);// 备注说明(门店编号) + paramMap.put("RETURNTYPE", "3"); + paramMap.put("TIMEOUT", ""); + paramMap.put("PUB", payBoday.get("secretKey").toString().substring(payBoday.get("secretKey").toString().length() - 30, payBoday.get("secretKey").toString().length())); + String mac = getMac(paramMap); + paramMap.put("MAC", mac);// 签名 + HttpResponse httpResponse = HttpTool.url(payBoday.get("wxgateway").toString()).formCCB(paramMap).post(); + String content = HttpTool.getResponseAsString(httpResponse); + JSONObject jsonObject = JSON.parseObject(content); + logger.error(content); + if (StringUtils.isNotBlank(jsonObject.getString("SUCCESS")) && "true".equals(jsonObject.getString("SUCCESS"))) { + String payUrl = jsonObject.getString("PAYURL"); + httpResponse = HttpTool.url(payUrl).post(); + content = HttpTool.getResponseAsString(httpResponse); + logger.error(content); + jsonObject = JSON.parseObject(content); + if (StringUtils.isNotBlank(jsonObject.getString("SUCCESS")) && "true".equals(jsonObject.getString("SUCCESS"))) { + data.put("type", "ccb");// 聚合支付二维码 + data.put("qrurl", jsonObject.getString("QRURL"));// 聚合支付二维码 + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + } else { + response.setStatus(0); + response.setMessage(jsonObject.getString("ERRMSG")); + } + } else { + response.setStatus(0); + response.setMessage(jsonObject.getString("ERRMSG")); + } + } + } else if (payParam.get("sign").toString().equals("saobei")) { + Map payBoday = (Map) payParam.get("pbody"); + Map paramMap = new LinkedHashMap<>(); + paramMap.put("attach", tenantId + "_" + storeId + "_" + tradeNo); + paramMap.put("merchant_no", payBoday.get("merchant_no").toString()); + paramMap.put("notify_url", saoBeiPayProperties.getApiUrl()); + paramMap.put("pay_type", "000"); + paramMap.put("pay_ver", "110"); + paramMap.put("service_id", "016"); + paramMap.put("terminal_id", payBoday.get("terminal_id").toString()); + paramMap.put("terminal_time", DateUtils.format(new Date(), "yyyyMMddHHmmss")); + paramMap.put("terminal_trace", tradeNo); + paramMap.put("total_fee", new Double(amount * 100).intValue()); + StringBuffer sb = new StringBuffer(); + Set keySet = paramMap.keySet(); + for (String str : keySet) { + sb.append(str + "=" + paramMap.get(str) + "&"); + } + String signKey = "access_token=" + payBoday.get("signKey").toString(); + sb.append(signKey); + String sign = DigestUtils.MD5(sb.toString()).toLowerCase(); + paramMap.put("key_sign", sign); + Object json = JSON.toJSON(paramMap); + logger.error("扫呗扫码支付=========>预下单请求参数{}", json); + final HttpResponse res = HttpTool.url(payBoday.get("gatewayUrl").toString() + "pay/110/qrpay").contentType("application/json").body(json.toString()).post(); + final String content = HttpTool.getResponseAsString(res); + logger.error("扫呗扫码支付=========>预下单响应参数{}", content); + JSONObject parseObject = JSON.parseObject(content); + String return_code = parseObject.getString("return_code"); + String return_msg = parseObject.getString("return_msg"); + String result_code = parseObject.getString("result_code"); + if (return_code.equals("01") && result_code.equals("01")) { + String merchant_name = parseObject.getString("merchant_name"); + String merchant_no = parseObject.getString("merchant_no"); + String terminal_id = parseObject.getString("terminal_id"); + String terminal_trace = parseObject.getString("terminal_trace"); + String terminal_time = parseObject.getString("terminal_time"); + String total_fee = parseObject.getString("total_fee"); + String out_trade_no = parseObject.getString("out_trade_no"); + String qr_url = parseObject.getString("qr_url"); + data.put("type", "saobei");// 聚合支付二维码 + data.put("qrurl", qr_url);// 聚合支付二维码 + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + } else { + response.setStatus(0); + response.setMessage(return_msg); + } + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + + /** + * 微信小程序统一下单建行支付支持分账支付 + */ + @ServiceMethod(method = "vpos.weixin.pay", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "微信小程序统一下单建行支付支持分账支付") + @Override + public Object VposWeixinPayWithCcbfz(VposWeixinPayRequest request) { + String info = "微信小程序统一下单建行支付支持分账支付"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String appId = request.getAppid();// + String openId = request.getOpenId();// 来源标识 + Double amount = request.getAmount();// 充值金额 + String tradeNo = request.getTradeNo(); + CommonDataResponse response = null; + Map data = new HashMap<>(); + try { + response = new CommonDataResponse(); + Store store = storeService.get(tenantId, storeId); + if (store == null) { + response.setStatus(0); + response.setMessage("erp门店不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + if (amount == null) { + response.setStatus(0); + response.setMessage("参数amount不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + BigDecimal payAmount = new BigDecimal(String.valueOf(amount)); + if (payAmount.compareTo(BigDecimal.ZERO) <= 0) { + response.setStatus(0); + response.setMessage("支付金额非法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + // 获取支付参数 + List parameterList = this.paymentParameterService.getPaymentParameterByStoreId(tenantId, request.getStoreId()); + List> payParamList = new ArrayList<>(); + for (PaymentParameter paymentParameter : parameterList) { + Map map = new HashMap<>(); + map.put("tenantId", paymentParameter.getTenantId()); + map.put("id", paymentParameter.getId()); + map.put("no", paymentParameter.getNo()); + map.put("name", paymentParameter.getName()); + map.put("sign", paymentParameter.getSign()); + Map pbodyMap = JSONUtil.parseObject(paymentParameter.getPbody(), new TypeReference>() { + }); + map.put("pbody", pbodyMap); + map.put("certText", paymentParameter.getCertText()); + if (StringUtils.equalsIgnoreCase("ccb", paymentParameter.getSign())) { + payParamList.add(map); + } else if (StringUtils.equalsIgnoreCase("saobei", paymentParameter.getSign())) { + payParamList.add(map); + } + } + if (CollectionUtils.isEmpty(payParamList)) { + response.setStatus(0); + response.setMessage("尚未配置支付参数"); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + Map payParam = new HashMap(); + payParam = payParamList.get(0); + if (payParam.get("sign").toString().equals("ccb")) { + Map payBoday = (Map) payParam.get("pbody"); + if(payBoday.get("ccbfz") != null && "1".equals(payBoday.get("ccbfz").toString())){ + //分账账户信息 + List accounts = vposCcbfzAccountService.getList(tenantId,new Criteria()); + if(CollectionUtils.isNotEmpty(accounts)){ + Map productTypeIdAccountIdMap = new HashMap<>(); + Map accountIdAccountMap = new HashMap<>(); + for(VposCcbfzAccount account : accounts){ + String[] seriesIdArr = account.getSeriesId().split(","); + for(String sereisId : seriesIdArr){ + productTypeIdAccountIdMap.put(sereisId,account.getId()); + } + accountIdAccountMap.put(account.getId(),account); + } + //查询明细,计算分账金额; + Criteria criter = new Criteria(); + criter.add(Restrictions.eq("busNo",tradeNo)); + List orderProducts = vposStoreOrderProductService.getList(tenantId,criter); + if(CollectionUtils.isNotEmpty(orderProducts)){ + Map accountAmountMap = new HashMap<>(); + for(VposStoreOrderProduct orderProduct : orderProducts){ + Double receivableTotal = orderProduct.getReceivableTotal(); + String seriesId = orderProduct.getSeriesId(); + String accountId = productTypeIdAccountIdMap.get(seriesId); + if(accountAmountMap.containsKey(accountId)){ + Double money = accountAmountMap.get(accountId)+receivableTotal; + accountAmountMap.put(accountId,money); + }else{ + accountAmountMap.put(accountId,receivableTotal); + } + } + if(accountAmountMap.size() <= 5){ + String fzInfo = payBoday.get("accountTypeCode").toString()+"!"; + for(String key : accountAmountMap.keySet()){ + Double fzMoney = accountAmountMap.get(key); + VposCcbfzAccount account = accountIdAccountMap.get(key); + fzInfo+=account.getReceiveNoType()+"^"+account.getReceiveNo()+"^"+(account.getAcountType() == null ? "" : account.getAcountType())+"^"+"^"+fzMoney+"^"+account.getRefundSign(); + fzInfo+="#"; + } + //System.out.println("fzInfo before >>>>>>>>> "+fzInfo); + fzInfo = escape(fzInfo); + //System.out.println("fzInfo after >>>>>>>>> "+fzInfo); + + Map fzParamMap = new LinkedHashMap<>(); + fzParamMap.put("MERCHANTID", payBoday.get("merchantId").toString());// 商户编号 + fzParamMap.put("POSID", payBoday.get("posId").toString());// 柜台ID + fzParamMap.put("BRANCHID", payBoday.get("branchId").toString());// 分行ID + fzParamMap.put("ORDERID", tradeNo);// 订单号 + fzParamMap.put("PAYMENT", amount);// 支付金额 + fzParamMap.put("CURCODE", "01");// 币种 + fzParamMap.put("TXCODE", "PAY4FZ");// 分账 + fzParamMap.put("FZINFO1", fzInfo);// 分账信息; + fzParamMap.put("PUB", payBoday.get("secretKey").toString().substring(payBoday.get("secretKey").toString().length() - 30, payBoday.get("secretKey").toString().length())); + //System.out.println(" PUB >>>>>>>>> "+payBoday.get("secretKey").toString().substring(payBoday.get("secretKey").toString().length() - 30, payBoday.get("secretKey").toString().length())); + String mac = getMacs(fzParamMap); + fzParamMap.put("MAC", mac);// 签名 + fzParamMap.remove("PUB"); + + //System.out.println(" fzParamMap >>>>>>>>> "+JSON.toJSONString(fzParamMap)); + + HttpResponse httpResponse = HttpTool.url(payBoday.get("wxgateway").toString()).formCCB(fzParamMap).post(); + //System.out.println(" httpResponse >>>>>>>>> "); + String content = HttpTool.getResponseAsString(httpResponse); + JSONObject jsonObject = JSON.parseObject(content); + logger.error(content); + //System.out.println(" content >>>>>>>>> "+content); + if (StringUtils.isNotBlank(jsonObject.getString("SUCCESS")) && "true".equals(jsonObject.getString("SUCCESS"))) { + String payUrl = jsonObject.getString("PAYURL"); + httpResponse = HttpTool.url(payUrl).post(); + content = HttpTool.getResponseAsString(httpResponse); + //System.out.println(" PAYURL content >>>>>>>>> "+content); + logger.error(content); + jsonObject = JSON.parseObject(content); + if (StringUtils.isNotBlank(jsonObject.getString("SUCCESS")) && "true".equals(jsonObject.getString("SUCCESS")) + && StringUtils.isNotBlank(jsonObject.getString("ERRCODE")) && "000000".equals(jsonObject.getString("ERRCODE"))) { + Map paramMap = new LinkedHashMap<>(); + paramMap.put("MERCHANTID", payBoday.get("merchantId").toString());// 商户编号 + paramMap.put("POSID", payBoday.get("posId").toString());// 柜台ID + paramMap.put("BRANCHID", payBoday.get("branchId").toString());// 分行ID + paramMap.put("ORDERID", tradeNo);// 订单号 + paramMap.put("PAYMENT", amount);// 支付金额 + paramMap.put("CURCODE", "01");// 币种 + paramMap.put("TXCODE", "530590");// 由建行统一分配为 530590 + paramMap.put("REMARK1", tenantId);// 备注说明(租户编号) + paramMap.put("REMARK2", storeId);// 备注说明(门店编号) + paramMap.put("TYPE", "1");// 防钓鱼接口 + paramMap.put("PUB", payBoday.get("secretKey").toString().substring(payBoday.get("secretKey").toString().length() - 30, payBoday.get("secretKey").toString().length())); + paramMap.put("GATEWAY", "0"); + paramMap.put("CLIENTIP", "127.0.0.1"); + paramMap.put("REGINFO", ""); + paramMap.put("PROINFO", ""); + paramMap.put("REFERER", ""); + paramMap.put("TRADE_TYPE", "MINIPRO");// 小程序支付 + paramMap.put("SUB_APPID", appId);// 小程序APPID + paramMap.put("SUB_OPENID", openId);// 用户子标识 + mac = getMac(paramMap); + paramMap.put("MAC", mac);// 签名 + httpResponse = HttpTool.url(payBoday.get("wxgateway").toString()).formCCB(paramMap).post(); + content = HttpTool.getResponseAsString(httpResponse); + jsonObject = JSON.parseObject(content); + logger.error(content); + if (StringUtils.isNotBlank(jsonObject.getString("SUCCESS")) && "true".equals(jsonObject.getString("SUCCESS"))) { + payUrl = jsonObject.getString("PAYURL"); + httpResponse = HttpTool.url(payUrl).post(); + content = HttpTool.getResponseAsString(httpResponse); + logger.error(content); + jsonObject = JSON.parseObject(content); + if (StringUtils.isNotBlank(jsonObject.getString("SUCCESS")) && "true".equals(jsonObject.getString("SUCCESS")) && StringUtils.isNotBlank(jsonObject.getString("ERRCODE")) && "000000".equals(jsonObject.getString("ERRCODE"))) { + data.put("appId", jsonObject.getString("appId"));// 微信分配的 + // APPID + data.put("timeStamp", jsonObject.getString("timeStamp"));// 时间戳 + data.put("nonceStr", jsonObject.getString("nonceStr"));// 随机串 + data.put("package", jsonObject.getString("package"));// 数据包 + data.put("signType", jsonObject.getString("signType"));// 签名方式 + data.put("paySign", jsonObject.getString("paySign"));// 签名数据 + data.put("partnerid", jsonObject.getString("partnerid"));// 子商户的商户号 + data.put("prepayid", jsonObject.getString("prepayid"));// 预支付交易会话ID + data.put("mweb_url", jsonObject.getString("mweb_url"));// 微信 + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + } else { + response.setStatus(0); + response.setMessage(jsonObject.getString("ERRMSG")); + } + } else { + response.setStatus(0); + response.setMessage(jsonObject.getString("ERRMSG")); + } + }else{ + response.setStatus(0); + response.setMessage(jsonObject.getString("ERRMSG")); + } + }else{ + response.setStatus(0); + response.setMessage(jsonObject.getString("ERRMSG")); + } + + }else{ + response.setStatus(0); + response.setMessage("分账账户超过最大数量"); + return response; + } + + }else{ + response.setStatus(0); + response.setMessage("未查到订单明细"); + return response; + } + }else{ + response.setStatus(0); + response.setMessage("未查到分账账户信息"); + return response; + } + }else{ + Map paramMap = new LinkedHashMap<>(); + paramMap.put("MERCHANTID", payBoday.get("merchantId").toString());// 商户编号 + paramMap.put("POSID", payBoday.get("posId").toString());// 柜台ID + paramMap.put("BRANCHID", payBoday.get("branchId").toString());// 分行ID + paramMap.put("ORDERID", tradeNo);// 订单号 + paramMap.put("PAYMENT", amount);// 支付金额 + paramMap.put("CURCODE", "01");// 币种 + paramMap.put("TXCODE", "530590");// 由建行统一分配为 530590 + paramMap.put("REMARK1", tenantId);// 备注说明(租户编号) + paramMap.put("REMARK2", storeId);// 备注说明(门店编号) + paramMap.put("TYPE", "1");// 防钓鱼接口 + paramMap.put("PUB", payBoday.get("secretKey").toString().substring(payBoday.get("secretKey").toString().length() - 30, payBoday.get("secretKey").toString().length())); + paramMap.put("GATEWAY", "0"); + paramMap.put("CLIENTIP", "127.0.0.1"); + paramMap.put("REGINFO", ""); + paramMap.put("PROINFO", ""); + paramMap.put("REFERER", ""); + paramMap.put("TRADE_TYPE", "MINIPRO");// 小程序支付 + paramMap.put("SUB_APPID", appId);// 小程序APPID + paramMap.put("SUB_OPENID", openId);// 用户子标识 + String mac = getMac(paramMap); + paramMap.put("MAC", mac);// 签名 + HttpResponse httpResponse = HttpTool.url(payBoday.get("wxgateway").toString()).formCCB(paramMap).post(); + String content = HttpTool.getResponseAsString(httpResponse); + JSONObject jsonObject = JSON.parseObject(content); + logger.error(content); + if (StringUtils.isNotBlank(jsonObject.getString("SUCCESS")) && "true".equals(jsonObject.getString("SUCCESS"))) { + String payUrl = jsonObject.getString("PAYURL"); + httpResponse = HttpTool.url(payUrl).post(); + content = HttpTool.getResponseAsString(httpResponse); + logger.error(content); + jsonObject = JSON.parseObject(content); + if (StringUtils.isNotBlank(jsonObject.getString("SUCCESS")) && "true".equals(jsonObject.getString("SUCCESS")) && StringUtils.isNotBlank(jsonObject.getString("ERRCODE")) && "000000".equals(jsonObject.getString("ERRCODE"))) { + data.put("appId", jsonObject.getString("appId"));// 微信分配的 + // APPID + data.put("timeStamp", jsonObject.getString("timeStamp"));// 时间戳 + data.put("nonceStr", jsonObject.getString("nonceStr"));// 随机串 + data.put("package", jsonObject.getString("package"));// 数据包 + data.put("signType", jsonObject.getString("signType"));// 签名方式 + data.put("paySign", jsonObject.getString("paySign"));// 签名数据 + data.put("partnerid", jsonObject.getString("partnerid"));// 子商户的商户号 + data.put("prepayid", jsonObject.getString("prepayid"));// 预支付交易会话ID + data.put("mweb_url", jsonObject.getString("mweb_url"));// 微信 + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + } else { + response.setStatus(0); + response.setMessage(jsonObject.getString("ERRMSG")); + } + } else { + response.setStatus(0); + response.setMessage(jsonObject.getString("ERRMSG")); + } + } + } else if (payParam.get("sign").toString().equals("saobei")) { + Map payBoday = (Map) payParam.get("pbody"); + Map paramMap = new LinkedHashMap<>(); + paramMap.put("pay_ver", "100"); + paramMap.put("pay_type", "010"); + paramMap.put("service_id", "015"); + paramMap.put("merchant_no", payBoday.get("merchant_no").toString()); + paramMap.put("terminal_id", payBoday.get("terminal_id").toString()); + paramMap.put("terminal_trace", tradeNo); + paramMap.put("terminal_time", DateUtils.format(new Date(), "yyyyMMddHHmmss")); + paramMap.put("total_fee", new Double(amount * 100).intValue()); + StringBuffer sb = new StringBuffer(); + Set keySet = paramMap.keySet(); + for (String str : keySet) { + sb.append(str + "=" + paramMap.get(str) + "&"); + } + String signKey = "access_token=" + payBoday.get("signKey").toString(); + sb.append(signKey); + String sign = DigestUtils.MD5(sb.toString()).toLowerCase(); + paramMap.put("sub_appid", appId); + paramMap.put("open_id", openId); + paramMap.put("order_body", store.getName() + "线上支付"); + paramMap.put("notify_url", saoBeiPayProperties.getApiUrl()); + paramMap.put("attach", tenantId + "_" + storeId + "_" + tradeNo); + paramMap.put("key_sign", sign); + Object json = JSON.toJSON(paramMap); + logger.error("扫呗支付=========>预下单请求参数{}", json); + final HttpResponse res = HttpTool.url(payBoday.get("gatewayUrl").toString() + "pay/100/minipay").contentType("application/json").body(json.toString()).post(); + final String content = HttpTool.getResponseAsString(res); + logger.error("扫呗支付=========>预下单响应参数{}", content); + JSONObject parseObject = JSON.parseObject(content); + String return_code = parseObject.getString("return_code"); + String result_code = parseObject.getString("result_code"); + String return_msg = parseObject.getString("return_msg"); + if (return_code.equals("01") && result_code.equals("01")) { + Map prepay = new HashMap<>(); + prepay.put("appId", parseObject.getString("appId")); + prepay.put("timeStamp", parseObject.getString("timeStamp")); + prepay.put("nonceStr", parseObject.getString("nonceStr")); + prepay.put("package", parseObject.getString("package_str")); + prepay.put("signType", parseObject.getString("signType")); + prepay.put("paySign", parseObject.getString("paySign")); + // 扫呗商户号 + prepay.put("outTradeNo", parseObject.getString("terminal_trace"));// 商户订单号 + prepay.put("saobeiOrderNo", parseObject.getString("out_trade_no"));// 扫呗唯一订单号 + response.setData(prepay); + response.setStatus(1); + response.setMessage("操作成功"); + } else { + response.setStatus(0); + response.setMessage(return_msg); + } + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + + /** + * 美食广场支付统一下单接口 + */ + @ServiceMethod(method = "vpos.weixin.pay2", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "微信点餐-微信统一下单") + @Override + public Object VposWeixinPay(VposWeixinPayRequest request) { + String info = "微信点餐-微信统一下单"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String appId = request.getAppid();// + String openId = request.getOpenId();// 来源标识 + Double amount = request.getAmount();// 充值金额 + String tradeNo = request.getTradeNo(); + CommonDataResponse response = null; + Map data = new HashMap<>(); + try { + response = new CommonDataResponse(); + Store store = storeService.get(tenantId, storeId); + if (store == null) { + response.setStatus(0); + response.setMessage("erp门店不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + if (amount == null) { + response.setStatus(0); + response.setMessage("参数amount不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + BigDecimal payAmount = new BigDecimal(String.valueOf(amount)); + if (payAmount.compareTo(BigDecimal.ZERO) <= 0) { + response.setStatus(0); + response.setMessage("支付金额非法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + // 获取支付参数 + List parameterList = this.paymentParameterService.getPaymentParameterByStoreId(tenantId, request.getStoreId()); + List> payParamList = new ArrayList<>(); + for (PaymentParameter paymentParameter : parameterList) { + Map map = new HashMap<>(); + map.put("tenantId", paymentParameter.getTenantId()); + map.put("id", paymentParameter.getId()); + map.put("no", paymentParameter.getNo()); + map.put("name", paymentParameter.getName()); + map.put("sign", paymentParameter.getSign()); + Map pbodyMap = JSONUtil.parseObject(paymentParameter.getPbody(), new TypeReference>() { + }); + map.put("pbody", pbodyMap); + map.put("certText", paymentParameter.getCertText()); + if (StringUtils.equalsIgnoreCase("ccb", paymentParameter.getSign())) { + payParamList.add(map); + } else if (StringUtils.equalsIgnoreCase("saobei", paymentParameter.getSign())) { + payParamList.add(map); + } + } + if (CollectionUtils.isEmpty(payParamList)) { + response.setStatus(0); + response.setMessage("尚未配置支付参数"); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + Map payParam = new HashMap(); + payParam = payParamList.get(0); + if (payParam.get("sign").toString().equals("ccb")) { + Map payBoday = (Map) payParam.get("pbody"); + Map paramMap = new LinkedHashMap<>(); + paramMap.put("MERCHANTID", payBoday.get("merchantId").toString());// 商户编号 + paramMap.put("POSID", payBoday.get("posId").toString());// 柜台ID + paramMap.put("BRANCHID", payBoday.get("branchId").toString());// 分行ID + paramMap.put("ORDERID", tradeNo);// 订单号 + paramMap.put("PAYMENT", amount);// 支付金额 + paramMap.put("CURCODE", "01");// 币种 + paramMap.put("TXCODE", "530590");// 由建行统一分配为 530590 + paramMap.put("REMARK1", tenantId);// 备注说明(租户编号) + paramMap.put("REMARK2", storeId);// 备注说明(门店编号) + paramMap.put("TYPE", "1");// 防钓鱼接口 + paramMap.put("PUB", payBoday.get("secretKey").toString().substring(payBoday.get("secretKey").toString().length() - 30, payBoday.get("secretKey").toString().length())); + paramMap.put("GATEWAY", "0"); + paramMap.put("CLIENTIP", "127.0.0.1"); + paramMap.put("REGINFO", ""); + paramMap.put("PROINFO", ""); + paramMap.put("REFERER", ""); + paramMap.put("TRADE_TYPE", "MINIPRO");// 小程序支付 + paramMap.put("SUB_APPID", appId);// 小程序APPID + paramMap.put("SUB_OPENID", openId);// 用户子标识 + String mac = getMac(paramMap); + paramMap.put("MAC", mac);// 签名 + HttpResponse httpResponse = HttpTool.url(payBoday.get("wxgateway").toString()).formCCB(paramMap).post(); + String content = HttpTool.getResponseAsString(httpResponse); + JSONObject jsonObject = JSON.parseObject(content); + logger.error(content); + if (StringUtils.isNotBlank(jsonObject.getString("SUCCESS")) && "true".equals(jsonObject.getString("SUCCESS"))) { + String payUrl = jsonObject.getString("PAYURL"); + httpResponse = HttpTool.url(payUrl).post(); + content = HttpTool.getResponseAsString(httpResponse); + logger.error(content); + jsonObject = JSON.parseObject(content); + if (StringUtils.isNotBlank(jsonObject.getString("SUCCESS")) && "true".equals(jsonObject.getString("SUCCESS")) && StringUtils.isNotBlank(jsonObject.getString("ERRCODE")) && "000000".equals(jsonObject.getString("ERRCODE"))) { + data.put("appId", jsonObject.getString("appId"));// 微信分配的 + // APPID + data.put("timeStamp", jsonObject.getString("timeStamp"));// 时间戳 + data.put("nonceStr", jsonObject.getString("nonceStr"));// 随机串 + data.put("package", jsonObject.getString("package"));// 数据包 + data.put("signType", jsonObject.getString("signType"));// 签名方式 + data.put("paySign", jsonObject.getString("paySign"));// 签名数据 + data.put("partnerid", jsonObject.getString("partnerid"));// 子商户的商户号 + data.put("prepayid", jsonObject.getString("prepayid"));// 预支付交易会话ID + data.put("mweb_url", jsonObject.getString("mweb_url"));// 微信 + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + } else { + response.setStatus(0); + response.setMessage(jsonObject.getString("ERRMSG")); + } + } else { + response.setStatus(0); + response.setMessage(jsonObject.getString("ERRMSG")); + } + } else if (payParam.get("sign").toString().equals("saobei")) { + Map payBoday = (Map) payParam.get("pbody"); + Map paramMap = new LinkedHashMap<>(); + paramMap.put("pay_ver", "100"); + paramMap.put("pay_type", "010"); + paramMap.put("service_id", "015"); + paramMap.put("merchant_no", payBoday.get("merchant_no").toString()); + paramMap.put("terminal_id", payBoday.get("terminal_id").toString()); + paramMap.put("terminal_trace", tradeNo); + paramMap.put("terminal_time", DateUtils.format(new Date(), "yyyyMMddHHmmss")); + paramMap.put("total_fee", new Double(amount * 100).intValue()); + StringBuffer sb = new StringBuffer(); + Set keySet = paramMap.keySet(); + for (String str : keySet) { + sb.append(str + "=" + paramMap.get(str) + "&"); + } + String signKey = "access_token=" + payBoday.get("signKey").toString(); + sb.append(signKey); + String sign = DigestUtils.MD5(sb.toString()).toLowerCase(); + paramMap.put("sub_appid", appId); + paramMap.put("open_id", openId); + paramMap.put("order_body", store.getName() + "线上支付"); + paramMap.put("notify_url", saoBeiPayProperties.getApiUrl()); + paramMap.put("attach", tenantId + "_" + storeId + "_" + tradeNo); + paramMap.put("key_sign", sign); + Object json = JSON.toJSON(paramMap); + logger.error("扫呗支付=========>预下单请求参数{}", json); + final HttpResponse res = HttpTool.url(payBoday.get("gatewayUrl").toString() + "pay/100/minipay").contentType("application/json").body(json.toString()).post(); + final String content = HttpTool.getResponseAsString(res); + logger.error("扫呗支付=========>预下单响应参数{}", content); + JSONObject parseObject = JSON.parseObject(content); + String return_code = parseObject.getString("return_code"); + String result_code = parseObject.getString("result_code"); + String return_msg = parseObject.getString("return_msg"); + if (return_code.equals("01") && result_code.equals("01")) { + Map prepay = new HashMap<>(); + prepay.put("appId", parseObject.getString("appId")); + prepay.put("timeStamp", parseObject.getString("timeStamp")); + prepay.put("nonceStr", parseObject.getString("nonceStr")); + prepay.put("package", parseObject.getString("package_str")); + prepay.put("signType", parseObject.getString("signType")); + prepay.put("paySign", parseObject.getString("paySign")); + // 扫呗商户号 + prepay.put("outTradeNo", parseObject.getString("terminal_trace"));// 商户订单号 + prepay.put("saobeiOrderNo", parseObject.getString("out_trade_no"));// 扫呗唯一订单号 + response.setData(prepay); + response.setStatus(1); + response.setMessage("操作成功"); + } else { + response.setStatus(0); + response.setMessage(return_msg); + } + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + public static String getMacs(Map form) { + StringBuilder formString = new StringBuilder(); + Iterator> parts = form.entrySet().iterator(); + if (parts.hasNext()) { + Entry entry = parts.next(); + formString.append(entry.getKey()); + formString.append("="); + formString.append(entry.getValue().toString()); + while (parts.hasNext()) { + entry = parts.next(); + formString.append("&"); + formString.append(entry.getKey()); + formString.append("="); + formString.append(entry.getValue().toString()); + } + } + //System.out.println("http参数-- getMac >>>>>>>" + formString.toString()); + return new Md5Hash(formString.toString()).toHex(); + } + + public static String getMac(Map form) { + StringBuilder formString = new StringBuilder(); + Iterator> parts = form.entrySet().iterator(); + if (parts.hasNext()) { + Entry entry = parts.next(); + formString.append(URLEncodedUtil.encode(entry.getKey())); + formString.append("="); + formString.append(URLEncodedUtil.encode(entry.getValue().toString())); + while (parts.hasNext()) { + entry = parts.next(); + formString.append("&"); + formString.append(URLEncodedUtil.encode(entry.getKey())); + formString.append("="); + formString.append(URLEncodedUtil.encode(entry.getValue().toString())); + } + } + //System.out.println("http参数-- getMac >>>>>>>" + formString.toString()); + return new Md5Hash(formString.toString()).toHex(); + } + + @ServiceMethod(method = "vpos.order.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "订单查询") + @Override + public Object VposOrderList(VposOrderListRequest request) { + String info = "订单查询"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String openId = request.getOpenId(); + int status = request.getStatus(); + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + // 收银机端专用 + String mobile = request.getMobile(); + String seqNo = request.getSeqNo(); + String startTime = request.getStartTime(); + String endTime = request.getEndTime(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + if (StringUtils.isNotEmpty(openId)) { + criteria.add(Restrictions.eq("openId", openId)); + } + if (StringUtils.isNotEmpty(mobile)) { + criteria.add(Restrictions.eq("mobile", mobile)); + } + if (StringUtils.isNotEmpty(seqNo)) { + criteria.add(Restrictions.like("seqNo", "%" + seqNo + "%")); + } + if (StringUtils.isNotEmpty(startTime)) { + criteria.add(Restrictions.ge("createDate", startTime)); + } + if (StringUtils.isNotEmpty(endTime)) { + criteria.add(Restrictions.le("createDate", endTime)); + } + criteria.add(Restrictions.order("createDate", "DESC")); + if (status == 1) { + criteria.add(Restrictions.eq("status", 0)); + } else if (status == 2) { + List statusList = new ArrayList<>(); + statusList.add(1);// 已支付 + statusList.add(2);// 已退单 + statusList.add(3);// 已取消 + statusList.add(4);// 已完成 + criteria.add(Restrictions.in("status", statusList)); + } + pager = vposStoreBusinessTicketService.getPager(tenantId, criteria, pager); + DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (VposStoreBusinessTicket vposStoreBusinessTicket : source) { + Map map = new HashMap<>(); + map.put("id", vposStoreBusinessTicket.getId()); + map.put("tenantId", vposStoreBusinessTicket.getTenantId()); + map.put("memberId", vposStoreBusinessTicket.getMemberId()); + map.put("openId", vposStoreBusinessTicket.getOpenId()); + map.put("mobile", vposStoreBusinessTicket.getMobile()); + map.put("no", vposStoreBusinessTicket.getNo()); + map.put("storeId", vposStoreBusinessTicket.getStoreId()); + map.put("storeNo", vposStoreBusinessTicket.getStoreNo()); + map.put("storeName", vposStoreBusinessTicket.getStoreName()); + map.put("status", vposStoreBusinessTicket.getStatus()); + map.put("saleDate", fmt.format(vposStoreBusinessTicket.getSaleDate())); + map.put("tableNo", vposStoreBusinessTicket.getTableNo()); + map.put("people", vposStoreBusinessTicket.getPeople()); + map.put("busMode", vposStoreBusinessTicket.getBusMode()); + map.put("amount", vposStoreBusinessTicket.getAmount()); + map.put("discount", vposStoreBusinessTicket.getDiscount()); + map.put("discountTotal", vposStoreBusinessTicket.getDiscountTotal()); + map.put("receivable", vposStoreBusinessTicket.getReceivable()); + map.put("maling", vposStoreBusinessTicket.getMaling()); + map.put("paid", vposStoreBusinessTicket.getPaid()); + map.put("noOrg", vposStoreBusinessTicket.getNoOrg()); + map.put("backCause", vposStoreBusinessTicket.getBackCause()); + map.put("isMember", vposStoreBusinessTicket.getIsMember()); + map.put("memberNo", vposStoreBusinessTicket.getMemberNo()); + map.put("memberJifen", vposStoreBusinessTicket.getMemberJifen()); + map.put("seqNo", vposStoreBusinessTicket.getSeqNo()); + map.put("weeker", vposStoreBusinessTicket.getWeather()); + map.put("tableName", vposStoreBusinessTicket.getTableName()); + map.put("ext1", vposStoreBusinessTicket.getExt1()); + map.put("ext2", vposStoreBusinessTicket.getExt2()); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 发布厨打订阅 + * + * @param tenantId + * @param storeId + * @param enity + * @param orderProduct + */ + public void sendMessage(String tenantId, String storeId, VposStoreBusinessTicket enity, List orderProduct, List productMakeList) { + DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String info = "厨打通订阅模型====>"; + try { + Map map = new HashMap<>(); + map.put("id", enity.getId()); + map.put("tenantId", enity.getTenantId()); + map.put("mobile", enity.getMobile()); + map.put("no", enity.getNo()); + map.put("storeId", enity.getStoreId()); + map.put("storeNo", enity.getStoreNo()); + map.put("storeName", enity.getStoreName()); + map.put("status", enity.getStatus()); + map.put("saleDate", enity.getSaleDate()); + map.put("tableNo", enity.getTableNo()); + map.put("people", enity.getPeople()); + map.put("busMode", enity.getBusMode()); + map.put("amount", enity.getAmount()); + map.put("discount", enity.getDiscount()); + map.put("discountTotal", enity.getDiscountTotal()); + map.put("receivable", enity.getReceivable()); + map.put("maling", enity.getMaling()); + map.put("paid", enity.getPaid()); + map.put("noOrg", enity.getNoOrg()); + map.put("backCause", enity.getBackCause()); + map.put("seqNo", enity.getSeqNo()); + map.put("ext1", enity.getExt1()); + map.put("ext2", enity.getExt2()); + map.put("posNo", enity.getPosNo()); + map.put("workNo", enity.getWorkNo()); + map.put("deviceIp", enity.getDeviceIp()); + map.put("deviceMac", enity.getDeviceMac()); + map.put("deviceName", enity.getDeviceName()); + List> groupList = getListByGroup(orderProduct); + for (List productList : groupList) { + List> productInfo = new ArrayList<>(); + String seriesId = ""; + for (VposStoreOrderProduct product : productList) { + seriesId = product.getSeriesId(); + Map productMap = new HashMap<>(); + productMap.put("id", product.getId()); + productMap.put("clientId", product.getClientId()); + productMap.put("parentId", product.getParentId()); + productMap.put("storeId", product.getStoreId()); + productMap.put("storeNo", product.getStoreNo()); + productMap.put("storeName", product.getStoreName()); + productMap.put("ticketId", product.getTicketId()); + productMap.put("busNo", product.getBusNo()); + productMap.put("busMode", product.getBusMode()); + productMap.put("tableNo", product.getTableNo()); + productMap.put("productId", product.getProductId()); + productMap.put("productNo", product.getProductNo()); + productMap.put("productName", product.getProductName()); + productMap.put("productUnitId", product.getProductUnitId()); + productMap.put("productUnitName", product.getProductUnitName()); + productMap.put("seriesId", product.getSeriesId()); + productMap.put("seriesName", product.getSeriesName()); + productMap.put("typePath", product.getTypePath()); + productMap.put("typeId", product.getTypeId()); + productMap.put("typeName", product.getTypeName()); + productMap.put("specId", product.getSpecId()); + productMap.put("specName", product.getSpecName()); + productMap.put("count", product.getCount()); + productMap.put("rcount", product.getRcount()); + productMap.put("price", product.getPrice()); + productMap.put("priceOrg", product.getPriceOrg()); + productMap.put("discountPrice", product.getDiscountPrice()); + productMap.put("isSuit", product.getIsSuit()); + productMap.put("suitId", product.getSuitId()); + productMap.put("saleDate", product.getSaleDate()); + productMap.put("amount", product.getAmount()); + productMap.put("discount", product.getDiscount()); + productMap.put("discountTotal", product.getDiscountTotal()); + productMap.put("receivable", product.getReceivable()); + productMap.put("addPriceTotal", product.getAddPriceTotal()); + productMap.put("discountAddTotal", product.getDiscountAddTotal()); + productMap.put("amountAddTotal", product.getAmountAddTotal()); + productMap.put("amountTotal", product.getAmountTotal()); + productMap.put("receivableTotal", product.getReceivableTotal()); + productMap.put("lineNo", product.getLineNo()); + productMap.put("seqNo", product.getSeqNo()); + productMap.put("tableName", product.getTableName()); + List> makeInfo = new ArrayList<>(); + if (productMakeList != null && productMakeList.size() > 0) { + for (VposStoreOrderProductMake make : productMakeList) { + if (product.getClientId().equals(make.getOrderItemId())) { + Map makeMap = new HashMap<>(); + makeMap.put("id", make.getId()); + makeMap.put("clientId", make.getClientId()); + makeMap.put("orderItemId", make.getOrderItemId()); + makeMap.put("storeId", make.getStoreId()); + makeMap.put("storeNo", make.getStoreNo()); + makeMap.put("storeName", make.getStoreName()); + makeMap.put("ticketId", make.getTicketId()); + makeMap.put("busNo", make.getBusNo()); + makeMap.put("makeId", make.getMakeId()); + makeMap.put("makeName", make.getMakeName()); + makeMap.put("addPrice", make.getAddPrice()); + makeMap.put("discountPrice", make.getDiscountPrice()); + makeMap.put("count", make.getCount()); + makeMap.put("rcount", make.getRcount()); + makeMap.put("addTotal", make.getAddTotal()); + makeMap.put("discountAddTotal", make.getDiscountAddTotal()); + makeMap.put("discount", make.getDiscount()); + makeMap.put("qtyFlag", make.getQtyFlag()); + makeMap.put("hand", make.getHand()); + makeMap.put("saleDate", make.getSaleDate()); + makeMap.put("tableNo", make.getTableNo()); + makeMap.put("tableName", make.getTableName()); + makeInfo.add(makeMap); + } + } + } + productMap.put("makeInfo", makeInfo); + productInfo.add(productMap); + } + map.put("productInfo", productInfo); + // 根据分类进行数据分发 + logger.error(info + "eprint/" + tenantId + "/" + storeId + "/" + seriesId); + logger.error(JSON.toJSONString(map, SerializerFeature.WriteDateUseDateFormat)); + mqttClient.Publish("eprint/" + tenantId + "/" + storeId + "/" + seriesId, JSON.toJSONString(map, SerializerFeature.WriteDateUseDateFormat)); + + } + } catch (Exception e) { + logger.error(info + "发布订阅模型时处理时,发生异常", e); + } + } + + private static List> getListByGroup(List list) { + List> result = new ArrayList>(); + Map> map = new TreeMap>(); + + for (VposStoreOrderProduct bean : list) { + if (map.containsKey(bean.getSeriesId())) { + List t = map.get(bean.getSeriesId()); + t.add(bean); + map.put(bean.getSeriesId(), t); + } else { + List t = new ArrayList(); + t.add(bean); + map.put(bean.getSeriesId(), t); + } + } + for (Entry> entry : map.entrySet()) { + result.add(entry.getValue()); + } + return result; + } + + @ServiceMethod(method = "vpos.weixin.pay.query", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "订单支付状态查询") + @Override + public Object VposWeixinPayQuery(VposWeixinPayQueryRequest request) { + String info = "订单支付状态查询"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String tradeNo = request.getTradeNo(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Store store = storeService.get(tenantId, storeId); + if (store == null) { + response.setStatus(0); + response.setMessage("erp门店不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + String keysuccess = "wxBusNo:" + tenantId + ":" + storeId + ":" + tradeNo; + Object busNoValue = cacheService.get(tenantId, keysuccess); + if (busNoValue != null && tradeNo.equals(busNoValue.toString().split("_")[0])) { + Map data = new HashMap<>(); + data.put("busNo", tradeNo); + data.put("seqNo", busNoValue.toString().split("_")[1]); + data.put("payType", busNoValue.toString().split("_")[2]); + response.setStatus(1); + response.setMessage("订单支付成功"); + response.setData(data); + } else { + response.setStatus(0); + response.setMessage("未查询到支付成功状态"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "vpos.order.cancel", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "未支付订单取消") + @Override + public Object VposOrderCancel(VposOrderCancelRequest request) { + String info = "未支付订单取消"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String openId = request.getOpenId();// 来源标识 + String tradeNo = request.getTradeNo(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("no", tradeNo)); + criteria.add(Restrictions.eq("openId", openId)); + criteria.add(Restrictions.eq("storeId", storeId)); + List ticketList = vposStoreBusinessTicketService.getList(tenantId, criteria); + if (CollectionUtils.isNotEmpty(ticketList)) { + VposStoreBusinessTicket ticket = ticketList.get(0); + if (ticket.getStatus() == 0) { + ticket.setStatus(3); + vposStoreBusinessTicketService.update(tenantId, ticket); + Map data = new HashMap<>(); + data.put("busNo", tradeNo); + response.setStatus(1); + response.setMessage("订单取消成功"); + response.setData(data); + } else { + response.setStatus(0); + response.setMessage("订单状态不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + } else { + response.setStatus(0); + response.setMessage("订单不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "vpos.order.detail", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "订单详情") + @Override + public Object VposOrderDetail(VposOrderDetailRequest request) { + String info = "订单详情"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String openId = request.getOpenId();// 来源标识 + String tradeNo = request.getTradeNo(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("no", tradeNo)); + if (StringUtils.isNotEmpty(openId)) { + criteria.add(Restrictions.eq("openId", openId)); + } + criteria.add(Restrictions.eq("storeId", storeId)); + List ticketList = vposStoreBusinessTicketService.getList(tenantId, criteria); + DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + if (CollectionUtils.isNotEmpty(ticketList)) { + VposStoreBusinessTicket vposStoreBusinessTicket = ticketList.get(0); + Map map = new HashMap<>(); + map.put("id", vposStoreBusinessTicket.getId()); + map.put("tenantId", vposStoreBusinessTicket.getTenantId()); + map.put("memberId", vposStoreBusinessTicket.getMemberId()); + map.put("openId", vposStoreBusinessTicket.getOpenId()); + map.put("mobile", vposStoreBusinessTicket.getMobile()); + map.put("no", vposStoreBusinessTicket.getNo()); + map.put("storeId", vposStoreBusinessTicket.getStoreId()); + map.put("storeNo", vposStoreBusinessTicket.getStoreNo()); + map.put("storeName", vposStoreBusinessTicket.getStoreName()); + map.put("status", vposStoreBusinessTicket.getStatus()); + map.put("saleDate", fmt.format(vposStoreBusinessTicket.getSaleDate())); + map.put("tableNo", vposStoreBusinessTicket.getTableNo()); + map.put("people", vposStoreBusinessTicket.getPeople()); + map.put("busMode", vposStoreBusinessTicket.getBusMode()); + map.put("amount", vposStoreBusinessTicket.getAmount()); + map.put("discount", vposStoreBusinessTicket.getDiscount()); + map.put("discountTotal", vposStoreBusinessTicket.getDiscountTotal()); + map.put("receivable", vposStoreBusinessTicket.getReceivable()); + map.put("maling", vposStoreBusinessTicket.getMaling()); + map.put("paid", vposStoreBusinessTicket.getPaid()); + map.put("noOrg", vposStoreBusinessTicket.getNoOrg()); + map.put("backCause", vposStoreBusinessTicket.getBackCause()); + map.put("isMember", vposStoreBusinessTicket.getIsMember()); + map.put("memberNo", vposStoreBusinessTicket.getMemberNo()); + map.put("memberJifen", vposStoreBusinessTicket.getMemberJifen()); + map.put("seqNo", vposStoreBusinessTicket.getSeqNo()); + map.put("weeker", vposStoreBusinessTicket.getWeather()); + map.put("tableName", vposStoreBusinessTicket.getTableName()); + map.put("ext1", vposStoreBusinessTicket.getExt1()); + map.put("ext2", vposStoreBusinessTicket.getExt2()); + criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketId", vposStoreBusinessTicket.getId())); + // 获取主单优惠 + List ticketInfoList = vposStoreBusinessTicketInfoService.getList(tenantId, criteria); + List> ticketInfo = new ArrayList<>(); + for (VposStoreBusinessTicketInfo item : ticketInfoList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("busNo", item.getBusNo()); + itemMap.put("type", item.getType()); + itemMap.put("info", item.getInfo()); + itemMap.put("discountMoney", item.getDiscountMoney()); + ticketInfo.add(itemMap); + } + map.put("ticketInfo", ticketInfo); + // 获取订单商品信息 + List orderProductList = vposStoreOrderProductService.getList(tenantId, criteria); + List> orderProduct = new ArrayList<>(); + for (VposStoreOrderProduct item : orderProductList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("clientId", item.getClientId()); + itemMap.put("parentId", item.getParentId()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("productId", item.getProductId()); + itemMap.put("productNo", item.getProductNo()); + itemMap.put("productName", item.getProductName()); + itemMap.put("productUnitId", item.getProductUnitId()); + itemMap.put("productUnitName", item.getProductUnitName()); + itemMap.put("productImageUrl", item.getProductImageUrl()); + itemMap.put("seriesId", item.getSeriesId()); + itemMap.put("seriesName", item.getSeriesName()); + itemMap.put("typePath", item.getTypePath()); + itemMap.put("typeId", item.getTypeId()); + itemMap.put("typeName", item.getTypeName()); + itemMap.put("specId", item.getSpecId()); + itemMap.put("specName", item.getSpecName()); + itemMap.put("count", item.getCount()); + itemMap.put("rcount", item.getRcount()); + itemMap.put("price", item.getPrice()); + itemMap.put("priceOrg", item.getPriceOrg()); + itemMap.put("discountPrice", item.getDiscountPrice()); + itemMap.put("isSuit", item.getIsSuit()); + itemMap.put("suitId", item.getSuitId()); + itemMap.put("amount", item.getAmount()); + itemMap.put("discount", item.getDiscount()); + itemMap.put("discountTotal", item.getDiscountTotal()); + itemMap.put("receivable", item.getReceivable()); + itemMap.put("addPriceTotal", item.getAddPriceTotal()); + itemMap.put("discountAddTotal", item.getDiscountAddTotal()); + itemMap.put("amountAddTotal", item.getAmountAddTotal()); + itemMap.put("amountTotal", item.getAmountTotal()); + itemMap.put("receivableTotal", item.getReceivableTotal()); + itemMap.put("lineNo", item.getLineNo()); + itemMap.put("seqNo", item.getSeqNo()); + orderProduct.add(itemMap); + } + map.put("orderProduct", orderProduct); + // 获取产品优惠信息 + List orderProductInfoList = vposStoreOrderProductInfoService.getList(tenantId, criteria); + List> orderProductInfo = new ArrayList<>(); + for (VposStoreOrderProductInfo item : orderProductInfoList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("orderItemId", item.getOrderItemId()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("type", item.getType()); + itemMap.put("info", item.getInfo()); + itemMap.put("discountMoney", item.getDiscountMoney()); + orderProductInfo.add(itemMap); + } + map.put("orderProductInfo", orderProductInfo); + // 获取产品做法信息 + List makeList = vposStoreOrderProductMakeService.getList(tenantId, criteria); + List> makeInfo = new ArrayList<>(); + for (VposStoreOrderProductMake item : makeList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("orderItemId", item.getOrderItemId()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("busNo", item.getBusNo()); + itemMap.put("makeId", item.getMakeId()); + itemMap.put("makeName", item.getMakeName()); + itemMap.put("addPrice", item.getAddPrice()); + itemMap.put("discountPrice", item.getDiscountPrice()); + itemMap.put("count", item.getCount()); + itemMap.put("rcount", item.getRcount()); + itemMap.put("addTotal", item.getAddTotal()); + itemMap.put("discountAddTotal", item.getDiscountAddTotal()); + itemMap.put("discount", item.getDiscount()); + itemMap.put("qtyFlag", item.getQtyFlag()); + itemMap.put("hand", item.getHand()); + makeInfo.add(itemMap); + } + map.put("makeInfo", makeInfo); + // 获取产品做法信息 + List payList = vposStorePayService.getList(tenantId, criteria); + List> payInfo = new ArrayList<>(); + for (VposStorePay item : payList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", item.getId()); + itemMap.put("payNo", item.getPayNo()); + itemMap.put("ticketId", item.getTicketId()); + itemMap.put("busNo", item.getBusNo()); + itemMap.put("payTypeNo", item.getPayTypeNo()); + itemMap.put("payType", item.getPayType()); + itemMap.put("paid", item.getPaid()); + itemMap.put("payDate", item.getPayDate() == null ? "" : fmt.format(item.getPayDate())); + itemMap.put("rchange", item.getRchange()); + itemMap.put("money", item.getMoney()); + itemMap.put("overAmount", item.getOverAmount()); + itemMap.put("voucherNo", item.getVoucherNo()); + itemMap.put("payDate", item.getPayDate()); + itemMap.put("cardno", item.getCardno()); + itemMap.put("cardYe", item.getCardYe()); + itemMap.put("cardJf", item.getCardJf()); + itemMap.put("incomeFlag", item.getIncomeFlag()); + itemMap.put("otherRateType", item.getOtherRateType()); + itemMap.put("otherRateValue", item.getOtherRateValue()); + itemMap.put("otherRate", item.getOtherRate()); + itemMap.put("payChannel", item.getPayChannel()); + itemMap.put("memo", item.getMemo()); + payInfo.add(itemMap); + } + map.put("payInfo", payInfo); + response.setStatus(1); + response.setMessage("订单获取成功"); + response.setData(map); + } else { + response.setStatus(0); + response.setMessage("订单不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "vpos.order.edit", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "订单修改") + @Override + public Object VposOrderEdit(VposOrderEditRequest request) { + String info = "订单修改"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + String storeId = request.getStoreId(); + String openId = request.getOpenId();// 来源标识 + String tradeNo = request.getTradeNo();// 订单编号 + String tableNo = request.getTableNo();// 餐桌号 + String mobile = request.getMobile();// 手机号 + String ext2 = request.getExt2();// 订单备注 + Integer busMode = request.getBusMode();// 营业模式 + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + + Store store = storeService.get(tenantId, request.getStoreId()); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("no", tradeNo)); + criteria.add(Restrictions.eq("openId", openId)); + criteria.add(Restrictions.eq("storeId", storeId)); + List ticketList = vposStoreBusinessTicketService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(ticketList)) { + response.setStatus(0); + response.setMessage("修改失败,订单不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + VposStoreBusinessTicket storeBusinessTicket = ticketList.get(0); + Date createDate = new Date(); + storeBusinessTicket.setCreateDate(createDate); + storeBusinessTicket.setCreateUser("open-api"); + storeBusinessTicket.setTableNo(tableNo); + storeBusinessTicket.setBusMode(busMode); + storeBusinessTicket.setMobile(mobile); + storeBusinessTicket.setExt2(ext2); + vposStoreBusinessTicketService.update(tenantId, storeBusinessTicket); + Map data = new HashMap<>(); + data.put("busNo", storeBusinessTicket.getNo()); + data.put("ticketId", storeBusinessTicket.getId()); + response.setStatus(1); + response.setMessage("订单修改成功"); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "vpos.order.refund", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "订单退款") + @Override + public Object VposOrderRefund(VposOrderRefundRequest request) { + + String info = "订单退款"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String openId = request.getOpenId();// 来源标识 + String tradeNo = request.getTradeNo(); + String payRefundNo = request.getPayRefundNo();// 建行凭证号 + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("no", tradeNo)); + if (StringUtils.isNotEmpty(openId)) { + criteria.add(Restrictions.eq("openId", openId)); + } + criteria.add(Restrictions.eq("storeId", storeId)); + List ticketList = vposStoreBusinessTicketService.getList(tenantId, criteria); + if (CollectionUtils.isNotEmpty(ticketList)) { + VposStoreBusinessTicket ticket = ticketList.get(0); + if (ticket.getStatus() == 4) { + ticket.setStatus(2); + vposStoreBusinessTicketService.update(tenantId, ticket); + // 反向生成退款订单 + criteria = new Criteria(); + criteria.add(Restrictions.eq("busNo", tradeNo)); + criteria.add(Restrictions.eq("storeId", storeId)); + // 获取主单优惠 + List ticketInfoList = vposStoreBusinessTicketInfoService.getList(tenantId, criteria); + // 获取订单商品信息 + List orderProductList = vposStoreOrderProductService.getList(tenantId, criteria); + // 获取产品优惠信息 + List orderProductInfoList = vposStoreOrderProductInfoService.getList(tenantId, criteria); + // 获取产品做法信息 + List makeList = vposStoreOrderProductMakeService.getList(tenantId, criteria); + // 获取产品支付明细 + List payList = vposStorePayService.getList(tenantId, criteria); + Date createDate = new Date(); + // 重置退单数据 + ticket.setAmount(0 - ticket.getAmount()); + ticket.setDiscountTotal(0 - ticket.getDiscountTotal()); + ticket.setMaling(0 - ticket.getMaling()); + ticket.setPaid(0 - ticket.getPaid()); + ticket.setReceivable(0 - ticket.getReceivable()); + // 主单信息 + StoreBusinessTicket storeBusinessTicket = new StoreBusinessTicket(); + storeBusinessTicket.setAmount(ticket.getAmount()); + storeBusinessTicket.setBackCause("线下订单退单"); + storeBusinessTicket.setBusMode(ticket.getBusMode()); + storeBusinessTicket.setClientId(String.valueOf(IdWorkerUtils.getInstance().nextId())); + storeBusinessTicket.setCreateDate(createDate); + storeBusinessTicket.setCreateUser("open-api"); + storeBusinessTicket.setDeviceIp(ticket.getDeviceIp()); + storeBusinessTicket.setDeviceMac(ticket.getDeviceMac()); + storeBusinessTicket.setDeviceName(ticket.getDeviceName()); + storeBusinessTicket.setDiscount(ticket.getDiscount()); + storeBusinessTicket.setDiscountTotal(ticket.getDiscountTotal()); + storeBusinessTicket.setEstimatedCost(0.00); + storeBusinessTicket.setEstimatedProfitAmount(0.00); + storeBusinessTicket.setEstimatedProfitMargin(0.00); + storeBusinessTicket.setExt1(ticket.getExt1()); + storeBusinessTicket.setExt2(ticket.getExt2()); + storeBusinessTicket.setExt3(ticket.getExt3()); + storeBusinessTicket.setIsInvalid(ticket.getIsInvalid()); + storeBusinessTicket.setIsMember(ticket.getIsMember()); + storeBusinessTicket.setIsStockDeal(ticket.getIsStockDeal()); + storeBusinessTicket.setMaling(ticket.getMaling()); + storeBusinessTicket.setMemberJifen(ticket.getMemberJifen()); + storeBusinessTicket.setMemberNo(ticket.getMemberNo()); + storeBusinessTicket.setNo("B" + String.valueOf(IdWorkerUtils.getInstance().nextId())); + storeBusinessTicket.setNoOrg(ticket.getNo()); + storeBusinessTicket.setPaid(ticket.getPaid()); + storeBusinessTicket.setPeople(ticket.getPeople()); + storeBusinessTicket.setPosNo(ticket.getPosNo()); + storeBusinessTicket.setProfitAmount(0.00); + storeBusinessTicket.setProfitMargin(0.00); + storeBusinessTicket.setReceivable(ticket.getReceivable()); + storeBusinessTicket.setSaleDate(createDate); + storeBusinessTicket.setSeqNo(ticket.getSeqNo()); + storeBusinessTicket.setShiftName(ticket.getShiftName()); + storeBusinessTicket.setShiftNo(ticket.getShiftNo()); + storeBusinessTicket.setStatus(2); + storeBusinessTicket.setStoreId(ticket.getStoreId()); + storeBusinessTicket.setStoreName(ticket.getStoreName()); + storeBusinessTicket.setStoreNo(ticket.getStoreNo()); + storeBusinessTicket.setTableName(ticket.getTableName()); + storeBusinessTicket.setTableNo(ticket.getTableNo()); + storeBusinessTicket.setTenantId(tenantId); + storeBusinessTicket.setTotalCost(0.00); + storeBusinessTicket.setWeather(ticket.getWeather()); + storeBusinessTicket.setWeeker(ticket.getWeeker()); + storeBusinessTicket.setWorkNo(ticket.getWorkNo()); + // 主单明细 + List storeBusinessTicketInfoList = new ArrayList<>(); + for (VposStoreBusinessTicketInfo item : ticketInfoList) { + StoreBusinessTicketInfo ticketInfo = new StoreBusinessTicketInfo(); + ticketInfo.setBusNo(storeBusinessTicket.getNo()); + ticketInfo.setClientId(String.valueOf(IdWorkerUtils.getInstance().nextId())); + ticketInfo.setCreateDate(createDate); + ticketInfo.setCreateUser("open-api"); + ticketInfo.setDiscountMoney(0 - item.getDiscountMoney()); + ticketInfo.setInfo(item.getInfo()); + ticketInfo.setIsInvalid(item.getIsInvalid()); + ticketInfo.setSaleDate(createDate); + ticketInfo.setStoreId(storeId); + ticketInfo.setTenantId(tenantId); + ticketInfo.setType(item.getType()); + storeBusinessTicketInfoList.add(ticketInfo); + } + // 商品明细 + List storeOrderProductList = new ArrayList<>(); + // 优惠详情 + List storeOrderProductInfoList = new ArrayList<>(); + // 商品做法明细 + List storeOrderProductMakeList = new ArrayList<>(); + for (VposStoreOrderProduct item : orderProductList) { + // 设置退单数据 + item.setAddPriceTotal(0 - item.getAddPriceTotal()); + item.setAmount(0 - item.getAmount()); + item.setAmountAddTotal(0 - item.getAmountAddTotal()); + item.setAmountTotal(0 - item.getAmountTotal()); + item.setRcount(item.getCount()); + item.setCount(0.00); + item.setDiscountAddTotal(0 - item.getDiscountAddTotal()); + item.setDiscountTotal(0 - item.getDiscountTotal()); + item.setReceivable(0 - item.getReceivable()); + item.setReceivableTotal(0 - item.getReceivableTotal()); + + StoreOrderProduct orderProduct = new StoreOrderProduct(); + orderProduct.setAddPriceTotal(item.getAddPriceTotal()); + orderProduct.setAmount(item.getAmount()); + orderProduct.setAmountAddTotal(item.getAmountAddTotal()); + orderProduct.setAmountTotal(item.getAmountTotal()); + orderProduct.setBusMode(item.getBusMode()); + orderProduct.setBusNo(storeBusinessTicket.getNo()); + orderProduct.setClientId(String.valueOf(IdWorkerUtils.getInstance().nextId())); + orderProduct.setCount(item.getCount()); + orderProduct.setCreateDate(createDate); + orderProduct.setCreateUser("open-api"); + orderProduct.setDeviceIp(item.getDeviceIp()); + orderProduct.setDeviceMac(item.getDeviceMac()); + orderProduct.setDeviceName(item.getDeviceName()); + orderProduct.setDiscount(item.getDiscount()); + orderProduct.setDiscountAddTotal(item.getDiscountAddTotal()); + orderProduct.setDiscountPrice(item.getDiscountPrice()); + orderProduct.setDiscountTotal(item.getDiscountTotal()); + orderProduct.setEstimatedCost(0.00); + orderProduct.setEstimatedProfitAmount(0.00); + orderProduct.setEstimatedProfitMargin(0.00); + orderProduct.setIsInvalid(item.getIsInvalid()); + orderProduct.setIsMember(item.getIsMember()); + orderProduct.setIsStockDeal(item.getIsStockDeal()); + orderProduct.setIsSuit(item.getIsSuit()); + orderProduct.setLineNo(item.getLineNo()); + orderProduct.setMemberNo(item.getMemberNo()); + orderProduct.setParentId(item.getParentId()); + orderProduct.setPosNo(item.getPosNo()); + orderProduct.setPrice(item.getPrice()); + orderProduct.setPriceOrg(item.getPriceOrg()); + orderProduct.setProductId(item.getProductId()); + orderProduct.setProductName(item.getProductName()); + orderProduct.setProductNo(item.getProductNo()); + orderProduct.setProductUnitId(item.getProductUnitId()); + orderProduct.setProductUnitName(item.getProductName()); + orderProduct.setProfitAmount(0.00); + orderProduct.setProfitMargin(0.00); + orderProduct.setRcount(item.getRcount()); + orderProduct.setReceivable(item.getReceivable()); + orderProduct.setReceivableTotal(item.getReceivableTotal()); + orderProduct.setSaleDate(storeBusinessTicket.getSaleDate()); + orderProduct.setSeqNo(item.getSeqNo()); + orderProduct.setSeriesId(item.getSeriesId()); + orderProduct.setSeriesName(item.getSeriesName()); + orderProduct.setSpecId(item.getSpecId()); + orderProduct.setSpecName(item.getSpecName()); + orderProduct.setStoreId(item.getStoreId()); + orderProduct.setStoreName(item.getStoreName()); + orderProduct.setStoreNo(item.getStoreNo()); + orderProduct.setSuitId(item.getSuitId()); + orderProduct.setTableName(item.getTableName()); + orderProduct.setTableNo(item.getTableNo()); + orderProduct.setTenantId(tenantId); + orderProduct.setTotalCost(0.00); + orderProduct.setTypeId(item.getTypeId()); + orderProduct.setTypeName(item.getTypeName()); + orderProduct.setTypePath(item.getTypePath()); + orderProduct.setWeather(item.getWeather()); + orderProduct.setWeeker(item.getWeeker()); + orderProduct.setWorkerNo(item.getWorkerNo()); + storeOrderProductList.add(orderProduct); + + for (VposStoreOrderProductInfo itemInfo : orderProductInfoList) { + if (item.getId().equals(itemInfo.getOrderItemId())) { + StoreOrderProductInfo storeOrderProductInfo = new StoreOrderProductInfo(); + storeOrderProductInfo.setBusNo(storeBusinessTicket.getNo()); + storeOrderProductInfo.setClientId(String.valueOf(IdWorkerUtils.getInstance().nextId())); + storeOrderProductInfo.setCreateDate(createDate); + storeOrderProductInfo.setCreateUser("open-api"); + storeOrderProductInfo.setDiscountMoney(0 - itemInfo.getDiscountMoney()); + storeOrderProductInfo.setInfo(itemInfo.getInfo()); + storeOrderProductInfo.setIsInvalid(itemInfo.getIsInvalid()); + storeOrderProductInfo.setOrderItemId(orderProduct.getClientId()); + storeOrderProductInfo.setSaleDate(createDate); + storeOrderProductInfo.setStoreId(storeId); + storeOrderProductInfo.setTableName(itemInfo.getTableName()); + storeOrderProductInfo.setTableNo(itemInfo.getTableNo()); + storeOrderProductInfo.setTenantId(tenantId); + storeOrderProductInfo.setType(itemInfo.getType()); + storeOrderProductInfoList.add(storeOrderProductInfo); + } + } + for (VposStoreOrderProductMake itemInfo : makeList) { + if (item.getId().equals(itemInfo.getOrderItemId())) { + // 设置退单数据 + itemInfo.setAddTotal(0 - itemInfo.getAddTotal()); + itemInfo.setRcount(itemInfo.getCount()); + itemInfo.setCount(0.00); + itemInfo.setDiscountAddTotal(0 - itemInfo.getDiscountAddTotal()); + StoreOrderProductMake storeOrderProductMake = new StoreOrderProductMake(); + storeOrderProductMake.setAddPrice(itemInfo.getAddPrice()); + storeOrderProductMake.setAddTotal(itemInfo.getAddTotal()); + storeOrderProductMake.setBusNo(storeBusinessTicket.getNo()); + storeOrderProductMake.setClientId(String.valueOf(IdWorkerUtils.getInstance().nextId())); + storeOrderProductMake.setCount(itemInfo.getCount()); + storeOrderProductMake.setCreateDate(createDate); + storeOrderProductMake.setCreateUser("open-api"); + storeOrderProductMake.setDiscount(itemInfo.getDiscount()); + storeOrderProductMake.setDiscountAddTotal(itemInfo.getDiscountAddTotal()); + storeOrderProductMake.setDiscountPrice(itemInfo.getDiscountPrice()); + storeOrderProductMake.setHand(itemInfo.getHand()); + storeOrderProductMake.setIsInvalid(itemInfo.getIsInvalid()); + storeOrderProductMake.setMakeId(itemInfo.getMakeId()); + storeOrderProductMake.setMakeName(itemInfo.getMakeName()); + storeOrderProductMake.setOrderItemId(orderProduct.getClientId()); + storeOrderProductMake.setQtyFlag(itemInfo.getQtyFlag()); + storeOrderProductMake.setRcount(itemInfo.getRcount()); + storeOrderProductMake.setSaleDate(createDate); + storeOrderProductMake.setStoreId(storeId); + storeOrderProductMake.setStoreName(itemInfo.getStoreName()); + storeOrderProductMake.setStoreNo(itemInfo.getStoreNo()); + storeOrderProductMake.setTableNo(itemInfo.getTableNo()); + storeOrderProductMake.setTableName(itemInfo.getTableName()); + storeOrderProductMake.setTenantId(tenantId); + storeOrderProductMakeList.add(storeOrderProductMake); + } + } + } + // 支付明细 + List storePayList = new ArrayList<>(); + for (VposStorePay item : payList) { + StorePay storePay = new StorePay(); + storePay.setBusMode(item.getBusMode()); + storePay.setBusNo(storeBusinessTicket.getNo()); + storePay.setCardJf(item.getCardJf()); + storePay.setCardno(item.getCardno()); + storePay.setCardYe(item.getCardYe()); + storePay.setClientId(String.valueOf(IdWorkerUtils.getInstance().nextId())); + storePay.setCreateDate(createDate); + storePay.setCreateUser("open-api"); + storePay.setDeviceIp(item.getDeviceIp()); + storePay.setDeviceMac(item.getDeviceMac()); + storePay.setDeviceName(item.getDeviceName()); + storePay.setIncomeFlag(item.getIncomeFlag()); + storePay.setIsInvalid(item.getIsInvalid()); + storePay.setMemo(item.getMemo()); + storePay.setMoney(0 - item.getMoney()); + storePay.setOtherRate(item.getOtherRate()); + storePay.setOtherRateType(item.getOtherRateType()); + storePay.setOtherRateValue(item.getOtherRateValue()); + storePay.setOverAmount(0 - item.getOverAmount()); + storePay.setPaid(0 - item.getPaid()); + storePay.setPayChannel(item.getPayChannel()); + storePay.setPayDate(createDate); + storePay.setPayNo(item.getPayNo()); + storePay.setPayType(item.getPayType()); + storePay.setPayTypeNo(item.getPayTypeNo()); + storePay.setPosNo(item.getPosNo()); + storePay.setRchange(0 - item.getRchange()); + storePay.setStoreId(item.getStoreId()); + storePay.setStoreName(item.getStoreName()); + storePay.setStoreNo(item.getStoreNo()); + storePay.setTableName(item.getTableName()); + storePay.setTableNo(item.getTableNo()); + storePay.setTenantId(tenantId); + storePay.setVoucherNo(payRefundNo); + storePay.setWorkNo(item.getWorkNo()); + storePayList.add(storePay); + } + // MQTT通知厨打 + // 订单进行分单 + sendMessage(tenantId, storeId, ticket, orderProductList, makeList); + // 退款增加库存,放入消息队列 + Map stockMessage = new HashMap<>(); + stockMessage.put("type", "productsalestock"); + stockMessage.put("orderProductList", orderProductList); + CorrelationData correlationData1 = new CorrelationData(UUID.randomUUID().toString()); + this.mqMessageSender.send4productsalestock(tenantId, stockMessage, correlationData1); + // 数据上传,放入消息队列 + Map message = new HashMap<>(); + message.put("type", "businessorderplus"); + message.put("storeBusinessTicket", storeBusinessTicket); + message.put("ticketInfoList", storeBusinessTicketInfoList); + message.put("orderProductList", storeOrderProductList); + message.put("orderProductInfoList", storeOrderProductInfoList); + message.put("payList", storePayList); + message.put("makeList", storeOrderProductMakeList); + message.put("deliveryList", new ArrayList()); + CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString()); + this.mqMessageSender.send4businessorderplus(tenantId, message, correlationData); + Map data = new HashMap<>(); + data.put("busNo", tradeNo); + data.put("refundNo", storeBusinessTicket.getNo()); + response.setStatus(1); + response.setMessage("订单退款成功"); + response.setData(data); + } else { + response.setStatus(0); + response.setMessage("订单状态不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + } else { + response.setStatus(0); + response.setMessage("订单不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "vpos.product.stock", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "订单库存校验") + @Override + public Object VposProductStock(VposProductStockRequest request) { + String info = "订单库存校验"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String specIds = request.getSpecIds(); + String counts = request.getCounts(); + + CommonDataResponse response = null; + Map data = new HashMap<>(); + try { + response = new CommonDataResponse(); + String[] ids = specIds.split(","); + String[] cts = counts.split(","); + if (ids.length != cts.length) { + response.setStatus(0); + response.setMessage("商品ID和数量参数不一致"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + response.setData(data); + return response; + } + String message = ""; + for (int i = 0; i < ids.length; i++) { + String specId = ids[i]; + double productCount = Double.parseDouble(cts[i]); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("specId", specId)); + List storeProductSaleStockList = storeProductSaleStockService.getList(tenantId, criteria); + if (CollectionUtils.isNotEmpty(storeProductSaleStockList)) { + StoreProductSaleStock storeProductSaleStock = storeProductSaleStockList.get(0); + if (storeProductSaleStock.getStock() != null && storeProductSaleStock.getStock() < productCount) { + message = storeProductSaleStock.getProductName() + ",剩余库存" + storeProductSaleStock.getStock() + ",数量不足无法下单"; + break; + } + } + } + if (!"".equals(message)) { + response.setStatus(0); + response.setMessage(message); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + response.setData(data); + } else { + response.setStatus(1); + response.setMessage("校验通过"); + return response; + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "vpos.order.refund.part", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "部分退款") + @Override + public Object VposOrderRefundPart(VposOrderRefundPartRequest request) { + + String info = "订单退款"; + logger.info(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.info("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + String openId = request.getOpenId();// 来源标识 + String tradeNo = request.getTradeNo(); + String payRefundNo = request.getPayRefundNo();// 建行凭证号 + String jsonString = request.getJsonString(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("no", tradeNo)); + if (StringUtils.isNotEmpty(openId)) { + criteria.add(Restrictions.eq("openId", openId)); + } + criteria.add(Restrictions.eq("storeId", storeId)); + List ticketList = vposStoreBusinessTicketService.getList(tenantId, criteria); + if (CollectionUtils.isNotEmpty(ticketList)) { + VposStoreBusinessTicket ticket = ticketList.get(0); + if (ticket.getStatus() == 4) { + + JSONObject json = JSONObject.parseObject(jsonString); + VposStoreBusinessTicketRefundPartEntity entity = new VposStoreBusinessTicketRefundPartEntity(json); + List productInfo = new ArrayList<>(); + List orderProductRefundPart = entity.getOrderProduct(); + double totalBackAmount = 0.00; + for (VposStoreOrderProductRefundPartEntity refundPart : orderProductRefundPart) { + VposStoreOrderProduct vposStoreOrderProduct = new VposStoreOrderProduct(); + vposStoreOrderProduct.setId(refundPart.getId()); + vposStoreOrderProduct.setCount(refundPart.getCount()); + vposStoreOrderProduct.setRcount(refundPart.getRcount()); + productInfo.add(vposStoreOrderProduct); + // 本次退款金额 + totalBackAmount = totalBackAmount + refundPart.getAmount(); + } + ticket.setStatus(2); + // vposStoreBusinessTicketService.update(tenantId, ticket); + vposStoreOrderProductService.update(tenantId, productInfo); + // 第二部,反向生成退单 + Date createDate = new Date(); + ticket.setDeviceIp(entity.getDeviceIp()); + ticket.setDeviceMac(entity.getDeviceMac()); + ticket.setDeviceName(entity.getDeviceName()); + ticket.setWorkNo(entity.getWorkNo()); + // 重置退单数据 + ticket.setAmount(0 - totalBackAmount); + ticket.setDiscountTotal(0.00); + ticket.setMaling(0.00); + ticket.setPaid(0 - totalBackAmount); + ticket.setReceivable(0 - totalBackAmount); + // 主单信息 + StoreBusinessTicket storeBusinessTicket = new StoreBusinessTicket(); + storeBusinessTicket.setAmount(ticket.getAmount()); + storeBusinessTicket.setBackCause("线下订单退单"); + storeBusinessTicket.setBusMode(ticket.getBusMode()); + storeBusinessTicket.setClientId(String.valueOf(IdWorkerUtils.getInstance().nextId())); + storeBusinessTicket.setCreateDate(createDate); + storeBusinessTicket.setCreateUser("open-api"); + storeBusinessTicket.setDeviceIp(entity.getDeviceIp()); + storeBusinessTicket.setDeviceMac(entity.getDeviceMac()); + storeBusinessTicket.setDeviceName(entity.getDeviceName()); + storeBusinessTicket.setDiscount(0.00); + storeBusinessTicket.setDiscountTotal(ticket.getDiscountTotal()); + storeBusinessTicket.setEstimatedCost(0.00); + storeBusinessTicket.setEstimatedProfitAmount(0.00); + storeBusinessTicket.setEstimatedProfitMargin(0.00); + storeBusinessTicket.setExt1(ticket.getExt1()); + storeBusinessTicket.setExt2(ticket.getExt2()); + storeBusinessTicket.setExt3(ticket.getExt3()); + storeBusinessTicket.setIsInvalid(ticket.getIsInvalid()); + storeBusinessTicket.setIsMember(ticket.getIsMember()); + storeBusinessTicket.setIsStockDeal(ticket.getIsStockDeal()); + storeBusinessTicket.setMaling(ticket.getMaling()); + storeBusinessTicket.setMemberJifen(ticket.getMemberJifen()); + storeBusinessTicket.setMemberNo(ticket.getMemberNo()); + storeBusinessTicket.setNo("B" + String.valueOf(IdWorkerUtils.getInstance().nextId())); + storeBusinessTicket.setNoOrg(ticket.getNo()); + storeBusinessTicket.setPaid(ticket.getPaid()); + storeBusinessTicket.setPeople(ticket.getPeople()); + storeBusinessTicket.setPosNo(entity.getPosNo()); + storeBusinessTicket.setProfitAmount(0.00); + storeBusinessTicket.setProfitMargin(0.00); + storeBusinessTicket.setReceivable(ticket.getReceivable()); + storeBusinessTicket.setSaleDate(createDate); + storeBusinessTicket.setSeqNo(ticket.getSeqNo()); + storeBusinessTicket.setShiftName(ticket.getShiftName()); + storeBusinessTicket.setShiftNo(ticket.getShiftNo()); + storeBusinessTicket.setStatus(2); + storeBusinessTicket.setStoreId(ticket.getStoreId()); + storeBusinessTicket.setStoreName(ticket.getStoreName()); + storeBusinessTicket.setStoreNo(ticket.getStoreNo()); + storeBusinessTicket.setTableName(ticket.getTableName()); + storeBusinessTicket.setTableNo(ticket.getTableNo()); + storeBusinessTicket.setTenantId(tenantId); + storeBusinessTicket.setTotalCost(0.00); + storeBusinessTicket.setWeather(ticket.getWeather()); + storeBusinessTicket.setWeeker(ticket.getWeeker()); + storeBusinessTicket.setWorkNo(entity.getWorkNo()); + // 主单明细 + List storeBusinessTicketInfoList = new ArrayList<>(); + // 商品明细 + List storeOrderProductList = new ArrayList<>(); + // 优惠详情 + List storeOrderProductInfoList = new ArrayList<>(); + // 商品做法明细 + List storeOrderProductMakeList = new ArrayList<>(); + int i = 1; + for (VposStoreOrderProductRefundPartEntity item : orderProductRefundPart) { + StoreOrderProduct orderProduct = new StoreOrderProduct(); + orderProduct.setAddPriceTotal(0.00); + orderProduct.setAmount(0 - item.getAmount()); + orderProduct.setAmountAddTotal(0.00); + orderProduct.setAmountTotal(0 - item.getAmount()); + orderProduct.setBusMode(ticket.getBusMode()); + orderProduct.setBusNo(storeBusinessTicket.getNo()); + orderProduct.setClientId(String.valueOf(IdWorkerUtils.getInstance().nextId())); + orderProduct.setCount(0.00); + orderProduct.setCreateDate(createDate); + orderProduct.setCreateUser("open-api"); + orderProduct.setDeviceIp(ticket.getDeviceIp()); + orderProduct.setDeviceMac(ticket.getDeviceMac()); + orderProduct.setDeviceName(ticket.getDeviceName()); + orderProduct.setDiscount(0.00); + orderProduct.setDiscountAddTotal(0.00); + orderProduct.setDiscountPrice(item.getPrice()); + orderProduct.setDiscountTotal(0.00); + orderProduct.setEstimatedCost(0.00); + orderProduct.setEstimatedProfitAmount(0.00); + orderProduct.setEstimatedProfitMargin(0.00); + orderProduct.setIsInvalid(0); + orderProduct.setIsMember(ticket.getIsMember()); + orderProduct.setIsStockDeal(0); + orderProduct.setIsSuit(1); + orderProduct.setLineNo(i); + i = i + 1; + orderProduct.setMemberNo(ticket.getMemberNo()); + orderProduct.setParentId(""); + orderProduct.setPosNo(ticket.getPosNo()); + orderProduct.setPrice(item.getPrice()); + orderProduct.setPriceOrg(item.getPrice()); + orderProduct.setProductId(item.getProductId()); + orderProduct.setProductName(item.getProductName()); + orderProduct.setProductNo(item.getProductNo()); + orderProduct.setProductUnitId(item.getProductUnitId()); + orderProduct.setProductUnitName(item.getProductName()); + orderProduct.setProfitAmount(0.00); + orderProduct.setProfitMargin(0.00); + orderProduct.setRcount(item.getBrcount()); + orderProduct.setReceivable(0 - item.getAmount()); + orderProduct.setReceivableTotal(0 - item.getAmount()); + orderProduct.setSaleDate(storeBusinessTicket.getSaleDate()); + orderProduct.setSeqNo(storeBusinessTicket.getSeqNo()); + orderProduct.setSeriesId(item.getSeriesId()); + orderProduct.setSeriesName(item.getSeriesName()); + orderProduct.setSpecId(item.getSpecId()); + orderProduct.setSpecName(item.getSpecName()); + orderProduct.setStoreId(storeBusinessTicket.getStoreId()); + orderProduct.setStoreName(storeBusinessTicket.getStoreName()); + orderProduct.setStoreNo(storeBusinessTicket.getStoreNo()); + orderProduct.setSuitId(""); + orderProduct.setTableName(storeBusinessTicket.getTableName()); + orderProduct.setTableNo(storeBusinessTicket.getTableNo()); + orderProduct.setTenantId(tenantId); + orderProduct.setTotalCost(0.00); + orderProduct.setTypeId(item.getTypeId()); + orderProduct.setTypeName(item.getTypeName()); + orderProduct.setTypePath(item.getTypePath()); + orderProduct.setWeather(storeBusinessTicket.getWeather()); + orderProduct.setWeeker(storeBusinessTicket.getWeeker()); + orderProduct.setWorkerNo(storeBusinessTicket.getWorkNo()); + + for (VposStoreOrderProductMakeRefundPartEntity itemMake : item.getProductMake()) { + StoreOrderProductMake storeOrderProductMake = new StoreOrderProductMake(); + storeOrderProductMake.setAddPrice(itemMake.getAddPrice()); + storeOrderProductMake.setAddTotal(0.00); + storeOrderProductMake.setBusNo(storeBusinessTicket.getNo()); + storeOrderProductMake.setClientId(String.valueOf(IdWorkerUtils.getInstance().nextId())); + storeOrderProductMake.setCount(0.00); + storeOrderProductMake.setCreateDate(createDate); + storeOrderProductMake.setCreateUser("open-api"); + storeOrderProductMake.setDiscount(0.00); + storeOrderProductMake.setDiscountAddTotal(0.00); + storeOrderProductMake.setDiscountPrice(0.00); + storeOrderProductMake.setHand(0); + storeOrderProductMake.setIsInvalid(0); + storeOrderProductMake.setMakeId(itemMake.getMakeId()); + storeOrderProductMake.setMakeName(itemMake.getMakeName()); + storeOrderProductMake.setOrderItemId(orderProduct.getClientId()); + storeOrderProductMake.setQtyFlag(0); + storeOrderProductMake.setRcount(itemMake.getBrcount()); + storeOrderProductMake.setSaleDate(createDate); + storeOrderProductMake.setStoreId(storeId); + storeOrderProductMake.setStoreName(storeBusinessTicket.getStoreName()); + storeOrderProductMake.setStoreNo(storeBusinessTicket.getStoreNo()); + storeOrderProductMake.setTableNo(storeBusinessTicket.getTableNo()); + storeOrderProductMake.setTableName(storeBusinessTicket.getTableName()); + storeOrderProductMake.setTenantId(tenantId); + storeOrderProductMakeList.add(storeOrderProductMake); + } + storeOrderProductList.add(orderProduct); + } + List orderPayRefundPart = entity.getOrderPay(); + // 支付明细 + List storePayList = new ArrayList<>(); + for (VposStorePayRefundPartEntity item : orderPayRefundPart) { + StorePay storePay = new StorePay(); + storePay.setBusMode(storeBusinessTicket.getBusMode()); + storePay.setBusNo(storeBusinessTicket.getNo()); + storePay.setCardJf(item.getCardJf()); + storePay.setCardno(item.getCardno()); + storePay.setCardYe(item.getCardYe()); + storePay.setClientId(String.valueOf(IdWorkerUtils.getInstance().nextId())); + storePay.setCreateDate(createDate); + storePay.setCreateUser("open-api"); + storePay.setDeviceIp(storeBusinessTicket.getDeviceIp()); + storePay.setDeviceMac(storeBusinessTicket.getDeviceMac()); + storePay.setDeviceName(storeBusinessTicket.getDeviceName()); + storePay.setIncomeFlag(item.getIncomeFlag()); + storePay.setIsInvalid(0); + storePay.setMemo(item.getMemo()); + storePay.setMoney(0 - item.getMoney()); + storePay.setOtherRate(item.getOtherRate()); + storePay.setOtherRateType(item.getOtherRateType()); + storePay.setOtherRateValue(item.getOtherRateValue()); + storePay.setOverAmount(0.00); + storePay.setPaid(0 - item.getPaid()); + storePay.setPayChannel(item.getPayChannel()); + storePay.setPayDate(createDate); + storePay.setPayNo(item.getPayNo()); + storePay.setPayType(item.getPayType()); + storePay.setPayTypeNo(item.getPayTypeNo()); + storePay.setPosNo(storeBusinessTicket.getPosNo()); + storePay.setRchange(0.00); + storePay.setStoreId(storeBusinessTicket.getStoreId()); + storePay.setStoreName(storeBusinessTicket.getStoreName()); + storePay.setStoreNo(storeBusinessTicket.getStoreNo()); + storePay.setTableName(storeBusinessTicket.getTableName()); + storePay.setTableNo(storeBusinessTicket.getTableNo()); + storePay.setTenantId(tenantId); + storePay.setVoucherNo(payRefundNo); + storePay.setWorkNo(storeBusinessTicket.getWorkNo()); + storePayList.add(storePay); + } + // MQTT通知厨打 + List orderProduct = new ArrayList<>(); + for (StoreOrderProduct item : storeOrderProductList) { + VposStoreOrderProduct vposStoreOrderProduct = new VposStoreOrderProduct(); + vposStoreOrderProduct.setAddPriceTotal(item.getAddPriceTotal()); + vposStoreOrderProduct.setAmount(item.getAmount()); + vposStoreOrderProduct.setAmountAddTotal(item.getAmountAddTotal()); + vposStoreOrderProduct.setAmountTotal(item.getAmountTotal()); + vposStoreOrderProduct.setBusMode(item.getBusMode()); + vposStoreOrderProduct.setBusNo(item.getBusNo()); + vposStoreOrderProduct.setClientId(item.getClientId()); + vposStoreOrderProduct.setCount(item.getCount()); + vposStoreOrderProduct.setCreateDate(item.getCreateDate()); + vposStoreOrderProduct.setCreateUser(item.getCreateUser()); + vposStoreOrderProduct.setDeviceIp(item.getDeviceIp()); + vposStoreOrderProduct.setDeviceMac(item.getDeviceMac()); + vposStoreOrderProduct.setDeviceName(item.getDeviceName()); + vposStoreOrderProduct.setDiscount(item.getDiscount()); + vposStoreOrderProduct.setDiscountAddTotal(item.getDiscountAddTotal()); + vposStoreOrderProduct.setDiscountPrice(item.getDiscountPrice()); + vposStoreOrderProduct.setDiscountTotal(item.getDiscountTotal()); + vposStoreOrderProduct.setEstimatedCost(item.getEstimatedCost()); + vposStoreOrderProduct.setEstimatedProfitAmount(item.getEstimatedProfitAmount()); + vposStoreOrderProduct.setEstimatedProfitMargin(item.getEstimatedProfitMargin()); + vposStoreOrderProduct.setExt1(item.getExt1()); + vposStoreOrderProduct.setExt2(item.getExt2()); + vposStoreOrderProduct.setExt3(item.getExt3()); + vposStoreOrderProduct.setId(item.getId()); + vposStoreOrderProduct.setIsInvalid(item.getIsInvalid()); + vposStoreOrderProduct.setIsMember(item.getIsMember()); + vposStoreOrderProduct.setIsStockDeal(item.getIsStockDeal()); + vposStoreOrderProduct.setIsSuit(item.getIsSuit()); + vposStoreOrderProduct.setLineNo(item.getLineNo()); + vposStoreOrderProduct.setMemberNo(item.getMemberNo()); + vposStoreOrderProduct.setParentId(item.getParentId()); + vposStoreOrderProduct.setPosNo(item.getPosNo()); + vposStoreOrderProduct.setPrice(item.getPrice()); + vposStoreOrderProduct.setPriceOrg(item.getPriceOrg()); + vposStoreOrderProduct.setProductId(item.getParentId()); + vposStoreOrderProduct.setProductName(item.getProductName()); + vposStoreOrderProduct.setProductNo(item.getProductNo()); + vposStoreOrderProduct.setProductUnitId(item.getProductId()); + vposStoreOrderProduct.setProductUnitName(item.getProductName()); + vposStoreOrderProduct.setProfitAmount(item.getProfitAmount()); + vposStoreOrderProduct.setProfitMargin(item.getProfitMargin()); + vposStoreOrderProduct.setRcount(item.getRcount()); + vposStoreOrderProduct.setReceivable(item.getReceivable()); + vposStoreOrderProduct.setReceivableTotal(item.getReceivableTotal()); + vposStoreOrderProduct.setSaleDate(item.getSaleDate()); + vposStoreOrderProduct.setSeqNo(item.getSeqNo()); + vposStoreOrderProduct.setSeriesId(item.getSeriesId()); + vposStoreOrderProduct.setSeriesName(item.getSeriesName()); + vposStoreOrderProduct.setSpecId(item.getSpecId()); + vposStoreOrderProduct.setSpecName(item.getSpecName()); + vposStoreOrderProduct.setStoreId(item.getStoreId()); + vposStoreOrderProduct.setStoreName(item.getStoreName()); + vposStoreOrderProduct.setStoreNo(item.getStoreNo()); + vposStoreOrderProduct.setSuitId(item.getSuitId()); + vposStoreOrderProduct.setTableName(item.getTableName()); + vposStoreOrderProduct.setTableNo(item.getTableNo()); + vposStoreOrderProduct.setTenantId(item.getTenantId()); + vposStoreOrderProduct.setTicketId(item.getTicketId()); + vposStoreOrderProduct.setTotalCost(item.getTotalCost()); + vposStoreOrderProduct.setTypeId(item.getTypeId()); + vposStoreOrderProduct.setTypeName(item.getTypeName()); + vposStoreOrderProduct.setTypePath(item.getTypePath()); + vposStoreOrderProduct.setWeather(item.getWeather()); + vposStoreOrderProduct.setWeeker(item.getWeeker()); + vposStoreOrderProduct.setWorkerNo(item.getWorkerNo()); + orderProduct.add(vposStoreOrderProduct); + } + List productMakeList = new ArrayList<>(); + for (StoreOrderProductMake item : storeOrderProductMakeList) { + VposStoreOrderProductMake vposStoreOrderProductMake = new VposStoreOrderProductMake(); + vposStoreOrderProductMake.setAddPrice(item.getAddPrice()); + vposStoreOrderProductMake.setAddTotal(item.getAddTotal()); + vposStoreOrderProductMake.setBusNo(item.getBusNo()); + vposStoreOrderProductMake.setClientId(item.getClientId()); + vposStoreOrderProductMake.setCount(item.getCount()); + vposStoreOrderProductMake.setCreateDate(item.getCreateDate()); + vposStoreOrderProductMake.setCreateUser(item.getCreateUser()); + vposStoreOrderProductMake.setDiscount(item.getDiscount()); + vposStoreOrderProductMake.setDiscountAddTotal(item.getDiscountAddTotal()); + vposStoreOrderProductMake.setDiscountPrice(item.getDiscountPrice()); + vposStoreOrderProductMake.setExt1(item.getExt1()); + vposStoreOrderProductMake.setExt2(item.getExt2()); + vposStoreOrderProductMake.setExt3(item.getExt3()); + vposStoreOrderProductMake.setHand(item.getHand()); + vposStoreOrderProductMake.setId(item.getId()); + vposStoreOrderProductMake.setIsInvalid(item.getIsInvalid()); + vposStoreOrderProductMake.setMakeId(item.getMakeId()); + vposStoreOrderProductMake.setMakeName(item.getMakeName()); + vposStoreOrderProductMake.setOrderItemId(item.getOrderItemId()); + vposStoreOrderProductMake.setQtyFlag(item.getQtyFlag()); + vposStoreOrderProductMake.setRcount(item.getRcount()); + vposStoreOrderProductMake.setSaleDate(item.getSaleDate()); + vposStoreOrderProductMake.setStoreId(item.getStoreId()); + vposStoreOrderProductMake.setStoreName(item.getStoreName()); + vposStoreOrderProductMake.setStoreNo(item.getStoreNo()); + vposStoreOrderProductMake.setTableName(item.getTableName()); + vposStoreOrderProductMake.setTableNo(item.getTableNo()); + vposStoreOrderProductMake.setTenantId(item.getTenantId()); + vposStoreOrderProductMake.setTicketId(item.getTicketId()); + productMakeList.add(vposStoreOrderProductMake); + } + // 订单进行分单 + sendMessage(tenantId, storeId, ticket, orderProduct, productMakeList); + // 退款增加库存,放入消息队列 + Map stockMessage = new HashMap<>(); + stockMessage.put("type", "productsalestock"); + stockMessage.put("orderProductList", orderProduct); + CorrelationData correlationData1 = new CorrelationData(UUID.randomUUID().toString()); + this.mqMessageSender.send4productsalestock(tenantId, stockMessage, correlationData1); + // 数据上传,放入消息队列 + Map message = new HashMap<>(); + message.put("type", "businessorderplus"); + message.put("storeBusinessTicket", storeBusinessTicket); + message.put("ticketInfoList", storeBusinessTicketInfoList); + message.put("orderProductList", storeOrderProductList); + message.put("orderProductInfoList", storeOrderProductInfoList); + message.put("payList", storePayList); + message.put("makeList", storeOrderProductMakeList); + message.put("deliveryList", new ArrayList()); + CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString()); + this.mqMessageSender.send4businessorderplus(tenantId, message, correlationData); + Map data = new HashMap<>(); + data.put("busNo", tradeNo); + data.put("refundNo", storeBusinessTicket.getNo()); + response.setStatus(1); + response.setMessage("订单退款成功"); + response.setData(data); + } else { + response.setStatus(0); + response.setMessage("订单状态不合法"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + } else { + response.setStatus(0); + response.setMessage("订单不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "vpos.adpicture.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "美食广场广告图片信息") + @Override + public Object VposAdPictures(VposAdPictureRequest request) { + String info = "美食广场广告图片信息"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + String storeId = request.getStoreId(); + String productTypeId = request.getProductTypeId(); + Integer type = request.getType(); + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize() == null ? 10 : request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("deleteFlag", 0)); + criteria.add(Restrictions.order("orderNo", "asc")); + if (type != null) { + criteria.add(Restrictions.eq("type", type)); + } + + pager = vposAdPictureService.getPager(tenantId, criteria, pager); + if (CollectionUtils.isEmpty(pager.getList())) { + response.setStatus(0); + response.setMessage("图片信息不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + List> list = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(pager.getList())) { + List pictures = (List) pager.getList(); + for (VposAdPicture picture : pictures) { + Map map = new HashMap<>(); + map.put("type", picture.getType()); + map.put("orderNo", picture.getOrderNo()); + map.put("name", picture.getName()); + map.put("linkUrl", picture.getLinkUrl()); + list.add(map); + } + } + + response.setStatus(1); + response.setMessage("获取图片成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "vpos.product.evaluate.upload", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "美食广场商品评价上传") + @Override + public Object VposProductEvaluateUpload(VposProductEvaluateUploadRequest request) { + String info = "美食广场商品评价上传"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + + String openId = request.getOpenId(); + String storeId = request.getStoreId(); + String memberId = request.getMemberId(); + String mobile = request.getMobile(); + String seriesId = request.getSeriesId(); + String productId = request.getProductId(); + String touxiang = request.getTouxiang(); + String memberName = request.getMemberName(); + String memo = request.getMemo(); + Integer level = request.getLevel(); + Integer type = request.getType(); + String tickingTime = request.getTickingTime(); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Store store = storeService.get(tenantId, storeId); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + if (StringUtils.isEmpty(memo)) { + response.setStatus(0); + response.setMessage("评价不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + if (0 == type) { + if (StringUtils.isEmpty(seriesId)) { + response.setStatus(0); + response.setMessage("档口ID不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + } else if (1 == type) { + if (StringUtils.isEmpty(productId)) { + response.setStatus(0); + response.setMessage("商品ID不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + } + + VposProductEvaluate evaluate = new VposProductEvaluate(); + evaluate.setTenantId(tenantId); + evaluate.setMemberId(memberId); + evaluate.setOpenId(openId); + evaluate.setMobile(mobile); + evaluate.setStoreId(storeId); + evaluate.setStoreNo(store.getNo()); + evaluate.setStoreName(store.getName()); + if (0 == type) { + ProductType productType = productTypeService.get(tenantId, seriesId); + evaluate.setSeriesId(seriesId); + evaluate.setSeriesName(productType.getName()); + evaluate.setTypePath(seriesId); + } else if (1 == type) { + Product product = productService.get(tenantId, productId); + evaluate.setProductId(productId); + evaluate.setProductNo(product.getNo()); + evaluate.setProductName(product.getName()); + evaluate.setTypePath(product.getTypePath()); + ProductType productType = productTypeService.get(tenantId, product.getTypeId()); + evaluate.setTypeId(product.getTypeId()); + evaluate.setTypeName(productType.getName()); + String[] typePath = product.getTypePath().split(","); + ProductType seriesType = productTypeService.get(tenantId, typePath[0]); + evaluate.setSeriesId(seriesType.getId()); + evaluate.setSeriesName(seriesType.getName()); + } + // 头像图片来自于微信头像; + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("openid", openId)); + List weixinUsers = weixinUserService.getList(Constant.DEFAULT_DB_SIGN, criteria); + if (CollectionUtils.isNotEmpty(weixinUsers)) { + evaluate.setTouxiang(weixinUsers.get(0).getHeadimgurl()); + } + evaluate.setMemberName(memberName); + evaluate.setMemo(memo); + evaluate.setType(type); + evaluate.setLevel(level); + evaluate.setTickingTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(tickingTime)); + evaluate.setStatus(0); + evaluate.setCreateDate(new Date()); + evaluate.setCreateUser("openApi"); + vposProductEvaluateService.save(tenantId, evaluate); + + Map data = new HashMap<>(); + response.setStatus(1); + response.setMessage("上传成功"); + response.setData(data); + + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "vpos.product.evaluate.view", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "美食广场商品评价查看") + @Override + public Object VposProductEvaluateView(VposProductEvaluateViewRequest request) { + String info = "美食广场商品评价查看"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + String openId = request.getOpenId(); + Integer type = request.getType(); + String seriesId = request.getSeriesId(); + String productId = request.getProductId(); + int pageNumber = request.getPageNumber() == null ? 1 : request.getPageNumber(); + int pageSize = request.getPageSize() == null ? 10 : request.getPageSize(); + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + + Criteria criteria = new Criteria(); + if (StringUtils.isNotEmpty(seriesId)) { + criteria.add(Restrictions.eq("a.seriesId", seriesId)); + } + if (StringUtils.isNotEmpty(productId)) { + criteria.add(Restrictions.eq("a.productId", productId)); + } + if (type != null) { + criteria.add(Restrictions.eq("a.type", type)); + } + criteria.add(Restrictions.order("a.tickingTime", "desc")); + pager = vposProductEvaluateService.getPager4ApiView(tenantId, openId, criteria, pager); + if (CollectionUtils.isEmpty(pager.getList())) { + response.setStatus(0); + response.setMessage("评价信息不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + List> list = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(pager.getList())) { + List evaluates = (List) pager.getList(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd"); + for (VposProductEvaluate evaluate : evaluates) { + Map map = new HashMap<>(); + map.put("memberId", evaluate.getMemberId()); + map.put("openId", evaluate.getOpenId()); + map.put("mobile", evaluate.getMobile()); + map.put("storeId", evaluate.getStoreId()); + map.put("storeNo", evaluate.getStoreNo()); + map.put("storeName", evaluate.getStoreName()); + map.put("seriesId", evaluate.getSeriesId()); + map.put("seriesName", evaluate.getSeriesName()); + map.put("typePath", evaluate.getTypePath()); + map.put("typeId", evaluate.getTypeId()); + map.put("typeName", evaluate.getTypeName()); + map.put("productId", evaluate.getProductId()); + map.put("productNo", evaluate.getProductNo()); + map.put("productName", evaluate.getProductName()); + map.put("touxiang", evaluate.getTouxiang()); + map.put("memberName", evaluate.getMemberName()); + map.put("memo", evaluate.getMemo()); + map.put("type", evaluate.getType()); + map.put("level", evaluate.getLevel()); + map.put("tickingTime", sdf.format(evaluate.getTickingTime())); + map.put("status", evaluate.getStatus()); + list.add(map); + } + } + + response.setStatus(1); + response.setMessage("获取评价信息成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "vpos.product.evaluate.level.view", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "美食广场商品评价级别查询") + @Override + public Object VposProductEvaluateLevelView(VposProductEvaluateLevelViewRequest request) { + String info = "美食广场商品评价级别查询"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + + String seriesId = request.getSeriesId(); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + if (StringUtils.isEmpty(seriesId)) { + response.setStatus(0); + response.setMessage("需要档口ID"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + Map data = new HashMap<>(); + String sql = "select SUM(`level`) as levels,count(id) as counts from cy_vpos_product_evaluate where tenantId = '" + tenantId + "' " + "and status = 1 and seriesId = '" + seriesId + "' and productId is NULL "; + Map map = vposProductEvaluateService.selectOne(tenantId, sql); + BigDecimal seriesLevels = map.get("levels") == null ? new BigDecimal(0.0) : (BigDecimal) map.get("levels"); + long seriesCounts = (long) map.get("counts"); + int seriesLevel = 0; + if (!MathUtil.eq(seriesLevels, BigDecimal.ZERO) && seriesCounts != 0L) { + long levels = seriesLevels.longValue(); + seriesLevel = levels % seriesCounts == 0 ? (int) (levels / seriesCounts) : (int) ((levels / seriesCounts) + 1); + } + data.put("seriesLevel", seriesLevel); + + String productSql = "select productNo,productName,productId, SUM(`level`) as levels,count(productId) as counts from cy_vpos_product_evaluate where tenantId = '" + tenantId + "' " + "and status = 1 and seriesId = '" + seriesId + "' and productId is not null GROUP BY productId ORDER BY productNo asc"; + + List> mapList = vposProductEvaluateService.selectList(tenantId, productSql); + int totalProductLevel = 0; + if (CollectionUtils.isNotEmpty(mapList)) { + BigDecimal totalLevels = new BigDecimal(0); + long counts = 0L; + JSONArray array = new JSONArray(); + for (Map obj : mapList) { + JSONObject object = new JSONObject(); + object.put("productId", obj.get("productId").toString()); + object.put("productNo", obj.get("productNo").toString()); + object.put("productName", obj.get("productName").toString()); + BigDecimal productLevel = obj.get("levels") == null ? new BigDecimal(0) : (BigDecimal) obj.get("levels"); + totalLevels = totalLevels.add(productLevel); + long productCounts = (long) obj.get("counts"); + counts += productCounts; + int productAvgLevel = 0; + if (!MathUtil.eq(productLevel, BigDecimal.ZERO) && productCounts != 0L) { + long levels = productLevel.longValue(); + productAvgLevel = levels % productCounts == 0 ? (int) (levels / productCounts) : (int) ((levels / productCounts) + 1); + } + object.put("productLevel", productAvgLevel); + array.add(object); + } + if (!MathUtil.eq(totalLevels, BigDecimal.ZERO) && counts != 0L) { + long le = totalLevels.longValue(); + totalProductLevel = le % counts == 0 ? (int) (le / counts) : (int) ((le / counts) + 1); + } + data.put("productList", array); + } + data.put("totalProductLevel", totalProductLevel); + response.setStatus(1); + response.setMessage("获取成功"); + response.setData(data); + + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "vpos.windows.ccbfz.infos", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "美食广场档口商铺建行分账信息") + @Override + public Object VposWindowsCcbfzInfos(VposWindowsCcbfzInfosRequest request) { + + String info = "美食广场档口商铺建行分账信息"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String seriesIds = request.getSeriesIds(); + logger.debug("appId=" + appId); + logger.debug("tenantCode=" + tenantCode); + logger.debug("appCode=" + appCode); + logger.debug("tenantId=" + tenantId); + CommonListResponse response = null; + try{ + response = new CommonListResponse(); + List> list = new ArrayList<>(); + Criteria criteria = new Criteria(); + Set seriesSet = new HashSet<>(); + Map pathMap = new HashMap<>(); + if(StringUtils.isNotEmpty(seriesIds)){ + List ids = Arrays.asList(seriesIds.split(",")); + //判断此ID是否还有上级; + Criteria criter = new Criteria(); + criter.add(Restrictions.in("id",ids)); + List types = productTypeService.getList(tenantId,criter); + if(CollectionUtils.isNotEmpty(types)){ + for(ProductType type : types){ + pathMap.put(type.getId(),type.getPath()); + if(StringUtils.isBlank(type.getParentId())){ + seriesSet.add(type.getId()); + }else{ + seriesSet.add(type.getPath().substring(0,type.getPath().indexOf(","))); + } + } + }else{ + response.setStatus(0); + response.setMessage("未查询到档口信息"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + } + List accounts = vposCcbfzAccountService.getList(tenantId,criteria); + if(CollectionUtils.isNotEmpty(accounts)){ + if(seriesSet.size() > 0){ + for(VposCcbfzAccount account : accounts){ + String[] seriesIdArr = account.getSeriesId().split(","); + for(String sereisId : seriesIdArr){ + if(seriesSet.contains(sereisId)){ + Map map = new HashMap<>(); + map.put("accountId",account.getId()); + map.put("seriesId",sereisId); + String typeIds = ""; + for(String key : pathMap.keySet()){ + String path = pathMap.get(key); + if(StringUtils.contains(path,sereisId)){ + typeIds += key +","; + } + } + if(typeIds.contains(",")){ + typeIds = typeIds.substring(0,typeIds.length()-1); + } + map.put("typeId",typeIds); + map.put("receiveNoType",account.getReceiveNoType()); + map.put("receiveNo",account.getReceiveNo()); + map.put("accountType",account.getAcountType()); + map.put("refundSign",account.getRefundSign()+""); + list.add(map); + } + } + } + }else{ + for(VposCcbfzAccount account : accounts){ + String[] seriesIdArr = account.getSeriesId().split(","); + for(String sereisId : seriesIdArr){ + Map map = new HashMap<>(); + map.put("accountId",account.getId()); + map.put("seriesId",sereisId); + map.put("receiveNoType",account.getReceiveNoType()); + map.put("receiveNo",account.getReceiveNo()); + map.put("accountType",account.getAcountType()); + map.put("refundSign",account.getRefundSign()+""); + list.add(map); + } + } + } + + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + }catch (Exception e){ + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + + return response; + } + + + private String escape(String escapeStr) { + String info = "分账信息escape转码"; + ScriptEngineManager sem = new ScriptEngineManager(); + ScriptEngine engine = sem.getEngineByExtension("js"); + String res = null; + try { + //直接解析 + res = (String) engine.eval(" escape('" + escapeStr + "')"); + + } catch (Exception e) { + logger.error(info + ",发生异常", e); + } + return res; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/waimai/WaiMaiService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/waimai/WaiMaiService.java new file mode 100644 index 0000000..05deb41 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/waimai/WaiMaiService.java @@ -0,0 +1,46 @@ +package com.jwsaas.api.service.waimai; + +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.api.request.waimai.OrderStatisticsRequest; +import com.jwsaas.api.service.WopService; +import javafx.beans.binding.ObjectExpression; + +/** + * 外卖相关 + */ +public interface WaiMaiService extends WopService { + + /** + * 订单统计 + */ + Object orderStatistics(OrderStatisticsRequest request); + + /** + * 美团门店绑定前保存数据; + * @param request + * @return + */ + Object meituanBrachBindStore(StoreBaseRequest request); + + /** + * 饿了么门店绑定前保存数据; + * @param request + * @return + */ + Object elemeAuthorizeBindStore(StoreBaseRequest request); + + /** + * 饿了么门店解除绑定; + * @param request + * @return + */ + Object elemeAuthorizeUnbindStore(StoreBaseRequest request); + + /** + * 果盘门店信息; + * @param request + * @return + */ + Object guopanStoreInfo(StoreBaseRequest request); + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/waimai/impl/WaiMaiServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/waimai/impl/WaiMaiServiceImpl.java new file mode 100644 index 0000000..554bea7 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/waimai/impl/WaiMaiServiceImpl.java @@ -0,0 +1,444 @@ +package com.jwsaas.api.service.waimai.impl; + +import java.math.BigDecimal; +import java.util.*; + +import javax.annotation.Resource; + +import com.alibaba.fastjson.JSON; +import com.jwsaas.Constants; +import com.jwsaas.api.request.store.StoreBaseRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.ops.AppGuopanStoreInfo; +import com.jwsaas.entity.ops.ElemeAuthorizeInfo; +import com.jwsaas.entity.ops.MeituanBranch; +import com.jwsaas.service.ops.AppGuopanStoreInfoService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; + +import com.jwsaas.api.request.waimai.OrderStatisticsRequest; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.response.mode.CommonListResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.waimai.WaiMaiService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.entity.food.Store; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.utils.AppKeyUtil; +import com.jwsaas.utils.MathUtil; + +@ServiceMethodBean(version = "1.0") +public class WaiMaiServiceImpl extends WopServiceImpl implements WaiMaiService { + + private static final long serialVersionUID = -937717100990513507L; + + @Resource + private com.jwsaas.service.food.StoreService storeService; + @Resource + private com.jwsaas.service.food.MeituanOrderService meituanOrderService; + @Resource + private com.jwsaas.service.food.ElemeOrderDetailService elemeOrderService; + @Resource + private com.jwsaas.service.food.BaiduOrderService baiduOrderService; + @Resource + private com.jwsaas.service.ops.MeituanBranchService meituanBranchService; + @Resource + private com.jwsaas.service.ops.ElemeAuthorizeInfoService elemeAuthorizeInfoService; + @Resource + private AppGuopanStoreInfoService appGuopanStoreInfoService; + + /** + * 订单统计 + */ + @ServiceMethod(method = "waimai.order.statistics", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "订单统计") + @Override + public Object orderStatistics(OrderStatisticsRequest request) { + String info = "订单统计(外卖)"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId();// 门店ID + String startTime = request.getStartTime();// 开始时间 + String endTime = request.getEndTime();// 结束时间 + + CommonListResponse response = null; + try { + response = new CommonListResponse(); + if (StringUtils.isBlank(startTime)) { + response.setStatus(0); + response.setMessage("参数startTime不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (StringUtils.isBlank(endTime)) { + response.setStatus(0); + response.setMessage("参数endTime不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + + StringBuffer sqlBuf = new StringBuffer(); + sqlBuf.append(" select count(orderId) as total,count(case when status = 8 then orderId end) as success,count(case when status = 9 then orderId end) as failed, "); + sqlBuf.append(" count(case when status <> 8 and `status` <> 9 then orderId end ) as other, "); + sqlBuf.append(" sum(case when status=8 THEN originalPrice else 0 END) as originalAmount,sum(case when status=8 THEN shippingFee else 0 END) as shippingFee,SUM(case when status=8 THEN wmPoiReceiveCent else 0 END) as receiveAmount "); + sqlBuf.append(" from cy_shop_meituan_order where tenantId = '" + tenantId + "' "); + sqlBuf.append(" AND storeId='" + storeId + "' AND createDate >= '" + startTime + "' and createDate<= '" + endTime + "' "); + logger.debug("sql:" + sqlBuf.toString()); + Map meiTuanDataMap = meituanOrderService.selectOne(tenantId, sqlBuf.toString()); + meiTuanDataMap.put("sign", "meituan"); + meiTuanDataMap.put("originalAmount", meiTuanDataMap.get("originalAmount") == null ? 0D : Double.valueOf(meiTuanDataMap.get("originalAmount").toString())); + meiTuanDataMap.put("shippingFee", meiTuanDataMap.get("shippingFee") == null ? 0D : Double.valueOf(meiTuanDataMap.get("shippingFee").toString())); + meiTuanDataMap.put("receiveAmount", + MathUtil.divide(meiTuanDataMap.get("receiveAmount") == null ? BigDecimal.ZERO : new BigDecimal(meiTuanDataMap.get("receiveAmount").toString()), new BigDecimal(100D)).setScale(4, + BigDecimal.ROUND_HALF_DOWN)); + meiTuanDataMap.put("totalAmount", MathUtil.subtract(new BigDecimal((Double) meiTuanDataMap.get("originalAmount")), new BigDecimal((Double) meiTuanDataMap.get("shippingFee"))).setScale(4, + BigDecimal.ROUND_HALF_DOWN)); + + sqlBuf = new StringBuffer(); + sqlBuf.append(" select count(orderId) as total,sum(case when status='settled' THEN 1 else 0 END ) as success,sum(case when refundStatus='successful' THEN 1 when status='invalid' THEN 1 else 0 END) as failed, "); + sqlBuf.append(" sum(case when status <> 'settled' and status <> 'invalid' and refundStatus <> 'successful' THEN 1 else 0 END) as other, "); + sqlBuf.append(" sum(case when status='settled' THEN originalPrice else 0 END) as originalAmount,sum(case when status='settled' THEN deliverFee else 0 END) as shippingFee, SUM(case when status='settled' THEN income else 0 END) as receiveAmount "); + sqlBuf.append(" from cy_eleme_order_detail where tenantId = '" + tenantId + "' "); + sqlBuf.append(" AND storeId='" + storeId + "' AND createdAt>= '" + startTime + "' and createdAt<='" + endTime + "' "); + logger.debug("sql:" + sqlBuf.toString()); + Map elemeDataMap = elemeOrderService.selectOne(tenantId, sqlBuf.toString()); + elemeDataMap.put("sign", "eleme"); + elemeDataMap.put("success", elemeDataMap.get("success") == null ? 0 : Integer.valueOf(elemeDataMap.get("success").toString())); + elemeDataMap.put("other", elemeDataMap.get("other") == null ? 0 : Integer.valueOf(elemeDataMap.get("other").toString())); + elemeDataMap.put("failed", elemeDataMap.get("failed") == null ? 0 : Integer.valueOf(elemeDataMap.get("failed").toString())); + elemeDataMap.put("originalAmount", elemeDataMap.get("originalAmount") == null ? 0D : Double.valueOf(elemeDataMap.get("originalAmount").toString())); + elemeDataMap.put("shippingFee", elemeDataMap.get("shippingFee") == null ? 0D : Double.valueOf(elemeDataMap.get("shippingFee").toString())); + elemeDataMap.put("receiveAmount", elemeDataMap.get("receiveAmount") == null ? 0D : Double.valueOf(elemeDataMap.get("receiveAmount").toString())); + elemeDataMap.put("totalAmount", + MathUtil.subtract(new BigDecimal((Double) elemeDataMap.get("originalAmount")), new BigDecimal((Double) elemeDataMap.get("shippingFee"))).setScale(4, BigDecimal.ROUND_HALF_DOWN)); + // 订单金额=订单原价-配送费用 + + List> list = new ArrayList<>(); + list.add(meiTuanDataMap); + list.add(elemeDataMap); + + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 美团门店绑定前保存数据 + * @param request + * @return + */ + @ServiceMethod(method = "waimai.meituan.store.save", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "美团门店绑定前保存数据") + @Override + public Object meituanBrachBindStore(StoreBaseRequest request) { + String info = "美团门店绑定前保存数据"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId();// 门店ID + + CommonDataResponse response = null; + try{ + response = new CommonDataResponse(); + if (StringUtils.isBlank(storeId)) { + response.setStatus(0); + response.setMessage("参数storeId不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + Store store = storeService.get(tenantId,storeId); + if(store == null){ + response.setStatus(0); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantCode",tenantId)); + criteria.add(Restrictions.eq("storeId",storeId)); + List meituanBranches = meituanBranchService.getList(Constants.DEFAULT_DB_SIGN,criteria); + if(CollectionUtils.isNotEmpty(meituanBranches)){ + response.setStatus(1); + response.setMessage("获取成功"); + Map map = new HashMap<>(); + map.put("storeId",storeId); + map.put("storeName",store.getName()); + response.setData(map); + }else{ + MeituanBranch branch = new MeituanBranch(); + branch.setTenantId(Constants.DEFAULT_DB_SIGN); + branch.setTenantCode(tenantId); + branch.setAppSign(Constants.APP_TYPE_SIGN); + branch.setStoreId(store.getId()); + branch.setNo(tenantId+store.getNo()); + branch.setName(store.getName()); + branch.setStoreName(store.getName()); + branch.setStoreNo(store.getNo()); + branch.setBusinessId(2); + branch.setStatus(0); + branch.setCreateUser(store.getNo()+"-openApi"); + branch.setCreateDate(new Date()); + meituanBranchService.save(Constants.DEFAULT_DB_SIGN,branch); + + response.setStatus(1); + response.setMessage("保存成功"); + Map map = new HashMap<>(); + map.put("storeId",storeId); + map.put("storeName",store.getName()); + response.setData(map); + } + }catch (Exception e){ + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + *饿了么门店绑定前保存数据 + * @param request + * @return + */ + @ServiceMethod(method = "waimai.eleme.store.save", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "饿了么门店绑定前保存数据") + @Override + public Object elemeAuthorizeBindStore(StoreBaseRequest request) { + String info = "饿了么门店绑定前保存数据"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId();// 门店ID + + CommonDataResponse response = null; + try{ + response = new CommonDataResponse(); + if (StringUtils.isBlank(storeId)) { + response.setStatus(0); + response.setMessage("参数storeId不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + Store store = storeService.get(tenantId,storeId); + if(store == null){ + response.setStatus(0); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantCode",tenantId)); + criteria.add(Restrictions.eq("storeId",storeId)); + List infos = elemeAuthorizeInfoService.getList(Constants.DEFAULT_DB_SIGN,criteria); + if(CollectionUtils.isNotEmpty(infos)){ + response.setStatus(1); + response.setMessage("获取成功"); + Map map = new HashMap<>(); + map.put("storeId",storeId); + map.put("no",infos.get(0).getNo()); + map.put("storeName",store.getName()); + response.setData(map); + }else{ + ElemeAuthorizeInfo einfo = new ElemeAuthorizeInfo(); + einfo.setTenantId(Constants.DEFAULT_DB_SIGN); + einfo.setTenantCode(tenantId); + einfo.setAppSign(Constants.APP_TYPE_SIGN); + einfo.setNo(tenantId+store.getNo()); + einfo.setName(store.getName()); + einfo.setStoreNo(store.getNo()); + einfo.setStoreId(storeId); + einfo.setStoreName(store.getName()); + einfo.setCreateUser(store.getNo()+"-openApi"); + einfo.setCreateDate(new Date()); + elemeAuthorizeInfoService.save(Constants.DEFAULT_DB_SIGN,einfo); + + response.setStatus(1); + response.setMessage("保存成功"); + Map map = new HashMap<>(); + map.put("storeId",storeId); + map.put("no",einfo.getNo()); + map.put("storeName",store.getName()); + response.setData(map); + } + + + }catch (Exception e){ + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + + + return response; + } + + /** + * 饿了么门店解除绑定 + * @param request + * @return + */ + @ServiceMethod(method = "waimai.eleme.store.unbind", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "饿了么门店解除绑定") + @Override + public Object elemeAuthorizeUnbindStore(StoreBaseRequest request) { + String info = "饿了么门店解除绑定"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId();// 门店ID + + CommonDataResponse response = null; + try{ + response = new CommonDataResponse(); + if (StringUtils.isBlank(storeId)) { + response.setStatus(0); + response.setMessage("参数storeId不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + + ElemeAuthorizeInfo einfo = elemeAuthorizeInfoService.find(Constants.DEFAULT_DB_SIGN,"storeId",storeId); + if(einfo == null){ + response.setStatus(0); + response.setMessage("没有查询到此授权信息,请先授权"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + if(StringUtils.isEmpty(einfo.getAccessToken())){ + response.setStatus(0); + response.setMessage("此门店未授权,请先授权"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + einfo.setClientId(null); + einfo.setResponseType(null); + einfo.setRedirectUri(null); + einfo.setScope(null); + einfo.setState(null); + einfo.setCode(null); + einfo.setGrantType(null); + einfo.setAccessToken(null); + einfo.setTokenType(null); + einfo.setTokenGetTime(null); + einfo.setRefreshToken(null); + einfo.setUserId(null); + einfo.setUserName(null); + einfo.setExpiresIn(null); + einfo.setShopId(null); + einfo.setShopName(null); + elemeAuthorizeInfoService.update(Constants.DEFAULT_DB_SIGN,einfo); + + response.setStatus(1); + response.setMessage("保存成功"); + Map map = new HashMap<>(); + map.put("storeId",storeId); + map.put("storeName",einfo.getStoreName()); + response.setData(map); + + }catch (Exception e){ + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + + return response; + } + + /** + * 获取果盘门店信息; + * @param request + * @return + */ + @ServiceMethod(method = "waimai.guopan.store", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "获取果盘门店信息") + @Override + public Object guopanStoreInfo(StoreBaseRequest request) { + String info = "获取果盘门店信息"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId();// 门店ID + + CommonDataResponse response = null; + try{ + response = new CommonDataResponse(); + if (StringUtils.isBlank(storeId)) { + response.setStatus(0); + response.setMessage("参数storeId不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantCode",tenantCode)); + criteria.add(Restrictions.eq("storeId",storeId)); + List storeInfos = appGuopanStoreInfoService.getList(Constants.DEFAULT_DB_SIGN,criteria); + if(CollectionUtils.isEmpty(storeInfos)){ + response.setStatus(0); + response.setMessage("此门店未授权,请先授权"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + AppGuopanStoreInfo storeInfo = storeInfos.get(0); + Map map = JSON.parseObject(JSON.toJSONString(storeInfo),Map.class); + response.setStatus(1); + response.setMessage("获取成功"); + response.setData(map); + + }catch (Exception e){ + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + + return response; + } + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/weixin/WeiXinService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/weixin/WeiXinService.java new file mode 100644 index 0000000..420ed08 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/weixin/WeiXinService.java @@ -0,0 +1,178 @@ +package com.jwsaas.api.service.weixin; + +import com.jwsaas.api.request.weixin.*; +import com.jwsaas.api.service.WopService; + +public interface WeiXinService extends WopService { + + /** + * 员工可查询门店列表 + * + * @param request + * @return + */ + Object workerStore(WorkerStoreRequest request); + + /** + * 日营业汇总 + * + * @param request + * @return + */ + Object daySummary(DaySummaryRequest request); + + /** + * 根据时间范围,获取营业汇总数据 + */ + Object daySummaryByDateRange(DaySummaryByDateRangeRequest request); + + /** + * 门店日营业汇总 + * + * @param request + * @return + */ + Object daySummaryList(DaySummaryListRequest request); + + /** + * 根据时间范围,获取门店日营业汇总数据 + * + * @param request + * @return + */ + Object daySummaryListByDateRange(DaySummaryListByDateRangeRequest request); + + /** + * 根据时间范围,获取门店日营业汇总数据(新,包含:现金、微信、支付宝、云闪付、其他) + * @param request + * @return + */ + Object daySummaryWithPayTypeListByDateRange(DaySummaryListByDateRangeRequest request); + + /** + * 产品销售排行 + * + * @param request + * @return + */ + Object productRank(ProductRankRequest request); + + /** + * 产品销售汇总 + */ + Object productSalesSummary(ProductSalesSummaryRequest request); + + /** + * 销售汇总列表 + * + * @param request + * @return + */ + Object orderSummaryList(OrderSummaryListRequest request); + + /** + * 类别销售汇总列表 + * + * @param request + * @return + */ + Object categorySummaryList(CategorySummaryListRequest request); + + /** + * 时段销售汇总列表 + * + * @param request + * @return + */ + Object timeSummaryList(TimeSummaryListRequest request); + + /** + * 支付方式汇总列表 + */ + Object paySummaryList(PaySummaryListRequest request); + + /** + * 销售毛利分析 + */ + Object grossProfitAnalysis(GrossProfitAnalysisRequest request); + + /** + * 代理商可查询门店列表 + * + * @param request + * @return + */ + Object agentStore(AgentStoreRequest request); + + + /** + * 美食广场档口商户对应档口列表; + * @param request + * @return + */ + Object vposUserSeries(VposUserSeriesRequest request); + + /** + * 根据时间范围,获取营业日报数据 + */ + Object salesDailyByDateRange(SalesDailyByDateRangeRequest request); + + /** + * 掌柜查询,首页销售概况数据; + * @param request + * @return + */ + Object indexSalesSummary(SalesDailyByDateRangeRequest request); + + /** + * 获取外卖汇总数据 + */ + Object waiMaiOrderStatistics(WaiMaiOrderStatisticsRequest request); + + /** + * 根据时间范围,按营业额金额排行 + * + * @param request + * @return + */ + Object daySummaryListRank(DaySummaryListByDateRangeRequest request); + + /** + * 掌柜查询员工权限 + * + * @param request + * @return + */ + Object managerWorkerModule(ManagerWorkerModuleRequest request); + + /** + * 掌柜查询操作日志汇总 + * + * @param request + * @return + */ + Object storeOperationLogSummary(DaySummaryListByDateRangeRequest request); + + /** + * 掌柜查询操作日志 + * + * @param request + * @return + */ + Object storeOperationLogList(DaySummaryListByDateRangeRequest request); + + /** + * 美食广场档口销售汇总; + * @return + */ + Object vposSalesSummary(VposSalesSummaryRequest request); + + /** + * 美食广场档口单品销售汇总; + * @param request + * @return + */ + Object vposProductSalesSummary(VposSalesSummaryRequest request); + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/weixin/impl/WeiXinServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/weixin/impl/WeiXinServiceImpl.java new file mode 100644 index 0000000..8de3782 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/weixin/impl/WeiXinServiceImpl.java @@ -0,0 +1,1513 @@ +package com.jwsaas.api.service.weixin.impl; + +import java.math.BigDecimal; +import java.util.*; + +import javax.annotation.Resource; + +import com.jwsaas.api.request.weixin.*; +import com.jwsaas.api.service.weixin.WeiXinService; +import com.jwsaas.entity.food.*; +import com.jwsaas.service.food.StoreOperationLogService; +import com.jwsaas.service.food.VposStoreOrderProductService; +import com.jwsaas.service.food.VposUserSeriesService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; + +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonListResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; + +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.utils.AppKeyUtil; +import com.jwsaas.utils.MathUtil; + +@ServiceMethodBean(version = "1.0") +public class WeiXinServiceImpl extends WopServiceImpl implements WeiXinService { + + private static final long serialVersionUID = -345096567692034966L; + + @Resource + private com.jwsaas.service.food.StoreService storeService; + @Resource + private com.jwsaas.service.food.StoreWorkerService storeWorkerService; + @Resource + private com.jwsaas.service.food.StoreBusinessTicketService storeBusinessTicketService; + @Resource + private com.jwsaas.service.food.StorePayService storePayService; + @Resource + private com.jwsaas.service.food.AgentStoreService agentStoreService; + @Resource + private com.jwsaas.service.food.MeituanOrderService meituanOrderService; + @Resource + private com.jwsaas.service.food.ElemeOrderDetailService elemeOrderService; + @Resource + private com.jwsaas.service.food.BaiduOrderService baiduOrderService; + @Resource + private com.jwsaas.service.food.PosRoleService posRoleService; + @Resource + private StoreOperationLogService storeOperationLogService; + @Resource + private VposUserSeriesService vposUserSeriesService; + @Resource + private VposStoreOrderProductService vposStoreOrderProductService; + + + @ServiceMethod(method = "weixin.worker.store", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "员工可查询门店列表") + @Override + public Object workerStore(WorkerStoreRequest request) { + String info = "员工可查询门店列表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String workerId = request.getWorkerId(); + String storeNo = request.getStoreNo(); + CommonListResponse response = null; + try { + Criteria criteria = null; + List> list = new ArrayList<>(); + if ("000000".equals(storeNo)) { + // 总部员工返回所有门店信息,可以调整为如果只关联了一个门店即总部门店则查询所有门店,关联门店多于一个的话则只查询他关联的门店 + criteria = new Criteria(); + criteria.add(Restrictions.eq("deleteFlag", 0)); + criteria.add(Restrictions.eq("authFlag", 1)); + criteria.add(Restrictions.eq("enabled", 1)); + List source = storeService.getList(tenantId, criteria); + for (Store store : source) { + Map map = new HashMap<>(); + map.put("tenantId", store.getTenantId()); + map.put("id", store.getId()); + map.put("no", store.getNo()); + map.put("name", store.getName()); + map.put("address", store.getAddress()); + list.add(map); + } + } else { +// List storeIds = storeWorkerService.getStoreIdList(tenantId, workerId); +// if (storeIds != null && storeIds.size() > 0) { +// criteria = new Criteria(); +// criteria.add(Restrictions.in("id", storeIds)); +// List source = storeService.getList(tenantId, criteria); +// for (Store store : source) { +// Map map = new HashMap<>(); +// map.put("tenantId", store.getTenantId()); +// map.put("id", store.getId()); +// map.put("no", store.getNo()); +// map.put("name", store.getName()); +// map.put("address", store.getAddress()); +// list.add(map); +// } +// } + criteria = new Criteria(); + criteria.add(Restrictions.eq("deleteFlag", 0)); + criteria.add(Restrictions.eq("no", storeNo)); + List source = storeService.getList(tenantId, criteria); + for (Store store : source) { + Map map = new HashMap<>(); + map.put("tenantId", store.getTenantId()); + map.put("id", store.getId()); + map.put("no", store.getNo()); + map.put("name", store.getName()); + map.put("address", store.getAddress()); + list.add(map); + } + } + response = new CommonListResponse(); + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "WORKER_STORE_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "weixin.day.summary", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "日营业汇总") + @Override + public Object daySummary(DaySummaryRequest request) { + String info = "日营业汇总"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String saleDate = request.getSaleDate(); + String storeIds = request.getStoreIds(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + StringBuffer sqlBuf = new StringBuffer(); + sqlBuf.append(" select sum(amount) as amount,sum(receivable) as receivableAmount,sum(discountTotal) as discountAmount, "); + sqlBuf.append(" sum(case when status = 4 then 1 else 0 end ) as tickCount, "); + sqlBuf.append(" sum(case when status = 2 then 1 else 0 end ) as backCount "); + sqlBuf.append(" from cy_store_business_ticket where tenantId = '" + tenantId + "' "); + sqlBuf.append(" AND isInvalid=0 AND saleDate like '%" + saleDate + "%' AND status in(2,4) "); + if (storeIds != null && !"".equals(storeIds)) { + if(StringUtils.contains(storeIds,",")){ + sqlBuf.append(" AND storeId in(" + storeIds + ")"); + }else{ + sqlBuf.append(" AND storeId = '" + storeIds + "' "); + } + } + Map map = storeBusinessTicketService.selectOne(tenantId, sqlBuf.toString()); + if (map == null) { + map = new HashMap(); + map.put("amount", 0.00); + map.put("receivableAmount", 0.00); + map.put("discountAmount", 0.00); + map.put("tickCount", 0); + map.put("backCount", 0); + } + response.setStatus(1); + response.setMessage("查询成功"); + response.setData(map); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "DAY_SUMMARY_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "weixin.day.summary.daterage", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "根据时间范围,获取营业汇总数据") + @Override + public Object daySummaryByDateRange(DaySummaryByDateRangeRequest request) { + String info = "根据时间范围,获取营业汇总数据"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String startTime = request.getStartTime();// 开始时间 + String endTime = request.getEndTime();// 结束时间 + String storeIds = request.getStoreIds(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Map map = null; + StringBuffer sqlBuf = new StringBuffer(); + sqlBuf.append(" select sum(amount) as amount,sum(receivable) as receivableAmount,sum(discountTotal) as discountAmount, storeId,"); + sqlBuf.append(" sum(case when status = 4 then 1 else 0 end ) as tickCount, "); + sqlBuf.append(" sum(case when status = 2 then 1 else 0 end ) as backCount "); + sqlBuf.append(" from cy_store_business_ticket where tenantId = '" + tenantId + "' "); + sqlBuf.append(" AND isInvalid=0 AND saleDate BETWEEN '" + startTime + "' AND '" + endTime + "' AND status in(2,4) "); + if (storeIds != null && !"".equals(storeIds)) { + if(StringUtils.contains(storeIds,",")){ + //sqlBuf.append(" AND storeId in(" + storeIds + ")"); + sqlBuf.append(" group by storeId "); + List ids = Arrays.asList(storeIds.split(",")); + Set idSet = new HashSet<>(ids); + List> mapList = storeBusinessTicketService.selectList(tenantId,sqlBuf.toString()); + if(CollectionUtils.isNotEmpty(mapList)){ + map = new HashMap<>(); + BigDecimal amount = new BigDecimal(0.0); + BigDecimal receivableAmount = new BigDecimal(0.0); + BigDecimal discountAmount = new BigDecimal(0.0); + BigDecimal tickCount = new BigDecimal(0.0); + BigDecimal backCount = new BigDecimal(0.0); + + for(Map sop : mapList){ + if(idSet.contains(sop.get("storeId").toString())){ + amount = amount.add((BigDecimal)sop.get("amount")); + receivableAmount = receivableAmount.add((BigDecimal)sop.get("receivableAmount")); + discountAmount = discountAmount.add((BigDecimal)sop.get("discountTotal")); + tickCount = tickCount.add((BigDecimal)sop.get("tickCount")); + backCount = backCount.add((BigDecimal)sop.get("backCount")); + } + } + map.put("amount",amount); + map.put("receivableAmount", receivableAmount); + map.put("discountAmount", discountAmount); + map.put("tickCount", tickCount); + map.put("backCount", backCount); + } + + }else{ + sqlBuf.append(" AND storeId = '" + storeIds + "' "); + map = storeBusinessTicketService.selectOne(tenantId, sqlBuf.toString()); + } + + } + + if (map == null) { + map = new HashMap(); + map.put("amount", 0.00); + map.put("receivableAmount", 0.00); + map.put("discountAmount", 0.00); + map.put("tickCount", 0); + map.put("backCount", 0); + } + response.setStatus(1); + response.setMessage("查询成功"); + response.setData(map); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "weixin.day.summary.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店日营业汇总") + @Override + public Object daySummaryList(DaySummaryListRequest request) { + String info = "门店日营业汇总"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String saleDate = request.getSaleDate(); + String storeIds = request.getStoreIds(); + CommonListResponse response = null; + try { + response = new CommonListResponse(); + StringBuffer sqlBuf = new StringBuffer(); + sqlBuf.append(" select storeId,storeNo,storeName, sum(amount) as amount,sum(receivable) as receivableAmount,sum(discountTotal) as discountAmount, "); + sqlBuf.append(" sum(case when status = 4 then 1 else 0 end ) as tickCount, "); + sqlBuf.append(" sum(case when status = 2 then 1 else 0 end ) as backCount "); + sqlBuf.append(" from cy_store_business_ticket where tenantId = '" + tenantId + "' "); + sqlBuf.append(" AND isInvalid=0 AND saleDate like '%" + saleDate + "%' AND status in(2,4) "); + if (storeIds != null && !"".equals(storeIds)) { + if(StringUtils.contains(storeIds,",")){ + sqlBuf.append(" AND storeId in(" + storeIds + ")"); + }else{ + sqlBuf.append(" AND storeId = '" + storeIds + "' "); + } + } + sqlBuf.append(" GROUP BY storeId order by storeNo "); + List> list = storeBusinessTicketService.selectList(tenantId, sqlBuf.toString()); + if (list == null) { + list = new ArrayList<>(); + } + response.setStatus(1); + response.setMessage("查询成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "DAY_SUMMARY_LIST_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 根据时间范围,获取门店日营业汇总数据 + */ + @ServiceMethod(method = "weixin.day.summary.list.daterage", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "根据时间范围,获取门店日营业汇总数据") + @Override + public Object daySummaryListByDateRange(DaySummaryListByDateRangeRequest request) { + String info = "根据时间范围,获取门店日营业汇总数据"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String startTime = request.getStartTime();// 开始时间 + String endTime = request.getEndTime();// 结束时间; + String storeIds = request.getStoreIds(); + CommonListResponse response = null; + try { + response = new CommonListResponse(); + StringBuffer sqlBuf = new StringBuffer(); + sqlBuf.append(" select storeId,storeNo,storeName, sum(amount) as amount,sum(receivable) as receivableAmount,sum(discountTotal) as discountAmount, "); + sqlBuf.append(" sum(case when status = 4 then 1 else 0 end ) as tickCount, "); + sqlBuf.append(" sum(case when status = 2 then 1 else 0 end ) as backCount "); + sqlBuf.append(" from cy_store_business_ticket where tenantId = '" + tenantId + "' "); + sqlBuf.append(" AND isInvalid=0 AND saleDate BETWEEN '" + startTime + "' AND '" + endTime + "' AND status in(2,4) "); + if (storeIds != null && !"".equals(storeIds)) { + if(StringUtils.contains(storeIds,",")){ + sqlBuf.append(" AND storeId in(" + storeIds + ")"); + }else{ + sqlBuf.append(" AND storeId = '" + storeIds + "' "); + } + } + sqlBuf.append(" GROUP BY storeId order by storeNo "); + List> list = storeBusinessTicketService.selectList(tenantId, sqlBuf.toString()); + if (list == null) { + list = new ArrayList<>(); + } + response.setStatus(1); + response.setMessage("查询成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + + /** + * 根据时间范围,获取门店日营业汇总数据(新,包含:现金、微信、支付宝、云闪付、其他) + */ + @ServiceMethod(method = "weixin.day.summary.paytype.list.daterage", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "根据时间范围,获取门店日营业汇总数据") + @Override + public Object daySummaryWithPayTypeListByDateRange(DaySummaryListByDateRangeRequest request) { + String info = "根据时间范围,获取门店日营业汇总数据"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String startTime = request.getStartTime();// 开始时间 + String endTime = request.getEndTime();// 结束时间; + String storeIds = request.getStoreIds(); + CommonListResponse response = null; + try { + response = new CommonListResponse(); + StringBuffer sqlBuf = new StringBuffer(); + sqlBuf.append(" select storeId,storeNo,storeName, sum(amount) as amount,sum(receivable) as receivableAmount," + + "sum(discountTotal) as discountAmount, "); + sqlBuf.append(" sum(case when status = 4 then 1 else 0 end ) as tickCount, "); + sqlBuf.append(" sum(case when status = 2 then 1 else 0 end ) as backCount "); + sqlBuf.append(" from cy_store_business_ticket where tenantId = '" + tenantId + "' "); + sqlBuf.append(" AND isInvalid=0 AND saleDate BETWEEN '" + startTime + "' AND '" + endTime + "' AND status in(2,4) "); + if (StringUtils.isNotBlank(storeIds)) { + if (StringUtils.contains(storeIds, ",")) { + sqlBuf.append(" AND storeId in(" + storeIds + ")"); + } else { + sqlBuf.append(" AND storeId = '" + storeIds + "' "); + } + } + sqlBuf.append(" GROUP BY storeId order by storeNo "); + List> list = storeBusinessTicketService.selectList(tenantId, sqlBuf.toString()); + if (CollectionUtils.isNotEmpty(list)) { + // 收银方式 + sqlBuf = new StringBuffer(); + sqlBuf.append(" select storeId,SUM(money)as paid,SUM(case when payTypeNo = '01' then money ELSE 0 END) as cash, "); + sqlBuf.append(" SUM(case when payTypeNo = '04' then paid ELSE 0 END) as zhifubao, "); + sqlBuf.append(" SUM(case when payTypeNo = '05' then paid ELSE 0 END) as weixin, "); + sqlBuf.append(" SUM(case when payTypeNo = '07' then paid ELSE 0 END) as jwpay "); + sqlBuf.append(" from cy_store_pay where tenantId =" + tenantId + " AND payDate BETWEEN '" + startTime + "' and '" + endTime + "' "); + sqlBuf.append(" AND isInvalid=0 "); + if (StringUtils.isNotBlank(storeIds)) { + if (StringUtils.contains(storeIds, ",")) { + sqlBuf.append(" AND storeId in(" + storeIds + ")"); + } else { + sqlBuf.append(" AND storeId = '" + storeIds + "' "); + } + } + sqlBuf.append(" GROUP BY storeId "); + List> maps = storePayService.selectList(tenantId,sqlBuf.toString()); + if(CollectionUtils.isNotEmpty(maps)){ + Map> mapList = new HashMap<>(); + for(Map map : list){ + String key = map.get("storeId").toString(); + mapList.put(key,map); + } + for(Map map : maps){ + String key = map.get("storeId").toString(); + Map ticketMap = mapList.get(key); + if(ticketMap != null){ + ticketMap.putAll(map); + } + } + list = new ArrayList<>(mapList.values()); + } + }else{ + list = new ArrayList<>(); + } + + + + response.setStatus(1); + response.setMessage("查询成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "weixin.product.rank", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "产品销售排行") + @Override + public Object productRank(ProductRankRequest request) { + String info = "产品销售排行"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String startDate = request.getStartDate(); + String endDate = request.getEndDate(); + String storeIds = request.getStoreIds(); + Integer size = 10; + if (request.getSize() != null) { + size = request.getSize(); + } + CommonListResponse response = null; + try { + response = new CommonListResponse(); + StringBuffer sqlBuf = new StringBuffer(); + sqlBuf.append(" select productId,productName,productUnitName,SUM(count-rcount) as saleCount,SUM(amountTotal) as amountTotal from cy_store_order_product "); + sqlBuf.append(" where tenantId =" + tenantId + " AND saleDate BETWEEN '" + startDate + " 00:00:00' and '" + endDate + " 23:59:59' "); + sqlBuf.append(" AND isInvalid=0 AND isSuit <>'3' "); + if (storeIds != null && !"".equals(storeIds)) { + if(StringUtils.contains(storeIds,",")){ + sqlBuf.append(" AND storeId in(" + storeIds + ")"); + }else{ + sqlBuf.append(" AND storeId = '" + storeIds + "' "); + } + } + sqlBuf.append(" group by productId "); + sqlBuf.append(" order by saleCount desc limit " + size); + List> list = storeBusinessTicketService.selectList(tenantId, sqlBuf.toString()); + if (list == null) { + list = new ArrayList<>(); + } + response.setStatus(1); + response.setMessage("查询成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "PRODUCT_RANK_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 产品销售汇总 + */ + @ServiceMethod(method = "weixin.product.sales.summary", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "产品销售汇总") + @Override + public Object productSalesSummary(ProductSalesSummaryRequest request) { + String info = "产品销售汇总"; + logger.debug("info:" + info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String startTime = request.getStartTime();// 开始时间 + String endTime = request.getEndTime();// 结束时间 + String storeIds = request.getStoreIds(); + CommonListResponse response = null; + try { + response = new CommonListResponse(); + StringBuffer sqlBuf = new StringBuffer(); + sqlBuf.append(" select productId,productNo,productName,specId,specName,productUnitName,typeId,typeName,SUM(count-rcount) as saleCount,SUM(amountTotal) as amountTotal from cy_store_order_product "); + sqlBuf.append(" where tenantId =" + tenantId + " AND saleDate BETWEEN '" + startTime + "' and '" + endTime + "' "); + sqlBuf.append(" AND isInvalid=0 AND isSuit <>'3' "); + if (storeIds != null && !"".equals(storeIds)) { + if(StringUtils.contains(storeIds,",")){ + sqlBuf.append(" AND storeId in(" + storeIds + ")"); + }else{ + sqlBuf.append(" AND storeId = '" + storeIds + "' "); + } + } + sqlBuf.append(" group by specId "); + //sqlBuf.append(" order by typeId asc,productNo asc,saleCount desc "); + sqlBuf.append(" order by saleCount desc,amountTotal desc "); + List> list = storeBusinessTicketService.selectList(tenantId, sqlBuf.toString()); + if (list == null) { + list = new ArrayList<>(); + } + response.setStatus(1); + response.setMessage("查询成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "weixin.order.summary.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "销售汇总列表") + @Override + public Object orderSummaryList(OrderSummaryListRequest request) { + String info = "销售汇总列表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String startDate = request.getStartDate(); + String endDate = request.getEndDate(); + String storeIds = request.getStoreIds(); + CommonListResponse response = null; + try { + response = new CommonListResponse(); + StringBuffer sqlBuf = new StringBuffer(); + // sqlBuf.append(" select DATE_FORMAT(saleDate,'%Y-%m-%d') as + // saleDate, ");// ERROR + sqlBuf.append(" select DATE_FORMAT(saleDate,'%Y-%m-%d') as queryDate, ");// 2017-12-27,上面的写法会造成数据汇总错误saleDate + sqlBuf.append(" sum(case when status in(2,4) and isMember =1 then amount else 0 end ) as memberAmount, "); + sqlBuf.append(" sum(case when status in(2,4) then amount else 0 end ) as amount, "); + sqlBuf.append(" sum(case when status = 4 then 1 else 0 end ) as tickCount, "); + sqlBuf.append(" sum(case when status = 2 then 1 else 0 end ) as backCount "); + sqlBuf.append(" from cy_store_business_ticket "); + sqlBuf.append(" where tenantId =" + tenantId + " AND saleDate BETWEEN '" + startDate + " 00:00:00' and '" + endDate + " 23:59:59' "); + sqlBuf.append(" AND isInvalid=0 AND status in(2,4) "); + if (storeIds != null && !"".equals(storeIds)) { + if(StringUtils.contains(storeIds,",")){ + sqlBuf.append(" AND storeId in(" + storeIds + ")"); + }else{ + sqlBuf.append(" AND storeId = '" + storeIds + "' "); + } + + } + // sqlBuf.append(" GROUP BY saleDate order by saleDate "); + sqlBuf.append(" GROUP BY queryDate order by queryDate "); + List> list = storeBusinessTicketService.selectList(tenantId, sqlBuf.toString()); + if (list == null) { + list = new ArrayList<>(); + } + response.setStatus(1); + response.setMessage("查询成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "ORDER_SUMMARY_LIST_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "weixin.category.summary.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "类别销售汇总列表") + @Override + public Object categorySummaryList(CategorySummaryListRequest request) { + String info = "类别销售汇总列表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String startDate = request.getStartDate(); + String endDate = request.getEndDate(); + String storeIds = request.getStoreIds(); + + CommonListResponse response = null; + try { + response = new CommonListResponse(); + StringBuffer sqlBuf = new StringBuffer(); + sqlBuf.append(" select typeId,typeName,SUM(count-rcount) as saleCount,SUM(amountTotal) as amount from cy_store_order_product "); + sqlBuf.append(" where tenantId =" + tenantId + " AND saleDate BETWEEN '" + startDate + " 00:00:00' and '" + endDate + " 23:59:59' "); + sqlBuf.append(" AND isInvalid=0 AND isSuit <>'3' "); + if (StringUtils.isNotBlank(storeIds)) { + if(StringUtils.contains(storeIds,",")){ + sqlBuf.append(" AND storeId in(" + storeIds + ")"); + }else{ + sqlBuf.append(" AND storeId = '" + storeIds + "' "); + } + } + sqlBuf.append(" group by typeId "); + sqlBuf.append(" order by amount desc "); + List> list = storeBusinessTicketService.selectList(tenantId, sqlBuf.toString()); + if (list == null) { + list = new ArrayList<>(); + } + response.setStatus(1); + response.setMessage("查询成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "CATEGORY_SUMMARY_LIST_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "weixin.time.summary.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "时段销售汇总列表") + @Override + public Object timeSummaryList(TimeSummaryListRequest request) { + String info = "时段销售汇总列表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String startDate = request.getStartDate(); + String endDate = request.getEndDate(); + String storeIds = request.getStoreIds(); + + CommonListResponse response = null; + try { + response = new CommonListResponse(); + StringBuffer sqlBuf = new StringBuffer(); + sqlBuf.append(" select DATE_FORMAT(saleDate,'%H') AS saleTime,SUM(amount) AS amount"); + sqlBuf.append(" from cy_store_business_ticket "); + sqlBuf.append(" where tenantId =" + tenantId + " AND saleDate BETWEEN '" + startDate + " 00:00:00' and '" + endDate + " 23:59:59' "); + sqlBuf.append(" AND isInvalid=0 AND status in(2,4) "); + if (storeIds != null && !"".equals(storeIds)) { + if(StringUtils.contains(storeIds,",")){ + sqlBuf.append(" AND storeId in(" + storeIds + ")"); + }else{ + sqlBuf.append(" AND storeId = '" + storeIds + "' "); + } + } + sqlBuf.append(" group by saleTime "); + List> list = storeBusinessTicketService.selectList(tenantId, sqlBuf.toString()); + if (list == null) { + list = new ArrayList<>(); + } + response.setStatus(1); + response.setMessage("查询成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "TIME_SUMMARY_LIST_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "weixin.pay.summary.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "支付方式汇总列表") + @Override + public Object paySummaryList(PaySummaryListRequest request) { + String info = "支付方式汇总列表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String startDate = request.getStartDate(); + String endDate = request.getEndDate(); + String storeIds = request.getStoreIds(); + + startDate = StringUtils.contains(startDate, ":") ? startDate : startDate + " 00:00:00"; + endDate = StringUtils.contains(endDate, ":") ? endDate : endDate + " 23:59:59"; + + CommonListResponse response = null; + try { + response = new CommonListResponse(); + StringBuffer sqlBuf = new StringBuffer(); + sqlBuf.append(" select payTypeNo,payType payTypeName,count(id) as totalCount,SUM(money) as totalAmount from cy_store_pay "); + sqlBuf.append(" where tenantId =" + tenantId + " AND payDate BETWEEN '" + startDate + "' and '" + endDate + "' "); + sqlBuf.append(" AND isInvalid=0 "); + if (StringUtils.isNotBlank(storeIds)) { + if(StringUtils.contains(storeIds,",")){ + sqlBuf.append(" AND storeId in(" + storeIds + ")"); + }else{ + sqlBuf.append(" AND storeId = '" + storeIds + "' "); + } + } + sqlBuf.append(" group by payTypeNo "); + sqlBuf.append(" order by payTypeNo asc "); + + List> list = storePayService.selectList(tenantId, sqlBuf.toString()); + if (list == null) { + list = new ArrayList<>(); + } + response.setStatus(1); + response.setMessage("查询成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "PAY_SUMMARY_LIST_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 销售毛利分析 + */ + @ServiceMethod(method = "weixin.gross.profit.analysis", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "销售毛利分析") + @Override + public Object grossProfitAnalysis(GrossProfitAnalysisRequest request) { + String info = "销售毛利分析"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String startDate = request.getStartDate(); + String endDate = request.getEndDate(); + String storeIds = request.getStoreIds(); + CommonListResponse response = null; + try { + response = new CommonListResponse(); + StringBuffer sqlBuf = new StringBuffer(); + sqlBuf.append(" select DATE_FORMAT(saleDate,'%Y-%m-%d') as queryDate, "); + sqlBuf.append(" sum(receivable) as amount, "); + sqlBuf.append(" sum(profitAmount) as profitAmount "); + sqlBuf.append(" from cy_store_business_ticket "); + sqlBuf.append(" where tenantId =" + tenantId + " AND saleDate BETWEEN '" + startDate + " 00:00:00' and '" + endDate + " 23:59:59' "); + sqlBuf.append(" AND isInvalid=0 "); + if (storeIds != null && !"".equals(storeIds)) { + if(StringUtils.contains(storeIds,",")){ + sqlBuf.append(" AND storeId in(" + storeIds + ")"); + }else{ + sqlBuf.append(" AND storeId = '" + storeIds + "' "); + } + } + sqlBuf.append(" GROUP BY queryDate order by queryDate "); + List> list = storeBusinessTicketService.selectList(tenantId, sqlBuf.toString()); + if (list == null) { + list = new ArrayList<>(); + } + response.setStatus(1); + response.setMessage("查询成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "weixin.agent.store", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "代理商可查询门店列表") + @Override + public Object agentStore(AgentStoreRequest request) { + String info = "代理商可查询门店列表"; + logger.debug(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String agentId = request.getAgentId(); + CommonListResponse response = null; + try { + List> list = new ArrayList<>(); + + Criteria criteria = null; + criteria = new Criteria(); + criteria.add(Restrictions.eq("agentId", agentId)); + criteria.add(Restrictions.eq("authFlag", 1)); + criteria.add(Restrictions.order("storeNo", "asc")); + List dataList = agentStoreService.getListExtend(tenantId, criteria); + ; + for (AgentStore store : dataList) { + Map map = new HashMap<>(); + map.put("tenantId", store.getTenantId()); + map.put("id", store.getStoreId()); + map.put("no", store.getStoreNo()); + map.put("name", store.getStoreName()); + map.put("address", store.getAddress()); + list.add(map); + } + + response = new CommonListResponse(); + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "weixin.vposuser.series", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "档口商户可查询档口列表") + @Override + public Object vposUserSeries(VposUserSeriesRequest request) { + String info = "档口商户可查询档口列表"; + logger.debug(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String vposUserId = request.getVposUserId(); + CommonListResponse response = null; + try { + List> list = new ArrayList<>(); + + Criteria criteria = null; + criteria = new Criteria(); + criteria.add(Restrictions.eq("userId", vposUserId)); + criteria.add(Restrictions.order("seriesNo", "asc")); + List dataList = vposUserSeriesService.getList(tenantId, criteria); + for (VposUserSeries series : dataList) { + Map map = new HashMap<>(); + map.put("tenantId", series.getTenantId()); + map.put("id", series.getSeriesId()); + map.put("no", series.getSeriesNo()); + map.put("name", series.getSeriesName()); + list.add(map); + } + + response = new CommonListResponse(); + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 根据时间范围,获取营业日报数据 + */ + @ServiceMethod(method = "weixin.sales.daily.daterage", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "根据时间范围,获取营业日报数据") + @Override + public Object salesDailyByDateRange(SalesDailyByDateRangeRequest request) { + String info = "根据时间范围,获取营业日报数据"; + logger.debug(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String startTime = request.getStartTime();// 开始时间 + String endTime = request.getEndTime();// 结束时间; + String storeIds = request.getStoreIds(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + StringBuffer sqlBuf = new StringBuffer(); + sqlBuf.append(" select sum(amount) as amount,sum(receivable) as receivableAmount,sum(discountTotal) as discountAmount,"); + sqlBuf.append(" sum(case when status = 4 then 1 else 0 end ) as tickCount, "); + sqlBuf.append(" sum(case when status = 2 then 1 else 0 end ) as backCount, "); + sqlBuf.append(" sum(case when status = 2 then amount else 0 end ) as refundAmount, "); + sqlBuf.append(" sum(case when status = 4 then people else 0 end ) as totalPeople, "); + sqlBuf.append(" sum(case when status = 2 then people else 0 end ) as refundPeople "); + sqlBuf.append(" from cy_store_business_ticket where tenantId = '" + tenantId + "' "); + sqlBuf.append(" AND isInvalid=0 AND saleDate BETWEEN '" + startTime + "' AND '" + endTime + "' AND status in(2,4) "); + if (storeIds != null && !"".equals(storeIds)) { + if(StringUtils.contains(storeIds,",")){ + sqlBuf.append(" AND storeId in(" + storeIds + ")"); + }else{ + sqlBuf.append(" AND storeId = '" + storeIds + "' "); + } + } + Map salesData = storeBusinessTicketService.selectOne(tenantId, sqlBuf.toString()); + if (salesData == null) { + salesData = new HashMap(); + salesData.put("amount", 0.00); + salesData.put("receivableAmount", 0.00); + salesData.put("discountAmount", 0.00); + salesData.put("tickCount", 0); + salesData.put("backCount", 0); + salesData.put("refundAmount", 0); + salesData.put("totalPeople", 0); + salesData.put("refundPeople", 0); + } + Map dataMap = new HashMap<>(); + dataMap.put("salesData", salesData); + + // 订单类型 + sqlBuf = new StringBuffer(); + sqlBuf.append(" select busMode,sum(amount) as totalAmount "); + sqlBuf.append(" from cy_store_business_ticket where tenantId = '" + tenantId + "' "); + sqlBuf.append(" AND isInvalid=0 AND saleDate BETWEEN '" + startTime + "' AND '" + endTime + "' AND status in(2,4) "); + if (storeIds != null && !"".equals(storeIds)) { + if(StringUtils.contains(storeIds,",")){ + sqlBuf.append(" AND storeId in(" + storeIds + ")"); + }else{ + sqlBuf.append(" AND storeId = '" + storeIds + "' "); + } + } + sqlBuf.append(" group by busMode "); + sqlBuf.append(" order by busMode asc "); + List> busModeList = storeBusinessTicketService.selectList(tenantId, sqlBuf.toString()); + if (busModeList == null) { + busModeList = new ArrayList<>(); + } + dataMap.put("busModeList", busModeList); + + // 收银方式 + sqlBuf = new StringBuffer(); + sqlBuf.append(" select payTypeNo,payType payTypeName,count(id) as totalCount,SUM(money) as totalAmount "); + sqlBuf.append(" from cy_store_pay where tenantId =" + tenantId + " AND payDate BETWEEN '" + startTime + "' and '" + endTime + "' "); + sqlBuf.append(" AND isInvalid=0 "); + if (StringUtils.isNotBlank(storeIds)) { + if(StringUtils.contains(storeIds,",")){ + sqlBuf.append(" AND storeId in(" + storeIds + ")"); + }else{ + sqlBuf.append(" AND storeId = '" + storeIds + "' "); + } + } + sqlBuf.append(" group by payTypeNo "); + sqlBuf.append(" order by payTypeNo asc "); + List> payList = storePayService.selectList(tenantId, sqlBuf.toString()); + if (payList == null) { + payList = new ArrayList<>(); + } + dataMap.put("payList", payList); + + response.setStatus(1); + response.setMessage("查询成功"); + response.setData(dataMap); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 掌柜查询,首页销售概况数据 + * + * @param request + * @return + */ + @ServiceMethod(method = "weixin.sales.summary.index", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "掌柜查询,首页销售概况数据") + @Override + public Object indexSalesSummary(SalesDailyByDateRangeRequest request) { + String info = "掌柜查询,首页销售概况数据"; + logger.debug(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String startTime = request.getStartTime();// 开始时间 + String endTime = request.getEndTime();// 结束时间; + String storeIds = request.getStoreIds(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + StringBuffer sqlBuf = new StringBuffer(); + sqlBuf.append(" select SUM(amount) as amount,sum(discountTotal) as discountTotal,SUM(receivable) as receivable,count(*) as total, "); + sqlBuf.append(" SUM(isMember) as isMember,SUM(case when isMember = 1 THEN receivable else 0 END) as memberReceivable "); + sqlBuf.append(" from cy_store_business_ticket where tenantId = '" + tenantId + "' "); + sqlBuf.append(" AND isInvalid=0 AND saleDate BETWEEN '" + startTime + "' AND '" + endTime + "' AND status in(2,4) "); + if (storeIds != null && !"".equals(storeIds)) { + if (StringUtils.contains(storeIds, ",")) { + sqlBuf.append(" AND storeId in(" + storeIds + ")"); + } else { + sqlBuf.append(" AND storeId = '" + storeIds + "' "); + } + + } + Map salesData = storeBusinessTicketService.selectOne(tenantId, sqlBuf.toString()); + if (salesData == null || salesData.get("amount") == null) { + salesData = new HashMap(); + salesData.put("amount", 0.00); + salesData.put("receivable", 0.00); + salesData.put("discountTotal", 0.00); + salesData.put("memberReceivable", 0.00); + salesData.put("otherReceivable", 0.00); + salesData.put("total", 0); + salesData.put("isMember", 0); + }else{ + BigDecimal memberReceivable = (BigDecimal) salesData.get("memberReceivable"); + BigDecimal otherReceivable = ((BigDecimal) salesData.get("receivable")).subtract(memberReceivable); + salesData.put("otherReceivable",otherReceivable); + } + Map dataMap = new HashMap<>(); + dataMap.put("salesData", salesData); + + //营业模式 + sqlBuf = new StringBuffer(); + sqlBuf.append(" select busMode,SUM(receivable) as receivable from cy_store_business_ticket "); + sqlBuf.append(" where tenantId =" + tenantId + " AND isInvalid=0 AND status in(2,4) "); + sqlBuf.append(" AND saleDate BETWEEN '" + startTime + "' and '" + endTime + "' "); + if (StringUtils.isNotBlank(storeIds)) { + if (StringUtils.contains(storeIds, ",")) { + sqlBuf.append(" AND storeId in(" + storeIds + ")"); + } else { + sqlBuf.append(" AND storeId = '" + storeIds + "' "); + } + } + sqlBuf.append(" GROUP BY busMode "); + List> busModeData = storeBusinessTicketService.selectList(tenantId, sqlBuf.toString()); + Map busModeMap = new HashMap<>(); + busModeMap.put("tangshi", 0.0); + busModeMap.put("wxdc", 0.0); + busModeMap.put("meituan", 0.0); + busModeMap.put("eleme", 0.0); + busModeMap.put("otherMode", new BigDecimal(0.0)); + if (CollectionUtils.isNotEmpty(busModeData)) { + for(Map map : busModeData){ + int busMode = (Integer) map.get("busMode"); + if(busMode == 0){ + busModeMap.put("tangshi", map.get("receivable")); + }else if(busMode == 4){ + busModeMap.put("meituan", map.get("receivable")); + }else if(busMode == 5){ + busModeMap.put("eleme", map.get("receivable")); + }else if(busMode == 7){ + busModeMap.put("wxdc", map.get("receivable")); + }else{ + BigDecimal other = (BigDecimal) busModeMap.get("otherMode"); + BigDecimal otherMoney = (BigDecimal) map.get("receivable"); + busModeMap.put("otherMode", other.add(otherMoney)); + } + } + } + dataMap.put("busModeData", busModeMap); + + // 收银方式 + sqlBuf = new StringBuffer(); + sqlBuf.append(" select SUM(money)as paid,SUM(case when payTypeNo = '01' then money ELSE 0 END) as cash, "); + sqlBuf.append(" SUM(case when payTypeNo = '04' then money ELSE 0 END) as zhifubao, "); + sqlBuf.append(" SUM(case when payTypeNo = '05' then money ELSE 0 END) as weixin "); + sqlBuf.append(" from cy_store_pay where tenantId =" + tenantId + " AND payDate BETWEEN '" + startTime + "' and '" + endTime + "' "); + sqlBuf.append(" AND isInvalid=0 "); + if (StringUtils.isNotBlank(storeIds)) { + if (StringUtils.contains(storeIds, ",")) { + sqlBuf.append(" AND storeId in(" + storeIds + ")"); + } else { + sqlBuf.append(" AND storeId = '" + storeIds + "' "); + } + } + Map payData = storePayService.selectOne(tenantId, sqlBuf.toString()); + if (payData == null || payData.get("paid") == null) { + payData = new HashMap<>(); + payData.put("paid", 0.0); + payData.put("cash", 0.0); + payData.put("zhifubao", 0.0); + payData.put("weixin", 0.0); + payData.put("other", 0.0); + }else{ + BigDecimal paid = (BigDecimal) payData.get("paid"); + BigDecimal cash = (BigDecimal) payData.get("cash"); + BigDecimal zhifubao = (BigDecimal) payData.get("zhifubao"); + BigDecimal weixin = (BigDecimal) payData.get("weixin"); + BigDecimal other = paid.subtract(cash).subtract(zhifubao).subtract(weixin); + payData.put("other", other); + } + dataMap.put("payData", payData); + response.setStatus(1); + response.setMessage("查询成功"); + response.setData(dataMap); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 获取外卖汇总数据 + */ + @ServiceMethod(method = "weixin.waimai.order.statistics", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "获取外卖汇总数据") + @Override + public Object waiMaiOrderStatistics(WaiMaiOrderStatisticsRequest request) { + String info = "获取外卖汇总数据"; + logger.debug(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String startDate = request.getStartDate(); + String endDate = request.getEndDate(); + String storeIds = request.getStoreIds(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + StringBuffer sqlBuf = new StringBuffer(); + sqlBuf.append("select DATE_FORMAT(createDate,'%Y-%m-%d') AS queryDate,count(orderId) as total, " + + "sum(originalPrice) as originalAmount,sum(shippingFee) as shippingFee," + + " SUM(wmPoiReceiveCent) as receiveAmount from "); + if (StringUtils.isNotEmpty(storeIds)) { + if (StringUtils.containsIgnoreCase(storeIds, ",")) { + sqlBuf.append(" (SELECT id from cy_store where tenantId = '" + tenantId + "' and id in (" + storeIds + "))store " + + " LEFT JOIN cy_shop_meituan_order orders on store.id = orders.storeId where "); + } else { + sqlBuf.append(" cy_shop_meituan_order where storeId = '" + storeIds + "' and "); + } + } else { + sqlBuf.append(" cy_shop_meituan_order where"); + } + sqlBuf.append(" tenantId = '" + tenantId + "' AND createDate BETWEEN '" + startDate + " 00:00:00' and '" + endDate + " 23:59:59' and status=8 " + + " GROUP BY queryDate order by queryDate"); + logger.debug("sql:" + sqlBuf.toString()); + List> meiTuanDataList = meituanOrderService.selectList(tenantId, sqlBuf.toString()); + for (Map meiTuanDataMap : meiTuanDataList) { + meiTuanDataMap.put("sign", "meituan"); + meiTuanDataMap.put("originalAmount", meiTuanDataMap.get("originalAmount") == null ? 0D : Double.valueOf(meiTuanDataMap.get("originalAmount").toString())); + meiTuanDataMap.put("shippingFee", meiTuanDataMap.get("shippingFee") == null ? 0D : Double.valueOf(meiTuanDataMap.get("shippingFee").toString())); + meiTuanDataMap.put("receiveAmount", + MathUtil.divide(meiTuanDataMap.get("receiveAmount") == null ? BigDecimal.ZERO : new BigDecimal(meiTuanDataMap.get("receiveAmount").toString()), new BigDecimal(100D)) + .setScale(4, BigDecimal.ROUND_HALF_DOWN)); + meiTuanDataMap.put("totalAmount", MathUtil.subtract(new BigDecimal((Double) meiTuanDataMap.get("originalAmount")), new BigDecimal((Double) meiTuanDataMap.get("shippingFee"))) + .setScale(4, BigDecimal.ROUND_HALF_DOWN)); + } + + sqlBuf = new StringBuffer(); + sqlBuf.append("select DATE_FORMAT(createdAt,'%Y-%m-%d') AS queryDate,count(orderId) as total," + + "sum(originalPrice) as originalAmount," + + " SUM(income) as receiveAmount from "); + if (StringUtils.isNotEmpty(storeIds)) { + if (StringUtils.containsIgnoreCase(storeIds, ",")) { + sqlBuf.append(" (SELECT id from cy_store where tenantId = '" + tenantId + "' and id in (" + storeIds + "))store \n" + + " LEFT JOIN cy_eleme_order_detail detail on store.id = detail.storeId where "); + } else { + sqlBuf.append("cy_eleme_order_detail where storeId = '" + storeIds + "' and "); + } + } else { + sqlBuf.append("cy_eleme_order_detail where "); + } + sqlBuf.append(" tenantId = '" + tenantId + "' " + + " AND createdAt BETWEEN '" + startDate + " 00:00:00' and '" + endDate + " 23:59:59' and status='settled' GROUP BY queryDate order by queryDate"); + logger.debug("sql:" + sqlBuf.toString()); + List> elemeDataList = elemeOrderService.selectList(tenantId, sqlBuf.toString()); + for (Map elemeDataMap : elemeDataList) { + elemeDataMap.put("sign", "eleme"); + elemeDataMap.put("originalAmount", elemeDataMap.get("originalAmount") == null ? 0D : Double.valueOf(elemeDataMap.get("originalAmount").toString())); + elemeDataMap.put("shippingFee", elemeDataMap.get("shippingFee") == null ? 0D : Double.valueOf(elemeDataMap.get("shippingFee").toString())); + elemeDataMap.put("receiveAmount", elemeDataMap.get("receiveAmount") == null ? 0D : Double.valueOf(elemeDataMap.get("receiveAmount").toString())); + elemeDataMap.put("totalAmount", MathUtil.subtract(new BigDecimal((Double) elemeDataMap.get("originalAmount")), new BigDecimal((Double) elemeDataMap.get("shippingFee"))).setScale(4, + BigDecimal.ROUND_HALF_DOWN)); + + } + // 订单金额=订单原价-配送费用 + + Map dataMap = new HashMap<>(); + dataMap.put("meituan", meiTuanDataList); + dataMap.put("eleme", elemeDataList); + + response.setStatus(1); + response.setMessage("查询成功"); + response.setData(dataMap); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 根据时间范围,获取门店日营业汇总数据 + */ + @ServiceMethod(method = "weixin.day.summary.list.rank", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "根据时间范围,获取门店日营业汇总数据") + @Override + public Object daySummaryListRank(DaySummaryListByDateRangeRequest request) { + String info = "根据时间范围,获取门店日营业汇总数据"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String startTime = request.getStartTime();// 开始时间 + String endTime = request.getEndTime();// 结束时间; + String storeIds = request.getStoreIds(); + CommonListResponse response = null; + try { + response = new CommonListResponse(); + StringBuffer sqlBuf = new StringBuffer(); + sqlBuf.append(" select storeId,storeNo,storeName, sum(amount) as amount,sum(receivable) as receivableAmount,sum(discountTotal) as discountAmount, "); + sqlBuf.append(" sum(case when status = 4 then 1 else 0 end ) as tickCount, "); + sqlBuf.append(" sum(case when status = 2 then 1 else 0 end ) as backCount "); + sqlBuf.append(" from cy_store_business_ticket where tenantId = '" + tenantId + "' "); + sqlBuf.append(" AND isInvalid=0 AND saleDate BETWEEN '" + startTime + "' AND '" + endTime + "' AND status in(2,4) "); + if (storeIds != null && !"".equals(storeIds)) { + if(StringUtils.contains(storeIds,",")) { + sqlBuf.append(" AND storeId in(" + storeIds + ")"); + }else{ + sqlBuf.append(" AND storeId = '" + storeIds + "' "); + } + } + sqlBuf.append(" GROUP BY storeId ORDER BY amount DESC "); + List> list = storeBusinessTicketService.selectList(tenantId, sqlBuf.toString()); + if (list == null) { + list = new ArrayList<>(); + } + response.setStatus(1); + response.setMessage("查询成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "weixin.worker.module", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "掌柜查询员工权限") + @Override + public Object managerWorkerModule(ManagerWorkerModuleRequest request) { + String info = "掌柜查询员工权限"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + String workerId = request.getWorkerId(); + CommonListResponse response = null; + try { + response = new CommonListResponse(); +// Store store = storeService.get(tenantId, storeId); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("获取失败"); +// response.setErrCode(CommonErrorCode.error998.getCode()); +// response.setErrMessage("门店不存在"); +// return response; +// } + List> list = new ArrayList<>(); + List moduleNoList = posRoleService.getManagerModuleNoList(tenantId, workerId); + if (moduleNoList != null && moduleNoList.size() > 0) { + for (String moduleNo : moduleNoList) { + Map map = new HashMap<>(); + map.put("tenantId", tenantId); + map.put("moduleNo", moduleNo); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("校验通过"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "weixin.operationlog.summary", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "掌柜查询-门店前台操作日志汇总") + @Override + public Object storeOperationLogSummary(DaySummaryListByDateRangeRequest request) { + String info = "根据时间范围,获取门店前台操作日志汇总"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String startTime = request.getStartTime();// 开始时间 + String endTime = request.getEndTime();// 结束时间; + String storeIds = request.getStoreIds(); + CommonListResponse response = null; + try { + response = new CommonListResponse(); + StringBuffer sqlBuf = new StringBuffer(); + sqlBuf.append(" select storeId,storeNo,storeName,type,typeTxt,COUNT(type) as counts from cy_store_operation_log "); + sqlBuf.append(" where tenantId = '" + tenantId + "' "); + sqlBuf.append(" AND operationTime BETWEEN '" + startTime + "' AND '" + endTime + "' "); + if (storeIds != null && !"".equals(storeIds)) { + if(StringUtils.contains(storeIds,",")){ + sqlBuf.append(" AND storeId in(" + storeIds + ")"); + }else{ + sqlBuf.append(" AND storeId = '" + storeIds + "' "); + } + } + sqlBuf.append(" GROUP BY storeId,type ORDER BY storeNo,type,operationTime asc "); + + List> list = storeOperationLogService.selectList(tenantId, sqlBuf.toString()); + if (list == null) { + list = new ArrayList<>(); + } + response.setStatus(1); + response.setMessage("查询成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "weixin.operationlog.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "掌柜查询-前台操作日志") + @Override + public Object storeOperationLogList(DaySummaryListByDateRangeRequest request) { + String info = "根据时间范围,获取前台操作日志"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String startTime = request.getStartTime();// 开始时间 + String endTime = request.getEndTime();// 结束时间; + String storeIds = request.getStoreIds(); + CommonListResponse response = null; + List> list = new ArrayList<>(); + try { + response = new CommonListResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeIds)); + criteria.add(Restrictions.between("operationTime", startTime,endTime)); + //criteria.add(Restrictions.le("operationTime", endTime)); + criteria.add(Restrictions.order("operationTime", "asc")); + List logs = storeOperationLogService.getList(tenantId, criteria); + if (CollectionUtils.isNotEmpty(logs)) { + for (StoreOperationLog log : logs) { + Map map = new HashMap<>(); + map.put("storeId", log.getStoreId()); + map.put("storeNo", log.getStoreNo()); + map.put("storeName", log.getStoreName()); + map.put("workerNo", log.getWorkerNo()); + map.put("shiftNo", log.getShiftNo()); + map.put("shiftName", log.getStoreName()); + map.put("posNo", log.getPosNo()); + map.put("deviceName", log.getDeviceName()); + map.put("operationTime", log.getOperationTime()); + map.put("typeTxt", log.getTypeTxt()); + map.put("memo", log.getMemo()); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("查询成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "weixin.vpos.sales.summary.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "根据时间范围,获取档口销售汇总数据") + @Override + public Object vposSalesSummary(VposSalesSummaryRequest request) { + String info = "根据时间范围,获取档口销售汇总数据"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String startTime = request.getStartTime();// 开始时间 + String endTime = request.getEndTime();// 结束时间; + String vposUserId = request.getVposUserId(); + String seriesIds = request.getSeriesIds(); + CommonListResponse response = null; + try { + response = new CommonListResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("isInvalid", 0)); + + criteria.add(Restrictions.between("saleDate", startTime,endTime)); + //criteria.add(Restrictions.le("saleDate", endTime)); + + if (StringUtils.isNotEmpty(seriesIds)) { + List ids = Arrays.asList(seriesIds.split(",")); + criteria.add(Restrictions.in("seriesId", ids)); + } else { + String userId = vposUserId; + List seriesIdList = vposUserSeriesService.getSeriesIdByUserId(tenantId, userId); + criteria.add(Restrictions.in("seriesId", seriesIdList)); + } + criteria.add(Restrictions.group("storeId")); + criteria.add(Restrictions.group("seriesId")); + criteria.add(Restrictions.order("storeNo", "asc")); + criteria.add(Restrictions.order("seriesId", "asc")); + List list = vposStoreOrderProductService.getSummaryList(tenantId, criteria); + List> maps = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(list)) { + for (VposStoreOrderProduct product : list) { + Map map = new HashMap<>(); + map.put("seriesId", product.getSeriesId()); + map.put("seriesName", product.getSeriesName()); + map.put("totalCount", product.getCount() == null ? 0.0 : product.getCount()); + map.put("refundCount", product.getRcount() == null ? 0.0 : product.getRcount()); + map.put("totalAmount", product.getAmountTotal() == null ? 0.0 : product.getAmountTotal()); + map.put("totalDiscountAmount", product.getReduce() == null ? 0.0 : product.getReduce()); + map.put("totalReceivableAmount", product.getReceivableTotal() == null ? 0.0 : product.getReceivableTotal()); + maps.add(map); + } + } + response.setStatus(1); + response.setMessage("查询成功"); + response.setList(maps); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "weixin.vpos.product.sales.summary", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "根据时间范围,美食广场单品销售汇总") + @Override + public Object vposProductSalesSummary(VposSalesSummaryRequest request) { + String info = "美食广场单品销售汇总"; + logger.debug("info:" + info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String startTime = request.getStartTime();// 开始时间 + String endTime = request.getEndTime();// 结束时间 + String seriesIds = request.getSeriesIds(); + String vposUserId = request.getVposUserId(); + CommonListResponse response = null; + try { + response = new CommonListResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("isInvalid", 0)); + + criteria.add(Restrictions.between("saleDate", startTime,endTime)); + //criteria.add(Restrictions.le("saleDate", endTime)); + + if (StringUtils.isNotEmpty(seriesIds)) { + List ids = Arrays.asList(seriesIds.split(",")); + criteria.add(Restrictions.in("seriesId", ids)); + } else { + String userId = vposUserId; + List seriesIdList = vposUserSeriesService.getSeriesIdByUserId(tenantId, userId); + criteria.add(Restrictions.in("seriesId", seriesIdList)); + } + criteria.add(Restrictions.group("storeId")); + criteria.add(Restrictions.group("specId")); + criteria.add(Restrictions.order("storeNo", "asc")); + criteria.add(Restrictions.order("seriesId", "asc")); + criteria.add(Restrictions.order("productNo", "asc")); + List list = vposStoreOrderProductService.getListByProductSalesSummary(tenantId, criteria); + List> maps = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(list)) { + for (VposStoreOrderProduct product : list) { + Map map = new HashMap<>(); + map.put("specId", product.getSpecId()); + map.put("productId", product.getProductId()); + map.put("specName", product.getSpecName()); + map.put("productNo", product.getProductNo()); + map.put("productName", product.getProductName()); + Double count = product.getCount() == null ? 0.0 : product.getCount(); + Double rcount = product.getRcount() == null ? 0.0 : product.getRcount(); + map.put("saleCount", (count - rcount)); + map.put("totalAmount", product.getAmountTotal() == null ? 0.0 : product.getAmountTotal()); + maps.add(map); + } + } + response.setStatus(1); + response.setMessage("查询成功"); + response.setList(maps); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/worker/WorkerService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/worker/WorkerService.java new file mode 100644 index 0000000..eb497c8 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/worker/WorkerService.java @@ -0,0 +1,49 @@ +package com.jwsaas.api.service.worker; + +import com.jwsaas.api.request.worker.WorkerListRequest; +import com.jwsaas.api.request.worker.WorkerLoginRequest; +import com.jwsaas.api.request.worker.WorkerPosModuleRequest; +import com.jwsaas.api.request.worker.WorkerPosRoleRequest; +import com.jwsaas.api.request.worker.WorkerUpdatePwdRequest; +import com.jwsaas.api.service.WopService; + +public interface WorkerService extends WopService { + + /** + * 门店员工登录 + * + * @param request + * @return + */ + Object workerLogin(WorkerLoginRequest request); + + /** + * 获取门店可登陆员工列表 + * + * @param request + * @return + */ + Object workerList(WorkerListRequest request); + + /** + * 员工角色折扣、免单权限列表 + * + * @param request + * @return + */ + Object workerPosRole(WorkerPosRoleRequest request); + + /** + * 员工角色折扣、免单权限列表 + * + * @param request + * @return + */ + Object workerPosModule(WorkerPosModuleRequest request); + + /** + * 员工修改门店登陆密码 + */ + Object workerUpdatePwd(WorkerUpdatePwdRequest request); + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/wxdc/WxdcDistributionService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/wxdc/WxdcDistributionService.java new file mode 100644 index 0000000..14e4f61 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/wxdc/WxdcDistributionService.java @@ -0,0 +1,39 @@ +package com.jwsaas.api.service.wxdc; + +import com.jwsaas.api.request.wxdc.DistributionAddressRequest; + +/** + * @Author:CHL + * @Date:Create in 2018/7/27 + * @Description: 微信点餐配送 + */ +public interface WxdcDistributionService { + /** + * 查看微信点餐饮的配送地址 + */ + Object getDistributionAddressList(DistributionAddressRequest request); + /** + * 添加配送地址 + */ + Object addDistributionAddress(DistributionAddressRequest request); + /** + * 删除配送地址 + */ + Object deleteDistributionAddress(DistributionAddressRequest request); + + /*** + * 获取一个配送地址信息 + * @param request + * @return + */ + Object oneDistributionAddress(DistributionAddressRequest request); + + /** + * 更新配送地址信息 + * @param request + * @return + */ + Object updateDistributionAddress(DistributionAddressRequest request); + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/wxdc/WxdcService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/wxdc/WxdcService.java new file mode 100644 index 0000000..37ab25b --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/wxdc/WxdcService.java @@ -0,0 +1,173 @@ +package com.jwsaas.api.service.wxdc; + +import com.jwsaas.api.request.wxdc.AdPictureListRequest; +import com.jwsaas.api.request.wxdc.GoodsCategoryListRequest; +import com.jwsaas.api.request.wxdc.GoodsCategoryRequest; +import com.jwsaas.api.request.wxdc.GoodsInfoRequest; +import com.jwsaas.api.request.wxdc.GoodsListRequest; +import com.jwsaas.api.request.wxdc.GoodsMakeListRequest; +import com.jwsaas.api.request.wxdc.GoodsSellInRequest; +import com.jwsaas.api.request.wxdc.GoodsSellOutRequest; +import com.jwsaas.api.request.wxdc.SalesOrderCancelRequest; +import com.jwsaas.api.request.wxdc.SalesOrderCreateRequest; +import com.jwsaas.api.request.wxdc.SalesOrderInfoRequest; +import com.jwsaas.api.request.wxdc.SalesOrderListRequest; +import com.jwsaas.api.request.wxdc.StoreAgreeRefundRequest; +import com.jwsaas.api.request.wxdc.StoreInfoRequest; +import com.jwsaas.api.request.wxdc.StoreListByWidRequest; +import com.jwsaas.api.request.wxdc.StoreListRequest; +import com.jwsaas.api.request.wxdc.StoreOpenStatusUpdateRequest; +import com.jwsaas.api.request.wxdc.StoreOrderCancelRequest; +import com.jwsaas.api.request.wxdc.StoreOrderConfirmRequest; +import com.jwsaas.api.request.wxdc.StoreOrderDeliveryRequest; +import com.jwsaas.api.request.wxdc.StoreOrderListRequest; +import com.jwsaas.api.request.wxdc.StorePayParameterRequest; +import com.jwsaas.api.request.wxdc.StoreRefuseRefundRequest; +import com.jwsaas.api.request.wxdc.UserApplyRefundRequest; +import com.jwsaas.api.service.WopService; + +/** + * 微信点餐 + */ +public interface WxdcService extends WopService { + + /** + * 广告图片列表 + */ + Object adPictureList(AdPictureListRequest request); + + /** + * 门店信息列表 + */ + Object storeList(StoreListRequest request); + + /** + * 根据公众号查询门店信息 + */ + Object storeListByWid(StoreListByWidRequest request); + + /** + * 门店信息详情 + */ + Object storeInfo(StoreInfoRequest request); + + /** + * 商品分类列表 + */ + Object goodsCategoryList(GoodsCategoryListRequest request); + + /** + * 商品分类列表(新) + */ + Object goodsCategory(GoodsCategoryRequest request); + + /** + * 商品信息列表 + */ + Object goodsList(GoodsListRequest request); + + /** + * 商品做法列表 + */ + Object goodsMakeList(GoodsMakeListRequest request); + + /** + * 销售订单创建(该订单已支付成功) + */ + Object salesOrderCreate(SalesOrderCreateRequest request); + + /** + * 销售订单列表 + */ + Object salesOrderList(SalesOrderListRequest request); + + /** + * 销售订单详情 + */ + Object salesOrderInfo(SalesOrderInfoRequest request); + + /** + * 获取门店支付参数 + */ + Object storePayParameter(StorePayParameterRequest request); + + /** + * 销售订单取消,用户主动取消/付款超时取消 + */ + Object salesOrderCancel(SalesOrderCancelRequest request); + + /** + * 门店销售订单(微信点餐订单)列表 + */ + Object storeOrderList(StoreOrderListRequest request); + + /** + * 门店确认订单 + */ + Object storeOrderConfirm(StoreOrderConfirmRequest request); + + /** + * 门店取消订单 + */ + Object storeOrderCancel(StoreOrderCancelRequest request); + + /** + * 门店确认送达 + */ + Object storeOrderDelivery(StoreOrderDeliveryRequest request); + + /** + * 门店营业状态修改 + */ + Object storeOpenStatusUpdate(StoreOpenStatusUpdateRequest request); + + /** + * 用户申请退款 + */ + Object userApplyRefund(UserApplyRefundRequest request); + + /** + * 门店同意退款 + */ + Object storeAgreeRefund(StoreAgreeRefundRequest request); + + /** + * 门店拒绝退款 + */ + Object storeRefuseRefund(StoreRefuseRefundRequest request); + + /** + * 商品详细信息(微信点餐) + */ + Object goodsInfo(GoodsInfoRequest request); + + /** + * 门店售罄 + * + * @param request + * @return + */ + Object storeGoodsSellOut(GoodsSellOutRequest request); + + /** + * 门店开卖 + * + * @param request + * @return + */ + Object storeGoodsSellIn(GoodsSellInRequest request); + + /** + * 获取租户微信点餐会员卡支付设置; + * @param request + * @return + */ + Object memberCardSet(StoreListRequest request); + + /** + * 获取租户微信点餐门店自助点餐设置; + * @param request + * @return + */ + Object storeTakeOrderSet(StoreListRequest request); +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/wxdc/WxdcZCService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/wxdc/WxdcZCService.java new file mode 100644 index 0000000..6605df3 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/wxdc/WxdcZCService.java @@ -0,0 +1,28 @@ +package com.jwsaas.api.service.wxdc; + +import com.jwsaas.api.request.wxdc.GoodsInfoZCRequest; +import com.jwsaas.api.request.wxdc.GoodsListRequest; +import com.jwsaas.api.request.wxdc.ZCGoodsCategoryListRequest; +import com.jwsaas.api.service.WopService; + +/** + * 微信点餐-中餐 + */ +public interface WxdcZCService extends WopService { + + + /** + * 商品分类列表 + */ + Object goodsCategoryList(ZCGoodsCategoryListRequest request); + + /** + * 商品信息列表 + */ + Object goodsList(GoodsListRequest request); + + /** + * 指定商品信息 + */ + Object goodsInfo(GoodsInfoZCRequest request); +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/wxdc/impl/WxdcDistributionServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/wxdc/impl/WxdcDistributionServiceImpl.java new file mode 100644 index 0000000..0e740f9 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/wxdc/impl/WxdcDistributionServiceImpl.java @@ -0,0 +1,296 @@ +package com.jwsaas.api.service.wxdc.impl; + +import com.jwsaas.api.request.wxdc.DistributionAddressRequest; +import com.jwsaas.api.response.CommonResponse; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonListResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.wxdc.WxdcDistributionService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.WxdcDistributionAddress; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.utils.AppKeyUtil; +import org.apache.commons.collections4.CollectionUtils; + +import javax.annotation.Resource; +import java.util.*; + +/** + * @Author:CHL + * @Date:Create in 2018/7/27 + * @Description: 微信点餐配送 + */ + +@ServiceMethodBean(version = "1.0") +public class WxdcDistributionServiceImpl extends WopServiceImpl implements WxdcDistributionService { + + @Resource + private com.jwsaas.service.food.WxdcDistributionAddressService wxdcDistributionAddressService; + @Resource + private com.jwsaas.service.food.WxdcDistributionService wxdcDistributionService; + + /** + * 查看微信点餐饮的配送地址 + */ + @ServiceMethod(method = "wxdc.get.distribution.address", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "微信点餐饮的配送地址列表") + @Override + public Object getDistributionAddressList(DistributionAddressRequest request) { + String info = "获取配送地址"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug(info+ " >>>getDistributionAddressList>>>appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + //NO.1 业务参数 + String wid = request.getWid(); + String openId = request.getOpenId(); + CommonListResponse response = null; + + try { + response = new CommonListResponse(); + Criteria c = new Criteria(); + c.add(Restrictions.eq("tenantId",tenantId)); + c.add(Restrictions.eq("wid",wid)); + c.add(Restrictions.eq("openId",openId)); + List wxdcAddressList = this.wxdcDistributionAddressService.getList(tenantId,c); + List> list = new ArrayList<>(); + for (WxdcDistributionAddress wa:wxdcAddressList){ + Map map = new HashMap<>(); + map.put("id",wa.getId()); + map.put("wid",wa.getWid()); + map.put("openId",wa.getOpenId()); + map.put("name",wa.getName()); + map.put("mobile",wa.getMobile()); + map.put("sex",wa.getSex()); + map.put("isDefault",wa.getIsDefault()); + map.put("receiveMobile",wa.getReceiveMobile()); + map.put("receiveAddress",wa.getReceiveAddress()); + map.put("addressLabel",wa.getAddressLabel()); + + list.add(map); + } + + response.setStatus(1); + response.setMessage("获取数据成功"); + response.setList(list); + } catch (Exception e) { + e.printStackTrace(); + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + + + return response; + } + + /** + * 添加配送地址 + */ + @ServiceMethod(method = "wxdc.save.distribution.address", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "添加配送地址") + @Override + public Object addDistributionAddress(DistributionAddressRequest request) { + String info = "添加配送地址"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug(info+ ">>>>addDistributionAddress>>>appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + //NO.1 业务参数 + String wid = request.getWid(); + String openId = request.getOpenId(); + String name = request.getName(); + String sex = request.getSex(); + String mobile = request.getMobile(); + String receiveMobile = request.getReceiveMobile(); + String receiveAddress = request.getReceiveAddress(); + Integer isDefaullt = request.getIsDefault(); + String addressLabel = request.getAddressLabel(); + CommonResponse response = null; + try { + response = new CommonResponse(); + + if(isDefaullt == 1){ + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("openId",openId)); + criteria.add(Restrictions.eq("isDefault",1)); + List list = wxdcDistributionAddressService.getList(tenantId,criteria); + if(CollectionUtils.isNotEmpty(list)){ + for(WxdcDistributionAddress address : list){ + address.setIsDefault(0); + wxdcDistributionAddressService.update(tenantId,address); + } + } + } + + //NO.2构建持久化对象 + WxdcDistributionAddress wxdcEntity = new WxdcDistributionAddress(); + wxdcEntity.setTenantId(tenantId); + wxdcEntity.setCreateUser("open-api"); + wxdcEntity.setCreateDate(new Date()); + wxdcEntity.setWid(wid); + wxdcEntity.setOpenId(openId); + wxdcEntity.setName(name); + wxdcEntity.setSex(sex); + wxdcEntity.setMobile(mobile); + wxdcEntity.setReceiveMobile(receiveMobile); + wxdcEntity.setReceiveAddress(receiveAddress); + wxdcEntity.setIsDefault(isDefaullt); + wxdcEntity.setAddressLabel(addressLabel); + //NO.3 持久化操作 + WxdcDistributionAddress temp = this.wxdcDistributionAddressService.save(tenantId,wxdcEntity); + if(temp!=null){ + response.setStatus(1); + response.setMessage("增加配送地址操作成功"); + }else{ + response.setStatus(0); + response.setMessage("操作失败"); + response.setErrCode("error"); + response.setErrMessage("操作失败"); + } + } catch (Exception e) { + e.printStackTrace(); + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + //NO.4 返回数据 + return response; + } + + + @ServiceMethod(method = "wxdc.delete.distribution.address", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "删除配送地址") + @Override + public Object deleteDistributionAddress(DistributionAddressRequest request) { + String info = "删除配送地址"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug(info + ">>>>deleteDistributionAddress>>>appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + //业务参数 + String id = request.getId(); + CommonDataResponse response = null; + Integer deleteCount =0; + try { + response = new CommonDataResponse(); + deleteCount = this.wxdcDistributionAddressService.delete(tenantId,id); + Map map = new HashMap<>(); + map.put("deleteCount",deleteCount); + response.setStatus(1); + response.setMessage("删除数据成功"); + response.setData(map); + } catch (Exception e) { + e.printStackTrace(); + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + + } + + @ServiceMethod(method = "wxdc.one.distribution.address", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "根据ID获取配送地址") + @Override + public Object oneDistributionAddress(DistributionAddressRequest request) { + String info = "根据ID获取配送地址"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug(info + ">>>>oneDistributionAddress>>>appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + //业务参数 + String id = request.getId(); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + WxdcDistributionAddress wxaddress = this.wxdcDistributionAddressService.get(tenantId,id); + Map map = new HashMap<>(); + map.put("data",wxaddress); + response.setStatus(1); + response.setMessage("获取数据成功"); + response.setData(map); + } catch (Exception e) { + e.printStackTrace(); + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + @ServiceMethod(method = "wxdc.update.distribution.address", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "更新配送地址") + @Override + public Object updateDistributionAddress(DistributionAddressRequest request) { + String info = "更新配送地址"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug(info+ ">>>>updateDistributionAddress>>>appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String tenantCode = appKeyInfo.getTenantCode(); + String tenantId = tenantCode; + //NO.1 业务参数 + String id = request.getId(); + String wid = request.getWid(); + String openId = request.getOpenId(); + String name = request.getName(); + String sex = request.getSex(); + String mobile = request.getMobile(); + String receiveMobile = request.getReceiveMobile(); + String receiveAddress = request.getReceiveAddress(); + Integer isDefaullt = request.getIsDefault(); + String addressLabel = request.getAddressLabel(); + CommonResponse response = null; + try { + response = new CommonResponse(); + + if(isDefaullt == 1){ + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("openId",openId)); + criteria.add(Restrictions.eq("isDefault",1)); + List list = wxdcDistributionAddressService.getList(tenantId,criteria); + if(CollectionUtils.isNotEmpty(list)){ + for(WxdcDistributionAddress address : list){ + address.setIsDefault(0); + wxdcDistributionAddressService.update(tenantId,address); + } + } + } + + //NO.2构建持久化对象 + WxdcDistributionAddress wxdcEntity = new WxdcDistributionAddress(); + wxdcEntity.setId(id); + wxdcEntity.setTenantId(tenantId); + wxdcEntity.setModifyUser("open-api"); + wxdcEntity.setModifyDate(new Date()); + wxdcEntity.setWid(wid); + wxdcEntity.setOpenId(openId); + wxdcEntity.setName(name); + wxdcEntity.setSex(sex); + wxdcEntity.setMobile(mobile); + wxdcEntity.setReceiveMobile(receiveMobile); + wxdcEntity.setReceiveAddress(receiveAddress); + wxdcEntity.setIsDefault(isDefaullt); + wxdcEntity.setAddressLabel(addressLabel); + Integer temp = 0; + //NO.3 持久化操作 + temp = this.wxdcDistributionAddressService.update(tenantId,wxdcEntity); + if(temp!=0){ + response.setStatus(1); + response.setMessage("更新配送地址操作成功"); + }else{ + response.setStatus(0); + response.setMessage("操作失败"); + response.setErrCode("error"); + response.setErrMessage("操作失败"); + } + } catch (Exception e) { + e.printStackTrace(); + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + //NO.4 返回数据 + return response; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/wxdc/impl/WxdcServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/wxdc/impl/WxdcServiceImpl.java new file mode 100644 index 0000000..2b6846c --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/wxdc/impl/WxdcServiceImpl.java @@ -0,0 +1,3443 @@ +package com.jwsaas.api.service.wxdc.impl; + +import java.math.BigDecimal; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import com.jwsaas.entity.food.*; +import com.jwsaas.service.food.TicketPrintSettingService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.jwsaas.Constant; +import com.jwsaas.Constants; +import com.jwsaas.api.entity.wxdc.SalesOrderEntity; +import com.jwsaas.api.entity.wxdc.SalesOrderItemEntity; +import com.jwsaas.api.entity.wxdc.SalesOrderItemMakeEntity; +import com.jwsaas.api.entity.wxdc.SalesOrderItemPromoEntity; +import com.jwsaas.api.entity.wxdc.SalesOrderPayEntity; +import com.jwsaas.api.request.wxdc.AdPictureListRequest; +import com.jwsaas.api.request.wxdc.GoodsCategoryListRequest; +import com.jwsaas.api.request.wxdc.GoodsCategoryRequest; +import com.jwsaas.api.request.wxdc.GoodsInfoRequest; +import com.jwsaas.api.request.wxdc.GoodsListRequest; +import com.jwsaas.api.request.wxdc.GoodsMakeListRequest; +import com.jwsaas.api.request.wxdc.GoodsSellInRequest; +import com.jwsaas.api.request.wxdc.GoodsSellOutRequest; +import com.jwsaas.api.request.wxdc.SalesOrderCancelRequest; +import com.jwsaas.api.request.wxdc.SalesOrderCreateRequest; +import com.jwsaas.api.request.wxdc.SalesOrderInfoRequest; +import com.jwsaas.api.request.wxdc.SalesOrderListRequest; +import com.jwsaas.api.request.wxdc.StoreAgreeRefundRequest; +import com.jwsaas.api.request.wxdc.StoreInfoRequest; +import com.jwsaas.api.request.wxdc.StoreListByWidRequest; +import com.jwsaas.api.request.wxdc.StoreListRequest; +import com.jwsaas.api.request.wxdc.StoreOpenStatusUpdateRequest; +import com.jwsaas.api.request.wxdc.StoreOrderCancelRequest; +import com.jwsaas.api.request.wxdc.StoreOrderConfirmRequest; +import com.jwsaas.api.request.wxdc.StoreOrderDeliveryRequest; +import com.jwsaas.api.request.wxdc.StoreOrderListRequest; +import com.jwsaas.api.request.wxdc.StorePayParameterRequest; +import com.jwsaas.api.request.wxdc.StoreRefuseRefundRequest; +import com.jwsaas.api.request.wxdc.UserApplyRefundRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.response.mode.CommonListResponse; +import com.jwsaas.api.response.mode.CommonPagerResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.wxdc.WxdcService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.mqtt.MqttClientExt; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.pager.Pager; +import com.jwsaas.properties.FdfsClientProperties; +import com.jwsaas.reactor.event.EventKeys; +import com.jwsaas.util.DateUtils; +import com.jwsaas.util.JSONUtil; +import com.jwsaas.utils.AppKeyUtil; +import com.jwsaas.utils.MathUtil; + +import reactor.bus.Event; + +@ServiceMethodBean(version = "1.0") +public class WxdcServiceImpl extends WopServiceImpl implements WxdcService { + + private static final long serialVersionUID = -3615170735139597226L; + + @Resource + private MqttClientExt mqttClient; + @Autowired + private com.jwsaas.cache.CacheService cacheService; + @Autowired + private FdfsClientProperties fdfsClientProperties; + @Resource + private com.jwsaas.service.food.StoreService storeService; + @Resource + private com.jwsaas.service.food.WxStoreService wxStoreService; + @Resource + private com.jwsaas.service.food.ProductUnitService productUnitService; + @Resource + private com.jwsaas.service.food.WxAdPictureService wxAdPictureService; + @Resource + private com.jwsaas.service.food.WxGoodsCategoryService wxGoodsCategoryService; + @Resource + private com.jwsaas.service.food.WxGoodsService wxGoodsService; + @Resource + private com.jwsaas.service.food.WxStoreGoodsService wxStoreGoodsService; + @Resource + private com.jwsaas.service.food.WxGoodsMakeService wxGoodsMakeService; + @Resource + private com.jwsaas.service.food.MakeTypeService makeTypeService; + @Resource + private com.jwsaas.service.food.MakeDetailService makeDetailService; + @Resource + private com.jwsaas.service.food.WxSalesOrderService salesOrderService; + @Resource + private com.jwsaas.service.food.WxSalesOrderItemService salesOrderItemService; + @Resource + private com.jwsaas.service.food.WxSalesOrderItemMakeService salesOrderItemMakeService; + @Resource + private com.jwsaas.service.food.WxSalesOrderItemPromoService salesOrderItemPromoService; + @Resource + private com.jwsaas.service.food.WxSalesOrderLogService salesOrderLogService; + @Resource + private com.jwsaas.service.food.WxSalesPaymentService paymentService; + @Resource + private com.jwsaas.service.food.WxPaymentParameterService wxPaymentParameterService; + @Resource + private com.jwsaas.service.food.StoreProductService storeProductService; + @Resource + private com.jwsaas.service.food.ProductSuitService productSuitService; + @Resource + private com.jwsaas.service.food.ProductSuitDetailService productSuitDetailService; + @Resource + private com.jwsaas.service.food.ProductService productService; + @Resource + private TicketPrintSettingService printSettingService; + + @ServiceMethod(method = "wxdc.ad.picture.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "广告图片列表") + @Override + public Object adPictureList(AdPictureListRequest request) { + String info = "广告图片列表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + CommonListResponse response = null; + try { + response = new CommonListResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("deleteFlag", 0)); + criteria.add(Restrictions.order("orderNo", "asc")); + List dataList = wxAdPictureService.getList(tenantId, criteria); + List> list = new ArrayList<>(); + for (WxAdPicture data : dataList) { + Map map = new HashMap<>(); + map.put("id", data.getId()); + map.put("tenantId", data.getTenantId()); + map.put("orderNo", data.getOrderNo()); + map.put("name", data.getName()); + map.put("width", data.getWidth());// 图片宽度 + map.put("height", data.getHeight());// 图片高度 + map.put("groupName", data.getGroupName());// 存储组名 + map.put("storageFileName", data.getStorageFileName());// 存储文件名 + map.put("dfsAccessDomain", fdfsClientProperties.getAccessDomain()); + map.put("linkUrl", data.getLinkUrl());// 链接地址 + list.add(map); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "wxdc.store.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店信息列表") + @Override + public Object storeList(StoreListRequest request) { + String info = "门店信息列表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String keyword = request.getKeyword(); + CommonListResponse response = null; + try { + response = new CommonListResponse(); + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("deleteFlag", 0)); + criteria.add(Restrictions.eq("enabled", 1));// 是否启用 + if (StringUtils.isNotBlank(keyword)) { + criteria.add(Restrictions.or(Restrictions.like("name", "%" + keyword + "%"), Restrictions.like("address", "%" + keyword + "%"))); + } + criteria.add(Restrictions.notEq("no", "000000")); + criteria.add(Restrictions.order("no", "asc")); + List wxStoreList = wxStoreService.getList(tenantId, criteria); + List> list = new ArrayList<>(); + if (CollectionUtils.isEmpty(wxStoreList)) { + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + return response; + } + + List storeIdList = new ArrayList<>(); + for (WxStore wxStore : wxStoreList) { + storeIdList.add(wxStore.getStoreId()); + } + criteria = new Criteria(); + criteria.add(Restrictions.in("id", storeIdList)); + List erpStoreList = storeService.getList(tenantId, criteria); + Map erpStoreMap = new HashMap<>(); + for (Store store : erpStoreList) { + erpStoreMap.put(store.getId(), store); + } + + // 组织返回结果 + for (WxStore wxStore : wxStoreList) { + Map map = new HashMap<>(); + map.put("id", wxStore.getId()); + map.put("tenantId", wxStore.getTenantId()); + map.put("no", wxStore.getNo());// 门店编号 + map.put("name", wxStore.getName());// 门店名称 + map.put("orderTel", wxStore.getOrderTel());// 订餐电话 + map.put("address", wxStore.getAddress());// 地址 + map.put("storeId", wxStore.getStoreId());// 关联门店ID/ERP门店ID + map.put("latitude", wxStore.getLatitude());// 纬度 + map.put("longitude", wxStore.getLongitude());// 经度 + map.put("noticeInfo", wxStore.getNoticeInfo());// 公告信息 + map.put("isOpen", wxStore.getIsOpen());// 是否营业 + map.put("openTimeType", wxStore.getOpenTimeType());// 营业时间类型 + map.put("openTime", wxStore.getOpenTime());// 营业时间 + map.put("deliverFee", wxStore.getDeliverFee());// 配送费 + map.put("deliverFeeDiscountType", wxStore.getDeliverFeeDiscountType());// 配送费减免类型 + map.put("deliverFeeDiscountRule", wxStore.getDeliverFeeDiscountRule());// 配送费减免规则 + map.put("posNo", wxStore.getPosNo());// POS编号 + // 门店图片 + map.put("dfsAccessDomain", fdfsClientProperties.getAccessDomain()); + map.put("width", 0);// 图片宽度 + map.put("height", 0);// 图片高度 + map.put("groupName", null);// 存储组名 + map.put("storageFileName", null);// 存储文件名 + if (erpStoreMap.get(wxStore.getStoreId()) != null) { + map.put("width", erpStoreMap.get(wxStore.getStoreId()).getWidth());// 图片宽度 + map.put("height", erpStoreMap.get(wxStore.getStoreId()).getHeight());// 图片高度 + map.put("groupName", erpStoreMap.get(wxStore.getStoreId()).getGroupName());// 存储组名 + map.put("storageFileName", erpStoreMap.get(wxStore.getStoreId()).getStorageFileName());// 存储文件名 + } + list.add(map); + } + + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "wxdc.store.info", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店信息详情") + @Override + public Object storeInfo(StoreInfoRequest request) { + String info = "门店信息列表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String wxStoreId = request.getWxStoreId(); + String erpStoreId = request.getErpStoreId(); + String storeNo = request.getStoreNo(); + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + if (StringUtils.isBlank(wxStoreId) && StringUtils.isBlank(erpStoreId) && StringUtils.isBlank(storeNo)) { + response.setStatus(0); + response.setMessage("参数wxStoreId和erpStoreId,storeNo不能同时为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + Criteria criteria = new Criteria(); + if (StringUtils.isNotBlank(wxStoreId)) { + criteria.add(Restrictions.eq("id", wxStoreId)); + } + if (StringUtils.isNotBlank(erpStoreId)) { + criteria.add(Restrictions.eq("storeId", erpStoreId)); + } + if (StringUtils.isNotBlank(storeNo)) { + criteria.add(Restrictions.eq("no", storeNo)); + } + criteria.add(Restrictions.eq("deleteFlag", 0)); + List wxStoreList = wxStoreService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(wxStoreList)) { + response.setStatus(0); + response.setMessage("门店信息不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + // 微信门店信息 + WxStore wxStore = wxStoreList.get(0); + // 关联门店信息 + Store store = storeService.get(tenantId, wxStore.getStoreId()); + + Map data = new HashMap<>(); + data.put("id", wxStore.getId()); + data.put("tenantId", wxStore.getTenantId()); + data.put("no", wxStore.getNo());// 门店编号 + data.put("name", wxStore.getName());// 门店名称 + data.put("orderTel", wxStore.getOrderTel());// 订餐电话 + data.put("address", wxStore.getAddress());// 地址 + data.put("storeId", wxStore.getStoreId());// 关联门店ID/ERP门店ID + data.put("latitude", wxStore.getLatitude());// 纬度 + data.put("longitude", wxStore.getLongitude());// 经度 + data.put("noticeInfo", wxStore.getNoticeInfo());// 公告信息 + //24小时直接返回数据,指定时间段则判断当前时间; + if(2 == wxStore.getOpenTimeType() && 1 == wxStore.getEnabled() && 1 == wxStore.getIsOpen()){ + Date date = new Date(); + String now = com.jwsaas.utils.DateUtils.format(date,"HH:mm:ss"); + String openTime = wxStore.getOpenTime(); + String startTime = openTime.split("-")[0].trim(); + String endTime = openTime.split("-")[1].trim(); + Long nowTime = com.jwsaas.utils.DateUtils.parseDate(now,"HH:mm:ss").getTime(); + Long start = com.jwsaas.utils.DateUtils.parseDate(startTime,"HH:mm").getTime(); + Long end = com.jwsaas.utils.DateUtils.parseDate(endTime,"HH:mm").getTime(); + if(nowTime >= start && nowTime < end){ + data.put("isOpen", 1);// 是否营业 + }else{ + data.put("isOpen", 0);// 是否营业 + } + }else{ + data.put("isOpen", wxStore.getIsOpen());// 是否营业 + } + data.put("openTimeType", wxStore.getOpenTimeType());// 营业时间类型 + data.put("openTime", wxStore.getOpenTime());// 营业时间 + data.put("deliverFee", wxStore.getDeliverFee());// 配送费 + data.put("deliverFeeDiscountType", wxStore.getDeliverFeeDiscountType());// 配送费减免类型 + data.put("deliverFeeDiscountRule", wxStore.getDeliverFeeDiscountRule());// 配送费减免规则 + data.put("posNo", wxStore.getPosNo());// POS编号 + data.put("storeBusModes", wxStore.getBusModes()); // 门店营业模式 + // 门店图片 + data.put("dfsAccessDomain", fdfsClientProperties.getAccessDomain()); + data.put("width", 0);// 图片宽度 + data.put("height", 0);// 图片高度 + data.put("groupName", null);// 存储组名 + data.put("storageFileName", null);// 存储文件名 + if (store != null) { + data.put("width", store.getWidth());// 图片宽度 + data.put("height", store.getHeight());// 图片高度 + data.put("groupName", store.getGroupName());// 存储组名 + data.put("storageFileName", store.getStorageFileName());// 存储文件名 + } + + response.setStatus(1); + response.setMessage("获取成功"); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "wxdc.goods.category.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "商品分类列表") + @Override + public Object goodsCategoryList(GoodsCategoryListRequest request) { + String info = "商品分类列表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + CommonListResponse response = null; + try { + response = new CommonListResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("deleteFlag", 0)); + criteria.add(Restrictions.order("orderNo", "asc")); + List dataList = wxGoodsCategoryService.getList(tenantId, criteria); + List> list = new ArrayList<>(); + for (WxGoodsCategory data : dataList) { + Map map = new HashMap<>(); + map.put("id", data.getId()); + map.put("tenantId", data.getTenantId()); + map.put("name", data.getName()); + map.put("description", data.getDescription()); + map.put("orderNo", data.getOrderNo()); + map.put("path", data.getPath()); + list.add(map); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @SuppressWarnings("unchecked") + @ServiceMethod(method = "wxdc.goods.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "商品信息列表") + @Override + public Object goodsList(GoodsListRequest request) { + String info = "商品信息列表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + String categoryId = request.getCategoryId(); + String property = request.getProperty(); + String keyword = request.getKeyword(); + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + WxStore store = wxStoreService.get(tenantId, storeId); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + + Criteria criteria = new Criteria(); + if (StringUtils.isNoneBlank(categoryId)) { + criteria.add(Restrictions.eq("categoryId", categoryId)); + } + if (StringUtils.isNotEmpty(keyword)) { + criteria.add(Restrictions.like("name", "%" + keyword + "%")); + } + criteria.add(Restrictions.eq("deleteFlag", 0)); + pager = wxStoreGoodsService.getPagerExtendSimpleByStoreId(tenantId, storeId, criteria, pager); + List> list = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(pager.getList())) { + Map dataMap = new HashMap<>(); + List productIdList = new ArrayList<>(); + for (Object obj : pager.getList()) { + Map data = (Map) obj; + String productId = data.get("productId").toString(); + productIdList.add(productId); + Map productInfo = new HashMap<>(); + productInfo.put("productId", productId); + productInfo.put("specCount", 0);// 规格数量 + productInfo.put("makeCount", 0);// 做法数量 + list.add(productInfo); + dataMap.put(productId, productInfo); + } + // 获取POS端商品售价 + criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", store.getStoreId())); + criteria.add(Restrictions.in("productId", productIdList)); + List storeProductList = storeProductService.getList(tenantId, criteria); + Map storeProductMap = new HashMap<>(); + for (StoreProduct storeProduct : storeProductList) { + storeProductMap.put(storeProduct.getSpecId(), storeProduct); + } + // 处理扩展信息,获取商品规格信息等。 + criteria = new Criteria(); + criteria.add(Restrictions.eq("wsg.storeId", storeId)); + criteria.add(Restrictions.eq("wg.deleteFlag", 0)); + criteria.add(Restrictions.in("wg.productId", productIdList)); + criteria.add(Restrictions.order("wsg.price", "asc")); + List> goodsList = this.wxStoreGoodsService.getListExtend(tenantId, criteria); + for (Map goods : goodsList) { + if (dataMap.get(goods.get("productId").toString()) == null) { + continue; + } + Map tempMap = (Map) dataMap.get(goods.get("productId").toString()); + tempMap.put("specCount", 1 + ((Integer) tempMap.get("specCount"))); + tempMap.put("saleStatus", goods.get("saleStatus"));// 售卖状态 + // 规格商品 + List> specList = (List>) tempMap.get("specList"); + if (specList == null) { + specList = new ArrayList<>(); + tempMap.put("specList", specList); + } + Map tempSku = new HashMap<>(); + tempSku.put("goodsId", goods.get("goodsId").toString()); + tempSku.put("productId", goods.get("productId").toString()); + tempSku.put("productNo", null == goods.get("productNo") ? "" : goods.get("productNo").toString()); + tempSku.put("specId", goods.get("specId").toString()); + // tempSku.put("name", goods.get("name")); + tempSku.put("specName", goods.get("specName")); + // tempSku.put("description", goods.get("description")); + tempSku.put("unitId", goods.get("unitId").toString()); + tempSku.put("unitName", goods.get("unitName")); + tempSku.put("price", goods.get("price")); + tempSku.put("memberPrice", goods.get("memberPrice")); + tempSku.put("inventoryQuantity", goods.get("inventoryQuantity"));// 库存量 + // tempSku.put("orderNo", goods.get("orderNo")); + tempSku.put("minCount", goods.get("minCount")); + tempSku.put("limitCount", goods.get("limitCount")); + tempSku.put("priceOrg", goods.get("price")); + tempSku.put("memberPriceOrg", goods.get("memberPrice")); + if (storeProductMap.get(goods.get("specId").toString()) != null) { + tempSku.put("priceOrg", storeProductMap.get(goods.get("specId").toString()).getPrice()); + tempSku.put("memberPriceOrg", storeProductMap.get(goods.get("specId").toString()).getMemberPrice()); + } + tempSku.put("saleStatus", goods.get("saleStatus"));// 售卖状态 + specList.add(tempSku); + if (specList.size() == 1) { + tempMap.put("goodsId", goods.get("goodsId").toString()); + tempMap.put("productId", goods.get("productId").toString()); + tempMap.put("productNo", goods.get("productNo")); + tempMap.put("specId", goods.get("specId").toString()); + tempMap.put("categoryId", goods.get("categoryId").toString()); + tempMap.put("categoryPath", goods.get("categoryPath")); + tempMap.put("name", goods.get("name")); + tempMap.put("boxPrice", goods.get("boxPrice")); + tempMap.put("specName", goods.get("specName")); + tempMap.put("description", goods.get("description")); + tempMap.put("unitId", goods.get("unitId").toString()); + tempMap.put("unitName", goods.get("unitName")); + tempMap.put("price", goods.get("price")); + tempMap.put("memberPrice", goods.get("memberPrice")); + tempMap.put("orderNo", goods.get("orderNo")); + tempMap.put("minCount", goods.get("minCount")); + tempMap.put("limitCount", goods.get("limitCount")); + tempMap.put("isNew", goods.get("isNew")); + tempMap.put("suitFlag", goods.get("suitFlag")); + tempMap.put("groupName", goods.get("groupName")); + tempMap.put("picture", goods.get("picture")); + tempMap.put("dfsAccessDomain", fdfsClientProperties.getAccessDomain()); + tempMap.put("makeCount", 0); + tempMap.put("makeList", new ArrayList<>()); + tempMap.put("priceOrg", goods.get("price")); + tempMap.put("memberPriceOrg", goods.get("memberPrice")); + if (storeProductMap.get(goods.get("specId").toString()) != null) { + tempMap.put("priceOrg", storeProductMap.get(goods.get("specId").toString()).getPrice()); + tempMap.put("memberPriceOrg", storeProductMap.get(goods.get("specId").toString()).getMemberPrice()); + } + } + } + // 处理商品做法 + criteria = new Criteria(); + criteria.add(Restrictions.in("wgm.productId", productIdList)); + criteria.add(Restrictions.group("wgm.productId,wgm.typeId,wgm.makeId")); + criteria.add(Restrictions.order("type.seqNo","asc")); + criteria.add(Restrictions.order("detail.orderNo","asc")); + List dataList = wxGoodsMakeService.getListExtends(tenantId, criteria); + // 获取做法和做法品类id集合 + List makeTypeIds = new ArrayList(); + List makeDetailIds = new ArrayList(); + for (WxGoodsMake data : dataList) { + makeTypeIds.add(data.getTypeId()); + makeDetailIds.add(data.getMakeId()); + } + // 获取做法分类 + Map makeTypeData = new HashMap(); + if (CollectionUtils.isNotEmpty(makeTypeIds)) { + List makeTypes = makeTypeService.findListByIds(tenantId, makeTypeIds); + for (MakeType type : makeTypes) { + makeTypeData.put(type.getId(), type); + } + } + // 获取做法 + Map makeDetailData = new HashMap(); + if (CollectionUtils.isNotEmpty(makeDetailIds)) { + List makeDetails = makeDetailService.findListByIds(tenantId, makeDetailIds); + for (MakeDetail detail : makeDetails) { + makeDetailData.put(detail.getId(), detail); + } + } + Map>> productMakeTypeMap = new LinkedHashMap<>(); + for (WxGoodsMake data : dataList) { + Map> makeTypeMap = productMakeTypeMap.get(data.getProductId()); + if (makeTypeMap == null) { + makeTypeMap = new LinkedHashMap<>(); + productMakeTypeMap.put(data.getProductId(), makeTypeMap); + } + // 做法分类 + Map map = makeTypeMap.get(data.getTypeId()); + if (map == null) { + map = new HashMap<>(); + makeTypeMap.put(data.getTypeId(), map); + // MakeType makeType = makeTypeService.get(tenantId, + // data.getTypeId()); + MakeType makeType = makeTypeData.get(data.getTypeId()); + if (null != makeType) { + map.put("typeId", makeType.getId()); + map.put("typeNo", makeType.getNo()); + map.put("typeName", makeType.getName()); + map.put("type", makeType.getType());// 类型(0口味1做法) + map.put("isRadio", makeType.getIsRadio());// 是否单选(0否1是) + map.put("seqNo", makeType.getSeqNo());// 前台顺序 + } + } + List> makeDetailList = (List>) map.get("detailList"); + if (makeDetailList == null) { + makeDetailList = new ArrayList<>(); + map.put("detailList", makeDetailList); + } + // 做法 + // MakeDetail makeDetail = makeDetailService.get(tenantId, + // data.getMakeId()); + MakeDetail makeDetail = makeDetailData.get(data.getMakeId()); + if (null != makeDetail) { + Map makeDetailMap = new HashMap<>(); + makeDetailMap.put("id", makeDetail.getId()); + makeDetailMap.put("no", makeDetail.getNo()); + makeDetailMap.put("name", makeDetail.getDescription()); + makeDetailMap.put("mngNum", makeDetail.getQtyFlag());// 管理数量 + makeDetailMap.put("addPrice", data.getAddPrice());// 加价 + makeDetailMap.put("orderNo", makeDetail.getOrderNo());// 显示序号 + makeDetailList.add(makeDetailMap); + } + + List> makeList = new ArrayList<>(); + for (Map makeType : makeTypeMap.values()) { + makeList.add(makeType); + } + + Map tempMap = (Map) dataMap.get(data.getProductId()); + tempMap.put("makeCount", makeList.size()); + tempMap.put("makeList", makeList); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "wxdc.goods.make.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "商品做法列表") + @Override + public Object goodsMakeList(GoodsMakeListRequest request) { + String info = "商品做法列表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String productId = request.getProductId(); + CommonListResponse response = null; + try { + response = new CommonListResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("productId", productId)); + List dataList = wxGoodsMakeService.getList(tenantId, criteria); + + Map> makeTypeMap = new LinkedHashMap<>(); + for (WxGoodsMake data : dataList) { + Map map = makeTypeMap.get(data.getTypeId()); + if (map == null) { + map = new HashMap<>(); + makeTypeMap.put(data.getTypeId(), map); + + MakeType makeType = makeTypeService.get(tenantId, data.getTypeId()); + map.put("typeId", makeType.getId()); + map.put("typeNo", makeType.getNo()); + map.put("typeName", makeType.getName()); + map.put("type", makeType.getType());// 类型(0口味1做法) + map.put("isRadio", makeType.getIsRadio());// 是否单选(0否1是) + map.put("seqNo", makeType.getSeqNo());// 前台顺序 + } + + List> makeDetailList = (List>) map.get("detailList"); + if (makeDetailList == null) { + makeDetailList = new ArrayList<>(); + map.put("detailList", makeDetailList); + } + + MakeDetail makeDetail = makeDetailService.get(tenantId, data.getMakeId()); + Map makeDetailMap = new HashMap<>(); + makeDetailMap.put("id", makeDetail.getId()); + makeDetailMap.put("no", makeDetail.getNo()); + makeDetailMap.put("name", makeDetail.getDescription()); + makeDetailMap.put("mngNum", makeDetail.getQtyFlag());// 管理数量 + makeDetailMap.put("addPrice", data.getAddPrice());// 加价 + makeDetailMap.put("orderNo", makeDetail.getOrderNo());// 显示序号 + makeDetailList.add(makeDetailMap); + } + + List> list = new ArrayList<>(); + for (Map makeType : makeTypeMap.values()) { + list.add(makeType); + } + + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 销售订单创建(该订单已支付成功)
+ *

+ * 微信点餐应用确认支付成功之后,调用该接口生成微信点餐订单 + *

+ */ + @ServiceMethod(method = "wxdc.sales.order.create", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "销售订单创建") + @Override + public Object salesOrderCreate(SalesOrderCreateRequest request) { + String info = "销售订单创建"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + String tableNo = request.getTableNo(); + String tableName = request.getTableName(); + String wid = request.getWid();// 公众号主键 + String memberId = request.getMemberId(); + String orderInfoJson = request.getOrderInfoJson(); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + if (StringUtils.isBlank(wid)) { + response.setStatus(0); + response.setMessage("参数wid不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + if (StringUtils.isBlank(memberId)) { + response.setStatus(0); + response.setMessage("参数memberId不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + WxStore wxStore = wxStoreService.get(tenantId, storeId); + if (wxStore == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + SalesOrderEntity salesOrder = JSONUtil.parseObject(orderInfoJson, SalesOrderEntity.class); + logger.debug("salesOrder:" + salesOrder); + + // 通过订单号查询订单是否已存在 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("no", salesOrder.getTicketNo())); + List wxOrders = salesOrderService.getList(tenantId, criteria); + if (wxOrders.size() > 0) { + logger.error(info + " 订单(" + salesOrder.getTicketNo() + ")已存在"); + response.setStatus(0); + response.setMessage("订单(" + salesOrder.getTicketNo() + ")已存在"); + response.setErrCode(CommonErrorCode.error20.getCode()); + response.setErrMessage(CommonErrorCode.error20.getMessage()); + return response; + } + + String createUser = Constant.CREATE_USER; + Date saleDate = new Date(); + String currentDate = DateUtils.format(saleDate, DateUtils.SHOW_DATE_FORMAT); + + WxSalesOrder wxSalesOrder = new WxSalesOrder(); + wxSalesOrder.setNo(salesOrder.getTicketNo());// 单据编号 + Integer daySeq = this.salesOrderService.getDaySeqByStoreId(tenantId, currentDate, wxStore.getId()); + logger.debug("daySeq:" + daySeq); + // 门店当天的订单流水号(每天流水号从1开始) + wxSalesOrder.setDaySeq(daySeq == null ? "1" : daySeq.toString()); + wxSalesOrder.setWid(wid); + wxSalesOrder.setMemberId(memberId);// 会员ID + wxSalesOrder.setPhone(salesOrder.getPhone());// 用户手机号 + wxSalesOrder.setStoreId(wxStore.getId());// 门店ID + wxSalesOrder.setStoreNo(wxStore.getNo());// 门店编号 + wxSalesOrder.setStoreName(wxStore.getName());// 门店名称 + wxSalesOrder.setStatus(0);// 单据状态 + wxSalesOrder.setRefundStatus(0);// 退单状态 + wxSalesOrder.setChannel("1");// 销售渠道 + wxSalesOrder.setSaleDate(StringUtils.isBlank(salesOrder.getSaleDate()) ? saleDate : DateUtils.parseDate(salesOrder.getSaleDate(), DateUtils.SHOW_DATETIME_FORMAT));// 销售时间 + wxSalesOrder.setTableNo(tableNo);// 餐桌号 + wxSalesOrder.setTableName(tableName); + wxSalesOrder.setPeople(salesOrder.getPeople());// 人数 + wxSalesOrder.setBusMode(salesOrder.getBusMode());// 营业模式 + wxSalesOrder.setBookTime(salesOrder.getBookTime());// 预定时间 + wxSalesOrder.setAmount(salesOrder.getAmount());// 消费金额 + wxSalesOrder.setDiscountTotal(salesOrder.getDiscountTotal());// 优惠额 + Double discount = MathUtil.eq(BigDecimal.ZERO, new BigDecimal(salesOrder.getAmount())) ? 0 : MathUtil.divide(new BigDecimal(salesOrder.getDiscountTotal()), new BigDecimal(salesOrder.getAmount())).doubleValue(); + wxSalesOrder.setDiscount(discount);// 优惠率 + wxSalesOrder.setReceivable(salesOrder.getReceivable());// 应收金额 + wxSalesOrder.setMaling(0.0);// 抹零金额 + wxSalesOrder.setPaid(salesOrder.getReceivable());// 实收金额 + wxSalesOrder.setNoOrg(null);// 原单号 + wxSalesOrder.setBackCause(null);// 退单原因 + wxSalesOrder.setIsMember(0);// 是否使用会员卡 + wxSalesOrder.setIsInvalid(0);// 是否失效 + wxSalesOrder.setDescription(salesOrder.getDescription());// 备注说明 + wxSalesOrder.setDistributionFee(salesOrder.getDistributionFee()); + wxSalesOrder.setReceiveName(salesOrder.getReceiveName()); + wxSalesOrder.setReceiveMobile(salesOrder.getReceiveMobile()); + wxSalesOrder.setReceiveAddress(salesOrder.getReceiveAddress()); + wxSalesOrder.setBoxFee(salesOrder.getBoxFee()); // 餐盒费 + wxSalesOrder.setCreateUser(createUser); + wxSalesOrder.setPayType(salesOrder.getPayType());// 付款类型(1-在线支付;) + wxSalesOrder.setPayMode(salesOrder.getPayMode());// 付款方式(1-微信支付;) + wxSalesOrder.setPayDate(StringUtils.isBlank(salesOrder.getPayDate()) ? wxSalesOrder.getSaleDate() : DateUtils.parseDate(salesOrder.getPayDate(), DateUtils.SHOW_DATETIME_FORMAT));// 付款时间 + + // 订单明细列表 + List orderItemList = new ArrayList<>(); + // 做法信息列表 + List> itemMakeList = new ArrayList<>(); + // 优惠信息列表 + List> itemPromoList = new ArrayList<>(); + for (SalesOrderItemEntity item : salesOrder.getItems()) { + WxSalesOrderItem wxSalesOrderItem = new WxSalesOrderItem(); + wxSalesOrderItem.setId(item.getId()); + wxSalesOrderItem.setStoreId(wxStore.getId());// 门店ID + wxSalesOrderItem.setStoreNo(wxStore.getNo());// 门店编号 + wxSalesOrderItem.setStoreName(wxStore.getName());// 门店名称 + wxSalesOrderItem.setTableNo(tableNo);// 桌号 + wxSalesOrderItem.setTableName(tableName); + wxSalesOrderItem.setLineNo(item.getLineNo());// 行号 + wxSalesOrderItem.setGoodsId(StringUtils.isNotBlank(item.getGoodsId()) ? item.getGoodsId() : null);// 商品ID + wxSalesOrderItem.setGoodsName(item.getGoodsName());// 商品名称 + wxSalesOrderItem.setSpecName(item.getSpecName());// 规格名称 + wxSalesOrderItem.setCategoryId(StringUtils.isNotBlank(item.getCategoryId()) ? item.getCategoryId() : null);// 分类ID + + WxGoodsCategory category = null; + if (StringUtils.isNotBlank(item.getCategoryId())) { + category = wxGoodsCategoryService.get(tenantId, item.getCategoryId()); + } + wxSalesOrderItem.setCategoryPath(category == null ? null : category.getPath());// 分类路径 + wxSalesOrderItem.setCategoryName(category == null ? null : category.getName());// 分类名称 + + wxSalesOrderItem.setProductId(item.getProductId());// 产品ID + wxSalesOrderItem.setProductNo(item.getProductNo());// 产品编号 + wxSalesOrderItem.setSpecId(item.getSpecId());// 规格ID + + wxSalesOrderItem.setProductUnitId(item.getProductUnitId());// 产品单位ID + ProductUnit productUnit = productUnitService.get(tenantId, item.getProductUnitId()); + wxSalesOrderItem.setProductUnitName(productUnit == null ? "" : productUnit.getName());// 产品单位名称 + + wxSalesOrderItem.setCount(item.getCount());// 数量 + wxSalesOrderItem.setRcount(0.0);// 退菜数量 + wxSalesOrderItem.setPrice(item.getPrice());// 销售价格 + wxSalesOrderItem.setPriceOrg(item.getPriceOrg());// 产品原价 + wxSalesOrderItem.setDiscountPrice(item.getDiscountPrice());// 折后价格 + wxSalesOrderItem.setSaleDate(saleDate);// 销售时间 + wxSalesOrderItem.setAmount(item.getAmount());// 消费金额 + wxSalesOrderItem.setDiscountTotal(item.getDiscountTotal());// 优惠额 + discount = MathUtil.eq(BigDecimal.ZERO, new BigDecimal(item.getAmount())) ? 0 : MathUtil.divide(new BigDecimal(item.getDiscountTotal()), new BigDecimal(item.getAmount())).doubleValue(); + wxSalesOrderItem.setDiscount(discount);// 优惠率 + wxSalesOrderItem.setReceivable(item.getReceivable());// 应收金额 + + wxSalesOrderItem.setAddPriceTotal(item.getAddPriceTotal());// 加价金额 + wxSalesOrderItem.setDiscountAddTotal(item.getDiscountAddTotal());// 加价优惠金额 + wxSalesOrderItem.setAmountAddTotal(item.getAmountAddTotal());// 加价应收金额 + + wxSalesOrderItem.setAmountTotal(item.getAmountTotal());// 消费总额 + wxSalesOrderItem.setReceivableTotal(item.getReceivableTotal());// 应收总额 + wxSalesOrderItem.setIsMember(0);// 是否使用会员卡 + + wxSalesOrderItem.setIsSuit(item.getIsSuit());// 是否套餐 + wxSalesOrderItem.setSuitId(item.getSuitId());// 套餐主菜ID + wxSalesOrderItem.setParentId(item.getParentId());// 主菜ID + wxSalesOrderItem.setBoxNum(item.getBoxNum()); // 餐盒数量 2018-08-01 + wxSalesOrderItem.setBoxPrice(item.getBoxPrice());// 餐盒费 + + orderItemList.add(wxSalesOrderItem); + + // 做法 + List makeList = new ArrayList<>(); + List makes = item.getMakes(); + for (SalesOrderItemMakeEntity makeEntity : makes) { + WxSalesOrderItemMake make = new WxSalesOrderItemMake(); + make.setStoreId(wxStore.getId());// 门店ID + make.setStoreNo(wxStore.getNo());// 门店编号 + make.setStoreName(wxStore.getName());// 门店名称 + make.setMakeId(makeEntity.getMakeId());// 做法ID + make.setMakeName(makeEntity.getMakeName());// 做法名称 + make.setAddPrice(makeEntity.getAddPrice());// 做法加价 + make.setDiscountPrice(makeEntity.getDiscountPrice());// 做法折后加价 + make.setCount(makeEntity.getCount());// 做法数量 + make.setRcount(0.0);// 做法退数量 + make.setAddTotal(makeEntity.getAddTotal());// 加价总额 + make.setDiscountAddTotal(makeEntity.getDiscountAddTotal());// 折后总额 + discount = MathUtil.eq(BigDecimal.ZERO, new BigDecimal(makeEntity.getAddTotal())) ? 0 : MathUtil.divide(new BigDecimal(makeEntity.getDiscountAddTotal()), new BigDecimal(makeEntity.getAddTotal())).doubleValue(); + make.setDiscount(discount);// 折扣率 + make.setQtyFlag(makeEntity.getMngNum());// 管理数量 + make.setSaleDate(saleDate);// 销售时间 + makeList.add(make); + } + + itemMakeList.add(makeList); + + // 优惠信息 + List promoList = new ArrayList<>(); + List promoEntityList = item.getPromotions() != null ? item.getPromotions() : new ArrayList(); + for (SalesOrderItemPromoEntity promoEntity : promoEntityList) { + WxSalesOrderItemPromo promo = new WxSalesOrderItemPromo(); + promo.setStoreId(wxStore.getId());// 门店ID + promo.setType(promoEntity.getType());// 优惠类型 + promo.setInfo(promoEntity.getInfo());// 优惠说明 + promo.setDiscountMoney(promoEntity.getDiscountMoney());// 优惠金额 + promo.setSaleDate(saleDate);// 销售时间 + promoList.add(promo); + } + + itemPromoList.add(promoList); + } + + // 付款信息 + List pays = new ArrayList<>(); + for (SalesOrderPayEntity payEntity : salesOrder.getPays()) { + WxSalesPayment paymentInfo = new WxSalesPayment(); + paymentInfo.setStoreId(wxStore.getId());// 门店ID + paymentInfo.setPayNo(payEntity.getPayNo());// 付款单号 + paymentInfo.setPayType(payEntity.getPayType());// 付款类型 + paymentInfo.setPayMode(payEntity.getPayMode());// 付款方式 + paymentInfo.setStatus(payEntity.getStatus());// 单据状态 + paymentInfo.setPaid(payEntity.getPaid());// 实收金额 + paymentInfo.setRchange(payEntity.getRchange());// 找零金额 + paymentInfo.setMoney(payEntity.getMoney());// 已收金额 + paymentInfo.setVoucherNo(payEntity.getVoucherNo());// 凭证号 + paymentInfo.setPayDate(StringUtils.isBlank(payEntity.getPayDate()) ? new Date() : DateUtils.parseDate(payEntity.getPayDate(), DateUtils.SHOW_DATETIME_FORMAT));// 付款时间 + paymentInfo.setPayAccount(payEntity.getPayAccount());// 付款账号 + paymentInfo.setMemo(payEntity.getMemo());// 备注 + pays.add(paymentInfo); + } + + wxSalesOrder = salesOrderService.saveExtend(tenantId, wxSalesOrder, orderItemList, itemMakeList, itemPromoList, pays); + + Map data = new HashMap<>(); + data.put("ticketId", wxSalesOrder.getId()); + data.put("ticketNo", wxSalesOrder.getNo()); + + response.setStatus(1); + response.setMessage("获取成功"); + response.setData(data); + // 订单创建成功,执行后续事件 + logger.debug(">>>>>>>用户下单成功,执行后续事件"); + Map eventData = new HashMap<>(); + eventData.put("appKey", appKey); + eventData.put("appId", appId); + eventData.put("tenantCode", tenantCode); + eventData.put("appCode", appCode); + eventData.put("tenantId", tenantId); + eventData.put("wid", wid); + eventData.put("wxStore", wxStore); + eventData.put("wxSalesOrder", wxSalesOrder); + eventBus.notify(EventKeys.WXDC_ORDER_CREATE, Event.wrap(eventData)); + logger.error("用户下单成功,通知门店:订单ID" + wxSalesOrder.getId() + ",订单编号" + wxSalesOrder.getNo()); + try { + orderStatusNotify(tenantCode, wxStore.getStoreId(), wxSalesOrder.getId(), 1); + } catch (Exception e) { + logger.error(info + "时,发生异常", e); + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 微信点餐订单状态变化,Cache操作
+ *

+ * 订单状态: 0-等待付款;1-已支付;2-已退单;3-已取消;4-商家已确认;5-已完成;
+ *

+ * + * @param tenantId + * @param erpStoreId + * @param orderId + * @param action + * 1-新订单;2-用户取消;3-商家5分钟不处理,超时自动取消;4-商家取消(拒单);5-商家确认(接单);6-用户申请退款; + * 7-商家拒绝退款;8-商家同意退款; + * @throws Exception + */ + protected void orderStatusNotify(String tenantId, String erpStoreId, String orderId, int action) throws Exception { + String info = "微信点餐订单状态变化,Cache操作"; + logger.debug(">>>>>>>" + info + "。。。"); + String appSign = Constants.APP_TYPE_SIGN; + if (action == 1 || action == 6) { + // 待处理订单发消息 + Map orderIds = (Map) cacheService.get(tenantId, "weixin_" + erpStoreId); + if (orderIds != null) { + orderIds.put(orderId, orderId); + cacheService.set(tenantId, "weixin_" + erpStoreId, orderIds, 3600); + } else { + orderIds = new HashMap<>(); + orderIds.put(orderId, orderId); + cacheService.set(tenantId, "weixin_" + erpStoreId, orderIds, 3600); + } + } else { + // 清除redis + Object weixinOrderIds = cacheService.get(tenantId, "weixin_" + erpStoreId); + if (weixinOrderIds != null) { + Map orderIds = (Map) cacheService.get(tenantId, "weixin_" + erpStoreId); + orderIds.remove(orderId); + cacheService.set(tenantId, "weixin_" + erpStoreId, orderIds, 3600); + } else { + Map orderIds = new HashMap<>(); + cacheService.set(tenantId, "weixin_" + erpStoreId, orderIds, 3600); + } + } + sendMessage(appSign, tenantId, erpStoreId); + logger.debug(">>>>>>>" + info + "。。。end"); + } + + /** + * 微信点餐订单状态变化,消息中心发布消息 + */ + protected void sendMessage(String appSign, String tenantId, String erpStoreId) throws Exception { + String info = "微信点餐订单状态变化,消息中心发布消息"; + logger.debug(">>>>>>>" + info + "。。。"); + Map orderIds = (Map) cacheService.get(tenantId, "weixin_" + erpStoreId); + String ids = ""; + for (Map.Entry entry : orderIds.entrySet()) { + ids = ids + entry.getKey() + ","; + } + if (ids.length() > 0) { + ids = ids.substring(0, ids.length() - 1); + } + Map order = new HashMap<>(); + order.put("weixin", ids); + order.put("date", DateUtils.format(new Date(), DateUtils.SHOW_DATETIME_FORMAT)); + mqttClient.Publish("weixin/" + appSign + "/" + tenantId + "/" + erpStoreId, JSONUtil.toJSONString(order)); + logger.debug(">>>>>>>" + info + "。。。end"); + } + + @ServiceMethod(method = "wxdc.sales.order.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "销售订单列表") + @Override + public Object salesOrderList(SalesOrderListRequest request) { + String info = "销售订单列表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String memberId = request.getMemberId(); + String startDate = request.getStartDate(); + String endDate = request.getEndDate(); + String orderField = request.getOrderField();// 排序字段 + String orderType = request.getOrderType();// ASC,DESC + String status = request.getStatus();// 状态 + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("memberId", memberId)); + if (StringUtils.isNotBlank(status)) { + criteria.add(Restrictions.eq("status", status)); + } + if (StringUtils.isNotBlank(startDate)) { + criteria.add(Restrictions.ge("saleDate", startDate)); + } + if (StringUtils.isNotBlank(endDate)) { + criteria.add(Restrictions.le("saleDate", endDate)); + } + if (StringUtils.isNotBlank(orderField) && StringUtils.isNotBlank(orderType)) { + criteria.add(Restrictions.order(orderField, orderType)); + } + pager = salesOrderService.getPager(tenantId, criteria, pager); + List> list = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(pager.getList())) { + List storeIdList = new ArrayList<>(); + List salesOrderIdList = new ArrayList<>(); + for (Object obj : pager.getList()) { + WxSalesOrder salesOrder = (WxSalesOrder) obj; + if (!storeIdList.contains(salesOrder.getStoreId())) { + storeIdList.add(salesOrder.getStoreId()); + } + salesOrderIdList.add(salesOrder.getId()); + } + + // 获取门店信息 + criteria = new Criteria(); + criteria.add(Restrictions.in("id", storeIdList)); + List wxStoreList = wxStoreService.getList(tenantId, criteria); + Map wxStoreMap = new HashMap<>(); + for (WxStore wxStore : wxStoreList) { + wxStoreMap.put(wxStore.getId(), wxStore); + } + + // 获取订单明细信息 + criteria = new Criteria(); + criteria.add(Restrictions.in("oi.ticketId", salesOrderIdList)); + criteria.add(Restrictions.order("oi.lineNo", "asc")); + List orderItemList = salesOrderItemService.getListExtend(tenantId, criteria); + Map> orderItemMap = new HashMap<>(); + for (WxSalesOrderItem orderItem : orderItemList) { + List itemList = orderItemMap.get(orderItem.getTicketId()); + if (itemList == null) { + itemList = new ArrayList<>(); + orderItemMap.put(orderItem.getTicketId(), itemList); + } + itemList.add(orderItem); + } + + for (Object obj : pager.getList()) { + WxSalesOrder salesOrder = (WxSalesOrder) obj; + WxStore wxStore = wxStoreMap.get(salesOrder.getStoreId()); + Map data = new HashMap<>(); + data.put("ticketId", salesOrder.getId());// 单据ID + data.put("ticketNo", salesOrder.getNo());// 单据编号 + data.put("memberId", salesOrder.getMemberId());// 会员ID + data.put("phone", salesOrder.getPhone());// 用户手机号 + data.put("storeId", wxStore.getId());// 门店ID + data.put("storeNo", wxStore.getNo());// 门店编号 + data.put("storeName", wxStore.getName());// 门店名称 + data.put("erpStoreId", wxStore.getStoreId());// 关联门店ID/ERP门店ID + data.put("takeNo", salesOrder.getTakeNo());// 取餐号 + data.put("status", salesOrder.getStatus());// 单据状态 + data.put("refundStatus", salesOrder.getRefundStatus());// 退单状态 + data.put("channel", salesOrder.getChannel());// 销售渠道 + data.put("saleDate", DateUtils.format(salesOrder.getSaleDate(), DateUtils.SHOW_DATETIME_FORMAT));// 销售时间 + data.put("tableNo", salesOrder.getTableNo());// 餐桌号 + data.put("tableName", salesOrder.getTableName());// 餐桌名称 + data.put("people", salesOrder.getPeople());// 人数 + data.put("busMode", salesOrder.getBusMode());// 营业模式 + data.put("amount", salesOrder.getAmount());// 消费金额 + data.put("discount", salesOrder.getDiscount());// 优惠率 + data.put("discountTotal", salesOrder.getDiscountTotal());// 优惠金额 + data.put("receivable", salesOrder.getReceivable());// 应收金额 + data.put("maling", salesOrder.getMaling());// 抹零金额 + data.put("paid", salesOrder.getMaling());// 实收金额 + data.put("noOrg", salesOrder.getNoOrg());// 原单号 + data.put("backCause", salesOrder.getBackCause());// 退单原因 + data.put("isMember", salesOrder.getIsMember());// 是否使用会员卡 + data.put("isInvalid", salesOrder.getIsInvalid());// 是否失效 + data.put("description", salesOrder.getDescription());// 备注说明 + data.put("boxFee", salesOrder.getBoxFee());// 餐盒费 + data.put("receiveName", salesOrder.getReceiveName());// 收货人姓名 + data.put("receiveMobile", salesOrder.getReceiveMobile());// 收餐人手机号 + data.put("receiveAddress", salesOrder.getReceiveAddress());// 收餐人地址 + data.put("distributionFee", salesOrder.getDistributionFee());// 配送费 + data.put("payType", salesOrder.getPayType());// 付款类型(1-在线支付;) + data.put("payMode", salesOrder.getPayMode());// 付款方式(05-微信支付;) + data.put("payDate", salesOrder.getPayDate() == null ? null : DateUtils.format(salesOrder.getPayDate(), DateUtils.SHOW_DATETIME_FORMAT));// 付款时间 + data.put("cancelDate", salesOrder.getCancelDate() == null ? null : DateUtils.format(salesOrder.getCancelDate(), DateUtils.SHOW_DATETIME_FORMAT));// 取消时间 + data.put("cancelReason", salesOrder.getCancelReason());// 取消原因 + data.put("storeReason", salesOrder.getStoreReason());// 门店意见 + + // 订单明细 + List> salesOrderItem = new ArrayList<>(); + for (WxSalesOrderItem orderItem : orderItemMap.get(salesOrder.getId())) { + Map itemMap = new HashMap<>(); + itemMap.put("id", orderItem.getId());// ID + itemMap.put("lineNo", orderItem.getLineNo());// 行号 + itemMap.put("goodsId", orderItem.getGoodsId());// 商品ID + itemMap.put("goodsName", orderItem.getGoodsName());// 商品名称 + itemMap.put("specName", orderItem.getSpecName());// 规格名称 + itemMap.put("categoryId", orderItem.getCategoryId());// 分类ID + // itemMap.put("categoryPath", + // orderItem.getCategoryPath());// + // 分类路径 + itemMap.put("categoryName", orderItem.getCategoryName());// 分类名称 + itemMap.put("productId", orderItem.getProductId());// 产品ID + itemMap.put("productNo", orderItem.getProductNo());// 产品编号 + itemMap.put("specId", orderItem.getSpecId());// 规格ID + itemMap.put("productUnitId", orderItem.getProductUnitId());// 产品单位 + itemMap.put("productUnitName", orderItem.getProductUnitName());// 产品单位名称 + itemMap.put("count", orderItem.getCount());// 数量 + itemMap.put("rcount", orderItem.getRcount());// 退菜数量 + itemMap.put("price", orderItem.getPrice());// 销售价格 + itemMap.put("priceOrg", orderItem.getPriceOrg());// 产品原价 + itemMap.put("discountPrice", orderItem.getDiscountPrice());// 折后价格 + // itemMap.put("saleDate", + // DateUtils.format(orderItem.getSaleDate(), + // DateUtils.SHOW_DATETIME_FORMAT));// 销售时间 + itemMap.put("amount", orderItem.getAmount());// 消费金额 + itemMap.put("discount", orderItem.getDiscount());// 优惠率 + itemMap.put("discountTotal", orderItem.getDiscountTotal());// 优惠金额 + itemMap.put("receivable", orderItem.getReceivable());// 应收金额 + itemMap.put("addPriceTotal", orderItem.getAddPriceTotal());// 加价金额 + itemMap.put("discountAddTotal", orderItem.getDiscountAddTotal());// 加价优惠金额 + itemMap.put("amountAddTotal", orderItem.getAmountAddTotal());// 加价应收金额 + itemMap.put("amountTotal", orderItem.getAmountTotal());// 消费总额 + itemMap.put("receivableTotal", orderItem.getReceivableTotal());// 应收总额 + itemMap.put("isMember", orderItem.getIsMember());// 是否使用会员卡 + itemMap.put("isSuit", orderItem.getIsSuit());// 是否套菜 + itemMap.put("suitId", orderItem.getSuitId());// 套菜ID + itemMap.put("parentId", orderItem.getParentId());// 父记录ID + + itemMap.put("groupName", orderItem.getGroupName()); + itemMap.put("picture", orderItem.getPicture()); + itemMap.put("dfsAccessDomain", fdfsClientProperties.getAccessDomain()); + itemMap.put("boxNum", orderItem.getBoxNum()); + itemMap.put("boxPrice", orderItem.getBoxPrice()); + salesOrderItem.add(itemMap); + } + data.put("items", salesOrderItem);// 订单明细列表 + + list.add(data); + } + } + + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "wxdc.sales.order.info", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "销售订单详情") + @Override + public Object salesOrderInfo(SalesOrderInfoRequest request) { + String info = "销售订单详情"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String wxStoreId = request.getWxStoreId(); + String erpStoreId = request.getErpStoreId(); + String memberId = request.getMemberId(); + String ticketId = request.getTicketId(); + String ticketNo = request.getTicketNo(); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + if (StringUtils.isBlank(wxStoreId) && StringUtils.isBlank(erpStoreId)) { + response.setStatus(0); + response.setMessage("参数wxStoreId和erpStoreId不能同时为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + Criteria criteria = new Criteria(); + if (StringUtils.isNotBlank(wxStoreId)) { + criteria.add(Restrictions.eq("id", wxStoreId)); + } + if (StringUtils.isNotBlank(erpStoreId)) { + criteria.add(Restrictions.eq("storeId", erpStoreId)); + } + criteria.add(Restrictions.eq("deleteFlag", 0)); + List wxStoreList = wxStoreService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(wxStoreList)) { + response.setStatus(0); + response.setMessage("门店信息不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + // 微信门店信息 + WxStore wxStore = wxStoreList.get(0); + // 关联门店信息 + // Store store = storeService.get(tenantId, wxStore.getStoreId()); + + criteria = new Criteria(); + + if (null != ticketId && StringUtils.isNotBlank(ticketId)) { + criteria.add(Restrictions.eq("id", ticketId)); + } + if (null != ticketNo && StringUtils.isNotBlank(ticketNo)) { + criteria.add(Restrictions.eq("no", ticketNo)); + } + criteria.add(Restrictions.eq("storeId", wxStore.getId())); + if (StringUtils.isNotBlank(memberId)) { + criteria.add(Restrictions.eq("memberId", memberId)); + } + List salesOrderList = salesOrderService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(salesOrderList)) { + response.setStatus(0); + response.setMessage("订单信息不存在"); + response.setErrCode(CommonErrorCode.error23.getCode()); + response.setErrMessage(CommonErrorCode.error23.getMessage()); + return response; + } + if (salesOrderList.size() != 1) { + response.setStatus(0); + response.setMessage("订单信息不唯一"); + response.setErrCode(CommonErrorCode.error24.getCode()); + response.setErrMessage(CommonErrorCode.error24.getMessage()); + return response; + } + + WxSalesOrder salesOrder = salesOrderList.get(0); + ticketId = salesOrder.getId(); + + // 订单明细信息 + criteria = new Criteria(); + criteria.add(Restrictions.eq("oi.ticketId", ticketId)); + criteria.add(Restrictions.eq("oi.storeId", wxStore.getId())); + if (StringUtils.isNotBlank(memberId)) { + criteria.add(Restrictions.eq("oi.memberId", memberId)); + } + criteria.add(Restrictions.order("oi.lineNo", "asc")); + List orderItemList = salesOrderItemService.getListExtend(tenantId, criteria); + + // 做法信息 + criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketId", ticketId)); + criteria.add(Restrictions.eq("storeId", wxStore.getId())); + if (StringUtils.isNotBlank(memberId)) { + criteria.add(Restrictions.eq("memberId", memberId)); + } + List orderItemMakeList = salesOrderItemMakeService.getList(tenantId, criteria); + Map> orderItemMakeMap = new HashMap<>(); + for (WxSalesOrderItemMake orderItemMake : orderItemMakeList) { + List makeList = orderItemMakeMap.get(orderItemMake.getOrderItemId()); + if (makeList == null) { + makeList = new ArrayList<>(); + orderItemMakeMap.put(orderItemMake.getOrderItemId(), makeList); + } + makeList.add(orderItemMake); + } + + // 优惠信息 + criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketId", ticketId)); + criteria.add(Restrictions.eq("storeId", wxStore.getId())); + List orderItemPromoList = salesOrderItemPromoService.getList(tenantId, criteria); + Map> orderItemPromoMap = new HashMap<>(); + for (WxSalesOrderItemPromo orderItemPromo : orderItemPromoList) { + List promoList = orderItemPromoMap.get(orderItemPromo.getOrderItemId()); + if (promoList == null) { + promoList = new ArrayList<>(); + orderItemPromoMap.put(orderItemPromo.getOrderItemId(), promoList); + } + promoList.add(orderItemPromo); + } + + // 组织返回结果 + Map data = new HashMap<>(); + + data.put("ticketId", salesOrder.getId());// 单据ID + data.put("ticketNo", salesOrder.getNo());// 单据编号 + data.put("memberId", salesOrder.getMemberId());// 会员ID + data.put("phone", salesOrder.getPhone());// 用户手机号 + data.put("storeId", wxStore.getId());// 门店ID + data.put("storeNo", wxStore.getNo());// 门店编号 + data.put("storeName", wxStore.getName());// 门店名称 + data.put("erpStoreId", wxStore.getStoreId());// 关联门店ID/ERP门店ID + data.put("takeNo", salesOrder.getTakeNo());// 取餐号 + data.put("status", salesOrder.getStatus());// 单据状态 + data.put("refundStatus", salesOrder.getRefundStatus());// 退单状态 + data.put("channel", salesOrder.getChannel());// 销售渠道 + data.put("saleDate", DateUtils.format(salesOrder.getSaleDate(), DateUtils.SHOW_DATETIME_FORMAT));// 销售时间 + data.put("tableNo", salesOrder.getTableNo());// 餐桌号 + data.put("tableName", salesOrder.getTableName());// 餐桌名称 + data.put("people", salesOrder.getPeople());// 人数 + data.put("busMode", salesOrder.getBusMode());// 营业模式 + data.put("amount", salesOrder.getAmount());// 消费金额 + data.put("discount", salesOrder.getDiscount());// 优惠率 + data.put("discountTotal", salesOrder.getDiscountTotal());// 优惠金额 + data.put("receivable", salesOrder.getReceivable());// 应收金额 + data.put("maling", salesOrder.getMaling());// 抹零金额 + data.put("paid", salesOrder.getMaling());// 实收金额 + data.put("noOrg", salesOrder.getNoOrg());// 原单号 + data.put("backCause", salesOrder.getBackCause());// 退单原因 + data.put("isMember", salesOrder.getIsMember());// 是否使用会员卡 + data.put("isInvalid", salesOrder.getIsInvalid());// 是否失效 + data.put("description", salesOrder.getDescription());// 备注说明 + data.put("receiveName", salesOrder.getReceiveName());// 收货人姓名 + data.put("receiveMobile", salesOrder.getReceiveMobile());// 收货人手机号 + data.put("receiveAddress", salesOrder.getReceiveAddress());// 收货人地址 + data.put("boxFee", salesOrder.getBoxFee());// 餐盒费 + data.put("distributionFee", salesOrder.getDistributionFee());// 配送费 + data.put("payType", salesOrder.getPayType());// 付款类型(1-在线支付;) + data.put("payMode", salesOrder.getPayMode());// 付款方式(05-微信支付;) + data.put("payDate", salesOrder.getPayDate() == null ? null : DateUtils.format(salesOrder.getPayDate(), DateUtils.SHOW_DATETIME_FORMAT));// 付款时间 + data.put("cancelDate", salesOrder.getCancelDate() == null ? null : DateUtils.format(salesOrder.getCancelDate(), DateUtils.SHOW_DATETIME_FORMAT));// 取消时间 + data.put("cancelReason", salesOrder.getCancelReason());// 取消原因 + data.put("storeReason", salesOrder.getStoreReason());// 门店意见 + + // 订单明细以及做法信息处理 + List> salesOrderItemList = new ArrayList<>(); + for (WxSalesOrderItem orderItem : orderItemList) { + Map itemMap = new HashMap<>(); + itemMap.put("id", orderItem.getId());// ID + itemMap.put("lineNo", orderItem.getLineNo());// 行号 + itemMap.put("goodsId", orderItem.getGoodsId());// 商品ID + itemMap.put("goodsName", orderItem.getGoodsName());// 商品名称 + itemMap.put("specName", orderItem.getSpecName());// 规格名称 + itemMap.put("categoryId", orderItem.getCategoryId());// 分类ID + // itemMap.put("categoryPath", orderItem.getCategoryPath());// + // 分类路径 + itemMap.put("categoryName", orderItem.getCategoryName());// 分类名称 + itemMap.put("productId", orderItem.getProductId());// 产品ID + itemMap.put("productNo", orderItem.getProductNo());// 产品编号 + itemMap.put("specId", orderItem.getSpecId());// 规格ID + itemMap.put("productUnitId", orderItem.getProductUnitId());// 产品单位 + itemMap.put("productUnitName", orderItem.getProductUnitName());// 产品单位名称 + itemMap.put("count", orderItem.getCount());// 数量 + itemMap.put("rcount", orderItem.getRcount());// 退菜数量 + itemMap.put("price", orderItem.getPrice());// 销售价格 + itemMap.put("priceOrg", orderItem.getPriceOrg());// 产品原价 + itemMap.put("discountPrice", orderItem.getDiscountPrice());// 折后价格 + itemMap.put("boxNum", orderItem.getBoxNum());// 餐盒数量 + itemMap.put("boxPrice", orderItem.getBoxPrice());// 餐盒费 + + // itemMap.put("saleDate", + // DateUtils.format(orderItem.getSaleDate(), + // DateUtils.SHOW_DATETIME_FORMAT));// 销售时间 + itemMap.put("amount", orderItem.getAmount());// 消费金额 + itemMap.put("discount", orderItem.getDiscount());// 优惠率 + itemMap.put("discountTotal", orderItem.getDiscountTotal());// 优惠金额 + itemMap.put("receivable", orderItem.getReceivable());// 应收金额 + itemMap.put("addPriceTotal", orderItem.getAddPriceTotal());// 加价金额 + itemMap.put("discountAddTotal", orderItem.getDiscountAddTotal());// 加价优惠金额 + itemMap.put("amountAddTotal", orderItem.getAmountAddTotal());// 加价应收金额 + itemMap.put("amountTotal", orderItem.getAmountTotal());// 消费总额 + itemMap.put("receivableTotal", orderItem.getReceivableTotal());// 应收总额 + itemMap.put("isMember", orderItem.getIsMember());// 是否使用会员卡 + itemMap.put("isSuit", orderItem.getIsSuit());// 是否套菜 + itemMap.put("suitId", orderItem.getSuitId());// 套菜ID + itemMap.put("parentId", orderItem.getParentId());// 父记录ID + + itemMap.put("groupName", orderItem.getGroupName()); + itemMap.put("picture", orderItem.getPicture()); + itemMap.put("dfsAccessDomain", fdfsClientProperties.getAccessDomain()); + + // 做法信息 + List> makeList = new ArrayList<>(); + List itemMakes = orderItemMakeMap.get(orderItem.getId()); + if (itemMakes != null) { + for (WxSalesOrderItemMake itemMake : itemMakes) { + Map makeMap = new HashMap<>(); + makeMap.put("orderItemId", itemMake.getOrderItemId());// 订单明细ID + makeMap.put("makeId", itemMake.getMakeId());// 做法ID + makeMap.put("makeName", itemMake.getMakeName());// 做法名称 + makeMap.put("addPrice", itemMake.getAddPrice());// 做法加价 + makeMap.put("discountPrice", itemMake.getDiscountPrice());// 做法折后加价 + makeMap.put("count", itemMake.getCount());// 做法数量 + makeMap.put("rcount", itemMake.getRcount());// 做法退数量 + makeMap.put("addTotal", itemMake.getAddTotal());// 加价总额 + makeMap.put("discountAddTotal", itemMake.getDiscountAddTotal());// 折后总额 + makeMap.put("discount", itemMake.getDiscount());// 折扣率 + makeMap.put("mngNu", itemMake.getQtyFlag());// 管理数量 + // makeMap.put("saleDate", + // DateUtils.format(itemMake.getSaleDate(), + // DateUtils.SHOW_DATETIME_FORMAT));//销售时间 + makeList.add(makeMap); + } + } + itemMap.put("makes", makeList);// 做法信息 + + // 优惠信息 + List> promoList = new ArrayList<>(); + List itemPromoes = orderItemPromoMap.get(orderItem.getId()); + if (itemPromoes != null) { + for (WxSalesOrderItemPromo itemPromo : itemPromoes) { + Map promoMap = new HashMap<>(); + promoMap.put("orderItemId", itemPromo.getOrderItemId());// 订单明细ID + promoMap.put("type", itemPromo.getType());// 优惠类型 + promoMap.put("info", itemPromo.getInfo());// 优惠说明 + promoMap.put("discountMoney", itemPromo.getDiscountMoney());// 优惠金额 + promoList.add(promoMap); + } + } + itemMap.put("promoList", promoList);// 优惠信息 + + salesOrderItemList.add(itemMap); + } + data.put("items", salesOrderItemList);// 订单明细列表 + + // 付款信息 + criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketId", ticketId));// 销售单ID + criteria.add(Restrictions.eq("storeId", wxStore.getId()));// 门店ID + List payList = paymentService.getList(tenantId, criteria); + List> pays = new ArrayList<>(); + for (WxSalesPayment payment : payList) { + Map payInfo = new HashMap<>(); + payInfo.put("id", payment.getId());// 唯一ID + payInfo.put("storeId", payment.getStoreId());// 门店ID + payInfo.put("ticketId", payment.getTicketId());// 销售单ID + payInfo.put("ticketNo", payment.getBusNo());// 销售单编号 + payInfo.put("memberId", payment.getMemberId());// 会员ID + payInfo.put("payNo", payment.getPayNo());// 付款单号 + payInfo.put("payType", payment.getPayType());// 付款类型 + payInfo.put("payMode", payment.getPayMode());// 付款方式 + payInfo.put("status", payment.getStatus());// 单据状态 + payInfo.put("paid", payment.getPaid());// 实收金额 + payInfo.put("rchange", payment.getRchange());// 找零金额 + payInfo.put("money", payment.getRchange());// 已收金额 + payInfo.put("voucherNo", payment.getVoucherNo());// 凭证号 + payInfo.put("payDate", payment.getPayDate() == null ? null : DateUtils.format(payment.getPayDate(), DateUtils.SHOW_DATETIME_FORMAT));// 付款时间 + payInfo.put("payAccount", payment.getPayAccount());// 付款账号 + payInfo.put("memo", payment.getMemo());// 备注 + pays.add(payInfo); + } + data.put("pays", pays);// 付款信息列表 + + response.setStatus(1); + response.setMessage("获取成功"); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "wxdc.store.pay.parameter", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "微信门店支付参数") + @Override + public Object storePayParameter(StorePayParameterRequest request) { + String info = "微信门店支付参数"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String wxStoreId = request.getStoreId(); + String payMode = request.getPayMode(); + + CommonListResponse response = null; + try { + response = new CommonListResponse(); + WxStore wxStore = wxStoreService.get(tenantId, wxStoreId); + if (wxStore == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + // 支付参数 + List source = this.wxPaymentParameterService.getPaymentParameterByStoreId(tenantId, wxStore.getId()); + List> list = new ArrayList<>(); + for (WxPaymentParameter paymentParameter : source) { + Map map = new HashMap<>(); + map.put("tenantId", paymentParameter.getTenantId()); + map.put("id", paymentParameter.getId()); + map.put("no", paymentParameter.getNo()); + map.put("name", paymentParameter.getName()); + map.put("sign", paymentParameter.getSign()); + Map pbodyMap = JSONUtil.parseObject(paymentParameter.getPbody(), new TypeReference>() { + }); + map.put("pbody", pbodyMap); + map.put("certText", paymentParameter.getCertText()); + + if (StringUtils.equals("05", payMode) && (StringUtils.equalsIgnoreCase("wxpay", paymentParameter.getSign()) || StringUtils.equalsIgnoreCase("subwxpay", paymentParameter.getSign()))) { + //微信; + list.add(map); + }else if(StringUtils.equals("06", payMode) && StringUtils.equalsIgnoreCase("fbzf", paymentParameter.getSign()) ) { + //付呗; + list.add(map); + }else if(StringUtils.equals("07", payMode) && StringUtils.equalsIgnoreCase("fuyou", paymentParameter.getSign())) { + //富友支付; + list.add(map); + }else if(StringUtils.equals("08", payMode) && StringUtils.equalsIgnoreCase("duolabao", paymentParameter.getSign())) { + //哆啦宝; + list.add(map); + }else if(StringUtils.equals("09", payMode) && StringUtils.equalsIgnoreCase("saobei", paymentParameter.getSign())) { + //哆啦宝; + list.add(map); + } + + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "wxdc.sales.order.cancel", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "销售订单取消") + @Override + public Object salesOrderCancel(SalesOrderCancelRequest request) { + String info = "销售订单取消"; + logger.debug(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + String memberId = request.getMemberId(); + String ticketId = request.getTicketId(); + String cancelReason = request.getCancelReason(); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + WxStore wxStore = wxStoreService.get(tenantId, storeId); + if (wxStore == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("id", ticketId)); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("memberId", memberId)); + List salesOrderList = salesOrderService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(salesOrderList)) { + response.setStatus(0); + response.setMessage("订单信息不存在"); + response.setErrCode(CommonErrorCode.error23.getCode()); + response.setErrMessage(CommonErrorCode.error23.getMessage()); + return response; + } + if (salesOrderList.size() != 1) { + response.setStatus(0); + response.setMessage("订单信息不唯一"); + response.setErrCode(CommonErrorCode.error24.getCode()); + response.setErrMessage(CommonErrorCode.error24.getMessage()); + return response; + } + + // 销售订单 + WxSalesOrder salesOrder = salesOrderList.get(0); + if (salesOrder.getStatus() != 1) { + // 0-等待付款;1-已支付;2-已退单;3-已取消;4-商家已确认;5-已完成; + String msg = "订单状态异常"; + switch (salesOrder.getStatus()) { + case 2: + msg = "订单已退单"; + break; + case 3: + msg = "订单已取消"; + break; + case 4: + msg = "商家已接单,取消失败";// 商家已接单,不允许用户取消(也可转入退款流程)。 + break; + case 5: + msg = "订单已完成"; + break; + default: + break; + } + + response.setStatus(0); + response.setMessage(msg); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(msg); + // response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + + String currentUser = Constant.CREATE_USER; + String ticketNo = salesOrder.getNo(); + salesOrderService.saveUserOrderCancel(tenantId, ticketId, ticketNo, cancelReason, currentUser); + salesOrder = salesOrderService.get(tenantId, ticketId); + + Map data = new HashMap<>(); + response.setStatus(1); + response.setMessage("获取成功"); + response.setData(data); + + // 用户取消,执行后续事件 + logger.debug(">>>>>>>用户取消,执行后续事件"); + Map eventData = new HashMap<>(); + eventData.put("appKey", appKey); + eventData.put("appId", appId); + eventData.put("tenantCode", tenantCode); + eventData.put("appCode", appCode); + eventData.put("tenantId", tenantId); + eventData.put("wid", salesOrder.getWid()); + eventData.put("wxStore", wxStore); + eventData.put("wxSalesOrder", salesOrder); + eventBus.notify(EventKeys.WXDC_ORDER_USER_CANCEL, Event.wrap(eventData)); + // 用户取消,退款处理 + // channel 1:微信点餐 2云店点餐 + if (StringUtils.isNotBlank(salesOrder.getChannel()) && StringUtils.equals("2", salesOrder.getChannel())) { + eventBus.notify(EventKeys.WXDC_ORDER_PAY_REFUND_LITEAPP, Event.wrap(eventData)); + } else { + eventBus.notify(EventKeys.WXDC_ORDER_PAY_REFUND, Event.wrap(eventData)); + } + + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "wxdc.store.order.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店销售订单(微信点餐订单)列表") + @Override + public Object storeOrderList(StoreOrderListRequest request) { + String info = "门店销售订单(微信点餐订单)列表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String erpStoreId = request.getErpStoreId(); + String startDate = request.getStartDate(); + String status = request.getStatus();// 状态 + String endDate = request.getEndDate(); + String orderField = request.getOrderField();// 排序字段 + String orderType = request.getOrderType();// ASC,DESC + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + if (StringUtils.isBlank(erpStoreId)) { + response.setStatus(0); + response.setMessage("参数erpStoreId不能为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + Criteria criteria = new Criteria(); + if (StringUtils.isNotBlank(erpStoreId)) { + criteria.add(Restrictions.eq("storeId", erpStoreId)); + } + criteria.add(Restrictions.eq("deleteFlag", 0)); + List wxStoreList = wxStoreService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(wxStoreList)) { + response.setStatus(0); + response.setMessage("门店信息不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + // 微信门店信息 + WxStore wxStore = wxStoreList.get(0); + String wxStoreId = wxStore.getId(); + // 关联门店信息 + // Store store = storeService.get(tenantId, wxStore.getStoreId()); + + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + + criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", wxStoreId)); + if (StringUtils.isNotBlank(startDate)) { + criteria.add(Restrictions.ge("saleDate", startDate)); + } + if (StringUtils.isNotBlank(endDate)) { + criteria.add(Restrictions.le("saleDate", endDate)); + } + if (StringUtils.isNotBlank(orderField) && StringUtils.isNotBlank(orderType)) { + criteria.add(Restrictions.order(orderField, orderType)); + } + if (StringUtils.isNotBlank(status)) { + criteria.add(Restrictions.eq("status", status)); + } else { + criteria.add(Restrictions.ge("status", 1)); + } + pager = salesOrderService.getPager(tenantId, criteria, pager); + List> list = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(pager.getList())) { + List salesOrderIdList = new ArrayList<>(); + for (Object obj : pager.getList()) { + WxSalesOrder salesOrder = (WxSalesOrder) obj; + salesOrderIdList.add(salesOrder.getId()); + } + + // 获取订单明细信息 + criteria = new Criteria(); + criteria.add(Restrictions.in("oi.ticketId", salesOrderIdList)); + criteria.add(Restrictions.order("oi.lineNo", "asc")); + List orderItemList = salesOrderItemService.getListExtend(tenantId, criteria); + Map> orderItemMap = new HashMap<>(); + for (WxSalesOrderItem orderItem : orderItemList) { + List itemList = orderItemMap.get(orderItem.getTicketId()); + if (itemList == null) { + itemList = new ArrayList<>(); + orderItemMap.put(orderItem.getTicketId(), itemList); + } + itemList.add(orderItem); + } + + // 获取订单明细做法信息 + criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", wxStoreId)); + criteria.add(Restrictions.in("ticketId", salesOrderIdList)); + List orderItemMakeList = salesOrderItemMakeService.getList(tenantId, criteria); + Map> orderItemMakeMap = new HashMap<>(); + for (WxSalesOrderItemMake orderItemMake : orderItemMakeList) { + List makeList = orderItemMakeMap.get(orderItemMake.getOrderItemId()); + if (makeList == null) { + makeList = new ArrayList<>(); + orderItemMakeMap.put(orderItemMake.getOrderItemId(), makeList); + } + makeList.add(orderItemMake); + } + + // 获取订单明细优惠信息 + criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", wxStoreId)); + criteria.add(Restrictions.in("ticketId", salesOrderIdList)); + List orderItemPromoList = salesOrderItemPromoService.getList(tenantId, criteria); + Map> orderItemPromoMap = new HashMap<>(); + for (WxSalesOrderItemPromo orderItemPromo : orderItemPromoList) { + List promoList = orderItemPromoMap.get(orderItemPromo.getOrderItemId()); + if (promoList == null) { + promoList = new ArrayList<>(); + orderItemPromoMap.put(orderItemPromo.getOrderItemId(), promoList); + } + promoList.add(orderItemPromo); + } + + // 付款信息 + criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", wxStoreId));// 门店ID + criteria.add(Restrictions.in("ticketId", salesOrderIdList)); + List orderPayList = paymentService.getList(tenantId, criteria); + Map> orderPayMap = new HashMap<>(); + for (WxSalesPayment orderPay : orderPayList) { + List payList = orderPayMap.get(orderPay.getTicketId()); + if (payList == null) { + payList = new ArrayList<>(); + orderPayMap.put(orderPay.getTicketId(), payList); + } + payList.add(orderPay); + } + + // 处理返回结果 + for (Object obj : pager.getList()) { + WxSalesOrder salesOrder = (WxSalesOrder) obj; + Map data = new HashMap<>(); + data.put("ticketId", salesOrder.getId());// 单据ID + data.put("ticketNo", salesOrder.getNo());// 单据编号 + data.put("memberId", salesOrder.getMemberId());// 会员ID + data.put("phone", salesOrder.getPhone());// 用户手机号 + data.put("storeId", wxStore.getId());// 门店ID + data.put("storeNo", wxStore.getNo());// 门店编号 + data.put("storeName", wxStore.getName());// 门店名称 + data.put("erpStoreId", wxStore.getStoreId());// 关联门店ID/ERP门店ID + data.put("takeNo", salesOrder.getTakeNo());// 取餐号 + data.put("status", salesOrder.getStatus());// 单据状态 + data.put("refundStatus", salesOrder.getRefundStatus());// 退单状态 + data.put("channel", salesOrder.getChannel());// 销售渠道 + data.put("saleDate", DateUtils.format(salesOrder.getSaleDate(), DateUtils.SHOW_DATETIME_FORMAT));// 销售时间 + data.put("tableNo", salesOrder.getTableNo());// 餐桌号 + data.put("tableName", salesOrder.getTableName());// 餐桌名称 + data.put("people", salesOrder.getPeople());// 人数 + data.put("busMode", salesOrder.getBusMode());// 营业模式 + data.put("amount", salesOrder.getAmount());// 消费金额 + data.put("discount", salesOrder.getDiscount());// 优惠率 + data.put("discountTotal", salesOrder.getDiscountTotal());// 优惠金额 + data.put("receivable", salesOrder.getReceivable());// 应收金额 + data.put("maling", salesOrder.getMaling());// 抹零金额 + data.put("paid", salesOrder.getMaling());// 实收金额 + data.put("noOrg", salesOrder.getNoOrg());// 原单号 + data.put("backCause", salesOrder.getBackCause());// 退单原因 + data.put("isMember", salesOrder.getIsMember());// 是否使用会员卡 + data.put("isInvalid", salesOrder.getIsInvalid());// 是否失效 + data.put("description", salesOrder.getDescription());// 备注说明 + data.put("receiveName", salesOrder.getReceiveName());// 收餐人 + data.put("receiveMobile", salesOrder.getReceiveMobile());// 收餐人电话 + data.put("receiveAddress", salesOrder.getReceiveAddress());// 收餐人地址 + data.put("distributionFee", salesOrder.getDistributionFee());// 配送费 + data.put("boxFee", salesOrder.getBoxFee());// 餐盒费 + data.put("payType", salesOrder.getPayType());// 付款类型(1-在线支付;) + data.put("payMode", salesOrder.getPayMode());// 付款方式(1-微信支付;) + data.put("payDate", salesOrder.getPayDate() == null ? null : DateUtils.format(salesOrder.getPayDate(), DateUtils.SHOW_DATETIME_FORMAT));// 付款时间 + data.put("cancelDate", salesOrder.getCancelDate() == null ? null : DateUtils.format(salesOrder.getCancelDate(), DateUtils.SHOW_DATETIME_FORMAT));// 取消时间 + data.put("cancelReason", salesOrder.getCancelReason());// 取消原因 + data.put("storeReason", salesOrder.getStoreReason());// 门店意见 + + // 订单明细 + List> salesOrderItem = new ArrayList<>(); + for (WxSalesOrderItem orderItem : orderItemMap.get(salesOrder.getId())) { + Map itemMap = new HashMap<>(); + itemMap.put("id", orderItem.getId());// ID + itemMap.put("lineNo", orderItem.getLineNo());// 行号 + itemMap.put("goodsId", orderItem.getGoodsId());// 商品ID + itemMap.put("goodsName", orderItem.getGoodsName());// 商品名称 + itemMap.put("specName", orderItem.getSpecName());// 规格名称 + itemMap.put("categoryId", orderItem.getCategoryId());// 分类ID + // itemMap.put("categoryPath", + // orderItem.getCategoryPath());// + // 分类路径 + itemMap.put("categoryName", orderItem.getCategoryName());// 分类名称 + itemMap.put("productId", orderItem.getProductId());// 产品ID + itemMap.put("productNo", orderItem.getProductNo());// 产品编号 + itemMap.put("specId", orderItem.getSpecId());// 规格ID + itemMap.put("productUnitId", orderItem.getProductUnitId());// 产品单位 + itemMap.put("productUnitName", orderItem.getProductUnitName());// 产品单位名称 + itemMap.put("count", orderItem.getCount());// 数量 + itemMap.put("rcount", orderItem.getRcount());// 退菜数量 + itemMap.put("price", orderItem.getPrice());// 销售价格 + itemMap.put("priceOrg", orderItem.getPriceOrg());// 产品原价 + itemMap.put("discountPrice", orderItem.getDiscountPrice());// 折后价格 + // itemMap.put("saleDate", + // DateUtils.format(orderItem.getSaleDate(), + // DateUtils.SHOW_DATETIME_FORMAT));// 销售时间 + itemMap.put("amount", orderItem.getAmount());// 消费金额 + itemMap.put("discount", orderItem.getDiscount());// 优惠率 + itemMap.put("discountTotal", orderItem.getDiscountTotal());// 优惠金额 + itemMap.put("receivable", orderItem.getReceivable());// 应收金额 + itemMap.put("addPriceTotal", orderItem.getAddPriceTotal());// 加价金额 + itemMap.put("discountAddTotal", orderItem.getDiscountAddTotal());// 加价优惠金额 + itemMap.put("amountAddTotal", orderItem.getAmountAddTotal());// 加价应收金额 + itemMap.put("amountTotal", orderItem.getAmountTotal());// 消费总额 + itemMap.put("receivableTotal", orderItem.getReceivableTotal());// 应收总额 + itemMap.put("isMember", orderItem.getIsMember());// 是否使用会员卡 + itemMap.put("isSuit", orderItem.getIsSuit());// 是否套菜 + itemMap.put("suitId", orderItem.getSuitId());// 套菜ID + itemMap.put("parentId", orderItem.getParentId());// 父记录ID + + itemMap.put("groupName", orderItem.getGroupName()); + itemMap.put("picture", orderItem.getPicture()); + itemMap.put("dfsAccessDomain", fdfsClientProperties.getAccessDomain()); + itemMap.put("boxNum", orderItem.getBoxNum()); + itemMap.put("boxPrice", orderItem.getBoxPrice()); + + // 做法信息 + List> makeList = new ArrayList<>(); + List itemMakes = orderItemMakeMap.get(orderItem.getId()); + if (itemMakes != null) { + for (WxSalesOrderItemMake itemMake : itemMakes) { + Map makeMap = new HashMap<>(); + makeMap.put("orderItemId", itemMake.getOrderItemId());// 订单明细ID + makeMap.put("makeId", itemMake.getMakeId());// 做法ID + makeMap.put("makeName", itemMake.getMakeName());// 做法名称 + makeMap.put("addPrice", itemMake.getAddPrice());// 做法加价 + makeMap.put("discountPrice", itemMake.getDiscountPrice());// 做法折后加价 + makeMap.put("count", itemMake.getCount());// 做法数量 + makeMap.put("rcount", itemMake.getRcount());// 做法退数量 + makeMap.put("addTotal", itemMake.getAddTotal());// 加价总额 + makeMap.put("discountAddTotal", itemMake.getDiscountAddTotal());// 折后总额 + makeMap.put("discount", itemMake.getDiscount());// 折扣率 + makeMap.put("mngNu", itemMake.getQtyFlag());// 管理数量 + makeList.add(makeMap); + } + } + itemMap.put("makes", makeList);// 做法信息 + + // 优惠信息 + List> promoList = new ArrayList<>(); + List itemPromoes = orderItemPromoMap.get(orderItem.getId()); + if (itemPromoes != null) { + for (WxSalesOrderItemPromo itemPromo : itemPromoes) { + Map promoMap = new HashMap<>(); + promoMap.put("orderItemId", itemPromo.getOrderItemId());// 订单明细ID + promoMap.put("type", itemPromo.getType());// 优惠类型 + promoMap.put("info", itemPromo.getInfo());// 优惠说明 + promoMap.put("discountMoney", itemPromo.getDiscountMoney());// 优惠金额 + promoList.add(promoMap); + } + } + itemMap.put("promoList", promoList);// 优惠信息 + + salesOrderItem.add(itemMap); + } + data.put("items", salesOrderItem);// 订单明细列表 + + // 付款信息 + List> pays = new ArrayList<>(); + List payList = orderPayMap.get(salesOrder.getId()); + if (payList != null) { + for (WxSalesPayment payment : payList) { + Map payInfo = new HashMap<>(); + payInfo.put("id", payment.getId());// 唯一ID + payInfo.put("storeId", payment.getStoreId());// 门店ID + payInfo.put("ticketId", payment.getTicketId());// 销售单ID + payInfo.put("ticketNo", payment.getBusNo());// 销售单编号 + payInfo.put("memberId", payment.getMemberId());// 会员ID + payInfo.put("payNo", payment.getPayNo());// 付款单号 + payInfo.put("payType", payment.getPayType());// 付款类型 + payInfo.put("payMode", payment.getPayMode());// 付款方式 + payInfo.put("status", payment.getStatus());// 单据状态 + payInfo.put("paid", payment.getPaid());// 实收金额 + payInfo.put("rchange", payment.getRchange());// 找零金额 + payInfo.put("money", payment.getRchange());// 已收金额 + payInfo.put("voucherNo", payment.getVoucherNo());// 凭证号 + payInfo.put("payDate", payment.getPayDate() == null ? null : DateUtils.format(payment.getPayDate(), DateUtils.SHOW_DATETIME_FORMAT));// 付款时间 + payInfo.put("payAccount", payment.getPayAccount());// 付款账号 + payInfo.put("memo", payment.getMemo());// 备注 + pays.add(payInfo); + } + } + data.put("pays", pays);// 付款信息列表 + + list.add(data); + } + } + + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "wxdc.store.order.confirm", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店确认订单") + @Override + public Object storeOrderConfirm(StoreOrderConfirmRequest request) { + String info = "门店确认订单(接单)"; + logger.debug(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String erpStoreId = request.getErpStoreId(); + String ticketId = request.getTicketId(); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Criteria criteria = new Criteria(); + if (StringUtils.isNotBlank(erpStoreId)) { + criteria.add(Restrictions.eq("storeId", erpStoreId)); + } + criteria.add(Restrictions.eq("deleteFlag", 0)); + List wxStoreList = wxStoreService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(wxStoreList)) { + response.setStatus(0); + response.setMessage("门店信息不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + // 微信门店信息 + WxStore wxStore = wxStoreList.get(0); + String wxStoreId = wxStore.getId(); + // 关联门店信息 + // Store store = storeService.get(tenantId, wxStore.getStoreId()); + + criteria = new Criteria(); + criteria.add(Restrictions.eq("id", ticketId)); + criteria.add(Restrictions.eq("storeId", wxStoreId)); + List salesOrderList = salesOrderService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(salesOrderList)) { + response.setStatus(0); + response.setMessage("订单信息不存在"); + response.setErrCode(CommonErrorCode.error23.getCode()); + response.setErrMessage(CommonErrorCode.error23.getMessage()); + return response; + } + if (salesOrderList.size() != 1) { + response.setStatus(0); + response.setMessage("订单信息不唯一"); + response.setErrCode(CommonErrorCode.error24.getCode()); + response.setErrMessage(CommonErrorCode.error24.getMessage()); + return response; + } + + // 销售订单 + WxSalesOrder salesOrder = salesOrderList.get(0); + if (salesOrder.getStatus() != 1) { + // 0-等待付款;1-已支付;2-已退单;3-已取消;4-商家已确认;5-已完成; + + String msg = "订单状态异常"; + switch (salesOrder.getStatus()) { + case 0: + msg = "订单尚未付款"; + break; + case 2: + msg = "订单已退单"; + break; + case 3: + msg = "订单已取消"; + break; + case 4: + msg = "订单已确认,请勿重复接单"; + break; + case 5: + msg = "订单已完成"; + break; + default: + break; + } + // 清除redis + Object weixinOrderIds = cacheService.get(tenantId, "weixin_" + erpStoreId); + if (weixinOrderIds != null) { + Map orderIds = (Map) cacheService.get(tenantId, "weixin_" + erpStoreId); + orderIds.remove(salesOrder.getId()); + cacheService.set(tenantId, "weixin_" + erpStoreId, orderIds, 3600); + } else { + Map orderIds = new HashMap<>(); + cacheService.set(tenantId, "weixin_" + erpStoreId, orderIds, 3600); + } + response.setStatus(0); + response.setMessage(msg); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(msg); + // response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + + String currentUser = Constant.CREATE_USER; + // String takeNo = "6" + StringUtils.leftPad("" + + // RandomUtil.randomInt(1, 1000), 3, "0"); + String takeNo = ""; + // 771118 特殊处理 取餐号默认三位 + if (StringUtils.equals("771118", tenantId)) { + takeNo = "6" + StringUtils.leftPad(salesOrder.getDaySeq(), 2, "0"); + } else { + takeNo = "6" + StringUtils.leftPad(salesOrder.getDaySeq(), 3, "0"); + } + String ticketNo = salesOrder.getNo(); + salesOrderService.saveStoreOrderConfirm(tenantId, ticketId, ticketNo, takeNo, currentUser); + salesOrder = salesOrderService.get(tenantId, ticketId); + + Map data = new HashMap<>(); + data.put("ticketId", salesOrder.getId()); + data.put("ticketNo", ticketNo); + data.put("takeNo", takeNo); + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + + // 商家接单成功,执行后续事件 + logger.debug(">>>>>>>门店确认订单(接单),执行后续事件"); + Map eventData = new HashMap<>(); + eventData.put("appKey", appKey); + eventData.put("appId", appId); + eventData.put("tenantCode", tenantCode); + eventData.put("appCode", appCode); + eventData.put("tenantId", tenantId); + eventData.put("wid", salesOrder.getWid()); + eventData.put("wxStore", wxStore); + eventData.put("wxSalesOrder", salesOrder); + eventBus.notify(EventKeys.WXDC_ORDER_STORE_CONFIRM, Event.wrap(eventData)); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "wxdc.store.order.cancel", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店取消订单") + @Override + public Object storeOrderCancel(StoreOrderCancelRequest request) { + String info = "门店取消订单(接单)"; + logger.debug(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String erpStoreId = request.getErpStoreId(); + String ticketId = request.getTicketId(); + String cancelReason = request.getCancelReason(); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Criteria criteria = new Criteria(); + if (StringUtils.isNotBlank(erpStoreId)) { + criteria.add(Restrictions.eq("storeId", erpStoreId)); + } + criteria.add(Restrictions.eq("deleteFlag", 0)); + List wxStoreList = wxStoreService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(wxStoreList)) { + response.setStatus(0); + response.setMessage("门店信息不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + // 微信门店信息 + WxStore wxStore = wxStoreList.get(0); + String wxStoreId = wxStore.getId(); + // 关联门店信息 + // Store store = storeService.get(tenantId, wxStore.getStoreId()); + + criteria = new Criteria(); + criteria.add(Restrictions.eq("id", ticketId)); + criteria.add(Restrictions.eq("storeId", wxStoreId)); + List salesOrderList = salesOrderService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(salesOrderList)) { + response.setStatus(0); + response.setMessage("订单信息不存在"); + response.setErrCode(CommonErrorCode.error23.getCode()); + response.setErrMessage(CommonErrorCode.error23.getMessage()); + return response; + } + if (salesOrderList.size() != 1) { + response.setStatus(0); + response.setMessage("订单信息不唯一"); + response.setErrCode(CommonErrorCode.error24.getCode()); + response.setErrMessage(CommonErrorCode.error24.getMessage()); + return response; + } + + // 销售订单 + WxSalesOrder salesOrder = salesOrderList.get(0); + if (salesOrder.getStatus() != 1) { + // 0-等待付款;1-已支付;2-已退单;3-已取消;4-商家已确认;5-已完成; + String msg = "订单状态异常"; + switch (salesOrder.getStatus()) { + case 2: + msg = "订单已退单"; + break; + case 3: + msg = "订单已取消"; + break; + default: + break; + } + + response.setStatus(0); + response.setMessage(msg); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(msg); + // response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + + String currentUser = Constant.CREATE_USER; + String ticketNo = salesOrder.getNo(); + salesOrderService.saveStoreOrderCancel(tenantId, ticketId, ticketNo, cancelReason, currentUser); + salesOrder = salesOrderService.get(tenantId, ticketId); + + Map data = new HashMap<>(); + + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + + // 商家拒单后,执行后续事件 + logger.debug(">>>>>>>门店确认订单(接单),执行后续事件"); + Map eventData = new HashMap<>(); + eventData.put("appKey", appKey); + eventData.put("appId", appId); + eventData.put("tenantCode", tenantCode); + eventData.put("appCode", appCode); + eventData.put("tenantId", tenantId); + eventData.put("wid", salesOrder.getWid()); + eventData.put("wxStore", wxStore); + eventData.put("wxSalesOrder", salesOrder); + eventBus.notify(EventKeys.WXDC_ORDER_STORE_CANCEL, Event.wrap(eventData)); + // 商家拒单,退款处理 + // channel 1:微信点餐 2云店点餐 + if (StringUtils.isNotBlank(salesOrder.getChannel()) && StringUtils.equals("2", salesOrder.getChannel())) { + eventBus.notify(EventKeys.WXDC_ORDER_PAY_REFUND_LITEAPP, Event.wrap(eventData)); + } else { + eventBus.notify(EventKeys.WXDC_ORDER_PAY_REFUND, Event.wrap(eventData)); + } + + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "wxdc.store.order.delivery", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店确认送达") + @Override + public Object storeOrderDelivery(StoreOrderDeliveryRequest request) { + String info = "门店确认送达"; + logger.debug(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String erpStoreId = request.getErpStoreId(); + String ticketId = request.getTicketId(); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Criteria criteria = new Criteria(); + if (StringUtils.isNotBlank(erpStoreId)) { + criteria.add(Restrictions.eq("storeId", erpStoreId)); + } + criteria.add(Restrictions.eq("deleteFlag", 0)); + List wxStoreList = wxStoreService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(wxStoreList)) { + response.setStatus(0); + response.setMessage("门店信息不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + // 微信门店信息 + WxStore wxStore = wxStoreList.get(0); + String wxStoreId = wxStore.getId(); + // 关联门店信息 + // Store store = storeService.get(tenantId, wxStore.getStoreId()); + + criteria = new Criteria(); + criteria.add(Restrictions.eq("id", ticketId)); + criteria.add(Restrictions.eq("storeId", wxStoreId)); + List salesOrderList = salesOrderService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(salesOrderList)) { + response.setStatus(0); + response.setMessage("订单信息不存在"); + response.setErrCode(CommonErrorCode.error23.getCode()); + response.setErrMessage(CommonErrorCode.error23.getMessage()); + return response; + } + if (salesOrderList.size() != 1) { + response.setStatus(0); + response.setMessage("订单信息不唯一"); + response.setErrCode(CommonErrorCode.error24.getCode()); + response.setErrMessage(CommonErrorCode.error24.getMessage()); + return response; + } + + // 销售订单 + WxSalesOrder salesOrder = salesOrderList.get(0); + + String currentUser = Constant.CREATE_USER; + String ticketNo = salesOrder.getNo(); + salesOrderService.saveStoreOrderDelivery(tenantId, ticketId, ticketNo, currentUser); + + Map data = new HashMap<>(); + + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "wxdc.store.open.status.update", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店营业状态修改") + @Override + public Object storeOpenStatusUpdate(StoreOpenStatusUpdateRequest request) { + String info = "门店营业状态修改"; + logger.debug(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String wxStoreId = request.getWxStoreId(); + String erpStoreId = request.getErpStoreId(); + Integer openStatus = request.getOpenStatus();// 0-休息;1-营业; + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + if (StringUtils.isBlank(wxStoreId) && StringUtils.isBlank(erpStoreId)) { + response.setStatus(0); + response.setMessage("参数wxStoreId和erpStoreId不能同时为空"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + Criteria criteria = new Criteria(); + if (StringUtils.isNotBlank(wxStoreId)) { + criteria.add(Restrictions.eq("id", wxStoreId)); + } + if (StringUtils.isNotBlank(erpStoreId)) { + criteria.add(Restrictions.eq("storeId", erpStoreId)); + } + criteria.add(Restrictions.eq("deleteFlag", 0)); + List wxStoreList = wxStoreService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(wxStoreList)) { + response.setStatus(0); + response.setMessage("门店信息不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + // 微信门店信息 + WxStore wxStore = wxStoreList.get(0); + // 关联门店信息 + // Store store = storeService.get(tenantId, wxStore.getStoreId()); + + // 更改门店营业状态 + WxStore updateWxStore = new WxStore(); + updateWxStore.setId(wxStore.getId()); + updateWxStore.setIsOpen(openStatus);// 是否营业(0-未营业;1-营业中;) + updateWxStore.setModifyUser(Constant.CREATE_USER); + updateWxStore.setModifyDate(new Date()); + wxStoreService.update(tenantId, updateWxStore); + + Map data = new HashMap<>(); + + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "wxdc.order.refund.user.apply", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "用户申请退款") + @Override + public Object userApplyRefund(UserApplyRefundRequest request) { + String info = "用户申请退款"; + logger.debug(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String wxStoreId = request.getWxStoreId(); + String memberId = request.getMemberId(); + String ticketId = request.getTicketId(); + String refundReason = request.getRefundReason(); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + WxStore wxStore = wxStoreService.get(tenantId, wxStoreId); + if (wxStore == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("id", ticketId)); + criteria.add(Restrictions.eq("storeId", wxStoreId)); + criteria.add(Restrictions.eq("memberId", memberId)); + List salesOrderList = salesOrderService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(salesOrderList)) { + response.setStatus(0); + response.setMessage("订单信息不存在"); + response.setErrCode(CommonErrorCode.error23.getCode()); + response.setErrMessage(CommonErrorCode.error23.getMessage()); + return response; + } + if (salesOrderList.size() != 1) { + response.setStatus(0); + response.setMessage("订单信息不唯一"); + response.setErrCode(CommonErrorCode.error24.getCode()); + response.setErrMessage(CommonErrorCode.error24.getMessage()); + return response; + } + + // 销售订单 + WxSalesOrder salesOrder = salesOrderList.get(0); + if (salesOrder.getRefundStatus() != 0) { + // refundStatus,退单状态(0-用户未申请退单;1-退单处理中;2-商家拒绝退单;3-已退单;) + String msg = "订单状态异常"; + switch (salesOrder.getRefundStatus()) { + case 1: + msg = "退单处理中"; + break; + case 2: + msg = "商家拒绝退单"; + break; + case 3: + msg = "已退单"; + break; + default: + break; + } + + response.setStatus(0); + response.setMessage(msg); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(msg); + // response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + + String currentUser = Constant.CREATE_USER; + String ticketNo = salesOrder.getNo(); + salesOrderService.saveRefundUserApply(tenantId, ticketId, ticketNo, refundReason, currentUser); + salesOrder = salesOrderService.get(tenantId, ticketId); + + Map data = new HashMap<>(); + response.setStatus(1); + response.setMessage("获取成功"); + response.setData(data); + + // 用户申请退款,执行后续事件 + logger.debug(">>>>>>>用户申请退款,执行后续事件"); + Map eventData = new HashMap<>(); + eventData.put("appKey", appKey); + eventData.put("appId", appId); + eventData.put("tenantCode", tenantCode); + eventData.put("appCode", appCode); + eventData.put("tenantId", tenantId); + eventData.put("wid", salesOrder.getWid()); + eventData.put("wxStore", wxStore); + eventData.put("wxSalesOrder", salesOrder); + eventBus.notify(EventKeys.WXDC_ORDER_REFUND_USER_APPLY, Event.wrap(eventData)); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "wxdc.order.refund.store.agree", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店同意退款") + @Override + public Object storeAgreeRefund(StoreAgreeRefundRequest request) { + String info = "门店同意退款"; + logger.debug(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String erpStoreId = request.getErpStoreId(); + String ticketId = request.getTicketId(); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Criteria criteria = new Criteria(); + if (StringUtils.isNotBlank(erpStoreId)) { + criteria.add(Restrictions.eq("storeId", erpStoreId)); + } + criteria.add(Restrictions.eq("deleteFlag", 0)); + List wxStoreList = wxStoreService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(wxStoreList)) { + response.setStatus(0); + response.setMessage("门店信息不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + // 微信门店信息 + WxStore wxStore = wxStoreList.get(0); + String wxStoreId = wxStore.getId(); + // 关联门店信息 + // Store store = storeService.get(tenantId, wxStore.getStoreId()); + + criteria = new Criteria(); + criteria.add(Restrictions.eq("id", ticketId)); + criteria.add(Restrictions.eq("storeId", wxStoreId)); + List salesOrderList = salesOrderService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(salesOrderList)) { + response.setStatus(0); + response.setMessage("订单信息不存在"); + response.setErrCode(CommonErrorCode.error23.getCode()); + response.setErrMessage(CommonErrorCode.error23.getMessage()); + return response; + } + if (salesOrderList.size() != 1) { + response.setStatus(0); + response.setMessage("订单信息不唯一"); + response.setErrCode(CommonErrorCode.error24.getCode()); + response.setErrMessage(CommonErrorCode.error24.getMessage()); + return response; + } + + // 销售订单 + WxSalesOrder salesOrder = salesOrderList.get(0); + if (salesOrder.getRefundStatus() == 3) { + // refundStatus,退单状态(0-用户未申请退单;1-退单处理中;2-商家拒绝退单;3-已退单;) + String msg = "已退单"; + + response.setStatus(0); + response.setMessage(msg); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(msg); + // response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + + String currentUser = Constant.CREATE_USER; + String ticketNo = salesOrder.getNo(); + salesOrderService.saveRefundStoreAgree(tenantId, ticketId, ticketNo, currentUser); + salesOrder = salesOrderService.get(tenantId, ticketId); + + Map data = new HashMap<>(); + response.setStatus(1); + response.setMessage("获取成功"); + response.setData(data); + + // 门店同意退款,执行后续事件 + logger.debug(">>>>>>>门店同意退款,执行后续事件"); + Map eventData = new HashMap<>(); + eventData.put("appKey", appKey); + eventData.put("appId", appId); + eventData.put("tenantCode", tenantCode); + eventData.put("appCode", appCode); + eventData.put("tenantId", tenantId); + eventData.put("wid", salesOrder.getWid()); + eventData.put("wxStore", wxStore); + eventData.put("wxSalesOrder", salesOrder); + eventBus.notify(EventKeys.WXDC_ORDER_REFUND_STORE_AGREE, Event.wrap(eventData)); + // 门店同意退款,退款处理 + // channel 1:微信点餐 2云店点餐 + if (StringUtils.isNotBlank(salesOrder.getChannel()) && StringUtils.equals("2", salesOrder.getChannel())) { + eventBus.notify(EventKeys.WXDC_ORDER_PAY_REFUND_LITEAPP, Event.wrap(eventData)); + } else { + eventBus.notify(EventKeys.WXDC_ORDER_PAY_REFUND, Event.wrap(eventData)); + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "wxdc.order.refund.store.refuse", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店拒绝退款") + @Override + public Object storeRefuseRefund(StoreRefuseRefundRequest request) { + String info = "门店拒绝退款"; + logger.debug(info); + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String erpStoreId = request.getErpStoreId(); + String ticketId = request.getTicketId(); + String refuseReason = request.getRefuseReason(); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Criteria criteria = new Criteria(); + if (StringUtils.isNotBlank(erpStoreId)) { + criteria.add(Restrictions.eq("storeId", erpStoreId)); + } + criteria.add(Restrictions.eq("deleteFlag", 0)); + List wxStoreList = wxStoreService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(wxStoreList)) { + response.setStatus(0); + response.setMessage("门店信息不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + // 微信门店信息 + WxStore wxStore = wxStoreList.get(0); + String wxStoreId = wxStore.getId(); + // 关联门店信息 + // Store store = storeService.get(tenantId, wxStore.getStoreId()); + + criteria = new Criteria(); + criteria.add(Restrictions.eq("id", ticketId)); + criteria.add(Restrictions.eq("storeId", wxStoreId)); + List salesOrderList = salesOrderService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(salesOrderList)) { + response.setStatus(0); + response.setMessage("订单信息不存在"); + response.setErrCode(CommonErrorCode.error23.getCode()); + response.setErrMessage(CommonErrorCode.error23.getMessage()); + return response; + } + if (salesOrderList.size() != 1) { + response.setStatus(0); + response.setMessage("订单信息不唯一"); + response.setErrCode(CommonErrorCode.error24.getCode()); + response.setErrMessage(CommonErrorCode.error24.getMessage()); + return response; + } + + // 销售订单 + WxSalesOrder salesOrder = salesOrderList.get(0); + if (salesOrder.getRefundStatus() != 1) { + // refundStatus,退单状态(0-用户未申请退单;1-退单处理中;2-商家拒绝退单;3-已退单;) + String msg = "订单状态异常"; + switch (salesOrder.getRefundStatus()) { + case 0: + msg = "用户未申请退单"; + break; + case 2: + msg = "商家已拒绝退单"; + break; + case 3: + msg = "已退单"; + break; + default: + break; + } + + response.setStatus(0); + response.setMessage(msg); + response.setErrCode(CommonErrorCode.error999.getCode()); + response.setErrMessage(msg); + // response.setErrMessage(CommonErrorCode.error999.getMessage()); + return response; + } + + String currentUser = Constant.CREATE_USER; + String ticketNo = salesOrder.getNo(); + salesOrderService.saveRefundStoreRefuse(tenantId, ticketId, ticketNo, refuseReason, currentUser); + salesOrder = salesOrderService.get(tenantId, ticketId); + + Map data = new HashMap<>(); + response.setStatus(1); + response.setMessage("获取成功"); + response.setData(data); + + // 门店拒绝退款,执行后续事件 + logger.debug(">>>>>>>门店拒绝退款,执行后续事件"); + Map eventData = new HashMap<>(); + eventData.put("appKey", appKey); + eventData.put("appId", appId); + eventData.put("tenantCode", tenantCode); + eventData.put("appCode", appCode); + eventData.put("tenantId", tenantId); + eventData.put("wid", salesOrder.getWid()); + eventData.put("wxStore", wxStore); + eventData.put("wxSalesOrder", salesOrder); + eventBus.notify(EventKeys.WXDC_ORDER_REFUND_STORE_REFUSE, Event.wrap(eventData)); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "wxdc.goods.info", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "商品详细信息(微信点餐)") + @Override + public Object goodsInfo(GoodsInfoRequest request) { + String info = "商品详细信息(微信点餐)"; + logger.debug(info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String wxStoreId = request.getWxStoreId();// 微信门店ID + String goodsId = request.getGoodsId(); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + WxStore store = wxStoreService.get(tenantId, wxStoreId); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + WxGoods wxGoods = wxGoodsService.get(tenantId, goodsId); + if (wxGoods == null) { + response.setStatus(0); + response.setMessage("商品ID不存在"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + Map data = new HashMap<>(); + data.put("goodsId", wxGoods.getId()); + data.put("productId", wxGoods.getProductId()); + data.put("productNo", wxGoods.getProductNo()); + data.put("specId", wxGoods.getSpecId()); + data.put("categoryId", wxGoods.getCategoryId()); + data.put("categoryPath", wxGoods.getCategoryPath()); + data.put("name", wxGoods.getName()); + data.put("specName", wxGoods.getSpecName()); + data.put("description", wxGoods.getDescription()); + data.put("orderNo", wxGoods.getOrderNo());// 显示序号 + data.put("isNew", wxGoods.getIsNew());// 是否新品 + data.put("price", wxGoods.getPrice());// 售价 + data.put("memberPrice", wxGoods.getMemberPrice());// 会员价 + data.put("boxPrice", wxGoods.getBoxPrice());// 餐盒费 + data.put("minCount", wxGoods.getMinCount());// 最小购买量 + data.put("limitCount", wxGoods.getLimitCount());// 限购数量 + data.put("suitFlag", wxGoods.getSuitFlag());// 是否套餐 + data.put("deleteFlag", wxGoods.getDeleteFlag());// 删除标识 + data.put("priceOrg", 0D); + data.put("memberPriceOrg", 0D); + + // 获取微信门店商品售价 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", store.getId())); + criteria.add(Restrictions.eq("goodsId", wxGoods.getId())); + List wxStoreGoodsList = this.wxStoreGoodsService.getList(tenantId, criteria); + if (CollectionUtils.isNotEmpty(wxStoreGoodsList)) { + WxStoreGoods wxStoreGoods = wxStoreGoodsList.get(0); + data.put("price", wxStoreGoods.getPrice());// 售价 + data.put("memberPrice", wxStoreGoods.getMemberPrice());// 会员价 + } + + // 获取POS端商品售价 + criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", store.getStoreId())); + criteria.add(Restrictions.eq("specId", wxGoods.getSpecId())); + List storeProductList = storeProductService.getList(tenantId, criteria); + if (CollectionUtils.isNotEmpty(storeProductList)) { + StoreProduct storeProduct = storeProductList.get(0); + data.put("priceOrg", storeProduct.getPrice()); + data.put("memberPriceOrg", storeProduct.getMemberPrice()); + } + + // 处理扩展信息,获取商品规格信息等。 + criteria = new Criteria(); + criteria.add(Restrictions.eq("wsg.storeId", wxStoreId)); + criteria.add(Restrictions.eq("wg.productId", wxGoods.getProductId())); + criteria.add(Restrictions.order("wsg.price", "asc")); + List> goodsList = this.wxStoreGoodsService.getListExtend(tenantId, criteria); + for (Map goods : goodsList) { + data.put("unitId", goods.get("unitId") == null ? "" : goods.get("unitId").toString()); + data.put("unitName", goods.get("unitName")); + // 商品图片 + data.put("groupName", goods.get("groupName")); + data.put("boxPrice", goods.get("boxPrice")); + data.put("picture", goods.get("picture")); + data.put("dfsAccessDomain", fdfsClientProperties.getAccessDomain()); + } + + List> suitList = new ArrayList<>(); + data.put("suitList", suitList); + if (wxGoods.getSuitFlag() == 1) {// 套餐 + // 道菜 + List productSuitList = productSuitService.findList(tenantId, "productId", wxGoods.getProductId()); + // 处理道菜信息 + List suitIdList = new ArrayList<>();// 道菜ID列表 + Map> suitMap = new HashMap<>(); + for (ProductSuit productSuit : productSuitList) { + Map suitInfo = new HashMap<>(); + suitInfo.put("id", productSuit.getId());// 道菜Id + suitInfo.put("no", productSuit.getNo());// 道菜编号 + suitInfo.put("name", productSuit.getName());// 道菜名称 + suitInfo.put("quantity", productSuit.getQuantity());// 数量 + suitInfo.put("detail", new ArrayList>()); + suitList.add(suitInfo); + suitMap.put(productSuit.getId(), suitInfo); + suitIdList.add(productSuit.getId()); + } + // 道菜明细 + criteria = new Criteria(); + criteria.add(Restrictions.in("psud.suitId", suitIdList)); + criteria.add(Restrictions.order("psud.defaultflag", "desc")); + criteria.add(Restrictions.order("p.no", "asc")); + criteria.add(Restrictions.order("ps.no", "asc")); + List suitDetailList = productSuitDetailService.getListExtend(tenantId, criteria); + logger.debug("suitDetailList.json:" + JSONUtil.toJSONString(suitDetailList)); + List suitDetailProductIdList = new ArrayList<>(); + List suitDetailSpecIdList = new ArrayList<>(); + for (ProductSuitDetail productSuitDetail : suitDetailList) { + Map suitInfo = suitMap.get(productSuitDetail.getSuitId()); + List> detailList = (List>) suitInfo.get("detail"); + Map detailInfo = new HashMap<>(); + detailInfo.put("id", productSuitDetail.getId()); + detailInfo.put("suitId", productSuitDetail.getSuitId());// 道菜ID + detailInfo.put("suitNo", productSuitDetail.getSuitNo());// 道菜编号 + detailInfo.put("suitName", productSuitDetail.getSuitName());// 道菜名称 + detailInfo.put("productId", productSuitDetail.getProductId());// 产品ID + detailInfo.put("specId", productSuitDetail.getSpecId());// 产品规格ID + detailInfo.put("quantity", productSuitDetail.getQuantity());// 数量 + detailInfo.put("addPrice", productSuitDetail.getAddPrice());// 加价 + detailInfo.put("defaultflag", productSuitDetail.getDefaultflag());// 是否默认 + + detailInfo.put("productNo", productSuitDetail.getProductNo());// 菜品编号 + detailInfo.put("productName", productSuitDetail.getProductName());// 菜品名称 + detailInfo.put("specName", productSuitDetail.getSpecName());// 规格名称 + detailInfo.put("unitId", productSuitDetail.getUnitId());// 单位ID + detailInfo.put("price", productSuitDetail.getPrice());// 售价 + detailInfo.put("memberPrice", productSuitDetail.getMemberPrice());// 会员价 + // 在此添加餐盒费用 + Double boxPrice = 0.0; + String productId = productSuitDetail.getProductId(); + // 根据道菜ID 查询微信点餐商品里关联商品的餐盒费 + criteria = new Criteria(); + criteria.add(Restrictions.eq("productId", productId)); + List wxgoodsList = this.wxGoodsService.getList(tenantId, criteria); + if (CollectionUtils.isNotEmpty(wxgoodsList)) { + WxGoods wg = wxgoodsList.get(0); + boxPrice = wg.getBoxPrice(); + } + detailInfo.put("boxPrice", boxPrice);// 餐盒费 + + detailList.add(detailInfo); + suitDetailProductIdList.add(detailInfo.get("productId").toString()); + suitDetailSpecIdList.add(detailInfo.get("specId").toString()); + } + + // 商品单位 + criteria = new Criteria(); + List productUnitList = productUnitService.getList(tenantId, criteria); + Map productUnitMap = new HashMap<>(); + for (ProductUnit productUnit : productUnitList) { + productUnitMap.put(productUnit.getId(), productUnit); + } + // 商品图片 + Map productMap = new HashMap<>(); + if (CollectionUtils.isNotEmpty(suitDetailProductIdList)) { + criteria = new Criteria(); + criteria.add(Restrictions.in("id", suitDetailProductIdList)); + List productList = productService.getList(tenantId, criteria); + for (Product product : productList) { + productMap.put(product.getId(), product); + } + } + + // 明细菜映射的微信商品信息 + criteria = new Criteria(); + criteria.add(Restrictions.eq("wsg.storeId", wxStoreId)); + criteria.add(Restrictions.in("wg.specId", suitDetailSpecIdList)); + List> tempGoodsList = this.wxStoreGoodsService.getListExtend(tenantId, criteria); + Map> suitDetailExtMap = new HashMap<>(); + for (Map tempGoods : tempGoodsList) { + suitDetailExtMap.put(tempGoods.get("specId").toString(), tempGoods); + } + + // 处理商品做法 + criteria = new Criteria(); + criteria.add(Restrictions.in("productId", suitDetailProductIdList)); + List> makeCountList = this.wxGoodsMakeService.getMakeCount(tenantId, criteria); + Map makeCountMap = new HashMap<>(); + for (Map makeCount : makeCountList) { + makeCountMap.put(makeCount.get("productId").toString(), Integer.valueOf(makeCount.get("makeCount").toString())); + } + + // 遍历道菜明细信息,处理商品单位和商品图片,以及明细菜映射的微信商品信息 + for (Map suitInfo : suitList) { + List> tempSuitDetailList = (List>) suitInfo.get("detail"); + for (Map suitDetail : tempSuitDetailList) { + suitDetail.put("unitName", productUnitMap.get(suitDetail.get("unitId").toString()) == null ? "" : productUnitMap.get(suitDetail.get("unitId").toString()).getName()); + Product product = productMap.get(suitDetail.get("productId").toString()); + suitDetail.put("groupName", product == null ? null : product.getGroupName()); + suitDetail.put("picture", product == null ? null : product.getPicture()); + suitDetail.put("dfsAccessDomain", fdfsClientProperties.getAccessDomain()); + Map suitDetailExt = suitDetailExtMap.get(suitDetail.get("specId").toString()); + suitDetail.put("goodsId", suitDetailExt == null ? null : suitDetailExt.get("goodsId")); + suitDetail.put("categoryId", suitDetailExt == null ? null : suitDetailExt.get("categoryId")); + suitDetail.put("categoryPath", suitDetailExt == null ? null : suitDetailExt.get("categoryPath")); + + Integer makeCount = makeCountMap.get(suitDetail.get("productId").toString()) == null ? 0 : makeCountMap.get(suitDetail.get("productId").toString()); + suitDetail.put("makeCount", makeCount); + + // 如果做法数量大于0 加载做法 + if (null != makeCount && makeCount > 0) { + criteria = new Criteria(); + criteria.add(Restrictions.eq("productId", suitDetail.get("productId").toString())); + List dataList = wxGoodsMakeService.getList(tenantId, criteria); + Map> makeTypeMap = new LinkedHashMap<>(); + for (WxGoodsMake makedData : dataList) { + Map map = makeTypeMap.get(makedData.getTypeId()); + if (map == null) { + map = new HashMap<>(); + makeTypeMap.put(makedData.getTypeId(), map); + + MakeType makeType = makeTypeService.get(tenantId, makedData.getTypeId()); + map.put("typeId", makeType.getId()); + map.put("typeNo", makeType.getNo()); + map.put("typeName", makeType.getName()); + map.put("type", makeType.getType());// 类型(0口味1做法) + map.put("isRadio", makeType.getIsRadio());// 是否单选(0否1是) + map.put("seqNo", makeType.getSeqNo());// 前台顺序 + } + + List> makeDetailList = (List>) map.get("detailList"); + if (makeDetailList == null) { + makeDetailList = new ArrayList<>(); + map.put("detailList", makeDetailList); + } + + MakeDetail makeDetail = makeDetailService.get(tenantId, makedData.getMakeId()); + Map makeDetailMap = new HashMap<>(); + makeDetailMap.put("id", makeDetail.getId()); + makeDetailMap.put("no", makeDetail.getNo()); + makeDetailMap.put("name", makeDetail.getDescription()); + makeDetailMap.put("mngNum", makeDetail.getQtyFlag());// 管理数量 + makeDetailMap.put("addPrice", makedData.getAddPrice());// 加价 + makeDetailMap.put("orderNo", makeDetail.getOrderNo());// 显示序号 + makeDetailList.add(makeDetailMap); + } + + List> makeList = new ArrayList<>(); + for (Map makeType : makeTypeMap.values()) { + makeList.add(makeType); + } + suitDetail.put("makeList", makeList); + } + } + } + + } + + response.setStatus(1); + response.setMessage("获取成功"); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "wxdc.goods.sellout", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店商品售罄") + @Override + public Object storeGoodsSellOut(GoodsSellOutRequest request) { + String info = "商品详细信息(微信点餐)"; + logger.debug(info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId();// 微信门店ID + String productIds = request.getProductIds();// 商品IDS + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + WxStore store = wxStoreService.get(tenantId, storeId); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + List ids = new ArrayList<>(); + if (productIds != null && !"".equals(productIds)) { + String[] product = productIds.split(","); + for (int i = 0; i < product.length; i++) { + ids.add(product[i]); + } + if (ids != null && ids.size() > 0) { + wxStoreGoodsService.updateStoreWxGoodsStatus(tenantId, storeId, ids, 1); + // 发布订阅消息 + sendMessage(tenantId, storeId, 1, productIds); + } + } else { + wxStoreGoodsService.updateStoreWxGoodsStatusByStoreId(tenantId, storeId, 1); + // 发布订阅消息 + sendMessage(tenantId, storeId, 1, productIds); + } + response.setStatus(1); + response.setMessage("更新成功"); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "wxdc.goods.sellin", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店商品开卖") + @Override + public Object storeGoodsSellIn(GoodsSellInRequest request) { + String info = "商品详细信息(微信点餐)"; + logger.debug(info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId();// 微信门店ID + String productIds = request.getProductIds();// 商品IDS + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + WxStore store = wxStoreService.get(tenantId, storeId); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + List ids = new ArrayList<>(); + if (productIds != null && !"".equals(productIds)) { + String[] product = productIds.split(","); + for (int i = 0; i < product.length; i++) { + ids.add(product[i]); + } + if (ids != null && ids.size() > 0) { + wxStoreGoodsService.updateStoreWxGoodsStatus(tenantId, storeId, ids, 0); + // 发布订阅消息 + sendMessage(tenantId, storeId, 2, productIds); + } + } else { + wxStoreGoodsService.updateStoreWxGoodsStatusByStoreId(tenantId, storeId, 0); + // 发布订阅消息 + sendMessage(tenantId, storeId, 2, productIds); + } + response.setStatus(1); + response.setMessage("更新成功"); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "wxdc.memberCard.set", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "微信点餐会员卡支付设置") + @Override + public Object memberCardSet(StoreListRequest request) { + String info = "微信点餐会员卡支付设置"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketSign", "wxdcMemberCardSet")); + criteria.add(Restrictions.eq("`key`", "wxdcMemberCardSet")); + List baseSettinglist = printSettingService.getList(tenantId, criteria); + + Map data = new HashMap<>(); + if(CollectionUtils.isEmpty(baseSettinglist)){ + data.put("memberCardSet", "0"); + }else{ + data.put("memberCardSet", baseSettinglist.get(0).getValue()); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + + @ServiceMethod(method = "wxdc.storeTakeOrder.set", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "获取租户微信点餐门店自助点餐设置") + @Override + public Object storeTakeOrderSet(StoreListRequest request) { + String info = "获取租户微信点餐门店自助点餐设置"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketSign", "wxdcMemberCardSet")); + criteria.add(Restrictions.eq("`key`", "wxdcStoreTakeOrderSet")); + List baseSettinglist = printSettingService.getList(tenantId, criteria); + + Map data = new HashMap<>(); + if(CollectionUtils.isEmpty(baseSettinglist)){ + data.put("storeTakeOrderSet", "1"); + }else{ + data.put("storeTakeOrderSet", baseSettinglist.get(0).getValue()); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + + public void sendMessage(String tenantId, String storeId, int type, String productIds) { + DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String info = "微信点餐订阅模型====>"; + try { + Map message = new HashMap<>(); + message.put("type", type); + message.put("storeId", storeId); + if (productIds == null || "".equals(productIds)) { + message.put("isAll", true); + } else { + message.put("isAll", false); + } + message.put("productIds", productIds); + message.put("date", fmt.format(new Date())); + mqttClient.Publish("wxdc/sell/" + tenantId + "/" + storeId, JSONUtil.toJSONString(message)); + logger.error(info + "wxdc/sell/" + tenantId + "/" + storeId, JSONUtil.toJSONString(message)); + } catch (Exception e) { + logger.error(info + "发布订阅模型时处理时,发生异常", e); + } + } + + @ServiceMethod(method = "wxdc.goods.category", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "商品分类列表") + @Override + public Object goodsCategory(GoodsCategoryRequest request) { + String info = "商品分类列表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String storeId = request.getStoreId(); + CommonListResponse response = null; + try { + response = new CommonListResponse(); + WxStore store = wxStoreService.get(tenantId, storeId); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + // 根据门店获取门店的商品ID + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.limit("0", "3000")); + List goodsList = wxStoreGoodsService.getList(tenantId, criteria); + if (goodsList == null || goodsList.size() <= 0) { + response.setStatus(0); + response.setMessage("门店商品分类不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + // 根据门店商品ID获取门店的分类ID + List goodsIds = new ArrayList<>(); + for (WxStoreGoods wxStoreGoods : goodsList) { + goodsIds.add(wxStoreGoods.getGoodsId()); + } + criteria = new Criteria(); + criteria.add(Restrictions.in("id", goodsIds)); + criteria.add(Restrictions.eq("deleteFlag", 0)); + criteria.add(Restrictions.limit("0", "3000")); + List wxGoodsList = wxGoodsService.getList(tenantId, criteria); + if (wxGoodsList == null || wxGoodsList.size() <= 0) { + response.setStatus(0); + response.setMessage("门店商品分类不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + List wxCategoryIds = new ArrayList<>(); + for (WxGoods wxGoods : wxGoodsList) { + wxCategoryIds.add(wxGoods.getCategoryId()); + } + criteria = new Criteria(); + criteria.add(Restrictions.eq("deleteFlag", 0)); + criteria.add(Restrictions.order("orderNo", "asc")); + criteria.add(Restrictions.in("id", wxCategoryIds)); + criteria.add(Restrictions.limit("0", "3000")); + List dataList = wxGoodsCategoryService.getList(tenantId, criteria); + List> list = new ArrayList<>(); + for (WxGoodsCategory data : dataList) { + Map map = new HashMap<>(); + map.put("id", data.getId()); + map.put("tenantId", data.getTenantId()); + map.put("name", data.getName()); + map.put("description", data.getDescription()); + map.put("orderNo", data.getOrderNo()); + map.put("path", data.getPath()); + list.add(map); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + @ServiceMethod(method = "wxdc.store.list.bywid", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "门店信息列表") + @Override + public Object storeListByWid(StoreListByWidRequest request) { + String info = "门店信息列表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + String wid = request.getWid(); + String keyword = request.getKeyword(); + CommonListResponse response = null; + try { + response = new CommonListResponse(); + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("deleteFlag", 0)); + criteria.add(Restrictions.eq("enabled", 1));// 是否启用 + criteria.add(Restrictions.eq("wid", wid)); + if (StringUtils.isNotBlank(keyword)) { + criteria.add(Restrictions.or(Restrictions.like("name", "%" + keyword + "%"), Restrictions.like("address", "%" + keyword + "%"))); + } + criteria.add(Restrictions.notEq("no", "000000")); + criteria.add(Restrictions.order("no", "asc")); + + List wxStoreList = wxStoreService.getList(tenantId, criteria); + List> list = new ArrayList<>(); + if (CollectionUtils.isEmpty(wxStoreList)) { + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + return response; + } + + List storeIdList = new ArrayList<>(); + for (WxStore wxStore : wxStoreList) { + storeIdList.add(wxStore.getStoreId()); + } + criteria = new Criteria(); + criteria.add(Restrictions.in("id", storeIdList)); + List erpStoreList = storeService.getList(tenantId, criteria); + Map erpStoreMap = new HashMap<>(); + for (Store store : erpStoreList) { + erpStoreMap.put(store.getId(), store); + } + + // 组织返回结果 + for (WxStore wxStore : wxStoreList) { + Map map = new HashMap<>(); + map.put("id", wxStore.getId()); + map.put("tenantId", wxStore.getTenantId()); + map.put("no", wxStore.getNo());// 门店编号 + map.put("name", wxStore.getName());// 门店名称 + map.put("orderTel", wxStore.getOrderTel());// 订餐电话 + map.put("address", wxStore.getAddress());// 地址 + map.put("storeId", wxStore.getStoreId());// 关联门店ID/ERP门店ID + map.put("latitude", wxStore.getLatitude());// 纬度 + map.put("longitude", wxStore.getLongitude());// 经度 + map.put("noticeInfo", wxStore.getNoticeInfo());// 公告信息 + map.put("isOpen", wxStore.getIsOpen());// 是否营业 + map.put("openTimeType", wxStore.getOpenTimeType());// 营业时间类型 + map.put("openTime", wxStore.getOpenTime());// 营业时间 + map.put("deliverFee", wxStore.getDeliverFee());// 配送费 + map.put("deliverFeeDiscountType", wxStore.getDeliverFeeDiscountType());// 配送费减免类型 + map.put("deliverFeeDiscountRule", wxStore.getDeliverFeeDiscountRule());// 配送费减免规则 + map.put("posNo", wxStore.getPosNo());// POS编号 + // 门店图片 + map.put("dfsAccessDomain", fdfsClientProperties.getAccessDomain()); + map.put("width", 0);// 图片宽度 + map.put("height", 0);// 图片高度 + map.put("groupName", null);// 存储组名 + map.put("storageFileName", null);// 存储文件名 + if (erpStoreMap.get(wxStore.getStoreId()) != null) { + map.put("width", erpStoreMap.get(wxStore.getStoreId()).getWidth());// 图片宽度 + map.put("height", erpStoreMap.get(wxStore.getStoreId()).getHeight());// 图片高度 + map.put("groupName", erpStoreMap.get(wxStore.getStoreId()).getGroupName());// 存储组名 + map.put("storageFileName", erpStoreMap.get(wxStore.getStoreId()).getStorageFileName());// 存储文件名 + } + list.add(map); + } + + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/wxdc/impl/WxdcZCServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/wxdc/impl/WxdcZCServiceImpl.java new file mode 100644 index 0000000..f9653fd --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/wxdc/impl/WxdcZCServiceImpl.java @@ -0,0 +1,588 @@ +package com.jwsaas.api.service.wxdc.impl; + +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; + +import com.alibaba.fastjson.JSON; +import com.jwsaas.api.request.wxdc.GoodsInfoZCRequest; +import com.jwsaas.api.request.wxdc.GoodsListRequest; +import com.jwsaas.api.request.wxdc.ZCGoodsCategoryListRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.response.mode.CommonPagerResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.wxdc.WxdcZCService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.MakeDetail; +import com.jwsaas.entity.food.MakeType; +import com.jwsaas.entity.food.Product; +import com.jwsaas.entity.food.ProductSpec; +import com.jwsaas.entity.food.ProductSuit; +import com.jwsaas.entity.food.ProductSuitDetail; +import com.jwsaas.entity.food.ProductType; +import com.jwsaas.entity.food.ProductUnit; +import com.jwsaas.entity.food.Store; +import com.jwsaas.entity.food.StoreProduct; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.pager.Pager; +import com.jwsaas.properties.FdfsClientProperties; +import com.jwsaas.util.DateUtils; +import com.jwsaas.utils.AppKeyUtil; + + + +/** + * 微信点餐-中餐 + * @author louxutao + * + */ +@ServiceMethodBean(version = "1.0") +public class WxdcZCServiceImpl extends WopServiceImpl implements WxdcZCService { + + private static final long serialVersionUID = -3615170735139597226L; + + @Autowired + private FdfsClientProperties fdfsClientProperties; + @Resource + private com.jwsaas.service.food.StoreService storeService; + @Resource + private com.jwsaas.service.food.ProductTypeService productTypeService; + @Resource + private com.jwsaas.service.food.ProductSpecService productSpecService; + @Resource + private com.jwsaas.service.food.ProductUnitService productUnitService; + @Resource + private com.jwsaas.service.food.MakeTypeService makeTypeService; + @Resource + private com.jwsaas.service.food.MakeDetailService makeDetailService; + @Resource + private com.jwsaas.service.food.StoreProductService storeProductService; + @Resource + private com.jwsaas.service.food.ProductSuitService productSuitService; + @Resource + private com.jwsaas.service.food.ProductSuitDetailService productSuitDetailService; + @Resource + private com.jwsaas.service.food.ProductService productService; + + + /*** + * 获取门店已上架商品品类 + */ + @ServiceMethod(method = "wxdcZC.goods.category.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "获取门店已上架商品品类") + @Override + public Object goodsCategoryList(ZCGoodsCategoryListRequest request) { + String info = "获取门店已上架商品品类"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("sp.storeId", request.getStoreId())); + criteria.add(Restrictions.lt("p.type", 10));// 非原料,辅料 + + criteria.add(Restrictions.eq("p.stopFlag", 0));// 未停用 + criteria.add(Restrictions.eq("p.deleteFlag", "0"));// 未删除 + criteria.add(Restrictions.isNotNull("t.id"));// 过滤空数据 + criteria.add(Restrictions.group("t.id")); + criteria.add(Restrictions.order("t.no", "asc")); + System.out.println("sql:"+criteria.toSQL()); + List> list = productService.getProductType(tenantId, criteria); + + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", + request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 中餐商品信息列表 + */ + @SuppressWarnings("unchecked") + @ServiceMethod(method = "wxdcZC.goods.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "中餐商品信息列表") + @Override + public Object goodsList(GoodsListRequest request) { + String info = "中餐商品信息列表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + String categoryId = request.getCategoryId(); + String property = request.getProperty(); + String keyword = request.getKeyword(); + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); + Store store = storeService.get(tenantId, storeId); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + // 查询商品 + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("sp.storeId", storeId)); + if(StringUtils.isNotBlank(keyword)){ + criteria.add(Restrictions.like("a.name", "%"+keyword+"%")); + } + if (StringUtils.isNotBlank(categoryId)) { + ProductType productType = productTypeService.get(tenantId, categoryId); + if (productType != null) { + criteria.add(Restrictions.like("a.typePath", productType.getPath() + "%")); + } + } + criteria.add(Restrictions.lt("a.type", 10)); + criteria.add(Restrictions.eq("a.stopFlag", 0)); + criteria.add(Restrictions.eq("a.deleteFlag", 0)); + criteria.add(Restrictions.group("sp.productId")); + criteria.add(Restrictions.order("a.no", "ASC")); + pager = productService.getPagerExtends(tenantId, criteria, pager); + // 组装商品数据 + List productIdList = new ArrayList(); + Map dataMap = new HashMap<>(); + List> list = new ArrayList<>(); + if (pager.getList() != null && pager.getList().size() > 0) { + List source = (List) pager.getList(); + for (Product product : source) { + Map map = new HashMap<>(); + map.put("tenantId", product.getTenantId()); + map.put("productId", product.getId()); + map.put("brandId", product.getBrandId()); + map.put("categoryId", product.getTypeId()); + map.put("categoryPath", product.getTypePath()); + map.put("productNo", product.getNo()); + map.put("name", product.getName()); + map.put("description", product.getDescription()); + if(product.getGroupName() != null && "".equals(product.getGroupName()) && StringUtils.isNotBlank(product.getPicture())){ + map.put("groupName", tenantId); + map.put("picture", product.getPicture().substring(product.getPicture().indexOf("image"))); + map.put("dfsAccessDomain", "http://pos.juweiyun.cn"); + }else{ + map.put("groupName", product.getGroupName()); + map.put("picture", product.getPicture()); + map.put("dfsAccessDomain", fdfsClientProperties.getAccessDomain()); + } + + map.put("shortName", product.getShortName()); + map.put("english", product.getEnglish()); + map.put("unitId", product.getUnitId()); + map.put("unitName", ""); + map.put("discountFlag", product.getDiscountFlag());// 是否可折扣 0否 1是 + map.put("tapleFlag", product.getTapleFlag());// 是否主食0否 1是 + map.put("currentFlag", product.getCurrentFlag());// 是否可议价 + map.put("suitFlag", product.getSuitFlag());// 是否套菜 0否 1是 + map.put("mebDiscountFlag", product.getMebDiscountFlag());// 会员折上折0不允许-1允许 + map.put("giveFlag", product.getGiveFlag());// 允许赠送(0不允许-1允许) + map.put("promotionFlag", product.getPromotionFlag());// 允许促销(0不允许-1允许) + map.put("type", product.getType());// 商品类型(0普通商品1成品10原料11辅料12半成品 10以下下商品是可销售商品 ,10以上商品是不可销售商品(包括10)) + map.put("stopFlag", product.getStopFlag());// 停用(0否-1是) + map.put("price", product.getPrice());// 零售价 + map.put("memberPrice", doubleFormat(product.getMemberPrice()));// 会员价 + map.put("minPrice", doubleFormat(product.getMinPrice()));//最低售价 + map.put("specCount", product.getSpecCount());// 规格数量(门店对应的数量) + map.put("specList", new ArrayList<>());// 规格 + map.put("makeCount", 0);// 做法 + map.put("makeList", new ArrayList<>()); + list.add(map); + dataMap.put(product.getId(), map); + productIdList.add(product.getId()); + } + } + if(productIdList.size() > 0){ + // 获取商品规格 + criteria = new Criteria(); + criteria.add(Restrictions.in("ps.productId", productIdList)); + criteria.add(Restrictions.eq("sp.storeId", storeId)); + List productSpecList = productSpecService.getListWithProductByStoreId(tenantId, criteria); + for (ProductSpec spec : productSpecList) { + Map productMap = (Map)dataMap.get(spec.getProductId()); +// productMap.put("price", doubleFormat(spec.getPrice()));// 零售价 +// productMap.put("memberPrice", doubleFormat(spec.getMemberPrice()));// 会员价 +// productMap.put("minPrice", doubleFormat(spec.getMinPrice()));//最低售价 +// productMap.put("goodsId", spec.getId());//最低售价 + + List> specList = (List>) productMap.get("specList"); + if (specList == null) { + specList = new ArrayList<>(); + productMap.put("specList", specList); + } + Map specMap = new HashMap<>(); + specMap.put("goodsId", spec.getId()); + specMap.put("productId", spec.getProductId()); + specMap.put("productNo", spec.getProductNo()); + specMap.put("specId", spec.getId()); + specMap.put("specName", spec.getName()); + specMap.put("unitId", spec.getUnitId()); + specMap.put("unitName", ""); + specMap.put("price", spec.getPrice()); + specMap.put("memberPrice", spec.getMemberPrice()); + specList.add(specMap); + + if (specList.size() == 1) { + productMap.put("goodsId", spec.getId()); + productMap.put("specId", spec.getId()); + productMap.put("specName", spec.getName()); + productMap.put("unitId", spec.getUnitId()); + productMap.put("unitName", ""); + productMap.put("price", spec.getPrice()); + productMap.put("memberPrice", spec.getMemberPrice()); + } + + productMap.put("specCount",specList.size()); + productMap.put("specList", specList); + } + } + // 商品做法类型 + criteria = new Criteria(); + criteria.add(Restrictions.eq("deleteFlag", 0)); + criteria.add(Restrictions.order("seqNo", "ASC")); + List makeTypeList = makeTypeService.getList(tenantId, criteria); + // 商品公有做法 + criteria = new Criteria(); + criteria.add(Restrictions.eq("md.deleteFlag", 0)); + List makes = makeDetailService.getListByStoreId(tenantId, request.getStoreId(), criteria); + // 商品添加做法 + for(String productId:productIdList){ + Map> typeInfoMap = new LinkedHashMap<>(); + List> makeInfoList = new ArrayList>(); + //封装zuofa + for(MakeType type :makeTypeList){ + type.setColor(""); + Map map = JSON.parseObject(JSON.toJSONString(type),Map.class); + map.put("groupName", type.getName()); + map.put("detailList", new ArrayList<>()); + makeInfoList.add(map); + typeInfoMap.put(type.getId(), map); + } + //封装私有做法 + if(CollectionUtils.isNotEmpty(makes)){ + for(MakeDetail detail :makes){ + detail.setColor(""); + Map makeMap = JSON.parseObject(JSON.toJSONString(detail),Map.class); + + Map typeMap = typeInfoMap.get(detail.getTypeId()); + List> makeDetails = (List>)typeMap.get("detailList"); + makeMap.put("name", detail.getDescription()); + makeMap.put("isRadio", typeMap.get("isRadio").toString()); + makeMap.put("type", typeMap.get("type").toString()); + makeDetails.add(makeMap); + } + } + List> productMakeList = new ArrayList<>(); + productMakeList.addAll(makeInfoList); + // 查询商品私有做法 + List proMakes = makeDetailService.getListByProductId(tenantId, productId, criteria); + if(proMakes.size() > 0){ + for(MakeDetail detail :proMakes){ + detail.setColor(""); + Map makeMap = JSON.parseObject(JSON.toJSONString(detail),Map.class); + + Map typeMap = typeInfoMap.get(detail.getTypeId()); + List> makeDetails = (List>)typeMap.get("detailList"); + makeMap.put("name", detail.getDescription()); + makeMap.put("isRadio", typeMap.get("isRadio").toString()); + makeMap.put("type", typeMap.get("type").toString()); + makeDetails.add(makeMap); + } + } + List> newMakeList = new ArrayList>(); + Map productMap = (Map)dataMap.get(productId); + for(Map map:productMakeList){ + if(null != map.get("detailList")){ + List> detailList = (List>)map.get("detailList"); + if(detailList.size() > 0){ + newMakeList.add(map); + } + } + } + productMap.put("makeList",newMakeList); + productMap.put("makeCount",newMakeList.size()); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + System.out.println(">>>>>>7 "+DateUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss SS")); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /** + * 商品详情 + */ + @ServiceMethod(method = "wxdcZC.goods.info", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "商品详情") + @Override + public Object goodsInfo(GoodsInfoZCRequest request) { + String info = "商品详细信息(微信点餐)"; + logger.debug(info); + String appKey = request.getWopRequestContext().getAppKey(); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId();// 微信门店ID + String goodsId = request.getGoodsId(); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Store store = storeService.get(tenantId, storeId); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + // 获取商品 + Product product = productService.get(tenantId, goodsId); + if (product == null) { + response.setStatus(0); + response.setMessage("商品不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + Map data = new HashMap<>(); + data.put("productId", product.getId()); + data.put("productNo", product.getNo()); + data.put("name", product.getName()); + data.put("description", product.getDescription()); + data.put("goodsId", ""); + data.put("categoryId", product.getTypeId()); + data.put("categoryPath", product.getTypePath()); + data.put("specId", ""); + data.put("price", product.getPrice());// 售价 + data.put("memberPrice", product.getMemberPrice());// 会员价 + data.put("suitFlag", product.getSuitFlag());// 是否套餐 + data.put("deleteFlag", product.getDeleteFlag());// 删除标识 + data.put("unitId", product.getUnitId()); + data.put("unitName", ""); + data.put("groupName", product.getGroupName()); + data.put("picture", product.getPicture()); + data.put("dfsAccessDomain", fdfsClientProperties.getAccessDomain()); + + // 获取POS端商品售价 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", store.getId())); + criteria.add(Restrictions.eq("productId", product.getId())); + List storeProductList = storeProductService.getList(tenantId, criteria); + if (CollectionUtils.isNotEmpty(storeProductList)) { + StoreProduct storeProduct = storeProductList.get(0); + data.put("price", storeProduct.getPrice());// 售价 + data.put("memberPrice", storeProduct.getMemberPrice());// 会员价 + } + + List> suitList = new ArrayList<>(); + data.put("suitList", suitList); + if (product.getSuitFlag() == 1) {// 套餐 + // 道菜 + List productSuitList = productSuitService.findList(tenantId, "productId", product.getId()); + // 处理道菜信息 + List suitIdList = new ArrayList<>();// 道菜ID列表 + Map> suitMap = new HashMap<>(); + for (ProductSuit productSuit : productSuitList) { + Map suitInfo = new HashMap<>(); + suitInfo.put("id", productSuit.getId());// 道菜Id + suitInfo.put("no", productSuit.getNo());// 道菜编号 + suitInfo.put("name", productSuit.getName());// 道菜名称 + suitInfo.put("quantity", productSuit.getQuantity());// 数量 + suitInfo.put("detail", new ArrayList>()); + suitList.add(suitInfo); + suitMap.put(productSuit.getId(), suitInfo); + suitIdList.add(productSuit.getId()); + } + // 道菜明细 + criteria = new Criteria(); + criteria.add(Restrictions.in("psud.suitId", suitIdList)); + criteria.add(Restrictions.eq("sp.storeId", storeId)); + criteria.add(Restrictions.order("psud.defaultflag", "desc")); + criteria.add(Restrictions.order("p.no", "asc")); + criteria.add(Restrictions.order("ps.no", "asc")); + List suitDetailList = productSuitDetailService.getListExtendByStoreId(tenantId, criteria); + List suitDetailProductIdList = new ArrayList<>(); + List suitDetailSpecIdList = new ArrayList<>(); + for (ProductSuitDetail productSuitDetail : suitDetailList) { + Map suitInfo = suitMap.get(productSuitDetail.getSuitId()); + List> detailList = (List>) suitInfo.get("detail"); + Map detailInfo = new HashMap<>(); + detailInfo.put("id", productSuitDetail.getId()); + detailInfo.put("suitId", productSuitDetail.getSuitId());// 道菜ID + detailInfo.put("suitNo", productSuitDetail.getSuitNo());// 道菜编号 + detailInfo.put("suitName", productSuitDetail.getSuitName());// 道菜名称 + detailInfo.put("productId", productSuitDetail.getProductId());// 产品ID + detailInfo.put("specId", productSuitDetail.getSpecId());// 产品规格ID + detailInfo.put("quantity", productSuitDetail.getQuantity());// 数量 + detailInfo.put("addPrice", productSuitDetail.getAddPrice());// 加价 + detailInfo.put("defaultflag", productSuitDetail.getDefaultflag());// 是否默认 + detailInfo.put("productNo", productSuitDetail.getProductNo());// 菜品编号 + detailInfo.put("productName", productSuitDetail.getProductName());// 菜品名称 + detailInfo.put("specName", productSuitDetail.getSpecName());// 规格名称 + detailInfo.put("unitId", productSuitDetail.getUnitId());// 单位ID + detailInfo.put("price", productSuitDetail.getPrice());// 售价 + detailInfo.put("memberPrice", productSuitDetail.getMemberPrice());// 会员价 + + detailList.add(detailInfo); + suitDetailProductIdList.add(detailInfo.get("productId").toString()); + suitDetailSpecIdList.add(detailInfo.get("specId").toString()); + } + + // 商品单位 + criteria = new Criteria(); + List productUnitList = productUnitService.getList(tenantId, criteria); + Map productUnitMap = new HashMap<>(); + for (ProductUnit productUnit : productUnitList) { + productUnitMap.put(productUnit.getId(), productUnit); + } + // 商品图片 + Map suitProductMap = new HashMap<>(); + if (CollectionUtils.isNotEmpty(suitDetailProductIdList)) { + criteria = new Criteria(); + criteria.add(Restrictions.in("id", suitDetailProductIdList)); + List productList = productService.getList(tenantId, criteria); + for (Product suitProduct : productList) { + suitProductMap.put(product.getId(), product); + } + } + // 明细菜映射的微信商品信息 + criteria = new Criteria(); + criteria.add(Restrictions.in("id", suitDetailSpecIdList)); + List tempGoodsList = this.productSpecService.getList(tenantId, criteria); + Map suitDetailExtMap = new HashMap(); + for (ProductSpec productSpec : tempGoodsList) { + suitDetailExtMap.put(productSpec.getId(), productSpec); + } + // 商品做法类型 + criteria = new Criteria(); + criteria.add(Restrictions.eq("deleteFlag", 0)); + criteria.add(Restrictions.order("seqNo", "ASC")); + List makeTypeList = makeTypeService.getList(tenantId, criteria); + // 商品公有做法 + criteria = new Criteria(); + criteria.add(Restrictions.eq("md.deleteFlag", 0)); + List makes = makeDetailService.getListByStoreId(tenantId, request.getStoreId(), criteria); + // 遍历道菜明细信息,处理商品单位和商品图片,以及明细菜映射的微信商品信息 + for (Map suitInfo : suitList) { + List> tempSuitDetailList = (List>) suitInfo.get("detail"); + for (Map suitDetail : tempSuitDetailList) { + suitDetail.put("unitName", productUnitMap.get(suitDetail.get("unitId").toString()) == null ? "" : productUnitMap.get(suitDetail.get("unitId").toString()).getName()); + Product suitProduct = suitProductMap.get(suitDetail.get("productId").toString()); + suitDetail.put("groupName", suitProduct == null ? null : suitProduct.getGroupName()); + suitDetail.put("picture", suitProduct == null ? null : suitProduct.getPicture()); + suitDetail.put("dfsAccessDomain", fdfsClientProperties.getAccessDomain()); + ProductSpec productSpec = suitDetailExtMap.get(suitDetail.get("specId").toString()); + suitDetail.put("goodsId", productSpec == null ? null : productSpec.getId()); + suitDetail.put("categoryId", productSpec == null ? null : productSpec.getTypeId()); + suitDetail.put("categoryPath", productSpec == null ? null : productSpec.getTypePath()); + + Map> typeInfoMap = new LinkedHashMap<>(); + List> makeInfoList = new ArrayList>(); + //封装类型 + for(MakeType type :makeTypeList){ + type.setColor(""); + Map map = JSON.parseObject(JSON.toJSONString(type),Map.class); + map.put("groupName", type.getName()); + map.put("detailList", new ArrayList<>()); + makeInfoList.add(map); + typeInfoMap.put(type.getId(), map); + } + //封装共有做法 + if(CollectionUtils.isNotEmpty(makes)){ + for(MakeDetail detail :makes){ + detail.setColor(""); + Map makeMap = JSON.parseObject(JSON.toJSONString(detail),Map.class); + makeMap.put("name", detail.getDescription()); + Map typeMap = typeInfoMap.get(detail.getTypeId()); + List> makeDetails = (List>)typeMap.get("detailList"); + makeDetails.add(makeMap); + } + } + List> productMakeList = new ArrayList<>(); + productMakeList.addAll(makeInfoList); + // 查询商品私有做法 + List proMakes = makeDetailService.getListByProductId(tenantId, suitDetail.get("productId").toString(), criteria); + if(proMakes.size() > 0){ + for(MakeDetail detail :proMakes){ + detail.setColor(""); + Map makeMap = JSON.parseObject(JSON.toJSONString(detail),Map.class); + makeMap.put("name", detail.getDescription()); + Map typeMap = typeInfoMap.get(detail.getTypeId()); + List> makeDetails = (List>)typeMap.get("detailList"); + makeDetails.add(makeMap); + } + } + List> newMakeList = new ArrayList<>(); + for(Map map:productMakeList){ + if(null != map.get("detailList")){ + List> detailList = (List>)map.get("detailList"); + if(detailList.size() > 0){ + newMakeList.add(map); + } + } + } + suitDetail.put("makeCount", newMakeList.size()); + suitDetail.put("makeList", newMakeList); + } + } + } + + response.setStatus(1); + response.setMessage("获取成功"); + response.setData(data); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/wxyh/WxyhService.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/wxyh/WxyhService.java new file mode 100644 index 0000000..d7b73e4 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/wxyh/WxyhService.java @@ -0,0 +1,42 @@ +package com.jwsaas.api.service.wxyh; + +import com.jwsaas.api.request.wxyh.UpdateWorkerPasswordRequest; +import com.jwsaas.api.request.wxyh.WxyhCategoryRequest; +import com.jwsaas.api.request.wxyh.WxyhGoodsRequest; +import com.jwsaas.api.service.WopService; + +/*** + * 微信要货接口 + * @author louxutao + * + */ +public interface WxyhService extends WopService{ + + /*** + * 获取商品品类 + * @param request + * @return + */ + Object goodsCategoryList(WxyhCategoryRequest request); + + /*** + * 获取商品 + * @param request + * @return + */ + Object goodsList(WxyhGoodsRequest request); + + /*** + * 获取商品(不包含原料) + * @param request + * @return + */ + Object goodsListWithoutMaterial(WxyhGoodsRequest request); + + /** + * 更新员工密码; + * @param request + * @return + */ + Object updateWorkerPasswordByWeixinAskGoods(UpdateWorkerPasswordRequest request); +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/api/service/wxyh/impl/WxyhServiceImpl.java b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/wxyh/impl/WxyhServiceImpl.java new file mode 100644 index 0000000..2eed0d4 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/api/service/wxyh/impl/WxyhServiceImpl.java @@ -0,0 +1,555 @@ +package com.jwsaas.api.service.wxyh.impl; + +import java.util.*; + +import javax.annotation.Resource; + +import com.alibaba.dubbo.common.utils.CollectionUtils; +import com.alibaba.fastjson.JSON; +import com.jwsaas.Constant; +import com.jwsaas.api.request.wxyh.UpdateWorkerPasswordRequest; +import com.jwsaas.api.request.wxyh.WxyhCategoryRequest; +import com.jwsaas.api.request.wxyh.WxyhGoodsRequest; +import com.jwsaas.api.response.mode.CommonDataResponse; +import com.jwsaas.api.response.mode.CommonErrorCode; +import com.jwsaas.api.response.mode.CommonListResponse; +import com.jwsaas.api.response.mode.CommonPagerResponse; +import com.jwsaas.api.service.impl.WopServiceImpl; +import com.jwsaas.api.service.wxyh.WxyhService; +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.*; +import com.jwsaas.open.annotation.HttpAction; +import com.jwsaas.open.annotation.NeedInSessionType; +import com.jwsaas.open.annotation.ServiceMethod; +import com.jwsaas.open.annotation.ServiceMethodBean; +import com.jwsaas.open.response.BusinessServiceErrorResponse; +import com.jwsaas.pager.Pager; +import com.jwsaas.reactor.event.EventKeys; +import com.jwsaas.service.food.StoreWorkerExtService; +import com.jwsaas.util.DesUtil; +import com.jwsaas.util.JSONUtil; +import com.jwsaas.util.StringUtils; +import com.jwsaas.utils.AppKeyUtil; +import com.jwsaas.utils.BCrypt; +import reactor.bus.Event; + +@ServiceMethodBean(version = "1.0") +public class WxyhServiceImpl extends WopServiceImpl implements WxyhService { + + private static final long serialVersionUID = -3615170735139597226L; + + @Resource + private com.jwsaas.service.food.StoreService storeService; + @Resource + private com.jwsaas.service.food.StoreProductService storeProductService; + @Resource + private com.jwsaas.service.food.ProductService productService; + @Resource + private com.jwsaas.service.food.ProductSpecService productSpecService; + @Resource + private com.jwsaas.service.food.ProductRatioService productRatioService; + @Resource + private com.jwsaas.service.food.ProductUnitService productUnitService; + @Resource + private com.jwsaas.service.food.ProductTypeService productTypeService; + @Resource + private StoreWorkerExtService storeWorkerExtService; + + /*** + * 获取原料品类 + */ + @ServiceMethod(method = "wxyh.goods.category.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "原料品类列表") + @Override + public Object goodsCategoryList(WxyhCategoryRequest request) { + String info = "获取原料品类"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + Integer isMaterial = request.getIsMaterial(); + + CommonListResponse response = null; + try { + response = new CommonListResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + if (isMaterial.intValue() == 1) { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("sp.storeId", request.getStoreId())); + criteria.add(Restrictions.ge("p.type", 10));// 原料,辅料 + criteria.add(Restrictions.eq("p.stockFlag", 1));// 管理库存 + criteria.add(Restrictions.eq("p.stopFlag", 0));// 未停用 + criteria.add(Restrictions.eq("p.deleteFlag", "0"));// 未删除 + criteria.add(Restrictions.isNotNull("t.id"));// 过滤空数据 + // criteria.add(Restrictions.isNull("t.parentId")); + criteria.add(Restrictions.group("t.id")); + criteria.add(Restrictions.order("t.no", "asc")); + System.out.println("sql:" + criteria.toSQL()); + List> list = productService.getProductType(tenantId, criteria); + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(list); + } else { + // 第一步,获取门店下的品牌 + List brandIdsList = storeService.getBrandIdList(tenantId, request.getStoreId()); + StringBuffer sb = new StringBuffer(); + sb.append(" SELECT CONCAT(t.`id`,'') AS id,t.`tenantId`,CONCAT(t.`parentId`,'') AS parentId,t.`path`,t.`no`,t.`name`,t.`color`,t.`deleteFlag`,t.`createDate`,t.`createUser` FROM "); + sb.append(" (SELECT * FROM cy_product "); + if (brandIdsList != null && brandIdsList.size() > 0) { + sb.append(" WHERE brandId IN (SELECT brandId FROM `cy_store_brand` WHERE storeId ='" + request.getStoreId() + "' and tenantId = '" + tenantId + "') "); + } + sb.append(" ) p "); + sb.append(" LEFT JOIN cy_product_type t ON t.id = p.typeId "); + sb.append(" WHERE t.id IS NOT NULL "); + sb.append(" AND p.type < 10 "); + sb.append(" AND t.parentId IS NOT NULL "); + sb.append(" AND p.stopFlag = 0 "); + sb.append(" AND p.deleteFlag = 0 "); + sb.append(" AND t.tenantId = '" + tenantId + "' "); + sb.append(" AND p.tenantId = '" + tenantId + "' "); + sb.append(" GROUP BY t.id ORDER BY t.no ASC "); + List> list = productService.selectList(tenantId, sb.toString()); + List ids = new ArrayList(); + // 获取一级分类 + for (Map map : list) { + if (map.get("parentId") != null) { + ids.add(map.get("path").toString().split(",")[0]); + } + } + if (ids != null && ids.size() > 0) { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.in("id", removeDuplicate(ids))); + criteria.add(Restrictions.eq("tenantId", tenantId)); + List productTypeList = productTypeService.getList(tenantId, criteria); + for (ProductType productType : productTypeList) { + Map map = new HashMap<>(); + map.put("id", productType.getId()); + map.put("tenantId", productType.getTenantId()); + map.put("parentId", productType.getParentId()); + map.put("path", productType.getPath()); + map.put("no", productType.getNo()); + map.put("name", productType.getName()); + map.put("color", productType.getColor()); + map.put("deleteFlag", productType.getDeleteFlag()); + map.put("createDate", productType.getCreateDate()); + map.put("createUser", productType.getCreateUser()); + list.add(map); + } + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setList(removeDuplicate(list)); + } + + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + public static List removeDuplicate(List list) { + if (list != null && list.size() > 0) { + for (int i = 0; i < list.size() - 1; i++) { + for (int j = list.size() - 1; j > i; j--) { + if (list.get(j).equals(list.get(i))) { + list.remove(j); + } + } + } + } + return list; + } + + /*** + * 获取商品信息列表 + */ + @SuppressWarnings("unchecked") + @ServiceMethod(method = "wxyh.goods.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "获取商品信息列表") + @Override + public Object goodsList(WxyhGoodsRequest request) { + String info = "获取商品信息列表"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + String categoryId = request.getCategoryId(); + String brandIds = request.getBrandIds(); + String property = request.getProperty(); + String keyword = request.getKeyword(); + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + + CommonPagerResponse response = null; + try { + + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + + Criteria criteria = new Criteria(); + // 模糊搜索 支持搜索名称,编码和拼音简码 + if (StringUtils.isNotBlank(keyword)) { + criteria.add(Restrictions.or(Restrictions.or(Restrictions.like("p.name", "%" + keyword + "%"), Restrictions.like("p.spell", "%" + keyword + "%")), Restrictions.or(Restrictions.like("p.no", "%" + keyword + "%"), Restrictions.like("p.barCode", "%" + keyword + "%")))); + } + if (StringUtils.isNotBlank(categoryId)) { + ProductType productType = productTypeService.get(tenantId, categoryId); + if (productType != null) { + criteria.add(Restrictions.like("sp.typePath", productType.getPath() + "%")); + } + } + if (StringUtils.isNotBlank(brandIds)) { + criteria.add(Restrictions.eq("p.brandId", brandIds)); + } + criteria.add(Restrictions.eq("sp.storeId", storeId)); + // 管理库存,未停用,未删除的原料,辅料 + criteria.add(Restrictions.eq("p.stopFlag", "0")); + criteria.add(Restrictions.eq("sp.storeId", storeId)); + criteria.add(Restrictions.eq("ps.deleteFlag", 0)); + criteria.add(Restrictions.eq("p.deleteFlag", 0)); + // 原料属性; + criteria.add(Restrictions.eq("p.type", "10")); + criteria.add(Restrictions.order("p.no", "asc")); + criteria.add(Restrictions.order("ps.no", "asc")); + pager = storeProductService.getPagerExtend(tenantId, criteria, pager); + List productList = (List) pager.getList(); + List> list = new ArrayList>(); + + for (StoreProduct product : productList) { + Map map = JSONUtil.parseObject(JSON.toJSONString(product), Map.class); + map.put("dishId", product.getSpecId()); + map.put("name", product.getProductName()); + map.put("unitId", product.getProductUnitId()); + map.put("no", product.getProductNo()); + map.put("oldPrice", product.getPrice()); + map.put("oldMinPrice", product.getMinPrice()); + map.put("oldMemberPrice", product.getMemberPrice()); + map.put("oldOtherPrice", product.getOtherPrice()); + list.add(map); + } + Map ratioMap = new HashMap(); + // 所有库存系数 + criteria = new Criteria(); + criteria.add(Restrictions.limit("0", "3000")); + List ratios = productRatioService.getList(tenantId, criteria); + for (ProductRatio ratio : ratios) { + ratioMap.put(ratio.getProductId(), ratio); + } + // 所有单位 + Map unitMap = new HashMap(); + criteria = new Criteria(); + List units = productUnitService.getList(tenantId, criteria); + for (ProductUnit unit : units) { + unitMap.put(unit.getId(), unit); + } + + Map productMap = new HashMap(); + // 原料批发价格 + criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.limit("0","3000")); + List sources = storeProductService.getList(tenantId, criteria); + for (StoreProduct product : sources) { + productMap.put(product.getSpecId(), product); + } + + // 组装数据 + for (Map map : list) { + String productId = map.get("productId").toString(); + String productName = map.get("name").toString(); + String specId = map.get("specId").toString(); + + // 配送单位 + if (null == ratioMap.get(productId)) { + response.setStatus(0); + response.setMessage(productName + "没有库存系数"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + String dispatchUnitId = ratioMap.get(productId).getDispatchUnitId(); + // 配送单位 + if (null == unitMap.get(dispatchUnitId)) { + response.setStatus(0); + response.setMessage(productName + "没有配送单位"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + String dispatchUnitName = unitMap.get(dispatchUnitId).getName(); + + map.put("dispatchUnitId", dispatchUnitId); + map.put("dispatchUnitName", dispatchUnitName); + // 配送价 + double dispatchPrice = 0.00; + if (null == productMap.get(specId)) { + logger.error(info + "异常,商品[" + map.get("dishId").toString() + "] 没有配送价"); + response.setStatus(0); + response.setMessage(productName + "没有配送价"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + dispatchPrice = productMap.get(specId).getDispatchPrice(); + + map.put("dispatchPrice", dispatchPrice); + } + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(pager.getPageCount()); + response.setTotalCount(pager.getTotalCount()); + response.setList(list); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /*** + * 获取商品信息列表(不包含原料) + */ + @SuppressWarnings("unchecked") + @ServiceMethod(method = "wxyh.goods.without.material.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "获取商品信息列表(不包含原料)") + @Override + public Object goodsListWithoutMaterial(WxyhGoodsRequest request) { + String info = "获取商品信息列表(不包含原料)"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + String categoryId = request.getCategoryId(); + String brandIds = request.getBrandIds(); + String property = request.getProperty(); + String keyword = request.getKeyword(); + int pageNumber = request.getPageNumber(); + int pageSize = request.getPageSize(); + + CommonPagerResponse response = null; + try { + response = new CommonPagerResponse(); +// Store store = storeService.get(tenantId, request.getStoreId()); +// if (store == null) { +// response.setStatus(0); +// response.setMessage("门店ID不存在"); +// response.setErrCode(CommonErrorCode.error3.getCode()); +// response.setErrMessage(CommonErrorCode.error3.getMessage()); +// return response; +// } + Pager pager = new Pager(); + pager.setPageSize(pageSize); + pager.setPageNumber(pageNumber); + + Criteria criteria = new Criteria(); + if (StringUtils.isNotBlank(categoryId)) { + ProductType productType = productTypeService.get(tenantId, categoryId); + if (productType != null) { + criteria.add(Restrictions.like("p.typePath", productType.getPath() + "%")); + } + } + if (StringUtils.isNotBlank(keyword)) { + criteria.add(Restrictions.or(Restrictions.or(Restrictions.like("p.name", "%" + keyword + "%"), Restrictions.like("p.spell", "%" + keyword + "%")), Restrictions.or(Restrictions.like("p.no", "%" + keyword + "%"), Restrictions.like("p.barCode", "%" + keyword + "%")))); + } + if (StringUtils.isNotBlank(brandIds)) { + criteria.add(Restrictions.eq("p.brandId", brandIds)); + } + criteria.add(Restrictions.lt("p.type", 10)); + criteria.add(Restrictions.eq("p.deleteFlag", 0)); + criteria.add(Restrictions.eq("p.stopFlag", "0")); + criteria.add(Restrictions.eq("ps.deleteFlag", 0)); + criteria.add(Restrictions.order("p.no", "asc")); + criteria.add(Restrictions.order("ps.no", "asc")); + + List storeIdList = new ArrayList(); + storeIdList.add(storeId); + List list = productSpecService.getListByStoreIds(tenantId, storeIdList, criteria); + List> dataList = new ArrayList>(); + + int totalCount = list.size(); + int totalPage = totalCount % pageSize == 0 ? totalCount / pageSize : totalCount / pageSize + 1; + if (list.size() >= pageNumber * pageSize) { + list = list.subList((pageNumber - 1) * pageSize, pageNumber * pageSize); + } else { + list = list.subList((pageNumber - 1) * pageSize, list.size()); + } + if (CollectionUtils.isNotEmpty(list)) { + Criteria crit = new Criteria(); + crit.add(Restrictions.eq("storeId", storeIdList.get(0))); + List products = storeProductService.getList(tenantId, crit); + Map maps = new HashMap<>(); + for (StoreProduct sp : products) { + maps.put(sp.getSpecId(), sp); + } + + for (ProductSpec spec : list) { + StoreProduct sp = maps.get(spec.getId()); + if (sp != null) { + spec.setPrice(sp.getPrice()); + spec.setMemberPrice(sp.getMemberPrice()); + spec.setOtherPrice(sp.getOtherPrice()); + spec.setMinPrice(sp.getMinPrice()); + } + Map map = JSON.parseObject(JSON.toJSONString(spec), Map.class); + map.put("specId", spec.getId()); + map.put("dishId", spec.getId()); + map.put("name", spec.getProductName()); + map.put("specName", spec.getName()); + map.put("oldPrice", spec.getPrice()); + map.put("oldMinPrice", spec.getMinPrice()); + map.put("oldMemberPrice", spec.getMemberPrice()); + map.put("oldOtherPrice", spec.getOtherPrice()); + dataList.add(map); + } + } + + response.setStatus(1); + response.setMessage("获取成功"); + response.setPageNumber(pager.getPageNumber()); + response.setPageSize(pager.getPageSize()); + response.setPageCount(totalPage); + response.setTotalCount(totalCount); + response.setList(dataList); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + + /*** + * 修改员工登录密码 + */ + @ServiceMethod(method = "wxyh.worker.password.update", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "修改员工登录密码") + @Override + public Object updateWorkerPasswordByWeixinAskGoods(UpdateWorkerPasswordRequest request) { + String info = "微信要货-修改员工登录密码"; + String appKey = request.getWopRequestContext().getAppKey(); + logger.debug("appKey=" + appKey); + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + // String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + // String appCode = appKeyInfo.getAppCode(); + String tenantId = tenantCode; + + String storeId = request.getStoreId(); + String storeNo = request.getStoreNo(); + String userName = request.getUserName(); + String newPasswd = request.getNewPassword(); + String workerId = request.getWorkerId(); + + CommonDataResponse response = null; + try { + response = new CommonDataResponse(); + Store store = storeService.get(tenantId, storeId); + if (store == null) { + response.setStatus(0); + response.setMessage("门店ID不存在"); + response.setErrCode(CommonErrorCode.error3.getCode()); + response.setErrMessage(CommonErrorCode.error3.getMessage()); + return response; + } + + if(!storeNo.equals(store.getNo())){ + response.setStatus(0); + response.setMessage("门店编号错误"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + newPasswd = DesUtil.strDecWithOutKey(newPasswd); + String hashed = BCrypt.hashpw(newPasswd, BCrypt.gensalt()); + Map dataMap = new HashMap<>(); + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId));// 门店ID + criteria.add(Restrictions.eq("workerId", workerId));// 员工工号 + List workerExtList = storeWorkerExtService.getList(tenantId, criteria); + if (org.apache.commons.collections4.CollectionUtils.isEmpty(workerExtList)) { + // 为空新增一条记录 + StoreWorkerExt saveObj = new StoreWorkerExt(); + saveObj.setWorkerId(workerId);// 员工ID + saveObj.setWorkerNo(userName);// 员工工号 + saveObj.setStoreId(storeId);// 门店ID + saveObj.setStoreNo(store.getNo());// 门店编号 + saveObj.setPasswd(hashed);// 登录密码 + saveObj.setDescription(null);// 备注 + saveObj.setCreateDate(new Date()); + saveObj.setCreateUser(Constant.CREATE_USER); + storeWorkerExtService.save(tenantId, saveObj); + + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(dataMap); + return response; + } + + StoreWorkerExt workerExt = workerExtList.get(0); + if(!userName.equals(workerExt.getWorkerNo())){ + response.setStatus(0); + response.setMessage("员工编号错误!"); + response.setErrCode(CommonErrorCode.error998.getCode()); + response.setErrMessage(CommonErrorCode.error998.getMessage()); + return response; + } + + + StoreWorkerExt updateObj = new StoreWorkerExt(); + updateObj.setId(workerExt.getId()); + updateObj.setPasswd(hashed); + updateObj.setModifyDate(new Date()); + updateObj.setModifyUser(Constant.CREATE_USER); + storeWorkerExtService.update(tenantId, updateObj); + + response.setStatus(1); + response.setMessage("操作成功"); + response.setData(dataMap); + + // 员工密码修改后,掌柜查询需重新登陆 + logger.debug(">>>>>>>员工密码修改后,掌柜查询需重新登陆"); + Map eventData = new HashMap<>(); + eventData.put("tenantCode", tenantCode); + eventData.put("tenantId", tenantId); + eventData.put("storeNo", store.getNo()); + eventData.put("workerNo", userName); + eventBus.notify(EventKeys.ZGCX_LOGIN_OUT, Event.wrap(eventData)); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale()); + } + return response; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/bean/AppKeyInfo.java b/food-open/food-open-api/src/main/java/com/jwsaas/bean/AppKeyInfo.java new file mode 100644 index 0000000..d203171 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/bean/AppKeyInfo.java @@ -0,0 +1,40 @@ +package com.jwsaas.bean; + +public class AppKeyInfo { + + private String appId; + private String tenantCode; + private String appCode; + + public AppKeyInfo(String appId, String tenantCode, String appCode) { + super(); + this.appId = appId; + this.tenantCode = tenantCode; + this.appCode = appCode; + } + + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } + + public String getTenantCode() { + return tenantCode; + } + + public void setTenantCode(String tenantCode) { + this.tenantCode = tenantCode; + } + + public String getAppCode() { + return appCode; + } + + public void setAppCode(String appCode) { + this.appCode = appCode; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/bean/StoresPrediction.java b/food-open/food-open-api/src/main/java/com/jwsaas/bean/StoresPrediction.java new file mode 100644 index 0000000..0bd3327 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/bean/StoresPrediction.java @@ -0,0 +1,148 @@ +package com.jwsaas.bean; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import java.util.Map; + +import com.jwsaas.utils.DateUtils; + +public class StoresPrediction implements Serializable , Comparable{ + + /** + * + */ + private static final long serialVersionUID = -6294339395535192174L; + private String id; + private String storeName; + private String storeId; + private String storeNo; + private String weekDay; + + private Double preDictionAmount; + + private Date dateTime; + + private List> histrylist; + /*表格导出使用*/ + private Map hisMap; + + private Double aftDictionAmount; + + private String floatStr; + + + + public Double getAftDictionAmount() { + return aftDictionAmount; + } + + public void setAftDictionAmount(Double aftDictionAmount) { + this.aftDictionAmount = aftDictionAmount; + } + + public String getFloatStr() { + return floatStr; + } + + public void setFloatStr(String floatStr) { + this.floatStr = floatStr; + } + + public Map getHisMap() { + return hisMap; + } + + public void setHisMap(Map hisMap) { + this.hisMap = hisMap; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getWeekDay() { + return weekDay; + } + + public void setWeekDay(String weekDay) { + this.weekDay = weekDay; + } + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public String getStoreNo() { + return storeNo; + } + + public void setStoreNo(String storeNo) { + this.storeNo = storeNo; + } + + public Double getPreDictionAmount() { + return preDictionAmount; + } + + public void setPreDictionAmount(Double preDictionAmount) { + this.preDictionAmount = preDictionAmount; + } + + public String getDateTime() { + return DateUtils.format(dateTime, "yyyy-MM-dd"); + } + + public void setDateTime(Date dateTime) { + this.dateTime = dateTime; + } + + public List> getHistrylist() { + return histrylist; + } + + public void setHistrylist(List> histrylist) { + this.histrylist = histrylist; + } + + @Override + public int compareTo(StoresPrediction o) { + Long i = DateUtils.parseDate(this.getDateTime(), "yyyy-MM-dd").getTime() - DateUtils.parseDate(o.getDateTime(), "yyyy-MM-dd").getTime(); + if(i > 0){ + return 1; + }else if(i==0){ + return 0; + }else{ + return -1; + } + } + + @Override + public String toString() { + return "StoresPrediction [preDictionAmount=" + preDictionAmount + ", dateTime=" + DateUtils.format(dateTime, "yyyy-MM-dd") + ", histrylist=" + + histrylist + "]"; + } + + + + + + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/cache/CacheUtil.java b/food-open/food-open-api/src/main/java/com/jwsaas/cache/CacheUtil.java new file mode 100644 index 0000000..937e217 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/cache/CacheUtil.java @@ -0,0 +1,126 @@ +package com.jwsaas.cache; + +import java.util.Set; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.jwsaas.utils.SpringUtils; + +/** + * CacheUtil CacheService工具类 + */ +public class CacheUtil { + + private static Logger logger = LoggerFactory.getLogger(CacheUtil.class); + + private static CacheService cacheService; + + private static int defaultSecondsToExpire = 60 * 30;// 默认缓存过期时间(30分钟) + + private static CacheService getCacheService() { + if (cacheService == null) { + cacheService = SpringUtils.getApplicationContext().getBean(CacheService.class); + } + return cacheService; + } + + /** + * 向给定的缓存名中存放一个缓存对象。 + * + * @param tenantId + * 租户标识 + * @param key + * 缓存的名字 + * @param value + * key对应的值内容 + * @param secondsToExpire + * 缓存过期时间 + * @return 存放成功,返回true;否则返回false + */ + public static boolean set(String tenantId, String key, Object value, int secondsToExpire) { + boolean result = false; + try { + getCacheService().set(tenantId, key, value, secondsToExpire); + result = true; + } catch (Exception e) { + logger.warn("向缓存中放入数据[key:" + key + "]时发生异常:", e); + } + return result; + } + + /** + * 向给定的缓存名中存放一个缓存对象。 + * + * @param tenantId + * 租户标识 + * @param key + * 缓存的名字 + * @param value + * key对应的值内容 + * @return 存放成功,返回true;否则返回false + */ + public static boolean set(String tenantId, String key, Object value) { + return set(tenantId, key, value, defaultSecondsToExpire); + } + + /** + * 通过给定的租户标识和key,获取缓存的内容。 + * + * @param tenantId + * 租户标识 + * @param key + * 缓存的名字 + * @return 缓存的对象 + */ + public static Object get(String tenantId, String key) { + Object value = null; + try { + value = getCacheService().get(tenantId, key); + logger.debug("获取缓存数据[tenantId:" + tenantId + ",key:" + key + "],value[" + value + "]。"); + } catch (Exception e) { + logger.warn("获取缓存的数据[key:" + key + "]时发生异常:", e); + } + return value; + } + + /** + * 通过给定的租户标识和key,清除其缓存信息。 + * + * @param tenantId + * 租户标识 + * @param key + * 缓存的名字 + * @return 清除缓存成功,返回true;否则返回false + */ + public static boolean delete(String tenantId, String key) { + boolean result = false; + try { + getCacheService().del(tenantId, key); + result = true; + logger.debug("删除缓存数据[tenantId:" + tenantId + ",key:" + key + "]" + (result ? "成功" : "失败") + "[" + result + "]。"); + } catch (Exception e) { + logger.error("删除缓存数据[tenantId:" + tenantId + ",key:" + key + "]时发生异常:", e); + } + return result; + } + + /** + * 根据租户标识,获取与其相关的所有缓存key。 + * + * @param tenantId + * 租户标识 + * @return + */ + public static Set getKeys(String tenantId) { + String info = "获取[tenantId:" + tenantId + "]下的所有缓存key。"; + Set keys = null; + try { + keys = getCacheService().keys(tenantId); + } catch (Exception e) { + logger.warn(info + "时发生异常:", e); + } + return keys; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/cache/data/CacheData.java b/food-open/food-open-api/src/main/java/com/jwsaas/cache/data/CacheData.java new file mode 100644 index 0000000..09ab423 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/cache/data/CacheData.java @@ -0,0 +1,25 @@ +package com.jwsaas.cache.data; + +import java.util.Map; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * 缓存基类 + */ +public abstract class CacheData { + + protected Logger logger = LoggerFactory.getLogger(getClass()); + + /** + * 删除缓存数据的方法 + * + * @param tenantId + * 租户标识 + * @param extendInfo + * 扩展信息,可为空。 + */ + public abstract void removeCacheData(String tenantId, Map extendInfo); + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/cache/data/ProductRatioCache.java b/food-open/food-open-api/src/main/java/com/jwsaas/cache/data/ProductRatioCache.java new file mode 100644 index 0000000..ea38886 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/cache/data/ProductRatioCache.java @@ -0,0 +1,91 @@ +package com.jwsaas.cache.data; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Component; + +import com.jwsaas.Global; +import com.jwsaas.cache.CacheKeys; +import com.jwsaas.cache.CacheUtil; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.ProductRatio; +import com.jwsaas.service.food.ProductRatioService; + +/** + * 商品库存系数相关缓存数据 + * + * @author ZhangShuXiang + */ +@Component(Global.APP_SIGN + "ProductRatioCache") +public class ProductRatioCache extends CacheData { + + @Resource + private ProductRatioService productRatioService; + + /** + * 获取商品库存系数列表 + */ + @SuppressWarnings("unchecked") + public List getAll(String tenantId) { + String key = CacheKeys.PRODUCT_RATIO_LIST.getKey(); + List list = null; + try { + Object cacheValue = CacheUtil.get(tenantId, key); + if (cacheValue == null) { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.order("productId", "asc")); + criteria.add(Restrictions.limit("0",Global.DATA_LIMIT)); + list = productRatioService.getList(tenantId, criteria); + if (list != null) { + CacheUtil.set(tenantId, key, list); + } + } else { + list = (List) cacheValue; + } + } catch (Exception ex) { + logger.error("ProductRatioCache中getAll方法发生异常:", ex); + } + return list; + } + + /** + * 获取商品库存系数Map,ProductId为key + */ + @SuppressWarnings("unchecked") + public Map getAllMap(String tenantId) { + String key = CacheKeys.PRODUCT_RATIO_MAP.getKey(); + Map map = null; + try { + Object cacheValue = CacheUtil.get(tenantId, key); + if (cacheValue == null) { + List list = getAll(tenantId); + if (list != null) { + map = new HashMap<>(); + for (ProductRatio data : list) { + map.put(data.getProductId(), data); + } + } + if (map != null) { + CacheUtil.set(tenantId, key, map); + } + } else { + map = (Map) cacheValue; + } + } catch (Exception ex) { + logger.error("ProductRatioCache中getAllMap方法发生异常:", ex); + } + return map; + } + + @Override + public void removeCacheData(String tenantId, Map extendInfo) { + CacheUtil.delete(tenantId, CacheKeys.PRODUCT_RATIO_LIST.getKey()); + CacheUtil.delete(tenantId, CacheKeys.PRODUCT_RATIO_MAP.getKey()); + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/cache/data/ProductUnitCache.java b/food-open/food-open-api/src/main/java/com/jwsaas/cache/data/ProductUnitCache.java new file mode 100644 index 0000000..b2b09c0 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/cache/data/ProductUnitCache.java @@ -0,0 +1,117 @@ +package com.jwsaas.cache.data; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Component; + +import com.jwsaas.Global; +import com.jwsaas.cache.CacheKeys; +import com.jwsaas.cache.CacheUtil; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.ProductUnit; +import com.jwsaas.service.food.ProductUnitService; + +/** + * 计量单位相关缓存数据 + * + * @author ZhangShuXiang + */ +@Component(Global.APP_SIGN + "ProductUnitCache") +public class ProductUnitCache extends CacheData { + + @Resource + private ProductUnitService productUnitService; + + /** + * 获取计量单位列表 + */ + @SuppressWarnings("unchecked") + public List getAll(String tenantId) { + String key = CacheKeys.PRODUCT_UNIT_LIST.getKey(); + List list = null; + try { + Object cacheValue = CacheUtil.get(tenantId, key); + if (cacheValue == null) { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.order("no", "asc")); + criteria.add(Restrictions.limit("0",Global.DATA_LIMIT)); + list = productUnitService.getList(tenantId, criteria); + if (list != null) { + CacheUtil.set(tenantId, key, list); + } + } else { + list = (List) cacheValue; + } + } catch (Exception ex) { + logger.error("ProductUnitCache中getAll方法发生异常:", ex); + } + return list; + } + + /** + * 获取计量单位列表 + */ + public List getList(String tenantId, boolean isAll) { + String info = "获取计量单位列表"; + logger.debug(info); + + List list = null; + try { + list = getAll(tenantId); + if (list != null && !isAll) { + List temp = new ArrayList<>(); + for (ProductUnit data : list) { + if (data.getDeleteFlag() == 0) { + temp.add(data); + } + } + list = temp; + } + } catch (Exception ex) { + logger.error(info + "时,发生异常", ex); + } + return list; + } + + /** + * 获取计量单位Map + */ + @SuppressWarnings("unchecked") + public Map getAllMap(String tenantId) { + String key = CacheKeys.PRODUCT_UNIT_MAP.getKey(); + Map map = null; + try { + Object cacheValue = CacheUtil.get(tenantId, key); + if (cacheValue == null) { + List list = getAll(tenantId); + if (list != null) { + map = new HashMap<>(); + for (ProductUnit data : list) { + map.put(data.getId(), data); + } + } + if (map != null) { + CacheUtil.set(tenantId, key, map); + } + } else { + map = (Map) cacheValue; + } + } catch (Exception ex) { + logger.error("ProductTypeCache中getAllMap方法发生异常:", ex); + } + return map; + } + + @Override + public void removeCacheData(String tenantId, Map extendInfo) { + CacheUtil.delete(tenantId, CacheKeys.PRODUCT_UNIT_LIST.getKey()); + CacheUtil.delete(tenantId, CacheKeys.PRODUCT_UNIT_MAP.getKey()); + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/cache/data/ProgramProductInfoCache.java b/food-open/food-open-api/src/main/java/com/jwsaas/cache/data/ProgramProductInfoCache.java new file mode 100644 index 0000000..90c2ee1 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/cache/data/ProgramProductInfoCache.java @@ -0,0 +1,266 @@ +package com.jwsaas.cache.data; + +import com.jwsaas.Global; +import com.jwsaas.cache.CacheUtil; +import com.jwsaas.entity.food.ProductType; +import com.jwsaas.pager.Pager; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.stereotype.Component; + +import java.util.List; +import java.util.Map; + +/** + * 巨为小程序门店商品信息缓存; + */ +@Component(Global.APP_SIGN + "ProgramProductInfoCache") +public class ProgramProductInfoCache extends CacheData { + private final String PROGRAM_PRODUCT_CATEGORY_SUFFIX = "_programProductCategoryList";//小程序商品分类信息; + private final String PROGRAM_PRODUCT_INFO_SUFFIX = "_programProductInfoList";//小程序商品信息; + private final String PROGRAM_PRODUCT_SPEC_INFO_SUFFIX = "_programProductSpecInfoList";//小程序商品规格信息; + private final String PROGRAM_PRODUCT_MAKE_SUFFIX = "_programProductMakeList";//小程序商品做法信息; + private final String PROGRAM_PRODUCT_SUIT_SUFFIX = "_programProductSuitList";//小程序商品套餐信息; + private final String PROGRAM_PRODUCT_SUIT_DETAIL_SUFFIX = "_programProductSuitDetailList";//小程序商品套餐明细信息; + private final String PROGRAM_PRODUCT_TYPE_MAP_SUFFIX = "_productTypeMap";//商品分类信息; + + private final String PROGRAM_AD_PICTURE_SUFFIX = "_programAdPictureList";//小程序广告图片——前10条记录; + + + /** + * 小程序广告图片信息(前10条) + * @param tenantId + * @return + */ + public Pager getProgramAdPictures(String tenantId,String programId){ + String key = tenantId+PROGRAM_AD_PICTURE_SUFFIX+programId; + Pager pager = null; + try{ + Object cacheValue = CacheUtil.get(tenantId, key); + if(cacheValue != null){ + pager = (Pager) cacheValue; + } + }catch (Exception e){ + logger.error("ProgramProductInfoCache 中方法 getProgramAdPictures 出错:", e); + } + return pager; + } + + /** + * 设置小程序广告图片信息(前10条) + * @param tenantId + * @return + */ + public void setProgramAdPictures(String tenantId,String programId,Pager pager){ + String key = tenantId+PROGRAM_AD_PICTURE_SUFFIX+programId; + if(pager != null && pager.getList().size() > 0){ + CacheUtil.set(tenantId, key, pager); + } + } + + + /** + * 商品分类信息 + * @param tenantId + * @return + */ + public Map getProductTypeMap(String tenantId) { + String key = tenantId+PROGRAM_PRODUCT_TYPE_MAP_SUFFIX; + Map map = null; + try{ + Object cacheValue = CacheUtil.get(tenantId, key); + if(cacheValue != null){ + map = (Map) cacheValue; + } + }catch (Exception e){ + logger.error("ProgramProductInfoCache 中方法 getProductTypeMap 出错:", e); + } + return map; + } + + public void putCacheProductTypeMap(String tenantId,Map map){ + String key = tenantId+PROGRAM_PRODUCT_TYPE_MAP_SUFFIX; + if(map != null && map.size() > 0){ + CacheUtil.set(tenantId, key, map); + } + } + + /** + * 小程序商品分类信息 + * @param tenantId + * @param storeId + * @return + */ + public List> getProgramProductCategory(String tenantId,String storeId) { + String key = tenantId+"-"+storeId+PROGRAM_PRODUCT_CATEGORY_SUFFIX; + List> list = null; + try{ + Object cacheValue = CacheUtil.get(tenantId, key); + if(cacheValue != null){ + list = (List>) cacheValue; + } + }catch (Exception e){ + logger.error("ProgramProductInfoCache 中方法getProgramProductCategory出错:", e); + } + return list; + } + + public void putCacheProgramProductCategory(String tenantId,String storeId,List> list){ + String key = tenantId+"-"+storeId+PROGRAM_PRODUCT_CATEGORY_SUFFIX; + if(CollectionUtils.isNotEmpty(list)){ + CacheUtil.set(tenantId, key, list); + } + } + + /** + * 小程序商品信息 + * @param tenantId + * @param storeId + * @return + */ + public List> getProgramProductInfo(String tenantId,String storeId) { + String key = tenantId+"-"+storeId+PROGRAM_PRODUCT_INFO_SUFFIX; + List> list = null; + try{ + Object cacheValue = CacheUtil.get(tenantId, key); + if(cacheValue != null){ + list = (List>) cacheValue; + } + }catch (Exception e){ + logger.error("ProgramProductInfoCache 中方法 getProgramProductInfo 出错:", e); + } + return list; + } + + public void putCacheProgramProductInfo(String tenantId,String storeId,List> list){ + String key = tenantId+"-"+storeId+PROGRAM_PRODUCT_INFO_SUFFIX; + if(CollectionUtils.isNotEmpty(list)){ + CacheUtil.set(tenantId, key, list); + } + } + + /** + * 小程序商品规格信息 + * @param tenantId + * @param storeId + * @return + */ + public List> getProgramProductSpecInfo(String tenantId,String storeId) { + String key = tenantId+"-"+storeId+PROGRAM_PRODUCT_SPEC_INFO_SUFFIX; + List> list = null; + try{ + Object cacheValue = CacheUtil.get(tenantId, key); + if(cacheValue != null){ + list = (List>) cacheValue; + } + }catch (Exception e){ + logger.error("ProgramProductInfoCache 中方法 getProgramProductSpecInfo 出错:", e); + } + return list; + } + + public void putCacheProgramProductSpecInfo(String tenantId,String storeId,List> list){ + String key = tenantId+"-"+storeId+PROGRAM_PRODUCT_SPEC_INFO_SUFFIX; + if(CollectionUtils.isNotEmpty(list)){ + CacheUtil.set(tenantId, key, list); + } + } + + /** + * 小程序商品做法信息 + * @param tenantId + * @param storeId + * @return + */ + public List> getProgramProductMake(String tenantId,String storeId) { + String key = tenantId+"-"+storeId+PROGRAM_PRODUCT_MAKE_SUFFIX; + List> list = null; + try{ + Object cacheValue = CacheUtil.get(tenantId, key); + if(cacheValue != null){ + list = (List>) cacheValue; + } + }catch (Exception e){ + logger.error("ProgramProductInfoCache 中方法 getProgramProductMake 出错:", e); + } + return list; + } + + public void putCacheProgramProductMake(String tenantId,String storeId,List> list){ + String key = tenantId+"-"+storeId+PROGRAM_PRODUCT_MAKE_SUFFIX; + if(CollectionUtils.isNotEmpty(list)){ + CacheUtil.set(tenantId, key, list); + } + } + + + /** + * 小程序商品套餐信息 + * @param tenantId + * @param storeId + * @return + */ + public List> getProgramProductSuit(String tenantId,String storeId) { + String key = tenantId+"-"+storeId+PROGRAM_PRODUCT_SUIT_SUFFIX; + List> list = null; + try{ + Object cacheValue = CacheUtil.get(tenantId, key); + if(cacheValue != null){ + list = (List>) cacheValue; + } + }catch (Exception e){ + logger.error("ProgramProductInfoCache 中方法 getProgramProductSuit 出错:", e); + } + return list; + } + + public void putCacheProgramProductSuit(String tenantId,String storeId,List> list){ + String key = tenantId+"-"+storeId+PROGRAM_PRODUCT_SUIT_SUFFIX; + if(CollectionUtils.isNotEmpty(list)){ + CacheUtil.set(tenantId, key, list); + } + } + + + /** + * 小程序商品套餐明细信息 + * @param tenantId + * @param storeId + * @return + */ + public List> getProgramProductSuitDetail(String tenantId,String storeId) { + String key = tenantId+"-"+storeId+PROGRAM_PRODUCT_SUIT_DETAIL_SUFFIX; + List> list = null; + try{ + Object cacheValue = CacheUtil.get(tenantId, key); + if(cacheValue != null){ + list = (List>) cacheValue; + } + }catch (Exception e){ + logger.error("ProgramProductInfoCache 中方法 getProgramProductSuitDetail 出错:", e); + } + return list; + } + + public void putCacheProgramProductSuitDetail(String tenantId,String storeId,List> list){ + String key = tenantId+"-"+storeId+PROGRAM_PRODUCT_SUIT_DETAIL_SUFFIX; + if(CollectionUtils.isNotEmpty(list)){ + CacheUtil.set(tenantId, key, list); + } + } + + + @Override + public void removeCacheData(String tenantId, Map extendInfo) { + String storeId = extendInfo.get("storeId").toString(); + CacheUtil.delete(tenantId, tenantId+"-"+storeId+PROGRAM_PRODUCT_CATEGORY_SUFFIX); + CacheUtil.delete(tenantId, tenantId+"-"+storeId+PROGRAM_PRODUCT_INFO_SUFFIX); + CacheUtil.delete(tenantId, tenantId+"-"+storeId+PROGRAM_PRODUCT_SPEC_INFO_SUFFIX); + CacheUtil.delete(tenantId, tenantId+"-"+storeId+PROGRAM_PRODUCT_MAKE_SUFFIX); + CacheUtil.delete(tenantId, tenantId+"-"+storeId+PROGRAM_PRODUCT_SUIT_SUFFIX); + CacheUtil.delete(tenantId, tenantId+"-"+storeId+PROGRAM_PRODUCT_SUIT_DETAIL_SUFFIX); + if(extendInfo.containsKey("programId")){ + CacheUtil.delete(tenantId, tenantId+PROGRAM_PRODUCT_TYPE_MAP_SUFFIX+extendInfo.get("programId")); + } + + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/cache/data/StoreCache.java b/food-open/food-open-api/src/main/java/com/jwsaas/cache/data/StoreCache.java new file mode 100644 index 0000000..9b25e2f --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/cache/data/StoreCache.java @@ -0,0 +1,200 @@ +package com.jwsaas.cache.data; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Component; + +import com.jwsaas.Global; +import com.jwsaas.cache.CacheKeys; +import com.jwsaas.cache.CacheUtil; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.Store; +import com.jwsaas.service.food.StoreService; + +/** + * 门店信息相关缓存数据 + * + * @author ZhangShuXiang + */ +@Component(Global.APP_SIGN + "StoreCache") +public class StoreCache extends CacheData { + + @Resource + private StoreService storeService; + + /** + * 获取门店信息列表 + */ + @SuppressWarnings("unchecked") + public List getAll(String tenantId) { + String key = CacheKeys.STORE_LIST.getKey(); + List list = null; + try { + Object cacheValue = CacheUtil.get(tenantId, key); + if (cacheValue == null) { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.order("no", "asc")); + criteria.add(Restrictions.limit("0",Global.DATA_LIMIT)); + list = storeService.getList(tenantId, criteria); + if (list != null) { + if ("571022".equals(tenantId)) { + List listTemp = new ArrayList<>(); + Store tempStore = null; + for (Store store : list) { + tempStore = new Store(); + tempStore.setTenantId(store.getTenantId()); + tempStore.setId(store.getId()); + tempStore.setNo(store.getNo()); + tempStore.setName(store.getName()); + tempStore.setEnabled(store.getEnabled()); + tempStore.setDeleteFlag(store.getDeleteFlag()); + tempStore.setAuthFlag(store.getAuthFlag()); + tempStore.setRegisterFlag(store.getRegisterFlag()); + listTemp.add(tempStore); + } + CacheUtil.set(tenantId, key, listTemp); + } else { + CacheUtil.set(tenantId, key, list); + } + + } + } else { + list = (List) cacheValue; + } + } catch (Exception ex) { + logger.error("StoreCache中getAll方法发生异常:", ex); + } + return list; + } + + /** + * 获取门店信息Map + */ + @SuppressWarnings("unchecked") + public Map getAllMap(String tenantId) { + String key = CacheKeys.STORE_MAP.getKey(); + Map map = null; + try { + Object cacheValue = CacheUtil.get(tenantId, key); + if (cacheValue == null) { + List list = getAll(tenantId); + if (list != null) { + map = new HashMap<>(); + for (Store data : list) { + map.put(data.getId(), data); + } + } + if (map != null) { + CacheUtil.set(tenantId, key, map); + } + } else { + map = (Map) cacheValue; + } + } catch (Exception ex) { + logger.error("StoreCache中getAllMap方法发生异常:", ex); + } + return map; + } + + /** + * 获取门店信息列表 + */ + public List getList(String tenantId, boolean isAll) { + String info = "获取门店信息列表"; + logger.debug(info); + + List list = null; + try { + list = getAll(tenantId); + if (list != null && !isAll) { + List temp = new ArrayList<>(); + for (Store data : list) { + if (data.getDeleteFlag() == 0) { + temp.add(data); + } + } + list = temp; + } + } catch (Exception ex) { + logger.error(info + "时,发生异常", ex); + } + return list; + } + + /** + * 获取可用的门店信息(不含总部,启用,已注册,已授权,未删除)列表 + */ + public List getAvailableList(String tenantId) { + String info = "获取门店信息列表"; + logger.debug(info); + + List list = null; + try { + list = getAll(tenantId); + if (list != null) { + List temp = new ArrayList<>(); + for (Store data : list) { + if (!data.getNo().equals("000000") && data.getDeleteFlag() == 0 && data.getEnabled() == 1 && data.getAuthFlag() == 1 && data.getRegisterFlag() == 1) { + temp.add(data); + } + } + list = temp; + } + } catch (Exception ex) { + logger.error(info + "时,发生异常", ex); + } + return list; + } + + /** + * 获取可用的门店信息(不含总部,启用,已注册,已授权,未删除)option HTML页面列表 + */ + public List getAvailableHTMLList(String tenantId) { + String info = "获取门店信息option列表"; + logger.debug(info); + + List list = getAll(tenantId); + List htmls = new ArrayList<>(); + try { + if (list != null) { + for (Store data : list) { + if (!data.getNo().equals("000000") && data.getDeleteFlag() == 0 && data.getEnabled() == 1 && data.getAuthFlag() == 1 && data.getRegisterFlag() == 1) { + htmls.add(""); + } + } + } + } catch (Exception ex) { + logger.error(info + "时,发生异常", ex); + } + return htmls; + } + + /** + * 根据门店Id,获取门店信息 + */ + public Store get(String tenantId, String storeId) { + String info = "获取门店信息"; + logger.debug(info); + Store data = null; + try { + Map allMap = getAllMap(tenantId); + data = allMap.get(storeId); + } catch (Exception ex) { + logger.error(info + "时,发生异常", ex); + } + return data; + } + + @Override + public void removeCacheData(String tenantId, Map extendInfo) { + CacheUtil.delete(tenantId, CacheKeys.STORE_LIST.getKey()); + CacheUtil.delete(tenantId, CacheKeys.STORE_MAP.getKey()); + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/config/ExpirationMessagePostProcessor.java b/food-open/food-open-api/src/main/java/com/jwsaas/config/ExpirationMessagePostProcessor.java new file mode 100644 index 0000000..3e9d4d0 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/config/ExpirationMessagePostProcessor.java @@ -0,0 +1,27 @@ +package com.jwsaas.config; + +import org.springframework.amqp.AmqpException; +import org.springframework.amqp.core.Message; +import org.springframework.amqp.core.MessagePostProcessor; + +/** + * 延时队列使用 + * @author yangaming + * + */ +public class ExpirationMessagePostProcessor implements MessagePostProcessor { + + private final Long ttl;//毫秒 + + public ExpirationMessagePostProcessor(Long ttl) { + this.ttl = ttl; + } + + + @Override + public Message postProcessMessage(Message message) throws AmqpException { + message.getMessageProperties().setExpiration(ttl.toString()); + return message; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/config/MQMessageSender.java b/food-open/food-open-api/src/main/java/com/jwsaas/config/MQMessageSender.java new file mode 100644 index 0000000..1ea55a6 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/config/MQMessageSender.java @@ -0,0 +1,63 @@ +package com.jwsaas.config; + +import java.util.Map; + +import org.springframework.amqp.core.MessagePostProcessor; +import org.springframework.amqp.rabbit.core.RabbitTemplate; +import org.springframework.amqp.rabbit.support.CorrelationData; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import com.jwsaas.util.JSONUtil; + +@Component +public class MQMessageSender { + + @Autowired + private RabbitTemplate rabbitTemplate; + + public void send4posmonitor(String tenantId, Map message, CorrelationData correlationData) throws Exception { + message.put("tenantId", tenantId); + this.rabbitTemplate.convertAndSend(RabbitConstant.EXCHANGE_NAME, RabbitConstant.ROUTING_KEY_POS_MONITOR, JSONUtil.toJSONString(message), correlationData); + } + + public void send4orderburden(String tenantId, Map message, CorrelationData correlationData) throws Exception { + message.put("tenantId", tenantId); + this.rabbitTemplate.convertAndSend(RabbitConstant.EXCHANGE_NAME, RabbitConstant.ROUTING_KEY_ORDER_BURDEN, JSONUtil.toJSONString(message), correlationData); + } + + public void send4businessorderplus(String tenantId, Map message, CorrelationData correlationData) throws Exception { + message.put("tenantId", tenantId); + this.rabbitTemplate.convertAndSend(RabbitConstant.EXCHANGE_NAME, RabbitConstant.ROUTING_KEY_BUSINESS_ORDER_PLUS, JSONUtil.toJSONString(message), correlationData); + } + + public void send4buslog(String tenantId, Map message, CorrelationData correlationData) throws Exception { + message.put("tenantId", tenantId); + this.rabbitTemplate.convertAndSend(RabbitConstant.EXCHANGE_NAME, RabbitConstant.ROUTING_KEY_BUSLOG, JSONUtil.toJSONString(message), correlationData); + } + + public void send4productsalestock(String tenantId, Map message, CorrelationData correlationData) throws Exception { + message.put("tenantId", tenantId); + this.rabbitTemplate.convertAndSend(RabbitConstant.EXCHANGE_NAME, RabbitConstant.ROUTING_KEY_PRODUCT_SALE_STOCK, JSONUtil.toJSONString(message), correlationData); + } + + public void send4programsalestock(String tenantId, Map message, CorrelationData correlationData) throws Exception { + message.put("tenantId", tenantId); + this.rabbitTemplate.convertAndSend(RabbitConstant.EXCHANGE_NAME, RabbitConstant.ROUTING_KEY_PROGRAM_SALE_STOCK, JSONUtil.toJSONString(message), correlationData); + } + + public void send4programwxmessage(String tenantId, Map message, CorrelationData correlationData) throws Exception { + message.put("tenantId", tenantId); + this.rabbitTemplate.convertAndSend(RabbitConstant.EXCHANGE_NAME, RabbitConstant.ROUTING_KEY_PROGRAM_WXMESSAGE, JSONUtil.toJSONString(message), correlationData); + } + + + /** + * 发送消息到send4jwprogramordermessage队列(巨为点餐小程序订单推送,延迟队列) + */ + public void send4jwprogramordermessage(String tenantId, Map message, String routingKey,CorrelationData correlationData, long ttl) throws Exception { + message.put("tenantId", tenantId); + MessagePostProcessor msgPostProcessor = new ExpirationMessagePostProcessor(ttl); + this.rabbitTemplate.convertAndSend(RabbitConstant.EXCHANGE_NAME, routingKey, JSONUtil.toJSONString(message), msgPostProcessor, correlationData); + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/config/MqttConfiguration.java b/food-open/food-open-api/src/main/java/com/jwsaas/config/MqttConfiguration.java new file mode 100644 index 0000000..e66c656 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/config/MqttConfiguration.java @@ -0,0 +1,50 @@ +package com.jwsaas.config; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import com.jwsaas.mqtt.MqttClientExt; + +@Configuration +public class MqttConfiguration { + + @Value("${mqtt.clientId:clientId}") + private String clientId; + + @Value("${mqtt.host:0.0.0.0}") + private String mqttHost; + + @Value("${mqtt.port:1883}") + private Integer mqttPort; + + @Value("${mqtt.keepalive:60}") + private int keepAlive; + + @Value("${mqtt.connection.timeout:10}") + private Integer connectionTimeout; + + @Value("${mqtt.username:admin}") + private String userName; + + @Value("${mqtt.passwd:admin}") + private String passwd; + + @Bean(initMethod = "init") + public MqttClientExt mqttClient() { + + MqttClientExt mqttClient = new MqttClientExt(); + + mqttClient.setClientId(clientId); + + mqttClient.setHost(mqttHost); + mqttClient.setPort(mqttPort); + mqttClient.setKeepAlive(keepAlive); + mqttClient.setConnectionTimeout(connectionTimeout); + mqttClient.setUserName(userName); + mqttClient.setPasswd(passwd); + + return mqttClient; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/config/OpenApiProperties.java b/food-open/food-open-api/src/main/java/com/jwsaas/config/OpenApiProperties.java new file mode 100644 index 0000000..6dd5756 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/config/OpenApiProperties.java @@ -0,0 +1,80 @@ +package com.jwsaas.config; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; + +public class OpenApiProperties { + public String tenantId; + + public String serverUrl; + + public String serverExtendUrl; + + public String appKey; + + public String appSecret; + + public String format; + + public String version; + + public String locale; + + public String client; + + public OpenApiProperties(String apis) { + JSONObject obj = JSON.parseObject(apis); + this.tenantId = obj.get("tenantId") != null ? obj.getString("tenantId") : null; + this.serverUrl = obj.get("url") != null ? obj.getString("url") : null; + this.serverExtendUrl = obj.get("extendUrl") != null ? obj.getString("extendUrl") : null; + this.appKey = obj.get("appKey") != null ? obj.getString("appKey") : null; + this.appSecret = obj.get("appSecret") != null ? obj.getString("appSecret") : null; + this.format = obj.get("format") != null ? obj.getString("format") : null; + this.version = obj.get("version") != null ? obj.getString("version") : null; + this.locale = obj.get("locale") != null ? obj.getString("locale") : null; + this.client = obj.get("client") != null ? obj.getString("client") : null; + } + + public String getTenantId() { + return tenantId; + } + + public String getServerUrl() { + return serverUrl; + } + + public String getServerExtendUrl() { + return serverExtendUrl; + } + + public String getAppKey() { + return appKey; + } + + public String getAppSecret() { + return appSecret; + } + + public String getFormat() { + return format; + } + + public String getVersion() { + return version; + } + + public String getLocale() { + return locale; + } + + public String getClient() { + return client; + } + + @Override + public String toString() { + return "OpenApiProperties [serverUrl=" + serverUrl + ", appKey=" + appKey + ", appSecret=" + appSecret + ", format=" + format + ", version=" + version + ", locale=" + locale + ", client=" + + client + "]"; + } + +} \ No newline at end of file diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/config/OpenCardApiProperties.java b/food-open/food-open-api/src/main/java/com/jwsaas/config/OpenCardApiProperties.java new file mode 100644 index 0000000..1e783c0 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/config/OpenCardApiProperties.java @@ -0,0 +1,34 @@ +package com.jwsaas.config; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; + +public class OpenCardApiProperties extends OpenApiProperties{ + private String posNo; + + public OpenCardApiProperties(String apis) { + super(apis); + + JSONObject obj = JSON.parseObject(apis); + this.posNo = obj.get("posNo") != null ? obj.getString("posNo") : null; + + } + + + public String getPosNo() { + return posNo; + } + + + public void setPosNo(String posNo) { + this.posNo = posNo; + } + + + @Override + public String toString() { + return "OpenApiProperties [serverUrl=" + serverUrl + ", appKey=" + appKey + ", appSecret=" + appSecret + ", format=" + format + ", version=" + version + ", locale=" + locale + ", client=" + + client + ", posNo="+ posNo + "]"; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/config/RabbitConstant.java b/food-open/food-open-api/src/main/java/com/jwsaas/config/RabbitConstant.java new file mode 100644 index 0000000..718b724 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/config/RabbitConstant.java @@ -0,0 +1,46 @@ +package com.jwsaas.config; + +public class RabbitConstant { + + public final static String EXCHANGE_NAME = "exchange";// 交换器 + + public final static String QUEUE_NAME_POS_MONITOR = "queue4posmonitor";// POS监控 + + public final static String ROUTING_KEY_POS_MONITOR = "routing4posmonitor";// POS监控 + + + public final static String QUEUE_NAME_ORDER_BURDEN = "queue4orderburden";// 库存扣减 + + public final static String ROUTING_KEY_ORDER_BURDEN = "routing4orderburden";// 库存扣减 + + + public final static String QUEUE_NAME_BUSINESS_ORDER_PLUS = "queue4businessorderplus";// 销售数据上传 + + public final static String ROUTING_KEY_BUSINESS_ORDER_PLUS = "routing4businessorderplus";// 销售数据上传 + + + public final static String QUEUE_NAME_BUSLOG = "queue4buslog";// 操作日志上传 + + public final static String ROUTING_KEY_BUSLOG = "routing4buslog";// 操作日志上传 + + + public final static String QUEUE_NAME_PRODUCT_SALE_STOCK = "queue4productsalestock";// 门店商品库存扣减 + + public final static String ROUTING_KEY_PRODUCT_SALE_STOCK = "routing4productsalestock";// 门店商品库存扣减 + + + public final static String QUEUE_NAME_PROGRAM_SALE_STOCK = "queue4programsalestock";// 小程序门店商品库存扣减 + + public final static String ROUTING_KEY_PROGRAM_SALE_STOCK = "routing4programsalestock";// 小程序门店商品库存扣减 + + + public final static String QUEUE_NAME_PROGRAM_WXMESSAGE = "queue4programwxmessage";// 小程序发送模板消息通知 + + public final static String ROUTING_KEY_PROGRAM_WXMESSAGE = "routing4programwxmessage";// 小程序发送模板消息通知 + + + public static final String ROUTING_KEY_JW_PROGRAM_ORDER_NOTIFY_DELAY = "routing4jwprogramordernotifydelay";//巨为小程序订单延时推送 + public static final String QUEUE_NAME_JW_PROGRAM_ORDER_DELAY = "queue4jwprogramorderdelay";//巨为小程序订单推送延时队列; + public static final String ROUTING_KEY_JW_PROGRAM_ORDER_NOTIFY = "routing4jwprogramordernotify";//巨为小程序订单推送; + public static final String QUEUE_NAME_JW_PROGRAM_ORDER_NOTIFY = "queue4jwprogramordernotify";//巨为小程序订单推送队列; +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/config/RabbitMQConfig.java b/food-open/food-open-api/src/main/java/com/jwsaas/config/RabbitMQConfig.java new file mode 100644 index 0000000..f1c2080 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/config/RabbitMQConfig.java @@ -0,0 +1,182 @@ +package com.jwsaas.config; + +import org.springframework.amqp.core.Binding; +import org.springframework.amqp.core.BindingBuilder; +import org.springframework.amqp.core.DirectExchange; +import org.springframework.amqp.core.Queue; +import org.springframework.amqp.core.QueueBuilder; +import org.springframework.amqp.rabbit.connection.CachingConnectionFactory; +import org.springframework.amqp.rabbit.connection.ConnectionFactory; +import org.springframework.amqp.rabbit.core.RabbitTemplate; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.beans.factory.config.ConfigurableBeanFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Scope; + +@Configuration +public class RabbitMQConfig { + + @Value("${spring.rabbitmq.host}") + private String host; + + @Value("${spring.rabbitmq.port}") + private String port; + + @Value("${spring.rabbitmq.username}") + private String username; + + @Value("${spring.rabbitmq.password}") + private String password; + + @Value("${spring.rabbitmq.publisher-confirms}") + private Boolean publisherConfirms; + + @Value("${spring.rabbitmq.virtual-host}") + private String virtualHost; + + // 创建工厂连接 + @Bean + public ConnectionFactory connectionFactory() { + CachingConnectionFactory connectionFactory = new CachingConnectionFactory(); + connectionFactory.setAddresses(this.host); + connectionFactory.setUsername(this.username); + connectionFactory.setPassword(this.password); + connectionFactory.setVirtualHost(this.virtualHost); + /** 如果要进行消息回调,则这里必须要设置为true */ + connectionFactory.setPublisherConfirms(this.publisherConfirms); // 必须要设置 + return connectionFactory; + } + + // rabbitmq的模板配置 + @Bean + @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) // 必须是prototype类型(因为要设置回调类,所以应是prototype类型,如果是singleton类型,则回调类为最后一次设置) + public RabbitTemplate rabbitTemplate() { + RabbitTemplate template = new RabbitTemplate(this.connectionFactory()); + // template.setConfirmCallback(); 设置消息确认 + // template.setReturnCallback(); + return template; + } + + // 直连交换机 + @Bean + public DirectExchange defaultExchange() { + return new DirectExchange(RabbitConstant.EXCHANGE_NAME); + } + + // 队列-POS监控 + @Bean(name = "queue4posmonitor") + public Queue queue4posmonitor() { + return QueueBuilder.durable(RabbitConstant.QUEUE_NAME_POS_MONITOR).build(); + } + + // 绑定-POS监控 + @Bean(name = "binding4posmonitor") + public Binding binding4posmonitor() { + return BindingBuilder.bind(this.queue4posmonitor()).to(this.defaultExchange()).with(RabbitConstant.ROUTING_KEY_POS_MONITOR); + } + + // 队列-耗料上传 + @Bean(name = "queue4orderburden") + public Queue queue4orderburden() { + return QueueBuilder.durable(RabbitConstant.QUEUE_NAME_ORDER_BURDEN).build(); + } + + // 绑定-耗料上传 + @Bean(name = "binding4orderburden") + public Binding binding4orderburden() { + return BindingBuilder.bind(this.queue4orderburden()).to(this.defaultExchange()).with(RabbitConstant.ROUTING_KEY_ORDER_BURDEN); + } + + // 队列-销售数据上传 + @Bean(name = "queue4businessorderplus") + public Queue queue4businessorderplus() { + return QueueBuilder.durable(RabbitConstant.QUEUE_NAME_BUSINESS_ORDER_PLUS).build(); + } + + // 绑定-销售数据上传 + @Bean(name = "binding4businessorderplus") + public Binding binding4businessorderplus() { + return BindingBuilder.bind(this.queue4businessorderplus()).to(this.defaultExchange()).with(RabbitConstant.ROUTING_KEY_BUSINESS_ORDER_PLUS); + } + + // 队列-操作日志上传 + @Bean(name = "queue4buslog") + public Queue queue4buslog() { + return QueueBuilder.durable(RabbitConstant.QUEUE_NAME_BUSLOG).build(); + } + + // 绑定-操作日志上传 + @Bean(name = "binding4buslog") + public Binding binding4buslog() { + return BindingBuilder.bind(this.queue4buslog()).to(this.defaultExchange()).with(RabbitConstant.ROUTING_KEY_BUSLOG); + } + + // 队列-库存扣减上传 + @Bean(name = "queue4productsalestock") + public Queue queue4productsalestock() { + return QueueBuilder.durable(RabbitConstant.QUEUE_NAME_PRODUCT_SALE_STOCK).build(); + } + + // 队列-库存扣减上传 + @Bean(name = "binding4productsalestock") + public Binding binding4productsalestock() { + return BindingBuilder.bind(this.queue4productsalestock()).to(this.defaultExchange()).with(RabbitConstant.ROUTING_KEY_PRODUCT_SALE_STOCK); + } + + // 队列-小程序商品库存扣减上传 + @Bean(name = "queue4programsalestock") + public Queue queue4programsalestock() { + return QueueBuilder.durable(RabbitConstant.QUEUE_NAME_PROGRAM_SALE_STOCK).build(); + } + + // 队列-小程序商品库存减上传 + @Bean(name = "binding4programsalestock") + public Binding binding4programsalestock() { + return BindingBuilder.bind(this.queue4programsalestock()).to(this.defaultExchange()).with(RabbitConstant.ROUTING_KEY_PROGRAM_SALE_STOCK); + } + + // 队列-小程序发送微信消息模板 + @Bean(name = "queue4programwxmessage") + public Queue queue4programwxmessage() { + return QueueBuilder.durable(RabbitConstant.QUEUE_NAME_PROGRAM_WXMESSAGE).build(); + } + + // 队列-小程序发送微信消息模板 + @Bean(name = "binding4programwxmessage") + public Binding binding4programwxmessage() { + return BindingBuilder.bind(this.queue4programwxmessage()).to(this.defaultExchange()).with(RabbitConstant.ROUTING_KEY_PROGRAM_WXMESSAGE); + } + + + + /** + * 延迟队列 + */ + @Bean(name = "queue4jwprogramorder4delay") + public Queue queue4jwprogramorder4delay() { + return QueueBuilder.durable(RabbitConstant.QUEUE_NAME_JW_PROGRAM_ORDER_DELAY) + .withArgument("x-dead-letter-exchange", RabbitConstant.EXCHANGE_NAME) + .withArgument("x-dead-letter-routing-key", RabbitConstant.ROUTING_KEY_JW_PROGRAM_ORDER_NOTIFY) + .build(); + } + + @Bean(name = "binding4jwprogramorder4delay") + public Binding binding4jwprogramorder4delay() { + return BindingBuilder.bind(this.queue4jwprogramorder4delay()).to(this.defaultExchange()).with(RabbitConstant.ROUTING_KEY_JW_PROGRAM_ORDER_NOTIFY_DELAY); + } + + + // 队列-巨为小程序订单信息推送 + @Bean(name = "queue4jwprogramordernotify") + public Queue queue4jwprogramordernotify() { + return QueueBuilder.durable(RabbitConstant.QUEUE_NAME_JW_PROGRAM_ORDER_NOTIFY).build(); + } + + // 队列-巨为小程序订单信息推送 + @Bean(name = "binding4jwprogramordernotify") + public Binding binding4jwprogramordernotify() { + return BindingBuilder.bind(this.queue4jwprogramordernotify()).to(this.defaultExchange()).with(RabbitConstant.ROUTING_KEY_JW_PROGRAM_ORDER_NOTIFY); + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/config/ReactorConfiguration.java b/food-open/food-open-api/src/main/java/com/jwsaas/config/ReactorConfiguration.java new file mode 100644 index 0000000..129f57e --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/config/ReactorConfiguration.java @@ -0,0 +1,39 @@ +package com.jwsaas.config; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import reactor.Environment; +import reactor.bus.EventBus; +import reactor.core.Dispatcher; +import reactor.core.dispatch.WorkQueueDispatcher; +import reactor.fn.Consumer; + +@Configuration +public class ReactorConfiguration { + + private static Logger logger = LoggerFactory.getLogger(ReactorConfiguration.class); + +// @Bean +// public EventBus eventBus(Environment environment) { +// // Dispatcher dispatcher = new ThreadPoolExecutorDispatcher(8, 2048); +// // Dispatcher dispatcher = new +// // WorkQueueDispatcher("workQueueDispatcher", 12, 2048, new +// // Consumer() { +// // +// // @Override +// // public void accept(Throwable t) { +// // logger.error("workQueueDispatcher分发后的任务执行失败......"); +// // logger.error("workQueueDispatcher分发后的任务执行失败!", t); +// // } +// // +// // }); +// // return EventBus.create(environment, dispatcher); +// +// logger.error("......environment.DefaultDispatcher:"+environment.getDefaultDispatcher()); +// return EventBus.create(environment); +// } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/config/RedissonConfiguration.java b/food-open/food-open-api/src/main/java/com/jwsaas/config/RedissonConfiguration.java new file mode 100644 index 0000000..c8877e3 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/config/RedissonConfiguration.java @@ -0,0 +1,73 @@ +package com.jwsaas.config; + +import org.apache.commons.lang3.StringUtils; +import org.redisson.Redisson; +import org.redisson.api.RedissonClient; +import org.redisson.config.Config; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import com.jwsaas.properties.RedisProperties; + +@Configuration +@EnableConfigurationProperties(RedisProperties.class) +public class RedissonConfiguration { + + private static Logger logger = LoggerFactory.getLogger(RedissonConfiguration.class); + + @Autowired + private RedisProperties properties; + + private enum RedisType { + SINGLE("single"); + + private String stringValue; + + RedisType(String s) { + stringValue = s; + } + + public String getStringValue() { + return stringValue; + } + } + + @Bean(destroyMethod = "shutdown") + public RedissonClient redissonClient() { + + RedissonClient redissonClient = null; + try { + Config config = new Config(); + + if (StringUtils.isBlank(properties.getType()) || StringUtils.equalsIgnoreCase(RedisType.SINGLE.getStringValue(), properties.getType())) { + String redisUrl = properties.getHost() + ":" + properties.getPort(); + config.useSingleServer().setAddress(redisUrl); + config.useSingleServer().setDatabase(properties.getDatabase());// (数据库编号),默认值:0,尝试连接的数据库编号。 + config.useSingleServer().setTimeout(properties.getTimeout());// (命令等待超时,单位:毫秒),默认值:3000,等待节点回复命令的时间。该时间从命令发送成功时开始计时。 + config.useSingleServer().setConnectTimeout(properties.getTimeout());// (连接超时,单位:毫秒),默认值:10000,同节点建立连接时的等待超时。时间单位是毫秒。 + config.useSingleServer().setSubscriptionConnectionPoolSize(50);// (发布和订阅连接池大小),默认值:50,用于发布和订阅连接的连接池最大容量。连接池的连接数量自动弹性伸缩。 + config.useSingleServer().setConnectionPoolSize(64);// (连接池大小),默认值:64,连接池最大容量。连接池的连接数量自动弹性伸缩。 + + if (StringUtils.isNotBlank(properties.getPassword())) { + config.useSingleServer().setPassword(properties.getPassword()); + } + + //数据序列化 + // Redis key/value codec. Default is json-codec + // config.setCodec(codec); + } + + redissonClient = Redisson.create(config); + + } catch (Exception e) { + logger.error("redissonClient init Exception", e); + } + + return redissonClient; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/config/SchedulingConfiguration.java b/food-open/food-open-api/src/main/java/com/jwsaas/config/SchedulingConfiguration.java new file mode 100644 index 0000000..31ab7ce --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/config/SchedulingConfiguration.java @@ -0,0 +1,26 @@ +package com.jwsaas.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.TaskScheduler; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; + +@EnableScheduling +@Configuration +public class SchedulingConfiguration { + + /** + * [DEBUG] org.springframework.scheduling.annotation. + * ScheduledAnnotationBeanPostProcessor - Could not find default TaskScheduler bean + * org.springframework.beans.factory.NoSuchBeanDefinitionException: No + * qualifying bean of type [org.springframework.scheduling.TaskScheduler] is defined + */ + @Bean + public static TaskScheduler taskScheduler() { + ThreadPoolTaskScheduler threadPoolTaskScheduler = new ThreadPoolTaskScheduler(); + threadPoolTaskScheduler.setPoolSize(8); + return threadPoolTaskScheduler; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/controller/BaseController.java b/food-open/food-open-api/src/main/java/com/jwsaas/controller/BaseController.java new file mode 100644 index 0000000..f9b792f --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/controller/BaseController.java @@ -0,0 +1,36 @@ +package com.jwsaas.controller; + +import javax.servlet.http.HttpServletRequest; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public abstract class BaseController { + + protected Logger logger = LoggerFactory.getLogger(getClass()); + + // 获取Parameter + public String getParameter(HttpServletRequest request, String name) { + return request.getParameter(name); + } + + // 获取Parameter数组 + public String[] getParameterValues(HttpServletRequest request, String name) { + return request.getParameterValues(name); + } + + public String getIpAddress(HttpServletRequest request) { + String ip = request.getHeader("x-forwarded-for"); + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("Proxy-Client-IP"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("WL-Proxy-Client-IP"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getRemoteAddr(); + } + return ip; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/controller/IndexController.java b/food-open/food-open-api/src/main/java/com/jwsaas/controller/IndexController.java new file mode 100644 index 0000000..36787c3 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/controller/IndexController.java @@ -0,0 +1,15 @@ +package com.jwsaas.controller; + +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; + +@Controller +public class IndexController extends BaseController { + + @RequestMapping(value = { "", "index" }) + public String index(Model model) { + return "index"; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/controller/callback/CallBackController.java b/food-open/food-open-api/src/main/java/com/jwsaas/controller/callback/CallBackController.java new file mode 100644 index 0000000..0fadeda --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/controller/callback/CallBackController.java @@ -0,0 +1,2249 @@ +package com.jwsaas.controller.callback; + +import java.io.BufferedReader; +import java.io.IOException; +import java.text.DateFormat; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import com.jwsaas.api.entity.program.ProgramStorePayEntity; +import com.jwsaas.config.RabbitConstant; +import com.jwsaas.entity.food.*; +import com.jwsaas.service.food.*; +import com.jwsaas.util.SybUtil; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.io.input.XmlStreamReader; +import org.apache.commons.lang3.StringUtils; +import org.dom4j.Document; +import org.dom4j.DocumentHelper; +import org.dom4j.Element; +import org.redisson.api.RLock; +import org.redisson.api.RMapCache; +import org.redisson.api.RedissonClient; +import org.springframework.amqp.rabbit.support.CorrelationData; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.util.FileCopyUtils; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.serializer.SerializerFeature; +import com.jwsaas.Constant; +import com.jwsaas.Constants; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.config.MQMessageSender; +import com.jwsaas.controller.open.BaseOpenController; +import com.jwsaas.entity.wxdc.WeixinOrderPay; +import com.jwsaas.http.HttpTool; +import com.jwsaas.mqtt.MqttClientExt; +import com.jwsaas.open.Global; +import com.jwsaas.pay.weixin.request.PayNotifyRequest; +import com.jwsaas.pay.weixin.response.PayNotifyResponse; +import com.jwsaas.reactor.event.EventKeys; +import com.jwsaas.service.wxdc.WeixinOrderPayService; +import com.jwsaas.util.JSONUtil; +import com.jwsaas.util.URLDecodedUtil; +import com.jwsaas.util.XStreamUtils; +import com.jwsaas.weixin.SignUtil; + +import reactor.bus.Event; +import reactor.bus.EventBus; + +/** + * 支付回调接口 + */ +@Controller(Global.SIGN + "CallBackController") +@RequestMapping(Global.OPEN_PATH + "/api/extend/callBack") +public class CallBackController extends BaseOpenController { + + @Autowired + protected EventBus eventBus; + + @Resource + private StoreAccountRechargeRecordService storeAccountRechargeRecordService; + @Resource + private WeixinOrderPayService weixinOrderPayService; + + @Resource + private WxPaymentParameterService wxPaymentParameterService; + + @Resource + private com.jwsaas.service.food.VposStoreBusinessTicketService vposStoreBusinessTicketService; + + @Resource + private com.jwsaas.service.food.VposStoreBusinessTicketInfoService vposStoreBusinessTicketInfoService; + + @Resource + private com.jwsaas.service.food.VposStoreOrderProductService vposStoreOrderProductService; + + @Resource + private com.jwsaas.service.food.VposStoreOrderProductInfoService vposStoreOrderProductInfoService; + + @Resource + private com.jwsaas.service.food.VposStoreOrderProductMakeService vposStoreOrderProductMakeService; + + @Resource + private com.jwsaas.service.food.ProgramStoreBusinessTicketService programStoreBusinessTicketService; + @Resource + private com.jwsaas.service.food.SplitStorePayService splitStorePayService; + @Resource + private com.jwsaas.cache.CacheService cacheService; + + @Resource + private StoreAccountRechargeParameterService storeAccountRechargeParameterService; + @Resource + private com.jwsaas.service.food.SplitShopWithdrawalService splitShopWithdrawalService; + @Resource + private MQMessageSender mqMessageSender; + + @Resource + private MqttClientExt mqttClient; + + @Resource + private RedissonClient redissonClient; + + @RequestMapping(value = "{type}", method = { RequestMethod.POST, RequestMethod.GET }) + @ResponseBody + public Object index(@PathVariable String type, HttpServletRequest request, HttpServletResponse response, Model model) { + String info = "支付回调接口 type:" + type; + logger.info(info); + + PayNotifyResponse payNotifyResponse = new PayNotifyResponse(); + try { + if (StringUtils.isBlank(type)) { + payNotifyResponse.setReturnCode("FAIL"); + payNotifyResponse.setReturnMsg("ERROR"); + logger.error(info + " 缺少必要参数type"); + } else { + switch (type.toLowerCase()) { + + case "weixinnotify": + payNotifyResponse = weixinnotify(request); + break; + case "wxdcwxnotify": + // 微信点餐回调 + payNotifyResponse = wxdcWxNotify(request); + break; + case "fuyouwxnotify": + // 富友支付异步通知; + payNotifyResponse = fuyouWxNotify(request, response); + break; + case "saobeiwxnotify": + // 扫呗异步通知; + payNotifyResponse = saobeiWxNotify(request, response); + break; + case "tonglianprogramnotify": + // 通联支付异步通知; + payNotifyResponse = tonglianNotify(request, response); + Map map11 = new HashMap<>(); + map11.put("return_code", payNotifyResponse.getReturnCode()); + map11.put("return_msg", payNotifyResponse.getReturnMsg()); + //return JSONUtil.toJSONString(map11); + return "success"; + case "signalagentpayotify": + // 通联单笔托管代付异步通知; + payNotifyResponse = tongliansingalNotify(request, response); + Map map12 = new HashMap<>(); + map12.put("return_code", payNotifyResponse.getReturnCode()); + map12.put("return_msg", payNotifyResponse.getReturnMsg()); + //return JSONUtil.toJSONString(map12); + return "success"; + case "withdrawapplynotify": + // 通联提现异步通知; + payNotifyResponse = withdrawapplyNotify(request, response); + Map map13 = new HashMap<>(); + map13.put("return_code", payNotifyResponse.getReturnCode()); + map13.put("return_msg", payNotifyResponse.getReturnMsg()); + return JSONUtil.toJSONString(map13); + case "ocrcomparisonresult": + // 通联影印件审核结果通知; + payNotifyResponse = ocrComparisonResult(request, response); + Map map14 = new HashMap<>(); + map14.put("return_code", payNotifyResponse.getReturnCode()); + map14.put("return_msg", payNotifyResponse.getReturnMsg()); + return JSONUtil.toJSONString(map14); + case "signacctprotocol": + // 通联收款方提现协议签约审核结果通知; + payNotifyResponse = signAcctProtocol(request, response); + Map map15 = new HashMap<>(); + map15.put("return_code", payNotifyResponse.getReturnCode()); + map15.put("return_msg", payNotifyResponse.getReturnMsg()); + return JSONUtil.toJSONString(map15); + case "companynotify": + // 企业信息审核结果通知; + payNotifyResponse = companyNotify(request, response); + break; + case "ocrComparisonnotify": + // 影印件审核结果通知; + payNotifyResponse = ocrComparisonNotify(request, response); + break; + case "ccbwxnotify": + // 建行异步通知; + payNotifyResponse = ccbWxNotify(request, response); + break; + case "saobeigcwxnotify": + // 扫呗美食广场项目回调; + payNotifyResponse = saoBeiGcWxNotify(request, response); + Map map = new HashMap<>(); + map.put("return_code", payNotifyResponse.getReturnCode()); + map.put("return_msg", payNotifyResponse.getReturnMsg()); + return JSONUtil.toJSONString(map); + case "saobeiprogramnotify": + // 扫呗小程序项目回调; + payNotifyResponse = saoBeiProgramNotify(request, response); + Map map1 = new HashMap<>(); + map1.put("return_code", payNotifyResponse.getReturnCode()); + map1.put("return_msg", payNotifyResponse.getReturnMsg()); + return JSONUtil.toJSONString(map1); + case "saobeistoreaccountrechargenotify": + // 扫呗异步通知; + payNotifyResponse = saobeiStoreAccountRechargeNotify(request, response); + Map map2 = new HashMap<>(); + map2.put("return_code", payNotifyResponse.getReturnCode()); + map2.put("return_msg", payNotifyResponse.getReturnMsg()); + return JSONUtil.toJSONString(map2); + case "jwprogramcardpayinfo": + //巨为小程序会员支付成功后,支付信息回调上传; + payNotifyResponse = jwProgramCardPayInfo(request, response); + Map map3 = new HashMap<>(); + map3.put("return_code", payNotifyResponse.getReturnCode()); + map3.put("return_msg", payNotifyResponse.getReturnMsg()); + return JSONUtil.toJSONString(map3); + default: + payNotifyResponse.setReturnCode("FAIL"); + payNotifyResponse.setReturnMsg("ERROR"); + logger.error(info + " 参数type错误"); + } + } + + } catch (Exception e) { + payNotifyResponse.setReturnCode("FAIL"); + payNotifyResponse.setReturnMsg("ERROR"); + + logger.error(info + ",业务处理时发生异常", e); + } + + return XStreamUtils.toXml(payNotifyResponse); + } + + private PayNotifyResponse jwProgramCardPayInfo(HttpServletRequest request, HttpServletResponse response) { + String info = "巨为小程序会员支付成功后,支付信息回调上传"; + PayNotifyResponse payNotifyResponse = new PayNotifyResponse(); + String programId = request.getParameter("programId"); + String busNo = request.getParameter("busNo"); + String tenantId = request.getParameter("tenantId"); + RLock lock = redissonClient.getLock(tenantId+"-"+busNo); + try{ + lock.lock(5, TimeUnit.SECONDS); + + String jsonString = request.getParameter("jsonString"); + Object busNoKey = cacheService.get(tenantId,busNo); + if(busNoKey != null && busNo.equals((String)busNoKey)){ + payNotifyResponse.setReturnCode("01"); + payNotifyResponse.setReturnMsg("SUCCESS"); + return payNotifyResponse; + }else{ + cacheService.set(tenantId,busNo,busNo,60*60*12); + } + + JSONObject json = JSONObject.parseObject(jsonString); + ProgramStorePayEntity storePayEntity = new ProgramStorePayEntity(json); + ProgramStoreBusinessTicket enity = programStoreBusinessTicketService.find(tenantId, "no", busNo); + if (enity == null) { + payNotifyResponse.setReturnCode("00"); + payNotifyResponse.setReturnMsg("failed"); + return payNotifyResponse; + } + if(0 == enity.getStatus()){ + payNotifyResponse.setReturnCode("01"); + payNotifyResponse.setReturnMsg("SUCCESS"); + return payNotifyResponse; + } + new DecimalFormat("0.00").format(enity.getReceivable()); + // 支付金额= 订单应收+餐盒费+配送费 + if (!new DecimalFormat("0.00").format(enity.getReceivable() + enity.getPackageFee() + enity.getDeliverFee()).equals(new DecimalFormat("0.00").format(storePayEntity.getPaid()))) { + payNotifyResponse.setReturnCode("00"); + payNotifyResponse.setReturnMsg("failed"); + return payNotifyResponse; + } + // 生成取餐号 + DateFormat fmt = new SimpleDateFormat("yyyyMMdd"); + String day = fmt.format(new Date()); + String key = "wxBus:" + tenantId + ":" + enity.getStoreId() + ":" + day; + cacheService.setQueue(tenantId, key, enity.getNo(), 60 * 60 * 24); + //int random = (int) (Math.random() * 10 + 1); + String datSeq = ""; + //按南宁要求,取餐号为 600-799 2020-04-10 13:49 + if(StringUtils.startsWith(tenantId,"77")){ + int queueSize = cacheService.getQueueSize(tenantId, key); + int daySize = queueSize + 600; + logger.error("单号:" + enity.getNo() + " queueSize =============>" + queueSize); + if(daySize >= 800){ + int index = queueSize / 200; + daySize = daySize-200*index; + logger.error("单号:" + enity.getNo() + " daySize =============>" + daySize); + } + datSeq = daySize+""; + }else{ + String random = "0"; + String busMode = "T"; + if (enity.getBusMode() == 0) { + busMode = "T"; + } else if (enity.getBusMode() == 1) { + busMode = "D"; + } else if (enity.getBusMode() == 2) { + busMode = "Y"; + } else { + busMode = "W"; + } + String suffix = String.format("%0" + 3 + "d", cacheService.getQueueSize(tenantId, key)); + + if(suffix.length() > 3){ + datSeq = busMode + suffix; + }else{ + datSeq = busMode + random + suffix; + } + } + logger.error("单号:" + enity.getNo() + "=============>" + datSeq); + enity.setSeqNo(datSeq);// 取餐号 + enity.setStatus(0);// 更改主单为待接单状态 + enity.setIsMember(1); + // 门店菜品销售记录优惠明细校验开始 + List payList = new ArrayList<>(); + Date createDate = new Date(); + ProgramStorePay storePay = new ProgramStorePay(); + storePay.setProgramId(programId); + storePay.setCreateDate(createDate); + storePay.setCreateUser("open-api"); + storePay.setClientId(enity.getClientId()); + storePay.setStoreId(enity.getStoreId()); + storePay.setStoreNo(enity.getStoreNo()); + storePay.setStoreName(enity.getStoreName()); + storePay.setBusNo(enity.getNo()); + storePay.setBusMode(enity.getBusMode()); + storePay.setPayNo(enity.getNo()); + storePay.setTableNo(enity.getTableNo()); + storePay.setPayTypeNo(storePayEntity.getPayTypeNo()); + storePay.setPayType(storePayEntity.getPayType()); + storePay.setMemo("支付成功"); + storePay.setPayDate(createDate); + storePay.setPaid(storePayEntity.getPaid()); + storePay.setRchange(0.00); + storePay.setMoney(storePayEntity.getMoney()); + storePay.setOverAmount(0.00); + storePay.setVoucherNo(storePayEntity.getVoucherNo()); + storePay.setCardno(storePayEntity.getCardno()); + storePay.setCardYe(storePayEntity.getCardYe()); + storePay.setCardJf(storePayEntity.getCardJf()); + storePay.setIncomeFlag(1); + storePay.setOtherRateType(0); + storePay.setOtherRateValue(0.00); + storePay.setOtherRate(0.00); + storePay.setPayChannel(-1);// 会员卡支付 + storePay.setDeductionRate(enity.getDeductionRate()); + storePay.setChargeBack(enity.getChargeBack()); + storePay.setSettleFlag(0); + payList.add(storePay); + StoreBusinessTicketCheck ticketCheck = programStoreBusinessTicketService.updateBusinessTicket(tenantId, enity, payList); + if ("1".equals(ticketCheck.getStatus())) { + // 门店信消息压进缓存 + try { + Object programOrderIds = cacheService.get(tenantId, "program_" + enity.getStoreId()); + if (programOrderIds != null) { + Map orderIds = (Map) cacheService.get(tenantId, "program_" + enity.getStoreId()); + orderIds.put(String.valueOf(enity.getNo()), String.valueOf(enity.getNo())); + cacheService.set(tenantId, "program_" + enity.getStoreId(), orderIds, 0); + } else { + Map orderIds = new HashMap<>(); + orderIds.put(String.valueOf(enity.getNo()), String.valueOf(enity.getNo())); + cacheService.set(tenantId, "program_" + enity.getStoreId(), orderIds, 0); + } + } catch (Exception e) { + logger.error(info + "创建订单推送创建缓存失败>>>>>>>>>>"); + } + // 前台阿布订阅模型 + sendProgramMessage("cy2", tenantId, enity.getStoreId()); + Map orderMap = new HashMap<>(); + orderMap.put("tenantId",tenantId); + orderMap.put("storeId",enity.getStoreId()); + orderMap.put("orderNo",enity.getNo()); + orderMap.put("reSendNums",0); + this.mqMessageSender.send4jwprogramordermessage(tenantId,orderMap, RabbitConstant.ROUTING_KEY_JW_PROGRAM_ORDER_NOTIFY_DELAY,new CorrelationData(UUID.randomUUID().toString()),1000L*90); + // 启动退款定时任务,3分钟不接单自动退款 + Map eventDatas = new HashMap<>(); + eventDatas.put("tenantId", tenantId); + eventDatas.put("storeId", enity.getStoreId()); + eventDatas.put("busNo", busNo); + eventBus.notify(EventKeys.PROGRAM_ORDER_PAY, Event.wrap(eventDatas)); + Map data = new HashMap<>(); + data.put("busNo", enity.getNo()); + data.put("ticketId", ticketCheck.getTicketId()); + payNotifyResponse.setReturnCode("01"); + payNotifyResponse.setReturnMsg("success"); + return payNotifyResponse; + } else { + payNotifyResponse.setReturnCode("00"); + payNotifyResponse.setReturnMsg("failed"); + return payNotifyResponse; + } + + }catch (Exception e){ + logger.error(info + ",业务处理时发生异常", e); + }finally { + lock.unlock(); + } + + return payNotifyResponse; + } + + /** + * 配送账户余额充值-扫呗支付异步通知 + * @param request + * @param response + * @return + */ + private PayNotifyResponse saobeiStoreAccountRechargeNotify(HttpServletRequest request, HttpServletResponse response) { + + String info = "配送账户余额充值-扫呗支付异步通知 notify "; + logger.error(info + " request:{} use {} method invoking", request.getRequestURL(), request.getMethod()); + + PayNotifyResponse payNotifyResponse = new PayNotifyResponse(); + try { + BufferedReader br = request.getReader(); + String str, wholeStr = ""; + while ((str = br.readLine()) != null) { + wholeStr += str; + } + JSONObject objects = JSONObject.parseObject(wholeStr); + //System.out.println("saobeiStoreAccountRechargeNotify --------->>>>>>> "+JSON.toJSONString(objects)); + Map map = new LinkedHashMap<>(); + String return_code = objects.get("return_code").toString(); + String return_msg = objects.get("return_msg") == null ? "" : objects.get("return_msg").toString(); + String result_code = objects.get("result_code") == null ? "" : objects.get("result_code").toString(); + String pay_type = objects.get("pay_type").toString(); + String user_id = objects.get("user_id").toString(); + String merchant_name = objects.get("merchant_name").toString(); + String merchant_no = objects.get("merchant_no").toString(); + String terminal_id = objects.get("terminal_id").toString(); + String terminal_trace = objects.get("terminal_trace").toString(); + String terminal_time = objects.get("terminal_time").toString(); + String total_fee = objects.get("total_fee").toString(); + String end_time = objects.get("end_time").toString(); + String out_trade_no = objects.get("out_trade_no").toString(); + String channel_trade_no = objects.get("channel_trade_no").toString(); + String attach = objects.get("attach").toString(); + String key_sign = objects.get("key_sign").toString(); + map.put("return_code", return_code); + map.put("return_msg", return_msg); + map.put("result_code", result_code); + map.put("pay_type", pay_type); + map.put("user_id", user_id); + map.put("merchant_name", merchant_name); + map.put("merchant_no", merchant_no); + map.put("terminal_id", terminal_id); + map.put("terminal_trace", terminal_trace); + map.put("terminal_time", terminal_time); + map.put("total_fee", total_fee); + map.put("end_time", end_time); + map.put("out_trade_no", out_trade_no); + map.put("channel_trade_no", channel_trade_no); + map.put("attach", attach); + String[] arrays = attach.split("_"); + // 检验支付参数 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("enabled", 1)); + List dataList = null; + try { + dataList = storeAccountRechargeParameterService.getList(arrays[0], criteria); + } catch (Exception e) { + logger.error("配送账户余额充值-扫呗支付异步通知,查找扫呗支付参数错误"); + } + String key = ""; + if (CollectionUtils.isNotEmpty(dataList)) { + JSONObject object = JSON.parseObject(dataList.get(0).getPbody()); + key = object.get("signKey").toString(); + } + String signKey = "&access_token=" + key; + String sign = SignUtil.createSign(map, signKey).toLowerCase(); + if (key_sign.equals(sign) && "01".equals(return_code) && "01".equals(result_code)) { + payNotifyResponse.setReturnCode("SUCCESS"); + payNotifyResponse.setReturnMsg("OK"); + logger.warn("notify payNotifyResponse {}", XStreamUtils.toXml(payNotifyResponse)); + + String prepayId = channel_trade_no;// 微信支付订单号 + String outTradeNo = terminal_trace;// 充值订单号 + logger.error(info + ">>>>> attach" + attach); + + Map eventData = new HashMap<>(); + eventData.put("tenantId", arrays[0]); + eventData.put("tradeNo", terminal_trace); + eventData.put("outTradeNo", out_trade_no); + eventData.put("prepayId", prepayId); + eventData.put("attach", attach); + eventData.put("notifyResponse", JSONUtil.toJSONString(payNotifyResponse)); + eventBus.notify(EventKeys.STORE_ACCOUNT_WEIXINPAY_NOTIFY, Event.wrap(eventData)); + + response.getWriter().write("{return_code:01}"); + response.getWriter().flush(); + response.getWriter().close(); + } else { + // 支付失败 + payNotifyResponse.setReturnCode("FAIL"); + payNotifyResponse.setReturnMsg(return_msg); + logger.error(">>> notify payNotifyResponse {}", XStreamUtils.toXml(payNotifyResponse)); + + // 记录充值失败信息 + try { + String outTradeNo = out_trade_no; + if (StringUtils.isNotBlank(outTradeNo) && StringUtils.isNotBlank(attach)) { + String tenantId = arrays[0]; + String tradeNo = terminal_trace; + + criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketNo", tradeNo)); + List records = storeAccountRechargeRecordService.getList(tenantId, criteria); + if (records.size() == 0) { + logger.error(info + " >>> 订单号(" + tradeNo + ")不存在"); + } else if (records.size() > 1) { + logger.error(info + " >>> 订单号(" + tradeNo + ")已存在"); + } else { + StoreAccountRechargeRecord record = records.get(0); + record.setStatus(1); // 已支付 + record.setRechargeStatus(0);// 已充值 + record.setNotifySign(attach);// 通知标识 + record.setNotifyData(JSONUtil.toJSONString(payNotifyResponse)); // + // 通知内容 + record.setModifyUser(Constant.CREATE_USER); + storeAccountRechargeRecordService.update(tenantId, record); + } + } + } catch (Exception e) { + logger.error(info + " 更新充值订单支付失败原因时发生异常", e); + } + } + br.close(); + + } catch (IOException e) { + payNotifyResponse.setReturnCode("FAIL"); + payNotifyResponse.setReturnMsg("ERROR"); + e.printStackTrace(); + } + + return payNotifyResponse; + + } + + // 账户余额充值-微信支付异步通知 + private PayNotifyResponse weixinnotify(HttpServletRequest request) { + String info = "账户余额充值-微信支付异步通知 notify "; + logger.error(info + " request:{} use {} method invoking", request.getRequestURL(), request.getMethod()); + + PayNotifyResponse payNotifyResponse = new PayNotifyResponse(); + try { + String content = FileCopyUtils.copyToString(new XmlStreamReader(request.getInputStream())); + logger.error(">>> notify content {}", content); + if (StringUtils.isNotBlank(content)) { + PayNotifyRequest payNotifyRequest = XStreamUtils.toBean(content, PayNotifyRequest.class); + logger.error(">>> notify payNotifyRequest {}", payNotifyRequest); + // 支付成功 + if ("SUCCESS".equals(payNotifyRequest.getReturnCode())) { + payNotifyResponse.setReturnCode("SUCCESS"); + payNotifyResponse.setReturnMsg("OK"); + logger.warn("notify payNotifyResponse {}", XStreamUtils.toXml(payNotifyResponse)); + + String prepayId = payNotifyRequest.getTransactionId();// 微信支付订单号 + String outTradeNo = payNotifyRequest.getOutTradeNo();// 充值订单号 + Map attach = JSONUtil.parseObject(payNotifyRequest.getAttach(), Map.class); + logger.error(info + ">>>>> attach"); + logger.error(payNotifyRequest.getAttach()); + String tenantId = attach.get("tenantId").toString(); + String tradeNo = attach.get("tradeNo").toString(); + Map eventData = new HashMap<>(); + eventData.put("tenantId", tenantId); + eventData.put("tradeNo", tradeNo); + eventData.put("outTradeNo", outTradeNo); + eventData.put("prepayId", prepayId); + eventData.put("attach", payNotifyRequest.getAttach()); + eventData.put("notifyResponse", JSONUtil.toJSONString(payNotifyResponse)); + eventBus.notify(EventKeys.STORE_ACCOUNT_WEIXINPAY_NOTIFY, Event.wrap(eventData)); + } else { + // 支付失败 + payNotifyResponse.setReturnCode("FAIL"); + payNotifyResponse.setReturnMsg(payNotifyRequest.getReturnMsg()); + logger.error(">>> notify payNotifyResponse {}", XStreamUtils.toXml(payNotifyResponse)); + + // 记录充值失败信息 + try { + String outTradeNo = payNotifyRequest.getOutTradeNo(); + if (StringUtils.isNotBlank(outTradeNo) && StringUtils.isNotBlank(payNotifyRequest.getAttach())) { + Map attach = JSONUtil.parseObject(payNotifyRequest.getAttach(), Map.class); + String tenantId = ""; + String tradeNo = ""; + if (null != attach.get("tenantId")) { + tenantId = attach.get("tenantId").toString(); + tradeNo = attach.get("tradeNo").toString(); + } + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketNo", tradeNo)); + List records = storeAccountRechargeRecordService.getList(tenantId, criteria); + if (records.size() == 0) { + logger.error(info + " >>> 订单号(" + tradeNo + ")不存在"); + } else if (records.size() > 1) { + logger.error(info + " >>> 订单号(" + tradeNo + ")已存在"); + } else { + StoreAccountRechargeRecord record = records.get(0); + record.setStatus(1); // 已支付 + record.setRechargeStatus(0);// 已充值 + record.setNotifySign(payNotifyRequest.getAttach());// 通知标识 + record.setNotifyData(JSONUtil.toJSONString(payNotifyResponse)); // + // 通知内容 + record.setModifyUser(Constant.CREATE_USER); + storeAccountRechargeRecordService.update(tenantId, record); + } + } + } catch (Exception e) { + logger.error(info + " 更新充值订单支付失败原因时发生异常", e); + } + } + } else { + payNotifyResponse.setReturnCode("FAIL"); + payNotifyResponse.setReturnMsg("ERROR"); + logger.error(info + "异常 : notify content 为空"); + } + } catch (IOException e) { + payNotifyResponse.setReturnCode("FAIL"); + payNotifyResponse.setReturnMsg("ERROR"); + e.printStackTrace(); + } + + return payNotifyResponse; + } + + // 微信点餐异步回调 + private PayNotifyResponse wxdcWxNotify(HttpServletRequest request) { + String info = "微信点餐-微信支付异步通知 notify "; + logger.info(info + " request:{} use {} method invoking", request.getRequestURL(), request.getMethod()); + + PayNotifyResponse payNotifyResponse = new PayNotifyResponse(); + try { + String content = FileCopyUtils.copyToString(new XmlStreamReader(request.getInputStream())); + logger.info(">>> notify content {}", content); + if (StringUtils.isNotBlank(content)) { + PayNotifyRequest payNotifyRequest = XStreamUtils.toBean(content, PayNotifyRequest.class); + logger.info(">>> notify payNotifyRequest {}", payNotifyRequest); + // 支付成功 + if ("SUCCESS".equals(payNotifyRequest.getReturnCode())) { + payNotifyResponse.setReturnCode("SUCCESS"); + payNotifyResponse.setReturnMsg("OK"); + logger.info("notify payNotifyResponse {}", XStreamUtils.toXml(payNotifyResponse)); + + String prepayId = payNotifyRequest.getTransactionId(); + String tradeNo = payNotifyRequest.getOutTradeNo(); + Map attach = JSONUtil.parseObject(payNotifyRequest.getAttach(), Map.class); + String tenantId = attach.get("tenantId").toString(); + + logger.info(info + ">>>>> 微信支付成功 异步处理充值"); + Map eventData = new HashMap<>(); + eventData.put("tenantId", tenantId); + eventData.put("tradeNo", tradeNo); + eventData.put("prepayId", prepayId); + eventData.put("notifyResponse", JSONUtil.toJSONString(payNotifyResponse)); + eventBus.notify(EventKeys.WXDC_WEIXINPAY_NOTIFY, Event.wrap(eventData)); + } else { + // 支付失败 + payNotifyResponse.setReturnCode("FAIL"); + payNotifyResponse.setReturnMsg(payNotifyRequest.getReturnMsg()); + logger.info(">>> notify payNotifyResponse {}", XStreamUtils.toXml(payNotifyResponse)); + + // 记录充值失败信息 + try { + String tradeNo = payNotifyRequest.getOutTradeNo(); + if (StringUtils.isNotBlank(tradeNo) && StringUtils.isNotBlank(payNotifyRequest.getAttach())) { + Map attach = JSONUtil.parseObject(payNotifyRequest.getAttach(), Map.class); + String tenantId = ""; + if (null != attach.get("tenantId")) { + tenantId = attach.get("tenantId").toString(); + } + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketNo", tradeNo)); + List records = storeAccountRechargeRecordService.getList(tenantId, criteria); + if (records.size() == 0) { + logger.error(info + " >>> 订单号(" + tradeNo + ")不存在"); + } else if (records.size() > 1) { + logger.error(info + " >>> 订单号(" + tradeNo + ")已存在"); + } else { + StoreAccountRechargeRecord record = records.get(0); + record.setStatus(1); // 已支付 + record.setRechargeStatus(0);// 已充值 + record.setNotifySign(payNotifyRequest.getAttach());// 通知标识 + record.setNotifyData(JSONUtil.toJSONString(payNotifyResponse)); // + // 通知内容 + record.setModifyUser(Constant.CREATE_USER); + storeAccountRechargeRecordService.update(tenantId, record); + } + } + } catch (Exception e) { + logger.error(info + " 更新充值订单支付失败原因时发生异常", e); + } + } + } else { + payNotifyResponse.setReturnCode("FAIL"); + payNotifyResponse.setReturnMsg("ERROR"); + logger.error(info + "异常 : notify content 为空"); + } + } catch (IOException e) { + payNotifyResponse.setReturnCode("FAIL"); + payNotifyResponse.setReturnMsg("ERROR"); + e.printStackTrace(); + } + + return payNotifyResponse; + } + + // 富友支付通知异步回调 + private PayNotifyResponse fuyouWxNotify(HttpServletRequest request, HttpServletResponse response) { + String info = "微信点餐-富友支付通知异步回调 notify "; + // logger.debug(info + ":wid{}:", wid); + logger.debug("notify receive request:{} use {} method invoking", request.getRequestURL(), request.getMethod()); + PayNotifyResponse payNotifyResponse = new PayNotifyResponse(); + String returnStatus = "SUCCESS"; + try { + + String privateKey = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAKw5xEbqxPHehG1R6yurpcMn5S5x2HjHUcZBv6OY+onpwiHpUE6z+yxZTu0mvFlJFfZgrTwJ5rBdksl5wSj0ubU+BJAt5d/q6uksufP2ml+jKH54f+3VkJicCnr2CGU72VpfeQYj4bfYblPQUiDp1W+ElWTh1NYeG6pftJl1i4oRAgMBAAECgYA9+LNVyViAp88C/z0eA6+r34kqAzEflKkqK7Jnjb5pLcH7LdcF2uGAfcpWr1+KyS+r7fGn7vAheio9cSA+OoEvzOwz2hMCzLl5ZNtxF9ac+4RAqqC2fDTCstkP6HsNzlzDOSvZgaFb8JjKBp1HlL3atXppfewZWQB4ghUAPLnpIQJBAN/Bc/fdsO0YfySuxnxaNbSTSecESWM8JQv9ZDk2KEOrQFDYCrIE9Vmw5wVVKrHKSSbO3J5nIcc9Ig0CDfHf2B0CQQDFC1M0Bm/pY3IPojQFQC01gDVXIRfrgoNqlGiCCa+n4odU6z/zO0vSFRbSa8Zo9zP3Bk9gLdDE+FpPd78wy9+FAkAn9ow40956qipjKdgHc7Et3DSRzyEwWRigyJPy5+pPE7H7/moCm4Iaj87jE+/5KxDfnoimvfK5fACt5BULgxg9AkAuTggCfNTFyuneBKcm6Lr3DKb8T7mYTbZmUHPywyX1VQWqjhIcLb4Wo4AWeN9KgXVDwsbaeknKT/ahICnc5LwlAkEAkr8XNYegirkvG5k40vPAWPmY+3NJ0wtQmvSb/9/2jxUpc7gG1SlhfrsL0cqtZ9gbOvLqHX3aNkxdNQ/KPXwDkA=="; + String req = request.getParameter("req"); + String content = URLDecodedUtil.decode(req, "GBK"); + Document doc = DocumentHelper.parseText(content); // 将字符串转为XML + Element rootElt = doc.getRootElement(); // 获取根节点 + String result_code = rootElt.elementTextTrim("result_code"); // 结果编码 + String result_message = rootElt.elementTextTrim("result_message"); // 结果编码 + String mchnt_order_no = rootElt.elementTextTrim("mchnt_order_no"); // 商户订单号, + // 商户系统内部的订单号(5到30个字符、 + // 只能包含字母数字,区分大小写)) + String order_amt = rootElt.elementTextTrim("order_amt"); // 订单金额 + String transaction_id = rootElt.elementTextTrim("transaction_id"); // 渠道交易流水号 + String sign = rootElt.elementTextTrim("sign"); // 渠道交易流水号 + + logger.debug("notify orderNo:{} resultCode:{} resultMsg:{} sign:{}", mchnt_order_no, result_code, result_message, sign); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("outTradeNo", mchnt_order_no.substring(4, mchnt_order_no.length()))); + List weixinOrders = weixinOrderPayService.getList(Constants.DEFAULT_DB_SIGN, criteria); + + double amount = Double.parseDouble(order_amt); + + if ("000000".equals(result_code) && weixinOrders.size() > 0 && amount == weixinOrders.get(0).getAmount() * 100) { + + response.getWriter().write("1"); + response.getWriter().flush(); + response.getWriter().close(); + + payNotifyResponse.setReturnCode("SUCCESS"); + payNotifyResponse.setReturnMsg("OK"); + logger.info("notify payNotifyResponse {}", XStreamUtils.toXml(payNotifyResponse)); + + Map wrapper = new HashMap(); + wrapper.put("orderNo", weixinOrders.get(0).getOrderNo()); + wrapper.put("transaction_id", transaction_id); + wrapper.put("outTradeNo", mchnt_order_no.substring(4, mchnt_order_no.length())); + + this.eventBus.notify(EventKeys.FUYOU_PAY_NOTIFY, Event.wrap(wrapper)); + } else { + payNotifyResponse.setReturnCode("FAIL"); + payNotifyResponse.setReturnMsg("ERROR"); + logger.error(info + "异常 : notify content 为空"); + } + } catch (Exception e) { + payNotifyResponse.setReturnCode("FAIL"); + payNotifyResponse.setReturnMsg("ERROR"); + logger.error(info, e); + } + return payNotifyResponse; + } + + private PayNotifyResponse saobeiWxNotify(HttpServletRequest request, HttpServletResponse response) { + String info = "微信-扫呗支付通知异步回调 notify "; + // logger.debug(info + ":wid{}:", wid); + logger.debug("notify receive request:{} use {} method invoking", request.getRequestURL(), request.getMethod()); + PayNotifyResponse payNotifyResponse = new PayNotifyResponse(); + String returnStatus = "SUCCESS"; + try { + BufferedReader br = request.getReader(); + String str, wholeStr = ""; + while ((str = br.readLine()) != null) { + wholeStr += str; + } + JSONObject objects = JSONObject.parseObject(wholeStr); + Map map = new LinkedHashMap<>(); + String return_code = objects.get("return_code").toString(); + String return_msg = objects.get("return_msg") == null ? "" : objects.get("return_msg").toString(); + String result_code = objects.get("result_code") == null ? "" : objects.get("result_code").toString(); + String pay_type = objects.get("pay_type").toString(); + String user_id = objects.get("user_id").toString(); + String merchant_name = objects.get("merchant_name").toString(); + String merchant_no = objects.get("merchant_no").toString(); + String terminal_id = objects.get("terminal_id").toString(); + String terminal_trace = objects.get("terminal_trace").toString(); + String terminal_time = objects.get("terminal_time").toString(); + String total_fee = objects.get("total_fee").toString(); + String end_time = objects.get("end_time").toString(); + String out_trade_no = objects.get("out_trade_no").toString(); + String channel_trade_no = objects.get("channel_trade_no").toString(); + String attach = objects.get("attach").toString(); + String key_sign = objects.get("key_sign").toString(); + map.put("return_code", return_code); + map.put("return_msg", return_msg); + map.put("result_code", result_code); + map.put("pay_type", pay_type); + map.put("user_id", user_id); + map.put("merchant_name", merchant_name); + map.put("merchant_no", merchant_no); + map.put("terminal_id", terminal_id); + map.put("terminal_trace", terminal_trace); + map.put("terminal_time", terminal_time); + map.put("total_fee", total_fee); + map.put("end_time", end_time); + map.put("out_trade_no", out_trade_no); + map.put("channel_trade_no", channel_trade_no); + map.put("attach", attach); + String[] arrays = attach.split("_"); + List source = wxPaymentParameterService.getPaymentParameterByStoreId(arrays[0], arrays[1]); + String key = ""; + if (CollectionUtils.isNotEmpty(source)) { + JSONObject object = JSON.parseObject(source.get(0).getPbody()); + key = object.get("signKey").toString(); + } + String signKey = "&access_token=" + key; + String sign = SignUtil.createSign(map, signKey).toLowerCase(); + + if (key_sign.equals(sign) && "01".equals(return_code) && "01".equals(result_code)) { + payNotifyResponse.setReturnCode("SUCCESS"); + payNotifyResponse.setReturnMsg("OK"); + logger.info("notify payNotifyResponse {}", XStreamUtils.toXml(payNotifyResponse)); + Map wrapper = new HashMap(); + wrapper.put("orderNo", terminal_trace); + wrapper.put("transaction_id", out_trade_no); + wrapper.put("tenantId", arrays[0]); + // wrapper.put("outTradeNo", terminal_trace); + this.eventBus.notify(EventKeys.SAOBEI_PAY_NOTIFY, Event.wrap(wrapper)); + response.getWriter().write("{return_code:01}"); + response.getWriter().flush(); + response.getWriter().close(); + } else { + payNotifyResponse.setReturnCode("FAIL"); + payNotifyResponse.setReturnMsg("ERROR"); + logger.error(info + "异常 : notify content 为空"); + } + br.close(); + } catch (Exception e) { + payNotifyResponse.setReturnCode("FAIL"); + payNotifyResponse.setReturnMsg("ERROR"); + logger.error(info, e); + } + return payNotifyResponse; + } + + private PayNotifyResponse tonglianNotify(HttpServletRequest request, HttpServletResponse response) { + String info = "通联支付通知异步回调 notify "; + PayNotifyResponse payNotifyResponse = new PayNotifyResponse(); + String returnStatus = "SUCCESS"; + RLock lock = null; + try { + //String resquestBody = HttpTool.getResquestBody(request); + //SONObject notify = JSON.parseObject(resquestBody); + String returnCode = request.getParameter("return_code"); + String resultCode = request.getParameter("result_code"); + String resultMsg = request.getParameter("return_msg"); + String user_id = request.getParameter("user_id");// 付款方用户id,“微信openid”、“支付宝账户”、“qq号”等 + String merchant_name = request.getParameter("merchant_name");// 商户名称 + String merchant_no = request.getParameter("merchant_no");// 商户号 + String terminal_id = request.getParameter("terminal_id");// 终端号 + String terminalTrace = request.getParameter("terminal_trace");// 终端流水号,此处传商户发起预支付或公众号支付时所传入的交易流水号 + String terminal_time = request.getParameter("terminal_time");// 终端交易时间,yyyyMMddHHmmss,全局统一时间格式(01时参与拼接) + String pay_trace = request.getParameter("pay_trace");// 当前支付终端流水号,与pay_time同时传递,返回时不参与签名 + String pay_time = request.getParameter("pay_time");// 当前支付终端交易时间,yyyyMMddHHmmss,全局统一时间格式,与pay_trace同时传递 + String total_fee = request.getParameter("amount");// 支付金额 + String fee = request.getParameter("fee");// 手续费 + + String pay_type = request.getParameter("pay_type");// 请求类型,010微信,020 + // 支付宝,060qq钱包,080京东钱包,090口碑,100翼支付 + String end_time = request.getParameter("end_time");// 支付完成时间,yyyyMMddHHmmss,全局统一时间格式 + String out_trade_no = request.getParameter("out_trade_no");// 利楚唯一订单号 + String channel_trade_no = request.getParameter("channel_trade_no");// 通道订单号,微信订单号、支付宝订单号等 + String attach = request.getParameter("attach");// 支付成功原样返回 + String receipt_fee = request.getParameter("receipt_fee");// 口碑实收金额,pay_type为090时必填 + String key_sign = request.getParameter("key_sign");// 签名字符串,拼装所有必传参数+令牌,32位md5加密转换 + String remark = request.getParameter("remark"); + String status = request.getParameter("status"); + + logger.error(info + "=====returnCode========>" + returnCode); + logger.error(info + "=====resultCode========>" + resultCode); + logger.error(info + "=====resultMsg========>" + resultMsg); + logger.error(info + "=====out_trade_no=======>" + out_trade_no); + logger.error(info + "=====pay_type========>" + pay_type); + logger.error(info + "=====channel_trade_no========>" + channel_trade_no); + logger.error(info + "=====attach========>" + attach); + logger.error(info + "=====total_fee========>" + total_fee); + logger.error(info + "=====fee========>" + fee); + + logger.error(info + "=====remark========>" + remark); + logger.error(info + "=====status========>" + status); + + // 校验签名是否正确 + if (status.equals("OK")) { + // tenantId+"_"+storeId + String attachArray[] = remark.split("_"); + String tenantId = attachArray[0];// 租户编号 + String storeId = attachArray[1];// 门店ID + String busNo = attachArray[2];// 订单号 + String keysuccess = "programBusNo:" + tenantId + ":" + storeId + ":" + busNo; + lock = redissonClient.getLock(keysuccess); + lock.lock(5, TimeUnit.SECONDS); + Object busNoValue = cacheService.get(tenantId, keysuccess); + if (busNoValue != null && busNo.equals(busNoValue.toString().split("_")[0])) { + payNotifyResponse.setReturnCode("SUCCESS"); + payNotifyResponse.setReturnMsg("OK"); + logger.error(info + "支付成功,订单信息上传成功"); + return payNotifyResponse; + } + ProgramStoreBusinessTicket enity = programStoreBusinessTicketService.find(tenantId, "no", busNo); + // 支付金额= 订单应收+餐盒费+配送费 + if ((enity.getReceivable() + enity.getPackageFee() + enity.getDeliverFee()) != (Double.parseDouble(total_fee) / 100)) { + payNotifyResponse.setReturnCode("SUCCESS"); + payNotifyResponse.setReturnMsg("OK"); + logger.error(info + "支付成功,单订金额不符"); + return payNotifyResponse; + } + // 生成取餐号 + DateFormat fmt = new SimpleDateFormat("yyyyMMdd"); + String day = fmt.format(new Date()); + String key = "wxBus:" + tenantId + ":" + storeId + ":" + day; + cacheService.setQueue(tenantId, key, enity.getNo(), 60 * 60 * 24); + //int random = (int) (Math.random() * 10 + 1); + String datSeq = ""; + //按南宁要求,取餐号为 600-799 2020-04-10 13:49 + if (StringUtils.startsWith(tenantId, "77")) { + int queueSize = cacheService.getQueueSize(tenantId, key); + int daySize = queueSize + 600; + logger.error("单号:" + enity.getNo() + " queueSize =============>" + queueSize); + if (daySize >= 800) { + int index = queueSize / 200; + daySize = daySize - 200 * index; + logger.error("单号:" + enity.getNo() + " daySize =============>" + daySize); + } + datSeq = daySize + ""; + } else { + String random = "0"; + String busMode = "T"; + if (enity.getBusMode() == 0) { + busMode = "T"; + } else if (enity.getBusMode() == 1) { + busMode = "D"; + } else if (enity.getBusMode() == 2) { + busMode = "Y"; + } else { + busMode = "W"; + } + String suffix = String.format("%0" + 3 + "d", cacheService.getQueueSize(tenantId, key)); + + if (suffix.length() > 3) { + datSeq = busMode + suffix; + } else { + datSeq = busMode + random + suffix; + } + } + + logger.error("单号:" + enity.getNo() + "=============>" + datSeq); + enity.setSeqNo(datSeq);// 取餐号 + enity.setStatus(0);// 更改主单为待接单状态 + // 门店菜品销售记录优惠明细校验开始 + List payList = new ArrayList<>(); + Date createDate = new Date(); + ProgramStorePay storePay = new ProgramStorePay(); + storePay.setProgramId(enity.getProgramId()); + storePay.setCreateDate(createDate); + storePay.setCreateUser("open-api"); + storePay.setClientId(enity.getClientId()); + storePay.setStoreId(enity.getStoreId()); + storePay.setStoreNo(enity.getStoreNo()); + storePay.setStoreName(enity.getStoreName()); + storePay.setBusNo(enity.getNo()); + storePay.setBusMode(enity.getBusMode()); + storePay.setPayNo(enity.getNo()); + storePay.setTableNo(enity.getTableNo()); + String notifyPayType = ""; + if ("020".equals(pay_type)) { + storePay.setPayTypeNo("04"); + storePay.setPayType("支付宝"); + storePay.setMemo("通联支付宝支付成功"); + notifyPayType = "ALIPAY"; + } else if ("010".equals(pay_type)) { + storePay.setPayTypeNo("05"); + storePay.setPayType("微信支付"); + storePay.setMemo("通联微信支付成功"); + notifyPayType = "WEIXIN"; + } else { + storePay.setPayTypeNo("05"); + storePay.setPayType("微信支付"); + storePay.setMemo("通联微信支付成功"); + notifyPayType = "WEIXIN"; + } + storePay.setPayTypeNo("50"); + storePay.setPayDate(createDate); + storePay.setPaid(Double.parseDouble(total_fee) / 100); + storePay.setRchange(0.00); + storePay.setMoney(Double.parseDouble(total_fee) / 100); + storePay.setOverAmount(0.00); + storePay.setVoucherNo(out_trade_no); + storePay.setCardno(""); + storePay.setCardYe(0.00); + storePay.setCardJf(0.00); + storePay.setIncomeFlag(1); + storePay.setOtherRateType(0); + storePay.setOtherRateValue(0.00); + storePay.setOtherRate(0.00); + storePay.setPayChannel(8);// 扫呗支付 + storePay.setDeductionRate(enity.getDeductionRate()); + //storePay.setChargeBack(enity.getChargeBack()); + storePay.setChargeBack(Double.parseDouble(fee) / 100); + storePay.setSettleFlag(0); + payList.add(storePay); + StoreBusinessTicketCheck ticketCheck = programStoreBusinessTicketService.updateBusinessTicket(tenantId, enity, payList); + if ("1".equals(ticketCheck.getStatus())) { + try { + // 存储支付成功的Key + cacheService.set(tenantId, keysuccess, busNo + "_" + datSeq + "_" + notifyPayType, 60 * 60 * 24); + // 门店信消息压进缓存 + try { + Object programOrderIds = cacheService.get(tenantId, "program_" + storeId); + if (programOrderIds != null) { + Map orderIds = (Map) cacheService.get(tenantId, "program_" + storeId); + orderIds.put(String.valueOf(enity.getNo()), String.valueOf(enity.getNo())); + cacheService.set(tenantId, "program_" + storeId, orderIds, 1200); + } else { + Map orderIds = new HashMap<>(); + orderIds.put(String.valueOf(enity.getNo()), String.valueOf(enity.getNo())); + cacheService.set(tenantId, "program_" + storeId, orderIds, 1200); + } + } catch (Exception e) { + logger.error(info + "创建订单推送创建缓存失败>>>>>>>>>>"); + } + //前台阿布订阅模型 + sendProgramMessage("cy2", tenantId, storeId); + Map orderMap = new HashMap<>(); + orderMap.put("tenantId", tenantId); + orderMap.put("storeId", storeId); + orderMap.put("orderNo", enity.getNo()); + orderMap.put("reSendNums", 0); + this.mqMessageSender.send4jwprogramordermessage(tenantId, orderMap, RabbitConstant.ROUTING_KEY_JW_PROGRAM_ORDER_NOTIFY_DELAY, new CorrelationData(UUID.randomUUID().toString()), 1000L * 60); + //启动退款定时任务,3分钟不接单自动退款 + Map eventDatas = new HashMap<>(); + eventDatas.put("tenantId", tenantId); + eventDatas.put("storeId", storeId); + eventDatas.put("busNo", busNo); + eventBus.notify(EventKeys.PROGRAM_ORDER_PAY, Event.wrap(eventDatas)); + payNotifyResponse.setReturnCode("01"); + payNotifyResponse.setReturnMsg("SUCCESS"); + logger.error(info + "支付成功,订单信息上传成功"); + } catch (Exception ex) { + payNotifyResponse.setReturnCode("02"); + payNotifyResponse.setReturnMsg("ERROR"); + logger.error(info, ex); + } + } else { + payNotifyResponse.setReturnCode("02"); + payNotifyResponse.setReturnMsg("ERROR"); + logger.error(info + "支付订单信息保存失败"); + } + + RMapCache stringMapRMapCache = redissonClient.getMapCache("weixin:small:loginKey:session"); + if (stringMapRMapCache.get(user_id) != null) { + String loginKey = stringMapRMapCache.get(user_id); + if (StringUtils.isNotBlank(loginKey)) { + RMapCache> sSessionMap = redissonClient.getMapCache("weixin:small:session"); + if (sSessionMap.get(loginKey) != null) { + Map data = sSessionMap.get(loginKey); + if (data.get("sessionKey") != null && StringUtils.isNotBlank(data.get("sessionKey").toString())) { + logger.info("通联订单上传异步任务:tradeNo" + busNo); + //扫呗订单上传; + Map eventData = new HashMap<>(); + eventData.put("tenantId", tenantId); + eventData.put("ticketId", enity.getId()); + eventData.put("merchant_no", merchant_no); + eventData.put("terminal_id", terminal_id); + eventData.put("out_order_no", out_trade_no); + eventData.put("transaction_id", channel_trade_no); + eventData.put("user_id", user_id); + eventData.put("session_key", data.get("sessionKey").toString()); + eventData.put("out_trade_no", busNo); + eventData.put("storeNo", enity.getStoreNo()); + eventData.put("storeId", enity.getStoreId()); + eventData.put("total_amount", ((Double) (enity.getAmount() * 100)).intValue()); + eventData.put("discount_amount", ((Double) (enity.getDiscountTotal() * 100)).intValue()); + eventData.put("user_amount", ((Double) (enity.getReceivable() * 100)).intValue()); + + eventBus.notify(EventKeys.PROGRAM_ORDER_SAOBEI_UPLOAD, Event.wrap(eventData)); + } else { + logger.info("通联订单上传异步任务:sessionKey 不存在"); + } + } else { + logger.info("通联订单上传异步任务:sSessionMap 不存在"); + } + } else { + logger.info("通联订单上传异步任务:loginKey" + loginKey + " ---------------- >>>>> 失败"); + } + } else { + logger.info("通联订单上传异步任务:user_id" + user_id + " ---------------- >>>>> 失败"); + } + } else { + payNotifyResponse.setReturnCode("02"); + payNotifyResponse.setReturnMsg("ERROR"); + logger.error(info + "支付订单信息保存失败"); + } + } catch (Exception e) { + payNotifyResponse.setReturnCode("02"); + payNotifyResponse.setReturnMsg("ERROR"); + logger.error(info, e); + } finally { + if (lock != null) { + lock.unlock(); + } + } + return payNotifyResponse; + } + + private PayNotifyResponse tongliansingalNotify(HttpServletRequest request, HttpServletResponse response) { + String info = "通联支付单笔托管代付通知异步回调 notify "; + PayNotifyResponse payNotifyResponse = new PayNotifyResponse(); + String returnStatus = "SUCCESS"; + RLock lock = null; + try { + String resquestBody = HttpTool.getResquestBody(request); + JSONObject notify = JSON.parseObject(resquestBody); + //String returnCode = notify.getString("return_code"); + String returnCode = request.getParameter("amount"); + + String remark = request.getParameter("remark"); + String status = request.getParameter("status"); + + logger.error(info + "=====returnCode========>" + returnCode); + logger.error(info + "=====remark========>" + remark); + logger.error(info + "=====status========>" + status); + if (status.equals("OK")) { + String attachArray[] = remark.split("_"); + String tenantId = attachArray[0];// 租户编号 + String storeId = attachArray[1];// 门店ID + String busNo = attachArray[2];// 订单号 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("id", busNo)); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("isInvalid ", "1")); + List listt = splitStorePayService.getList(tenantId,criteria); + if(listt!=null&&listt.size()>0){ + logger.error(info + "通联支付单笔托管代付通知异步已回调"); + }else{ + SplitStorePay pay=splitStorePayService.get(tenantId,busNo); + pay.setIsInvalid(1); + splitStorePayService.update(tenantId,pay); + logger.error(info + "通联支付单笔托管代付通知异步回调成功"); + } + }else{ + logger.error(info + "通联支付单笔托管代付通知异步回调失败"); + + } + } catch (Exception e) { + payNotifyResponse.setReturnCode("02"); + payNotifyResponse.setReturnMsg("ERROR"); + logger.error(info, e); + } finally { + if (lock != null) { + lock.unlock(); + } + } + return payNotifyResponse; + } + + private PayNotifyResponse withdrawapplyNotify(HttpServletRequest request, HttpServletResponse response) { + String info = "通联提现通知异步回调 notify "; + PayNotifyResponse payNotifyResponse = new PayNotifyResponse(); + String returnStatus = "SUCCESS"; + RLock lock = null; + try { + String resquestBody = HttpTool.getResquestBody(request); + JSONObject notify = JSON.parseObject(resquestBody); + //String returnCode = notify.getString("return_code"); + String amount = request.getParameter("amount"); + String remark = request.getParameter("remark"); + String status = request.getParameter("status"); + logger.error(info + "=====amount========>" + amount); + logger.error(info + "=====remark========>" + remark); + logger.error(info + "=====status========>" + status); + if (status.equals("OK")) { + String attachArray[] = remark.split("_"); + String tenantId = attachArray[0];// 租户编号 + String orderId = attachArray[2];// 记录ID + SplitShopWithdrawal withdrawal=new SplitShopWithdrawal(); + withdrawal.setId(orderId); + withdrawal.setStatus(1); + splitShopWithdrawalService.update(tenantId,withdrawal); + logger.error(info + "通联提现接口通知异步回调成功"); + }else{ + logger.error(info + "通联提现接口通知异步回调失败"); + + } + } catch (Exception e) { + payNotifyResponse.setReturnCode("02"); + payNotifyResponse.setReturnMsg("ERROR"); + logger.error(info, e); + } finally { + if (lock != null) { + lock.unlock(); + } + } + return payNotifyResponse; + } + + private PayNotifyResponse ocrComparisonResult(HttpServletRequest request, HttpServletResponse response) { + String info = "影印件审核结果通知 notify "; + PayNotifyResponse payNotifyResponse = new PayNotifyResponse(); + String returnStatus = "SUCCESS"; + RLock lock = null; + try { + String resquestBody = HttpTool.getResquestBody(request); + JSONObject notify = JSON.parseObject(resquestBody); + String bizUserId = request.getParameter("bizUserId"); + String resultInfo = request.getParameter("resultInfo"); + String ocrRegnumComparisonResult = request.getParameter("ocrRegnumComparisonResult"); + String ocrIdcardComparisonResult = request.getParameter("ocrIdcardComparisonResult"); + //{"bizUserId":"ZHTQY_OUT16916554874517117","ocrIdcardComparisonResult":"1","ocrRegnumComparisonResult":"1","resultInfo":"人脸OCR识别成功;国徽OCR识别成功;企业营业执照OCR识别成功;"} + String bizContent = request.getParameter("bizContent"); + + logger.error(info + "=====bizContent========>" + bizContent); + logger.error(info + "=====resultInfo========>" + resultInfo); + logger.error(info + "=====ocrRegnumComparisonResult========>" + ocrRegnumComparisonResult); + logger.error(info + "=====ocrIdcardComparisonResult========>" + ocrIdcardComparisonResult); + + + } catch (Exception e) { + payNotifyResponse.setReturnCode("02"); + payNotifyResponse.setReturnMsg("ERROR"); + logger.error(info, e); + } finally { + if (lock != null) { + lock.unlock(); + } + } + return payNotifyResponse; + } + + private PayNotifyResponse signAcctProtocol(HttpServletRequest request, HttpServletResponse response) { + String info = "收款方提现协议签约审核结果通知 notify "; + PayNotifyResponse payNotifyResponse = new PayNotifyResponse(); + String returnStatus = "SUCCESS"; + RLock lock = null; + try { + String resquestBody = HttpTool.getResquestBody(request); + JSONObject notify = JSON.parseObject(resquestBody); + String bizUserId = request.getParameter("bizUserId"); + String acctProtocolNo = request.getParameter("acctProtocolNo"); + String result = request.getParameter("result"); + + logger.error(info + "=====bizUserId========>" + bizUserId); + logger.error(info + "=====acctProtocolNo========>" + acctProtocolNo); + logger.error(info + "=====result========>" + result); + + } catch (Exception e) { + payNotifyResponse.setReturnCode("02"); + payNotifyResponse.setReturnMsg("ERROR"); + logger.error(info, e); + } finally { + if (lock != null) { + lock.unlock(); + } + } + return payNotifyResponse; + } + + private PayNotifyResponse companyNotify(HttpServletRequest request, HttpServletResponse response) { + String info = "企业信息审核结果通知通知异步回调 notify "; + logger.info(info + " request:{} use {} method invoking", request.getRequestURL(), request.getMethod()); + PayNotifyResponse payNotifyResponse = new PayNotifyResponse(); + TreeMap result=new TreeMap<>(); + try { + request.setCharacterEncoding("UTF-8");//通知传输的编码为GBK + response.setCharacterEncoding("UTF-8"); + TreeMap params = SybUtil.getParams(request);//动态遍历获取所有收到的参数 + Iterator io = params.keySet().iterator(); + while (io.hasNext()) { + String key = io.next(); + String value = params.get(key); + this.logger.info(key + " : " + value + " "); + } + + }catch (Exception e){ + logger.error(e.getMessage(),e); + } + return payNotifyResponse; + } + + private PayNotifyResponse ocrComparisonNotify(HttpServletRequest request, HttpServletResponse response) { + String info = "影印件审核结果通知通知异步回调 notify "; + logger.info(info + " request:{} use {} method invoking", request.getRequestURL(), request.getMethod()); + PayNotifyResponse payNotifyResponse = new PayNotifyResponse(); + TreeMap result=new TreeMap<>(); + try { + request.setCharacterEncoding("UTF-8");//通知传输的编码为GBK + response.setCharacterEncoding("UTF-8"); + TreeMap params = SybUtil.getParams(request);//动态遍历获取所有收到的参数 + Iterator io = params.keySet().iterator(); + while (io.hasNext()) { + String key = io.next(); + String value = params.get(key); + this.logger.info(key + " : " + value + " "); + } + + }catch (Exception e){ + logger.error(e.getMessage(),e); + } + return payNotifyResponse; + } + + /** + * 建行龙支付页面回调地址 + * + * @param request + * @param response + * @return + */ + private PayNotifyResponse ccbWxNotify(HttpServletRequest request, HttpServletResponse response) { + String info = "微信-建行龙支付通知异步回调 notify "; + PayNotifyResponse payNotifyResponse = new PayNotifyResponse(); + String returnStatus = "SUCCESS"; + try { + String POSID = request.getParameter("POSID");// 商户柜台代码 + String BRANCHID = request.getParameter("BRANCHID");// 分行代码 + String ORDERID = request.getParameter("ORDERID");// 定单号 + String PAYMENT = request.getParameter("PAYMENT");// 付款金额 + String CURCODE = request.getParameter("CURCODE");// 币种 + String REMARK1 = request.getParameter("REMARK1");// 备注一 + String REMARK2 = request.getParameter("REMARK2");// 备注二 + String ACC_TYPE = request.getParameter("ACC_TYPE");// 账户类型 + String SUCCESS = request.getParameter("SUCCESS");// 成功标志 + String TYPE = request.getParameter("TYPE");// 接口类型 + String REFERER = request.getParameter("TYPE");// Referer信息 + String CLIENTIP = request.getParameter("CLIENTIP");// 客户端IP + String ACCDATE = request.getParameter("ACCDATE");// 系统记账日期 + String USRMSG = request.getParameter("USRMSG");// 支付账户信息 + String USRINFO = request.getParameter("USRINFO");// 客户加密信息 + String PAYTYPE = request.getParameter("PAYTYPE");// 支付方式 + String SIGN = request.getParameter("SIGN");// 数字签名 + logger.error(info + "=============>" + POSID); + logger.error(info + "=============>" + BRANCHID); + logger.error(info + "======订单号=======>" + ORDERID); + logger.error(info + "=============>" + PAYMENT); + logger.error(info + "=============>" + CURCODE); + logger.error(info + "=============>" + REMARK1); + logger.error(info + "=============>" + REMARK2); + logger.error(info + "=============>" + ACC_TYPE); + logger.error(info + "=============>" + SUCCESS); + logger.error(info + "======签名=======>" + SIGN); + logger.error(info + "======加密信息=======>" + USRMSG); + logger.error(info + "======支付方式=======>" + PAYTYPE); + // 校验签名是否正确 + if ("Y".equals(SUCCESS)) { + String tenantId = REMARK1;// 租户编号 + String storeId = REMARK2;// 门店ID + String busNo = ORDERID;// 订单号 + String keysuccess = "wxBusNo:" + tenantId + ":" + storeId + ":" + busNo; + Object busNoValue = cacheService.get(tenantId, keysuccess); + if (busNoValue != null && busNo.equals(busNoValue.toString().split("_")[0])) { + payNotifyResponse.setReturnCode("SUCCESS"); + payNotifyResponse.setReturnMsg("OK"); + logger.error(info + "支付成功,订单信息上传成功"); + return payNotifyResponse; + } + VposStoreBusinessTicket enity = vposStoreBusinessTicketService.find(tenantId, "no", busNo); + if (enity.getReceivable() != Double.parseDouble(PAYMENT)) { + payNotifyResponse.setReturnCode("SUCCESS"); + payNotifyResponse.setReturnMsg("OK"); + logger.error(info + "支付成功,单订金额不符"); + return payNotifyResponse; + } + // 生成取餐号 + DateFormat fmt = new SimpleDateFormat("yyyyMMdd"); + String day = fmt.format(new Date()); + String key = "wxBus:" + tenantId + ":" + storeId + ":" + day; + cacheService.setQueue(tenantId, key, enity.getNo(), 60 * 60 * 24); + int random = (int) (Math.random() * 10 + 1); + String busMode = "T"; + if (enity.getBusMode() == 0) { + busMode = "T"; + } else { + busMode = "W"; + } + String datSeq = busMode + random + String.format("%0" + 5 + "d", cacheService.getQueueSize(tenantId, key)); + logger.error("单号:" + enity.getNo() + "=============>" + datSeq); + enity.setSeqNo(datSeq);// 取餐号 + enity.setStatus(4);// 更改主单为支付成功状态 + // 门店菜品销售记录优惠明细校验开始 + List payList = new ArrayList<>(); + Date createDate = new Date(); + VposStorePay storePay = new VposStorePay(); + storePay.setCreateDate(createDate); + storePay.setCreateUser("open-api"); + storePay.setClientId(enity.getClientId()); + storePay.setStoreId(enity.getStoreId()); + storePay.setStoreNo(enity.getStoreNo()); + storePay.setStoreName(enity.getStoreName()); + storePay.setBusNo(enity.getNo()); + storePay.setBusMode(enity.getBusMode()); + storePay.setPayNo(enity.getNo()); + storePay.setTableNo(enity.getTableNo()); + if ("ALIPAY".equals(PAYTYPE)) { + storePay.setPayTypeNo("04"); + storePay.setPayType("支付宝"); + storePay.setMemo("建行支付宝支付成功"); + } else if ("WEIXIN".equals(PAYTYPE)) { + storePay.setPayTypeNo("05"); + storePay.setPayType("微信支付"); + storePay.setMemo("建行微信支付成功"); + } else { + storePay.setPayTypeNo("05"); + storePay.setPayType("微信支付"); + storePay.setMemo("建行微信支付成功"); + } + storePay.setPayDate(createDate); + storePay.setPaid(Double.parseDouble(PAYMENT)); + storePay.setRchange(0.00); + storePay.setMoney(Double.parseDouble(PAYMENT)); + storePay.setOverAmount(0.00); + storePay.setWorkNo(enity.getWorkNo()); + storePay.setDeviceName(enity.getDeviceName()); + storePay.setDeviceMac(enity.getDeviceMac()); + storePay.setDeviceIp(enity.getDeviceIp()); + storePay.setPosNo(enity.getPosNo()); + storePay.setVoucherNo(enity.getNo()); + storePay.setCardno(""); + storePay.setCardYe(0.00); + storePay.setCardJf(0.00); + storePay.setIncomeFlag(1); + storePay.setOtherRateType(0); + storePay.setOtherRateValue(0.00); + storePay.setOtherRate(0.00); + storePay.setPayChannel(4);// 建行支付 + payList.add(storePay); + StoreBusinessTicketCheck ticketCheck = vposStoreBusinessTicketService.updateBusinessTicket(tenantId, enity, payList); + if ("1".equals(ticketCheck.getStatus())) { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("busNo", enity.getNo())); + // 获取主单优惠 + List ticketInfoList = vposStoreBusinessTicketInfoService.getList(tenantId, criteria); + // 获取订单商品信息 + List orderProductList = vposStoreOrderProductService.getList(tenantId, criteria); + // 获取产品优惠信息 + List orderProductInfoList = vposStoreOrderProductInfoService.getList(tenantId, criteria); + // 获取产品做法信息 + List makeList = vposStoreOrderProductMakeService.getList(tenantId, criteria); + // 订单进行分单 + sendMessage(tenantId, storeId, enity, orderProductList, makeList); + try { + // 存储支付成功的Key + cacheService.set(tenantId, keysuccess, busNo + "_" + datSeq + "_" + PAYTYPE, 60 * 60 * 24); + // 发送支付成功通知 + Map map = new HashMap<>(); + map.put("type", 1);// 支付成功通知 + map.put("openId", enity.getOpenId());// 用户ID + map.put("busNo", busNo);// 业务单号 + map.put("date", new Date());// 日期 + map.put("amount", Double.parseDouble(PAYMENT)); + logger.error("weixinpay/" + tenantId + "/" + storeId + "/" + enity.getOpenId()); + logger.error(JSON.toJSONString(map, SerializerFeature.WriteDateUseDateFormat)); + mqttClient.Publish("weixinpay/" + tenantId + "/" + storeId + "/" + enity.getOpenId(), JSON.toJSONString(map, SerializerFeature.WriteDateUseDateFormat)); + // 将时间改为支付时间 + enity.setSaleDate(createDate); + if (CollectionUtils.isNotEmpty(ticketInfoList)) { + for (VposStoreBusinessTicketInfo vposStoreBusinessTicketInfo : ticketInfoList) { + vposStoreBusinessTicketInfo.setSaleDate(createDate); + } + } + if (CollectionUtils.isNotEmpty(orderProductList)) { + for (VposStoreOrderProduct vposStoreOrderProduct : orderProductList) { + vposStoreOrderProduct.setSaleDate(createDate); + } + } + if (CollectionUtils.isNotEmpty(orderProductInfoList)) { + for (VposStoreOrderProductInfo vposStoreOrderProductInfo : orderProductInfoList) { + vposStoreOrderProductInfo.setSaleDate(createDate); + } + } + if (CollectionUtils.isNotEmpty(makeList)) { + for (VposStoreOrderProductMake vposStoreOrderProductMake : makeList) { + vposStoreOrderProductMake.setSaleDate(createDate); + } + } + // 数据上传 + // 放入消息队列 + Map message = new HashMap<>(); + message.put("type", "businessorderplus"); + message.put("storeBusinessTicket", enity); + message.put("ticketInfoList", ticketInfoList); + message.put("orderProductList", orderProductList); + message.put("orderProductInfoList", orderProductInfoList); + message.put("payList", payList); + message.put("makeList", makeList); + message.put("deliveryList", new ArrayList()); + CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString()); + this.mqMessageSender.send4businessorderplus(tenantId, message, correlationData); + logger.error(info + "销售数据上传发送成功"); + // 支付成功减少库存 + // 放入消息队列 + Map stockMessage = new HashMap<>(); + stockMessage.put("type", "productsalestock"); + stockMessage.put("orderProductList", orderProductList); + CorrelationData correlationData1 = new CorrelationData(UUID.randomUUID().toString()); + this.mqMessageSender.send4productsalestock(tenantId, stockMessage, correlationData1); + logger.error(info + "支付扣减库存发送成功"); + Map data = new HashMap<>(); + data.put("busNo", enity.getNo()); + data.put("ticketId", ticketCheck.getTicketId()); + data.put("seqNo", datSeq); + payNotifyResponse.setReturnCode("SUCCESS"); + payNotifyResponse.setReturnMsg("OK"); + logger.error(info + "支付成功,订单信息上传成功"); + } catch (Exception ex) { + payNotifyResponse.setReturnCode("FAIL"); + payNotifyResponse.setReturnMsg("ERROR"); + logger.error(info, ex); + } + } else { + payNotifyResponse.setReturnCode("FAIL"); + payNotifyResponse.setReturnMsg("ERROR"); + logger.error(info + "支付订单信息保存失败"); + } + } else { + payNotifyResponse.setReturnCode("FAIL"); + payNotifyResponse.setReturnMsg("ERROR"); + logger.error(info + "支付订单信息保存失败"); + } + } catch (Exception e) { + payNotifyResponse.setReturnCode("FAIL"); + payNotifyResponse.setReturnMsg("ERROR"); + logger.error(info, e); + } + return payNotifyResponse; + } + + /** + * 扫呗美食广场项目接口回调 + * + * @param request + * @param response + * @return + */ + private PayNotifyResponse saoBeiGcWxNotify(HttpServletRequest request, HttpServletResponse response) { + String info = "微信-扫呗通知异步回调 notify "; + PayNotifyResponse payNotifyResponse = new PayNotifyResponse(); + String returnStatus = "SUCCESS"; + try { + String resquestBody = HttpTool.getResquestBody(request); + JSONObject notify = JSON.parseObject(resquestBody); + String returnCode = notify.getString("return_code"); + String resultCode = notify.getString("result_code"); + String resultMsg = notify.getString("return_msg"); + String user_id = notify.getString("user_id");// 付款方用户id,“微信openid”、“支付宝账户”、“qq号”等 + String merchant_name = notify.getString("merchant_name");// 商户名称 + String merchant_no = notify.getString("merchant_no");// 商户号 + String terminal_id = notify.getString("terminal_id");// 终端号 + String terminalTrace = notify.getString("terminal_trace");// 终端流水号,此处传商户发起预支付或公众号支付时所传入的交易流水号 + String terminal_time = notify.getString("terminal_time");// 终端交易时间,yyyyMMddHHmmss,全局统一时间格式(01时参与拼接) + String pay_trace = notify.getString("pay_trace");// 当前支付终端流水号,与pay_time同时传递,返回时不参与签名 + String pay_time = notify.getString("pay_time");// 当前支付终端交易时间,yyyyMMddHHmmss,全局统一时间格式,与pay_trace同时传递 + String total_fee = notify.getString("total_fee");// 支付金额 + String pay_type = notify.getString("pay_type");// 请求类型,010微信,020 + // 支付宝,060qq钱包,080京东钱包,090口碑,100翼支付 + String end_time = notify.getString("end_time");// 支付完成时间,yyyyMMddHHmmss,全局统一时间格式 + String out_trade_no = notify.getString("out_trade_no");// 利楚唯一订单号 + String channel_trade_no = notify.getString("channel_trade_no");// 通道订单号,微信订单号、支付宝订单号等 + String attach = notify.getString("attach");// 支付成功原样返回 + String receipt_fee = notify.getString("receipt_fee");// 口碑实收金额,pay_type为090时必填 + String key_sign = notify.getString("key_sign");// 签名字符串,拼装所有必传参数+令牌,32位md5加密转换 + + logger.error(info + "=====returnCode========>" + returnCode); + logger.error(info + "=====resultCode========>" + resultCode); + logger.error(info + "=====resultMsg========>" + resultMsg); + logger.error(info + "=====out_trade_no=======>" + out_trade_no); + logger.error(info + "=====pay_type========>" + pay_type); + logger.error(info + "=====channel_trade_no========>" + channel_trade_no); + logger.error(info + "=====attach========>" + attach); + logger.error(info + "=====total_fee========>" + total_fee); + // 校验签名是否正确 + if (returnCode.equals("01") && resultCode.equals("01")) { + // tenantId+"_"+storeId + String attachArray[] = attach.split("_"); + String tenantId = attachArray[0];// 租户编号 + String storeId = attachArray[1];// 门店ID + String busNo = attachArray[2];// 订单号 + String keysuccess = "wxBusNo:" + tenantId + ":" + storeId + ":" + busNo; + Object busNoValue = cacheService.get(tenantId, keysuccess); + if (busNoValue != null && busNo.equals(busNoValue.toString().split("_")[0])) { + payNotifyResponse.setReturnCode("SUCCESS"); + payNotifyResponse.setReturnMsg("OK"); + logger.error(info + "支付成功,订单信息上传成功"); + return payNotifyResponse; + } + VposStoreBusinessTicket enity = vposStoreBusinessTicketService.find(tenantId, "no", busNo); + if (enity.getReceivable() != (Double.parseDouble(total_fee) / 100)) { + payNotifyResponse.setReturnCode("SUCCESS"); + payNotifyResponse.setReturnMsg("OK"); + logger.error(info + "支付成功,单订金额不符"); + return payNotifyResponse; + } + // 生成取餐号 + DateFormat fmt = new SimpleDateFormat("yyyyMMdd"); + String day = fmt.format(new Date()); + String key = "wxBus:" + tenantId + ":" + storeId + ":" + day; + cacheService.setQueue(tenantId, key, enity.getNo(), 60 * 60 * 24); + int random = (int) (Math.random() * 10 + 1); + String busMode = "T"; + if (enity.getBusMode() == 0) { + busMode = "T"; + } else { + busMode = "W"; + } + String datSeq = busMode + random + String.format("%0" + 5 + "d", cacheService.getQueueSize(tenantId, key)); + logger.error("单号:" + enity.getNo() + "=============>" + datSeq); + enity.setSeqNo(datSeq);// 取餐号 + enity.setStatus(4);// 更改主单为支付成功状态 + // 门店菜品销售记录优惠明细校验开始 + List payList = new ArrayList<>(); + Date createDate = new Date(); + VposStorePay storePay = new VposStorePay(); + storePay.setCreateDate(createDate); + storePay.setCreateUser("open-api"); + storePay.setClientId(enity.getClientId()); + storePay.setStoreId(enity.getStoreId()); + storePay.setStoreNo(enity.getStoreNo()); + storePay.setStoreName(enity.getStoreName()); + storePay.setBusNo(enity.getNo()); + storePay.setBusMode(enity.getBusMode()); + storePay.setPayNo(enity.getNo()); + storePay.setTableNo(enity.getTableNo()); + String notifyPayType = ""; + if ("020".equals(pay_type)) { + storePay.setPayTypeNo("04"); + storePay.setPayType("支付宝"); + storePay.setMemo("扫呗支付宝支付成功"); + notifyPayType = "ALIPAY"; + } else if ("010".equals(pay_type)) { + storePay.setPayTypeNo("05"); + storePay.setPayType("微信支付"); + storePay.setMemo("扫呗微信支付成功"); + notifyPayType = "WEIXIN"; + } else { + storePay.setPayTypeNo("05"); + storePay.setPayType("微信支付"); + storePay.setMemo("扫呗微信支付成功"); + notifyPayType = "WEIXIN"; + } + storePay.setPayDate(createDate); + storePay.setPaid(Double.parseDouble(total_fee) / 100); + storePay.setRchange(0.00); + storePay.setMoney(Double.parseDouble(total_fee) / 100); + storePay.setOverAmount(0.00); + storePay.setWorkNo(enity.getWorkNo()); + storePay.setDeviceName(enity.getDeviceName()); + storePay.setDeviceMac(enity.getDeviceMac()); + storePay.setDeviceIp(enity.getDeviceIp()); + storePay.setPosNo(enity.getPosNo()); + storePay.setVoucherNo(out_trade_no); + storePay.setCardno(""); + storePay.setCardYe(0.00); + storePay.setCardJf(0.00); + storePay.setIncomeFlag(1); + storePay.setOtherRateType(0); + storePay.setOtherRateValue(0.00); + storePay.setOtherRate(0.00); + storePay.setPayChannel(8);// 扫呗支付 + payList.add(storePay); + StoreBusinessTicketCheck ticketCheck = vposStoreBusinessTicketService.updateBusinessTicket(tenantId, enity, payList); + if ("1".equals(ticketCheck.getStatus())) { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("busNo", enity.getNo())); + // 获取主单优惠 + List ticketInfoList = vposStoreBusinessTicketInfoService.getList(tenantId, criteria); + // 获取订单商品信息 + List orderProductList = vposStoreOrderProductService.getList(tenantId, criteria); + // 获取产品优惠信息 + List orderProductInfoList = vposStoreOrderProductInfoService.getList(tenantId, criteria); + // 获取产品做法信息 + List makeList = vposStoreOrderProductMakeService.getList(tenantId, criteria); + // 订单进行分单 + sendMessage(tenantId, storeId, enity, orderProductList, makeList); + try { + // 存储支付成功的Key + cacheService.set(tenantId, keysuccess, busNo + "_" + datSeq + "_" + notifyPayType, 60 * 60 * 24); + // 发送支付成功通知 + Map map = new HashMap<>(); + map.put("type", 1);// 支付成功通知 + map.put("openId", enity.getOpenId());// 用户ID + map.put("busNo", busNo);// 业务单号 + map.put("date", new Date());// 日期 + map.put("amount", Double.parseDouble(total_fee) / 100); + logger.error("weixinpay/" + tenantId + "/" + storeId + "/" + enity.getOpenId()); + logger.error(JSON.toJSONString(map, SerializerFeature.WriteDateUseDateFormat)); + mqttClient.Publish("weixinpay/" + tenantId + "/" + storeId + "/" + enity.getOpenId(), JSON.toJSONString(map, SerializerFeature.WriteDateUseDateFormat)); + // 将时间改为支付时间 + enity.setSaleDate(createDate); + if (CollectionUtils.isNotEmpty(ticketInfoList)) { + for (VposStoreBusinessTicketInfo vposStoreBusinessTicketInfo : ticketInfoList) { + vposStoreBusinessTicketInfo.setSaleDate(createDate); + } + } + if (CollectionUtils.isNotEmpty(orderProductList)) { + for (VposStoreOrderProduct vposStoreOrderProduct : orderProductList) { + vposStoreOrderProduct.setSaleDate(createDate); + } + } + if (CollectionUtils.isNotEmpty(orderProductInfoList)) { + for (VposStoreOrderProductInfo vposStoreOrderProductInfo : orderProductInfoList) { + vposStoreOrderProductInfo.setSaleDate(createDate); + } + } + if (CollectionUtils.isNotEmpty(makeList)) { + for (VposStoreOrderProductMake vposStoreOrderProductMake : makeList) { + vposStoreOrderProductMake.setSaleDate(createDate); + } + } + // 数据上传 + // 放入消息队列 + Map message = new HashMap<>(); + message.put("type", "businessorderplus"); + message.put("storeBusinessTicket", enity); + message.put("ticketInfoList", ticketInfoList); + message.put("orderProductList", orderProductList); + message.put("orderProductInfoList", orderProductInfoList); + message.put("payList", payList); + message.put("makeList", makeList); + message.put("deliveryList", new ArrayList()); + CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString()); + this.mqMessageSender.send4businessorderplus(tenantId, message, correlationData); + logger.error(info + "销售数据上传发送成功"); + // 支付成功减少库存 + // 放入消息队列 + Map stockMessage = new HashMap<>(); + stockMessage.put("type", "productsalestock"); + stockMessage.put("orderProductList", orderProductList); + CorrelationData correlationData1 = new CorrelationData(UUID.randomUUID().toString()); + this.mqMessageSender.send4productsalestock(tenantId, stockMessage, correlationData1); + logger.error(info + "支付扣减库存发送成功"); + Map data = new HashMap<>(); + data.put("busNo", enity.getNo()); + data.put("ticketId", ticketCheck.getTicketId()); + data.put("seqNo", datSeq); + payNotifyResponse.setReturnCode("01"); + payNotifyResponse.setReturnMsg("SUCCESS"); + logger.error(info + "支付成功,订单信息上传成功"); + } catch (Exception ex) { + payNotifyResponse.setReturnCode("02"); + payNotifyResponse.setReturnMsg("ERROR"); + logger.error(info, ex); + } + } else { + payNotifyResponse.setReturnCode("02"); + payNotifyResponse.setReturnMsg("ERROR"); + logger.error(info + "支付订单信息保存失败"); + } + } else { + payNotifyResponse.setReturnCode("02"); + payNotifyResponse.setReturnMsg("ERROR"); + logger.error(info + "支付订单信息保存失败"); + } + } catch (Exception e) { + payNotifyResponse.setReturnCode("02"); + payNotifyResponse.setReturnMsg("ERROR"); + logger.error(info, e); + } + return payNotifyResponse; + } + + /** + * 扫呗小程序点餐支付接口回调 + * + * @param request + * @param response + * @return + */ + private PayNotifyResponse saoBeiProgramNotify(HttpServletRequest request, HttpServletResponse response) { + String info = "微信小程序-扫呗通知异步回调 notify "; + PayNotifyResponse payNotifyResponse = new PayNotifyResponse(); + String returnStatus = "SUCCESS"; + RLock lock = null; + try { + String resquestBody = HttpTool.getResquestBody(request); + JSONObject notify = JSON.parseObject(resquestBody); + String returnCode = notify.getString("return_code"); + String resultCode = notify.getString("result_code"); + String resultMsg = notify.getString("return_msg"); + String user_id = notify.getString("user_id");// 付款方用户id,“微信openid”、“支付宝账户”、“qq号”等 + String merchant_name = notify.getString("merchant_name");// 商户名称 + String merchant_no = notify.getString("merchant_no");// 商户号 + String terminal_id = notify.getString("terminal_id");// 终端号 + String terminalTrace = notify.getString("terminal_trace");// 终端流水号,此处传商户发起预支付或公众号支付时所传入的交易流水号 + String terminal_time = notify.getString("terminal_time");// 终端交易时间,yyyyMMddHHmmss,全局统一时间格式(01时参与拼接) + String pay_trace = notify.getString("pay_trace");// 当前支付终端流水号,与pay_time同时传递,返回时不参与签名 + String pay_time = notify.getString("pay_time");// 当前支付终端交易时间,yyyyMMddHHmmss,全局统一时间格式,与pay_trace同时传递 + String total_fee = notify.getString("total_fee");// 支付金额 + String pay_type = notify.getString("pay_type");// 请求类型,010微信,020 + // 支付宝,060qq钱包,080京东钱包,090口碑,100翼支付 + String end_time = notify.getString("end_time");// 支付完成时间,yyyyMMddHHmmss,全局统一时间格式 + String out_trade_no = notify.getString("out_trade_no");// 利楚唯一订单号 + String channel_trade_no = notify.getString("channel_trade_no");// 通道订单号,微信订单号、支付宝订单号等 + String attach = notify.getString("attach");// 支付成功原样返回 + String receipt_fee = notify.getString("receipt_fee");// 口碑实收金额,pay_type为090时必填 + String key_sign = notify.getString("key_sign");// 签名字符串,拼装所有必传参数+令牌,32位md5加密转换 + + logger.error(info + "=====returnCode========>" + returnCode); + logger.error(info + "=====resultCode========>" + resultCode); + logger.error(info + "=====resultMsg========>" + resultMsg); + logger.error(info + "=====out_trade_no=======>" + out_trade_no); + logger.error(info + "=====pay_type========>" + pay_type); + logger.error(info + "=====channel_trade_no========>" + channel_trade_no); + logger.error(info + "=====attach========>" + attach); + logger.error(info + "=====total_fee========>" + total_fee); + // 校验签名是否正确 + if (returnCode.equals("01") && resultCode.equals("01")) { + // tenantId+"_"+storeId + String attachArray[] = attach.split("_"); + String tenantId = attachArray[0];// 租户编号 + String storeId = attachArray[1];// 门店ID + String busNo = attachArray[2];// 订单号 + String keysuccess = "programBusNo:" + tenantId + ":" + storeId + ":" + busNo; + lock = redissonClient.getLock(keysuccess); + lock.lock(5,TimeUnit.SECONDS); + Object busNoValue = cacheService.get(tenantId, keysuccess); + if (busNoValue != null && busNo.equals(busNoValue.toString().split("_")[0])) { + payNotifyResponse.setReturnCode("SUCCESS"); + payNotifyResponse.setReturnMsg("OK"); + logger.error(info + "支付成功,订单信息上传成功"); + return payNotifyResponse; + } + ProgramStoreBusinessTicket enity = programStoreBusinessTicketService.find(tenantId, "no", busNo); + // 支付金额= 订单应收+餐盒费+配送费 + if ((enity.getReceivable() + enity.getPackageFee() + enity.getDeliverFee()) != (Double.parseDouble(total_fee) / 100)) { + payNotifyResponse.setReturnCode("SUCCESS"); + payNotifyResponse.setReturnMsg("OK"); + logger.error(info + "支付成功,单订金额不符"); + return payNotifyResponse; + } + // 生成取餐号 + DateFormat fmt = new SimpleDateFormat("yyyyMMdd"); + String day = fmt.format(new Date()); + String key = "wxBus:" + tenantId + ":" + storeId + ":" + day; + cacheService.setQueue(tenantId, key, enity.getNo(), 60 * 60 * 24); + //int random = (int) (Math.random() * 10 + 1); + String datSeq = ""; + //按南宁要求,取餐号为 600-799 2020-04-10 13:49 + if(StringUtils.startsWith(tenantId,"77")){ + int queueSize = cacheService.getQueueSize(tenantId, key); + int daySize = queueSize + 600; + logger.error("单号:" + enity.getNo() + " queueSize =============>" + queueSize); + if(daySize >= 800){ + int index = queueSize / 200; + daySize = daySize-200*index; + logger.error("单号:" + enity.getNo() + " daySize =============>" + daySize); + } + datSeq = daySize+""; + }else{ + String random = "0"; + String busMode = "T"; + if (enity.getBusMode() == 0) { + busMode = "T"; + } else if (enity.getBusMode() == 1) { + busMode = "D"; + } else if (enity.getBusMode() == 2) { + busMode = "Y"; + } else { + busMode = "W"; + } + String suffix = String.format("%0" + 3 + "d", cacheService.getQueueSize(tenantId, key)); + + if(suffix.length() > 3){ + datSeq = busMode + suffix; + }else{ + datSeq = busMode + random + suffix; + } + } + + logger.error("单号:" + enity.getNo() + "=============>" + datSeq); + enity.setSeqNo(datSeq);// 取餐号 + enity.setStatus(0);// 更改主单为待接单状态 + // 门店菜品销售记录优惠明细校验开始 + List payList = new ArrayList<>(); + Date createDate = new Date(); + ProgramStorePay storePay = new ProgramStorePay(); + storePay.setProgramId(enity.getProgramId()); + storePay.setCreateDate(createDate); + storePay.setCreateUser("open-api"); + storePay.setClientId(enity.getClientId()); + storePay.setStoreId(enity.getStoreId()); + storePay.setStoreNo(enity.getStoreNo()); + storePay.setStoreName(enity.getStoreName()); + storePay.setBusNo(enity.getNo()); + storePay.setBusMode(enity.getBusMode()); + storePay.setPayNo(enity.getNo()); + storePay.setTableNo(enity.getTableNo()); + String notifyPayType = ""; + if ("020".equals(pay_type)) { + storePay.setPayTypeNo("04"); + storePay.setPayType("支付宝"); + storePay.setMemo("扫呗支付宝支付成功"); + notifyPayType = "ALIPAY"; + } else if ("010".equals(pay_type)) { + storePay.setPayTypeNo("05"); + storePay.setPayType("微信支付"); + storePay.setMemo("扫呗微信支付成功"); + notifyPayType = "WEIXIN"; + } else { + storePay.setPayTypeNo("05"); + storePay.setPayType("微信支付"); + storePay.setMemo("扫呗微信支付成功"); + notifyPayType = "WEIXIN"; + } + storePay.setPayDate(createDate); + storePay.setPaid(Double.parseDouble(total_fee) / 100); + storePay.setRchange(0.00); + storePay.setMoney(Double.parseDouble(total_fee) / 100); + storePay.setOverAmount(0.00); + storePay.setVoucherNo(out_trade_no); + storePay.setCardno(""); + storePay.setCardYe(0.00); + storePay.setCardJf(0.00); + storePay.setIncomeFlag(1); + storePay.setOtherRateType(0); + storePay.setOtherRateValue(0.00); + storePay.setOtherRate(0.00); + storePay.setPayChannel(8);// 扫呗支付 + storePay.setDeductionRate(enity.getDeductionRate()); + storePay.setChargeBack(enity.getChargeBack()); + storePay.setSettleFlag(0); + payList.add(storePay); + StoreBusinessTicketCheck ticketCheck = programStoreBusinessTicketService.updateBusinessTicket(tenantId, enity, payList); + if ("1".equals(ticketCheck.getStatus())) { + try { + // 存储支付成功的Key + cacheService.set(tenantId, keysuccess, busNo + "_" + datSeq + "_" + notifyPayType, 60 * 60 * 24); + // 门店信消息压进缓存 + try { + Object programOrderIds = cacheService.get(tenantId, "program_" + storeId); + if (programOrderIds != null) { + Map orderIds = (Map) cacheService.get(tenantId, "program_" + storeId); + orderIds.put(String.valueOf(enity.getNo()), String.valueOf(enity.getNo())); + cacheService.set(tenantId, "program_" + storeId, orderIds, 1200); + } else { + Map orderIds = new HashMap<>(); + orderIds.put(String.valueOf(enity.getNo()), String.valueOf(enity.getNo())); + cacheService.set(tenantId, "program_" + storeId, orderIds, 1200); + } + } catch (Exception e) { + logger.error(info + "创建订单推送创建缓存失败>>>>>>>>>>"); + } + //前台阿布订阅模型 + sendProgramMessage("cy2", tenantId, storeId); + Map orderMap = new HashMap<>(); + orderMap.put("tenantId",tenantId); + orderMap.put("storeId",storeId); + orderMap.put("orderNo",enity.getNo()); + orderMap.put("reSendNums",0); + this.mqMessageSender.send4jwprogramordermessage(tenantId,orderMap, RabbitConstant.ROUTING_KEY_JW_PROGRAM_ORDER_NOTIFY_DELAY,new CorrelationData(UUID.randomUUID().toString()),1000L*60); + //启动退款定时任务,3分钟不接单自动退款 + Map eventDatas = new HashMap<>(); + eventDatas.put("tenantId", tenantId); + eventDatas.put("storeId", storeId); + eventDatas.put("busNo", busNo); + eventBus.notify(EventKeys.PROGRAM_ORDER_PAY, Event.wrap(eventDatas)); + payNotifyResponse.setReturnCode("01"); + payNotifyResponse.setReturnMsg("SUCCESS"); + logger.error(info + "支付成功,订单信息上传成功"); + } catch (Exception ex) { + payNotifyResponse.setReturnCode("02"); + payNotifyResponse.setReturnMsg("ERROR"); + logger.error(info, ex); + } + } else { + payNotifyResponse.setReturnCode("02"); + payNotifyResponse.setReturnMsg("ERROR"); + logger.error(info + "支付订单信息保存失败"); + } + + RMapCache stringMapRMapCache = redissonClient.getMapCache("weixin:small:loginKey:session"); + if(stringMapRMapCache.get(user_id) != null){ + String loginKey = stringMapRMapCache.get(user_id); + if(StringUtils.isNotBlank(loginKey)){ + RMapCache> sSessionMap = redissonClient.getMapCache("weixin:small:session"); + if(sSessionMap.get(loginKey) != null){ + Map data = sSessionMap.get(loginKey); + if(data.get("sessionKey") != null && StringUtils.isNotBlank(data.get("sessionKey").toString())){ + logger.info("扫呗订单上传异步任务:tradeNo"+busNo); + //扫呗订单上传; + Map eventData = new HashMap<>(); + eventData.put("tenantId", tenantId); + eventData.put("ticketId", enity.getId()); + eventData.put("merchant_no", merchant_no); + eventData.put("terminal_id", terminal_id); + eventData.put("out_order_no", out_trade_no); + eventData.put("transaction_id", channel_trade_no); + eventData.put("user_id", user_id); + eventData.put("session_key", data.get("sessionKey").toString()); + eventData.put("out_trade_no", busNo); + eventData.put("storeNo", enity.getStoreNo()); + eventData.put("storeId", enity.getStoreId()); + eventData.put("total_amount", ((Double)(enity.getAmount()*100)).intValue()); + eventData.put("discount_amount", ((Double)(enity.getDiscountTotal()*100)).intValue()); + eventData.put("user_amount", ((Double)(enity.getReceivable()*100)).intValue()); + + eventBus.notify(EventKeys.PROGRAM_ORDER_SAOBEI_UPLOAD, Event.wrap(eventData)); + }else{ + logger.info("扫呗订单上传异步任务:sessionKey 不存在"); + } + }else{ + logger.info("扫呗订单上传异步任务:sSessionMap 不存在"); + } + }else{ + logger.info("扫呗订单上传异步任务:loginKey"+loginKey+" ---------------- >>>>> 失败"); + } + }else{ + logger.info("扫呗订单上传异步任务:user_id"+user_id+" ---------------- >>>>> 失败"); + } + } else { + payNotifyResponse.setReturnCode("02"); + payNotifyResponse.setReturnMsg("ERROR"); + logger.error(info + "支付订单信息保存失败"); + } + } catch (Exception e) { + payNotifyResponse.setReturnCode("02"); + payNotifyResponse.setReturnMsg("ERROR"); + logger.error(info, e); + }finally { + if(lock != null){ + lock.unlock(); + } + } + return payNotifyResponse; + } + + /** + * 小程序订单订阅模型 + * @param appSign + * @param tenantId + * @param storeId + */ + public void sendProgramMessage(String appSign, String tenantId, String storeId) { + DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String info = "小程序订单订阅模型====>"; + try { + Map orderIds = (Map) cacheService.get(tenantId, "program_" + storeId); + String ids = ""; + for (Map.Entry entry : orderIds.entrySet()) { + ids = ids + entry.getKey() + ","; + } + if (ids.length() > 0) { + ids = ids.substring(0, ids.length() - 1); + } + if (ids != null && !"".equals(ids)) { + Map order = new HashMap<>(); + order.put("program", ids); + order.put("date", fmt.format(new Date())); + mqttClient.Publish("program/" + appSign + "/" + tenantId + "/" + storeId, JSONUtil.toJSONString(order)); + logger.error(info + "program/" + appSign + "/" + tenantId + "/" + storeId, JSONUtil.toJSONString(order)); + } else { + logger.error(info + "未发布"); + } + } catch (Exception e) { + logger.error(info + "发布订阅模型时处理时,发生异常", e); + } + } + + /** + * 发布厨打订阅 + * + * @param tenantId + * @param storeId + * @param enity + * @param orderProduct + */ + public void sendMessage(String tenantId, String storeId, VposStoreBusinessTicket enity, List orderProduct, List productMakeList) { + DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String info = "厨打通订阅模型====>"; + try { + Map map = new HashMap<>(); + map.put("id", enity.getId()); + map.put("tenantId", enity.getTenantId()); + map.put("mobile", enity.getMobile()); + map.put("no", enity.getNo()); + map.put("storeId", enity.getStoreId()); + map.put("storeNo", enity.getStoreNo()); + map.put("storeName", enity.getStoreName()); + map.put("status", enity.getStatus()); + map.put("saleDate", enity.getSaleDate()); + map.put("tableNo", enity.getTableNo()); + map.put("people", enity.getPeople()); + map.put("busMode", enity.getBusMode()); + map.put("amount", enity.getAmount()); + map.put("discount", enity.getDiscount()); + map.put("discountTotal", enity.getDiscountTotal()); + map.put("receivable", enity.getReceivable()); + map.put("maling", enity.getMaling()); + map.put("paid", enity.getPaid()); + map.put("noOrg", enity.getNoOrg()); + map.put("backCause", enity.getBackCause()); + map.put("seqNo", enity.getSeqNo()); + map.put("ext1", enity.getExt1()); + map.put("ext2", enity.getExt2()); + map.put("posNo", enity.getPosNo()); + map.put("workNo", enity.getWorkNo()); + map.put("deviceIp", enity.getDeviceIp()); + map.put("deviceMac", enity.getDeviceMac()); + map.put("deviceName", enity.getDeviceName()); + List> groupList = getListByGroup(orderProduct); + for (List productList : groupList) { + List> productInfo = new ArrayList<>(); + String seriesId = ""; + for (VposStoreOrderProduct product : productList) { + seriesId = product.getSeriesId(); + Map productMap = new HashMap<>(); + productMap.put("id", product.getId()); + productMap.put("clientId", product.getClientId()); + productMap.put("parentId", product.getParentId()); + productMap.put("storeId", product.getStoreId()); + productMap.put("storeNo", product.getStoreNo()); + productMap.put("storeName", product.getStoreName()); + productMap.put("ticketId", product.getTicketId()); + productMap.put("busNo", product.getBusNo()); + productMap.put("busMode", product.getBusMode()); + productMap.put("tableNo", product.getTableNo()); + productMap.put("productId", product.getProductId()); + productMap.put("productNo", product.getProductNo()); + productMap.put("productName", product.getProductName()); + productMap.put("productUnitId", product.getProductUnitId()); + productMap.put("productUnitName", product.getProductUnitName()); + productMap.put("seriesId", product.getSeriesId()); + productMap.put("seriesName", product.getSeriesName()); + productMap.put("typePath", product.getTypePath()); + productMap.put("typeId", product.getTypeId()); + productMap.put("typeName", product.getTypeName()); + productMap.put("specId", product.getSpecId()); + productMap.put("specName", product.getSpecName()); + productMap.put("count", product.getCount()); + productMap.put("rcount", product.getRcount()); + productMap.put("price", product.getPrice()); + productMap.put("priceOrg", product.getPriceOrg()); + productMap.put("discountPrice", product.getDiscountPrice()); + productMap.put("isSuit", product.getIsSuit()); + productMap.put("suitId", product.getSuitId()); + productMap.put("saleDate", product.getSaleDate()); + productMap.put("amount", product.getAmount()); + productMap.put("discount", product.getDiscount()); + productMap.put("discountTotal", product.getDiscountTotal()); + productMap.put("receivable", product.getReceivable()); + productMap.put("addPriceTotal", product.getAddPriceTotal()); + productMap.put("discountAddTotal", product.getDiscountAddTotal()); + productMap.put("amountAddTotal", product.getAmountAddTotal()); + productMap.put("amountTotal", product.getAmountTotal()); + productMap.put("receivableTotal", product.getReceivableTotal()); + productMap.put("lineNo", product.getLineNo()); + productMap.put("seqNo", product.getSeqNo()); + productMap.put("tableName", product.getTableName()); + List> makeInfo = new ArrayList<>(); + if (productMakeList != null && productMakeList.size() > 0) { + for (VposStoreOrderProductMake make : productMakeList) { + if (product.getClientId().equals(make.getOrderItemId())) { + Map makeMap = new HashMap<>(); + makeMap.put("id", make.getId()); + makeMap.put("clientId", make.getClientId()); + makeMap.put("orderItemId", make.getOrderItemId()); + makeMap.put("storeId", make.getStoreId()); + makeMap.put("storeNo", make.getStoreNo()); + makeMap.put("storeName", make.getStoreName()); + makeMap.put("ticketId", make.getTicketId()); + makeMap.put("busNo", make.getBusNo()); + makeMap.put("makeId", make.getMakeId()); + makeMap.put("makeName", make.getMakeName()); + makeMap.put("addPrice", make.getAddPrice()); + makeMap.put("discountPrice", make.getDiscountPrice()); + makeMap.put("count", make.getCount()); + makeMap.put("rcount", make.getRcount()); + makeMap.put("addTotal", make.getAddTotal()); + makeMap.put("discountAddTotal", make.getDiscountAddTotal()); + makeMap.put("discount", make.getDiscount()); + makeMap.put("qtyFlag", make.getQtyFlag()); + makeMap.put("hand", make.getHand()); + makeMap.put("saleDate", make.getSaleDate()); + makeMap.put("tableNo", make.getTableNo()); + makeMap.put("tableName", make.getTableName()); + makeInfo.add(makeMap); + } + } + } + productMap.put("makeInfo", makeInfo); + productInfo.add(productMap); + } + map.put("productInfo", productInfo); + // 根据分类进行数据分发 + logger.error(info + "eprint/" + tenantId + "/" + storeId + "/" + seriesId); + logger.error(JSON.toJSONString(map, SerializerFeature.WriteDateUseDateFormat)); + mqttClient.Publish("eprint/" + tenantId + "/" + storeId + "/" + seriesId, JSON.toJSONString(map, SerializerFeature.WriteDateUseDateFormat)); + + } + } catch (Exception e) { + logger.error(info + "发布订阅模型时处理时,发生异常", e); + } + } + + private static List> getListByGroup(List list) { + List> result = new ArrayList>(); + Map> map = new TreeMap>(); + + for (VposStoreOrderProduct bean : list) { + if (map.containsKey(bean.getSeriesId())) { + List t = map.get(bean.getSeriesId()); + t.add(bean); + map.put(bean.getSeriesId(), t); + } else { + List t = new ArrayList(); + t.add(bean); + map.put(bean.getSeriesId(), t); + } + } + for (Entry> entry : map.entrySet()) { + result.add(entry.getValue()); + } + return result; + } + +// public static void main(String[] args) { +// Double value = 10.03; +// String total_fee = "1003"; +// System.out.println(Double.parseDouble(total_fee) / 100); +// System.out.println(RandomUtil.format2(10.03)); +// System.out.println(Double.parseDouble(total_fee) / 100); +//// if (RandomUtil.format2(enity.getReceivable() + enity.getPackageFee() + enity.getDeliverFee()) != RandomUtil.format2(Double.parseDouble(total_fee) / 100)) { +//// payNotifyResponse.setReturnCode("SUCCESS"); +//// payNotifyResponse.setReturnMsg("OK"); +//// logger.error(info + "支付成功,单订金额不符"); +//// return payNotifyResponse; +//// } +// } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/controller/callback/CandaoDispatchCallBackController.java b/food-open/food-open-api/src/main/java/com/jwsaas/controller/callback/CandaoDispatchCallBackController.java new file mode 100644 index 0000000..1e33406 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/controller/callback/CandaoDispatchCallBackController.java @@ -0,0 +1,181 @@ +package com.jwsaas.controller.callback; + + +import com.jwsaas.Constant; +import com.jwsaas.controller.open.BaseOpenController; +import com.jwsaas.entity.food.ProgramStoreBusinessTicket; +import com.jwsaas.entity.food.ProgramStoreBusinessTicketDeliver; +import com.jwsaas.mqtt.MqttClientExt; +import com.jwsaas.open.Global; +import com.jwsaas.service.food.ProgramStoreBusinessTicketDeliverService; +import com.jwsaas.util.JSONUtil; +import com.jwsaas.util.StringUtils; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.CompletableFuture; + +@Controller(Global.SIGN + "CandaoDispatchCallBackController") +@RequestMapping(Global.OPEN_PATH + "/callback/candao/dispatch") +public class CandaoDispatchCallBackController extends BaseOpenController { + + @Resource + private com.jwsaas.service.food.ProgramStoreBusinessTicketService programStoreBusinessTicketService; + @Resource + private ProgramStoreBusinessTicketDeliverService programStoreBusinessTicketDeliverService; + + @Resource + private MqttClientExt mqttClient; + + @RequestMapping("status") + @ResponseBody + public Object callback(Model model, HttpServletRequest request, HttpServletResponse response) { + String info = "餐道配送回调信息"; + logger.debug(info + "callback......"); + logger.debug(info + "request.parameterMap:" + request.getParameterMap()); + logger.debug(info + "request.ContentLength:" + request.getContentLength()); + logger.debug(info + "request.parameterMap.json:" + JSONUtil.toJSONString(request.getParameterMap())); + + Map result = new HashMap<>(); + try { + /*-1待下单 0已下单 1骑手接单 2骑手已取餐 3骑手已送达 4配送取消 5骑手配送中 + * 骑手状态 + * 1:待推送(用于配送系统不支持预约单情况下,开放平台保留订单延迟推送的状态); + * 2:待接单;5:已分配;6:已到店;7:配送中;10:已送达;15:已取消;-1:呼叫失败; + * -2:配送异常;-3:取消失败;4:待转派(15、-1,-2 需要重新呼叫骑手);-4:分配超时;-5:取餐超时; + * 8:转派中(表示DMS当前转派的第三方骑手公司失败,正转派下一家骑手公司 或 DMS出现配送异常,正转派其他骑手); + * 9:门店自送;-100:未知状态 + * */ + String tenantId = getParameter(request, "tenantId"); + String ticketId = getParameter(request, "orderId"); + Integer status = Integer.parseInt(getParameter(request, "deliveryStatus")) ; + logger.info(info + "tenantId:" + tenantId); + logger.info(info + "ticketId:" + ticketId); + if(StringUtils.isEmpty(tenantId)){ + result.put("message", "error"); + return result; + } + + CompletableFuture.supplyAsync(()->{ + String deliverySysName = getParameter(request,"deliverySysName");//配送公司 + String logisticsDispatcherName = getParameter(request,"riderName");//骑手名称 + String logisticsDispatcherMobile = getParameter(request,"riderPhone");//骑手电话 + String logisticsReceiptTime = getParameter(request,"deliveryStartTime");//骑手接单时间 + String logisticsFinishTime = getParameter(request,"deliveryEndTime");//骑手送达时间 + String logisticsFetchTime = getParameter(request,"ongoingTime");//骑手取餐时间 + String reason = getParameter(request,"remark");//配送取消原因 + + int deliverStatus = -1; + if(status != 1){ + switch (status){ + case 2: + case -4: + case 4: + case -1: + case -2: + case 8: + deliverStatus = 0; + break; + case 5: + case -5: + deliverStatus = 1; + break; + case 6: + deliverStatus = 2; + break; + case 7: + deliverStatus = 5; + break; + case 10: + deliverStatus = 3; + break; + case 15: + deliverStatus = 4; + break; + default: + logger.info(info+"配送其他类型信息,status>>>>>"+status); + break; + } + + try{ + ProgramStoreBusinessTicket ticket = programStoreBusinessTicketService.get(tenantId,ticketId); + if(ticket != null) { + ticket.setDeliverStatus(deliverStatus); + ProgramStoreBusinessTicketDeliver deliver = programStoreBusinessTicketDeliverService.find(tenantId, "ticketId", ticketId); + deliver.setTicketId(null); + deliver.setDeliverComName(deliverySysName); + deliver.setLogisticsDispatcherName(logisticsDispatcherName); + deliver.setLogisticsDispatcherMobile(logisticsDispatcherMobile); + deliver.setLogisticsReceiptTime(logisticsReceiptTime); + deliver.setLogisticsFetchTime(logisticsFetchTime); + deliver.setLogisticsFinishTime(logisticsFinishTime); + deliver.setExt1(reason); + deliver.setModifyDate(new Date()); + deliver.setModifyUser(Constant.CREATE_USER); + programStoreBusinessTicketDeliverService.update(tenantId, deliver); + programStoreBusinessTicketService.update(tenantId, ticket); + + //配送员接单,配送取消,向小程序推送消息 + if(deliverStatus == 1 || deliverStatus == 4){ + sendMessage(tenantId,ticket.getNo(),deliverStatus); + } + }else{ + return "error"; + } + }catch (Exception e){ + logger.error(info + "处理订单状态时,发生异常", e); + return "error"; + } + } + return "OK"; + }); + + result.put("message", "ok"); + } catch (Exception e) { + result.put("message", "处理时,发生异常:" + e.getMessage()); + logger.error(info + "处理时,发生异常", e); + } + return result; + } + + + public void sendMessage(String tenantId, String busNo, int status) { + DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String info = "巨为小程序配送订阅模型====>"; + try { + Map message = new HashMap<>(); + message.put("deliverStatus", status); + message.put("date", fmt.format(new Date())); + mqttClient.Publish("wxxcx/delivery/" + tenantId + "/" + busNo, JSONUtil.toJSONString(message)); + logger.error(info + "wxxcx/delivery/" + tenantId + "/" + busNo, JSONUtil.toJSONString(message)); + } catch (Exception e) { + logger.error(info + "发布订阅模型时处理时,发生异常", e); + } + } + + public void sendPosDeliverMessage(String tenantId,String storeId, String busNo, int status,String deliverComName) { + DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String info = "巨为小程序配送POS订阅模型====>"; + try { + Map message = new HashMap<>(); + message.put("deliverStatus", status); + message.put("deliverComName", deliverComName); + message.put("date", fmt.format(new Date())); + mqttClient.Publish("wxxcx/delivery/" + tenantId +"/" + storeId+ "/" + busNo, JSONUtil.toJSONString(message)); + logger.error(info + "wxxcx/delivery/" + tenantId +"/" + storeId + "/" + busNo, JSONUtil.toJSONString(message)); + } catch (Exception e) { + logger.error(info + "发布订阅模型时处理时,发生异常", e); + } + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/controller/open/ApiExtendController.java b/food-open/food-open-api/src/main/java/com/jwsaas/controller/open/ApiExtendController.java new file mode 100644 index 0000000..d1aa4fe --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/controller/open/ApiExtendController.java @@ -0,0 +1,2246 @@ +package com.jwsaas.controller.open; + +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import com.jwsaas.ProgramIndexPictureType; +import com.jwsaas.entity.food.*; +import com.jwsaas.service.food.*; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.http.HttpResponse; +import org.redisson.api.RMapCache; +import org.redisson.api.RedissonClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.fasterxml.jackson.core.type.TypeReference; +import com.jwsaas.Constant; +import com.jwsaas.Constants; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.Tenant; +import com.jwsaas.entity.ops.AppInfo; +import com.jwsaas.entity.ops.AppVersion; +import com.jwsaas.entity.ops.AppWhiteDetail; +import com.jwsaas.entity.ops.ErrorInfo; +import com.jwsaas.entity.ops.UpgradeScheme; +import com.jwsaas.entity.ops.UpgradeStore; +import com.jwsaas.entity.shared.AppAuth; +import com.jwsaas.entity.wxdc.WeixinAccount; +import com.jwsaas.entity.wxyh.WeixinUser; +import com.jwsaas.http.HttpTool; +import com.jwsaas.open.Global; +import com.jwsaas.properties.FdfsClientProperties; +import com.jwsaas.service.TenantService; +import com.jwsaas.service.ops.AppInfoService; +import com.jwsaas.service.ops.AppVersionService; +import com.jwsaas.service.ops.AppWhiteDetailService; +import com.jwsaas.service.ops.ErrorInfoService; +import com.jwsaas.service.ops.UpgradeSchemeService; +import com.jwsaas.service.ops.UpgradeStoreService; +import com.jwsaas.service.shared.AppAuthService; +import com.jwsaas.service.wxdc.WeixinAccountService; +import com.jwsaas.service.wxyh.WeixinUserService; +import com.jwsaas.util.DesUtil; +import com.jwsaas.util.EncryptedDataUtils; +import com.jwsaas.util.JSONUtil; +import com.jwsaas.util.RandomUtil; +import com.jwsaas.utils.BCrypt; +import com.jwsaas.utils.DateUtils; + +/** + * 对外开放的扩展接口 + */ +@Controller(Global.SIGN + "ApiExtendController") +@RequestMapping(Global.OPEN_PATH + "/api/extend") +public class ApiExtendController extends BaseOpenController { + + @Resource + private PosPollcodeService posPollcodeService; + @Resource + private StoreService storeService; + @Resource + private WxStoreService wxStoreService; + @Resource + private StoreWorkerService storeWorkerService; + @Resource + private StoreWorkerExtService storeWorkerExtService; + @Resource + private AppAuthService appAuthService; + @Autowired + private FdfsClientProperties fdfsClientProperties; + @Resource + private AppInfoService appInfoService; + @Resource + private AppVersionService appVersionService; + @Resource + private ErrorInfoService errorInfoService; + @Resource + private StoreTypeService storeTypeService; + @Resource + private WeixinUserService weixinYHService; + @Resource + private com.jwsaas.service.wxdc.WeixinUserService weixindcUserService; + @Resource + protected RedissonClient redissonClient; + @Resource + protected TenantService tenantService; + @Resource + protected UpgradeSchemeService upgradeSchemeService; + @Resource + protected UpgradeStoreService upgradeStoreService; + @Resource + private AgentService agentService; + @Resource + private UserService userService; + @Resource + private AppWhiteDetailService appWhiteDetailService; + @Resource + private WeixinAccountService weixinAccountService; + @Resource + private ProgramSettingService programSettingService; + @Resource + private VposUserService vposUserService; + @Resource + private ProgramIndexPictureService programIndexPictureService; + + + + @RequestMapping(value = "", method = { RequestMethod.POST }) + @ResponseBody + public Object index(String type, HttpServletRequest request, HttpServletResponse response, Model model) { + String info = "扩展API入口"; + + Map result = new HashMap<>(); + result.put("status", "0"); + result.put("message", "操作失败"); + + try { + if (StringUtils.isBlank(type)) { + result.put("message", "缺少必要参数type"); + return result; + } + Map data = null; + switch (type.toLowerCase()) { + case "pollcode": + data = getPosPollcode(request); + break; + case "posversioncheck": + // pos新版本检测 + data = getPosVersionInfo(request); + break; + case "poserrorlog": + // pos错误信息 + data = getPosErrorLog(request); + break; + case "weixinlogin": + // 微信登录验证 + data = weixinLogin(request); + break; + case "cardauth": + // 微信登录验证 + data = cardAuth(request); + break; + case "weixinqrbind": + // 微信二维码绑定 + data = weixinQRBind(request); + break; + case "weixinagentlogin": + // 微信代理商登录验证 + data = weixinAgentLogin(request); + break; + case "wxyhjscode2session": + // 微信要货获取openId和会话密匙session_key + data = wxyhJscode2session(request); + break; + case "wxyhlogin": + // 微信要货登录验证 + data = wxyhLogin(request); + break; + case "wxdcjscode2session": + // 微信要货获取openId和会话密匙session_key + data = wxdcJscode2session(request); + break; + case "wxdcgetuser": + // 微信点餐获取/新增用户信息 + data = wxdcGetUser(request); + break; + case "wxdcgetappauth": + // 微信点餐获取开放平台信息 + data = wxdcGetAppAuth(request); + break; + case "wxdcgetphone": + // 微信点餐获取用户手机号 + data = wxdcGetPhone(request); + break; + case "wxdcedituser": + // 微信点餐更改用户信息 + data = wxdcEditUser(request); + break; + case "wxdcechecksession": + // 微信点餐校验loginkey是否有效 + data = wxdcCheckSession(request); + break; + case "cardgetappkey": + // 会员系统获取餐饮AppKey + data = cardGetAppKey(request); + break; + case "pollcodev1tov2": + // POS注册码校验(v1升级到v2) + data = pollcodeVaildV1ToV2(request); + break; + case "accountinfobywid": + // 根据wid获取账户信息 + data = getAccountInfoByWid(request); + break; + case "programinfobywid": + // 根据wid获取账户信息 + data = getProgramInfoByWid(request); + break; + case "weixinvposwindowlogin": + // 美食广场档口商户登录; + data = weixinVposWindowLogin(request); + break; + case "programbaseinfobyappid": + // 小程序基础信息获取; + data = getProgramBaseInfoByAppId(request); + break; + default: + result.put("status", "0"); + result.put("message", "参数type错误"); + break; + } + + if (data != null) { + if (StringUtils.equals("1", data.get("status").toString())) { + result.put("status", "1"); + result.put("message", "操作成功"); + + data.remove("status"); + data.remove("message"); + + result.put("data", data); + } else { + result.put("status", "0"); + result.put("message", data.get("message").toString()); + } + } + + } catch (Exception e) { + result.put("status", "0"); + result.put("message", e.getMessage()); + logger.error(info + ",业务处理时发生异常", e); + } + + return result; + } + + + private Map getProgramBaseInfoByAppId(HttpServletRequest request) { + String info = "根据appId获取小程序餐饮wid,tenantId"; + Map result = new HashMap<>(); + String appId = getParameter(request, "appId"); + + try{ + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("appId",appId)); + criteria.add(Restrictions.order("createDate","desc")); + List accounts = weixinAccountService.getList(Constant.DEFAULT_DB_SIGN,criteria); + if(CollectionUtils.isNotEmpty(accounts)){ + WeixinAccount account = accounts.get(0); + + result.put("tenantId",account.getTenantCode()); + result.put("wid",account.getHashids()); + result.put("status", "1"); + }else{ + result.put("status", "0"); + result.put("message", "没有查找到账户信息"); + } + + }catch (Exception e){ + result.put("status", "0"); + result.put("message", e.getMessage()); + logger.error(info + ",业务处理时发生异常", e); + } + return result; + } + + + private Map getAccountInfoByWid(HttpServletRequest request) { + String info = "根据wid获取账户信息"; + Map result = new HashMap<>(); + String wid = getParameter(request, "wid"); + + try{ + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("hashids",wid)); + List accounts = weixinAccountService.getList(Constant.DEFAULT_DB_SIGN,criteria); + if(CollectionUtils.isNotEmpty(accounts)){ + WeixinAccount account = accounts.get(0); + JSONObject apisObj = new JSONObject(); + if(StringUtils.isNotEmpty(account.getApis())){ + apisObj = JSON.parseObject(account.getApis()); + } + JSONObject memberObj = new JSONObject(); + if(StringUtils.isNotEmpty(account.getCards())){ + memberObj = JSON.parseObject(account.getCards()); + } + result.put("tenantId",account.getTenantCode()); + result.put("appid",account.getAppId()); + result.put("secret",account.getAppSecret()); + result.put("appKey",apisObj.getString("appKey")); + result.put("appSecret",apisObj.getString("appSecret")); + result.put("storeId",apisObj.getString("storeId")); + result.put("serverUrl",apisObj.getString("url")); + result.put("serverUrlExtend",apisObj.getString("extendUrl")); + result.put("appMemberKey",memberObj.getString("appKey")); + result.put("appMemberSecret",memberObj.getString("appSecret")); + result.put("serverMemberUrl",memberObj.getString("url")); + result.put("serverMemberUrlExtend",memberObj.getString("extendUrl")); + result.put("memberWid",memberObj.getString("mWid")); + result.put("status", "1"); + }else{ + result.put("status", "0"); + result.put("message", "没有查找到账户信息"); + } + + + + }catch (Exception e){ + result.put("status", "0"); + result.put("message", e.getMessage()); + logger.error(info + ",业务处理时发生异常", e); + } + return result; + } + + private Map getPosPollcode(HttpServletRequest request) { + String info = "根据提取码获取AppKey"; + + Map result = new HashMap<>(); + + String tenantId = getParameter(request, "tenantId"); + String pollcode = getParameter(request, "pollcode"); + + if (StringUtils.isBlank(tenantId)) { + result.put("status", "0"); + result.put("message", "缺少必要参数tenantId"); + return result; + } + if (StringUtils.isBlank(pollcode)) { + result.put("status", "0"); + result.put("message", "缺少必要参数pollcode"); + return result; + } + + PosPollcode posPollcode = null; + Store store = null; + StoreType storeType = null; + AppAuth appAuth = null; + AppAuth appAuth4Card = null; + try { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("status", 1)); + criteria.add(Restrictions.eq("tenantCode", tenantId)); + List appAuthlist = appAuthService.getList(Constant.DEFAULT_DB_SIGN, criteria); + if (appAuthlist != null && appAuthlist.size() > 0) { + appAuth = appAuthlist.get(0); + } + if (appAuth == null) { + result.put("status", "0"); + result.put("message", tenantId + "企业编号不存在"); + return result; + } + if ("373001".equals(tenantId) && "888888".equals(pollcode)) { + criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantId", tenantId)); + criteria.add(Restrictions.eq("storeId", "624481659819003904")); + List list = posPollcodeService.getList(tenantId, criteria); + if (list != null) { + posPollcode = list.get(0); + String storeId = posPollcode.getStoreId(); + // String storeNo = posPollcode.getStoreNo(); + store = storeService.get(tenantId, storeId); + + if (store != null) { + storeType = storeTypeService.get(tenantId, store.getTypeId()); + } + } + } else { + criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantId", tenantId)); + criteria.add(Restrictions.eq("pollCode", pollcode)); + criteria.add(Restrictions.between("createDate", DateUtils.format(new Date(), DateUtils.SHOW_DATE_FORMAT) + " 00:00:00", DateUtils.format(DateUtils.addDay(new Date(), 1), DateUtils.SHOW_DATE_FORMAT) + " 00:00:00")); + List list = posPollcodeService.getList(tenantId, criteria); + if (list != null && list.size() == 1) { + posPollcode = list.get(0); + String storeId = posPollcode.getStoreId(); + // String storeNo = posPollcode.getStoreNo(); + store = storeService.get(tenantId, storeId); + + if (store != null) { + storeType = storeTypeService.get(tenantId, store.getTypeId()); + } + } + } + criteria = new Criteria(); + criteria.add(Restrictions.eq("status", 1)); + criteria.add(Restrictions.eq("tenantCode", tenantId)); + appAuthlist = appAuthService.getListWithAppSign(Constant.DEFAULT_DB_SIGN, "card2", criteria); + if (appAuthlist != null && appAuthlist.size() > 0) { + appAuth4Card = appAuthlist.get(0); + } + + } catch (Exception e) { + logger.error(info + ",发生异常", e); + } + + if (posPollcode == null) { + result.put("status", "0"); + result.put("message", "注册码不可用,操作失败"); + } else { + if (store == null) { + result.put("status", "0"); + result.put("message", "注册码对应门店信息不存在,操作失败"); + } else { + result.put("status", "1"); + result.put("message", "操作成功"); + Map storeInfo = new HashMap<>(); + + Map storeTypeInfo = new HashMap<>(); + storeTypeInfo.put("id", storeType.getId()); + storeTypeInfo.put("no", storeType.getNo()); + storeTypeInfo.put("name", storeType.getName()); + storeTypeInfo.put("sign", storeType.getSign()); + storeInfo.put("storeType", storeTypeInfo); + + storeInfo.put("storeId", store.getId()); + storeInfo.put("storeNo", store.getNo()); + storeInfo.put("storeName", store.getName()); + storeInfo.put("storeAddress", store.getAddress()); + + storeInfo.put("appSecret", appAuth.getAppSecret()); + storeInfo.put("appKey", appAuth.getAppKey()); + result.put("store", storeInfo); + + Map cardAuthInfo = new HashMap<>(); + cardAuthInfo.put("appSecret", appAuth4Card == null ? null : appAuth4Card.getAppSecret()); + cardAuthInfo.put("appKey", appAuth4Card == null ? null : appAuth4Card.getAppKey()); + result.put("cardAuth", cardAuthInfo); + + } + } + return result; + } + + private Map getPosVersionInfo(HttpServletRequest request) { + String info = "获取最新终端程序的版本信息以及下载地址"; + Map result = new HashMap<>(); + String appSign = getParameter(request, "appSign");// 应用标识 + if (StringUtils.isBlank(appSign)) { + result.put("status", "0"); + result.put("message", "缺少必要参数appSign"); + return result; + } + String terminalType = getParameter(request, "terminalType");// 应用标识 + if (StringUtils.isBlank(terminalType)) { + result.put("status", "0"); + result.put("message", "缺少必要参数terminalType"); + return result; + } + String versionType = getParameter(request, "versionType");// 版本类型(1:稳定版;2:内测版) + if (StringUtils.isBlank(versionType)) { + result.put("status", "0"); + result.put("message", "缺少必要参数verType"); + return result; + } + String currentVersionNum = getParameter(request, "versionNum");// 当前版本号 + if (StringUtils.isBlank(currentVersionNum)) { + result.put("status", "0"); + result.put("message", "缺少必要参数curVerNum"); + return result; + } + String tenantId = getParameter(request, "tenantId");// 租户ID + String storeNo = getParameter(request, "storeNo");// 门店编号 + String posNo = getParameter(request, "posNo");// 终端设备编号 + if (StringUtils.isBlank(tenantId)) { + result.put("status", "0"); + result.put("message", "缺少必要参数tenantId"); + return result; + } + if (StringUtils.isBlank(posNo)) { + result.put("status", "0"); + result.put("message", "缺少必要参数posNo"); + return result; + } + AppVersion currentVersion = null; + try { + // 不启用白名单的版本 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("appSign", appSign)); + criteria.add(Restrictions.eq("terminalType", terminalType)); + criteria.add(Restrictions.eq("versionType", versionType)); + criteria.add(Restrictions.eq("status", 1));// 1:发布;0:不发布 + criteria.add(Restrictions.gt("versionNum", currentVersionNum)); + criteria.add(Restrictions.le("minVersionNum", currentVersionNum)); + criteria.add(Restrictions.order("minVersionNum", "asc")); + criteria.add(Restrictions.order("versionNum", "desc")); + criteria.add(Restrictions.eq("enableWhite", 0));// 0否1是 + criteria.add(Restrictions.limit("0", "1")); + List versionList = appVersionService.getList(Constant.DEFAULT_DB_SIGN, criteria); + // 通用版本 + AppVersion appVersion = null; + if (CollectionUtils.isNotEmpty(versionList)) { + appVersion = versionList.get(0); + } + // 启用白名有包含该租户和POS的 + List versionWhiteList = null; + + // 先获取白名单 + criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantCode", tenantId)); + criteria.add(Restrictions.eq("posNo", posNo)); + List whiteDetailList = appWhiteDetailService.getList(Constant.DEFAULT_DB_SIGN, criteria); + //根据pos查找升级方案,有升级方案判断此方案是否有效,再根据门店查找,有方案判断是否有效,最后根据租户查找升级方案 2020-03-05 14:55 +// if (CollectionUtils.isEmpty(whiteDetailList)) { +// if (StringUtils.isNotBlank(storeNo)) { +// criteria = new Criteria(); +// criteria.add(Restrictions.eq("tenantCode", tenantId)); +// criteria.add(Restrictions.eq("storeNo", storeNo)); +// criteria.add(Restrictions.isNull("posNo")); +// whiteDetailList = appWhiteDetailService.getList(Constant.DEFAULT_DB_SIGN, criteria); +// } +// +// if (CollectionUtils.isEmpty(whiteDetailList)) { +// criteria = new Criteria(); +// criteria.add(Restrictions.eq("tenantCode", tenantId)); +// criteria.add(Restrictions.isNull("storeNo")); +// criteria.add(Restrictions.isNull("posNo")); +// whiteDetailList = appWhiteDetailService.getList(Constant.DEFAULT_DB_SIGN, criteria); +// } +// } +// +// if (CollectionUtils.isNotEmpty(whiteDetailList)) { +// List planIdList = new ArrayList<>(); +// for (AppWhiteDetail whiteDetail : whiteDetailList) { +// if (!planIdList.contains(whiteDetail.getPlanId())) { +// planIdList.add(whiteDetail.getPlanId()); +// } +// } +// +// versionWhiteList = appVersionService.getListByPlan(Constant.DEFAULT_DB_SIGN, tenantId, storeNo, posNo, appSign, terminalType, 1, versionType, currentVersionNum, planIdList); +// } + + if(CollectionUtils.isNotEmpty(whiteDetailList)){ + versionWhiteList = getAppVersionList(whiteDetailList,tenantId,storeNo,posNo,appSign,terminalType,versionType,currentVersionNum); + + if(CollectionUtils.isEmpty(versionWhiteList)){ + if (StringUtils.isNotBlank(storeNo)) { + criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantCode", tenantId)); + criteria.add(Restrictions.eq("storeNo", storeNo)); + criteria.add(Restrictions.isNull("posNo")); + whiteDetailList = appWhiteDetailService.getList(Constant.DEFAULT_DB_SIGN, criteria); + } + if(CollectionUtils.isNotEmpty(whiteDetailList)){ + versionWhiteList = getAppVersionList(whiteDetailList,tenantId,storeNo,posNo,appSign,terminalType,versionType,currentVersionNum); + + if(CollectionUtils.isEmpty(versionList)){ + criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantCode", tenantId)); + criteria.add(Restrictions.isNull("storeNo")); + criteria.add(Restrictions.isNull("posNo")); + whiteDetailList = appWhiteDetailService.getList(Constant.DEFAULT_DB_SIGN, criteria); + if(CollectionUtils.isNotEmpty(whiteDetailList)){ + versionWhiteList = getAppVersionList(whiteDetailList,tenantId,storeNo,posNo,appSign,terminalType,versionType,currentVersionNum); + } + } + }else{ + criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantCode", tenantId)); + criteria.add(Restrictions.isNull("storeNo")); + criteria.add(Restrictions.isNull("posNo")); + whiteDetailList = appWhiteDetailService.getList(Constant.DEFAULT_DB_SIGN, criteria); + if(CollectionUtils.isNotEmpty(whiteDetailList)){ + versionWhiteList = getAppVersionList(whiteDetailList,tenantId,storeNo,posNo,appSign,terminalType,versionType,currentVersionNum); + } + } + } + }else{ + if (StringUtils.isNotBlank(storeNo)) { + criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantCode", tenantId)); + criteria.add(Restrictions.eq("storeNo", storeNo)); + criteria.add(Restrictions.isNull("posNo")); + whiteDetailList = appWhiteDetailService.getList(Constant.DEFAULT_DB_SIGN, criteria); + } + + if(CollectionUtils.isNotEmpty(whiteDetailList)){ + versionWhiteList = getAppVersionList(whiteDetailList,tenantId,storeNo,posNo,appSign,terminalType,versionType,currentVersionNum); + + if(CollectionUtils.isEmpty(versionWhiteList)){ + criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantCode", tenantId)); + criteria.add(Restrictions.isNull("storeNo")); + criteria.add(Restrictions.isNull("posNo")); + whiteDetailList = appWhiteDetailService.getList(Constant.DEFAULT_DB_SIGN, criteria); + if(CollectionUtils.isNotEmpty(whiteDetailList)){ + versionWhiteList = getAppVersionList(whiteDetailList,tenantId,storeNo,posNo,appSign,terminalType,versionType,currentVersionNum); + } + } + }else{ + criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantCode", tenantId)); + criteria.add(Restrictions.isNull("storeNo")); + criteria.add(Restrictions.isNull("posNo")); + whiteDetailList = appWhiteDetailService.getList(Constant.DEFAULT_DB_SIGN, criteria); + if(CollectionUtils.isNotEmpty(whiteDetailList)){ + versionWhiteList = getAppVersionList(whiteDetailList,tenantId,storeNo,posNo,appSign,terminalType,versionType,currentVersionNum); + } + } + } + + // if (StringUtils.isBlank(storeNo)) { + // versionWhiteList = + // appVersionService.getListByPosNo(Constant.DEFAULT_DB_SIGN, + // tenantId, posNo, appSign, terminalType, 1, versionType, + // currentVersionNum); + // } else { + // versionWhiteList = + // appVersionService.getListExtend(Constant.DEFAULT_DB_SIGN, + // tenantId, storeNo, posNo, appSign, terminalType, 1, versionType, + // currentVersionNum); + // } + + AppVersion appVersionWhite = null; + if (CollectionUtils.isNotEmpty(versionWhiteList)) { + appVersionWhite = versionWhiteList.get(0); + } + + logger.debug("appVersion:" + (appVersion == null ? appVersion : JSONUtil.toJSONString(appVersion))); + logger.debug("versionWhiteList:" + (versionWhiteList == null ? versionWhiteList : JSONUtil.toJSONString(versionWhiteList))); + logger.debug("appVersionWhite:" + (appVersionWhite == null ? appVersionWhite : JSONUtil.toJSONString(appVersionWhite))); + + String dfsAccessDomain = fdfsClientProperties.getAccessDomain(); + if (appVersion == null && appVersionWhite == null) {// 没有任何版本要更新 + result.put("hasNew", false); + } else if (appVersion == null && appVersionWhite != null) {// 白名单升级 + result.put("hasNew", true); + result.put("dfsAccessDomain", dfsAccessDomain);// 文件服务器地址 + result.put("appSign", appVersionWhite.getAppSign());// 应用标识 + result.put("terminalType", appVersionWhite.getTerminalType());// 终端类型 + result.put("versionType", appVersionWhite.getVersionType());// 版本类型 + result.put("versionNum", currentVersionNum);// 版本号 + result.put("newVersionNum", appVersionWhite.getVersionNum());// 新版本号 + result.put("minVersionNum", appVersionWhite.getMinVersionNum());// 升级最低版本 + result.put("checkNum", appVersionWhite.getCheckNum());// MD5 + result.put("fileName", appVersionWhite.getFileName());// 文件名称 + result.put("uploadFile", appVersionWhite.getUploadFile());// 文件路径 + result.put("length", appVersionWhite.getLength());// 文件大小 + result.put("uploadLog", appVersionWhite.getUploadLog());// 升级日志 + result.put("forceUpload", appVersionWhite.getForceUpload());// 强制升级 + result.put("description", appVersionWhite.getDescription());// 备注说明 + AppInfo appInfo = appInfoService.get(Constant.DEFAULT_DB_SIGN, appVersionWhite.getAppInfoId()); + result.put("appName", appInfo.getName());// 备注说明 + } else if (appVersion != null && appVersionWhite == null) {// 黑单升级 + result.put("hasNew", true); + result.put("dfsAccessDomain", dfsAccessDomain);// 文件服务器地址 + result.put("appSign", appVersion.getAppSign());// 应用标识 + result.put("terminalType", appVersion.getTerminalType());// 终端类型 + result.put("versionType", appVersion.getVersionType());// 版本类型 + result.put("versionNum", currentVersionNum);// 版本号 + result.put("newVersionNum", appVersion.getVersionNum());// 新版本号 + result.put("minVersionNum", appVersion.getMinVersionNum());// 升级最低版本 + result.put("checkNum", appVersion.getCheckNum());// MD5 + result.put("fileName", appVersion.getFileName());// 文件名称 + result.put("uploadFile", appVersion.getUploadFile());// 文件路径 + result.put("length", appVersion.getLength());// 文件大小 + result.put("uploadLog", appVersion.getUploadLog());// 升级日志 + result.put("forceUpload", appVersion.getForceUpload());// 强制升级 + result.put("description", appVersion.getDescription());// 备注说明 + AppInfo appInfo = appInfoService.get(Constant.DEFAULT_DB_SIGN, appVersion.getAppInfoId()); + result.put("appName", appInfo.getName());// 备注说明 + } else if (appVersion != null && appVersionWhite != null) { + String v = appVersion.getVersionNum(); + String vWhite = appVersionWhite.getVersionNum(); + if (v.compareTo(vWhite) >= 0) { + result.put("hasNew", true); + result.put("dfsAccessDomain", dfsAccessDomain);// 文件服务器地址 + result.put("appSign", appVersion.getAppSign());// 应用标识 + result.put("terminalType", appVersion.getTerminalType());// 终端类型 + result.put("versionType", appVersion.getVersionType());// 版本类型 + result.put("versionNum", currentVersionNum);// 版本号 + result.put("newVersionNum", appVersion.getVersionNum());// 新版本号 + result.put("minVersionNum", appVersion.getMinVersionNum());// 升级最低版本 + result.put("checkNum", appVersion.getCheckNum());// MD5 + result.put("fileName", appVersion.getFileName());// 文件名称 + result.put("uploadFile", appVersion.getUploadFile());// 文件路径 + result.put("length", appVersion.getLength());// 文件大小 + result.put("uploadLog", appVersion.getUploadLog());// 升级日志 + result.put("forceUpload", appVersion.getForceUpload());// 强制升级 + result.put("description", appVersion.getDescription());// 备注说明 + AppInfo appInfo = appInfoService.get(Constant.DEFAULT_DB_SIGN, appVersion.getAppInfoId()); + result.put("appName", appInfo.getName());// 备注说明 + } else { + result.put("hasNew", true); + result.put("dfsAccessDomain", dfsAccessDomain);// 文件服务器地址 + result.put("appSign", appVersionWhite.getAppSign());// 应用标识 + result.put("terminalType", appVersionWhite.getTerminalType());// 终端类型 + result.put("versionType", appVersionWhite.getVersionType());// 版本类型 + result.put("versionNum", currentVersionNum);// 版本号 + result.put("newVersionNum", appVersionWhite.getVersionNum());// 新版本号 + result.put("minVersionNum", appVersionWhite.getMinVersionNum());// 升级最低版本 + result.put("checkNum", appVersionWhite.getCheckNum());// MD5 + result.put("fileName", appVersionWhite.getFileName());// 文件名称 + result.put("uploadFile", appVersionWhite.getUploadFile());// 文件路径 + result.put("length", appVersionWhite.getLength());// 文件大小 + result.put("uploadLog", appVersionWhite.getUploadLog());// 升级日志 + result.put("forceUpload", appVersionWhite.getForceUpload());// 强制升级 + result.put("description", appVersionWhite.getDescription());// 备注说明 + result.put("appName", appVersionWhite.getDescription());// 备注说明 + AppInfo appInfo = appInfoService.get(Constant.DEFAULT_DB_SIGN, appVersionWhite.getAppInfoId()); + result.put("appName", appInfo.getName());// 备注说明 + } + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + } + result.put("status", "1"); + result.put("message", "操作成功"); + return result; + } + + private List getAppVersionList(List whiteDetailList,String tenantId,String storeNo,String posNo,String appSign,String terminalType,String versionType,String currentVersionNum) throws Exception{ + List planIdList = new ArrayList<>(); + for (AppWhiteDetail whiteDetail : whiteDetailList) { + if (!planIdList.contains(whiteDetail.getPlanId())) { + planIdList.add(whiteDetail.getPlanId()); + } + } + List versionWhiteList = appVersionService.getListByPlan(Constant.DEFAULT_DB_SIGN, tenantId, storeNo, posNo, appSign, terminalType, 1, versionType, currentVersionNum, planIdList); + return versionWhiteList; + } + + private Map getPosErrorLog(HttpServletRequest request) { + // 5次上传一次 + String info = "上传POS错误日志"; + Map result = new HashMap<>(); + + int random = (int) (Math.random() * 10 + 1); + if (random < 10) { + result.put("status", "1"); + result.put("message", "操作成功"); + result.put("ticketId", ""); + return result; + } + String appSign = getParameter(request, "appSign");// 应用标识 + String terminalType = getParameter(request, "terminalType");// 应用标识 + String versionType = getParameter(request, "versionType");// 版本类型(1:稳定版;2:内测版) + String currentVersionNum = getParameter(request, "versionNum");// 当前版本号 + String tenantId = getParameter(request, "tenantId");// 租户ID + String posNo = getParameter(request, "posNo");// 终端设备编号 + String osName = getParameter(request, "osName");// 操作系统 + String storeNo = getParameter(request, "storeNo");// 门店编号 + String errorInfo = getParameter(request, "info");// 描述 + String errorLog = getParameter(request, "errorLog");// 错误日志 + try { + ErrorInfo errorInfoEntity = new ErrorInfo(); + errorInfoEntity.setAppSign(appSign); + errorInfoEntity.setCreateDate(new Date()); + errorInfoEntity.setCreateUser("open-api"); + errorInfoEntity.setErrorLog(errorLog); + errorInfoEntity.setInfo(errorInfo); + errorInfoEntity.setOsName(osName); + errorInfoEntity.setPosNo(posNo); + errorInfoEntity.setStatus(1); + errorInfoEntity.setStoreNo(storeNo); + errorInfoEntity.setTenantCode(tenantId); + errorInfoEntity.setTenantId(Constant.DEFAULT_DB_SIGN); + errorInfoEntity.setTerminalType(terminalType); + errorInfoEntity.setVersionNum(currentVersionNum); + int type = 0; + try { + type = Integer.parseInt(versionType); + } catch (Exception e) { + } + errorInfoEntity.setVersionType(type); + errorInfoEntity = errorInfoService.save(Constant.DEFAULT_DB_SIGN, errorInfoEntity); + result.put("status", "1"); + result.put("message", "操作成功"); + result.put("ticketId", errorInfoEntity.getId()); + } catch (Exception e) { + result.put("status", "0"); + result.put("message", "上传失败"); + logger.error(info + ",发生异常", e); + } + return result; + } + + private Map weixinLogin(HttpServletRequest request) { + String info = "微信登录验证"; + Map result = new HashMap<>(); + String tenantId = getParameter(request, "tenantId"); + String storeNo = getParameter(request, "storeNo"); + String userName = getParameter(request, "userName"); + String password = getParameter(request, "password"); + + if (StringUtils.isBlank(tenantId)) { + result.put("status", "0"); + result.put("message", "缺少必要参数tenantId"); + return result; + } + if (StringUtils.isBlank(storeNo)) { + result.put("status", "0"); + result.put("message", "缺少必要参数storeNo"); + return result; + } + if (StringUtils.isBlank(userName)) { + result.put("status", "0"); + result.put("message", "缺少必要参数userName"); + return result; + } + if (StringUtils.isBlank(password)) { + result.put("status", "0"); + result.put("password", "缺少必要参数password"); + return result; + } + AppAuth appAuth = null; + AppAuth appAuthCard = null; + try { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("status", 1)); + criteria.add(Restrictions.eq("tenantCode", tenantId)); + List appAuthlist = appAuthService.getList(Constant.DEFAULT_DB_SIGN, criteria); + if (appAuthlist != null && appAuthlist.size() > 0) { + appAuth = appAuthlist.get(0); + } + if (appAuth == null) { + result.put("status", "0"); + result.put("message", tenantId + "企业编号不存在"); + return result; + } + Store store = storeService.find(tenantId, "no", storeNo); + if (store == null || store.getDeleteFlag() == 1) { + result.put("status", "0"); + result.put("message", "门店信息不存在"); + return result; + } + if (store.getAuthFlag() == 0) { + result.put("status", "0"); + result.put("message", "门店未授权开通"); + return result; + } + StoreWorker storeWorker = storeWorkerService.find(tenantId, "no", userName); + if (storeWorker == null || storeWorker.getEnabled() == 0 || storeWorker.getDeleteFlag() == 1) { + result.put("status", "0"); + result.put("message", "员工工号不存在"); + return result; + } + boolean flag = storeWorkerService.isStoreWorker(tenantId, storeWorker.getId(), store.getId()); + if (!flag) { + result.put("status", "0"); + result.put("message", "此员工无权登录当前门店"); + return result; + } + + // 校验门店登陆密码 + // 获取员工门店扩展信息 + criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", store.getId()));// 门店ID + criteria.add(Restrictions.eq("workerNo", userName));// 员工工号 + List workerExtList = storeWorkerExtService.getList(tenantId, criteria); + + String passwd = getDecryptStr(password); + String passwdHash = null; + if (CollectionUtils.isEmpty(workerExtList)) { + passwdHash = storeWorker.getPasswd(); + } else { + if (workerExtList.size() >= 1) { + passwdHash = workerExtList.get(0).getPasswd(); + } + } + + // 校验密码 + if (passwdHash == null || !BCrypt.checkpw(passwd, passwdHash)) { + result.put("status", "0"); + result.put("message", "员工登录密码错误"); + return result; + } + + result.put("tenantId", store.getTenantId()); + result.put("storeId", store.getId()); + result.put("storeNo", store.getNo());// 门店编号 + result.put("storeName", store.getName());// 门店编号 + result.put("workerId", storeWorker.getId()); + result.put("workerNo", storeWorker.getNo()); + result.put("workerName", storeWorker.getName()); + result.put("appSecret", appAuth.getAppSecret()); + result.put("appKey", appAuth.getAppKey()); + criteria = new Criteria(); + criteria.add(Restrictions.eq("status", 1)); + criteria.add(Restrictions.eq("tenantCode", tenantId)); + appAuthlist = appAuthService.getListWithAppSign(Constant.DEFAULT_DB_SIGN, "card2", criteria); + if (appAuthlist != null && appAuthlist.size() > 0) { + appAuthCard = appAuthlist.get(0); + } + if (appAuthCard != null) { + result.put("appCardSecret", appAuthCard.getAppSecret()); + result.put("appCardKey", appAuthCard.getAppKey()); + } else { + result.put("appCardSecret", ""); + result.put("appCardKey", ""); + } + result.put("status", "1"); + result.put("message", "获取成功"); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + } + return result; + } + + private Map cardAuth(HttpServletRequest request) { + String info = "微信登录验证"; + Map result = new HashMap<>(); + String tenantId = getParameter(request, "tenantId"); + + if (StringUtils.isBlank(tenantId)) { + result.put("status", "0"); + result.put("message", "缺少必要参数tenantId"); + return result; + } + AppAuth appAuthCard = null; + try { + result.put("tenantId", tenantId); + Criteria criteria = new Criteria(); + criteria = new Criteria(); + criteria.add(Restrictions.eq("status", 1)); + criteria.add(Restrictions.eq("tenantCode", tenantId)); + List appAuthlist = appAuthService.getListWithAppSign(Constant.DEFAULT_DB_SIGN, "card2", criteria); + if (appAuthlist != null && appAuthlist.size() > 0) { + appAuthCard = appAuthlist.get(0); + } + if (appAuthCard != null) { + result.put("appCardSecret", appAuthCard.getAppSecret()); + result.put("appCardKey", appAuthCard.getAppKey()); + } else { + result.put("appCardSecret", ""); + result.put("appCardKey", ""); + } + result.put("status", "1"); + result.put("message", "获取成功"); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + } + return result; + } + + private Map weixinQRBind(HttpServletRequest request) { + String info = "微信二维码绑定"; + Map result = new HashMap<>(); + String tenantId = getParameter(request, "tenantId"); + String storeNo = getParameter(request, "storeNo"); + String userName = getParameter(request, "userName"); + if (StringUtils.isBlank(tenantId)) { + result.put("status", "0"); + result.put("message", "缺少必要参数tenantId"); + return result; + } + if (StringUtils.isBlank(storeNo)) { + result.put("status", "0"); + result.put("message", "缺少必要参数storeNo"); + return result; + } + if (StringUtils.isBlank(userName)) { + result.put("status", "0"); + result.put("message", "缺少必要参数userName"); + return result; + } + AppAuth appAuth = null; + AppAuth appAuthCard = null; + try { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("status", 1)); + criteria.add(Restrictions.eq("tenantCode", tenantId)); + List appAuthlist = appAuthService.getList(Constant.DEFAULT_DB_SIGN, criteria); + if (appAuthlist != null && appAuthlist.size() > 0) { + appAuth = appAuthlist.get(0); + } + if (appAuth == null) { + result.put("status", "0"); + result.put("message", tenantId + "企业编号不存在"); + return result; + } + Store store = storeService.find(tenantId, "no", storeNo); + if (store == null) { + result.put("status", "0"); + result.put("message", "门店信息不存在"); + return result; + } + if (store.getAuthFlag() == 0) { + result.put("status", "0"); + result.put("message", "门店未授权开通"); + return result; + } + StoreWorker storeWorker = storeWorkerService.find(tenantId, "no", userName); + if (storeWorker == null) { + result.put("status", "0"); + result.put("message", "员工工号不存在"); + return result; + } + + boolean flag = storeWorkerService.isStoreWorker(tenantId, storeWorker.getId(), store.getId()); + if (!flag) { + result.put("status", "0"); + result.put("message", "此员工无权登录当前门店"); + return result; + } + + result.put("tenantId", store.getTenantId()); + result.put("storeId", store.getId()); + result.put("storeNo", store.getNo());// 门店编号 + result.put("storeName", store.getName());// 门店编号 + result.put("workerId", storeWorker.getId()); + result.put("workerNo", storeWorker.getNo()); + result.put("workerName", storeWorker.getName()); + result.put("appSecret", appAuth.getAppSecret()); + result.put("appKey", appAuth.getAppKey()); + criteria = new Criteria(); + criteria.add(Restrictions.eq("status", 1)); + criteria.add(Restrictions.eq("tenantCode", tenantId)); + appAuthlist = appAuthService.getListWithAppSign(Constant.DEFAULT_DB_SIGN, "card2", criteria); + if (appAuthlist != null && appAuthlist.size() > 0) { + appAuthCard = appAuthlist.get(0); + } + if (appAuthCard != null) { + result.put("appCardSecret", appAuthCard.getAppSecret()); + result.put("appCardKey", appAuthCard.getAppKey()); + } else { + result.put("appCardSecret", ""); + result.put("appCardKey", ""); + } + result.put("status", "1"); + result.put("message", "获取成功"); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + } + return result; + } + + /*** + * 小程序要货登录 + * + * @param request + * @return + */ + private Map wxyhLogin(HttpServletRequest request) { + String info = "小程序要货登录"; + Map result = new HashMap<>(); + + // source == scan 扫码登录 + String source = getParameter(request, "source"); + String tenantId = getParameter(request, "tenantId"); + String storeNo = getParameter(request, "storeNo"); + String userName = getParameter(request, "userName"); + String password = getParameter(request, "password"); + + String openid = getParameter(request, "openid"); + String clientSession = getParameter(request, "clientSession"); + String nickName = getParameter(request, "openid"); + String mobile = getParameter(request, "mobile"); + String sex = getParameter(request, "sex"); + String province = getParameter(request, "province"); + String city = getParameter(request, "city"); + String country = getParameter(request, "country"); + String language = getParameter(request, "language"); + String headimgurl = getParameter(request, "headimgurl"); + + if (StringUtils.isBlank(tenantId)) { + result.put("status", "0"); + result.put("message", "缺少必要参数tenantId"); + return result; + } + if (StringUtils.isBlank(storeNo)) { + result.put("status", "0"); + result.put("message", "缺少必要参数storeNo"); + return result; + } + if (StringUtils.isBlank(userName)) { + result.put("status", "0"); + result.put("message", "缺少必要参数userName"); + return result; + } + // 非扫码登录 需要校验密码 + if (!"scan".equals(source) && StringUtils.isBlank(password)) { + result.put("status", "0"); + result.put("message", "缺少必要参数password"); + return result; + } + if (StringUtils.isBlank(openid)) { + result.put("status", "0"); + result.put("message", "缺少必要参数openid"); + return result; + } + if (StringUtils.isBlank(clientSession)) { + result.put("status", "0"); + result.put("message", "缺少必要参数clientSession"); + return result; + } + if (StringUtils.isBlank(nickName)) { + result.put("status", "0"); + result.put("message", "缺少必要参数nickName"); + return result; + } + AppAuth appAuth = null; + AppAuth appAuthCard = null; + try { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("status", 1)); + criteria.add(Restrictions.eq("tenantCode", tenantId)); + List appAuthlist = appAuthService.getList(Constant.DEFAULT_DB_SIGN, criteria); + if (appAuthlist != null && appAuthlist.size() > 0) { + appAuth = appAuthlist.get(0); + } + if (appAuth == null) { + result.put("status", "0"); + result.put("message", tenantId + "企业编号不存在"); + return result; + } + criteria = new Criteria(); + criteria.add(Restrictions.eq("no",storeNo)); + criteria.add(Restrictions.eq("deleteFlag",0)); + List stores = storeService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(stores)) { + result.put("status", "0"); + result.put("message", "门店信息不存在"); + return result; + } + Store store = stores.get(0); + if (store.getAuthFlag() == 0) { + result.put("status", "0"); + result.put("message", "门店未授权开通"); + return result; + } + criteria = new Criteria(); + criteria.add(Restrictions.eq("no",userName)); + criteria.add(Restrictions.eq("deleteFlag",0)); + List storeWorkers = storeWorkerService.getList(tenantId,criteria); + if (CollectionUtils.isEmpty(storeWorkers)) { + result.put("status", "0"); + result.put("message", "员工工号不存在"); + return result; + } + StoreWorker storeWorker = storeWorkers.get(0); + boolean flag = storeWorkerService.isStoreWorker(tenantId, storeWorker.getId(), store.getId()); + if (!flag) { + result.put("status", "0"); + result.put("message", "此员工无权登录当前门店"); + return result; + } + + // RMapCache> sSessionMap = + // redissonClient.getMapCache("weixin:small:session"); + // if(null == sSessionMap.get(clientSession)){ + // result.put("status", "0"); + // result.put("message", "会话已结束"); + // return result; + // } + + // 非扫码登录 需要校验密码 + if (!"scan".equals(source)) { + // 校验门店登陆密码 + // 获取员工门店扩展信息 + criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", store.getId()));// 门店ID + criteria.add(Restrictions.eq("workerNo", userName));// 员工工号 + List workerExtList = storeWorkerExtService.getList(tenantId, criteria); + + // String passwd = getDecryptStr(password); + String passwd = DesUtil.strDecWithOutKey(password); + + String passwdHash = null; + if (CollectionUtils.isEmpty(workerExtList)) { + passwdHash = storeWorker.getPasswd(); + } else { + if (workerExtList.size() >= 1) { + passwdHash = workerExtList.get(0).getPasswd(); + } + } + + // 校验密码 + if (passwdHash == null || !BCrypt.checkpw(passwd, passwdHash)) { + result.put("status", "0"); + result.put("message", "员工登录密码错误"); + return result; + } + } + + // 查询该用户是否存在 + criteria = new Criteria(); + criteria.add(Restrictions.eq("openid", openid)); + criteria.add(Restrictions.eq("storeId", store.getId())); + criteria.add(Restrictions.eq("workerId", storeWorker.getId())); + List userList = weixinYHService.getList(Constant.DEFAULT_DB_SIGN, criteria); + if (userList.size() == 0) { + // 保存微信用户和关联门店信息 + WeixinUser yhuser = new WeixinUser(); + yhuser.setTenantCode(tenantId); + yhuser.setTenantCode(tenantId); + yhuser.setOpenid(openid); + yhuser.setWorkerId(storeWorker.getId()); + yhuser.setWorkerNo(storeWorker.getNo()); + yhuser.setWorkerName(storeWorker.getName()); + yhuser.setStoreId(store.getId()); + yhuser.setStoreNo(storeNo); + yhuser.setStoreName(store.getName()); + yhuser.setNickName(StringUtils.isNotBlank(nickName) ? nickName : ""); + yhuser.setMobile(StringUtils.isNotBlank(mobile) ? mobile : ""); + yhuser.setProvince(province); + yhuser.setCity(city); + yhuser.setCountry(country); + yhuser.setLanguage(language); + yhuser.setHeadimgurl(headimgurl); + yhuser.setSex(StringUtils.isNotBlank(sex) ? Integer.parseInt(sex) : 0); + yhuser.setCreateUser(Constant.CREATE_USER); + yhuser.setCreateDate(new Date()); + weixinYHService.save(Constant.DEFAULT_DB_SIGN, yhuser); + } + + result.put("tenantId", tenantId); + result.put("store", store); + result.put("worker", storeWorker); + result.put("appSecret", appAuth.getAppSecret()); + result.put("appKey", appAuth.getAppKey()); + + criteria = new Criteria(); + criteria.add(Restrictions.eq("status", 1)); + criteria.add(Restrictions.eq("tenantCode", tenantId)); + appAuthlist = appAuthService.getListWithAppSign(Constant.DEFAULT_DB_SIGN, "card2", criteria); + if (appAuthlist != null && appAuthlist.size() > 0) { + appAuthCard = appAuthlist.get(0); + } + if (appAuthCard != null) { + result.put("appCardSecret", appAuthCard.getAppSecret()); + result.put("appCardKey", appAuthCard.getAppKey()); + } else { + result.put("appCardSecret", ""); + result.put("appCardKey", ""); + } + result.put("status", "1"); + result.put("message", "登录成功"); + } catch (Exception e) { + logger.error("ApiExtendController" + ".wxyhLogin:" + info + ",发生异常", e); + } + return result; + } + + /*** + * 获取用户唯一标识openId和本次登录会话秘钥session_key + * + * @param request + * @return + */ + private Map wxyhJscode2session(HttpServletRequest request) { + String info = "获取用户openId和会话密匙session_key"; + Map result = new HashMap<>(); + String code = getParameter(request, "code"); + String appid = getParameter(request, "appid"); + String secret = getParameter(request, "secret"); + + if (StringUtils.isBlank(code)) { + result.put("status", "0"); + result.put("message", "缺少必要参数code"); + return result; + } + if (StringUtils.isBlank(appid)) { + result.put("status", "0"); + result.put("message", "缺少必要参数appid"); + return result; + } + if (StringUtils.isBlank(secret)) { + result.put("status", "0"); + result.put("message", "缺少必要参数secret"); + return result; + } + try { + String url = "https://api.weixin.qq.com/sns/jscode2session?appid=%s&secret=%s&js_code=%s&grant_type=authorization_code"; + url = String.format(url, appid, secret, code); + + long startTime = System.currentTimeMillis(); + final HttpResponse httpResponse = HttpTool.url(url).post(); + long endTime = System.currentTimeMillis(); + System.out.println("请求耗时:" + (endTime - startTime)); + + String content = HttpTool.getResponseAsString(httpResponse); + Map resultMap = JSON.parseObject(content, Map.class); + + String status = ""; + String errorCode = ""; + String message = ""; + Map data = new HashMap(); + + if (null != resultMap.get("errcode")) { + status = "0"; + errorCode = resultMap.get("errcode").toString(); + message = resultMap.get("errmsg").toString(); + } else { + status = "1"; + message = "获取成功"; + data.put("openId", resultMap.get("openid").toString()); + data.put("sessionKey", resultMap.get("session_key").toString()); + + String session_key = RandomUtil.generateString(128); + + RMapCache> sSessionMap = redissonClient.getMapCache("weixin:small:session"); + sSessionMap.put(session_key, data, 60, TimeUnit.MINUTES); + } + result.put("status", status); + result.put("errcode", errorCode); + result.put("message", message); + result.put("openId", resultMap.get("openid").toString()); + result.put("sessionKey", resultMap.get("session_key").toString()); + logger.info("response>>>>>" + JSON.toJSONString(result)); + } catch (Exception e) { + logger.error("ApiExtendController" + ".wxyhJscode2session:" + info + ",发生异常", e); + } + return result; + } + + /*** + * 小程序点餐 登陆凭证校验 获取用户唯一标识openId和本次登录会话秘钥session_key + * + * @param request + * @return + */ + private Map wxdcJscode2session(HttpServletRequest request) { + String info = "小程序点餐-获取用户openId和会话密匙session_key"; + Map result = new HashMap<>(); + String code = getParameter(request, "code"); + String appid = getParameter(request, "appid"); + String secret = getParameter(request, "secret"); + + if (StringUtils.isBlank(code)) { + result.put("status", "0"); + result.put("message", "缺少必要参数code"); + return result; + } + if (StringUtils.isBlank(appid)) { + result.put("status", "0"); + result.put("message", "缺少必要参数appid"); + return result; + } + if (StringUtils.isBlank(secret)) { + result.put("status", "0"); + result.put("message", "缺少必要参数secret"); + return result; + } + try { + String url = "https://api.weixin.qq.com/sns/jscode2session?appid=%s&secret=%s&js_code=%s&grant_type=authorization_code"; + url = String.format(url, appid, secret, code); + logger.info(">>>>>>>>>>>" + info); + + long startTime = System.currentTimeMillis(); + final HttpResponse httpResponse = HttpTool.url(url).get(); + long endTime = System.currentTimeMillis(); + logger.info("请求耗时:" + (endTime - startTime)); + + final String content = HttpTool.getResponseAsString(httpResponse); + Map resultMap = JSON.parseObject(content, Map.class); + + String status = ""; + String errorCode = ""; + String message = ""; + Map data = new HashMap(); + if (null != resultMap.get("errcode")) { + status = "0"; + errorCode = resultMap.get("errcode").toString(); + message = resultMap.get("errmsg").toString(); + } else { + status = "1"; + message = "获取成功"; + data.put("openId", resultMap.get("openid").toString()); + data.put("sessionKey", resultMap.get("session_key").toString()); + String loginKey = RandomUtil.generateString(128); + // 永久不失效 + RMapCache> sSessionMap = redissonClient.getMapCache("weixin:small:session"); + sSessionMap.put(loginKey, data); + RMapCache stringMapRMapCache = redissonClient.getMapCache("weixin:small:loginKey:session"); + stringMapRMapCache.put(resultMap.get("openid").toString(),loginKey); + logger.info("openId >>>>>"+resultMap.get("openid").toString()+":"+info+"存入session_key"); + + result.put("openId", resultMap.get("openid").toString()); + result.put("loginKey", loginKey); + } + result.put("status", status); + result.put("errcode", errorCode); + result.put("message", message); + logger.info("response>>>>>" + JSON.toJSONString(result)); + } catch (Exception e) { + result.put("status", 0); + result.put("message", "操作错误"); + logger.error("ApiExtendController" + ".wxdcJscode2session:" + info + ",发生异常", e); + } + return result; + } + + /*** + * 小程序点餐-获取/新增用户信息 + * + * @param request + * @return + */ + private Map wxdcGetUser(HttpServletRequest request) { + String info = "小程序点餐-获取/新增用户信息"; + Map result = new HashMap<>(); + + String tenantId = getParameter(request, "tenantId"); + String wid = getParameter(request, "wid"); + // String storeId = getParameter(request, "storeId"); + String loginKey = getParameter(request, "loginKey"); + String nickName = getParameter(request, "nickName"); + int sex = Integer.parseInt(getParameter(request, "sex")); + String encryptedData = getParameter(request, "encryptedData");// 包括敏感数据在内的完整用户信息的加密数据 + String iv = getParameter(request, "iv");// 加密算法的初始向量 + + AppAuth appAuth = null; + try { + if (StringUtils.isBlank(wid)) { + result.put("status", "0"); + result.put("message", "缺少必要参数wid"); + return result; + } + if (StringUtils.isBlank(tenantId)) { + result.put("status", "0"); + result.put("message", "缺少必要参数tenantId"); + return result; + } + if (StringUtils.isBlank(loginKey)) { + result.put("status", "0"); + result.put("message", "缺少必要参数loginKey"); + return result; + } + if (StringUtils.isBlank(nickName)) { + result.put("status", "0"); + result.put("message", "缺少必要参数nickName"); + return result; + } + // 校验租户 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("status", 1)); + criteria.add(Restrictions.eq("tenantCode", tenantId)); + criteria.add(Restrictions.order("createDate", "desc")); + List appAuthlist = appAuthService.getList(Constant.DEFAULT_DB_SIGN, criteria); + if (appAuthlist != null && appAuthlist.size() > 0) { + appAuth = appAuthlist.get(0); + } + if (appAuth == null) { + result.put("status", "0"); + result.put("message", tenantId + "企业编号不存在"); + return result; + } + // 校验数据签名 + RMapCache> sSessionMap = redissonClient.getMapCache("weixin:small:session"); + if (null == sSessionMap.get(loginKey)) { + result.put("status", "0"); + result.put("message", "会话已结束"); + return result; + } + Map sessionMap = sSessionMap.get(loginKey); + String sessionKey = sessionMap.get("sessionKey").toString(); + String openId = sessionMap.get("openId").toString(); + + logger.info("encryptedData " + encryptedData); + logger.info("sessionKey " + sessionKey); + logger.info("iv " + iv); + logger.info("openId " + openId); + + // 解密userData + String unionId = ""; + JSONObject userData = null; + String decodeDate = EncryptedDataUtils.encryptedData(encryptedData, sessionKey, iv); + if (StringUtils.isNotBlank(decodeDate)) { + userData = JSON.parseObject(decodeDate); + unionId = null == userData.get("unionId") ? "" : userData.getString("unionId"); + } + logger.info(info + " unionId:" + unionId); + + com.jwsaas.entity.wxdc.WeixinUser wxdcUser = new com.jwsaas.entity.wxdc.WeixinUser(); + // 查询该用户是否存在 + criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantCode", tenantId)); + if (null != userData && StringUtils.isNotBlank(unionId)) { + criteria.add(Restrictions.eq("unionid", userData.getString("unionId"))); + } else { + criteria.add(Restrictions.eq("openid", openId)); + criteria.add(Restrictions.eq("nickname", nickName)); + } + List userList = weixindcUserService.getList(Constant.DEFAULT_DB_SIGN, criteria); + if (userList.size() == 0) { + // 保存微信用户和关联门店信息 + wxdcUser.setTenantCode(tenantId); + wxdcUser.setWid(wid); + wxdcUser.setOpenid(openId); + wxdcUser.setUnionid(unionId); + wxdcUser.setLoginFlag(1); + wxdcUser.setLastLoginTime(new Date()); + wxdcUser.setNickname(StringUtils.isNotBlank(nickName) ? nickName : ""); + wxdcUser.setMobile(""); + wxdcUser.setSex(sex); + wxdcUser.setProvince(null == userData ? "" : userData.getString("province")); + wxdcUser.setCity(null == userData ? "" : userData.getString("city")); + wxdcUser.setCountry(""); + wxdcUser.setHeadimgurl(null == userData ? "" : userData.getString("avatarUrl")); + wxdcUser.setSex(sex); + wxdcUser.setStatus(1); + wxdcUser.setCreateUser(Constant.CREATE_USER); + wxdcUser.setCreateDate(new Date()); + wxdcUser = weixindcUserService.save(Constant.DEFAULT_DB_SIGN, wxdcUser); + } else { + wxdcUser = userList.get(0); + } + + result.put("tenantId", tenantId); + result.put("user", wxdcUser); + result.put("appSecret", appAuth.getAppSecret()); + result.put("appKey", appAuth.getAppKey()); + + result.put("status", "1"); + result.put("message", "登录成功"); + } catch (Exception e) { + result.put("status", 0); + result.put("message", "操作错误"); + logger.error("ApiExtendController" + ".wxdcGetUser:" + info + ",发生异常", e); + } + return result; + } + + /*** + * 小程序点餐-获取开放平台信息 + * + * @param request + * @return + */ + private Map wxdcGetAppAuth(HttpServletRequest request) { + String info = "小程序点餐-获取开放平台信息"; + Map result = new HashMap<>(); + + String tenantId = getParameter(request, "tenantId"); + + AppAuth appAuth = null; + try { + if (StringUtils.isBlank(tenantId)) { + result.put("status", "0"); + result.put("message", "缺少必要参数tenantId"); + return result; + } + // 校验租户 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("status", 1)); + criteria.add(Restrictions.eq("tenantCode", tenantId)); + criteria.add(Restrictions.order("createDate", "desc")); + List appAuthlist = appAuthService.getList(Constant.DEFAULT_DB_SIGN, criteria); + if (appAuthlist != null && appAuthlist.size() > 0) { + appAuth = appAuthlist.get(0); + } + if (appAuth == null) { + result.put("status", "0"); + result.put("message", tenantId + "企业编号不存在"); + return result; + } + + result.put("tenantId", tenantId); + result.put("appSecret", appAuth.getAppSecret()); + result.put("appKey", appAuth.getAppKey()); + + result.put("status", "1"); + result.put("message", "登录成功"); + } catch (Exception e) { + result.put("status", 0); + result.put("message", "操作错误"); + logger.error("ApiExtendController" + ".wxdcGetAppAuth:" + info + ",发生异常", e); + } + return result; + } + + /*** + * 小程序点餐-获取用户信息 + * + * @param request + * @return + */ + private Map wxdcGetPhone(HttpServletRequest request) { + String info = "小程序点餐-获取用户手机号信息"; + Map result = new HashMap<>(); + + // String storeId = getParameter(request, "storeId"); + String loginKey = getParameter(request, "loginKey"); + String encryptedData = getParameter(request, "encryptedData");// 包括敏感数据在内的完整用户信息的加密数据 + String iv = getParameter(request, "iv");// 加密算法的初始向量 + + try { + if (StringUtils.isBlank(loginKey)) { + result.put("status", "0"); + result.put("message", "缺少必要参数loginKey"); + return result; + } + // 校验数据签名 + RMapCache> sSessionMap = redissonClient.getMapCache("weixin:small:session"); + if (null == sSessionMap.get(loginKey)) { + result.put("status", "0"); + result.put("message", "会话已结束 loginKey:" + loginKey); + return result; + } + // 获取key和openId + Map sessionMap = sSessionMap.get(loginKey); + String sessionKey = sessionMap.get("sessionKey").toString(); + + JSONObject data = new JSONObject(); + // 解密userData + String decodeDate = EncryptedDataUtils.encryptedData(encryptedData, sessionKey, iv); + if (StringUtils.isNotBlank(decodeDate)) { + data = JSON.parseObject(decodeDate); + logger.info(info + " data:" + data.toJSONString()); + result.put("data", data); + + result.put("status", "1"); + result.put("message", "登录成功"); + } else { + result.put("status", "0"); + result.put("message", "解密失败,解密后数据为空"); + logger.error(info + " 解密失败,解密后数据为空"); + } + } catch (Exception e) { + result.put("status", 0); + result.put("message", "操作错误"); + logger.error("ApiExtendController" + ".wxdcGetUser:" + info + ",发生异常", e); + } + return result; + } + + /*** + * 小程序点餐-更新用户信息 + * + * @param request + * @return + */ + private Map wxdcEditUser(HttpServletRequest request) { + String info = "小程序点餐-更新用户信息"; + Map result = new HashMap<>(); + + String userId = getParameter(request, "userId"); + String mobile = getParameter(request, "mobile"); + String tenantId = getParameter(request, "tenantId"); + + logger.debug(info + " userId:" + userId + " mobile:" + mobile + " tenantId:" + tenantId); + try { + if (StringUtils.isBlank(userId)) { + result.put("status", "0"); + result.put("message", "缺少必要参数userId"); + return result; + } + if (StringUtils.isBlank(mobile)) { + result.put("status", "0"); + result.put("message", "缺少必要参数mobile"); + return result; + } + + // 查询该用户是否存在 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("id", userId)); + List userList = weixindcUserService.getList(Constant.DEFAULT_DB_SIGN, criteria); + if (userList.size() > 0) { + com.jwsaas.entity.wxdc.WeixinUser user = userList.get(0); + user.setMobile(mobile); + user.setVipMobile(mobile); + user.setModifyUser(Constant.CREATE_USER); + weixindcUserService.update(Constant.DEFAULT_DB_SIGN, user); + + result.put("status", "1"); + result.put("message", "登录成功"); + } else { + result.put("status", "0"); + result.put("message", "用户信息不存在"); + logger.error(info + " 用户信息不存在"); + } + + } catch (Exception e) { + result.put("status", 0); + result.put("message", "操作错误"); + logger.error("ApiExtendController" + ".wxdcEditUser:" + info + ",发生异常", e); + } + return result; + } + + /*** + * 小程序点餐-校验loginkey和session + * + * @param request + * @return + */ + private Map wxdcCheckSession(HttpServletRequest request) { + String info = "小程序点餐-校验loginkey和session"; + Map result = new HashMap<>(); + + String userId = getParameter(request, "userId"); + String loginKey = getParameter(request, "loginKey"); + + logger.debug(info + " userId:" + userId + " loginKey:" + loginKey); + try { + if (StringUtils.isBlank(loginKey)) { + result.put("status", "0"); + result.put("message", "缺少必要参数loginKey"); + return result; + } + + // 校验数据签名 + RMapCache> sSessionMap = redissonClient.getMapCache("weixin:small:session"); + if (null != sSessionMap && null != sSessionMap.get(loginKey)) { + result.put("status", "1"); + result.put("message", "校验成功"); + } else { + result.put("status", "0"); + result.put("message", "未查询到对应session"); + logger.error(info + " 未查询到对应session"); + } + } catch (Exception e) { + result.put("status", 0); + result.put("message", "操作错误"); + logger.error("ApiExtendController" + ".wxdcCheckSession:" + info + ",发生异常", e); + } + return result; + } + + private Map cardGetAppKey(HttpServletRequest request) { + String info = " 会员系统获取餐饮AppKey"; + Map result = new HashMap<>(); + String tenantId = getParameter(request, "tenantId"); + + if (StringUtils.isBlank(tenantId)) { + result.put("status", "0"); + result.put("message", "缺少必要参数tenantId"); + return result; + } + + AppAuth appAuth = null; + try { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("status", 1)); + criteria.add(Restrictions.eq("tenantCode", tenantId)); + List appAuthlist = appAuthService.getList(Constant.DEFAULT_DB_SIGN, criteria); + if (appAuthlist != null && appAuthlist.size() > 0) { + appAuth = appAuthlist.get(0); + } + if (appAuth == null) { + result.put("status", "0"); + result.put("message", tenantId + "企业编号不存在"); + return result; + } + + result.put("status", "1"); + result.put("message", "操作成功"); + result.put("tenantCode", appAuth.getTenantCode()); + result.put("appId", appAuth.getAppId()); + result.put("appCode", appAuth.getAppCode()); + result.put("appKey", appAuth.getAppKey()); + result.put("appSecret", appAuth.getAppSecret()); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + } + return result; + } + + /** + * POS注册码校验(v1升级到v2),获取AppKey + */ + private Map pollcodeVaildV1ToV2(HttpServletRequest request) { + String info = "POS注册码校验(v1升级到v2),获取AppKey"; + Map result = new HashMap<>(); + + String tenantId4V1 = getParameter(request, "tenantId4V1");// V1企业编号 + String storeNo4V1 = getParameter(request, "storeNo4V1");// V1门店编号 + String storeName4V1 = getParameter(request, "storeName4V1");// V1门店名称 + String posNo4V1 = getParameter(request, "posNo4V1");// V1POS编号 + String pollcode = getParameter(request, "pollcode");// 使用固定的注册码 + + if (StringUtils.isBlank(tenantId4V1)) { + result.put("status", "0"); + result.put("message", "缺少必要参数tenantId4V1"); + return result; + } + if (StringUtils.isBlank(storeNo4V1)) { + result.put("status", "0"); + result.put("message", "缺少必要参数storeNo4V1"); + return result; + } + if (StringUtils.isBlank(storeName4V1)) { + result.put("status", "0"); + result.put("message", "缺少必要参数storeName4V1"); + return result; + } + if (StringUtils.isBlank(posNo4V1)) { + result.put("status", "0"); + result.put("message", "缺少必要参数posNo4V1"); + return result; + } + if (StringUtils.isBlank(pollcode)) { + result.put("status", "0"); + result.put("message", "缺少必要参数pollcode"); + return result; + } else if (!StringUtils.equals("autov1tov2", pollcode)) { + result.put("status", "0"); + result.put("message", "注册码不可用,操作失败"); + return result; + } + + Tenant tenant = null; + Store store = null; + StoreType storeType = null; + AppAuth appAuth = null; + AppAuth appAuth4Card = null; + try { + String tenantId = null;// V2企业编号 + String storeNo = null;// V2门店编号 + + // 根据V1企业号获取V2企业号 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("appSign", Constants.APP_TYPE_SIGN));// 应用标识 + criteria.add(Restrictions.eq("oldTenantCode", tenantId4V1)); + List schemeList = upgradeSchemeService.getList(Constant.DEFAULT_DB_SIGN, criteria); + if (CollectionUtils.isEmpty(schemeList)) { + result.put("status", "0"); + result.put("message", tenantId4V1 + "对应的升级方案不存在"); + return result; + } + UpgradeScheme scheme = schemeList.get(0); + if (scheme.getStatus() == 0) { + result.put("status", "0"); + result.put("message", tenantId4V1 + "没有可用的升级方案"); + return result; + } + tenantId = scheme.getTenantCode();// "373001"; + + // 根据V1门店号获取V2门店号 + criteria = new Criteria(); + criteria.add(Restrictions.eq("appSign", Constants.APP_TYPE_SIGN));// 应用标识 + criteria.add(Restrictions.eq("schemeId", scheme.getId()));// 升级方案ID + criteria.add(Restrictions.eq("oldStoreNo", storeNo4V1));// 旧门店编号 + List storeList = upgradeStoreService.getList(Constant.DEFAULT_DB_SIGN, criteria); + if (CollectionUtils.isEmpty(storeList)) { + result.put("status", "0"); + result.put("message", "门店[" + storeNo4V1 + "]对应的新门店不存在"); + return result; + } + UpgradeStore upgradeStore = storeList.get(0); + if (upgradeStore.getStatus() == 0) { + result.put("status", "0"); + result.put("message", "门店[" + storeNo4V1 + "]没有可用的升级信息"); + return result; + } + storeNo = upgradeStore.getStoreNo(); + + // 查询V2租户信息 + tenant = tenantService.find(Constants.DEFAULT_DB_SIGN, "code", tenantId); + if (tenant == null) { + result.put("status", "0"); + result.put("message", tenantId + "企业编号不存在"); + return result; + } + + criteria = new Criteria(); + criteria.add(Restrictions.eq("status", 1)); + criteria.add(Restrictions.eq("tenantCode", tenantId)); + List appAuthlist = appAuthService.getList(Constant.DEFAULT_DB_SIGN, criteria); + if (appAuthlist != null && appAuthlist.size() > 0) { + appAuth = appAuthlist.get(0); + } + if (appAuth == null) { + result.put("status", "0"); + result.put("message", tenantId + "企业授权信息不存在"); + return result; + } + + store = storeService.find(tenantId, "no", storeNo); + if (store != null) { + storeType = storeTypeService.get(tenantId, store.getTypeId()); + } + + criteria = new Criteria(); + criteria.add(Restrictions.eq("status", 1)); + criteria.add(Restrictions.eq("tenantCode", tenantId)); + appAuthlist = appAuthService.getListWithAppSign(Constant.DEFAULT_DB_SIGN, "card2", criteria); + if (appAuthlist != null && appAuthlist.size() > 0) { + appAuth4Card = appAuthlist.get(0); + } + + } catch (Exception e) { + logger.error(info + ",发生异常", e); + } + + if (store == null) { + result.put("status", "0"); + result.put("message", "门店信息不存在,操作失败"); + } else { + result.put("status", "1"); + result.put("message", "操作成功"); + Map storeInfo = new HashMap<>(); + + Map storeTypeInfo = new HashMap<>(); + storeTypeInfo.put("id", storeType.getId()); + storeTypeInfo.put("no", storeType.getNo()); + storeTypeInfo.put("name", storeType.getName()); + storeTypeInfo.put("sign", storeType.getSign()); + storeInfo.put("storeType", storeTypeInfo); + + storeInfo.put("tenantId", tenant.getCode()); + storeInfo.put("tenantName", tenant.getName()); + + storeInfo.put("storeId", store.getId()); + storeInfo.put("storeNo", store.getNo()); + storeInfo.put("storeName", store.getName()); + storeInfo.put("storeAddress", store.getAddress()); + + storeInfo.put("appSecret", appAuth.getAppSecret()); + storeInfo.put("appKey", appAuth.getAppKey()); + result.put("store", storeInfo); + + Map cardAuthInfo = new HashMap<>(); + cardAuthInfo.put("appSecret", appAuth4Card == null ? null : appAuth4Card.getAppSecret()); + cardAuthInfo.put("appKey", appAuth4Card == null ? null : appAuth4Card.getAppKey()); + result.put("cardAuth", cardAuthInfo); + } + return result; + } + + /** + * 微信代理商登录验证 + */ + private Map weixinAgentLogin(HttpServletRequest request) { + String info = "微信代理商登录验证"; + Map result = new HashMap<>(); + String tenantId = getParameter(request, "tenantId"); + String userName = getParameter(request, "userName"); + String password = getParameter(request, "password"); + + if (StringUtils.isBlank(tenantId)) { + result.put("status", "0"); + result.put("message", "缺少必要参数tenantId"); + return result; + } + if (StringUtils.isBlank(userName)) { + result.put("status", "0"); + result.put("message", "缺少必要参数userName"); + return result; + } + if (StringUtils.isBlank(password)) { + result.put("status", "0"); + result.put("password", "缺少必要参数password"); + return result; + } + AppAuth appAuth = null; + AppAuth appAuthCard = null; + try { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("status", 1)); + criteria.add(Restrictions.eq("tenantCode", tenantId)); + List appAuthlist = appAuthService.getList(Constant.DEFAULT_DB_SIGN, criteria); + if (appAuthlist != null && appAuthlist.size() > 0) { + appAuth = appAuthlist.get(0); + } + if (appAuth == null) { + result.put("status", "0"); + result.put("message", tenantId + "企业编号不存在"); + return result; + } + + User user = userService.find(tenantId, "userName", userName); + logger.debug("user:" + user); + if (user == null) { + result.put("status", "0"); + result.put("message", "登陆账号不存在"); + return result; + } + + String passwd = getDecryptStr(password); + String passwdHash = user.getPasswd(); + // 校验密码 + if (passwdHash == null || !BCrypt.checkpw(passwd, passwdHash)) { + result.put("status", "0"); + result.put("message", "登录密码错误"); + return result; + } + int identityFlag = user.getIdentityFlag();// 用户身份标识,0-总部;1-门店(营业员);2-代理商 + if (identityFlag != 2) { + result.put("status", "0"); + result.put("message", "该账户不是代理商账户"); + return result; + } + + Agent agent = agentService.find(tenantId, "no", userName); + logger.debug("agent:" + agent); + if (agent == null) { + result.put("status", "0"); + result.put("message", "代理商信息不存在"); + return result; + } + if (agent.getEnable() == 0) { + result.put("status", "0"); + result.put("message", "该账户已被禁用"); + return result; + } + + result.put("tenantId", tenantId); + result.put("agentId", agent.getId()); + result.put("agentNo", agent.getNo()); + result.put("agentName", agent.getName()); + result.put("appSecret", appAuth.getAppSecret()); + result.put("appKey", appAuth.getAppKey()); + criteria = new Criteria(); + criteria.add(Restrictions.eq("status", 1)); + criteria.add(Restrictions.eq("tenantCode", tenantId)); + appAuthlist = appAuthService.getListWithAppSign(Constant.DEFAULT_DB_SIGN, "card2", criteria); + if (appAuthlist != null && appAuthlist.size() > 0) { + appAuthCard = appAuthlist.get(0); + } + if (appAuthCard != null) { + result.put("appCardSecret", appAuthCard.getAppSecret()); + result.put("appCardKey", appAuthCard.getAppKey()); + } else { + result.put("appCardSecret", ""); + result.put("appCardKey", ""); + } + result.put("status", "1"); + result.put("message", "获取成功"); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + } + return result; + } + + private Map getProgramInfoByWid(HttpServletRequest request) { + String info = "根据wid获取小程序配置信息"; + Map result = new HashMap<>(); + String wid = getParameter(request, "wid"); + String tenantId = getParameter(request, "tenantId"); + try{ + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("wid",wid)); + criteria.add(Restrictions.eq("enableFlag",1)); + List accounts = programSettingService.getList(tenantId,criteria); + if(CollectionUtils.isNotEmpty(accounts)){ + ProgramSetting account = accounts.get(0); + result.put("id",account.getId()); + result.put("tenantId",account.getTenantId()); + result.put("name",account.getName()); + result.put("type",account.getType()); + result.put("color",account.getColor()); + result.put("memberFlag",account.getMemberFlag()); + result.put("indexStyle",account.getIndexStyle()); + //微信配置 + result.put("wxStatus",account.getWxStatus()); + Map wxBoday = JSONUtil.parseObject(account.getWxBoday(), new TypeReference>() { + }); + result.put("wxBoday",wxBoday); + result.put("aliStatus",account.getAliStatus()); + //支付宝配置 + Map aliBoday = JSONUtil.parseObject(account.getAliBoday(), new TypeReference>() { + }); + result.put("aliBoday",aliBoday); + //微信消息模板 + Map wxTemplate = JSONUtil.parseObject(account.getWxTemplate(), new TypeReference>() { + }); + result.put("wxTemplate",wxTemplate); + //支付宝消息模板 + Map aliTemplate = JSONUtil.parseObject(account.getAliTemplate(), new TypeReference>() { + }); + result.put("aliTemplate",aliTemplate); + //餐饮配置 + Map cyApi = JSONUtil.parseObject(account.getCyApi(), new TypeReference>() { + }); + result.put("cyApi",cyApi); + //会员配置 + Map cardApi = JSONUtil.parseObject(account.getCardApi(), new TypeReference>() { + }); + result.put("cardApi",cardApi); + result.put("description", account.getDescription()); + result.put("wid", account.getWid()); + result.put("dataVersion",account.getDataVersion()); + //查询小程序首页图片; + criteria = new Criteria(); + criteria.add(Restrictions.eq("programId",account.getId())); + criteria.add(Restrictions.eq("deleteFlag",0)); + List pictures = programIndexPictureService.getList(tenantId,criteria); + Map picUrlMap = new HashMap<>(); + if(CollectionUtils.isNotEmpty(pictures)){ + for(ProgramIndexPicture picture : pictures){ + //充值图片; + if(StringUtils.equalsIgnoreCase(picture.getIndexPictureType().getSign(), ProgramIndexPictureType.RECHARGE.getSign())){ + picUrlMap.put("rechargeUrl",picture.getLinkUrl()); + picUrlMap.put("rechargePath",picture.getPath()); + picUrlMap.put("rechargeFuncName",picture.getFuncName()); + } + //优惠券图片; + if(StringUtils.equalsIgnoreCase(picture.getIndexPictureType().getSign(), ProgramIndexPictureType.COUPON.getSign())){ + picUrlMap.put("couponUrl",picture.getLinkUrl()); + picUrlMap.put("couponPath",picture.getPath()); + picUrlMap.put("couponFuncName",picture.getFuncName()); + } + //支付码图片; + if(StringUtils.equalsIgnoreCase(picture.getIndexPictureType().getSign(), ProgramIndexPictureType.PAYCODE.getSign())){ + picUrlMap.put("payCodeUrl",picture.getLinkUrl()); + picUrlMap.put("payCodePath",picture.getPath()); + picUrlMap.put("payCodeFuncName",picture.getFuncName()); + } + //堂食图片; + if(StringUtils.equalsIgnoreCase(picture.getIndexPictureType().getSign(), ProgramIndexPictureType.FORHEREORDER.getSign())){ + picUrlMap.put("forHereOrderUrl",picture.getLinkUrl()); + picUrlMap.put("forHereOrderPath",picture.getPath()); + } + //外卖图片; + if(StringUtils.equalsIgnoreCase(picture.getIndexPictureType().getSign(), ProgramIndexPictureType.TAKEOUTORDER.getSign())){ + picUrlMap.put("takeOutOrderUrl",picture.getLinkUrl()); + picUrlMap.put("takeOutOrderPath",picture.getPath()); + } + //积分商城; + if(StringUtils.equalsIgnoreCase(picture.getIndexPictureType().getSign(), ProgramIndexPictureType.INTEGRALMALL.getSign())){ + picUrlMap.put("integralMallUrl",picture.getLinkUrl()); + picUrlMap.put("integralMallPath",picture.getPath()); + } + //个人中心; + if(StringUtils.equalsIgnoreCase(picture.getIndexPictureType().getSign(), ProgramIndexPictureType.USERCENTER.getSign())){ + picUrlMap.put("userCenterUrl",picture.getLinkUrl()); + picUrlMap.put("userCenterPath",picture.getPath()); + } + } + } + result.put("pictureInfos",picUrlMap); + result.put("status", "1"); + result.put("message", "获取成功"); + }else{ + result.put("status", "0"); + result.put("message", "没有查找到账户信息"); + } + }catch (Exception e){ + result.put("status", "0"); + result.put("message", e.getMessage()); + logger.error(info + ",业务处理时发生异常", e); + } + return result; + } + + + private Map weixinVposWindowLogin(HttpServletRequest request) { + String info = "美食广场档口用户登录验证"; + Map result = new HashMap<>(); + String tenantId = getParameter(request, "tenantId"); + String userName = getParameter(request, "userName"); + String password = getParameter(request, "password"); + + if (StringUtils.isBlank(tenantId)) { + result.put("status", "0"); + result.put("message", "缺少必要参数tenantId"); + return result; + } + if (StringUtils.isBlank(userName)) { + result.put("status", "0"); + result.put("message", "缺少必要参数userName"); + return result; + } + if (StringUtils.isBlank(password)) { + result.put("status", "0"); + result.put("password", "缺少必要参数password"); + return result; + } + AppAuth appAuth = null; + AppAuth appAuthCard = null; + try { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("status", 1)); + criteria.add(Restrictions.eq("tenantCode", tenantId)); + List appAuthlist = appAuthService.getList(Constant.DEFAULT_DB_SIGN, criteria); + if (appAuthlist != null && appAuthlist.size() > 0) { + appAuth = appAuthlist.get(0); + } + if (appAuth == null) { + result.put("status", "0"); + result.put("message", tenantId + "企业编号不存在"); + return result; + } + + User user = userService.find(tenantId, "userName", userName); + logger.debug("user:" + user); + if (user == null) { + result.put("status", "0"); + result.put("message", "登陆账号不存在"); + return result; + } + + String passwd = getDecryptStr(password); + String passwdHash = user.getPasswd(); + // 校验密码 + if (passwdHash == null || !BCrypt.checkpw(passwd, passwdHash)) { + result.put("status", "0"); + result.put("message", "登录密码错误"); + return result; + } + int identityFlag = user.getIdentityFlag();// 用户身份标识,0-总部;1-门店(营业员);2-代理商;3-美食广场档口商户; + if (identityFlag != 3) { + result.put("status", "0"); + result.put("message", "该账户不是档口商户账户"); + return result; + } + + VposUser vposUser = vposUserService.find(tenantId, "no", userName); + logger.debug("vposUser:" + vposUser); + if (vposUser == null) { + result.put("status", "0"); + result.put("message", "档口商户信息不存在"); + return result; + } + if (vposUser.getEnable() == 0) { + result.put("status", "0"); + result.put("message", "该账户已被禁用"); + return result; + } + + result.put("tenantId", tenantId); + result.put("vposUserId", vposUser.getId()); + result.put("vposUserNo", vposUser.getNo()); + result.put("vposUserName", vposUser.getName()); + result.put("appSecret", appAuth.getAppSecret()); + result.put("appKey", appAuth.getAppKey()); + criteria = new Criteria(); + criteria.add(Restrictions.eq("status", 1)); + criteria.add(Restrictions.eq("tenantCode", tenantId)); + appAuthlist = appAuthService.getListWithAppSign(Constant.DEFAULT_DB_SIGN, "card2", criteria); + if (appAuthlist != null && appAuthlist.size() > 0) { + appAuthCard = appAuthlist.get(0); + } + if (appAuthCard != null) { + result.put("appCardSecret", appAuthCard.getAppSecret()); + result.put("appCardKey", appAuthCard.getAppKey()); + } else { + result.put("appCardSecret", ""); + result.put("appCardKey", ""); + } + result.put("status", "1"); + result.put("message", "获取成功"); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + } + return result; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/controller/open/BaiDuLbsController.java b/food-open/food-open-api/src/main/java/com/jwsaas/controller/open/BaiDuLbsController.java new file mode 100644 index 0000000..53ade8a --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/controller/open/BaiDuLbsController.java @@ -0,0 +1,817 @@ +package com.jwsaas.controller.open; + +import java.net.URLEncoder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.lang3.StringUtils; +import org.apache.http.HttpResponse; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.alibaba.fastjson.JSON; +import com.fasterxml.jackson.core.type.TypeReference; +import com.jwsaas.entity.food.WxStore; +import com.jwsaas.http.HttpTool; +import com.jwsaas.open.Global; +import com.jwsaas.properties.BaiduhProperties; +import com.jwsaas.service.food.WxStoreService; +import com.jwsaas.util.JSONUtil; + + +/** + * 百度LBS服务接口 + */ +@Controller(Global.SIGN + "BaiDuLbsController") +@RequestMapping(Global.OPEN_PATH + "/api/extend/lbs") +public class BaiDuLbsController extends BaseOpenController { + + private static Logger logger = LoggerFactory.getLogger(BaiDuLbsController.class); + + @Autowired + private BaiduhProperties baiduhProperties; + + @Resource + private WxStoreService wxStoreService; + + @RequestMapping(value = "", method = { RequestMethod.POST }) + @ResponseBody + public Object index(String type, HttpServletRequest request, HttpServletResponse response, Model model) { + String info = "百度LBS服务接口入口"; + + Map result = new HashMap<>(); + result.put("status", "0"); + result.put("message", "操作失败"); + + try { + if (StringUtils.isBlank(type)) { + result.put("message", "缺少必要参数type"); + return result; + } + Map data = null; + switch (type.toLowerCase()) { + case "poiquery": + data = poiQuery(request); + break; + case "poiqueryinfo": + data = poiQueryInfo(request); + break; + case "querycolumn": + data = queryColumn(request); + break; + case "updatecolumn": + data = updateColumn(request); + break; + case "poicreate": + data = poiCreate(request); + break; + case "poiupdate": + data = poiUpdate(request); + break; + case "poideletestore": + data = poiDeleteStore(request); + break; + case "poiquerystores": + data = poiQueryStores(request); + break; + default: + result.put("status", "0"); + result.put("message", "参数type错误"); + break; + } + + if (data != null) { + if (StringUtils.equals("1", data.get("status").toString())) { + result.put("status", "1"); + result.put("message", "操作成功"); + + data.remove("status"); + data.remove("message"); + + result.put("data", data); + } else { + result.put("status", "0"); + result.put("message", data.get("message").toString()); + } + } + + } catch (Exception e) { + result.put("status", "0"); + result.put("message", e.getMessage()); + logger.error(info + ",业务处理时发生异常", e); + } + + return result; + } + + /** + * POI Query-查询指定微信门店数据 + */ + private Map poiQuery(HttpServletRequest request) { + String info = "POI Query-查询指定微信门店数据"; + logger.error(info); + + Map result = new HashMap<>(); + String tenantId = getParameter(request, "tenantId");// 租户ID + String appSign = getParameter(request, "appSign");// 应用 + String wxStoreId = getParameter(request, "wxStoreId");// 微信门店Id + String pageIndex = getParameter(request, "pageIndex");// 当前页数 + String pageSize = getParameter(request, "pageSize");// 每页个数 + + try { + Map param = new HashMap(); + param.put("ak", baiduhProperties.getBaiduV4ak()); + param.put("geotable_id", baiduhProperties.getBakduTableId()); + param.put("tenantId", tenantId); + param.put("appSign", appSign); + param.put("wxStoreId", wxStoreId); + param.put("page_index", pageIndex); + param.put("page_size", pageSize); + String url = "http://api.map.baidu.com/geodata/v4/poi/list"; + + logger.info(info + " param>>>> " + JSON.toJSONString(param)); + HttpResponse response = HttpTool.url(url).form(param).post(); + String content = HttpTool.getResponseAsString(response); + + logger.info(info + " content>>>> " + JSON.toJSONString(content)); + Map dataMap = JSONUtil.parseObject(content, new TypeReference>() {}); + logger.error(info + " dataMap>>>> " + JSON.toJSONString(dataMap)); + + if(null != dataMap && "0".equals(dataMap.get("status").toString())){ + result.put("dataMapStatus", dataMap.get("status")); + result.put("pois", dataMap.get("pois")); + }else{ + result.put("dataMapStatus", dataMap.get("status").toString()); + result.put("dataMessage", dataMap.get("message")); + logger.error(info + ">>>> dataMap" + JSON.toJSONString(dataMap)); + } + + result.put("status", "1"); + result.put("message", "操作成功"); + } catch (Exception e) { + result.put("status", "0"); + result.put("message", "操作失败"); + logger.error(info + ",发生异常", e); + } + return result; + } + + /** + * POI Query-查询指定微信门店数据 + */ + private Map poiQueryInfo(HttpServletRequest request) { + String info = "POI poiQueryInfo-查询指定微信门店数据"; + logger.error(info); + + Map result = new HashMap<>(); + String tenantId = getParameter(request, "tenantId");// 租户ID + String appSign = getParameter(request, "appSign");// 应用 + String id = getParameter(request, "id");// 指定行Id + try { + if (StringUtils.isBlank(tenantId)) { + result.put("status", "0"); + result.put("message", tenantId + "企业编号不存在"); + return result; + } + if (StringUtils.isBlank(appSign)) { + result.put("status", "0"); + result.put("message", appSign + "应用不存在"); + return result; + } + + Map param = new HashMap(); + param.put("ak", baiduhProperties.getBaiduV4ak()); + param.put("geotable_id", baiduhProperties.getBakduTableId()); + param.put("id", id); + String url = "http://api.map.baidu.com/geodata/v4/poi/detail"; + + logger.info(info + " param>>>> " + JSON.toJSONString(param)); + HttpResponse response = HttpTool.url(url).form(param).post(); + String content = HttpTool.getResponseAsString(response); + logger.info(info + " content>>>> " + JSON.toJSONString(content)); + + Map dataMap = JSONUtil.parseObject(content, new TypeReference>() {}); + logger.error(info + " dataMap>>>> " + JSON.toJSONString(dataMap)); + + if(null != dataMap && "0".equals(dataMap.get("status").toString())){ + result.put("dataMapStatus", dataMap.get("status")); + result.put("pois", dataMap.get("pois")); + logger.info(info+">>>> 成功"); + }else{ + result.put("dataMapStatus", dataMap.get("status").toString()); + result.put("dataMessage", dataMap.get("message")); + logger.error(info + ">>>> dataMap" + JSON.toJSONString(dataMap)); + } + + result.put("status", "1"); + result.put("message", "操作成功"); + } catch (Exception e) { + result.put("status", "0"); + result.put("message", "操作失败"); + logger.error(info + ",发生异常", e); + } + return result; + } + + /** + * POI queryColumn-查询行column信息 + */ + private Map queryColumn(HttpServletRequest request) { + String info = "POI querycolumn-查询行column信息"; + logger.error(info); + + Map result = new HashMap<>(); + String tenantId = getParameter(request, "tenantId");// 租户ID + String appSign = getParameter(request, "appSign");// 应用 + + try { + if (StringUtils.isBlank(tenantId)) { + result.put("status", "0"); + result.put("message", tenantId + "企业编号不存在"); + return result; + } + if (StringUtils.isBlank(appSign)) { + result.put("status", "0"); + result.put("message", appSign + "应用不存在"); + return result; + } + + Map param = new HashMap(); + param.put("ak", baiduhProperties.getBaiduV4ak()); + param.put("geotable_id", baiduhProperties.getBakduTableId()); + String url = "http://api.map.baidu.com/geodata/v4/column/list"; + + logger.info(info + " param>>>> " + JSON.toJSONString(param)); + HttpResponse response = HttpTool.url(url).form(param).post(); + String content = HttpTool.getResponseAsString(response); + logger.info(info + " content>>>> " + JSON.toJSONString(content)); + Map dataMap = JSONUtil.parseObject(content, new TypeReference>() {}); + logger.error(info + " dataMap>>>> " + JSON.toJSONString(dataMap)); + + if(null != dataMap && "0".equals(dataMap.get("status").toString())){ + result.put("dataMapStatus", dataMap.get("status")); + result.put("data", dataMap.get("columns")); + logger.info(info+">>>> 成功"); + }else{ + result.put("dataMapStatus", dataMap.get("status").toString()); + result.put("dataMessage", dataMap.get("message")); + logger.error(info + ">>>> dataMap" + JSON.toJSONString(dataMap)); + } + + result.put("status", "1"); + result.put("message", "操作成功"); + } catch (Exception e) { + result.put("status", "0"); + result.put("message", "操作失败"); + logger.error(info + ",发生异常", e); + } + return result; + } + + /** + * POI updateColumn-编辑column信息 + */ + private Map updateColumn(HttpServletRequest request) { + String info = "POI updateColumn-编辑column信息"; + logger.error(info); + + Map result = new HashMap<>(); + String tenantId = getParameter(request, "tenantId");// 租户ID + String appSign = getParameter(request, "appSign");// 应用 + String id = getParameter(request, "id");// 指定表指定行Id + String isIndexField = getParameter(request, "isIndexField");// 是否是检索字段 + String isSearchField = getParameter(request, "isSearchField");// 是否为云存储的索引字段; + + try { + if (StringUtils.isBlank(tenantId)) { + result.put("status", "0"); + result.put("message", tenantId + "企业编号不存在"); + return result; + } + if (StringUtils.isBlank(appSign)) { + result.put("status", "0"); + result.put("message", appSign + "应用不存在"); + return result; + } + if (StringUtils.isBlank(id)) { + result.put("status", "0"); + result.put("message", id + "修改数据行不存在"); + return result; + } + + Map param = new HashMap(); + param.put("ak", baiduhProperties.getBaiduV4ak()); + param.put("geotable_id", baiduhProperties.getBakduTableId()); + param.put("id", id); + if (StringUtils.isNotBlank(isIndexField)) { + param.put("is_index_field", isIndexField); + } + if (StringUtils.isNotBlank(isSearchField)) { + param.put("is_search_field", isSearchField); + } + String url = "http://api.map.baidu.com/geodata/v4/column/update"; + + logger.info(info + " param>>>> " + JSON.toJSONString(param)); + HttpResponse response = HttpTool.url(url).form(param).post(); + String content = HttpTool.getResponseAsString(response); + logger.info(info + " content>>>> " + JSON.toJSONString(content)); + Map dataMap = JSONUtil.parseObject(content, new TypeReference>() {}); + logger.error(info + " dataMap>>>> " + JSON.toJSONString(dataMap)); + + if(null != dataMap && "0".equals(dataMap.get("status").toString())){ + result.put("dataMapStatus", dataMap.get("status")); + result.put("pois", dataMap.get("pois")); + logger.info(info+">>>> 成功"); + }else{ + result.put("dataMapStatus", dataMap.get("status").toString()); + result.put("dataMessage", dataMap.get("message")); + logger.error(info + ">>>> dataMap" + JSON.toJSONString(dataMap)); + } + + result.put("status", "1"); + result.put("message", "操作成功"); + } catch (Exception e) { + result.put("status", "0"); + result.put("message", "操作失败"); + logger.error(info + ",发生异常", e); + } + return result; + } + + /** + * POI Create-指定表创建新数据 + */ + private Map poiCreate(HttpServletRequest request) { + String info = "POI Create"; + logger.error(info); + + Map result = new HashMap<>(); + String tenantId = getParameter(request, "tenantId");// 租户ID + String appSign = getParameter(request, "appSign");// 应用 + String title = getParameter(request, "title"); + String tags = getParameter(request, "tags"); + String latitude = getParameter(request, "latitude");// 纬度 + String longitude = getParameter(request, "longitude");// 经度 + String coord_type = getParameter(request, "coord_type");// 坐标类型 + String address = getParameter(request, "address");// 地址 + String storeId = getParameter(request, "storeId"); + String no = getParameter(request, "no"); + String name = getParameter(request, "name"); + String wxStoreId = getParameter(request, "wxStoreId"); + String enabled = getParameter(request, "enabled");// 微信门店状态 + + try { + if (StringUtils.isBlank(tenantId)) { + result.put("status", "0"); + result.put("message", tenantId + "企业编号不存在"); + return result; + } + if (StringUtils.isBlank(appSign)) { + result.put("status", "0"); + result.put("message", appSign + "应用不存在"); + return result; + } + if (StringUtils.isBlank(wxStoreId)) { + result.put("status", "0"); + result.put("message", wxStoreId + "微信门店不存在"); + return result; + } + + Map param = new HashMap(); + param.put("ak", baiduhProperties.getBaiduV4ak()); + param.put("geotable_id", baiduhProperties.getBakduTableId()); + param.put("tenantId", tenantId); + param.put("appSign", appSign); + param.put("title", title); + // param.put("tags", tags); + param.put("tags", tenantId + "-" + appSign + "-"+enabled); + param.put("latitude", latitude); + param.put("longitude", longitude); + param.put("coord_type", coord_type); + param.put("address", address); + param.put("storeId", storeId); + param.put("no", no); + param.put("name", name); + param.put("wxStoreId", wxStoreId); + param.put("enabled", enabled); + String url = "http://api.map.baidu.com/geodata/v4/poi/create"; + + logger.info(info + " param>>>> " + JSON.toJSONString(param)); + HttpResponse response = HttpTool.url(url).form(param).post(); + String content = HttpTool.getResponseAsString(response); + logger.info(info + " content>>>> " + JSON.toJSONString(content)); + Map dataMap = JSONUtil.parseObject(content, new TypeReference>() {}); + logger.error(info + " dataMap>>>> " + JSON.toJSONString(dataMap)); + if(null != dataMap && "0".equals(dataMap.get("status").toString())){ + result.put("dataMapStatus", 1); + result.put("dataMessage", dataMap.get("message")); + result.put("id", dataMap.get("id")); + logger.info(info+">>>> 成功"); + }else{ + result.put("dataMapStatus", dataMap.get("status").toString()); + result.put("dataMessage", dataMap.get("message")); + logger.error(info + ">>>> dataMap" + JSON.toJSONString(dataMap)); + } + + result.put("status", "1"); + result.put("message", "操作成功"); + } catch (Exception e) { + result.put("status", "0"); + result.put("message", "操作失败"); + logger.error(info + ",发生异常", e); + } + return result; + } + + /** + * POI Update-指定表编辑/创建指定数据 + */ + private Map poiUpdate(HttpServletRequest request) { + String info = "POI poiUpdate-编辑/新增指定数据"; + logger.error(info); + + Map result = new HashMap<>(); + String tenantId = getParameter(request, "tenantId");// 租户ID + String appSign = getParameter(request, "appSign");// 应用 + String title = getParameter(request, "title"); + // String tags = getParameter(request, "tags"); + String latitude = getParameter(request, "latitude");// 纬度 + String longitude = getParameter(request, "longitude");// 经度 + String coord_type = getParameter(request, "coord_type");// 坐标类型 + String address = getParameter(request, "address");// 地址 + String storeId = getParameter(request, "storeId"); + String no = getParameter(request, "no"); + String name = getParameter(request, "name"); + String wxStoreId = getParameter(request, "wxStoreId"); + String enabled = getParameter(request, "enabled");// 微信门店状态 + try { + if (StringUtils.isBlank(tenantId)) { + result.put("status", "0"); + result.put("message", tenantId + "企业编号不存在"); + return result; + } + if (StringUtils.isBlank(appSign)) { + result.put("status", "0"); + result.put("message", appSign + "应用不存在"); + return result; + } + if (StringUtils.isBlank(wxStoreId)) { + result.put("status", "0"); + result.put("message", wxStoreId + "微信门店不存在"); + return result; + } + WxStore store = wxStoreService.get(tenantId, wxStoreId); + if (store == null) { + result.put("status", "0"); + result.put("message", "微信门店信息不存在"); + return result; + } + // 默认深圳 + if (StringUtils.isBlank(latitude)) { + latitude = "22.581329"; + } + if (StringUtils.isBlank(longitude)) { + longitude = "113.918868"; + } + + Map data = new HashMap(); + data.put("title", store.getName()); + data.put("name", store.getName()); + data.put("address", address); + data.put("longitude", longitude); + data.put("latitude", latitude); + data.put("storeId", storeId); + data.put("no", no); + data.put("wxStoreId", wxStoreId); + data.put("enabled", enabled); + logger.info(info + ">>>> param" + JSON.toJSONString(data)); + Map dataMap = updateBaiduStore(data, tenantId, appSign,baiduhProperties.getBaiduV4ak(),baiduhProperties.getBakduTableId()); + logger.info(info + ">>>> dataMap" + JSON.toJSONString(dataMap)); + + if(null != dataMap && "0".equals(dataMap.get("status").toString())){ + result.put("dataMapStatus", 1); + result.put("dataMessage", dataMap.get("message")); + result.put("id", dataMap.get("id")); + logger.info(info+">>>> 成功"); + }else{ + result.put("dataMapStatus", dataMap.get("status").toString()); + result.put("dataMessage", dataMap.get("message")); + logger.error(info + ">>>> dataMap" + JSON.toJSONString(dataMap)); + } + + result.put("status", "1"); + result.put("message", "操作成功"); + } catch (Exception e) { + result.put("status", "0"); + result.put("message", "操作失败"); + logger.error(info + ",发生异常", e); + } + return result; + } + + /** + * POI deleteStore-删除指定百度门店信息 + */ + public Map poiDeleteStore(HttpServletRequest request) { + String info = "删除指定百度门店信息"; + logger.error(info ); + + String tenantId = request.getParameter("tenantId");// + String appSign = request.getParameter("appSign");// 应用 + String wxStoreId = request.getParameter("wxStoreId");// 微信门店Id + + Map dataMap = null; + try { + dataMap = deleteStore(tenantId,appSign,wxStoreId,baiduhProperties.getBaiduV4ak(),baiduhProperties.getBakduTableId()); + } catch (Exception e) { + logger.error(info+"时发生异常",e); + } + return dataMap; + } + + /** + * POI deleteStore-删除指定百度门店信息 + */ + public static Map deleteStore(String tenantId,String appSign,String wxStoreId,String baiduAk,String baiduTableId) { + String info = "删除指定百度门店信息"; + logger.error(info+" wxStoreId:{}",wxStoreId); + + Map dataMap = null; + try { + // 先通过微信门店Id查询数据是否存在 存在获取数据Id删除 + Map param = new HashMap(); + param.put("ak", baiduAk); + param.put("geotable_id", baiduTableId); + param.put("tenantId", tenantId); + param.put("appSign", appSign); + param.put("wxStoreId", wxStoreId); + param.put("page_index", 0); + param.put("page_size", 50); + String queryUrl = "http://api.map.baidu.com/geodata/v4/poi/list"; + + logger.error(info + ">>>> query param>>>> " + JSON.toJSONString(param)); + HttpResponse queryResponse = HttpTool.url(queryUrl).form(param).post(); + String queryContent = HttpTool.getResponseAsString(queryResponse); + dataMap = JSONUtil.parseObject(queryContent, new TypeReference>() {}); + logger.info(info + ">>>> query " + JSON.toJSONString(dataMap)); + if (null != dataMap && null != dataMap.get("status") && "0".equals(dataMap.get("status").toString())) { + int size = Integer.parseInt(dataMap.get("size").toString()); + if(size > 0){ + String[] pois = JSON.parseObject(JSON.toJSONString(dataMap.get("pois")), String[].class); + Map poisMap = JSONUtil.parseObject(pois[0], new TypeReference>() {}); + String id = poisMap.get("id").toString(); + if(StringUtils.isNotBlank(id)){ + // 数据不存在 执行插入操作 + param = new HashMap(); + param.put("ak", baiduAk); + param.put("geotable_id", baiduTableId); + param.put("id", id); + String url = "http://api.map.baidu.com/geodata/v4/poi/delete"; + + logger.info(info + " delete param>>>> " + JSON.toJSONString(param)); + HttpResponse response = HttpTool.url(url).form(param).post(); + String content = HttpTool.getResponseAsString(response); + dataMap = JSONUtil.parseObject(content, new TypeReference>() {}); + if("0".equals(dataMap.get("status"))){ + dataMap.put("status", 1); + }else{ + dataMap.put("status", 0); + } + logger.error(info + " delete result>>>> " + JSON.toJSONString(dataMap)); + }else{ + dataMap.put("status",0); + dataMap.put("message","查询数据Id不存在"); + } + }else{ + dataMap.put("status",0); + dataMap.put("message","查询数据不存在"); + } + }else{ + dataMap.put("status",0); + dataMap.put("message","查询数据错误"); + } + } catch (Exception e) { + logger.error(info + "时发生错误:", e); + } + return dataMap; + } + + // 修改百度门店信息 + public static Map updateBaiduStore(Map data, String tenantId, String appSign,String baiduAk,String baiduTableId) { + String info = "修改百度门店信息"; + logger.error(info + " storeId:" + data.get("storeId").toString() + " no:" + data.get("no").toString() + " name:" + + data.get("name").toString()); + + Map dataMap = null; + try { + + // 先通过微信门店Id查询数据是否存在 如果不存在执行插入操作 否则更新数据 + Map param = new HashMap(); + param.put("ak", baiduAk); + param.put("geotable_id", baiduTableId); + param.put("tenantId", tenantId); + param.put("appSign", appSign); + param.put("wxStoreId", data.get("wxStoreId").toString()); + param.put("page_index", 0); + param.put("page_size", 50); + String queryUrl = "http://api.map.baidu.com/geodata/v4/poi/list"; + + logger.error(info + ">>>> query param>>>> " + JSON.toJSONString(param)); + HttpResponse queryResponse = HttpTool.url(queryUrl).form(param).post(); + String queryContent = HttpTool.getResponseAsString(queryResponse); + dataMap = JSONUtil.parseObject(queryContent, new TypeReference>() {}); + logger.info(info+">>>> query " + JSON.toJSONString(dataMap)); + + if (null != dataMap && null != dataMap.get("status") && "0".equals(dataMap.get("status").toString())) { + param = new HashMap(); + param.put("ak", baiduAk); + param.put("geotable_id", baiduTableId); + param.put("longitude", data.get("longitude").toString()); + param.put("latitude", data.get("latitude").toString()); + param.put("coord_type", 1); + param.put("title", data.get("title").toString()); + param.put("name", data.get("name").toString()); + param.put("enabled", data.get("enabled").toString()); + param.put("tags", tenantId + "-" + appSign + "-" + data.get("enabled").toString()); + param.put("address", data.get("address").toString()); + int size = Integer.parseInt(dataMap.get("size").toString()); + if (size > 0) { + if (size > 1) { + logger.error(info + "时发生错误 在百度数据中通过wxStoreId:" + data.get("wxStoreId").toString() + "查询出多条记录:" + + size); + } else { + // 数据已经存在 执行修改操作 + String[] poisStr = JSON.parseObject(JSON.toJSONString(dataMap.get("pois")), String[].class); + Map storeMap = JSONUtil.parseObject(poisStr[0], + new TypeReference>() { + }); + String id = storeMap.get("id").toString(); + param.put("id", id); + String url = "http://api.map.baidu.com/geodata/v4/poi/update"; + + logger.info(info + ">>>> update param" + JSON.toJSONString(param)); + HttpResponse response = HttpTool.url(url).form(param).post(); + String content = HttpTool.getResponseAsString(response); + dataMap = JSONUtil.parseObject(content, new TypeReference>() {}); + logger.error(info + ">>>> update result" + JSON.toJSONString(dataMap)); + } + } else { + // 数据不存在 执行插入操作 + param.put("appSign", appSign); + param.put("storeId", data.get("storeId").toString()); + param.put("no", data.get("no").toString()); + param.put("wxStoreId", data.get("wxStoreId").toString()); + String url = "http://api.map.baidu.com/geodata/v4/poi/create"; + + logger.info(info + " save param>>>> " + JSON.toJSONString(param)); + HttpResponse response = HttpTool.url(url).form(param).post(); + String content = HttpTool.getResponseAsString(response); + dataMap = JSONUtil.parseObject(content, new TypeReference>() {}); + logger.error(info + " save result>>>> " + JSON.toJSONString(dataMap)); + } + }else{ + logger.error(info + " query错误>>>> " + JSON.toJSONString(dataMap)); + } + } catch (Exception e) { + logger.error(info + "时发生错误:", e); + } + return dataMap; + } + + /** + * POI Query-查询指定经纬度附近门店 + */ + private Map poiQueryStores(HttpServletRequest request) { + String info = "POI poiQueryStores"; + logger.error(info); + + Map result = new HashMap<>(); + String tenantId = getParameter(request, "tenantId");// 租户ID + String appSign = getParameter(request, "appSign");// 应用 + String longitude = getParameter(request, "longitude");// 经度 + String latitude = getParameter(request, "latitude");// 纬度 + String radius = getParameter(request, "radius");// 查询范围(米) + String sortby = getParameter(request, "sortby");// 排序字段 + String filter = getParameter(request, "filter");// 筛选 + String enabled = getParameter(request, "enabled");// 门店状态 + String pageIndex = getParameter(request, "pageIndex");// 当前页数 + String pageSize = getParameter(request, "pageSize");// 每页个数 + try { + if (StringUtils.isBlank(tenantId)) { + result.put("status", "0"); + result.put("message", tenantId + "企业编号不存在"); + return result; + } + if (StringUtils.isBlank(appSign)) { + result.put("status", "0"); + result.put("message", appSign + "应用不存在"); + return result; + } + if (StringUtils.isBlank(latitude)) { + result.put("status", "0"); + result.put("message", latitude + "纬度不存在"); + return result; + } + if (StringUtils.isBlank(radius)) { + result.put("status", "0"); + result.put("message", radius + "经度不存在"); + return result; + } + + Map param = new HashMap(); + param.put("ak", baiduhProperties.getBaiduV4ak()); + param.put("geotable_id", baiduhProperties.getBakduTableId()); + param.put("location", longitude + "," + latitude); + param.put("tags", tenantId + "-" + appSign + "-" + enabled); + + if (StringUtils.isNotBlank(filter)) { + param.put("filter", filter); + } + if (StringUtils.isNotBlank(radius)) { + param.put("radius", radius); + } + if (StringUtils.isNotBlank(sortby)) { + param.put("sortby", sortby); + } + if (StringUtils.isNotBlank(pageIndex)) { + param.put("page_index", pageIndex); + } + if (StringUtils.isNotBlank(pageSize)) { + param.put("page_size", pageSize); + } + String url = "http://api.map.baidu.com/geosearch/v4/nearby"; + url = url + "?" + transferMapToString(param); + logger.error(info + ">>>> param" + JSON.toJSONString(param)); + + HttpResponse response = HttpTool.url(url).get(); + String content = HttpTool.getResponseAsString(response); + logger.info(info + ">>>> content" + content); + Map dataMap = JSONUtil.parseObject(content, new TypeReference>() {}); + + logger.error(info + " poiQueryStores result>>>> " + JSON.toJSONString(dataMap)); + if(null != dataMap && "0".equals(dataMap.get("status").toString())){ + List> data = new ArrayList>(); + String[] contents = JSON.parseObject(JSON.toJSONString(dataMap.get("contents")), String[].class); + for (String storeStr : contents) { + Map storeMap = JSONUtil.parseObject(storeStr, new TypeReference>() {}); + String name = storeMap.get("name").toString(); + name = name.replaceAll("\\+", " "); + storeMap.put("name", name); + String address = storeMap.get("address")==null?"":storeMap.get("address").toString(); + address = address.replaceAll("\\+", " "); + storeMap.put("address", address); + data.add(storeMap); + } + result.put("dataMapStatus", 0); + result.put("total", dataMap.get("total")); + result.put("size", dataMap.get("size")); + result.put("data", data); + }else{ + result.put("dataMapStatus", dataMap.get("status").toString()); + result.put("dataMessage", dataMap.get("message")); + logger.error(info+" >>> "+JSON.toJSONString(dataMap)); + } + + result.put("status", "1"); + result.put("message", "操作成功"); + } catch (Exception e) { + result.put("status", "0"); + result.put("message", "操作失败"); + logger.error(info + ",发生异常", e); + } + return result; + } + + // 将map转化为&key=value的形式 + public String transferMapToString(Map param) { + String content = ""; + try { + if (null != param) { + for (String key : param.keySet()) { + if (StringUtils.isNotBlank(content)) { + content += "&" + key + "=" + URLEncoder.encode(param.get(key).toString(), "UTF-8"); + } else { + content = key + "=" + URLEncoder.encode(param.get(key).toString(), "UTF-8"); + } + } + } + } catch (Exception e) { + logger.error("map转string时出错", e); + } + + System.out.println("url >>>> " + content); + return content; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/controller/open/BaseOpenController.java b/food-open/food-open-api/src/main/java/com/jwsaas/controller/open/BaseOpenController.java new file mode 100644 index 0000000..e38061a --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/controller/open/BaseOpenController.java @@ -0,0 +1,25 @@ +package com.jwsaas.controller.open; + +import com.jwsaas.controller.BaseController; +import com.jwsaas.open.utils.DES; +import com.jwsaas.open.utils.DESEx; + +public abstract class BaseOpenController extends BaseController { + + protected String getDecryptStr(String encryptStr) { + String result = null; + // 暴力模式适配javascript的ecb模式下的des加密解密 + try { + // CBC模式,进行SafeBase64解密,使用于C#、Delphi、Android + result = DES.decrypt(encryptStr); + } catch (Exception ex) { + // ECB模式,进行HEX编码解密,适用于JS、NODE + String strSuffix = DESEx.get3DESRandomSuffix(); + String cipherText = encryptStr.toUpperCase().substring(0, encryptStr.length() - 16) + strSuffix; + result = DESEx.tripleDESDecrypt(cipherText); + } + + return result == null ? encryptStr : result; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/controller/open/MqttController.java b/food-open/food-open-api/src/main/java/com/jwsaas/controller/open/MqttController.java new file mode 100644 index 0000000..042df60 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/controller/open/MqttController.java @@ -0,0 +1,58 @@ +package com.jwsaas.controller.open; + +import java.util.HashMap; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.jwsaas.http.HttpTool; +import com.jwsaas.open.Global; +import com.jwsaas.util.JSONUtil; + +/** + * MQTT相关接口 + */ +@Controller(Global.SIGN + "MqttController") +@RequestMapping(Global.OPEN_PATH + "/mqtt") +public class MqttController extends BaseOpenController { + + @RequestMapping(value = "logs", method = { RequestMethod.POST }) + @ResponseBody + public Object logs(HttpServletRequest request, HttpServletResponse response, Model model) { + String info = "MQTT日志服务"; + logger.debug(info); + + Map result = new HashMap<>(); + result.put("status", "0"); + result.put("message", "操作失败"); + + try { + + logger.error("request.parameterMap:" + request.getParameterMap()); + logger.error("request.parameterMap.json:" + JSONUtil.toJSONString(request.getParameterMap())); + + logger.error("request.ContentLength:" + request.getContentLength()); + + // 读取请求内容 + String resquestBody = HttpTool.getResquestBody(request); + logger.error("resquestBody:" + resquestBody); + + result.put("status", "1"); + result.put("message", "操作成功"); + } catch (Exception e) { + result.put("status", "0"); + result.put("message", e.getMessage()); + logger.error(info + ",业务处理时发生异常", e); + } + + return result; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/controller/open/TaskController.java b/food-open/food-open-api/src/main/java/com/jwsaas/controller/open/TaskController.java new file mode 100644 index 0000000..9292b4e --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/controller/open/TaskController.java @@ -0,0 +1,1851 @@ +package com.jwsaas.controller.open; + +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import com.jwsaas.entity.food.*; +import com.jwsaas.entity.task.Schedule; +import com.jwsaas.service.food.*; +import com.jwsaas.task.utils.TaskOpenUtils; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.http.HttpResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.fasterxml.jackson.core.type.TypeReference; +import com.jwsaas.Constant; +import com.jwsaas.api.entity.program.AuthAccessToken; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.http.HttpTool; +import com.jwsaas.open.Global; +import com.jwsaas.open.utils.WopUtils; +import com.jwsaas.reactor.event.EventKeys; +import com.jwsaas.util.JSONUtil; +import com.jwsaas.util.TaskSignUtil; +import com.jwsaas.utils.DateUtils; +import com.jwsaas.utils.IdWorkerUtils; +import com.jwsaas.weixin.SignUtil; + +import reactor.bus.Event; +import reactor.bus.EventBus; + +/** + * 计划任务开放接口 + */ +@Controller(Global.SIGN + "TaskController") +@RequestMapping(Global.OPEN_PATH + "/task") +public class TaskController extends BaseOpenController { + + @Resource + private com.jwsaas.service.food.ProgramSettingService programSettingService; + @Resource + private AdjustPriceTicketService adjustPriceTicketService; + @Resource + private AdjustPriceProductService adjustPriceProductService; + @Resource + private AdjustPriceStoreService adjustPriceStoreService; + @Resource + private StoreProductService storeProductService; + @Resource + private com.jwsaas.service.food.WxSalesOrderService wxSalesOrderService; + @Resource + private com.jwsaas.service.food.WxStoreService wxStoreService; + @Autowired + protected EventBus eventBus; + @Resource + private PromotionTicketService promotionTicketService; + @Resource + private CouponService couponService; + @Resource + private PromotionTaskService promotionTaskService; + @Resource + private WxAdjustPriceTicketService wxAdjustPriceTicketService; + @Resource + private WxAdjustPriceGoodsService wxAdjustPriceGoodsService; + @Resource + private WxAdjustPriceStoreService wxAdjustPriceStoreService; + @Resource + private WxStoreGoodsService wxStoreGoodsService; + @Resource + private ProductStoreStockLogService productStoreStockLogService; + @Resource + private ProductStoreOutCollectDayService productStoreOutCollectDayService; + + @Resource + private com.jwsaas.service.food.ProgramStoreBusinessTicketService programStoreBusinessTicketService; + @Resource + private com.jwsaas.service.food.ProgramStorePayService programStorePayService; + @Resource + private com.jwsaas.service.food.PaymentParameterService paymentParameterService; + @Resource + private com.jwsaas.cache.CacheService cacheService; + + @Resource + private com.jwsaas.service.food.PosInfoService posInfoService; + + @Resource + private ProgramPromotionTicketService programPromotionTicketService; + @Resource + private ProgramPromotionTaskService programPromotionTaskService; + @Resource + private DispatchTicketService dispatchTicketService; + @Resource + private StoreCostManageService storeCostManageService; + + @Autowired + private TaskOpenUtils taskOpenUtils; + + @Resource + private ProgramPaymentParameterService programPaymentParameterService; + + @Resource + private StoreService storeService; + + /** + * 计划任务RSA公钥 + */ + public static final String TASK_RSA_PUBLICK_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDEVtinnqO5NvpSul4XRpwc7yQoOobvob8dKCX5K79bns3TTmeGoTwwoXJuJX0KUBF817Tr+DKA4Dd/a5VLTZux3Xww2Lox773lByp7g9kCiUAQK4JDJKu0IdAhGX7pE8ABNRnG0vPQLvwF/mQEt5ItFaxk3gtfWJB2ay5yyQiboQIDAQAB"; + private static String charset = "UTF-8"; + + @RequestMapping(value = "", method = { RequestMethod.POST }) + @ResponseBody + public Object index(String type, HttpServletRequest request, HttpServletResponse response, Model model) { + String info = "计划任务执行入口"; + + Map result = new HashMap<>(); + result.put("status", "0"); + result.put("message", "操作失败"); + + try { + String action = getParameter(request, "action"); + String sign = getParameter(request, "sign"); + String tenantId = getParameter(request, "tenantId"); + Map paramsMap = TaskSignUtil.getSignParamsMap(request); + paramsMap.put("sign", sign); + boolean signVerified = TaskSignUtil.rsaCheck(paramsMap, TASK_RSA_PUBLICK_KEY, charset); + logger.debug("action:" + action + ",signVerified:" + signVerified); + if (!signVerified) { + result.put("status", "0"); + result.put("message", "签名校验失败"); + return result; + } + + Map data = null; + switch (action) { + case "ProductPriceAdjust": + // 商品调价 + data = executeProductPriceAdjust(tenantId, request); + break; + case "WxdcOrderAutoCancel": + // 微信点餐订单,超时自动取消 + data = executeWxdcOrderAutoCancel(tenantId, request); + break; + case "WxdcOrderAutoFinish": + // 微信点餐订单,商家接单N分钟后自动完成 + data = executeWxdcOrderAutoFinish(tenantId, request); + break; + case "PromotionTicketStatusChange": + // 促销单状态调整 + data = executePromotionTicketStatusChange(tenantId, request); + break; + case "PromotionTicketStart": + // 促销单开始 + data = executePromotionTicketStart(tenantId, request); + break; + case "PromotionTicketFinish": + // 促销单结束 + data = executePromotionTicketFinish(tenantId, request); + break; + case "CouponFinish": + // 代金券结束 + data = executeCouponFinish(tenantId, request); + break; + case "WxAdjustPriceTicket": + // 微信商品调价 + data = executeWeixinGoodsPriceAdjust(tenantId, request); + break; + case "StoreOutgoingCollect": + // 门店出库汇总 + data = executeStoreOutgoingCollect(tenantId, request); + break; + case "DelProductStoreStockLog": + // 门店库存流水删除 + data = DelProductStoreStockLog(tenantId, request); + break; + case "ProgramOrderAutoCancel": + // 小程序自动取消订单,退款 + data = executeProgramOrderAutoCancel(tenantId, request); + break; + case "ProgramOrderAutoFinish": + // 小程序60分钟自动完成订单 + data = executeProgramOrderAutoFinish(tenantId, request); + break; + case "ProgramPromotionTicketStatusChange": + // 小程序促销单状态调整; + data = executeProgramPromotionTicketStatusChange(tenantId, request); + break; + case "ProgramPromotionTicketStart": + // 小程序促销开始; + data = executeProgramPromotionTicketStart(tenantId, request); + break; + case "ProgramPromotionTicketFinish": + // 小程序促销结束; + data = executeProgramPromotionTicketFinish(tenantId, request); + break; + case "DispatchTicketAutoCheck": + // 配送单发货后7天自动验收; + data = executeDispatchTicketAutoCheck(tenantId, request); + break; + case "StoreTimeCostTask": + // 门店扣款定时任务; + data = executeStoreTimeCostTask(tenantId, request); + break; + case "PrepareStoreTimeCostTask": + // 门店扣款定时任务; + data = executeStoreTimeCostTaskStart(tenantId, request); + break; + case "StoreTimeCostTaskFinish": + // 门店扣款定时任务; + data = executeStoreTimeCostTaskFinish(tenantId, request); + break; + case "ProgramOrderNopaidAutoCancel": + // 巨为小程序订单,120分钟未支付,订单改为取消 + data = executeProgramOrderNopaidAutoCancel(tenantId, request); + break; + case "SplitStorePayAuto": + // 定时分帐 + data = executeSplitStorePayAuto(tenantId, request); + break; + default: + result.put("status", "0"); + result.put("message", "参数action错误"); + break; + } + + if (data != null && data.get("status") != null) { + if (StringUtils.equals("1", data.get("status").toString())) { + result.put("status", "1"); + result.put("message", "操作成功"); + + data.remove("status"); + data.remove("message"); + + result.put("data", data); + } else { + result.put("status", "0"); + result.put("message", data.get("message").toString()); + } + } + + } catch (Exception e) { + result.put("status", "0"); + result.put("message", e.getMessage()); + logger.error(info + ",业务处理时发生异常", e); + } + return result; + } + + private Map executeProgramOrderNopaidAutoCancel(String tenantId, HttpServletRequest request) { + String info = "下单后120分钟订单没有支付取消订单"; + Map result = new HashMap<>(); + tenantId = getParameter(request, "tenantId"); + String storeId = getParameter(request, "storeId"); + String busNo = getParameter(request, "busNo"); + if (StringUtils.isBlank(tenantId)) { + result.put("status", "0"); + result.put("message", "缺少必要参数tenantId"); + return result; + } + if (StringUtils.isBlank(storeId)) { + result.put("status", "0"); + result.put("message", "缺少必要参数storeId"); + return result; + } + if (StringUtils.isBlank(busNo)) { + result.put("status", "0"); + result.put("message", "缺少必要参数busNo"); + return result; + } + try { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("no", busNo)); + criteria.add(Restrictions.eq("storeId", storeId)); + List ticketList = programStoreBusinessTicketService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(ticketList)) { + result.put("status", "0"); + result.put("message", "订单不存在"); + return result; + } + ProgramStoreBusinessTicket programStoreBusinessTicket = ticketList.get(0); + if (programStoreBusinessTicket.getStatus() != -1) { + result.put("status", "0"); + result.put("message", "订单状态不合法"); + return result; + } + //有出现会员支付成功,但没有上传支付数据,直接调用会员退款接口; + try { + OrderMemberPayRefund(tenantId,programStoreBusinessTicket,programStoreBusinessTicket.getNo()); + } catch (Exception e) { + logger.error(info + ",直接调用会员退款接口,出错:"+e); + programStoreBusinessTicket.setStatus(3);// 订单已取消 + programStoreBusinessTicket.setBackCause("订单支付超时,已取消"); + programStoreBusinessTicket.setModifyUser("taskJob"); + programStoreBusinessTicket.setModifyDate(new Date()); + programStoreBusinessTicketService.update(tenantId, programStoreBusinessTicket); + + Object meituanOrderIds = cacheService.get(tenantId, "program_" + storeId); + if (meituanOrderIds != null) { + Map orderIds = (Map) cacheService.get(tenantId, "program_" + storeId); + orderIds.remove(String.valueOf(programStoreBusinessTicket.getNo())); + cacheService.set(tenantId, "program_" + storeId, orderIds, 1200); + } else { + Map orderIds = new HashMap<>(); + cacheService.set(tenantId, "program_" + storeId, orderIds, 1200); + } + result.put("status", "1"); + } + + programStoreBusinessTicket.setStatus(3);// 订单已取消 + programStoreBusinessTicket.setBackCause("订单支付超时,已取消"); + programStoreBusinessTicket.setModifyUser("taskJob"); + programStoreBusinessTicket.setModifyDate(new Date()); + programStoreBusinessTicketService.update(tenantId, programStoreBusinessTicket); + // 清理MQTT订单待处理订单缓存 + try { + Object meituanOrderIds = cacheService.get(tenantId, "program_" + storeId); + if (meituanOrderIds != null) { + Map orderIds = (Map) cacheService.get(tenantId, "program_" + storeId); + orderIds.remove(String.valueOf(programStoreBusinessTicket.getNo())); + cacheService.set(tenantId, "program_" + storeId, orderIds, 1200); + } else { + Map orderIds = new HashMap<>(); + cacheService.set(tenantId, "program_" + storeId, orderIds, 1200); + } + } catch (Exception e) { + logger.error(info + "订单状态推送清理缓存失败>>>>>>>>>>"); + } + result.put("status", "1"); + } catch (Exception e) { + result.put("status", "0"); + result.put("message", "操作失败" + e.getMessage()); + logger.error(info + ",发生异常", e); + } + return result; + } + + private Map executeSplitStorePayAuto(String tenantId, HttpServletRequest request) { + String info = "定时分帐"; + logger.debug("info:" + info+"tenantId:"+tenantId); + Map result = new HashMap<>(); + return result; + } + + private Map executeStoreTimeCostTaskFinish(String tenantId, HttpServletRequest request) { + String info = "门店费用扣款定时任务结束"; + Map result = new HashMap<>(); + String feeId = getParameter(request, "feeId"); + try{ + String currentUser = Constant.CREATE_USER; + logger.debug("info:" + info); + logger.debug("tenantId:" + tenantId); + logger.debug("feeId:" + feeId); + logger.debug("currentUser:" + currentUser); + + StoreCostManage manage = storeCostManageService.get(tenantId,feeId); + Integer i = 0; + if(manage.getStatus() == 1){ + if(manage.getExeStatus() == 1){ +// manage.setExeStatus(3);//结束; +// manage.setModifyDate(new Date()); +// manage.setModifyUser(currentUser); + storeCostManageService.updateStatusToFinish(tenantId,manage,currentUser); + + /*-------------移除计划任务---------------*/ + Schedule schedule = new Schedule(); + schedule.setTenantId(tenantId); + schedule.setSign("StoreTimeCostTask_" + tenantId+"_feeId_"+feeId);// 标识 + Boolean queryTaskResult = taskOpenUtils.querySchedule(schedule); + Boolean removeTaskResult = true; + if (queryTaskResult) { + removeTaskResult = taskOpenUtils.removeSchedule(schedule); + } + i = 1; + } + } + + if(i == 1){ + result.put("status", "1"); + result.put("message", "操作成功"); + }else{ + result.put("status", "0"); + result.put("message", "操作失败"); + } + }catch (Exception e){ + result.put("status", "0"); + result.put("message", "操作失败" + e.getMessage()); + logger.error(info + ",发生异常", e); + } + return result; + } + + private Map executeStoreTimeCostTaskStart(String tenantId, HttpServletRequest request) { + String info = "门店费用扣款任务启用任务"; + Map result = new HashMap<>(); + String feeId = getParameter(request, "feeId"); + try{ + String currentUser = Constant.CREATE_USER; + logger.debug("info:" + info); + logger.debug("tenantId:" + tenantId); + logger.debug("feeId:" + feeId); + logger.debug("currentUser:" + currentUser); + + StoreCostManage manage = storeCostManageService.get(tenantId,feeId); + Integer i = 0; + if(manage.getStatus() == 1){ + if(manage.getExeStatus() == 0){ + manage.setExeStatus(1); + manage.setModifyDate(new Date()); + manage.setModifyUser(currentUser); + storeCostManageService.update(tenantId,manage); + i = 1; + } + } + + if(i == 1){ + result.put("status", "1"); + result.put("message", "操作成功"); + }else{ + result.put("status", "0"); + result.put("message", "操作失败"); + } + }catch (Exception e){ + result.put("status", "0"); + result.put("message", "操作失败" + e.getMessage()); + logger.error(info + ",发生异常", e); + } + return result; + } + + private Map executeStoreTimeCostTask(String tenantId, HttpServletRequest request) { + String info = "门店扣款定时任务"; + Map result = new HashMap<>(); + String feeId = getParameter(request, "feeId"); + try{ + String currentUser = Constant.CREATE_USER; + logger.debug("info:" + info); + logger.debug("tenantId:" + tenantId); + logger.debug("feeId:" + feeId); + logger.debug("currentUser:" + currentUser); + + Integer i = storeCostManageService.saveTimeCost(tenantId,feeId,currentUser); + + if(i == 1){ + result.put("status", "1"); + result.put("message", "操作成功"); + }else{ + result.put("status", "0"); + result.put("message", "操作失败"); + } + }catch (Exception e){ + result.put("status", "0"); + result.put("message", "操作失败" + e.getMessage()); + logger.error(info + ",发生异常", e); + } + return result; + } + + private Map executeDispatchTicketAutoCheck(String tenantId, HttpServletRequest request) { + String info = "配送单发货后7天自动验收,定时任务"; + Map result = new HashMap<>(); + String ticketId = getParameter(request, "id"); + try{ + String currentUser = Constant.CREATE_USER; + logger.debug("info:" + info); + logger.debug("tenantId:" + tenantId); + logger.debug("ticketId:" + ticketId); + logger.debug("currentUser:" + currentUser); + //自动验收将生成门店验收单并审核,数量默认照配送单数量,不存在差异,存入门店查出的第一个仓库; + ReceiveGoodsTicket ticket = dispatchTicketService.saveStoreReceiveGoodsTicketByAutoCheck(tenantId,ticketId); + if(ticket != null){ + result.put("status", "1"); + result.put("message", "操作成功"); + }else{ + result.put("status", "0"); + result.put("message", "操作失败"); + } + }catch (Exception e){ + result.put("status", "0"); + result.put("message", "操作失败" + e.getMessage()); + logger.error(info + ",发生异常", e); + } + return result; + } + + private Map executeProgramPromotionTicketStatusChange(String tenantId, HttpServletRequest request) { + String info = "小程序促销单状态调整,计划任务"; + Map result = new HashMap<>(); + try { + String currentUser = Constant.CREATE_USER; + logger.debug("info:" + info); + logger.debug("tenantId:" + tenantId); + logger.debug("currentUser:" + currentUser); + // 判断当前时间确定处理哪个业务; + // 十一点左右:处理定时任务生成;更改下一天促销任务状态; + // 零点执行单据改变状态,sql语句更改; + SimpleDateFormat sdf = new SimpleDateFormat("HH"); + String timeSignal = sdf.format(new Date()); + if ("23".equals(timeSignal)) { + logger.debug("23点任务开始 : "); + Criteria criteria = new Criteria(); + List status = new ArrayList<>(); + status.add(0); + status.add(1); + criteria.add(Restrictions.in("status", status)); + criteria.add(Restrictions.eq("confirmStatus", 1)); + criteria.add(Restrictions.isNotNull("lastTaskDate")); + criteria.add(Restrictions.ge("endDate", new SimpleDateFormat("yyyy-MM-dd").format(new Date()))); + List tickets = programPromotionTicketService.getList(tenantId, criteria); + for (ProgramPromotionTicket ticket : tickets) { + if (new SimpleDateFormat("yyyy-MM-dd").parse(ticket.getLastTaskDate()).getTime() < ticket.getEndDate().getTime()) { + Map eventData = new HashMap<>(); + eventData.put("tenantCode", tenantId); + eventData.put("tenantId", tenantId); + eventData.put("ticketId", ticket.getId()); + eventData.put("lastTaskEndDate", ticket.getLastTaskDate()); + eventData.put("lastTaskNo", ticket.getLastTaskNo()); + eventData.put("currentUser", currentUser); + // 生成促销任务 + eventBus.notify(EventKeys.PROGRAM_PROMOTION_TASK_CREATE_NEXT_DAY, Event.wrap(eventData)); + } + } + + // 处理第二天的促销任务的状态; + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); + calendar.add(Calendar.DATE, 1); + String tomorrow = new SimpleDateFormat("yyyy-MM-dd").format(calendar.getTime()); + Date tom = new SimpleDateFormat("yyyy-MM-dd").parse(tomorrow); + programPromotionTicketService.updateStatusToExecuting(tenantId, tomorrow, ""); + + } else if ("00".equals(timeSignal)) { + // 删除30天前的促销任务; + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); + calendar.add(Calendar.DATE, -30); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.le("endDate", new SimpleDateFormat("yyyy-MM-dd").format(calendar.getTime()))); + programPromotionTaskService.deleteByCriteria(tenantId, criteria); + // 判断结束日期为昨天的已审核的在执行的单据,在执行的任务; + programPromotionTicketService.updateTicketStatusByTask(tenantId, currentUser); + } + + result.put("status", "1"); + result.put("message", "操作成功"); + } catch (Exception e) { + result.put("status", "0"); + result.put("message", "操作失败" + e.getMessage()); + logger.error(info + ",发生异常", e); + } + return result; + } + + private Map executeProgramPromotionTicketFinish(String tenantId, HttpServletRequest request) { + String info = "小程序促销单结束,计划任务"; + Map result = new HashMap<>(); + String ticketId = getParameter(request, "id"); + try { + String currentUser = Constant.CREATE_USER; + logger.debug("info:" + info); + logger.debug("tenantId:" + tenantId); + logger.debug("ticketId:" + ticketId); + logger.debug("currentUser:" + currentUser); + + programPromotionTicketService.updateTicketFinishByTask(tenantId, ticketId, currentUser); + + result.put("status", "1"); + result.put("message", "操作成功"); + } catch (Exception e) { + result.put("status", "0"); + result.put("message", "操作失败" + e.getMessage()); + logger.error(info + ",发生异常", e); + } + return result; + } + + private Map executeProgramPromotionTicketStart(String tenantId, HttpServletRequest request) { + String info = "小程序促销单开始,计划任务"; + Map result = new HashMap<>(); + String ticketId = getParameter(request, "id"); + try { + String currentUser = Constant.CREATE_USER; + logger.debug("info:" + info); + logger.debug("tenantId:" + tenantId); + logger.debug("ticketId:" + ticketId); + logger.debug("currentUser:" + currentUser); + + programPromotionTicketService.updateTicketStartByTask(tenantId, ticketId, currentUser); + + result.put("status", "1"); + result.put("message", "操作成功"); + } catch (Exception e) { + result.put("status", "0"); + result.put("message", "操作失败" + e.getMessage()); + logger.error(info + ",发生异常", e); + } + return result; + } + + private Map DelProductStoreStockLog(String tenantId, HttpServletRequest request) { + String info = "门店库存流水删除"; + Map result = new HashMap<>(); + try { + Criteria criteria = new Criteria(); + String format = DateUtils.format(DateUtils.addDay(new Date(), -62), "yyyy-MM-dd");// 获取三个月之前的时间 + criteria.add(Restrictions.le("createDate", format)); + criteria.add(Restrictions.eq("tenantId", tenantId)); + Integer deleteByCriteria = this.productStoreStockLogService.deleteByCriteria(tenantId, criteria); + logger.error(info + deleteByCriteria + "条"); + result.put("status", "1"); + result.put("message", "门店库存流水删除成功"); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + result.put("status", "0"); + result.put("message", "调价任务失败"); + } + return result; + } + + /** + * 执行微信商品调价单任务; + * + * @param tenantId + * @param request + * @return + */ + private Map executeWeixinGoodsPriceAdjust(String tenantId, HttpServletRequest request) { + String info = "微信商品调价"; + Map result = new HashMap<>(); + String ticketId = getParameter(request, "id"); + if (StringUtils.isBlank(tenantId)) { + result.put("status", "0"); + result.put("message", "缺少必要参数tenantId"); + return result; + } + if (StringUtils.isBlank(ticketId)) { + result.put("status", "0"); + result.put("message", "缺少必要参数id"); + return result; + } + try { + // Integer i = + // wxAdjustPriceTicketService.saveExecuteWxAdjustPrice(tenantId,ticketId); + WxAdjustPriceTicket ticket = wxAdjustPriceTicketService.get(tenantId, ticketId); + if (ticket != null) { + if (ticket.getStatus() == 1) { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketId", ticketId)); + List goodses = wxAdjustPriceGoodsService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(goodses)) { + result.put("status", "0"); + result.put("message", "单据明细不存在"); + } + List stores = wxAdjustPriceStoreService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(stores)) { + result.put("status", "0"); + result.put("message", "没有查找到调价门店"); + } + List storeIds = new ArrayList<>(); + for (WxAdjustPriceStore store : stores) { + storeIds.add(store.getStoreId()); + } + Map map = new HashMap<>(); + + Criteria c = new Criteria(); + c.add(Restrictions.in("storeId", storeIds)); + c.add(Restrictions.limit("0","20000")); + List list = wxStoreGoodsService.getList(tenantId, c); + if (CollectionUtils.isNotEmpty(list)) { + for (WxStoreGoods goods : list) { + String key = goods.getStoreId() + "-" + goods.getGoodsId(); + map.put(key, goods); + } + } + + List wxStoreGoodsList = new ArrayList<>(); + for (WxAdjustPriceStore store : stores) { + for (WxAdjustPriceGoods goods : goodses) { + String key = store.getStoreId() + "-" + goods.getGoodsId(); + WxStoreGoods wxStoreGoods = map.get(key); + if (wxStoreGoods != null) { + wxStoreGoods.setPrice(goods.getPrice()); + wxStoreGoods.setMemberPrice(goods.getMemberPrice()); + wxStoreGoods.setModifyDate(new Date()); + wxStoreGoods.setModifyUser("Job"); + wxStoreGoodsList.add(wxStoreGoods); + } + } + } + if (wxStoreGoodsList.size() > 0) { + wxStoreGoodsService.update(tenantId, wxStoreGoodsList); + } + // 更新服务数据版本信息; + Map eventData = new HashMap<>(); + eventData.put("tenantId", tenantId); + eventData.put("dataType", "CY_PRODUCTDATA"); + eventBus.notify(EventKeys.SERVERDATAVERSION_UPDATE, Event.wrap(eventData)); + ticket.setStatus(3); + wxAdjustPriceTicketService.update(tenantId, ticket); + result.put("status", "1"); + result.put("message", "调价成功"); + } else { + result.put("status", "0"); + result.put("message", "单据状态不是已审核"); + } + } else { + result.put("status", "0"); + result.put("message", "调价单不存在"); + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + result.put("status", "0"); + result.put("message", "调价任务失败"); + } + return result; + } + + /** + * 执行商品调价 + */ + private Map executeProductPriceAdjust(String tenantId, HttpServletRequest request) { + String info = "商品调价"; + Map result = new HashMap<>(); + String ticketId = getParameter(request, "id"); + if (StringUtils.isBlank(tenantId)) { + result.put("status", "0"); + result.put("message", "缺少必要参数tenantId"); + return result; + } + if (StringUtils.isBlank(ticketId)) { + result.put("status", "0"); + result.put("message", "缺少必要参数id"); + return result; + } + + try { + AdjustPriceTicket adjustPriceTicket = adjustPriceTicketService.get(tenantId, ticketId); + logger.debug("adjustPriceTicket:" + adjustPriceTicket); + if (adjustPriceTicket == null) { + result.put("status", "0"); + result.put("message", "商品调价单[" + ticketId + "]不存在"); + return result; + } + + List storeList = adjustPriceStoreService.findList(tenantId, "ticketId", adjustPriceTicket.getId()); + List productList = adjustPriceProductService.findList(tenantId, "ticketId", adjustPriceTicket.getId()); + + List storeIds = new ArrayList<>(); + for (AdjustPriceStore store : storeList) { + storeIds.add(store.getStoreId()); + } + List specIds = new ArrayList<>(); + for (AdjustPriceProduct product : productList) { + specIds.add(product.getSpecId()); + } + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.in("storeId", storeIds)); + criteria.add(Restrictions.in("specId", specIds)); + criteria.add(Restrictions.limit("0", "20000")); + List storeProductList = storeProductService.getList(tenantId, criteria); + Map storeProductMap = new HashMap<>(); + storeProductList.forEach(map -> { + storeProductMap.put(map.getStoreId() + "#" + map.getSpecId(), map); + }); + + Date modifyDate = new Date(); + String modifyUser = "JOB"; + String key = null; + List updateStoreProducts = new ArrayList(); + for (AdjustPriceStore store : storeList) { + for (AdjustPriceProduct product : productList) { + key = store.getStoreId() + "#" + product.getSpecId(); + if (storeProductMap.containsKey(key)) { + StoreProduct storeProduct = new StoreProduct(); + storeProduct.setId(storeProductMap.get(key).getId()); + storeProduct.setStoreId(store.getStoreId()); + storeProduct.setProductId(product.getProductId()); + storeProduct.setSpecId(product.getSpecId()); + storeProduct.setPrice(product.getPrice()); + storeProduct.setMemberPrice(product.getMemberPrice()); + storeProduct.setOtherPrice(product.getOtherPrice()); + storeProduct.setMinPrice(product.getMinPrice()); + storeProduct.setModifyDate(modifyDate); + storeProduct.setModifyUser(modifyUser); + updateStoreProducts.add(storeProduct); + if (updateStoreProducts.size() >= 1000) { + logger.error("调价完成 ---> size:" + updateStoreProducts.size()); + storeProductService.update(tenantId, updateStoreProducts); + updateStoreProducts = new ArrayList<>(); + } + } + } + } + if (updateStoreProducts.size() > 0) { + logger.error("调价完成 ---> size:" + updateStoreProducts.size()); + storeProductService.update(tenantId, updateStoreProducts); + } + logger.debug("调价完成 ---> size:" + updateStoreProducts.size()); + // 更新服务数据版本信息; + Map eventData = new HashMap<>(); + eventData.put("tenantId", tenantId); + eventData.put("dataType", "CY_PRODUCTDATA"); + eventBus.notify(EventKeys.SERVERDATAVERSION_UPDATE, Event.wrap(eventData)); + + AdjustPriceTicket updateTicket = new AdjustPriceTicket(); + updateTicket.setId(adjustPriceTicket.getId()); + updateTicket.setStatus(3);// 表示已执行 + updateTicket.setModifyDate(modifyDate); + updateTicket.setModifyUser(modifyUser); + adjustPriceTicketService.update(tenantId, updateTicket); + logger.debug("单据状态更改: OK "); + + result.put("status", "1"); + result.put("message", "操作成功"); + } catch (Exception e) { + result.put("status", "0"); + result.put("message", "操作失败" + e.getMessage()); + logger.error(info + ",发生异常", e); + } + + return result; + } + + /** + * 微信点餐订单,超时自动取消 + */ + private Map executeWxdcOrderAutoCancel(String tenantId, HttpServletRequest request) { + String info = "微信点餐订单,超时自动取消"; + Map result = new HashMap<>(); + String storeNo = getParameter(request, "storeNo"); + String ticketId = getParameter(request, "ticketId"); + String ticketNo = getParameter(request, "ticketNo"); + if (StringUtils.isBlank(tenantId)) { + result.put("status", "0"); + result.put("message", "缺少必要参数tenantId"); + return result; + } + if (StringUtils.isBlank(storeNo)) { + result.put("status", "0"); + result.put("message", "缺少必要参数storeNo"); + return result; + } + if (StringUtils.isBlank(ticketId)) { + result.put("status", "0"); + result.put("message", "缺少必要参数ticketId"); + return result; + } + if (StringUtils.isBlank(ticketNo)) { + result.put("status", "0"); + result.put("message", "缺少必要参数ticketNo"); + return result; + } + + try { + WxSalesOrder salesOrder = wxSalesOrderService.get(tenantId, ticketId); + if (salesOrder == null) { + result.put("status", "0"); + result.put("message", "订单信息不存在[" + tenantId + "," + ticketId + "]"); + return result; + } + if (salesOrder.getStatus() != 1) { + // 0-等待付款;1-已支付;2-已退单;3-已取消;4-商家已确认;5-已完成; + String msg = "订单状态异常"; + switch (salesOrder.getStatus()) { + case 2: + msg = "订单已退单"; + break; + case 3: + msg = "订单已取消"; + break; + case 4: + msg = "商家已接单,取消失败";// 商家已接单,不允许用户取消(也可转入退款流程)。 + break; + case 5: + msg = "订单已完成"; + break; + default: + break; + } + + result.put("status", "0"); + result.put("message", msg); + return result; + } + + String currentUser = Constant.CREATE_USER; + String cancelReason = "商家接单超时,订单自动取消"; + wxSalesOrderService.saveOrderAutoCancel(tenantId, ticketId, ticketNo, cancelReason, currentUser); + salesOrder = wxSalesOrderService.get(tenantId, ticketId); + result.put("status", "1"); + result.put("message", "操作成功"); + + // 订单自动取消,执行后续事件 + logger.debug(">>>>>>>订单自动取消,执行后续事件"); + Map eventData = new HashMap<>(); + eventData.put("tenantId", tenantId); + eventData.put("tenantCode", tenantId); + eventData.put("wid", salesOrder.getWid()); + eventData.put("wxSalesOrder", salesOrder); + eventBus.notify(EventKeys.WXDC_ORDER_AUTO_CANCEL, Event.wrap(eventData)); + // 订单取消,退款处理 + WxStore wxStore = wxStoreService.get(tenantId, salesOrder.getStoreId()); + eventData.put("wxStore", wxStore); + // channel 1:微信点餐 2云店点餐 + if (StringUtils.isNotBlank(salesOrder.getChannel()) && StringUtils.equals("2", salesOrder.getChannel())) { + eventBus.notify(EventKeys.WXDC_ORDER_PAY_REFUND_LITEAPP, Event.wrap(eventData)); + } else { + eventBus.notify(EventKeys.WXDC_ORDER_PAY_REFUND, Event.wrap(eventData)); + } + } catch (Exception e) { + result.put("status", "0"); + result.put("message", "操作失败" + e.getMessage()); + logger.error(info + ",发生异常", e); + } + + return result; + } + + /** + * 微信点餐订单,商家接单N分钟后自动完成 + */ + private Map executeWxdcOrderAutoFinish(String tenantId, HttpServletRequest request) { + String info = "微信点餐订单,商家接单N分钟后自动完成"; + Map result = new HashMap<>(); + String storeNo = getParameter(request, "storeNo"); + String ticketId = getParameter(request, "ticketId"); + String ticketNo = getParameter(request, "ticketNo"); + if (StringUtils.isBlank(tenantId)) { + result.put("status", "0"); + result.put("message", "缺少必要参数tenantId"); + return result; + } + if (StringUtils.isBlank(storeNo)) { + result.put("status", "0"); + result.put("message", "缺少必要参数storeNo"); + return result; + } + if (StringUtils.isBlank(ticketId)) { + result.put("status", "0"); + result.put("message", "缺少必要参数ticketId"); + return result; + } + if (StringUtils.isBlank(ticketNo)) { + result.put("status", "0"); + result.put("message", "缺少必要参数ticketNo"); + return result; + } + + try { + WxSalesOrder salesOrder = wxSalesOrderService.get(tenantId, ticketId); + if (salesOrder == null) { + result.put("status", "0"); + result.put("message", "订单信息不存在[" + tenantId + "," + ticketId + "]"); + return result; + } + if (salesOrder.getStatus() != 4) { + // 0-等待付款;1-已支付;2-已退单;3-已取消;4-商家已确认;5-已完成; + String msg = "订单状态异常"; + switch (salesOrder.getStatus()) { + case 2: + msg = "订单已退单"; + break; + case 3: + msg = "订单已取消"; + break; + case 5: + msg = "订单已完成"; + break; + default: + break; + } + + result.put("status", "1"); + result.put("message", msg); + return result; + } + + String currentUser = Constant.CREATE_USER; + wxSalesOrderService.saveStoreOrderDelivery(tenantId, ticketId, ticketNo, currentUser); + salesOrder = wxSalesOrderService.get(tenantId, ticketId); + result.put("status", "1"); + result.put("message", "操作成功"); + + // 订单自动完成,执行后续事件 + logger.debug(">>>>>>>订单自动完成,执行后续事件"); + Map eventData = new HashMap<>(); + eventData.put("tenantId", tenantId); + eventData.put("tenantCode", tenantId); + eventData.put("wid", salesOrder.getWid()); + eventData.put("wxSalesOrder", salesOrder); + eventBus.notify(EventKeys.WXDC_ORDER_AUTO_FINISH, Event.wrap(eventData)); + } catch (Exception e) { + result.put("status", "0"); + result.put("message", "操作失败" + e.getMessage()); + logger.error(info + ",发生异常", e); + } + + return result; + } + + /** + * 促销单状态调整,计划任务 + */ + private Map executePromotionTicketStatusChange(String tenantId, HttpServletRequest request) { + String info = "促销单状态调整,计划任务"; + Map result = new HashMap<>(); + try { + String currentUser = Constant.CREATE_USER; + logger.debug("info:" + info); + logger.debug("tenantId:" + tenantId); + logger.debug("currentUser:" + currentUser); + // 判断当前时间确定处理哪个业务; + // 十一点左右:处理定时任务生成;更改下一天促销任务状态; + // 零点执行单据改变状态,sql语句更改; + SimpleDateFormat sdf = new SimpleDateFormat("HH"); + String timeSignal = sdf.format(new Date()); + if ("23".equals(timeSignal)) { + logger.debug("23点任务开始 : "); + Criteria criteria = new Criteria(); + List status = new ArrayList<>(); + status.add(0); + status.add(1); + criteria.add(Restrictions.in("status", status)); + criteria.add(Restrictions.eq("confirmStatus", 1)); + criteria.add(Restrictions.isNotNull("lastTaskDate")); + criteria.add(Restrictions.ge("endDate", new SimpleDateFormat("yyyy-MM-dd").format(new Date()))); + List tickets = promotionTicketService.getList(tenantId, criteria); + for (PromotionTicket ticket : tickets) { + if (new SimpleDateFormat("yyyy-MM-dd").parse(ticket.getLastTaskDate()).getTime() < ticket.getEndDate().getTime()) { + Map eventData = new HashMap<>(); + eventData.put("tenantCode", tenantId); + eventData.put("tenantId", tenantId); + eventData.put("ticketId", ticket.getId()); + eventData.put("lastTaskEndDate", ticket.getLastTaskDate()); + eventData.put("lastTaskNo", ticket.getLastTaskNo()); + eventData.put("currentUser", currentUser); + // 生成促销任务 + eventBus.notify(EventKeys.PROMOTION_TASK_CREATE_NEXT_DAY, Event.wrap(eventData)); + } + } + + // 处理第二天的促销任务的状态; + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); + calendar.add(Calendar.DATE, 1); + String tomorrow = new SimpleDateFormat("yyyy-MM-dd").format(calendar.getTime()); + Date tom = new SimpleDateFormat("yyyy-MM-dd").parse(tomorrow); + promotionTicketService.updateStatusToExecuting(tenantId, tomorrow, ""); + + } else if ("00".equals(timeSignal)) { + // 删除30天前的促销任务; + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); + calendar.add(Calendar.DATE, -30); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.le("endDate", new SimpleDateFormat("yyyy-MM-dd").format(calendar.getTime()))); + promotionTaskService.deleteByCriteria(tenantId, criteria); + // 判断结束日期为昨天的已审核的在执行的单据,在执行的任务; + promotionTicketService.updateTicketStatusByTask(tenantId, currentUser); + } + + result.put("status", "1"); + result.put("message", "操作成功"); + } catch (Exception e) { + result.put("status", "0"); + result.put("message", "操作失败" + e.getMessage()); + logger.error(info + ",发生异常", e); + } + return result; + } + + /** + * 促销单开始,计划任务 + */ + private Map executePromotionTicketStart(String tenantId, HttpServletRequest request) { + String info = "促销单开始,计划任务"; + Map result = new HashMap<>(); + String ticketId = getParameter(request, "id"); + try { + String currentUser = Constant.CREATE_USER; + logger.debug("info:" + info); + logger.debug("tenantId:" + tenantId); + logger.debug("ticketId:" + ticketId); + logger.debug("currentUser:" + currentUser); + + promotionTicketService.updateTicketStartByTask(tenantId, ticketId, currentUser); + + result.put("status", "1"); + result.put("message", "操作成功"); + } catch (Exception e) { + result.put("status", "0"); + result.put("message", "操作失败" + e.getMessage()); + logger.error(info + ",发生异常", e); + } + return result; + } + + /** + * 促销单结束,计划任务 + */ + private Map executePromotionTicketFinish(String tenantId, HttpServletRequest request) { + String info = "促销单结束,计划任务"; + Map result = new HashMap<>(); + String ticketId = getParameter(request, "id"); + try { + String currentUser = Constant.CREATE_USER; + logger.debug("info:" + info); + logger.debug("tenantId:" + tenantId); + logger.debug("ticketId:" + ticketId); + logger.debug("currentUser:" + currentUser); + + promotionTicketService.updateTicketFinishByTask(tenantId, ticketId, currentUser); + + result.put("status", "1"); + result.put("message", "操作成功"); + } catch (Exception e) { + result.put("status", "0"); + result.put("message", "操作失败" + e.getMessage()); + logger.error(info + ",发生异常", e); + } + return result; + } + + /** + * 代金券活动结束,计划任务 + */ + private Map executeCouponFinish(String tenantId, HttpServletRequest request) { + String info = "代金券活动结束,计划任务"; + Map result = new HashMap<>(); + String ticketId = getParameter(request, "id"); + try { + String currentUser = Constant.CREATE_USER; + logger.debug("info:" + info); + logger.debug("tenantId:" + tenantId); + logger.debug("ticketId:" + ticketId); + logger.debug("currentUser:" + currentUser); + + couponService.updateCouponFinishByTask(tenantId, ticketId, currentUser); + + result.put("status", "1"); + result.put("message", "操作成功"); + } catch (Exception e) { + result.put("status", "0"); + result.put("message", "操作失败" + e.getMessage()); + logger.error(info + ",发生异常", e); + } + return result; + } + + /** + * 门店出库汇总归类数据,计划任务 + */ + private Map executeStoreOutgoingCollect(String tenantId, HttpServletRequest request) { + String info = "门店出库汇总归类数据,计划任务"; + Map result = new HashMap<>(); + String upadteTime = getParameter(request, "upadteTime");// 更新时间 + try { + String currentUser = Constant.CREATE_USER; + logger.debug("info:" + info); + logger.debug("tenantId:" + tenantId); + logger.debug("currentUser:" + currentUser); + + String format; + if (StringUtils.isNotEmpty(upadteTime)) { + try { + DateUtils.parseDate(upadteTime, "yyyy-MM-dd"); + } catch (Exception e) { + result.put("status", "1"); + result.put("message", upadteTime + "非标准时间格式(yyyy-MM-dd)"); + return result; + } + format = upadteTime; + } else { + format = DateUtils.format(DateUtils.addDay(new Date(), -1), "yyyy-MM-dd"); + } + Criteria criteria = new Criteria(); + criteria.add(Restrictions.ge("createDate", format + " 00:00:00")); + criteria.add(Restrictions.le("createDate", format + " 23:59:59")); + List list = this.productStoreOutCollectDayService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(list)) { + + Criteria criteria1 = new Criteria(); + criteria1.add(Restrictions.eq("psl.orderType", 4)); + criteria1.add(Restrictions.ge("psl.createDate", format + " 00:00:00")); + criteria1.add(Restrictions.le("psl.createDate", format + " 23:59:59"));// 结束时间 + criteria1.add(Restrictions.eq("psl.tenantId", tenantId)); + criteria1.add(Restrictions.group("psl.storeId,psl.specId")); + criteria1.add(Restrictions.order("p.typeId", "asc")); + criteria1.add(Restrictions.order("psl.productNo", "asc")); + List storeOutgoingCollect = productStoreOutCollectDayService.getStoreOutgoingCollect(tenantId, criteria1); + Integer updateStoreOutgoingCollect = this.productStoreStockLogService.updateStoreOutgoingCollect(tenantId, storeOutgoingCollect); + if (updateStoreOutgoingCollect > 0) { + result.put("status", "1"); + result.put("message", "操作成功"); + } else { + if (updateStoreOutgoingCollect == -1) { + result.put("status", "1"); + result.put("message", format + "无最新数据产生!"); + } else { + result.put("status", "0"); + result.put("message", "操作失败"); + } + + } + } else { + result.put("status", "1"); + result.put("message", format + "计划任务已经更新"); + } + } catch (Exception e) { + result.put("status", "0"); + result.put("message", "操作失败" + e.getMessage()); + logger.error(info + ",发生异常", e); + } + return result; + } + + /** + * 小程序点餐订单,超时自动取消 + */ + private Map executeProgramOrderAutoCancel(String tenantId, HttpServletRequest request) { + String info = "小程序点餐订单,超时自动取消"; + Map result = new HashMap<>(); + tenantId = getParameter(request, "tenantId"); + String storeId = getParameter(request, "storeId"); + String busNo = getParameter(request, "busNo"); + if (StringUtils.isBlank(tenantId)) { + result.put("status", "0"); + result.put("message", "缺少必要参数tenantId"); + return result; + } + if (StringUtils.isBlank(storeId)) { + result.put("status", "0"); + result.put("message", "缺少必要参数storeId"); + return result; + } + if (StringUtils.isBlank(busNo)) { + result.put("status", "0"); + result.put("message", "缺少必要参数busNo"); + return result; + } + try { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("no", busNo)); + criteria.add(Restrictions.eq("storeId", storeId)); + List ticketList = programStoreBusinessTicketService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(ticketList)) { + result.put("status", "0"); + result.put("message", "订单不存在"); + return result; + } + ProgramStoreBusinessTicket programStoreBusinessTicket = ticketList.get(0); + if (programStoreBusinessTicket.getStatus() != 0) { + result.put("status", "0"); + result.put("message", "订单状态不合法,退款失败"); + return result; + } + // 支付退款操作 + Map refundMap = OrderRefund(tenantId, storeId,programStoreBusinessTicket.getStoreNo(), busNo); + if (Integer.parseInt(refundMap.get("status").toString()) == 0) { + result.put("status", "0"); + result.put("message", "支付参数错误,退款失败"); + return result; + } + programStoreBusinessTicket.setStatus(3);// 订单被取消 + programStoreBusinessTicket.setRefundStatus(4);//退款已完成 + + if(StringUtils.isNotEmpty(programStoreBusinessTicket.getBackCause())){ + programStoreBusinessTicket.setBackCause(programStoreBusinessTicket.getBackCause()+",接单超时,自动退款"); + }else{ + programStoreBusinessTicket.setBackCause("接单超时,自动退款"); + + } + programStoreBusinessTicket.setModifyDate(new Date()); + programStoreBusinessTicket.setModifyUser("task-job"); + programStoreBusinessTicketService.update(tenantId, programStoreBusinessTicket); + // 清理MQTT订单待处理订单缓存 + try { + Object meituanOrderIds = cacheService.get(tenantId, "program_" + storeId); + if (meituanOrderIds != null) { + Map orderIds = (Map) cacheService.get(tenantId, "program_" + storeId); + orderIds.remove(String.valueOf(programStoreBusinessTicket.getNo())); + cacheService.set(tenantId, "program_" + storeId, orderIds, 1200); + } else { + Map orderIds = new HashMap<>(); + cacheService.set(tenantId, "program_" + storeId, orderIds, 1200); + } + } catch (Exception e) { + logger.error(info + "订单状态推送清理缓存失败>>>>>>>>>>"); + } + //推送取消模板消息 + sendWxTemplement(tenantId, busNo, 2, programStoreBusinessTicket); + } catch (Exception e) { + result.put("status", "0"); + result.put("message", "操作失败" + e.getMessage()); + logger.error(info + ",发生异常", e); + } + return result; + } + + public void sendWxTemplement(String tenantId, String busNo, int type, ProgramStoreBusinessTicket programStoreBusinessTicket) { + try { + logger.error("发送模板消息=>>>>>" + tenantId); + logger.error("发送模板消息=>>>>>" + busNo); + logger.error("发送模板消息=>>>>>" + type); + logger.error("发送模板消息=>>>>>" + programStoreBusinessTicket); + ProgramSetting programSetting = programSettingService.get(tenantId, programStoreBusinessTicket.getProgramId()); + // 获取access_token + Map pbodyMapWx = JSONUtil.parseObject(programSetting.getWxBoday(), new TypeReference>() { + }); + String appId = pbodyMapWx.get("appId").toString(); + String appSecret = pbodyMapWx.get("appSecret").toString(); + String accessTokenKey = "programAccessToken:" + tenantId + ":" + appId + ":" + appSecret; + Object accessToken = cacheService.get(tenantId, accessTokenKey); + String content = ""; + if (accessToken == null) { + String url = String.format("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s", appId, appSecret); + HttpResponse response = HttpTool.url(url).get(); + content = HttpTool.getResponseAsString(response); + // 缓存 access_token + cacheService.set(tenantId, accessTokenKey, content, 120); + } else { + content = accessToken.toString(); + } + AuthAccessToken token = JSONUtil.parseObject(content, AuthAccessToken.class); + String tokenJson = JSONUtil.toJSONString(token); + logger.error("发送模板消息=>>>>>" + tokenJson); + String sendType = "";// 模板ID获取类型 + if (type == 3) { + sendType = "orderBack"; + } else { + sendType = "orderCreate"; + } + // 获取FormId + String keyFromId = "programFormId:" + tenantId + ":" + programStoreBusinessTicket.getProgramId() + ":" + sendType + ":" + programStoreBusinessTicket.getOpenId() + ":" + busNo; + Object fromId = cacheService.get(tenantId, keyFromId); + Map pbodyMapWxTemplate = JSONUtil.parseObject(programSetting.getWxTemplate(), new TypeReference>() { + }); + // 发送模板消息推送 + String url = "https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send?access_token=" + token.getAccessToken(); + String page = "pages/tabbar/launch"; + // 订单支付成功通知 + Map tem = new HashMap<>(); + switch (type) { + case 0:// 拒单 + tem.put("template_id", pbodyMapWxTemplate.get("orderRefuse").toString()); + break; + case 1:// 接单 + tem.put("template_id", pbodyMapWxTemplate.get("orderCheckSuccess").toString()); + break; + case 2:// 超时通知 + tem.put("template_id", pbodyMapWxTemplate.get("orderOverTime").toString()); + break; + case 3:// 订单退款通知 + tem.put("template_id", pbodyMapWxTemplate.get("orderBack").toString()); + break; + default: + break; + } + tem.put("touser", programStoreBusinessTicket.getOpenId()); + tem.put("page", page); + tem.put("form_id", fromId.toString());// formId 用于发送模板消息 + tem.put("emphasis_keyword", ""); + String busModeTx = "堂食"; + int busMode = programStoreBusinessTicket.getBusMode(); + switch (busMode) { + case 0: + busModeTx = "堂食"; + break; + case 1: + busModeTx = "外带"; + break; + case 2: + busModeTx = "预定"; + break; + case 3: + busModeTx = "外卖"; + break; + default: + break; + } + // 组装页面显示数据 + Map data = new HashMap<>(); + switch (type) { + case 0:// 拒单 + { + Map keyword1 = new HashMap<>(); + keyword1.put("value", busNo); + data.put("keyword1", keyword1);// 订单编号 + Map keyword2 = new HashMap<>(); + keyword2.put("value", "微信点餐(" + busModeTx + ")"); + data.put("keyword2", keyword2);// 订单类型 + Map keyword3 = new HashMap<>(); + keyword3.put("value", DateUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss")); + data.put("keyword3", keyword3);// 拒单时间 + Map keyword4 = new HashMap<>(); + keyword4.put("value", "店家忙不过来,为您带来的不便敬请谅解!"); + data.put("keyword4", keyword4);// 拒单原因 + } + break; + case 1:// 接单 + { + Map keyword1 = new HashMap<>(); + keyword1.put("value", programStoreBusinessTicket.getSeqNo()); + data.put("keyword1", keyword1);// 取餐号 + Map keyword2 = new HashMap<>(); + keyword2.put("value", "微信点餐(" + busModeTx + ")"); + data.put("keyword2", keyword2);// 订单类型 + Map keyword3 = new HashMap<>(); + keyword3.put("value", DateUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss")); + data.put("keyword3", keyword3);// 接单时间 + Map keyword4 = new HashMap<>(); + keyword4.put("value", programStoreBusinessTicket.getStoreName()); + data.put("keyword4", keyword4);// 商家名称 + Map keyword5 = new HashMap<>(); + keyword5.put("value", "您好,商家已成功接单,请留意取餐提醒!"); + data.put("keyword5", keyword5);// 微信提示 + } + break; + case 2:// 超时通知 + { + Map keyword1 = new HashMap<>(); + keyword1.put("value", busNo); + data.put("keyword1", keyword1);// 订单号 + Map keyword2 = new HashMap<>(); + keyword2.put("value", "微信点餐(" + busModeTx + ")"); + data.put("keyword2", keyword2);// 订单类型 + Map keyword3 = new HashMap<>(); + keyword3.put("value", DateUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss")); + data.put("keyword3", keyword3);// 接单时间 + Map keyword4 = new HashMap<>(); + keyword4.put("value", programStoreBusinessTicket.getStoreName()); + data.put("keyword4", keyword4);// 商家名称 + Map keyword5 = new HashMap<>(); + keyword5.put("value", "您好,商家接单超时,支付金额已原路返回,为您带来的不便敬请谅解!"); + data.put("keyword5", keyword5);// 微信提示 + } + break; + case 3:// 订单退款通知 + { + Map keyword1 = new HashMap<>(); + keyword1.put("value", busNo); + data.put("keyword1", keyword1);// 订单号 + Map keyword2 = new HashMap<>(); + keyword2.put("value", "微信点餐(" + busModeTx + ")"); + data.put("keyword2", keyword2);// 订单类型 + Map keyword3 = new HashMap<>(); + keyword3.put("value", DateUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss")); + data.put("keyword3", keyword3);// 退款时间 + Map keyword4 = new HashMap<>(); + keyword4.put("value", new DecimalFormat("0.00").format(programStoreBusinessTicket.getReceivable() + programStoreBusinessTicket.getDeliverFee() + programStoreBusinessTicket.getPackageFee())); + data.put("keyword4", keyword4);// 退款金额 + Map keyword5 = new HashMap<>(); + keyword5.put("value", "您好,商家同意退款,支付金额已原路返回!"); + data.put("keyword5", keyword5);// 退款原因 + } + break; + default: + break; + } + tem.put("data", data); + String json = JSONUtil.toJSONString(tem); + logger.error("发送模板消息=>>>>>:{}:{}模板消息", tenantId, json); + HttpResponse response = HttpTool.url(url).contentType("application/x-www-form-urlencoded").body(json).post(); + content = HttpTool.getResponseAsString(response); + logger.error("发送模板消息=>>>>>:{}:{}模板消息返回", tenantId, content); + } catch (Exception e) { + logger.error("发送模板消息=>>>>>" + ",发生异常", e); + } + } + + /** + * 订单退款 + * + * @param tenantId + * @param storeId + * @param busNo + * @return + */ + private Map OrderRefund(String tenantId, String storeId,String storeNo, String busNo) { + String info = "支付退款"; + logger.debug(info); + Map result = null; + try { + // 根据订单信息进行退款 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("busNo", busNo)); + List payList = programStorePayService.getList(tenantId, criteria); + ProgramStorePay pay = payList.get(0); + switch (pay.getPayTypeNo()) { + case "04": + case "05": + //微信退款 + // 获取支付参数 + //微信退款 + // 获取支付参数 + List> payParamList = new ArrayList<>(); + + List parameters = this.programPaymentParameterService.getPaymentParameterByStoreId(tenantId, storeId); + for (ProgramPaymentParameter paymentParameter : parameters) { + Map map = new HashMap<>(); + map.put("tenantId", paymentParameter.getTenantId()); + map.put("id", paymentParameter.getId()); + map.put("no", paymentParameter.getNo()); + map.put("name", paymentParameter.getName()); + map.put("sign", paymentParameter.getSign()); + Map pbodyMap = JSONUtil.parseObject(paymentParameter.getPbody(), new TypeReference>() { + }); + map.put("pbody", pbodyMap); + map.put("certText", paymentParameter.getCertText()); + if (StringUtils.equalsIgnoreCase("saobei", paymentParameter.getSign())) { + payParamList.add(map); + }else if(StringUtils.equalsIgnoreCase("abcMiniPay", paymentParameter.getSign())){ + payParamList.add(map); + } + } + if(CollectionUtils.isEmpty(payParamList)){ + List parameterList = this.paymentParameterService.getPaymentParameterByStoreId(tenantId, storeId); + for (PaymentParameter paymentParameter : parameterList) { + Map map = new HashMap<>(); + map.put("tenantId", paymentParameter.getTenantId()); + map.put("id", paymentParameter.getId()); + map.put("no", paymentParameter.getNo()); + map.put("name", paymentParameter.getName()); + map.put("sign", paymentParameter.getSign()); + Map pbodyMap = JSONUtil.parseObject(paymentParameter.getPbody(), new TypeReference>() { + }); + map.put("pbody", pbodyMap); + map.put("certText", paymentParameter.getCertText()); + if (StringUtils.equalsIgnoreCase("saobei", paymentParameter.getSign())) { + payParamList.add(map); + }else if (StringUtils.equalsIgnoreCase("abcMiniPay", paymentParameter.getSign())){ + payParamList.add(map); + } + } + } + + Map payParam = new HashMap(); + payParam = payParamList.get(0); + Map payBoday = (Map) payParam.get("pbody"); + String moneyStr = String.valueOf((int)(pay.getPaid() * 100)); + Map paramMap = new LinkedHashMap<>(); + paramMap.put("pay_ver", "100"); + if ("04".equals(pay.getPayTypeNo())) { + paramMap.put("pay_type", "020"); + } else if ("05".equals(pay.getPayTypeNo())) { + paramMap.put("pay_type", "010"); + } + String outRefundNo = "B" + String.valueOf(IdWorkerUtils.getInstance().nextId()); + paramMap.put("service_id", "030"); + paramMap.put("merchant_no", payBoday.get("merchant_no").toString()); + paramMap.put("terminal_id", payBoday.get("terminal_id").toString()); + paramMap.put("terminal_trace", outRefundNo); + paramMap.put("terminal_time", DateUtils.format(new Date(), "yyyyMMddHHmmss")); + paramMap.put("refund_fee", moneyStr); + paramMap.put("out_trade_no", pay.getVoucherNo()); + String signKey = "&access_token=" + payBoday.get("signKey").toString(); + String sign = SignUtil.createSign(paramMap, signKey); + paramMap.put("pay_trace", ""); + paramMap.put("pay_time", ""); + paramMap.put("auth_code", ""); + paramMap.put("key_sign", sign); + HttpResponse httpResponse = HttpTool.url(payBoday.get("gatewayUrl").toString() + "/pay/100/refund").contentType("application/json").body(JSON.toJSONString(paramMap)).post(); + String content = HttpTool.getResponseAsString(httpResponse); + JSONObject response = JSON.parseObject(content); + result = new HashMap<>(); + if ("01".equals(response.get("return_code").toString()) && "01".equals(response.get("result_code"))) { + result.put("status", 1); + result.put("message", "扫呗退款成功"); + logger.error(info + "扫呗退款成功 订单号 orderNo:" + busNo + " 退款单号:" + outRefundNo + " moneyActual:" + pay.getPaid()); + } else { + result.put("status", 0); + result.put("message", "扫呗退款失败"); + logger.error(info + "扫呗退款失败 订单号 orderNo:" + busNo + " 退款单号:" + outRefundNo + " moneyActual:" + pay.getPaid() + " 扫呗退款时发生异常 :" + response.get("return_msg").toString()); + } + break; + case "02": + //会员卡退款 + ProgramSetting programSetting = programSettingService.get(tenantId, pay.getProgramId()); + Map pbodyMapMember = JSONUtil.parseObject(programSetting.getCardApi(), new TypeReference>() { + }); + // 会员卡退款 + Map paramMapMember = new HashMap(20); + List ignoreSignParamsMember = new ArrayList(); + // 系统级参数 + paramMapMember.put("appKey", pbodyMapMember.get("appKey").toString()); + paramMapMember.put("method", "jw.trade.cancel"); + paramMapMember.put("v", pbodyMapMember.get("version").toString()); + paramMapMember.put("format", pbodyMapMember.get("format").toString()); + paramMapMember.put("locale", pbodyMapMember.get("locale").toString()); + paramMapMember.put("client", pbodyMapMember.get("client").toString()); + paramMapMember.put("timestamp", String.valueOf(System.currentTimeMillis())); + // 业务参数 + paramMapMember.put("tradeVoucherNo", pay.getVoucherNo()); + paramMapMember.put("tradeNo", busNo); // 业务单据号 + String outRefundNoMember = "B" + String.valueOf(IdWorkerUtils.getInstance().nextId()); + paramMapMember.put("ticketNo", outRefundNoMember); + paramMapMember.put("reason", "用户申请退款"); + paramMapMember.put("shopNo", storeNo); + criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + List posInfoList = posInfoService.getList(tenantId, criteria); + PosInfo posInfo = posInfoList.get(0); + paramMapMember.put("posNo", posInfo.getPosNo()); + paramMapMember.put("workerNo", pbodyMapMember.get("workerNo").toString()); + paramMapMember.put("sourceSign", "web"); + ignoreSignParamsMember.add("reason"); + // 参数签名 + String signValue = this.sign(paramMapMember, ignoreSignParamsMember, pbodyMapMember.get("appSecret").toString()); + paramMapMember.put("sign", signValue); + HttpResponse responseMember = HttpTool.url(pbodyMapMember.get("url").toString()).form(paramMapMember).post(); + String contentMember = HttpTool.getResponseAsString(responseMember); + result = new HashMap<>(); + if (this.isSuccessful(contentMember)) { + JSONObject responseJsonMember = JSON.parseObject(contentMember); + if (responseJsonMember.getInteger("status") == 1) { + result.put("status", 1); + result.put("message", "会员卡退款成功"); + logger.error(info + "会员卡退款成功 订单号 orderNo:" + busNo + " 退款单号:" + outRefundNoMember + " moneyActual:" + pay.getPaid()); + } else { + result.put("status", 0); + result.put("message", "会员卡退款失败"); + logger.error(info + "会员卡退款失败 订单号 orderNo:" + busNo + " 退款单号:" + outRefundNoMember + " moneyActual:" + pay.getPaid() + " 会员退款时发生异常 :" + responseJsonMember.get("message").toString()); + } + } else { + result.put("status", 0); + result.put("message", "会员卡退款失败"); + logger.error(info + "会员卡退款失败 订单号 orderNo:" + busNo + " 退款单号:" + outRefundNoMember + " moneyActual:" + pay.getPaid() + " 会员退款时发生异常 :" + contentMember); + } + break; + default: + break; + } + + } catch (Exception e) { + logger.error(info + "时,发生异常", e); + result.put("status", 0); + result.put("message", "会员卡退款失败"); + logger.error(info + "会员卡退款失败 订单号 orderNo:" + busNo); + } + return result; + } + + protected final String ERROR_TOKEN = "@@$-ERROR_TOKEN$-@@"; + + /** + * 对paramValues进行签名 + * + * @param paramValues + * @param secret + * @return + */ + public String sign(Map paramValues, String secret) { + return sign(paramValues, null, secret); + } + + /** + * 对paramValues进行签名,其中ignoreParamNames这些参数不参与签名 + * + * @param paramValues + * @param ignoreParamNames + * @param secret + * @return + */ + public String sign(Map paramValues, List ignoreParamNames, String secret) { + StringBuilder sb = new StringBuilder(); + List paramNames = new ArrayList(paramValues.size()); + paramNames.addAll(paramValues.keySet()); + if (ignoreParamNames != null && ignoreParamNames.size() > 0) { + for (String ignoreParamName : ignoreParamNames) { + paramNames.remove(ignoreParamName); + } + } + Collections.sort(paramNames); + + sb.append(secret); + for (String paramName : paramNames) { + sb.append(paramName).append(paramValues.get(paramName)); + } + sb.append(secret); + + System.out.println(sb.toString()); + + String sign = WopUtils.sign(sb.toString()); + System.out.println(sign); + + return sign; + + } + + protected boolean isSuccessful(String content) { + return !(content.contains(ERROR_TOKEN)); + } + + /** + * 小程序点餐订单,商家接单60分钟后自动完成 + */ + private Map executeProgramOrderAutoFinish(String tenantId, HttpServletRequest request) { + String info = "小程序点餐订单,商家接单60分钟后自动完成"; + Map result = new HashMap<>(); + tenantId = getParameter(request, "tenantId"); + String storeId = getParameter(request, "storeId"); + String busNo = getParameter(request, "busNo"); + if (StringUtils.isBlank(tenantId)) { + result.put("status", "0"); + result.put("message", "缺少必要参数tenantId"); + return result; + } + if (StringUtils.isBlank(storeId)) { + result.put("status", "0"); + result.put("message", "缺少必要参数storeId"); + return result; + } + if (StringUtils.isBlank(busNo)) { + result.put("status", "0"); + result.put("message", "缺少必要参数busNo"); + return result; + } + try { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("no", busNo)); + criteria.add(Restrictions.eq("storeId", storeId)); + List ticketList = programStoreBusinessTicketService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(ticketList)) { + result.put("status", "0"); + result.put("message", "订单不存在"); + return result; + } + ProgramStoreBusinessTicket programStoreBusinessTicket = ticketList.get(0); + if (programStoreBusinessTicket.getStatus() != 1) { + result.put("status", "0"); + result.put("message", "订单状态不合法"); + return result; + } + programStoreBusinessTicket.setStatus(4);// 订单已完成 + programStoreBusinessTicketService.update(tenantId, programStoreBusinessTicket); + // 清理MQTT订单待处理订单缓存 + try { + Object meituanOrderIds = cacheService.get(tenantId, "program_" + storeId); + if (meituanOrderIds != null) { + Map orderIds = (Map) cacheService.get(tenantId, "program_" + storeId); + orderIds.remove(String.valueOf(programStoreBusinessTicket.getNo())); + cacheService.set(tenantId, "program_" + storeId, orderIds, 1200); + } else { + Map orderIds = new HashMap<>(); + cacheService.set(tenantId, "program_" + storeId, orderIds, 1200); + } + } catch (Exception e) { + logger.error(info + "订单状态推送清理缓存失败>>>>>>>>>>"); + } + } catch (Exception e) { + result.put("status", "0"); + result.put("message", "操作失败" + e.getMessage()); + logger.error(info + ",发生异常", e); + } + return result; + } + + /** + * 订单未支付,超时,无法确认会员是否超时,直接退款 + * + * @param tenantId + * @param busNo + * @return + */ + private Map OrderMemberPayRefund(String tenantId, ProgramStoreBusinessTicket ticket, String busNo) { + String info = "订单未支付,超时,无法确认会员是否超时,直接退款"; + logger.debug(info); + Map result = null; + try { + //会员卡退款 + ProgramSetting programSetting = programSettingService.get(tenantId, ticket.getProgramId()); + Map pbodyMapMember = JSONUtil.parseObject(programSetting.getCardApi(), new TypeReference>() { + }); + // 会员卡退款 + Map paramMapMember = new HashMap(20); + List ignoreSignParamsMember = new ArrayList(); + // 系统级参数 + paramMapMember.put("appKey", pbodyMapMember.get("appKey").toString()); + paramMapMember.put("method", "jw.trade.cancel"); + paramMapMember.put("v", pbodyMapMember.get("version").toString()); + paramMapMember.put("format", pbodyMapMember.get("format").toString()); + paramMapMember.put("locale", pbodyMapMember.get("locale").toString()); + paramMapMember.put("client", pbodyMapMember.get("client").toString()); + paramMapMember.put("timestamp", String.valueOf(System.currentTimeMillis())); + // 业务参数 + paramMapMember.put("tradeVoucherNo", ""); + paramMapMember.put("tradeNo", busNo); // 业务单据号 + String outRefundNoMember = "B" + String.valueOf(IdWorkerUtils.getInstance().nextId()); + paramMapMember.put("ticketNo", outRefundNoMember); + paramMapMember.put("reason", "用户申请退款"); + Store store = storeService.get(tenantId,ticket.getStoreId()); + paramMapMember.put("shopNo", store.getNo()); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", ticket.getStoreId())); + List posInfoList = posInfoService.getList(tenantId, criteria); + PosInfo posInfo = posInfoList.get(0); + paramMapMember.put("posNo", posInfo.getPosNo()); + paramMapMember.put("workerNo", pbodyMapMember.get("workerNo").toString()); + paramMapMember.put("sourceSign", "web"); + ignoreSignParamsMember.add("reason"); + // 参数签名 + String signValue = this.sign(paramMapMember, ignoreSignParamsMember, pbodyMapMember.get("appSecret").toString()); + paramMapMember.put("sign", signValue); + HttpResponse responseMember = HttpTool.url(pbodyMapMember.get("url").toString()).form(paramMapMember).post(); + String contentMember = HttpTool.getResponseAsString(responseMember); + result = new HashMap<>(); + if (this.isSuccessful(contentMember)) { + JSONObject responseJsonMember = JSON.parseObject(contentMember); + if (responseJsonMember.getInteger("status") == 1) { + result.put("status", 1); + result.put("message", "会员卡退款成功"); + logger.error(info + "会员卡退款成功 订单号 orderNo:" + busNo + " 退款单号:" + outRefundNoMember + " moneyActual:" + ticket.getReceivable()); + } else { + result.put("status", 0); + result.put("message", "会员卡退款失败"); + logger.error(info + "会员卡退款失败 订单号 orderNo:" + busNo + " 退款单号:" + outRefundNoMember + " moneyActual:" + ticket.getReceivable() + " 会员退款时发生异常 :" + responseJsonMember.get("message").toString()); + } + } else { + result.put("status", 0); + result.put("message", "会员卡退款失败"); + logger.error(info + "会员卡退款失败 订单号 orderNo:" + busNo + " 退款单号:" + outRefundNoMember + " moneyActual:" + ticket.getReceivable() + " 会员退款时发生异常 :" + contentMember); + } + } catch (Exception e) { + logger.error(info + "时,发生异常", e); + result.put("status", 0); + result.put("message", "会员卡退款失败"); + logger.error(info + "会员卡退款失败 订单号 orderNo:" + busNo); + } + return result; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/freemarker/DefaultTemplateExceptionHandler.java b/food-open/food-open-api/src/main/java/com/jwsaas/freemarker/DefaultTemplateExceptionHandler.java new file mode 100644 index 0000000..58a8c7c --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/freemarker/DefaultTemplateExceptionHandler.java @@ -0,0 +1,27 @@ +package com.jwsaas.freemarker; + +import java.io.IOException; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import freemarker.core.Environment; +import freemarker.template.TemplateException; +import freemarker.template.TemplateExceptionHandler; + +public class DefaultTemplateExceptionHandler implements TemplateExceptionHandler { + + private static final Logger logger = LoggerFactory.getLogger(DefaultTemplateExceptionHandler.class); + + public void handleTemplateException(TemplateException te, Environment env, java.io.Writer out) + throws TemplateException { + try { + logger.info("handleTemplateException"); + + out.write("[ERROR: " + te.getMessage() + "]"); + } catch (IOException e) { + throw new TemplateException("Failed to print error message. Cause: " + e, env); + } + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/http/HTTPRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/http/HTTPRequest.java new file mode 100644 index 0000000..09edf8b --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/http/HTTPRequest.java @@ -0,0 +1,474 @@ +package com.jwsaas.http; + +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.concurrent.Executor; +import java.util.concurrent.Executors; + +import org.apache.commons.codec.binary.Base64; +import org.apache.http.HttpEntity; +import org.apache.http.HttpResponse; +import org.apache.http.client.ClientProtocolException; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.config.RequestConfig.Builder; +import org.apache.http.client.methods.HttpDelete; +import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpOptions; +import org.apache.http.client.methods.HttpPatch; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.methods.HttpPut; +import org.apache.http.client.methods.HttpUriRequest; +import org.apache.http.client.utils.URIBuilder; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.entity.mime.MultipartEntityBuilder; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.jwsaas.util.Md5Hash; +import com.jwsaas.util.URLEncodedUtil; +import com.jwsaas.util.file.FileUtils; + +public class HTTPRequest { + + protected Logger logger = LoggerFactory.getLogger(getClass()); + + private static Executor executor = Executors.newCachedThreadPool(); + + private final String url; + + private final HashMap> headers = new HashMap>(); + + private final HashMap> queryParams = new HashMap>(); + + private final HashMap pathParams = new HashMap(); + + private Integer timeout; + + private boolean followRedirect = true; + + private String body = ""; + + private String userAgent = null; + + /** + * @param url + * URL + */ + public HTTPRequest(final String url) { + this.url = url; + } + + /** + * @param name + * the name of the header + * @param value + * the value of the header + * @return this + */ + public HTTPRequest header(final String name, final String value) { + if (!this.headers.containsKey(name)) { + this.headers.put(name, new ArrayList()); + } + this.headers.get(name).add(value); + return this; + } + + /** + * @param name + * the name of the query parameter + * @param value + * the value of the query parameter + * @return this + */ + public HTTPRequest queryParam(final String name, final String value) { + if (!this.queryParams.containsKey(name)) { + + this.queryParams.put(name, new ArrayList()); + } + this.queryParams.get(name).add(value); + return this; + } + + /** + * @param name + * the name of the path parameter + * @param value + * the value of the path parameter + * @return this + */ + public HTTPRequest pathParam(final String name, final String value) { + this.pathParams.put(name, value); + return this; + } + + /** + * @param newTimeout + * Timeout in ms + * @return this + */ + public HTTPRequest timeout(final int newTimeout) { + this.timeout = newTimeout; + return this; + } + + /** + * @param follow + * true to automatically follow redirects; + * false otherwise + * @return this + */ + public HTTPRequest followRedirect(boolean follow) { + this.followRedirect = follow; + return this; + } + + /** + * @param agent + * the user agent string to use + * @return this + */ + public HTTPRequest userAgent(String agent) { + this.userAgent = agent; + return this; + } + + // ####################### + // Some header shortcuts + // ####################### + + /** + * @param type + * the Content-Type + * @return this + */ + public HTTPRequest contentType(final String type) { + return this.header(HttpConstants.HEADER_CONTENT_TYPE, type); + } + + /** + * @param authString + * the Authorization header + * @return this + */ + public HTTPRequest auth(final String authString) { + return this.header(HttpConstants.HEADER_AUTHORIZATION, authString); + } + + /** + * @param user + * the username + * @param password + * the password + * @return this + */ + public HTTPRequest authBasic(final String user, final String password) { + final String credentials = user + ":" + password; + final String auth = Base64.encodeBase64String(credentials.getBytes()); + return this.auth("Basic " + auth); + } + + /** + * @param accessToken + * the OAuth2 Bearer access token + * @return this + */ + public HTTPRequest authBearer(final String accessToken) { + return this.auth("Bearer " + accessToken); + } + + /** + * @param type + * the Accept type + * @return this + */ + public HTTPRequest accept(final String type) { + return this.header(HttpConstants.HEADER_ACCEPT, type); + } + + /** + * @param bodyString + * the body entity + * @return this + */ + public HTTPRequest body(final String bodyString) { + this.body = bodyString; + return this; + } + + /** + * @param form + * the form content + * @return this + */ + public HTTPRequest form(Map form) { + StringBuilder formString = new StringBuilder(); + Iterator> parts = form.entrySet().iterator(); + if (parts.hasNext()) { + Entry entry = parts.next(); + formString.append(URLEncodedUtil.encode(entry.getKey())); + formString.append("="); + formString.append(URLEncodedUtil.encode(entry.getValue().toString())); + while (parts.hasNext()) { + entry = parts.next(); + formString.append("&"); + formString.append(URLEncodedUtil.encode(entry.getKey())); + formString.append("="); + formString.append(URLEncodedUtil.encode(entry.getValue().toString())); + } + } + + logger.error("http参数--" + formString.toString()); + + return this.contentType("application/x-www-form-urlencoded").body(formString.toString()); + } + + + /** + * @param form + * the form content + * @return this + */ + public HTTPRequest formCCB(Map form) { + StringBuilder formString = new StringBuilder(); + Iterator> parts = form.entrySet().iterator(); + if (parts.hasNext()) { + Entry entry = parts.next(); + formString.append("CCB_IBSVersion=V6"); + formString.append("&"); + formString.append(URLEncodedUtil.encode(entry.getKey())); + formString.append("="); + formString.append(URLEncodedUtil.encode(entry.getValue().toString())); + while (parts.hasNext()) { + entry = parts.next(); + formString.append("&"); + formString.append(URLEncodedUtil.encode(entry.getKey())); + formString.append("="); + formString.append(URLEncodedUtil.encode(entry.getValue().toString())); + } + } + + logger.debug("http参数--" + formString.toString()); + + return this.contentType("application/x-www-form-urlencoded").body(formString.toString()); + } + + public HTTPRequest formSS(Map form) { + StringBuilder formString = new StringBuilder(); + Iterator> parts = form.entrySet().iterator(); + if (parts.hasNext()) { + Entry entry = parts.next(); + formString.append(URLEncodedUtil.encode(entry.getKey())); + formString.append("="); + formString.append(URLEncodedUtil.encode(entry.getValue().toString())); + while (parts.hasNext()) { + entry = parts.next(); + formString.append("&"); + formString.append(URLEncodedUtil.encode(entry.getKey())); + formString.append("="); + formString.append(URLEncodedUtil.encode(entry.getValue().toString())); + } + } + + logger.debug("http参数--" + formString.toString()); + + return this.contentType("application/x-www-form-urlencoded").body(formString.toString()); + } + + /** + * @return the {@link HttpResponse} + */ + public HttpResponse get() { + return this.execute(new HttpGet(this.buildURI())); + } + + /** + * @return the {@link HttpResponse} + */ + public HttpResponse put() { + return this.execute(new HttpPut(this.buildURI())); + } + + /** + * @return the {@link HttpResponse} + */ + public HttpResponse patch() { + return this.execute(new HttpPatch(this.buildURI())); + } + + /** + * @return the {@link HttpResponse} + */ + public HttpResponse post() { + return this.execute(new HttpPost(this.buildURI())); + } + + /** + * @return the {@link HttpResponse} + */ + public HttpResponse delete() { + return this.execute(new HttpDelete(this.buildURI())); + } + + /** + * @return the {@link HttpResponse} + */ + public HttpResponse options() { + return this.execute(new HttpOptions(this.buildURI())); + } + + /** + * @return the {@link HttpResponse} + */ + public void getAsync(HTTPResponseCallback callback) { + this.executeAsync(new HttpGet(this.buildURI()), callback); + } + + /** + * @return the {@link HttpResponse} + */ + public void putAsync(HTTPResponseCallback callback) { + this.executeAsync(new HttpPut(this.buildURI()), callback); + } + + /** + * @return the {@link HttpResponse} + */ + public void patchAsync(HTTPResponseCallback callback) { + this.executeAsync(new HttpPatch(this.buildURI()), callback); + } + + /** + * @return the {@link HttpResponse} + */ + public void postAsync(HTTPResponseCallback callback) { + this.executeAsync(new HttpPost(this.buildURI()), callback); + } + + /** + * @return the {@link HttpResponse} + */ + public void deleteAsync(HTTPResponseCallback callback) { + this.executeAsync(new HttpDelete(this.buildURI()), callback); + } + + /** + * @return the {@link HttpResponse} + */ + public void optionsAsync(HTTPResponseCallback callback) { + this.executeAsync(new HttpOptions(this.buildURI()), callback); + } + + private void executeAsync(final HttpUriRequest req, final HTTPResponseCallback cb) { + Runnable execute = new Runnable() { + + @Override + public void run() { + try { + HttpResponse res = HTTPRequest.this.execute(req); + cb.response(res); + } catch (Exception e) { + cb.fail(e); + } + } + }; + HTTPRequest.executor.execute(execute); + } + + private HttpResponse execute(final HttpUriRequest req) { + HttpClientBuilder builder = HttpClientBuilder.create(); + Builder reqConfig = RequestConfig.custom(); + if (this.timeout != null) { + reqConfig.setConnectTimeout(this.timeout); + } + reqConfig.setRedirectsEnabled(this.followRedirect); + builder.setDefaultRequestConfig(reqConfig.build()); + if ((this.userAgent != null) && !this.userAgent.isEmpty()) { + builder.setUserAgent(this.userAgent); + } + try { + final CloseableHttpClient httpclient = builder.build(); + // if request has data populate body + if (req instanceof HttpEntityEnclosingRequestBase) { + final HttpEntityEnclosingRequestBase entityBase = (HttpEntityEnclosingRequestBase) req; + entityBase.setEntity(new StringEntity(this.body, "UTF-8")); + } + // Set headers + final Set>> entrySet = this.headers.entrySet(); + for (final Entry> entry : entrySet) { + final List list = entry.getValue(); + for (final String string : list) { + req.addHeader(entry.getKey(), string); + } + } + + final HttpResponse response = httpclient.execute(req); + return response; + } catch (final ClientProtocolException e) { + throw new RuntimeException(e); + } catch (final IOException e) { + throw new RuntimeException(e); + } + } + + private URI buildURI() { + try { + String u = this.url; + for (final Entry pathEntry : this.pathParams.entrySet()) { + u = u.replace("{" + pathEntry.getKey() + "}", pathEntry.getValue()); + } + final URIBuilder builder = new URIBuilder(u); + final Set>> entrySet = this.queryParams.entrySet(); + for (final Entry> entry : entrySet) { + final List list = entry.getValue(); + for (final String string : list) { + builder.addParameter(entry.getKey(), string); + } + } + final URI uri = builder.build(); + return uri; + } catch (final URISyntaxException e) { + throw new RuntimeException("Invalid URI", e); + } + } + + public HttpResponse put(String fileParamName, File file) { + HttpClientBuilder builder = HttpClientBuilder.create(); + Builder reqConfig = RequestConfig.custom(); + if (this.timeout != null) { + reqConfig.setConnectTimeout(this.timeout); + } + reqConfig.setRedirectsEnabled(this.followRedirect); + builder.setDefaultRequestConfig(reqConfig.build()); + if ((this.userAgent != null) && !this.userAgent.isEmpty()) { + builder.setUserAgent(this.userAgent); + } + try { + final CloseableHttpClient httpclient = builder.build(); + HttpPut req = new HttpPut(this.buildURI()); + MultipartEntityBuilder multipartEntityBuilder = MultipartEntityBuilder.create(); + HttpEntity httpEntity = multipartEntityBuilder.addBinaryBody(fileParamName, file, ContentType.create(FileUtils.getMimeType(file.getName())), file.getName()).build(); + req.setEntity(httpEntity); + + final HttpResponse response = httpclient.execute(req); + return response; + } catch (final ClientProtocolException e) { + throw new RuntimeException(e); + } catch (final IOException e) { + throw new RuntimeException(e); + } + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/http/HTTPResponseCallback.java b/food-open/food-open-api/src/main/java/com/jwsaas/http/HTTPResponseCallback.java new file mode 100644 index 0000000..7aec323 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/http/HTTPResponseCallback.java @@ -0,0 +1,10 @@ +package com.jwsaas.http; + +import org.apache.http.HttpResponse; + +public interface HTTPResponseCallback { + + void response(HttpResponse response); + + void fail(Exception e); +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/http/HttpConstants.java b/food-open/food-open-api/src/main/java/com/jwsaas/http/HttpConstants.java new file mode 100644 index 0000000..2eecc87 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/http/HttpConstants.java @@ -0,0 +1,94 @@ +package com.jwsaas.http; + +public interface HttpConstants { + + // Header names + + /** Authentication credentials for HTTP authentication */ + String HEADER_AUTHORIZATION = "Authorization"; + + /** Content-Types that are acceptable */ + String HEADER_ACCEPT = "Accept"; + + /** Character sets that are acceptable */ + String HEADER_ACCEPT_CHARSET = "Accept-Charset"; + + /** Acceptable encodings */ + String HEADER_ACCEPT_ENCODING = "Accept-Encoding"; + + /** Acceptable languages for response */ + String HEADER_ACCEPT_LANGUAGE = "Accept-Language"; + + /** What type of connection the user-agent would prefer */ + String HEADER_CONNECTION = "Connection"; + + /** an HTTP cookie previously sent by the server with Set-Cookie */ + String HEADER_COOKIE = "Cookie"; + + /** Used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain */ + String HEADER_CACHE_CONTROL = "Cache-Control"; + + /** The length of the request body in octets (8-bit bytes) */ + String HEADER_CONTENT_LENGTH = "Content-Length"; + + /** A Base64-encoded binary MD5 sum of the content of the request body */ + String HEADER_CONTENT_MD5 = "Content-MD5"; + + /** The MIME type of the body of the request (used with POST and PUT requests) */ + String HEADER_CONTENT_TYPE = "Content-Type"; + + /** The date and time that the message was sent */ + String HEADER_DATE = "Date"; + + /** Indicates that particular server behaviors are required by the client */ + String HEADER_EXPECT = "Expect"; + + /** The email address of the user making the request */ + String HEADER_FROM = "From"; + + /** Only perform the action if the client supplied entity matches the same entity on the server */ + String HEADER_IF_MATCH = "If-Match"; + + /** Allows a 304 Not Modified to be returned if content is unchanged */ + String HEADER_IF_MODIFIED_SINCE = "If-Modified-Since"; + + /** Allows a 304 Not Modified to be returned if content is unchanged */ + String HEADER_IF_NONE_MATCH = "If-None-Match"; + + /** If the entity is unchanged, send me the part(s) that I am missing; otherwise, send me the entire new entity */ + String HEADER_IF_RANGE = "If-Range"; + + /** Only send the response if the entity has not been modified since a specific time */ + String HEADER_IF_UNMODIFIED_SINCE = "If-Unmodified-Since"; + + /** Limit the number of times the message can be forwarded through proxies or gateways */ + String HEADER_MAX_FORWARDS = "Max-Forwards"; + + /** Implementation-specific headers that may have various effects anywhere along the request-response chain */ + String HEADER_PRAGMA = "Pragma"; + + /** Authorization credentials for connecting to a proxy */ + String HEADER_PROXY_AUTHORIZATION = "Proxy-Authorization"; + + /** Request only part of an entity. Bytes are numbered from 0. */ + String HEADER_RANGE = "Range"; + + /** This is the address of the previous web page from which a link to the currently requested page was followed */ + String HEADER_REFERER = "Referer"; + + /** The transfer encodings the user agent is willing to accept */ + String HEADER_TARNSFER_ENCODING = "TE"; + + /** Ask the server to upgrade to another protocol */ + String HEADER_UPGRADE = "Upgrade"; + + /** The user agent string of the user agent */ + String HEADER_USER_AGENT = "User-Agent"; + + /** Informs the server of proxies through which the request was sent */ + String HEADER_VIA = "Via"; + + /** A general warning about possible problems with the entity body */ + String HEADER_WARNING = "Warning"; + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/http/HttpTool.java b/food-open/food-open-api/src/main/java/com/jwsaas/http/HttpTool.java new file mode 100644 index 0000000..d4acc76 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/http/HttpTool.java @@ -0,0 +1,125 @@ +package com.jwsaas.http; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.URLDecoder; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.http.HttpResponse; +import org.apache.http.ParseException; +import org.apache.http.util.EntityUtils; + +public final class HttpTool { + + private HttpTool() { + // + } + + /** + * @param url + * the base URL + * @return the created {@link HTTPRequest} + */ + public static HTTPRequest url(final String url) { + return new HTTPRequest(url); + } + + /** + * @param response + * the {@link HttpResponse} + * @return String the body as UTF-8 string + */ + public static String getResponseAsString(final HttpResponse response) { + try { + return EntityUtils.toString(response.getEntity(), "UTF-8"); + } catch (final ParseException e) { + throw new RuntimeException(e); + } catch (final IOException e) { + throw new RuntimeException(e); + } + } + + /** + * @param response + * the {@link HttpResponse} + * @return String the body as UTF-8 string + */ + public static byte[] getResponseAsBytes(final HttpResponse response) { + try { + return EntityUtils.toByteArray(response.getEntity()); + } catch (final ParseException e) { + throw new RuntimeException(e); + } catch (final IOException e) { + throw new RuntimeException(e); + } + } + + /** + * @param response + * Response + * @return String + */ + public static int getStatus(final HttpResponse response) { + return response.getStatusLine().getStatusCode(); + } + + /** + * @param response + * Response + * @return true if status code if between 200 and 299 + */ + public static boolean isStatusOK(final HttpResponse response) { + final int code = HttpTool.getStatus(response); + return (code >= 200) && (code <= 299); + } + + /** + * @param response + * Response + * @return true if status code if between 300 and 399 + */ + public static boolean isStatusRedirect(final HttpResponse response) { + final int code = HttpTool.getStatus(response); + return (code >= 300) && (code <= 399); + } + + /** + * @param response + * Response + * @return true if status code if between 400 and 499 + */ + public static boolean isStatusClientError(final HttpResponse response) { + final int code = HttpTool.getStatus(response); + return (code >= 400) && (code <= 499); + } + + /** + * @param response + * Response + * @return true if status code if between 500 and 599 + */ + public static boolean isStatusServerError(final HttpResponse response) { + final int code = HttpTool.getStatus(response); + return (code >= 500) && (code <= 599); + } + + public static String getResquestBody(final HttpServletRequest request) { + try { + // 读取请求内容 + BufferedReader br = new BufferedReader(new InputStreamReader(request.getInputStream())); + String line = null; + StringBuilder sb = new StringBuilder(); + while ((line = br.readLine()) != null) { + sb.append(line); + } + // 解码 + String reqBody = sb.toString(); + return URLDecoder.decode(reqBody, "UTF-8"); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/http/callbacks/HTTPByteCallback.java b/food-open/food-open-api/src/main/java/com/jwsaas/http/callbacks/HTTPByteCallback.java new file mode 100644 index 0000000..5698bda --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/http/callbacks/HTTPByteCallback.java @@ -0,0 +1,16 @@ +package com.jwsaas.http.callbacks; + +import org.apache.http.HttpResponse; + +import com.jwsaas.http.HttpTool; + +public abstract class HTTPByteCallback extends HTTPStatusCheckCallback { + + @Override + protected void checkedResponse(HttpResponse response) { + this.byteResponse(HttpTool.getResponseAsBytes(response), response); + } + + protected abstract void byteResponse(byte[] body, HttpResponse response); + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/http/callbacks/HTTPStatusCheckCallback.java b/food-open/food-open-api/src/main/java/com/jwsaas/http/callbacks/HTTPStatusCheckCallback.java new file mode 100644 index 0000000..0a802e8 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/http/callbacks/HTTPStatusCheckCallback.java @@ -0,0 +1,29 @@ +package com.jwsaas.http.callbacks; + +import org.apache.http.HttpResponse; + +import com.jwsaas.http.HTTPResponseCallback; + +public abstract class HTTPStatusCheckCallback implements HTTPResponseCallback { + + @Override + public final void response(HttpResponse response) { + int statusCode = response.getStatusLine().getStatusCode(); + if (statusCode != this.expectedStatus()) { + this.invalidStatus(statusCode, response); + } + this.checkedResponse(response); + } + + protected abstract void checkedResponse(HttpResponse response); + + protected abstract void invalidStatus(int status, HttpResponse response); + + /** + * @return the expected status code of the {@link HttpResponse} + */ + protected int expectedStatus() { + return 200; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/http/callbacks/HTTPStringCallback.java b/food-open/food-open-api/src/main/java/com/jwsaas/http/callbacks/HTTPStringCallback.java new file mode 100644 index 0000000..5bca86b --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/http/callbacks/HTTPStringCallback.java @@ -0,0 +1,16 @@ +package com.jwsaas.http.callbacks; + +import org.apache.http.HttpResponse; + +import com.jwsaas.http.HttpTool; + +public abstract class HTTPStringCallback extends HTTPStatusCheckCallback { + + @Override + protected void checkedResponse(HttpResponse response) { + this.stringResponse(HttpTool.getResponseAsString(response), response); + } + + protected abstract void stringResponse(String body, HttpResponse response); + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/mqtt/MqttClientExt.java b/food-open/food-open-api/src/main/java/com/jwsaas/mqtt/MqttClientExt.java new file mode 100644 index 0000000..520e8fe --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/mqtt/MqttClientExt.java @@ -0,0 +1,306 @@ +package com.jwsaas.mqtt; + +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.Queue; +import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; + +import org.eclipse.paho.client.mqttv3.MqttClient; +import org.eclipse.paho.client.mqttv3.MqttConnectOptions; +import org.eclipse.paho.client.mqttv3.MqttException; +import org.eclipse.paho.client.mqttv3.MqttMessage; +import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +//// @Resource private MqttClientExt mqttClient; +// mqttClient.Publisher(); + + +public class MqttClientExt { + + private static Logger logger = LoggerFactory.getLogger(MqttClientExt.class); + + private final int QOS = 2; + + private ScheduledExecutorService scheduler; + + private MqttClient mqttClient; + + private MqttConnectOptions options; + + private String clientId; + + private String host; + + private Integer port; + + private Integer keepAlive; + + private Integer connectionTimeout; + + private String userName = "00000"; + + private String passwd = "0000000000000000000"; + + private Queue> wait = null; + + public MqttClientExt() { + wait = new ConcurrentLinkedQueue>(); + } + + + private void connect() { + try { + + logger.info("初始化MQTT消息服务......"); + + String serverURI = "tcp://" + this.getHost() + ":" + this.getPort(); + + MemoryPersistence persistence = new MemoryPersistence(); + + this.mqttClient = new MqttClient(serverURI, this.getClientId(), persistence); + + // MQTT的连接设置 + this.options = new MqttConnectOptions(); + + //设置是否清空session,这里如果设置为false表示服务器会保留客户端的连接记录,这里设置为true表示每次连接到服务器都以新的身份连接 + //如果是true,那么清理所有离线消息,即QoS1或者2的所有未接收内容 + this.options.setCleanSession(false); + + this.options.setMaxInflight(10000); + + // 设置超时时间 单位为秒 + this.options.setConnectionTimeout(this.getConnectionTimeout()); + // 设置会话心跳时间 单位为秒 服务器会每隔20秒的时间向客户端发送个消息判断客户端是否在线,但这个方法并没有重连的机制 + this.options.setKeepAliveInterval(this.getKeepAlive()); + + this.options.setUserName(this.getUserName()); + + this.options.setPassword(this.getPasswd().toCharArray()); + //设置是否自动重连 + this.options.setAutomaticReconnect(false);// this.options.setAutomaticReconnect(true); + // 设置回调 + mqttClient.setCallback(new PushCallback()); + + mqttClient.connect(options); + + } catch (Exception ex) { + + mqttClient = null; + + logger.error("连接MQTT消息中心异常",ex); + } + } + + public void init() { + + try { + + this.connect(); + + } catch (Exception ex) { + logger.error("连接MQTT消息中心异常",ex); + } + finally { + logger.info("连接MQTT消息中心状态:" + this.isConnected()); + + scheduler = Executors.newSingleThreadScheduledExecutor(); + scheduler.scheduleAtFixedRate(new Runnable() { + public void run() { + try { + logger.info("MQTT消息中心状态<{}>,消息队列<{}>",isConnected(),wait.size()); + + if(!isConnected()) { + + logger.info("重新连接MQTT消息中心......"); + + connect(); + } + + if(!wait.isEmpty()) { + //循环次数 + int loop = wait.size() > 100 ? 100 : wait.size(); + + for(int i = 0;i data = wait.poll(); + + Date date = (Date) data.get("date"); + Integer count = (Integer) data.get("count"); + + long currDate = new Date().getTime(); + //发送超过10次或超过5分钟丢弃 + if(count > 10 || currDate - date.getTime() > 5*60*60*1000) { + return; + } + + if(isConnected()) { + + String topic = data.get("topic").toString(); + String payload = data.get("payload").toString(); + + Publish(topic,payload); + } + else { + data.put("date", new Date()); + + count++; + data.put("count", count); + + wait.add(data); + } + + Thread.sleep(10); + } + } + + } catch (Exception e) { + logger.error("检测MQTT消息中心状态异常",e); + } + } + }, 20 * 1000, 30 * 1000, TimeUnit.MILLISECONDS); + } + } + + public void destroy() { + try { + + if(this.isConnected()) { + + this.mqttClient.disconnect(); + + logger.info("断开MQTT消息中心连接"); + } + + this.mqttClient = null; + + } catch (MqttException ex) { + logger.error("断开MQTT消息中心连接异常",ex); + } + } + + public boolean isConnected() { + return this.mqttClient != null && this.mqttClient.isConnected(); + } + + public void Publish(String topic, String payload,Integer count) { + + try { + if(this.isConnected()) { + + MqttMessage message = new MqttMessage(payload.getBytes()); + + message.setQos(this.QOS); + + mqttClient.publish(topic, message); + + logger.debug("<{}>进行第<{}>次发布...",topic,count); + } + else + { + Map data = new HashMap(); + data.put("topic", topic); + data.put("payload", payload); + + data.put("date", new Date()); + count++; + data.put("count", count); + + this.wait.add(data); + } + }catch (Exception ex) { + logger.error("MQTT发布消息异常",ex); + } + + + } + + public void Publish(String topic, String payload) { + Publish(topic, payload,1); + } + + + public void Subscribe(String topicFilter) throws MqttException { + + try { + if(this.isConnected()) { + mqttClient.subscribe(topicFilter, this.QOS); + } + }catch (Exception ex) { + logger.error("MQTT订阅异常",ex); + } + } + + public void Unsubscribe(String topicFilter) throws MqttException { + + try { + if(this.isConnected()) { + mqttClient.unsubscribe(topicFilter); + } + }catch (Exception ex) { + logger.error("MQTT退订异常",ex); + } + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getHost() { + return host; + } + + public void setHost(String host) { + this.host = host; + } + + public Integer getPort() { + return port; + } + + public void setPort(Integer port) { + this.port = port; + } + + public Integer getKeepAlive() { + return keepAlive; + } + + public void setKeepAlive(Integer keepAlive) { + this.keepAlive = keepAlive; + } + + public Integer getConnectionTimeout() { + return connectionTimeout; + } + + public void setConnectionTimeout(Integer connectionTimeout) { + this.connectionTimeout = connectionTimeout; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getPasswd() { + return passwd; + } + + public void setPasswd(String passwd) { + this.passwd = passwd; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/mqtt/PushCallback.java b/food-open/food-open-api/src/main/java/com/jwsaas/mqtt/PushCallback.java new file mode 100644 index 0000000..5955705 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/mqtt/PushCallback.java @@ -0,0 +1,32 @@ +package com.jwsaas.mqtt; + +import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken; +import org.eclipse.paho.client.mqttv3.MqttCallback; +import org.eclipse.paho.client.mqttv3.MqttMessage; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class PushCallback implements MqttCallback { + + private static Logger logger = LoggerFactory.getLogger(PushCallback.class); + + @Override + public void connectionLost(Throwable cause) { + logger.error("连接失败,原因", cause); + } + + @Override + public void messageArrived(String topic, MqttMessage message) throws Exception { + // subscribe后得到的消息会执行到这里面 + logger.debug("接收消息主题:" + topic); + logger.debug("接收消息Qos:" + message.getQos()); + logger.debug("接收消息内容:" + new String(message.getPayload())); + } + + @Override + public void deliveryComplete(IMqttDeliveryToken token) { + // publish后会执行到这里 + logger.debug("消息发送成功!" + ((token == null || token.getResponse() == null) ? "null" : token.getResponse().getKey())); + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/mqtt/Topic.java b/food-open/food-open-api/src/main/java/com/jwsaas/mqtt/Topic.java new file mode 100644 index 0000000..fc84f1d --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/mqtt/Topic.java @@ -0,0 +1,74 @@ +package com.jwsaas.mqtt; + +import java.util.Map; + +public class Topic { + + public static String cardPayMsg = "%s:%s:pay"; + + private String topicName; // 主题名称 + + private String tenantId; // 企业编号 + + private String shopNo; // 门店编号 + + private String posNo; // pos编号 + + private String workerNo; // 员工编号 + + private Map ext; // 附加信息 + + public String getTopicName() { + return topicName; + } + + public void setTopicName(String topicName) { + this.topicName = topicName; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getShopNo() { + return shopNo; + } + + public void setShopNo(String shopNo) { + this.shopNo = shopNo; + } + + public String getPosNo() { + return posNo; + } + + public void setPosNo(String posNo) { + this.posNo = posNo; + } + + public String getWorkerNo() { + return workerNo; + } + + public void setWorkerNo(String workerNo) { + this.workerNo = workerNo; + } + + public Map getExt() { + return ext; + } + + public void setExt(Map ext) { + this.ext = ext; + } + + @Override + public String toString() { + return "Topic [topicName=" + topicName + ", shopNo=" + shopNo + ", posNo=" + posNo + ", workerNo=" + workerNo + ", ext=" + ext + "]"; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/open/converter/DateConverter.java b/food-open/food-open-api/src/main/java/com/jwsaas/open/converter/DateConverter.java new file mode 100644 index 0000000..3db5b45 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/open/converter/DateConverter.java @@ -0,0 +1,33 @@ +package com.jwsaas.open.converter; + +import java.util.Date; + +import com.jwsaas.open.request.WopConverter; +import com.jwsaas.util.DateUtils; + +/** + * @author : 张莹 + */ +public class DateConverter implements WopConverter { + + @Override + public Date convert(String s) { + return DateUtils.parseDate(s); + } + + @Override + public String unconvert(Date date) { + return DateUtils.format(date,DateUtils.DATETIME_FORMAT); + } + + @Override + public Class getSourceClass() { + return String.class; + } + + @Override + public Class getTargetClass() { + return Date.class; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/open/interceptor/ReservedInterceptor.java b/food-open/food-open-api/src/main/java/com/jwsaas/open/interceptor/ReservedInterceptor.java new file mode 100644 index 0000000..e840056 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/open/interceptor/ReservedInterceptor.java @@ -0,0 +1,53 @@ +package com.jwsaas.open.interceptor; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.jwsaas.open.AbstractInterceptor; +import com.jwsaas.open.WopRequestContext; + +/** + *
+ *  该拦截器仅对method为“user.add”进行拦截,你可以在{@link #isMatch(com.jwsaas.open.WopRequestContext)}方法中定义拦截器的匹配规则。
+ *  你可以通过{@link com.jwsaas.open.WopRequestContext#getServiceMethodDefinition()}获取服务方法的注解信息,通过这些信息进行拦截匹配规则
+ *  定义。
+ * 
+ * + * @author 张莹 + */ +public class ReservedInterceptor extends AbstractInterceptor { + + private Logger logger = LoggerFactory.getLogger(getClass()); + + /** + * 在数据绑定后,服务方法调用前执行该拦截方法 + * + * @param wopRequestContext + */ + @Override + public void beforeService(WopRequestContext wopRequestContext) { + logger.debug("beforeService ..." + wopRequestContext.getFormat()); + } + + /** + * 在服务执行完成后,响应返回前执行该拦截方法 + * + * @param wopRequestContext + */ + @Override + public void beforeResponse(WopRequestContext wopRequestContext) { + logger.debug("beforeResponse ..." + wopRequestContext.getFormat()); + } + + /** + * 对method为user.add的方法进行拦截,你可以通过methodContext中的信息制定拦截方案 + * + * @param wopRequestContext + * @return + */ + @Override + public boolean isMatch(WopRequestContext wopRequestContext) { + return "user.add".equals(wopRequestContext.getMethod()); + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/open/listener/DefaultAfterDoServiceEventListener.java b/food-open/food-open-api/src/main/java/com/jwsaas/open/listener/DefaultAfterDoServiceEventListener.java new file mode 100644 index 0000000..4663d2c --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/open/listener/DefaultAfterDoServiceEventListener.java @@ -0,0 +1,40 @@ +package com.jwsaas.open.listener; + +import java.util.Map; + +import com.jwsaas.open.WopRequestContext; +import com.jwsaas.open.event.AfterDoServiceEvent; +import com.jwsaas.open.event.WopEventListener; +import com.jwsaas.open.marshaller.MessageMarshallerUtils; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + *
+ * 功能说明:
+ * 
+ * + * @author 张莹 + */ +public class DefaultAfterDoServiceEventListener implements WopEventListener { + + protected final Logger logger = LoggerFactory.getLogger(getClass()); + + @Override + public void onWopEvent(AfterDoServiceEvent ropEvent) { + WopRequestContext wopRequestContext = ropEvent.getWopRequestContext(); + if (wopRequestContext != null) { + Map allParams = wopRequestContext.getAllParams(); + String message = MessageMarshallerUtils.asUrlString(allParams); + logger.debug(message); + logger.debug("耗时:" + (wopRequestContext.getServiceEndTime() - wopRequestContext.getServiceBeginTime()) + "ms"); + } + } + + @Override + public int getOrder() { + return 0; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/open/listener/DefaultAfterStartedEventListener.java b/food-open/food-open-api/src/main/java/com/jwsaas/open/listener/DefaultAfterStartedEventListener.java new file mode 100644 index 0000000..eab76c2 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/open/listener/DefaultAfterStartedEventListener.java @@ -0,0 +1,63 @@ +package com.jwsaas.open.listener; + +import java.util.HashMap; +import java.util.Map; + +import org.redisson.api.RList; +import org.redisson.api.RedissonClient; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +import com.jwsaas.open.WopContext; +import com.jwsaas.open.event.AfterStartedWopEvent; +import com.jwsaas.open.event.WopEventListener; +import com.jwsaas.properties.ApplicationProperties; +import com.jwsaas.util.JSONUtil; +import com.jwsaas.util.DateUtils; +import com.jwsaas.utils.RedisKeyUtil; + +public class DefaultAfterStartedEventListener implements WopEventListener { + + private static Logger logger = LoggerFactory.getLogger(DefaultAfterStartedEventListener.class); + + @Autowired + private ApplicationProperties applicationProperties; + @Autowired + private RedissonClient redissonClient; + + @Override + public void onWopEvent(AfterStartedWopEvent wopEvent) { + logger.debug("DefaultAfterStartedEventListener.onWopEvent -> execute..."); + + try { + WopContext wopContext = wopEvent.getWopContext(); + String startTime = DateUtils.getCurrentDateTime(); + + String redisName = RedisKeyUtil.getKey4Methods(applicationProperties); + RList> methodList = redissonClient.getList(redisName); + methodList.clear(); + wopContext.getAllServiceMethodHandlers().forEach((key, value) -> { + Map methodInfoMap = new HashMap<>(); + methodInfoMap.put("key", key); + methodInfoMap.put("startTime", startTime); + methodInfoMap.put("info", JSONUtil.toJSONString(value.getServiceMethodDefinition())); + methodInfoMap.put("className", value.getHandlerMethod().getDeclaringClass().getCanonicalName()); + methodInfoMap.put("methodName", value.getHandlerMethod().getName()); + methodInfoMap.put("requestType", value.getRequestType().getName()); + methodInfoMap.put("ignoreSignFieldNames", JSONUtil.toJSONString(value.getIgnoreSignFieldNames())); + + methodList.add(methodInfoMap); + }); + } catch (Exception e) { + logger.error("DefaultAfterStartedEventListener.onWopEvent -> Exception", e); + } + + } + + @Override + public int getOrder() { + return 0; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/open/security/redis/RedisAppSecretManager.java b/food-open/food-open-api/src/main/java/com/jwsaas/open/security/redis/RedisAppSecretManager.java new file mode 100644 index 0000000..a379e14 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/open/security/redis/RedisAppSecretManager.java @@ -0,0 +1,39 @@ +package com.jwsaas.open.security.redis; + +import java.util.Set; + +import com.jwsaas.entity.shared.AppAuth; +import com.jwsaas.open.security.AppSecretManager; +import com.jwsaas.utils.AppAuthUtil; + +/** + * AppSecretManager通过Redis(结合数据库)管理 + * + *
+ * 功能说明:
+ * 
+ * + * @author 张书祥 + */ +public class RedisAppSecretManager implements AppSecretManager { + + @Override + public String getSecret(String appKey) { + String appKeySecret = null; + AppAuth appAuth = AppAuthUtil.getAppAuth(appKey); + if (appAuth != null) { + appKeySecret = appAuth.getAppSecret(); + } + return appKeySecret; + } + + @Override + public boolean isValidAppKey(String appKey) { + return getSecret(appKey) != null; + } + + public static Set getAppKeySet() { + return AppAuthUtil.getAppKeySet(); + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/open/security/redis/RedisInvokeTimesController.java b/food-open/food-open-api/src/main/java/com/jwsaas/open/security/redis/RedisInvokeTimesController.java new file mode 100644 index 0000000..7d77514 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/open/security/redis/RedisInvokeTimesController.java @@ -0,0 +1,101 @@ +package com.jwsaas.open.security.redis; + +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.lang3.StringUtils; +import org.redisson.api.RAtomicLong; +import org.redisson.api.RMapCache; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.entity.shared.AppAuth; +import com.jwsaas.open.WopRequestContext; +import com.jwsaas.open.security.DefaultInvokeTimesController; +import com.jwsaas.open.session.Session; +import com.jwsaas.util.JSONUtil; +import com.jwsaas.utils.AppAuthUtil; +import com.jwsaas.utils.AppKeyUtil; + +public class RedisInvokeTimesController extends DefaultInvokeTimesController { + + private Logger logger = LoggerFactory.getLogger(getClass()); + private static Set methodNotCountSet = new HashSet<>(); + static { + methodNotCountSet.add("common.sayhello"); + } + + @Override + public void caculateInvokeTimes(String appKey, Session session, WopRequestContext wopRequestContext) { + if (methodNotCountSet.contains(wopRequestContext.getMethod())) { + // common.sayhello,不计数 + logger.debug(wopRequestContext.getMethod() + "不计数 ..."); + return; + } + + if (AppAuthUtil.getAppAuth(appKey) == null) { + logger.warn("无效的appKey[" + appKey + "]"); + logger.warn("allParams:" + JSONUtil.toJSONString(wopRequestContext.getAllParams())); + return; + } + + if (isAppInvokeLimitExceed(appKey)) { + // 应用的服务访问次数超限,不再计数 + return; + } + + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + if (appKeyInfo == null || StringUtils.isBlank(appKeyInfo.getAppCode())) { + return; + } + + String appCode = appKeyInfo.getAppCode(); + RAtomicLong rAtomicLong = AppAuthUtil.getInvokeTimes(appCode); + if (rAtomicLong.get() == 0) { + AppAuth appAuth = AppAuthUtil.getAppAuth(appKey); + if (Long.parseLong(appAuth.getCallCounter()) != 0) { + rAtomicLong.set(Long.parseLong(appAuth.getCallCounter())); + } + } + rAtomicLong.getAndIncrement(); + + RMapCache> callTimeMap = AppAuthUtil.getCallTime(); + Map dataMap = callTimeMap.get(appKey); + Date currentDate = new Date(); + if (dataMap == null) { + dataMap = new HashMap<>(); + dataMap.put("firstCallTime", currentDate); + dataMap.put("lastCallTime", currentDate); + } else { + if (!dataMap.containsKey("firstCallTime")) { + dataMap.put("firstCallTime", currentDate); + } + dataMap.put("lastCallTime", currentDate); + } + callTimeMap.put(appKey, dataMap, 5, TimeUnit.DAYS); + + } + + @Override + public boolean isAppInvokeLimitExceed(String appKey) { + AppAuth appAuth = AppAuthUtil.getAppAuth(appKey); + if (appAuth == null) { + return false; + } + + int callLimits = appAuth.getCallLimits(); + if (callLimits == -1) { + return false; + } + + String appCode = appAuth.getAppCode(); + RAtomicLong rAtomicLong = AppAuthUtil.getInvokeTimes(appCode); + return rAtomicLong.get() >= callLimits; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/open/security/redis/RedisServiceAccessController.java b/food-open/food-open-api/src/main/java/com/jwsaas/open/security/redis/RedisServiceAccessController.java new file mode 100644 index 0000000..ca69a3c --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/open/security/redis/RedisServiceAccessController.java @@ -0,0 +1,85 @@ +package com.jwsaas.open.security.redis; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.redisson.api.RList; +import org.redisson.api.RedissonClient; +import org.springframework.beans.factory.annotation.Autowired; + +import com.fasterxml.jackson.databind.JsonNode; +import com.jwsaas.open.security.DefaultServiceAccessController; +import com.jwsaas.open.session.Session; +import com.jwsaas.properties.ApplicationProperties; +import com.jwsaas.util.JSONUtil; +import com.jwsaas.utils.RedisKeyUtil; + +public class RedisServiceAccessController extends DefaultServiceAccessController { + + @Autowired + protected ApplicationProperties applicationProperties; + + @Autowired + protected RedissonClient redissonClient; + + @Override + protected Map> getAclmap() { + if (aclMap == null) { + syncInitAclmap(); + } + return aclMap; + } + + private synchronized void syncInitAclmap() { + if (aclMap == null) { + aclMap = new HashMap>(); + for (String appKey : RedisAppSecretManager.getAppKeySet()) { + aclMap.put(appKey, getServicemethods()); + } + } + } + + @Override + public boolean isAppGranted(String appKey, String method, String version) { + if (getAclmap().containsKey(appKey)) { + List serviceMethods = getAclmap().get(appKey); + return serviceMethods.contains(method); + } else { + if (RedisAppSecretManager.getAppKeySet().contains(appKey)) { + getAclmap().put(appKey, getServicemethods()); + return isAppGranted(appKey, method, version); + } + return false; + } + } + + @Override + public boolean isUserGranted(Session session, String method, String version) { + return true; + } + + @Override + public ArrayList getServicemethods() { + if (serviceMethods == null) { + syncInitServicemethods(); + } + return serviceMethods; + } + + private synchronized void syncInitServicemethods() { + if (serviceMethods == null) { + serviceMethods = new ArrayList(); + + String redisName = RedisKeyUtil.getKey4Methods(applicationProperties); + RList> methodList = redissonClient.getList(redisName); + methodList.forEach(methodInfoMap -> { + String info = methodInfoMap.get("info"); + JsonNode infoNode = JSONUtil.parseJsonNode(info); + serviceMethods.add(infoNode.path("method").asText()); + }); + } + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/open/session/redis/RedisSessionBindInterceptor.java b/food-open/food-open-api/src/main/java/com/jwsaas/open/session/redis/RedisSessionBindInterceptor.java new file mode 100644 index 0000000..b0ea2fc --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/open/session/redis/RedisSessionBindInterceptor.java @@ -0,0 +1,22 @@ +package com.jwsaas.open.session.redis; + +import java.util.HashSet; +import java.util.Set; + +import com.jwsaas.open.WopRequestContext; +import com.jwsaas.open.session.SessionBindInterceptor; + +public class RedisSessionBindInterceptor extends SessionBindInterceptor { + + private static Set sessionNotNeedRefresh = new HashSet<>(); + static { + sessionNotNeedRefresh.add("operator.logout"); + sessionNotNeedRefresh.add("session.remove"); + } + + @Override + protected boolean needRefresh(WopRequestContext wopRequestContext) { + return !sessionNotNeedRefresh.contains(wopRequestContext.getMethod()); + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/open/session/redis/RedisSessionManager.java b/food-open/food-open-api/src/main/java/com/jwsaas/open/session/redis/RedisSessionManager.java new file mode 100644 index 0000000..4f48959 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/open/session/redis/RedisSessionManager.java @@ -0,0 +1,84 @@ +package com.jwsaas.open.session.redis; + +import java.util.concurrent.TimeUnit; + +import org.redisson.api.RMapCache; +import org.redisson.api.RedissonClient; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +import com.jwsaas.open.session.Session; +import com.jwsaas.open.session.SessionManager; +import com.jwsaas.properties.ApplicationProperties; +import com.jwsaas.utils.RedisKeyUtil; + +public class RedisSessionManager implements SessionManager { + + private static Logger logger = LoggerFactory.getLogger(RedisSessionManager.class); + + @Autowired + protected ApplicationProperties applicationProperties; + + @Autowired + protected RedissonClient redissonClient; + + private RMapCache sessionMapCache; + + public void init() { + String redisName = RedisKeyUtil.getKey4Sessions(); + sessionMapCache = redissonClient.getMapCache(redisName); + } + + /** + * 添加/更新Session + */ + @Override + public void addSession(String sessionId, Session session) { + logger.debug("add Session[" + sessionId + "]"); + + String appKey = session.getAttribute("appKey") != null ? session.getAttribute("appKey").toString() : null; + String appId = session.getAttribute("appId") != null ? session.getAttribute("appId").toString() : null; + String tenantCode = session.getAttribute("tenantCode") != null ? session.getAttribute("tenantCode").toString() : null; + String appCode = session.getAttribute("appCode") != null ? session.getAttribute("appCode").toString() : null; + + logger.debug("add Session[" + sessionId + "],appKey:" + appKey); + logger.debug("add Session[" + sessionId + "],appId:" + appId); + logger.debug("add Session[" + sessionId + "],tenantCode:" + tenantCode); + logger.debug("add Session[" + sessionId + "],appCode:" + appCode); + + sessionMapCache.put(sessionId, session, 1, TimeUnit.DAYS); + } + + @Override + public Session getSession(String sessionId) { + logger.debug("get Session[" + sessionId + "]"); + Session session = sessionMapCache.get(sessionId); + logger.debug("get Session[" + sessionId + "],session:" + session); + return session; + } + + @Override + public void removeSession(String sessionId) { + Session session = getSession(sessionId); + logger.debug("remove Session[" + sessionId + "]"); + try { + sessionMapCache.remove(sessionId); + + if (session != null) { + String appKey = session.getAttribute("appKey").toString(); + String appId = session.getAttribute("appId").toString(); + String tenantCode = session.getAttribute("tenantCode").toString(); + String appCode = session.getAttribute("appCode").toString(); + + logger.debug("remove Session[" + sessionId + "],appKey:" + appKey); + logger.debug("remove Session[" + sessionId + "],appId:" + appId); + logger.debug("remove Session[" + sessionId + "],tenantCode:" + tenantCode); + logger.debug("remove Session[" + sessionId + "],appCode:" + appCode); + } + } catch (Exception e) { + logger.debug("remove Session[" + sessionId + "] exception", e); + } + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/pager/Pager.java b/food-open/food-open-api/src/main/java/com/jwsaas/pager/Pager.java new file mode 100644 index 0000000..cc79ae8 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/pager/Pager.java @@ -0,0 +1,124 @@ +package com.jwsaas.pager; + +import java.io.Serializable; +import java.util.List; + +public class Pager implements Serializable { + + private static final long serialVersionUID = 6340241739722441650L; + + public static final Integer MAX_PAGE_SIZE = 500;// 每页最大记录数限制 + + private Integer pageNumber = 1;// 当前页码 + private Integer pageSize = 20;// 每页记录数 + private Integer totalCount = 0;// 总记录数 + private Integer pageCount = 0;// 总页数 + + private String property;// 查找属性名称 + private String keyword;// 查找关键字 + private String orderBy = "createDate";// 排序字段 + private String orderType = "desc"; + + private List list;// 数据List + + public Integer getPageNumber() { + return pageNumber; + } + + public void setPageNumber(Integer pageNumber) { + if (pageNumber < 1) { + pageNumber = 1; + } + this.pageNumber = pageNumber; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + if (pageSize < 1) { + pageSize = 1; + } else if (pageSize > MAX_PAGE_SIZE) { + pageSize = MAX_PAGE_SIZE; + } + this.pageSize = pageSize; + } + + public Integer getTotalCount() { + return totalCount; + } + + public void setTotalCount(Integer totalCount) { + this.totalCount = totalCount; + } + + public Integer getPageCount() { + pageCount = totalCount / pageSize; + if (totalCount % pageSize > 0) { + pageCount++; + } + return pageCount; + } + + public void setPageCount(Integer pageCount) { + this.pageCount = pageCount; + } + + public String getProperty() { + return property; + } + + public void setProperty(String property) { + this.property = property; + } + + public String getKeyword() { + return keyword; + } + + public void setKeyword(String keyword) { + this.keyword = keyword; + } + + public String getOrderBy() { + return orderBy; + } + + public void setOrderBy(String orderBy) { + this.orderBy = orderBy; + } + + public String getOrderType() { + return orderType; + } + + public void setOrderType(String orderType) { + this.orderType = orderType; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("Pager"); + sb.append("{pageNumber=").append(getPageNumber()); + sb.append(", pageSize=").append(getPageSize()); + sb.append(", pageCount=").append(getPageCount()); + sb.append(", totalCount=").append(getTotalCount()); + sb.append(", property=").append(getProperty()); + sb.append(", keyword=").append(getKeyword()); + sb.append(", orderBy=").append(getOrderBy()); + sb.append(", orderType=").append(getOrderType()); + sb.append(", list=").append(list); + sb.append('}'); + return sb.toString(); + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/api/WeiXinPayApi.java b/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/api/WeiXinPayApi.java new file mode 100644 index 0000000..add7bc8 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/api/WeiXinPayApi.java @@ -0,0 +1,193 @@ +package com.jwsaas.pay.weixin.api; + +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.security.KeyStore; + +import javax.net.ssl.SSLContext; + +import org.apache.http.HttpEntity; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.ssl.SSLContexts; +import org.apache.http.util.EntityUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.jwsaas.http.HttpTool; +import com.jwsaas.pay.weixin.request.QueryOrderRequest; +import com.jwsaas.pay.weixin.request.QueryRefundRequest; +import com.jwsaas.pay.weixin.request.RefundRequest; +import com.jwsaas.pay.weixin.request.UnifiedOrderRequest; +import com.jwsaas.pay.weixin.response.QueryOrderResponse; +import com.jwsaas.pay.weixin.response.QueryRefundResponse; +import com.jwsaas.pay.weixin.response.RefundResponse; +import com.jwsaas.pay.weixin.response.UnifiedOrderResponse; +import com.jwsaas.util.XStreamUtils; +import com.jwsaas.utils.Base64; + +public class WeiXinPayApi { + + private static final Logger logger = LoggerFactory.getLogger(WeiXinPayApi.class); + + /** + * 查询订单 + * + * @应用场景 该接口提供所有微信支付订单的查询,商户可以通过该接口主动查询订单状态,完成下一步的业务逻辑。 + *

+ * 需要调用查询接口的情况:
+ * + * ◆ 当商户后台、网络、服务器等出现异常,商户系统最终未接收到支付通知;
+ * ◆ 调用支付接口后,返回系统错误或未知交易状态情况;
+ * ◆ 调用被扫支付API,返回USERPAYING的状态;
+ * ◆ 调用关单或撤销接口API之前,需确认支付状态; + *

+ * + * @param queryOrderRequest + * @return + * @throws IOException + */ + public static QueryOrderResponse queryOrder(QueryOrderRequest queryOrderRequest) throws IOException { + String url = "https://api.mch.weixin.qq.com/pay/orderquery"; + String xml = XStreamUtils.toXml(queryOrderRequest); + logger.debug("pay>query>xml>:{}", xml); + + final HttpResponse response = HttpTool.url(url).body(xml).post(); + logger.debug("status:{}", HttpTool.getStatus(response)); + logger.debug("statusOK:{}", HttpTool.isStatusOK(response)); + final String content = HttpTool.getResponseAsString(response); + logger.debug("weixin>resp>:{}", content); + return XStreamUtils.toBean(content, QueryOrderResponse.class); + } + + /** + * 申请退款 + * + * @应用场景 当交易发生之后一段时间内,由于买家或者卖家的原因需要退款时,卖家可以通过退款接口将支付款退还给买家,微信支付将在收到退款请求并且验证成功之后 + * ,按照退款规则将支付款按原路退到买家帐号上。 + *

+ *

注意:

+ *
    + *
  • 交易时间超过一年的订单无法提交退款;
  • + *
  • 微信支付退款支持单笔交易分多次退款,多次退款需要提交原支付订单的商户订单号和设置不同的退款单号。一笔退款失败后重新提交, + * 要采用原来的退款单号 。总退款金额不能超过用户实际支付金额。
  • + *
+ *

+ * @param refundRequest + * @return + * @throws IOException + */ + public static RefundResponse refund(RefundRequest refundRequest, String certText) { + String url = "https://api.mch.weixin.qq.com/secapi/pay/refund"; + String xml = XStreamUtils.toXml(refundRequest); + logger.debug("pay>close>xml>:{}", xml); + + StringBuffer message = new StringBuffer(); + try { + KeyStore keyStore = KeyStore.getInstance("PKCS12"); + InputStream instream = new ByteArrayInputStream(Base64.decode(certText)); + try { + keyStore.load(instream, refundRequest.getMchId().toCharArray()); + } finally { + instream.close(); + } + + SSLContext sslcontext = SSLContexts.custom().loadKeyMaterial(keyStore, refundRequest.getMchId().toCharArray()).build(); + SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslcontext, new String[] { "TLSv1" }, null, SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER); + CloseableHttpClient httpclient = HttpClients.custom().setSSLSocketFactory(sslsf).build(); + try { + HttpPost httpost = new HttpPost(url); + httpost.addHeader("Connection", "keep-alive"); + httpost.addHeader("Accept", "*/*"); + httpost.addHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); + httpost.addHeader("Host", "api.mch.weixin.qq.com"); + httpost.addHeader("X-Requested-With", "XMLHttpRequest"); + httpost.addHeader("Cache-Control", "max-age=0"); + httpost.addHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0) "); + httpost.setEntity(new StringEntity(xml, "UTF-8")); + CloseableHttpResponse response = httpclient.execute(httpost); + + try { + HttpEntity entity = response.getEntity(); + if (entity != null) { + BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(entity.getContent(), "UTF-8")); + String text; + while ((text = bufferedReader.readLine()) != null) { + message.append(text); + } + } + EntityUtils.consume(entity); + } catch (IOException e) { + e.printStackTrace(); + } finally { + response.close(); + } + } finally { + httpclient.close(); + } + } catch (Exception e) { + e.printStackTrace(); + } + + String content = message.toString(); + logger.debug("weixin>resp>:{}", content); + return XStreamUtils.toBean(content, RefundResponse.class); + } + + /** + * 查询退款 + * + * @应用场景 提交退款申请后,通过调用该接口查询退款状态。退款有一定延时,用零钱支付的退款20分钟内到账,银行卡支付的退款3个工作日后重新查询退款状态 + * 。 + * @param queryRefundRequest + * @return + * @throws IOException + */ + public static QueryRefundResponse queryRefund(QueryRefundRequest queryRefundRequest) throws IOException { + String url = "https://api.mch.weixin.qq.com/pay/refundquery"; + String xml = XStreamUtils.toXml(queryRefundRequest); + logger.debug("pay>queryRefund>xml>:{}", xml); + + final HttpResponse response = HttpTool.url(url).body(xml).post(); + logger.debug("status:{}", HttpTool.getStatus(response)); + logger.debug("statusOK:{}", HttpTool.isStatusOK(response)); + final String content = HttpTool.getResponseAsString(response); + logger.debug("weixin>resp>:{}", content); + return XStreamUtils.toBean(content, QueryRefundResponse.class); + } + + /** + * 统一下单 + * + * @应用场景 除被扫支付场景以外,商户系统先调用该接口在微信支付服务后台生成预支付交易单,返回正确的预支付交易回话标识后再按扫码、JSAPI、 + * APP等不同场景生成交易串调起支付。 + * + * @param unifiedOrderRequest + * @return + * @throws IOException + */ + public UnifiedOrderResponse unifiedOrder(UnifiedOrderRequest unifiedOrderRequest) throws IOException { + String url = "https://api.mch.weixin.qq.com/pay/unifiedorder"; + String xml = XStreamUtils.toXml(unifiedOrderRequest); + logger.debug("pay>unified>xml>:{}", xml); + + + final HttpResponse response = HttpTool.url(url).body(xml).post(); + logger.debug("status:{}", HttpTool.getStatus(response)); + logger.debug("statusOK:{}", HttpTool.isStatusOK(response)); + final String content = HttpTool.getResponseAsString(response); + logger.debug("weixin>resp>:{}", content); + + UnifiedOrderResponse resp = XStreamUtils.toBean(content, UnifiedOrderResponse.class); + return resp; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/request/PayNotifyRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/request/PayNotifyRequest.java new file mode 100644 index 0000000..9aa219e --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/request/PayNotifyRequest.java @@ -0,0 +1,518 @@ +package com.jwsaas.pay.weixin.request; + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlAccessOrder; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorOrder; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +import com.thoughtworks.xstream.annotations.XStreamAlias; + +/** + * 支付结果通用通知请求参数 + * + * @author 张莹 + * + */ +@XmlRootElement(name = "xml") +@XmlAccessorOrder(XmlAccessOrder.UNDEFINED) +@XmlAccessorType(XmlAccessType.NONE) +@XStreamAlias("xml") +public class PayNotifyRequest implements Serializable { + + private static final long serialVersionUID = 4109619776930478478L; + + /** + * 返回状态码 + * + * @描述 SUCCESS/FAIL 此字段是通信标识,非交易标识,交易是否成功需要查看result_code来判断 + * @示例值 SUCCESS + */ + @XmlElement(name = "return_code") + @XStreamAlias("return_code") + private String returnCode; + + /** + * 返回信息 + * + * @描述 返回信息,如非空,为错误原因(签名失败,参数格式校验错误) + * @示例值 签名失败 + */ + @XmlElement(name = "return_msg") + @XStreamAlias("return_msg") + private String returnMsg; + + // 以下字段在return_code为SUCCESS的时候有返回 + + /** + * 公众账号ID + * + * @描述 调用接口提交的公众账号ID + * @示例值 wx8888888888888888 + */ + @XmlElement(name = "appid") + @XStreamAlias("appid") + private String appid; + + /** + * 商户号 + * + * @描述 调用接口提交的商户号 + * @示例值 1900000109 + */ + @XmlElement(name = "mch_id") + @XStreamAlias("mch_id") + private String mchId; + + /** + * 子商户公众账号ID + * + * @描述 子商户公众账号ID + * @示例值 wx8888888888888888 + */ + @XmlElement(name = "sub_appid") + @XStreamAlias("sub_appid") + private String subAppid; + + /** + * 子商户号 + * + * @描述 调用接口提交的子商户号 + * @示例值 1900000109 + */ + @XmlElement(name = "sub_mch_id") + @XStreamAlias("sub_mch_id") + private String subMchId; + + /** + * 设备号 + * + * @描述 调用接口提交的终端设备号 + * @示例值 013467007045764 + */ + @XmlElement(name = "device_info") + @XStreamAlias("device_info") + private String deviceInfo; + + /** + * 随机字符串 + * + * @描述 微信返回的随机字符串 + * @示例值 5K8264ILTKCH16CQ2502SI8ZNMTM67VS + */ + @XmlElement(name = "nonce_str") + @XStreamAlias("nonce_str") + private String nonceStr; + + /** + * 签名 + * + * @描述 微信返回的签名,详见签名算法 + * @示例值 C380BEC2BFD727A4B6845133519F3AD6 + */ + @XmlElement(name = "sign") + @XStreamAlias("sign") + private String sign; + + /** + * 业务结果 + * + * @描述 SUCCESS/FAIL + * @示例值 SUCCESS + */ + @XmlElement(name = "result_code") + @XStreamAlias("result_code") + private String resultCode; + + /** + * 错误代码 + * + * @描述 详细参见第6节错误列表 + * @示例值 SYSTEMERROR + */ + @XmlElement(name = "err_code") + @XStreamAlias("err_code") + private String errCode; + + /** + * 错误代码描述 + * + * @描述 错误返回的信息描述 + * @示例值 系统错误 + */ + @XmlElement(name = "err_code_des") + @XStreamAlias("err_code_des") + private String errCodeDes; + + // 以下字段在return_code 和result_code都为SUCCESS的时候有返回 + + /** + * 用户标识 + * + * @描述 用户在商户appid下的唯一标识 + * @示例值 wxd930ea5d5a258f4f + */ + @XmlElement(name = "openid") + @XStreamAlias("openid") + private String openid; + + /** + * 用户子标识 + * + * @描述 用户在子商户appid下的唯一标识 + * @示例值 wxd930ea5d5a258f4f + */ + @XmlElement(name = "sub_openid") + @XStreamAlias("sub_openid") + private String subOpenid; + + /** + * 是否关注公众账号 + * + * @描述 用户是否关注公众账号,Y-关注,N-未关注,仅在公众账号类型支付有效 + * @示例值 Y + */ + @XmlElement(name = "is_subscribe") + @XStreamAlias("is_subscribe") + private String isSubscribe; + + /** + * 交易类型 + * + * @描述 调用接口提交的交易类型,取值如下:JSAPI,NATIVE,APP,详细说明见参数规定 + * @示例值 NATIVE + */ + @XmlElement(name = "trade_type") + @XStreamAlias("trade_type") + private String tradeType; + + /** + * 付款银行 + * + * @描述 银行类型,采用字符串类型的银行标识 + * @示例值 CMC + */ + @XmlElement(name = "bank_type") + @XStreamAlias("bank_type") + private String bankType; + + /** + * 总金额 + * + * @描述 订单总金额,单位为分 + * @示例值 100 + */ + @XmlElement(name = "total_fee") + @XStreamAlias("total_fee") + private long totalFee; + + /** + * 货币种类 + * + * @描述 货币类型,符合ISO 4217标准的三位字母代码,默认人民币:CNY,其他值列表详见货币类型 + * @示例值 CNY + */ + @XmlElement(name = "fee_type") + @XStreamAlias("fee_type") + private String feeType; + + /** + * 现金支付金额 + * + * @描述 现金支付金额订单现金支付金额,详见支付金额 + * @示例值 100 + */ + @XmlElement(name = "cash_fee") + @XStreamAlias("cash_fee") + private long cashFee; + + /** + * 现金支付货币类型 + * + * @描述 货币类型,符合ISO 4217标准的三位字母代码,默认人民币:CNY,其他值列表详见货币类型 + * @示例值 CNY + */ + @XmlElement(name = "cash_fee_type") + @XStreamAlias("cash_fee_type") + private String cashFeeType; + + /** + * 代金券或立减优惠金额 + * + * @描述 “代金券或立减优惠”金额<=订单总金额,订单总金额-“代金券或立减优惠”金额=现金支付金额,详见支付金额 + * @示例值 100 + */ + @XmlElement(name = "coupon_fee") + @XStreamAlias("coupon_fee") + private long couponFee; + + /** + * 代金券或立减优惠使用数量 + * + * @描述 代金券或立减优惠使用数量 + * @示例值 1 + */ + @XmlElement(name = "coupon_count") + @XStreamAlias("coupon_count") + private long couponCount; + + /** + * 微信支付订单号 + * + * @描述 微信支付订单号 + * @示例值 1217752501201407033233368018 + */ + @XmlElement(name = "transaction_id") + @XStreamAlias("transaction_id") + private String transactionId; + + /** + * 商户订单号 + * + * @描述 商户系统的订单号,与请求一致。 + * @示例值 1217752501201407033233368018 + */ + @XmlElement(name = "out_trade_no") + @XStreamAlias("out_trade_no") + private String outTradeNo; + + /** + * 商家数据包 + * + * @描述 商家数据包,原样返回 + * @示例值 123456 + */ + @XmlElement(name = "attach") + @XStreamAlias("attach") + private String attach; + + /** + * 支付完成时间 + * + * @描述 订单支付时间,格式为yyyyMMddHHmmss,如2009年12月25日9点10分10秒表示为20091225091010。其他详见时间规则 + * @示例值 20141030133525 + */ + @XmlElement(name = "time_end") + @XStreamAlias("time_end") + private String timeEnd; + + public String getReturnCode() { + return returnCode; + } + + public void setReturnCode(String returnCode) { + this.returnCode = returnCode; + } + + public String getReturnMsg() { + return returnMsg; + } + + public void setReturnMsg(String returnMsg) { + this.returnMsg = returnMsg; + } + + public String getAppid() { + return appid; + } + + public void setAppid(String appid) { + this.appid = appid; + } + + public String getMchId() { + return mchId; + } + + public void setMchId(String mchId) { + this.mchId = mchId; + } + + public String getDeviceInfo() { + return deviceInfo; + } + + public void setDeviceInfo(String deviceInfo) { + this.deviceInfo = deviceInfo; + } + + public String getNonceStr() { + return nonceStr; + } + + public void setNonceStr(String nonceStr) { + this.nonceStr = nonceStr; + } + + public String getSign() { + return sign; + } + + public void setSign(String sign) { + this.sign = sign; + } + + public String getResultCode() { + return resultCode; + } + + public void setResultCode(String resultCode) { + this.resultCode = resultCode; + } + + public String getErrCode() { + return errCode; + } + + public void setErrCode(String errCode) { + this.errCode = errCode; + } + + public String getErrCodeDes() { + return errCodeDes; + } + + public void setErrCodeDes(String errCodeDes) { + this.errCodeDes = errCodeDes; + } + + public String getOpenid() { + return openid; + } + + public void setOpenid(String openid) { + this.openid = openid; + } + + public String getIsSubscribe() { + return isSubscribe; + } + + public void setIsSubscribe(String isSubscribe) { + this.isSubscribe = isSubscribe; + } + + public String getTradeType() { + return tradeType; + } + + public void setTradeType(String tradeType) { + this.tradeType = tradeType; + } + + public String getBankType() { + return bankType; + } + + public void setBankType(String bankType) { + this.bankType = bankType; + } + + public long getTotalFee() { + return totalFee; + } + + public void setTotalFee(long totalFee) { + this.totalFee = totalFee; + } + + public String getFeeType() { + return feeType; + } + + public void setFeeType(String feeType) { + this.feeType = feeType; + } + + public long getCashFee() { + return cashFee; + } + + public void setCashFee(long cashFee) { + this.cashFee = cashFee; + } + + public String getCashFeeType() { + return cashFeeType; + } + + public void setCashFeeType(String cashFeeType) { + this.cashFeeType = cashFeeType; + } + + public long getCouponFee() { + return couponFee; + } + + public void setCouponFee(long couponFee) { + this.couponFee = couponFee; + } + + public long getCouponCount() { + return couponCount; + } + + public void setCouponCount(long couponCount) { + this.couponCount = couponCount; + } + + public String getTransactionId() { + return transactionId; + } + + public void setTransactionId(String transactionId) { + this.transactionId = transactionId; + } + + public String getOutTradeNo() { + return outTradeNo; + } + + public void setOutTradeNo(String outTradeNo) { + this.outTradeNo = outTradeNo; + } + + public String getAttach() { + return attach; + } + + public void setAttach(String attach) { + this.attach = attach; + } + + public String getTimeEnd() { + return timeEnd; + } + + public void setTimeEnd(String timeEnd) { + this.timeEnd = timeEnd; + } + + public String getSubAppid() { + return subAppid; + } + + public void setSubAppid(String subAppid) { + this.subAppid = subAppid; + } + + public String getSubMchId() { + return subMchId; + } + + public void setSubMchId(String subMchId) { + this.subMchId = subMchId; + } + + public String getSubOpenid() { + return subOpenid; + } + + public void setSubOpenid(String subOpenid) { + this.subOpenid = subOpenid; + } + +} \ No newline at end of file diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/request/QueryOrderRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/request/QueryOrderRequest.java new file mode 100644 index 0000000..f5c3515 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/request/QueryOrderRequest.java @@ -0,0 +1,168 @@ +package com.jwsaas.pay.weixin.request; + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlAccessOrder; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorOrder; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +import com.thoughtworks.xstream.annotations.XStreamAlias; + +/** + * 查询订单请求参数 + */ +@XmlRootElement(name = "xml") +@XmlAccessorOrder(XmlAccessOrder.UNDEFINED) +@XmlAccessorType(XmlAccessType.NONE) +@XStreamAlias("xml") +public class QueryOrderRequest implements Serializable { + + private static final long serialVersionUID = 3202391151721151801L; + + /** + * 公众账号ID + * + * @描述 微信分配的公众账号ID(企业号corpid即为此appId) + * @示例值 wx8888888888888888 + */ + @XmlElement(name = "appid") + @XStreamAlias("appid") + private String appid; + + /** + * 商户号 + * + * @描述 微信支付分配的商户号 + * @示例值 1900000109 + */ + @XmlElement(name = "mch_id") + @XStreamAlias("mch_id") + private String mchId; + + /** + * 子商户公众账号ID + * + * @描述 微信分配的公众账号ID(企业号corpid即为此appId) + * @示例值 wx8888888888888888 + */ + @XmlElement(name = "sub_appid") + @XStreamAlias("sub_appid") + private String subAppid; + + /** + * 子商户号 + * + * @描述 微信支付分配的商户号 + * @示例值 1900000109 + */ + @XmlElement(name = "sub_mch_id") + @XStreamAlias("sub_mch_id") + private String subMchId; + + /** + * 微信订单号 + * + * @描述 终端设备号(门店号或收银设备ID),注意:PC网页或公众号内支付请传"WEB" + * @示例值 013467007045764 + */ + @XmlElement(name = "transaction_id") + @XStreamAlias("transaction_id") + private String transactionId; + + /** + * 商户订单号 + * + * @描述 商户系统内部的订单号,当没提供transaction_id时需要传这个。 + * @示例值 1217752501201407033233368018 + */ + @XmlElement(name = "out_trade_no") + @XStreamAlias("out_trade_no") + private String outTradeNo; + + /** + * 随机字符串 + * + * @描述 随机字符串,不长于32位。推荐随机数生成算法 + * @示例值 5K8264ILTKCH16CQ2502SI8ZNMTM67VS + */ + @XmlElement(name = "nonce_str") + @XStreamAlias("nonce_str") + private String nonceStr; + + /** + * 签名 + * + * @描述 签名,详见签名生成算法 + * @示例值 C380BEC2BFD727A4B6845133519F3AD6 + */ + @XmlElement(name = "sign") + @XStreamAlias("sign") + private String sign; + + public String getAppid() { + return appid; + } + + public void setAppid(String appid) { + this.appid = appid; + } + + public String getMchId() { + return mchId; + } + + public void setMchId(String mchId) { + this.mchId = mchId; + } + + public String getSubAppid() { + return subAppid; + } + + public void setSubAppid(String subAppid) { + this.subAppid = subAppid; + } + + public String getSubMchId() { + return subMchId; + } + + public void setSubMchId(String subMchId) { + this.subMchId = subMchId; + } + + public String getTransactionId() { + return transactionId; + } + + public void setTransactionId(String transactionId) { + this.transactionId = transactionId; + } + + public String getOutTradeNo() { + return outTradeNo; + } + + public void setOutTradeNo(String outTradeNo) { + this.outTradeNo = outTradeNo; + } + + public String getNonceStr() { + return nonceStr; + } + + public void setNonceStr(String nonceStr) { + this.nonceStr = nonceStr; + } + + public String getSign() { + return sign; + } + + public void setSign(String sign) { + this.sign = sign; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/request/QueryRefundRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/request/QueryRefundRequest.java new file mode 100644 index 0000000..fe57fbb --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/request/QueryRefundRequest.java @@ -0,0 +1,189 @@ +package com.jwsaas.pay.weixin.request; + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlAccessOrder; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorOrder; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +import com.thoughtworks.xstream.annotations.XStreamAlias; + +/** + * 查询退款请求参数 + */ +@XmlRootElement(name = "xml") +@XmlAccessorOrder(XmlAccessOrder.UNDEFINED) +@XmlAccessorType(XmlAccessType.NONE) +@XStreamAlias("xml") +public class QueryRefundRequest implements Serializable { + + private static final long serialVersionUID = 4109619776930478478L; + + /** + * 公众账号ID + * + * @描述 微信分配的公众账号ID(企业号corpid即为此appId) + * @示例值 wx8888888888888888 + */ + @XmlElement(name = "appid") + @XStreamAlias("appid") + private String appid; + + /** + * 商户号 + * + * @描述 微信支付分配的商户号 + * @示例值 1900000109 + */ + @XmlElement(name = "mch_id") + @XStreamAlias("mch_id") + private String mchId; + + /** + * 子商户号 + * + * @描述 微信支付分配的商户号 + * @示例值 1900000109 + */ + @XmlElement(name = "sub_mch_id") + @XStreamAlias("sub_mch_id") + private String subMchId; + + /** + * 随机字符串 + * + * @描述 随机字符串,不长于32位。推荐随机数生成算法 + * @示例值 5K8264ILTKCH16CQ2502SI8ZNMTM67VS + */ + @XmlElement(name = "nonce_str") + @XStreamAlias("nonce_str") + private String nonceStr; + + /** + * 签名 + * + * @描述 签名,详见签名生成算法 + * @示例值 C380BEC2BFD727A4B6845133519F3AD6 + */ + @XmlElement(name = "sign") + @XStreamAlias("sign") + private String sign; + + /** + * 微信订单号 + * + * @描述 终端设备号(门店号或收银设备ID),注意:PC网页或公众号内支付请传"WEB" + * @示例值 013467007045764 + */ + @XmlElement(name = "transaction_id") + @XStreamAlias("transaction_id") + private String transactionId; + + /** + * 商户订单号 + * + * @描述 商户系统内部的订单号,当没提供transaction_id时需要传这个。 + * @示例值 1217752501201407033233368018 + */ + @XmlElement(name = "out_trade_no") + @XStreamAlias("out_trade_no") + private String outTradeNo; + + /** + * 商户退款单号 + * + * @描述 商户系统内部的退款单号,商户系统内部唯一,同一退款单号多次请求只退一笔 + * @示例值 1217752501201407033233368018 + */ + @XmlElement(name = "out_refund_no") + @XStreamAlias("out_refund_no") + private String outRefundNo; + + /** + * 微信退款单号 + * + * @描述 微信退款单号 refund_id、out_refund_no、out_trade_no、transaction_id四个参数必填一个, + * 如果同时存在优先级为: refund_id>out_refund_no>transaction_id>out_trade_no + * + * @示例值 1217752501201407033233368018 + */ + @XmlElement(name = "refund_id") + @XStreamAlias("refund_id") + private String refundId; + + public String getAppid() { + return appid; + } + + public void setAppid(String appid) { + this.appid = appid; + } + + public String getMchId() { + return mchId; + } + + public void setMchId(String mchId) { + this.mchId = mchId; + } + + public String getSubMchId() { + return subMchId; + } + + public void setSubMchId(String subMchId) { + this.subMchId = subMchId; + } + + public String getNonceStr() { + return nonceStr; + } + + public void setNonceStr(String nonceStr) { + this.nonceStr = nonceStr; + } + + public String getSign() { + return sign; + } + + public void setSign(String sign) { + this.sign = sign; + } + + public String getTransactionId() { + return transactionId; + } + + public void setTransactionId(String transactionId) { + this.transactionId = transactionId; + } + + public String getOutTradeNo() { + return outTradeNo; + } + + public void setOutTradeNo(String outTradeNo) { + this.outTradeNo = outTradeNo; + } + + public String getOutRefundNo() { + return outRefundNo; + } + + public void setOutRefundNo(String outRefundNo) { + this.outRefundNo = outRefundNo; + } + + public String getRefundId() { + return refundId; + } + + public void setRefundId(String refundId) { + this.refundId = refundId; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/request/RefundRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/request/RefundRequest.java new file mode 100644 index 0000000..fadf439 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/request/RefundRequest.java @@ -0,0 +1,241 @@ +package com.jwsaas.pay.weixin.request; + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlAccessOrder; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorOrder; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +import com.thoughtworks.xstream.annotations.XStreamAlias; + +/** + * 申请退款请求参数 + */ +@XmlRootElement(name = "xml") +@XmlAccessorOrder(XmlAccessOrder.UNDEFINED) +@XmlAccessorType(XmlAccessType.NONE) +@XStreamAlias("xml") +public class RefundRequest implements Serializable { + + private static final long serialVersionUID = 4109619776930478478L; + + /** + * 公众账号ID + * + * @描述 微信分配的公众账号ID(企业号corpid即为此appId) + * @示例值 wx8888888888888888 + */ + @XmlElement(name = "appid") + @XStreamAlias("appid") + private String appid; + + /** + * 商户号 + * + * @描述 微信支付分配的商户号 + * @示例值 1900000109 + */ + @XmlElement(name = "mch_id") + @XStreamAlias("mch_id") + private String mchId; + + /** + * 子商户号 + * + * @描述 微信支付分配的商户号 + * @示例值 1900000109 + */ + @XmlElement(name = "sub_mch_id") + @XStreamAlias("sub_mch_id") + private String subMchId; + + /** + * 随机字符串 + * + * @描述 随机字符串,不长于32位。推荐随机数生成算法 + * @示例值 5K8264ILTKCH16CQ2502SI8ZNMTM67VS + */ + @XmlElement(name = "nonce_str") + @XStreamAlias("nonce_str") + private String nonceStr; + + /** + * 签名 + * + * @描述 签名,详见签名生成算法 + * @示例值 C380BEC2BFD727A4B6845133519F3AD6 + */ + @XmlElement(name = "sign") + @XStreamAlias("sign") + private String sign; + + /** + * 微信订单号 + * + * @描述 终端设备号(门店号或收银设备ID),注意:PC网页或公众号内支付请传"WEB" + * @示例值 013467007045764 + */ + @XmlElement(name = "transaction_id") + @XStreamAlias("transaction_id") + private String transactionId; + + /** + * 商户订单号 + * + * @描述 商户系统内部的订单号,当没提供transaction_id时需要传这个。 + * @示例值 1217752501201407033233368018 + */ + @XmlElement(name = "out_trade_no") + @XStreamAlias("out_trade_no") + private String outTradeNo; + + /** + * 商户退款单号 + * + * @描述 商户系统内部的退款单号,商户系统内部唯一,同一退款单号多次请求只退一笔 + * @示例值 1217752501201407033233368018 + */ + @XmlElement(name = "out_refund_no") + @XStreamAlias("out_refund_no") + private String outRefundNo; + + /** + * 总金额 + * + * @描述 订单总金额,单位为分,只能为整数,详见支付金额 + * @示例值 100 + */ + @XmlElement(name = "total_fee") + @XStreamAlias("total_fee") + private long totalFee; + + /** + * 退款金额 + * + * @描述 退款总金额,订单总金额,单位为分,只能为整数,详见支付金额 + * @示例值 100 + */ + @XmlElement(name = "refund_fee") + @XStreamAlias("refund_fee") + private long refundFee; + + /** + * 货币种类 + * + * @描述 货币类型,符合ISO 4217标准的三位字母代码,默认人民币:CNY,其他值列表详见货币类型 + * @示例值 CNY + */ + @XmlElement(name = "refund_fee_type") + @XStreamAlias("refund_fee_type") + private String refundFeeType; + + /** + * 操作员 + * + * @描述 操作员帐号, 默认为商户号 + * @示例值 1900000109 + */ + @XmlElement(name = "op_user_id") + @XStreamAlias("op_user_id") + private String opUserId; + + public String getAppid() { + return appid; + } + + public void setAppid(String appid) { + this.appid = appid; + } + + public String getMchId() { + return mchId; + } + + public void setMchId(String mchId) { + this.mchId = mchId; + } + + public String getSubMchId() { + return subMchId; + } + + public void setSubMchId(String subMchId) { + this.subMchId = subMchId; + } + + public String getNonceStr() { + return nonceStr; + } + + public void setNonceStr(String nonceStr) { + this.nonceStr = nonceStr; + } + + public String getSign() { + return sign; + } + + public void setSign(String sign) { + this.sign = sign; + } + + public String getTransactionId() { + return transactionId; + } + + public void setTransactionId(String transactionId) { + this.transactionId = transactionId; + } + + public String getOutTradeNo() { + return outTradeNo; + } + + public void setOutTradeNo(String outTradeNo) { + this.outTradeNo = outTradeNo; + } + + public String getOutRefundNo() { + return outRefundNo; + } + + public void setOutRefundNo(String outRefundNo) { + this.outRefundNo = outRefundNo; + } + + public long getTotalFee() { + return totalFee; + } + + public void setTotalFee(long totalFee) { + this.totalFee = totalFee; + } + + public long getRefundFee() { + return refundFee; + } + + public void setRefundFee(long refundFee) { + this.refundFee = refundFee; + } + + public String getRefundFeeType() { + return refundFeeType; + } + + public void setRefundFeeType(String refundFeeType) { + this.refundFeeType = refundFeeType; + } + + public String getOpUserId() { + return opUserId; + } + + public void setOpUserId(String opUserId) { + this.opUserId = opUserId; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/request/UnifiedOrderRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/request/UnifiedOrderRequest.java new file mode 100644 index 0000000..e72faca --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/request/UnifiedOrderRequest.java @@ -0,0 +1,441 @@ +package com.jwsaas.pay.weixin.request; + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlAccessOrder; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorOrder; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +import com.thoughtworks.xstream.annotations.XStreamAlias; + +/** + * 统一下单请求参数 + */ +@XmlRootElement(name = "xml") +@XmlAccessorOrder(XmlAccessOrder.UNDEFINED) +@XmlAccessorType(XmlAccessType.NONE) +@XStreamAlias("xml") +public class UnifiedOrderRequest implements Serializable { + + private static final long serialVersionUID = -8034625462040842562L; + + /** + * 公众账号ID + * + * @描述 微信分配的公众账号ID + * @示例值 wx8888888888888888 + */ + @XmlElement(name = "appid") + @XStreamAlias("appid") + private String appid; + + /** + * 商户号 + * + * @描述 微信支付分配的商户号 + * @示例值 1900000109 + */ + @XmlElement(name = "mch_id") + @XStreamAlias("mch_id") + private String mchId; + + /** + * 子商户公众账号ID + * + * @描述 微微信分配的子商户公众账号ID,如需在支付完成后获取sub_openid则此参数必传。 + * @示例值 wx8888888888888888 + */ + @XmlElement(name = "sub_appid") + @XStreamAlias("sub_appid") + private String subAppid; + + /** + * 子商户号 + * + * @描述 微信支付分配的子商户号 + * @示例值 1900000109 + */ + @XmlElement(name = "sub_mch_id") + @XStreamAlias("sub_mch_id") + private String subMchId; + + + /** + * 设备号 + * + * @描述 终端设备号(门店号或收银设备ID),注意:PC网页或公众号内支付请传"WEB" + * @示例值 013467007045764 + */ + @XmlElement(name = "device_info") + @XStreamAlias("device_info") + private String deviceInfo; + + /** + * 随机字符串 + * + * @描述 随机字符串,不长于32位。推荐随机数生成算法 + * @示例值 5K8264ILTKCH16CQ2502SI8ZNMTM67VS + */ + @XmlElement(name = "nonce_str") + @XStreamAlias("nonce_str") + private String nonceStr; + + /** + * 签名 + * + * @描述 签名,详见签名生成算法 + * @示例值 C380BEC2BFD727A4B6845133519F3AD6 + */ + @XmlElement(name = "sign") + @XStreamAlias("sign") + private String sign; + /** + * 商品描述 + * + * @描述 商品或支付单简要描述 + * @示例值 Ipad mini 16G 白色 + */ + @XmlElement(name = "body") + @XStreamAlias("body") + private String body; + + /** + * 商品详情 + * + * @描述 商品名称明细列表 + * @示例值 Ipad mini 16G 白色 + */ + @XmlElement(name = "detail") + @XStreamAlias("detail") + private String detail; + + /** + * 附加数据 + * + * @描述 附加数据,在查询API和支付通知中原样返回,该字段主要用于商户携带订单的自定义数据 + * @示例值 说明 + */ + @XmlElement(name = "attach") + @XStreamAlias("attach") + private String attach; + + /** + * 商户订单号 + * + * @描述 商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号 + * @示例值 1217752501201407033233368018 + */ + @XmlElement(name = "out_trade_no") + @XStreamAlias("out_trade_no") + private String outTradeNo; + + /** + * 货币类型 + * + * @描述 符合ISO 4217标准的三位字母代码,默认人民币:CNY,其他值列表详见货币类型 + * @示例值 CNY + */ + @XmlElement(name = "fee_type") + @XStreamAlias("fee_type") + private String feeType; + + /** + * 总金额 + * + * @描述 订单总金额,只能为整数,详见支付金额 + * @示例值 888 + */ + @XmlElement(name = "total_fee") + @XStreamAlias("total_fee") + private long totalFee; + + /** + * 终端IP + * + * @描述 APP和网页支付提交用户端ip,Native支付填调用微信支付API的机器IP。 + * @示例值 8.8.8.8 + */ + @XmlElement(name = "spbill_create_ip") + @XStreamAlias("spbill_create_ip") + private String spbillCreateIp; + + /** + * 交易起始时间 + * + * @描述 订单生成时间,格式为yyyyMMddHHmmss,如2009年12月25日9点10分10秒表示为20091225091010。 + * 其他详见时间规则 + * @示例值 20091225091010 + */ + @XmlElement(name = "time_start") + @XStreamAlias("time_start") + private String timeStart; + + /** + * 交易结束时间 + * + * @描述 订单失效时间,格式为yyyyMMddHHmmss,如2009年12月27日9点10分10秒表示为20091227091010。 + * 其他详见时间规则 注意:最短失效时间间隔必须大于5分钟 + * @示例值 20091227091010 + */ + @XmlElement(name = "time_expire") + @XStreamAlias("time_expire") + private String timeExpire; + /** + * 商品标记 + * + * @描述 商品标记,代金券或立减优惠功能的参数,说明详见代金券或立减优惠 + * @示例值 WXG + */ + @XmlElement(name = "goods_tag") + @XStreamAlias("goods_tag") + private String goodsTag; + + /** + * 通知地址 + * + * @描述 接收微信支付异步通知回调地址 + * @示例值 http://www.baidu.com + */ + @XmlElement(name = "notify_url") + @XStreamAlias("notify_url") + private String notifyUrl; + /** + * 交易类型 + * + * @描述 取值如下:JSAPI,NATIVE,APP,WAP,详细说明见参数规定 + * @示例值 JSAPI + */ + @XmlElement(name = "trade_type") + @XStreamAlias("trade_type") + private String tradeType; + + /** + * 商品ID + * + * @描述 trade_type=NATIVE,此参数必传。此id为二维码中包含的商品ID,商户自行定义。 + * @示例值 12235413214070356458058 + */ + @XmlElement(name = "product_id") + @XStreamAlias("product_id") + private String productId; + + /** + * 指定支付方式 + * + * @描述 no_credit--指定不能使用信用卡支付 + * @示例值 20091225091010 + */ + @XmlElement(name = "limit_pay") + @XStreamAlias("limit_pay") + private String limitPay; + + /** + * 用户标识 + * + * @描述 trade_type=JSAPI,此参数必传,用户在商户appid下的唯一标识。openid如何获取,可参考【获取openid】。 + * + * @示例值 oUpF8uMuAJO_M2pxb1Q9zNjWeS6o + */ + @XmlElement(name = "openid") + @XStreamAlias("openid") + private String openid; + + /** + * 用户子标识 + * + * @描述 trade_type=JSAPI,此参数必传,用户在商户appid下的唯一标识。openid如何获取,可参考【获取openid】。 + * + * @示例值 oUpF8uMuAJO_M2pxb1Q9zNjWeS6o + */ + @XmlElement(name = "sub_openid") + @XStreamAlias("sub_openid") + private String subOpenid; + + public String getAppid() { + return appid; + } + + public void setAppid(String appid) { + this.appid = appid; + } + + public String getMchId() { + return mchId; + } + + public void setMchId(String mchId) { + this.mchId = mchId; + } + + public String getSubAppid() { + return subAppid; + } + + public void setSubAppid(String subAppid) { + this.subAppid = subAppid; + } + + public String getSubMchId() { + return subMchId; + } + + public void setSubMchId(String subMchId) { + this.subMchId = subMchId; + } + + public String getDeviceInfo() { + return deviceInfo; + } + + public void setDeviceInfo(String deviceInfo) { + this.deviceInfo = deviceInfo; + } + + public String getNonceStr() { + return nonceStr; + } + + public void setNonceStr(String nonceStr) { + this.nonceStr = nonceStr; + } + + public String getSign() { + return sign; + } + + public void setSign(String sign) { + this.sign = sign; + } + + public String getBody() { + return body; + } + + public void setBody(String body) { + this.body = body; + } + + public String getDetail() { + return detail; + } + + public void setDetail(String detail) { + this.detail = detail; + } + + public String getAttach() { + return attach; + } + + public void setAttach(String attach) { + this.attach = attach; + } + + public String getOutTradeNo() { + return outTradeNo; + } + + public void setOutTradeNo(String outTradeNo) { + this.outTradeNo = outTradeNo; + } + + public String getFeeType() { + return feeType; + } + + public void setFeeType(String feeType) { + this.feeType = feeType; + } + + public long getTotalFee() { + return totalFee; + } + + public void setTotalFee(long totalFee) { + this.totalFee = totalFee; + } + + public String getSpbillCreateIp() { + return spbillCreateIp; + } + + public void setSpbillCreateIp(String spbillCreateIp) { + this.spbillCreateIp = spbillCreateIp; + } + + public String getTimeStart() { + return timeStart; + } + + public void setTimeStart(String timeStart) { + this.timeStart = timeStart; + } + + public String getTimeExpire() { + return timeExpire; + } + + public void setTimeExpire(String timeExpire) { + this.timeExpire = timeExpire; + } + + public String getGoodsTag() { + return goodsTag; + } + + public void setGoodsTag(String goodsTag) { + this.goodsTag = goodsTag; + } + + public String getNotifyUrl() { + return notifyUrl; + } + + public void setNotifyUrl(String notifyUrl) { + this.notifyUrl = notifyUrl; + } + + public String getTradeType() { + return tradeType; + } + + public void setTradeType(String tradeType) { + this.tradeType = tradeType; + } + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId; + } + + public String getLimitPay() { + return limitPay; + } + + public void setLimitPay(String limitPay) { + this.limitPay = limitPay; + } + + public String getOpenid() { + return openid; + } + + public void setOpenid(String openid) { + this.openid = openid; + } + + public String getSubOpenid() { + return subOpenid; + } + + public void setSubOpenid(String subOpenid) { + this.subOpenid = subOpenid; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/response/PayNotifyResponse.java b/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/response/PayNotifyResponse.java new file mode 100644 index 0000000..78268b9 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/response/PayNotifyResponse.java @@ -0,0 +1,65 @@ +package com.jwsaas.pay.weixin.response; + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlAccessOrder; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorOrder; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +import com.thoughtworks.xstream.annotations.XStreamAlias; + +/** + * 支付结果通用通知返回结果 + * + * @author 张莹 + */ +@XmlRootElement(name = "xml") +@XmlAccessorOrder(XmlAccessOrder.UNDEFINED) +@XmlAccessorType(XmlAccessType.NONE) +@XmlType +@XStreamAlias("xml") +public class PayNotifyResponse implements Serializable { + + private static final long serialVersionUID = 4109619776930478478L; + + /** + * 返回状态码 + * + * @描述 SUCCESS/FAIL 此字段是通信标识,非交易标识,交易是否成功需要查看result_code来判断 + * @示例值 SUCCESS + */ + @XmlElement(name="return_code") + @XStreamAlias("return_code") + private String returnCode; + + /** + * 返回信息 + * + * @描述 返回信息,如非空,为错误原因(签名失败,参数格式校验错误) + * @示例值 签名失败 + */ + @XmlElement(name="return_msg") + @XStreamAlias("return_msg") + private String returnMsg; + + public String getReturnCode() { + return returnCode; + } + + public void setReturnCode(String returnCode) { + this.returnCode = returnCode; + } + + public String getReturnMsg() { + return returnMsg; + } + + public void setReturnMsg(String returnMsg) { + this.returnMsg = returnMsg; + } + +} \ No newline at end of file diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/response/QueryOrderResponse.java b/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/response/QueryOrderResponse.java new file mode 100644 index 0000000..f2fc606 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/response/QueryOrderResponse.java @@ -0,0 +1,591 @@ +package com.jwsaas.pay.weixin.response; + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlAccessOrder; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorOrder; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +import com.thoughtworks.xstream.annotations.XStreamAlias; + +/** + * 查询订单返回结果 + */ +@XmlRootElement(name = "xml") +@XmlAccessorOrder(XmlAccessOrder.UNDEFINED) +@XmlAccessorType(XmlAccessType.NONE) +@XmlType +@XStreamAlias("xml") +public class QueryOrderResponse implements Serializable { + + private static final long serialVersionUID = 4109619776930478478L; + + /** + * 返回状态码 + * + * @描述 SUCCESS/FAIL 此字段是通信标识,非交易标识,交易是否成功需要查看result_code来判断 + * @示例值 SUCCESS + */ + @XmlElement(name = "return_code") + @XStreamAlias("return_code") + private String returnCode; + + /** + * 返回信息 + * + * @描述 返回信息,如非空,为错误原因(签名失败,参数格式校验错误) + * @示例值 签名失败 + */ + @XmlElement(name = "return_msg") + @XStreamAlias("return_msg") + private String returnMsg; + + // 以下字段在return_code为SUCCESS的时候有返回 + + /** + * 公众账号ID + * + * @描述 调用接口提交的公众账号ID + * @示例值 wx8888888888888888 + */ + @XmlElement(name = "appid") + @XStreamAlias("appid") + private String appid; + + /** + * 商户号 + * + * @描述 调用接口提交的商户号 + * @示例值 1900000109 + */ + @XmlElement(name = "mch_id") + @XStreamAlias("mch_id") + private String mchId; + + /** + * 子商户公众账号ID + * + * @描述 微微信分配的子商户公众账号ID,如需在支付完成后获取sub_openid则此参数必传。 + * @示例值 wx8888888888888888 + */ + @XmlElement(name = "sub_appid") + @XStreamAlias("sub_appid") + private String subAppid; + + /** + * 子商户号 + * + * @描述 微信支付分配的商户号 + * @示例值 1900000109 + */ + @XmlElement(name = "sub_mch_id") + @XStreamAlias("sub_mch_id") + private String subMchId; + + /** + * 随机字符串 + * + * @描述 微信返回的随机字符串 + * @示例值 5K8264ILTKCH16CQ2502SI8ZNMTM67VS + */ + @XmlElement(name = "nonce_str") + @XStreamAlias("nonce_str") + private String nonceStr; + + /** + * 签名 + * + * @描述 微信返回的签名,详见签名算法 + * @示例值 C380BEC2BFD727A4B6845133519F3AD6 + */ + @XmlElement(name = "sign") + @XStreamAlias("sign") + private String sign; + + /** + * 业务结果 + * + * @描述 SUCCESS/FAIL + * @示例值 SUCCESS + */ + @XmlElement(name = "result_code") + @XStreamAlias("result_code") + private String resultCode; + + /** + * 错误代码 + * + * @描述 详细参见第6节错误列表 + * @示例值 SYSTEMERROR + */ + @XmlElement(name = "err_code") + @XStreamAlias("err_code") + private String errCode; + + /** + * 错误代码描述 + * + * @描述 错误返回的信息描述 + * @示例值 系统错误 + */ + @XmlElement(name = "err_code_des") + @XStreamAlias("err_code_des") + private String errCodeDes; + + // 以下字段在return_code 和result_code都为SUCCESS的时候有返回 + + /** + * 设备号 + * + * @描述 微信支付分配的终端设备号 + * @示例值 013467007045764 + */ + @XmlElement(name = "device_info") + @XStreamAlias("device_info") + private String deviceInfo; + + /** + * 用户标识 + * + * @描述 用户在商户appid下的唯一标识 + * @示例值 wxd930ea5d5a258f4f + */ + @XmlElement(name = "openid") + @XStreamAlias("openid") + private String openid; + + /** + * 用户子标识 + * + * @描述 trade_type=JSAPI,此参数必传,用户在商户appid下的唯一标识。openid如何获取,可参考【获取openid】。 + * + * @示例值 oUpF8uMuAJO_M2pxb1Q9zNjWeS6o + */ + @XmlElement(name = "sub_openid") + @XStreamAlias("sub_openid") + private String subOpenid; + + /** + * 是否关注公众账号 + * + * @描述 用户是否关注公众账号,Y-关注,N-未关注,仅在公众账号类型支付有效 + * @示例值 Y + */ + @XmlElement(name = "is_subscribe") + @XStreamAlias("is_subscribe") + private String isSubscribe; + + /** + * 是否关注子公众账号 + * + * @描述 用户是否关注公众账号,Y-关注,N-未关注,仅在公众账号类型支付有效 + * @示例值 Y + */ + @XmlElement(name = "sub_is_subscribe") + @XStreamAlias("sub_is_subscribe") + private String subIsSubscribe; + + /** + * 交易类型 + * + * @描述 调用接口提交的交易类型,取值如下:JSAPI,NATIVE,APP,详细说明见参数规定 + * @示例值 NATIVE + */ + @XmlElement(name = "trade_type") + @XStreamAlias("trade_type") + private String tradeType; + + /** + * 交易状态 + * + * @描述 + *
    + *
  • SUCCESS—支付成功
  • + *
  • REFUND—转入退款
  • + *
  • NOTPAY—未支付
  • + *
  • REVOKED—已撤销(刷卡支付)
  • + *
  • USERPAYING--用户支付中
  • + *
  • PAYERROR--支付失败(其他原因,如银行返回失败)
  • + *
  • CLOSED—已关闭
  • + *
+ * @示例值 SUCCESS + */ + @XmlElement(name = "trade_state") + @XStreamAlias("trade_state") + private String tradeState; + + /** + * 交易状态描述 + * + * @描述 对当前查询订单状态的描述和下一步操作的指引 + * @示例值 支付失败,请重新下单支付 + */ + @XmlElement(name = "trade_state_desc") + @XStreamAlias("trade_state_desc") + private String tradeStateDesc; + + /** + * 付款银行 + * + * @描述 银行类型,采用字符串类型的银行标识 + * @示例值 CMC + */ + @XmlElement(name = "bank_type") + @XStreamAlias("bank_type") + private String bankType; + + /** + * 总金额 + * + * @描述 订单总金额,单位为分 + * @示例值 100 + */ + @XmlElement(name = "total_fee") + @XStreamAlias("total_fee") + private long totalFee; + + /** + * 货币种类 + * + * @描述 货币类型,符合ISO 4217标准的三位字母代码,默认人民币:CNY,其他值列表详见货币类型 + * @示例值 CNY + */ + @XmlElement(name = "fee_type") + @XStreamAlias("fee_type") + private String feeType; + + /** + * 现金支付金额 + * + * @描述 现金支付金额订单现金支付金额,详见支付金额 + * @示例值 100 + */ + @XmlElement(name = "cash_fee") + @XStreamAlias("cash_fee") + private long cashFee; + + /** + * 现金支付货币类型 + * + * @描述 货币类型,符合ISO 4217标准的三位字母代码,默认人民币:CNY,其他值列表详见货币类型 + * @示例值 CNY + */ + @XmlElement(name = "cash_fee_type") + @XStreamAlias("cash_fee_type") + private String cashFeeType; + + /** + * 代金券或立减优惠金额 + * + * @描述 “代金券或立减优惠”金额<=订单总金额,订单总金额-“代金券或立减优惠”金额=现金支付金额,详见支付金额 + * @示例值 100 + */ + @XmlElement(name = "coupon_fee") + @XStreamAlias("coupon_fee") + private long couponFee; + + /** + * 代金券或立减优惠使用数量 + * + * @描述 代金券或立减优惠使用数量 + * @示例值 1 + */ + @XmlElement(name = "coupon_count") + @XStreamAlias("coupon_count") + private long couponCount; + + /** + * 微信支付订单号 + * + * @描述 微信支付订单号 + * @示例值 1217752501201407033233368018 + */ + @XmlElement(name = "transaction_id") + @XStreamAlias("transaction_id") + private String transactionId; + + /** + * 商户订单号 + * + * @描述 商户系统的订单号,与请求一致。 + * @示例值 1217752501201407033233368018 + */ + @XmlElement(name = "out_trade_no") + @XStreamAlias("out_trade_no") + private String outTradeNo; + + /** + * 商家数据包 + * + * @描述 商家数据包,原样返回 + * @示例值 123456 + */ + @XmlElement(name = "attach") + @XStreamAlias("attach") + private String attach; + + /** + * 支付完成时间 + * + * @描述 订单支付时间,格式为yyyyMMddHHmmss,如2009年12月25日9点10分10秒表示为20091225091010。 + * 其他详见时间规则 + * @示例值 20141030133525 + */ + @XmlElement(name = "time_end") + @XStreamAlias("time_end") + private String timeEnd; + + public String getReturnCode() { + return returnCode; + } + + public void setReturnCode(String returnCode) { + this.returnCode = returnCode; + } + + public String getReturnMsg() { + return returnMsg; + } + + public void setReturnMsg(String returnMsg) { + this.returnMsg = returnMsg; + } + + public String getAppid() { + return appid; + } + + public void setAppid(String appid) { + this.appid = appid; + } + + public String getMchId() { + return mchId; + } + + public void setMchId(String mchId) { + this.mchId = mchId; + } + + public String getSubAppid() { + return subAppid; + } + + public void setSubAppid(String subAppid) { + this.subAppid = subAppid; + } + + public String getSubMchId() { + return subMchId; + } + + public void setSubMchId(String subMchId) { + this.subMchId = subMchId; + } + + public String getNonceStr() { + return nonceStr; + } + + public void setNonceStr(String nonceStr) { + this.nonceStr = nonceStr; + } + + public String getSign() { + return sign; + } + + public void setSign(String sign) { + this.sign = sign; + } + + public String getResultCode() { + return resultCode; + } + + public void setResultCode(String resultCode) { + this.resultCode = resultCode; + } + + public String getErrCode() { + return errCode; + } + + public void setErrCode(String errCode) { + this.errCode = errCode; + } + + public String getErrCodeDes() { + return errCodeDes; + } + + public void setErrCodeDes(String errCodeDes) { + this.errCodeDes = errCodeDes; + } + + public String getDeviceInfo() { + return deviceInfo; + } + + public void setDeviceInfo(String deviceInfo) { + this.deviceInfo = deviceInfo; + } + + public String getOpenid() { + return openid; + } + + public void setOpenid(String openid) { + this.openid = openid; + } + + public String getSubOpenid() { + return subOpenid; + } + + public void setSubOpenid(String subOpenid) { + this.subOpenid = subOpenid; + } + + public String getIsSubscribe() { + return isSubscribe; + } + + public void setIsSubscribe(String isSubscribe) { + this.isSubscribe = isSubscribe; + } + + public String getSubIsSubscribe() { + return subIsSubscribe; + } + + public void setSubIsSubscribe(String subIsSubscribe) { + this.subIsSubscribe = subIsSubscribe; + } + + public String getTradeType() { + return tradeType; + } + + public void setTradeType(String tradeType) { + this.tradeType = tradeType; + } + + public String getTradeState() { + return tradeState; + } + + public void setTradeState(String tradeState) { + this.tradeState = tradeState; + } + + public String getTradeStateDesc() { + return tradeStateDesc; + } + + public void setTradeStateDesc(String tradeStateDesc) { + this.tradeStateDesc = tradeStateDesc; + } + + public String getBankType() { + return bankType; + } + + public void setBankType(String bankType) { + this.bankType = bankType; + } + + public long getTotalFee() { + return totalFee; + } + + public void setTotalFee(long totalFee) { + this.totalFee = totalFee; + } + + public String getFeeType() { + return feeType; + } + + public void setFeeType(String feeType) { + this.feeType = feeType; + } + + public long getCashFee() { + return cashFee; + } + + public void setCashFee(long cashFee) { + this.cashFee = cashFee; + } + + public String getCashFeeType() { + return cashFeeType; + } + + public void setCashFeeType(String cashFeeType) { + this.cashFeeType = cashFeeType; + } + + public long getCouponFee() { + return couponFee; + } + + public void setCouponFee(long couponFee) { + this.couponFee = couponFee; + } + + public long getCouponCount() { + return couponCount; + } + + public void setCouponCount(long couponCount) { + this.couponCount = couponCount; + } + + public String getTransactionId() { + return transactionId; + } + + public void setTransactionId(String transactionId) { + this.transactionId = transactionId; + } + + public String getOutTradeNo() { + return outTradeNo; + } + + public void setOutTradeNo(String outTradeNo) { + this.outTradeNo = outTradeNo; + } + + public String getAttach() { + return attach; + } + + public void setAttach(String attach) { + this.attach = attach; + } + + public String getTimeEnd() { + return timeEnd; + } + + public void setTimeEnd(String timeEnd) { + this.timeEnd = timeEnd; + } + + @Override + public String toString() { + return "QueryOrderResponse [returnCode=" + returnCode + ", returnMsg=" + returnMsg + ", appid=" + appid + ", mchId=" + mchId + ", nonceStr=" + nonceStr + ", sign=" + sign + ", resultCode=" + + resultCode + ", errCode=" + errCode + ", errCodeDes=" + errCodeDes + ", deviceInfo=" + deviceInfo + ", openid=" + openid + ", isSubscribe=" + isSubscribe + ", tradeType=" + tradeType + + ", tradeState=" + tradeState + ", tradeStateDesc=" + tradeStateDesc + ", bankType=" + bankType + ", totalFee=" + totalFee + ", feeType=" + feeType + ", cashFee=" + cashFee + + ", cashFeeType=" + cashFeeType + ", couponFee=" + couponFee + ", couponCount=" + couponCount + ", transactionId=" + transactionId + ", outTradeNo=" + outTradeNo + ", attach=" + + attach + ", timeEnd=" + timeEnd + "]"; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/response/QueryRefundResponse.java b/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/response/QueryRefundResponse.java new file mode 100644 index 0000000..e5caa55 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/response/QueryRefundResponse.java @@ -0,0 +1,458 @@ +package com.jwsaas.pay.weixin.response; + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlAccessOrder; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorOrder; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +import com.thoughtworks.xstream.annotations.XStreamAlias; + +/** + * 查询退款返回结果 + */ +@XmlRootElement(name = "xml") +@XmlAccessorOrder(XmlAccessOrder.UNDEFINED) +@XmlAccessorType(XmlAccessType.NONE) +@XmlType +@XStreamAlias("xml") +public class QueryRefundResponse implements Serializable { + + private static final long serialVersionUID = 4109619776930478478L; + + /** + * 返回状态码 + * + * @描述 SUCCESS/FAIL 此字段是通信标识,非交易标识,交易是否成功需要查看result_code来判断 + * @示例值 SUCCESS + */ + @XmlElement(name = "return_code") + @XStreamAlias("return_code") + private String returnCode; + + /** + * 返回信息 + * + * @描述 返回信息,如非空,为错误原因(签名失败,参数格式校验错误) + * @示例值 签名失败 + */ + @XmlElement(name = "return_msg") + @XStreamAlias("return_msg") + private String returnMsg; + + // 以下字段在return_code为SUCCESS的时候有返回 + + /** + * 公众账号ID + * + * @描述 调用接口提交的公众账号ID + * @示例值 wx8888888888888888 + */ + @XmlElement(name = "appid") + @XStreamAlias("appid") + private String appid; + + /** + * 商户号 + * + * @描述 调用接口提交的商户号 + * @示例值 1900000109 + */ + @XmlElement(name = "mch_id") + @XStreamAlias("mch_id") + private String mchId; + + /** + * 随机字符串 + * + * @描述 微信返回的随机字符串 + * @示例值 5K8264ILTKCH16CQ2502SI8ZNMTM67VS + */ + @XmlElement(name = "nonce_str") + @XStreamAlias("nonce_str") + private String nonceStr; + + /** + * 签名 + * + * @描述 微信返回的签名,详见签名算法 + * @示例值 C380BEC2BFD727A4B6845133519F3AD6 + */ + @XmlElement(name = "sign") + @XStreamAlias("sign") + private String sign; + + /** + * 业务结果 + * + * @描述 SUCCESS/FAIL + * @示例值 SUCCESS + */ + @XmlElement(name = "result_code") + @XStreamAlias("result_code") + private String resultCode; + + /** + * 错误代码 + * + * @描述 详细参见第6节错误列表 + * @示例值 SYSTEMERROR + */ + @XmlElement(name = "err_code") + @XStreamAlias("err_code") + private String errCode; + + /** + * 错误代码描述 + * + * @描述 错误返回的信息描述 + * @示例值 系统错误 + */ + @XmlElement(name = "err_code_des") + @XStreamAlias("err_code_des") + private String errCodeDes; + + // 以下字段在return_code 和result_code都为SUCCESS的时候有返回 + + /** + * 设备号 + * + * @描述 微信支付分配的终端设备号 + * @示例值 013467007045764 + */ + @XmlElement(name = "device_info") + @XStreamAlias("device_info") + private String deviceInfo; + + /** + * 微信支付订单号 + * + * @描述 微信支付订单号 + * @示例值 1217752501201407033233368018 + */ + @XmlElement(name = "transaction_id") + @XStreamAlias("transaction_id") + private String transactionId; + + /** + * 商户订单号 + * + * @描述 商户系统的订单号,与请求一致。 + * @示例值 1217752501201407033233368018 + */ + @XmlElement(name = "out_trade_no") + @XStreamAlias("out_trade_no") + private String outTradeNo; + + /** + * 订单总金额 + * + * @描述 订单总金额,单位为分,只能为整数,详见支付金额 + * + * @示例值 100 + */ + @XmlElement(name = "total_fee") + @XStreamAlias("total_fee") + private long totalFee; + + /** + * 订单金额货币种类 + * + * @描述 订单金额货币类型,符合ISO 4217标准的三位字母代码,默认人民币:CNY,其他值列表详见货币类型 + * + * @示例值 CNY + */ + @XmlElement(name = "fee_type") + @XStreamAlias("fee_type") + private String feeType; + + /** + * 现金支付金额 + * + * @描述 现金支付金额,单位为分,只能为整数,详见支付金额 + * + * @示例值 100 + */ + @XmlElement(name = "cash_fee") + @XStreamAlias("cash_fee") + private long cashFee; + + /** + * 退款笔数 + * + * @描述 退款记录数 + * + * @示例值 1 + */ + @XmlElement(name = "refund_count") + @XStreamAlias("refund_count") + private long refundCount; + + /** + * 商户退款单号 + */ + @XmlElement(name = "out_refund_no_0") + @XStreamAlias("out_refund_no_0") + private String outRefundNo; + + /** + * 微信退款单号 + */ + @XmlElement(name = "refund_id_0") + @XStreamAlias("refund_id_0") + private String refundId; + + /** + * 退款渠道 + */ + @XmlElement(name = "refund_channel_0") + @XStreamAlias("refund_channel_0") + private String refundChannel; + + /** + * 申请退款金额 + */ + @XmlElement(name = "refund_fee_0") + @XStreamAlias("refund_fee_0") + private long refundFee; + + /** + * 退款金额 + */ + @XmlElement(name = "settlement_refund_fee_0") + @XStreamAlias("settlement_refund_fee_0") + private long settlementRefundFee; + + /** + * 退款状态 + */ + @XmlElement(name = "refund_status_0") + @XStreamAlias("refund_status_0") + private String refundStatus; + + /** + * 退款资金来源 + */ + @XmlElement(name = "refund_account_0") + @XStreamAlias("refund_account_0") + private String refundAccount; + + /** + * 退款入账账户 + */ + @XmlElement(name = "refund_recv_accout_0") + @XStreamAlias("refund_recv_accout_0") + private String refundRecvAccout; + + /** + * 退款成功时间 + */ + @XmlElement(name = "refund_success_time_0") + @XStreamAlias("refund_success_time_0") + private String refundSuccessTime; + + public String getReturnCode() { + return returnCode; + } + + public void setReturnCode(String returnCode) { + this.returnCode = returnCode; + } + + public String getReturnMsg() { + return returnMsg; + } + + public void setReturnMsg(String returnMsg) { + this.returnMsg = returnMsg; + } + + public String getAppid() { + return appid; + } + + public void setAppid(String appid) { + this.appid = appid; + } + + public String getMchId() { + return mchId; + } + + public void setMchId(String mchId) { + this.mchId = mchId; + } + + public String getNonceStr() { + return nonceStr; + } + + public void setNonceStr(String nonceStr) { + this.nonceStr = nonceStr; + } + + public String getSign() { + return sign; + } + + public void setSign(String sign) { + this.sign = sign; + } + + public String getResultCode() { + return resultCode; + } + + public void setResultCode(String resultCode) { + this.resultCode = resultCode; + } + + public String getErrCode() { + return errCode; + } + + public void setErrCode(String errCode) { + this.errCode = errCode; + } + + public String getErrCodeDes() { + return errCodeDes; + } + + public void setErrCodeDes(String errCodeDes) { + this.errCodeDes = errCodeDes; + } + + public String getDeviceInfo() { + return deviceInfo; + } + + public void setDeviceInfo(String deviceInfo) { + this.deviceInfo = deviceInfo; + } + + public String getTransactionId() { + return transactionId; + } + + public void setTransactionId(String transactionId) { + this.transactionId = transactionId; + } + + public String getOutTradeNo() { + return outTradeNo; + } + + public void setOutTradeNo(String outTradeNo) { + this.outTradeNo = outTradeNo; + } + + public long getTotalFee() { + return totalFee; + } + + public void setTotalFee(long totalFee) { + this.totalFee = totalFee; + } + + public String getFeeType() { + return feeType; + } + + public void setFeeType(String feeType) { + this.feeType = feeType; + } + + public long getCashFee() { + return cashFee; + } + + public void setCashFee(long cashFee) { + this.cashFee = cashFee; + } + + public long getRefundCount() { + return refundCount; + } + + public void setRefundCount(long refundCount) { + this.refundCount = refundCount; + } + + public String getOutRefundNo() { + return outRefundNo; + } + + public void setOutRefundNo(String outRefundNo) { + this.outRefundNo = outRefundNo; + } + + public String getRefundId() { + return refundId; + } + + public void setRefundId(String refundId) { + this.refundId = refundId; + } + + public String getRefundChannel() { + return refundChannel; + } + + public void setRefundChannel(String refundChannel) { + this.refundChannel = refundChannel; + } + + public long getRefundFee() { + return refundFee; + } + + public void setRefundFee(long refundFee) { + this.refundFee = refundFee; + } + + public long getSettlementRefundFee() { + return settlementRefundFee; + } + + public void setSettlementRefundFee(long settlementRefundFee) { + this.settlementRefundFee = settlementRefundFee; + } + + public String getRefundStatus() { + return refundStatus; + } + + public void setRefundStatus(String refundStatus) { + this.refundStatus = refundStatus; + } + + public String getRefundAccount() { + return refundAccount; + } + + public void setRefundAccount(String refundAccount) { + this.refundAccount = refundAccount; + } + + public String getRefundRecvAccout() { + return refundRecvAccout; + } + + public void setRefundRecvAccout(String refundRecvAccout) { + this.refundRecvAccout = refundRecvAccout; + } + + public String getRefundSuccessTime() { + return refundSuccessTime; + } + + public void setRefundSuccessTime(String refundSuccessTime) { + this.refundSuccessTime = refundSuccessTime; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/response/RefundResponse.java b/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/response/RefundResponse.java new file mode 100644 index 0000000..c89ee9d --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/response/RefundResponse.java @@ -0,0 +1,463 @@ +package com.jwsaas.pay.weixin.response; + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlAccessOrder; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorOrder; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +import com.thoughtworks.xstream.annotations.XStreamAlias; + +/** + * 申请退款返回结果 + */ +@XmlRootElement(name = "xml") +@XmlAccessorOrder(XmlAccessOrder.UNDEFINED) +@XmlAccessorType(XmlAccessType.NONE) +@XmlType +@XStreamAlias("xml") +public class RefundResponse implements Serializable { + + private static final long serialVersionUID = 4109619776930478478L; + + /** + * 返回状态码 + * + * @描述 SUCCESS/FAIL 此字段是通信标识,非交易标识,交易是否成功需要查看result_code来判断 + * @示例值 SUCCESS + */ + @XmlElement(name = "return_code") + @XStreamAlias("return_code") + private String returnCode; + + /** + * 返回信息 + * + * @描述 返回信息,如非空,为错误原因(签名失败,参数格式校验错误) + * @示例值 签名失败 + */ + @XmlElement(name = "return_msg") + @XStreamAlias("return_msg") + private String returnMsg; + + // 以下字段在return_code为SUCCESS的时候有返回 + + /** + * 公众账号ID + * + * @描述 调用接口提交的公众账号ID + * @示例值 wx8888888888888888 + */ + @XmlElement(name = "appid") + @XStreamAlias("appid") + private String appid; + + /** + * 商户号 + * + * @描述 调用接口提交的商户号 + * @示例值 1900000109 + */ + @XmlElement(name = "mch_id") + @XStreamAlias("mch_id") + private String mchId; + + /** + * 随机字符串 + * + * @描述 微信返回的随机字符串 + * @示例值 5K8264ILTKCH16CQ2502SI8ZNMTM67VS + */ + @XmlElement(name = "nonce_str") + @XStreamAlias("nonce_str") + private String nonceStr; + + /** + * 签名 + * + * @描述 微信返回的签名,详见签名算法 + * @示例值 C380BEC2BFD727A4B6845133519F3AD6 + */ + @XmlElement(name = "sign") + @XStreamAlias("sign") + private String sign; + + /** + * 业务结果 + * + * @描述 SUCCESS/FAIL + * @示例值 SUCCESS + */ + @XmlElement(name = "result_code") + @XStreamAlias("result_code") + private String resultCode; + + /** + * 错误代码 + * + * @描述 详细参见第6节错误列表 + * @示例值 SYSTEMERROR + */ + @XmlElement(name = "err_code") + @XStreamAlias("err_code") + private String errCode; + + /** + * 错误代码描述 + * + * @描述 错误返回的信息描述 + * @示例值 系统错误 + */ + @XmlElement(name = "err_code_des") + @XStreamAlias("err_code_des") + private String errCodeDes; + + // 以下字段在return_code 和result_code都为SUCCESS的时候有返回 + + /** + * 设备号 + * + * @描述 微信支付分配的终端设备号 + * @示例值 013467007045764 + */ + @XmlElement(name = "device_info") + @XStreamAlias("device_info") + private String deviceInfo; + + /** + * 微信支付订单号 + * + * @描述 微信支付订单号 + * @示例值 1217752501201407033233368018 + */ + @XmlElement(name = "transaction_id") + @XStreamAlias("transaction_id") + private String transactionId; + + /** + * 商户订单号 + * + * @描述 商户系统的订单号,与请求一致。 + * @示例值 1217752501201407033233368018 + */ + @XmlElement(name = "out_trade_no") + @XStreamAlias("out_trade_no") + private String outTradeNo; + + /** + * 商户退款单号 + * + * @描述 商户退款单号 + * @示例值 1217752501201407033233368018 + */ + @XmlElement(name = "out_refund_no") + @XStreamAlias("out_refund_no") + private String outRefundNo; + + /** + * 微信退款单号 + * + * @描述 微信退款单号 + * @示例值 1217752501201407033233368018 + */ + @XmlElement(name = "refund_id") + @XStreamAlias("refund_id") + private String refundId; + + /** + * 退款渠道 + * + * @描述 ORIGINAL—原路退款 BALANCE—退回到余额 + * + * @示例值 ORIGINAL + */ + @XmlElement(name = "refund_channel") + @XStreamAlias("refund_channel") + private String refundChannel; + + /** + * 退款金额 + * + * @描述 退款总金额,单位为分,可以做部分退款 + * + * @示例值 100 + */ + @XmlElement(name = "refund_fee") + @XStreamAlias("refund_fee") + private long refundFee; + + /** + * 订单总金额 + * + * @描述 订单总金额,单位为分,只能为整数,详见支付金额 + * + * @示例值 100 + */ + @XmlElement(name = "total_fee") + @XStreamAlias("total_fee") + private long totalFee; + + /** + * 订单金额货币种类 + * + * @描述 订单金额货币类型,符合ISO 4217标准的三位字母代码,默认人民币:CNY,其他值列表详见货币类型 + * + * @示例值 CNY + */ + @XmlElement(name = "fee_type") + @XStreamAlias("fee_type") + private String feeType; + + /** + * 现金支付金额 + * + * @描述 现金支付金额,单位为分,只能为整数,详见支付金额 + * + * @示例值 100 + */ + @XmlElement(name = "cash_fee") + @XStreamAlias("cash_fee") + private long cashFee; + + /** + * 现金退款金额 + * + * @描述 现金退款金额,单位为分,只能为整数,详见支付金额 + * + * @示例值 100 + */ + @XmlElement(name = "cash_refund_fee") + @XStreamAlias("cash_refund_fee") + private long cashRefundFee; + + /** + * 代金券或立减优惠退款金额 + * + * @描述 代金券或立减优惠退款金额=订单金额-现金退款金额,注意:立减优惠金额不会退回 + * + * @示例值 100 + */ + @XmlElement(name = "coupon_refund_fee") + @XStreamAlias("coupon_refund_fee") + private long couponRefundFee; + + /** + * 代金券或立减优惠使用数量 + * + * @描述 代金券或立减优惠使用数量 + * + * @示例值 1 + */ + @XmlElement(name = "coupon_refund_count") + @XStreamAlias("coupon_refund_count") + private long couponRefundCount; + + /** + * 代金券或立减优惠ID + * + * @描述 代金券或立减优惠ID + * + * @示例值 10000 + */ + @XmlElement(name = "coupon_refund_id") + @XStreamAlias("coupon_refund_id") + private String couponRefundId; + + public String getReturnCode() { + return returnCode; + } + + public void setReturnCode(String returnCode) { + this.returnCode = returnCode; + } + + public String getReturnMsg() { + return returnMsg; + } + + public void setReturnMsg(String returnMsg) { + this.returnMsg = returnMsg; + } + + public String getAppid() { + return appid; + } + + public void setAppid(String appid) { + this.appid = appid; + } + + public String getMchId() { + return mchId; + } + + public void setMchId(String mchId) { + this.mchId = mchId; + } + + public String getNonceStr() { + return nonceStr; + } + + public void setNonceStr(String nonceStr) { + this.nonceStr = nonceStr; + } + + public String getSign() { + return sign; + } + + public void setSign(String sign) { + this.sign = sign; + } + + public String getResultCode() { + return resultCode; + } + + public void setResultCode(String resultCode) { + this.resultCode = resultCode; + } + + public String getErrCode() { + return errCode; + } + + public void setErrCode(String errCode) { + this.errCode = errCode; + } + + public String getErrCodeDes() { + return errCodeDes; + } + + public void setErrCodeDes(String errCodeDes) { + this.errCodeDes = errCodeDes; + } + + public String getDeviceInfo() { + return deviceInfo; + } + + public void setDeviceInfo(String deviceInfo) { + this.deviceInfo = deviceInfo; + } + + public String getTransactionId() { + return transactionId; + } + + public void setTransactionId(String transactionId) { + this.transactionId = transactionId; + } + + public String getOutTradeNo() { + return outTradeNo; + } + + public void setOutTradeNo(String outTradeNo) { + this.outTradeNo = outTradeNo; + } + + public String getOutRefundNo() { + return outRefundNo; + } + + public void setOutRefundNo(String outRefundNo) { + this.outRefundNo = outRefundNo; + } + + public String getRefundId() { + return refundId; + } + + public void setRefundId(String refundId) { + this.refundId = refundId; + } + + public String getRefundChannel() { + return refundChannel; + } + + public void setRefundChannel(String refundChannel) { + this.refundChannel = refundChannel; + } + + public long getRefundFee() { + return refundFee; + } + + public void setRefundFee(long refundFee) { + this.refundFee = refundFee; + } + + public long getTotalFee() { + return totalFee; + } + + public void setTotalFee(long totalFee) { + this.totalFee = totalFee; + } + + public String getFeeType() { + return feeType; + } + + public void setFeeType(String feeType) { + this.feeType = feeType; + } + + public long getCashFee() { + return cashFee; + } + + public void setCashFee(long cashFee) { + this.cashFee = cashFee; + } + + public long getCashRefundFee() { + return cashRefundFee; + } + + public void setCashRefundFee(long cashRefundFee) { + this.cashRefundFee = cashRefundFee; + } + + public long getCouponRefundFee() { + return couponRefundFee; + } + + public void setCouponRefundFee(long couponRefundFee) { + this.couponRefundFee = couponRefundFee; + } + + public long getCouponRefundCount() { + return couponRefundCount; + } + + public void setCouponRefundCount(long couponRefundCount) { + this.couponRefundCount = couponRefundCount; + } + + public String getCouponRefundId() { + return couponRefundId; + } + + public void setCouponRefundId(String couponRefundId) { + this.couponRefundId = couponRefundId; + } + + @Override + public String toString() { + return "RefundResponse [returnCode=" + returnCode + ", returnMsg=" + returnMsg + ", appid=" + appid + ", mchId=" + mchId + ", nonceStr=" + nonceStr + ", sign=" + sign + ", resultCode=" + + resultCode + ", errCode=" + errCode + ", errCodeDes=" + errCodeDes + ", deviceInfo=" + deviceInfo + ", transactionId=" + transactionId + ", outTradeNo=" + outTradeNo + + ", outRefundNo=" + outRefundNo + ", refundId=" + refundId + ", refundChannel=" + refundChannel + ", refundFee=" + refundFee + ", totalFee=" + totalFee + ", feeType=" + feeType + + ", cashFee=" + cashFee + ", cashRefundFee=" + cashRefundFee + ", couponRefundFee=" + couponRefundFee + ", couponRefundCount=" + couponRefundCount + ", couponRefundId=" + + couponRefundId + "]"; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/response/UnifiedOrderResponse.java b/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/response/UnifiedOrderResponse.java new file mode 100644 index 0000000..87cea7e --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/response/UnifiedOrderResponse.java @@ -0,0 +1,305 @@ +package com.jwsaas.pay.weixin.response; + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlAccessOrder; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorOrder; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +import com.thoughtworks.xstream.annotations.XStreamAlias; + +/** + * 统一下单返回结果 + */ +@XmlRootElement(name = "xml") +@XmlAccessorOrder(XmlAccessOrder.UNDEFINED) +@XmlAccessorType(XmlAccessType.NONE) +@XmlType +@XStreamAlias("xml") +public class UnifiedOrderResponse implements Serializable { + + private static final long serialVersionUID = -5280995823376844204L; + + /** + * 返回状态码 + * + * @描述 SUCCESS/FAIL 此字段是通信标识,非交易标识,交易是否成功需要查看result_code来判断 + * @示例值 SUCCESS + */ + @XmlElement(name = "return_code") + @XStreamAlias("return_code") + private String returnCode; + + /** + * 返回信息 + * + * @描述 返回信息,如非空,为错误原因(签名失败,参数格式校验错误) + * @示例值 签名失败 + */ + @XmlElement(name = "return_msg") + @XStreamAlias("return_msg") + private String returnMsg; + + // 以下字段在return_code为SUCCESS的时候有返回 + + /** + * 公众账号ID + * + * @描述 调用接口提交的公众账号ID + * @示例值 wx8888888888888888 + */ + @XmlElement(name = "appid") + @XStreamAlias("appid") + private String appid; + + /** + * 商户号 + * + * @描述 调用接口提交的商户号 + * @示例值 1900000109 + */ + @XmlElement(name = "mch_id") + @XStreamAlias("mch_id") + private String mchId; + + /** + * 子商户公众账号ID + * + * @描述 微微信分配的子商户公众账号ID,如需在支付完成后获取sub_openid则此参数必传。 + * @示例值 wx8888888888888888 + */ + @XmlElement(name = "sub_appid") + @XStreamAlias("sub_appid") + private String subAppid; + + /** + * 子商户号 + * + * @描述 微信支付分配的子商户号 + * @示例值 1900000109 + */ + @XmlElement(name = "sub_mch_id") + @XStreamAlias("sub_mch_id") + private String subMchId; + + /** + * 设备号 + * + * @描述 调用接口提交的终端设备号 + * @示例值 013467007045764 + */ + @XmlElement(name = "device_info") + @XStreamAlias("device_info") + private String deviceInfo; + + /** + * 随机字符串 + * + * @描述 微信返回的随机字符串 + * @示例值 5K8264ILTKCH16CQ2502SI8ZNMTM67VS + */ + @XmlElement(name = "nonce_str") + @XStreamAlias("nonce_str") + private String nonceStr; + + /** + * 签名 + * + * @描述 微信返回的签名,详见签名算法 + * @示例值 C380BEC2BFD727A4B6845133519F3AD6 + */ + @XmlElement(name = "sign") + @XStreamAlias("sign") + private String sign; + + /** + * 业务结果 + * + * @描述 SUCCESS/FAIL + * @示例值 SUCCESS + */ + @XmlElement(name = "result_code") + @XStreamAlias("result_code") + private String resultCode; + + /** + * 错误代码 + * + * @描述 详细参见第6节错误列表 + * @示例值 SYSTEMERROR + */ + @XmlElement(name = "err_code") + @XStreamAlias("err_code") + private String errCode; + + /** + * 错误代码描述 + * + * @描述 错误返回的信息描述 + * @示例值 系统错误 + */ + @XmlElement(name = "err_code_des") + @XStreamAlias("err_code_des") + private String errCodeDes; + + // 以下字段在return_code 和result_code都为SUCCESS的时候有返回 + + /** + * 交易类型 + * + * @描述 调用接口提交的交易类型,取值如下:JSAPI,NATIVE,APP,详细说明见参数规定 + * @示例值 NATIVE + */ + @XmlElement(name = "trade_type") + @XStreamAlias("trade_type") + private String tradeType; + + /** + * 预支付交易会话标识 + * + * @描述 微信生成的预支付回话标识,用于后续接口调用中使用,该值有效期为2小时 + * @示例值 wx201410272009395522657a690389285100 + */ + @XmlElement(name = "prepay_id") + @XStreamAlias("prepay_id") + private String prepayId; + + /** + * 二维码链接 + * + * @描述 trade_type为NATIVE是有返回,可将该参数值生成二维码展示出来进行扫码支付 + * @示例值 URl:weixin://wxpay/s/An4baqw + */ + @XmlElement(name = "code_url") + @XStreamAlias("code_url") + private String codeUrl; + + public String getReturnCode() { + return returnCode; + } + + public void setReturnCode(String returnCode) { + this.returnCode = returnCode; + } + + public String getReturnMsg() { + return returnMsg; + } + + public void setReturnMsg(String returnMsg) { + this.returnMsg = returnMsg; + } + + public String getAppid() { + return appid; + } + + public void setAppid(String appid) { + this.appid = appid; + } + + public String getMchId() { + return mchId; + } + + public void setMchId(String mchId) { + this.mchId = mchId; + } + + public String getSubAppid() { + return subAppid; + } + + public void setSubAppid(String subAppid) { + this.subAppid = subAppid; + } + + public String getSubMchId() { + return subMchId; + } + + public void setSubMchId(String subMchId) { + this.subMchId = subMchId; + } + + public String getDeviceInfo() { + return deviceInfo; + } + + public void setDeviceInfo(String deviceInfo) { + this.deviceInfo = deviceInfo; + } + + public String getNonceStr() { + return nonceStr; + } + + public void setNonceStr(String nonceStr) { + this.nonceStr = nonceStr; + } + + public String getSign() { + return sign; + } + + public void setSign(String sign) { + this.sign = sign; + } + + public String getResultCode() { + return resultCode; + } + + public void setResultCode(String resultCode) { + this.resultCode = resultCode; + } + + public String getErrCode() { + return errCode; + } + + public void setErrCode(String errCode) { + this.errCode = errCode; + } + + public String getErrCodeDes() { + return errCodeDes; + } + + public void setErrCodeDes(String errCodeDes) { + this.errCodeDes = errCodeDes; + } + + public String getTradeType() { + return tradeType; + } + + public void setTradeType(String tradeType) { + this.tradeType = tradeType; + } + + public String getPrepayId() { + return prepayId; + } + + public void setPrepayId(String prepayId) { + this.prepayId = prepayId; + } + + public String getCodeUrl() { + return codeUrl; + } + + public void setCodeUrl(String codeUrl) { + this.codeUrl = codeUrl; + } + + @Override + public String toString() { + return "UnifiedOrderResponse [returnCode=" + returnCode + ", returnMsg=" + returnMsg + ", appid=" + appid + ", mchId=" + mchId + ", deviceInfo=" + deviceInfo + ", nonceStr=" + nonceStr + ", sign=" + sign + ", resultCode=" + resultCode + ", errCode=" + errCode + ", errCodeDes=" + errCodeDes + ", tradeType=" + tradeType + ", prepayId=" + prepayId + ", codeUrl=" + codeUrl + "]"; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/utils/SecurityUtils.java b/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/utils/SecurityUtils.java new file mode 100644 index 0000000..4c0c963 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/pay/weixin/utils/SecurityUtils.java @@ -0,0 +1,54 @@ +package com.jwsaas.pay.weixin.utils; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +import javax.xml.bind.annotation.XmlElement; + +import com.jwsaas.util.DigestUtils; +import com.jwsaas.util.ReflectionUtils; + +public class SecurityUtils { + + /** + * 签名算法 + */ + public static String sign(String key, Object obj) { + Field[] fields = obj.getClass().getDeclaredFields(); + StringBuilder sb = new StringBuilder(); + List params = new ArrayList(); + + for (Field field : fields) { + if (field.isAnnotationPresent(XmlElement.class)) { + String name = field.getAnnotation(XmlElement.class).name(); + Object value = null; + try { + value = ReflectionUtils.invokeGetterMethod(obj, field.getName()); + } catch (Exception e) { + // TO NOTHING + } + if (value != null) { + params.add(name + "=" + value + "&"); + } + } + } + Collections.sort(params, new Comparator() { + + @Override + public int compare(String o1, String o2) { + return o1.compareTo(o2); + } + + }); + for (String param : params) { + sb.append(param); + } + sb.append("key=").append(key); + + return DigestUtils.MD5(sb.toString()).toUpperCase(); + } + +} \ No newline at end of file diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/properties/ApplicationProperties.java b/food-open/food-open-api/src/main/java/com/jwsaas/properties/ApplicationProperties.java new file mode 100644 index 0000000..7660284 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/properties/ApplicationProperties.java @@ -0,0 +1,75 @@ +package com.jwsaas.properties; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +@Component +public class ApplicationProperties { + + @Value("${application.name}") + private String name; + + @Value("${application.owner}") + private String owner; + + @Value("${application.sign}") + private String sign; + + @Value("${application.description}") + private String description; + + @Value("${application.index}") + private int index; + + @Value("${appauth.callcount.skip}") + private Boolean callCountTaskSkip; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getOwner() { + return owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getSign() { + return sign; + } + + public void setSign(String sign) { + this.sign = sign; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public int getIndex() { + return index; + } + + public void setIndex(int index) { + this.index = index; + } + + public Boolean getCallCountTaskSkip() { + return callCountTaskSkip; + } + + public void setCallCountTaskSkip(Boolean callCountTaskSkip) { + this.callCountTaskSkip = callCountTaskSkip; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/properties/BaiduhProperties.java b/food-open/food-open-api/src/main/java/com/jwsaas/properties/BaiduhProperties.java new file mode 100644 index 0000000..ee9076e --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/properties/BaiduhProperties.java @@ -0,0 +1,33 @@ +package com.jwsaas.properties; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +@Component +public class BaiduhProperties { + + // 百度地图ak + @Value("${baidu.api.v4.ak}") + private String baiduV4ak; + + // 百度地图表Id + @Value("${baidu.api.v4.geoTableId}") + private String bakduTableId; + + public String getBaiduV4ak() { + return baiduV4ak; + } + + public void setBaiduV4ak(String baiduV4ak) { + this.baiduV4ak = baiduV4ak; + } + + public String getBakduTableId() { + return bakduTableId; + } + + public void setBakduTableId(String bakduTableId) { + this.bakduTableId = bakduTableId; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/properties/CandaoProperties.java b/food-open/food-open-api/src/main/java/com/jwsaas/properties/CandaoProperties.java new file mode 100644 index 0000000..9d680f5 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/properties/CandaoProperties.java @@ -0,0 +1,20 @@ +package com.jwsaas.properties; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +@Component +public class CandaoProperties { + + // 微信支付异步通知地址 + @Value("${candao.waimai.dispatch.url}") + private String candaoDispatchUrl; + + public String getCandaoDispatchUrl() { + return candaoDispatchUrl; + } + + public void setCandaoDispatchUrl(String candaoDispatchUrl) { + this.candaoDispatchUrl = candaoDispatchUrl; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/properties/FdfsClientProperties.java b/food-open/food-open-api/src/main/java/com/jwsaas/properties/FdfsClientProperties.java new file mode 100644 index 0000000..ac1baf8 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/properties/FdfsClientProperties.java @@ -0,0 +1,20 @@ +package com.jwsaas.properties; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +@Component +public class FdfsClientProperties { + + @Value("${fastdfs.client.access_domain}") + private String accessDomain; + + public String getAccessDomain() { + return accessDomain; + } + + public void setAccessDomain(String accessDomain) { + this.accessDomain = accessDomain; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/properties/RedisProperties.java b/food-open/food-open-api/src/main/java/com/jwsaas/properties/RedisProperties.java new file mode 100644 index 0000000..d508b5e --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/properties/RedisProperties.java @@ -0,0 +1,99 @@ +package com.jwsaas.properties; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +@ConfigurationProperties(prefix = "redis") +public class RedisProperties { + + private String type; + private String host; + private String port; + private String password; + private Integer database; + private Integer timeout; + private Integer poolMaxIdle; + private Integer poolMinIdle; + private Integer poolMaxActive; + private Integer poolMaxWait; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getHost() { + return host; + } + + public void setHost(String host) { + this.host = host; + } + + public String getPort() { + return port; + } + + public void setPort(String port) { + this.port = port; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public Integer getDatabase() { + return database; + } + + public void setDatabase(Integer database) { + this.database = database; + } + + public Integer getTimeout() { + return timeout; + } + + public void setTimeout(Integer timeout) { + this.timeout = timeout; + } + + public Integer getPoolMaxIdle() { + return poolMaxIdle; + } + + public void setPoolMaxIdle(Integer poolMaxIdle) { + this.poolMaxIdle = poolMaxIdle; + } + + public Integer getPoolMinIdle() { + return poolMinIdle; + } + + public void setPoolMinIdle(Integer poolMinIdle) { + this.poolMinIdle = poolMinIdle; + } + + public Integer getPoolMaxActive() { + return poolMaxActive; + } + + public void setPoolMaxActive(Integer poolMaxActive) { + this.poolMaxActive = poolMaxActive; + } + + public Integer getPoolMaxWait() { + return poolMaxWait; + } + + public void setPoolMaxWait(Integer poolMaxWait) { + this.poolMaxWait = poolMaxWait; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/properties/SaoBeiPayProperties.java b/food-open/food-open-api/src/main/java/com/jwsaas/properties/SaoBeiPayProperties.java new file mode 100644 index 0000000..f168182 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/properties/SaoBeiPayProperties.java @@ -0,0 +1,33 @@ +package com.jwsaas.properties; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +@Component +public class SaoBeiPayProperties { + + // 微信支付异步通知地址 + @Value("${saobeipay.wxnotify.url}") + private String apiUrl; + + // 微信支付异步通知地址 + @Value("${saobeipay.programnotify.url}") + private String apiProgramUrl; + + public String getApiUrl() { + return apiUrl; + } + + public void setApiUrl(String apiUrl) { + this.apiUrl = apiUrl; + } + + public String getApiProgramUrl() { + return apiProgramUrl; + } + + public void setApiProgramUrl(String apiProgramUrl) { + this.apiProgramUrl = apiProgramUrl; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/properties/TongLianPayProperties.java b/food-open/food-open-api/src/main/java/com/jwsaas/properties/TongLianPayProperties.java new file mode 100644 index 0000000..6abe260 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/properties/TongLianPayProperties.java @@ -0,0 +1,43 @@ +package com.jwsaas.properties; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +@Component +public class TongLianPayProperties { + + // 微信支付异步通知地址 + @Value("${tonglianpay.wxnotify.url}") + private String apiUrl; + + // 微信支付异步通知地址 + @Value("${tonglianpay.programnotify.url}") + private String apiProgramUrl; + + @Value("${tonglian.signalagentPayotify}") + private String signalagentPayotifyUrl; + + public String getApiUrl() { + return apiUrl; + } + + public void setApiUrl(String apiUrl) { + this.apiUrl = apiUrl; + } + + public String getApiProgramUrl() { + return apiProgramUrl; + } + + public void setApiProgramUrl(String apiProgramUrl) { + this.apiProgramUrl = apiProgramUrl; + } + + public String getSignalagentPayotifyUrl() { + return signalagentPayotifyUrl; + } + + public void setSignalagentPayotifyUrl(String signalagentPayotifyUrl) { + this.signalagentPayotifyUrl = signalagentPayotifyUrl; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/properties/WeiXinProperties.java b/food-open/food-open-api/src/main/java/com/jwsaas/properties/WeiXinProperties.java new file mode 100644 index 0000000..947125d --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/properties/WeiXinProperties.java @@ -0,0 +1,20 @@ +package com.jwsaas.properties; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +@Component +public class WeiXinProperties { + + @Value("${weixin.oauth.center.url}") + private String oauthCenterUrl; + + public String getOauthCenterUrl() { + return oauthCenterUrl; + } + + public void setOauthCenterUrl(String oauthCenterUrl) { + this.oauthCenterUrl = oauthCenterUrl; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/properties/WxyhProperties.java b/food-open/food-open-api/src/main/java/com/jwsaas/properties/WxyhProperties.java new file mode 100644 index 0000000..a009b43 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/properties/WxyhProperties.java @@ -0,0 +1,21 @@ +package com.jwsaas.properties; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +@Component +public class WxyhProperties { + + // 微信支付异步通知地址 + @Value("${wxyh.api.v2.wxnotify.url}") + private String apiUrl; + + public String getApiUrl() { + return apiUrl; + } + + public void setApiUrl(String apiUrl) { + this.apiUrl = apiUrl; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/properties/ZgxcProperties.java b/food-open/food-open-api/src/main/java/com/jwsaas/properties/ZgxcProperties.java new file mode 100644 index 0000000..9cae980 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/properties/ZgxcProperties.java @@ -0,0 +1,20 @@ +package com.jwsaas.properties; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +@Component +public class ZgxcProperties { + + @Value("${zgcx.api.v2.url}") + private String apiUrl; + + public String getApiUrl() { + return apiUrl; + } + + public void setApiUrl(String apiUrl) { + this.apiUrl = apiUrl; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/quartz/SchedulerTack.java b/food-open/food-open-api/src/main/java/com/jwsaas/quartz/SchedulerTack.java new file mode 100644 index 0000000..c01cdc4 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/quartz/SchedulerTack.java @@ -0,0 +1,186 @@ +package com.jwsaas.quartz; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.jwsaas.TlData; +import com.jwsaas.TlReturnMsg; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.SplitShopAccount; +import com.jwsaas.entity.food.SplitStorePay; +import com.jwsaas.entity.tl.member.SingalAgentPay; +import com.jwsaas.pager.Pager; +import com.jwsaas.service.food.SplitShopAccountService; +import com.jwsaas.tonglian.TlHttpClient; +import com.jwsaas.util.KeyIdUtil; +import com.jwsaas.utils.PropertiesUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.BeansException; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.scheduling.annotation.Scheduled; +import reactor.spring.context.annotation.Consumer; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @Author 37962 + * @Date 2023/12/25 + */ +@Configuration +@EnableScheduling + +public class SchedulerTack implements ApplicationContextAware { + protected Logger logger = LoggerFactory.getLogger(getClass()); + private static ApplicationContext context; + @Resource + private com.jwsaas.service.food.SplitStorePayService splitStorePayService; + @Resource + private SplitShopAccountService splitShopAccountService; + + /** + * 自动分帐定时任务 + */ + // @Scheduled(cron = "0 30 22 * * ?") // 每天22点30分执行一次 + @Scheduled(cron = "0 45 11 * * ?") // 每天22点30分执行一次 + private void process(){ + Map result = null; + String info = "订单分帐"; + logger.info("divide.order" + info); + try { + Date newdate=new Date(); + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); + String datestr=sdf.format(newdate); + //查询所有未分帐记录 + Criteria criter = new Criteria(); + criter.add(Restrictions.ge("payDate", newdate+" 00:00:00")); + criter.add(Restrictions.le("payDate", newdate+" 23:59:59")); + criter.add(Restrictions.eq("isInvalid",0)); + criter.add(Restrictions.eq("payTypeNo","50")); + // List payModeList = splitStorePayService.getSplitStorePayList(criter); + Pager payPModeList = splitStorePayService.getSplitOrderPager(null,criter,null); + List payModeList= (List) payPModeList.getList(); + + for (SplitStorePay splitStorePay : payModeList) { + String json = JSON.toJSONString(splitStorePay); + logger.debug("单笔托管代付:" + "(" + json + ")"); + if (splitStorePay != null) { + int isInvalid = splitStorePay.getIsInvalid();//是否生效 1是0否 + if (isInvalid == 1) { + logger.info("该订单已分帐,分帐失败" + splitStorePay.getId()); + } else { + //订单类型 堂食 = 0,外带 = 1,电话外卖 = 2,餐桌 = 3,美团外卖 = 4,饿了么 = 5,百度外卖 = 6,微信点餐 = 7 + String tenantId=splitStorePay.getTenantId(); + String orderType = splitStorePay.getOrderType(); + String storeId = splitStorePay.getStoreId(); + Double paid = splitStorePay.getPaid();//实收金额 + long fee = splitStorePay.getFee();//手续费 + int isRefund = splitStorePay.getIsRefund();//是否有退款 0否 1有 + Double refundAmount = splitStorePay.getRefundAmount();//退款金额 + String payTyepNo=splitStorePay.getPayTypeNo(); + String id=splitStorePay.getId(); + if("50".equals(payTyepNo)) {//通联支付 + BigDecimal bpaid = new BigDecimal(paid); + BigDecimal brefundAmount = new BigDecimal(refundAmount); + int flag = bpaid.compareTo(brefundAmount); + if (flag == 0) {//相等 + logger.info("分帐失败,退款金额和实收金额相等" + splitStorePay.getId()); + } else if (flag == 1) {//大于 + String splitStoreId = splitStorePay.getSplitStoreId();//分店ID + SplitShopAccount account = splitShopAccountService.get(tenantId, splitStoreId); + String backUrl = PropertiesUtil.getValue("config.properties", "tonglian.signalagentPayotify"); + String bizUserId=account.getBizUserId(); + BigDecimal pidb = bpaid.subtract(brefundAmount); + BigDecimal b100 = new BigDecimal(100); + BigDecimal bigDecimal = pidb.multiply(b100).setScale(0, RoundingMode.HALF_UP); + long moneyValue = bigDecimal.longValue(); + SingalAgentPay pay = new SingalAgentPay(); + //String bizOrderNo = "tl-" + System.currentTimeMillis(); + String bizOrderNo = "tl-" + KeyIdUtil.getUniqueKey(""); + if ("7".equals(orderType)) { + pay.setBizOrderNo(bizOrderNo); + final JSONArray tranlist = new JSONArray(); + final HashMap trandetail1 = new HashMap<>(); + trandetail1.put("bizOrderNo", splitStorePay.getBusNo()); + trandetail1.put("amount", moneyValue); + tranlist.add(trandetail1); + String stranlist = JSON.toJSONString(tranlist); + pay.setCollectPayList(stranlist); + pay.setBizUserId(bizUserId); + pay.setBackUrl(backUrl); + pay.setAmount(moneyValue); + pay.setFee(fee); + pay.setTradeCode("3001"); + logger.error("租户编号_门店ID_订单号" + tenantId + "_" + storeId + "_" + id); + pay.setRemark(tenantId + "_" + storeId + "_" + id); + } else if ("0".equals(orderType) || "1".equals(orderType) || "3".equals(orderType)) { + String fromBizUserId = splitStorePay.getFromBizUserId(); + pay.setBizOrderNo(bizOrderNo); + final JSONArray tranlist = new JSONArray(); + final HashMap trandetail1 = new HashMap<>(); + trandetail1.put("bizOrderNo", splitStorePay.getBusNo()); + trandetail1.put("amount", moneyValue); + tranlist.add(trandetail1); + String stranlist = JSON.toJSONString(tranlist); + pay.setCollectPayList(stranlist); + pay.setBizUserId(fromBizUserId); + pay.setBackUrl(backUrl); + pay.setAmount(moneyValue); + pay.setFee((long) 0); + if(bizUserId.equals(fromBizUserId)==false){ + final JSONArray splitRuleList = new JSONArray(); + final HashMap splitRuletail1 = new HashMap<>(); + splitRuletail1.put("bizUserId", bizUserId); + splitRuletail1.put("amount", moneyValue); + splitRuletail1.put("fee", fee); + splitRuletail1.put("remark", ""); + splitRuleList.add(splitRuletail1); + pay.setSplitRuleList(splitRuleList); + } + pay.setTradeCode("3001"); + logger.error("租户编号_门店ID_订单号" + tenantId + "_" + storeId + "_" + id); + pay.setRemark(tenantId + "_" + storeId + "_" + id); + } + String jsonpay = JSON.toJSONString(pay); + logger.error("单笔托管代付param:" + jsonpay); + String content = TlHttpClient.post("order.signalAgentPay", pay); + System.out.println("单笔托管代付content:" + content); + TlReturnMsg msg = JSON.parseObject(content, TlReturnMsg.class); + String subCode = msg.getSubCode(); + String subMsg = msg.getMsg(); + if ("OK".equals(subCode)) { + String tldata = msg.getData(); + TlData dataa = JSON.parseObject(tldata, TlData.class); + splitStorePay.setBizOrderNo(bizOrderNo); + splitStorePayService.update(tenantId, splitStorePay); + logger.info("操作成功"); + } else if ("FAIL".equals(subCode)) { + logger.info("分帐失败,"+ subMsg); + } + } else { + logger.info("分帐失败,退款金额大于实收金额"); + } + } + } + } + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + @Override + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { + context=applicationContext; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/BaseEvents.java b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/BaseEvents.java new file mode 100644 index 0000000..a96fca2 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/BaseEvents.java @@ -0,0 +1,19 @@ +package com.jwsaas.reactor.event; + +import org.redisson.api.RedissonClient; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +import reactor.bus.EventBus; + +public class BaseEvents { + + protected final Logger logger = LoggerFactory.getLogger(this.getClass()); + + @Autowired + protected EventBus eventBus; + @Autowired + protected RedissonClient redissonClient; + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/BaseWxdcEvents.java b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/BaseWxdcEvents.java new file mode 100644 index 0000000..c37296f --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/BaseWxdcEvents.java @@ -0,0 +1,119 @@ +package com.jwsaas.reactor.event; + +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; + +import com.jwsaas.Constant; +import com.jwsaas.Constants; +import com.jwsaas.entity.wxdc.WeixinUser; +import com.jwsaas.mqtt.MqttClientExt; +import com.jwsaas.util.CardApiUtils; +import com.jwsaas.util.DateUtils; +import com.jwsaas.util.JSONUtil; + +public class BaseWxdcEvents extends BaseEvents{ + + @Autowired + private com.jwsaas.cache.CacheService cacheService; + @Autowired + private MqttClientExt mqttClient; + @Autowired + private com.jwsaas.service.wxdc.WeixinUserService weixinUserService; + + @Autowired + protected CardApiUtils cardApiUtils; + + /** + * 微信点餐订单状态变化,消息中心发布消息 + */ + protected void sendMessage(String appSign, String tenantId, String erpStoreId) throws Exception { + String info = "微信点餐订单状态变化,消息中心发布消息"; + logger.debug(">>>>>>>" + info + "。。。"); + Map orderIds = (Map) cacheService.get(tenantId, "weixin_" + erpStoreId); + String ids = ""; + for (Map.Entry entry : orderIds.entrySet()) { + ids = ids + entry.getKey() + ","; + } + if (ids.length() > 0) { + ids = ids.substring(0, ids.length() - 1); + } + Map order = new HashMap<>(); + order.put("weixin", ids); + order.put("date", DateUtils.format(new Date(), DateUtils.SHOW_DATETIME_FORMAT)); + mqttClient.Publish("weixin/" + appSign + "/" + tenantId + "/" + erpStoreId, JSONUtil.toJSONString(order)); + logger.error(">>>>>>>" + info + "。。。end"); + } + + /** + * 发送消息给C端用户 + * 3:取消 ,4: 接单,5:退单 ,6:拒单 + */ + protected void sendMessageToUser(String topic, Map notifyData) throws Exception { + String payload = JSONUtil.toJSONString(notifyData); + logger.debug("--->payload:" + payload); + mqttClient.Publish(topic, payload); + } + + /** + * 获取用户信息 + */ + protected WeixinUser getWeixinUser(String tenantId, String memberId) { + String info = "获取用户信息[" + tenantId + "," + memberId + "]"; + WeixinUser weixinUser = null; + try { + weixinUser = weixinUserService.get(Constant.DEFAULT_DB_SIGN, memberId); + } catch (Exception e) { + logger.error(info + ",发生异常", e); + } + return weixinUser; + } + + /** + * 微信点餐订单状态变化,Cache操作
+ *

+ * 订单状态: 0-等待付款;1-已支付;2-已退单;3-已取消;4-商家已确认;5-已完成;
+ *

+ * + * @param tenantId + * @param erpStoreId + * @param orderId + * @param action + * 1-新订单;2-用户取消;3-商家5分钟不处理,超时自动取消;4-商家取消(拒单);5-商家确认(接单);6-用户申请退款;7-商家拒绝退款;8-商家同意退款; + * @throws Exception + */ + protected void orderStatusNotify(String tenantId, String erpStoreId, String orderId, int action) throws Exception { + String info = "微信点餐订单状态变化,Cache操作"; + logger.debug(">>>>>>>" + info + "。。。"); + String appSign = Constants.APP_TYPE_SIGN; + logger.error(">>>>>>>" + info + ">>>>>>订单ID:"+orderId+">>>>操作类型:"+action); + if (action == 1 || action == 6) { + // 待处理订单发消息 + Map orderIds = (Map) cacheService.get(tenantId, "weixin_" + erpStoreId); + if (orderIds != null) { + orderIds.put(orderId, orderId); + cacheService.set(tenantId, "weixin_" + erpStoreId, orderIds, 3600); + } else { + orderIds = new HashMap<>(); + orderIds.put(orderId, orderId); + cacheService.set(tenantId, "weixin_" + erpStoreId, orderIds, 3600); + } + } else { + // 清除redis + Object weixinOrderIds = cacheService.get(tenantId, "weixin_" + erpStoreId); + if (weixinOrderIds != null) { + Map orderIds = (Map) cacheService.get(tenantId, "weixin_" + erpStoreId); + orderIds.remove(orderId); + cacheService.set(tenantId, "weixin_" + erpStoreId, orderIds, 3600); + } else { + Map orderIds = new HashMap<>(); + cacheService.set(tenantId, "weixin_" + erpStoreId, orderIds, 3600); + } + } + sendMessage(appSign, tenantId, erpStoreId); + logger.error(">>>>>>>" + info + "。。。end"); + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/BusinessHandoverEvents.java b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/BusinessHandoverEvents.java new file mode 100644 index 0000000..3c27cb3 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/BusinessHandoverEvents.java @@ -0,0 +1,214 @@ +package com.jwsaas.reactor.event; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; + +import com.jwsaas.Constant; +import com.jwsaas.StoreAccountBusType; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.DispatchSettlePlan; +import com.jwsaas.entity.food.DispatchSettlePlanPayMode; +import com.jwsaas.entity.food.StoreAccount; +import com.jwsaas.entity.food.StoreAccountDetail; +import com.jwsaas.entity.food.StoreHandover; +import com.jwsaas.entity.food.StoreHandoverDetailPay; +import com.jwsaas.util.JSONUtil; +import com.jwsaas.utils.MathUtil; + +import reactor.bus.Event; +import reactor.spring.context.annotation.Consumer; +import reactor.spring.context.annotation.Selector; + +@Consumer +public class BusinessHandoverEvents extends BaseEvents { + + @Resource + private com.jwsaas.service.food.StoreService storeService; + @Resource + private com.jwsaas.service.food.DispatchSettlePlanService dispatchSettlePlanService; + @Resource + private com.jwsaas.service.food.DispatchSettlePlanPayModeService dispatchSettlePlanPayModeService; + @Resource + private com.jwsaas.service.food.StoreHandoverService storeHandoverService; + @Resource + private com.jwsaas.service.food.StoreHandoverDetailService storeHandoverDetailService; + @Resource + private com.jwsaas.service.food.StoreAccountService storeAccountService; + @Resource + private com.jwsaas.service.food.StoreAccountDetailService storeAccountDetailService; + @Resource + private com.jwsaas.service.food.StoreHandoverDetailPayService storeHandoverDetailPayService; + + /** + * 交班后汇总交班信息计入门店余额事件 + */ + @Selector(EventKeys.BUSINESS_HANDOVER_STORE_ACCOUNT_RECHARGE) + public void storeAccountRecharge(Event> event) { + String info = "交班后汇总交班信息计入门店余额事件"; + logger.debug(">>>>>>>" + info + "。。。"); + + Map eventData = event.getData(); + String tenantCode = eventData.get("tenantCode").toString(); + String tenantId = eventData.get("tenantId").toString(); + String storeId = eventData.get("storeId").toString(); + String storeNo = eventData.get("storeNo").toString(); + String handoverId = eventData.get("handoverId").toString(); + String busNo = eventData.get("busNo").toString(); + try { + logger.debug("tenantCode:" + tenantCode); + logger.debug("tenantId:" + tenantId); + logger.debug("storeId:" + storeId); + logger.debug("storeNo:" + storeNo); + logger.debug("handoverId:" + handoverId); + logger.debug("busNo:" + busNo); + + Criteria criteria = new Criteria(); + List settlePlanList = dispatchSettlePlanService.getListByStoreId(tenantId, storeId, criteria); + if (CollectionUtils.isEmpty(settlePlanList)) { + logger.error("尚未配置门店配送结算方案"); + return; + } + if (settlePlanList.size() > 1) { + logger.error("门店配送结算方案不唯一"); + return; + } + + DispatchSettlePlan settlePlan = settlePlanList.get(0); + criteria = new Criteria(); + criteria.add(Restrictions.eq("planId", settlePlan.getId())); + List settlePlanPayModeList = dispatchSettlePlanPayModeService.getList(tenantId, criteria); + if (CollectionUtils.isEmpty(settlePlanPayModeList)) { + logger.error("门店配送结算方案没有定义相关收银方式"); + return; + } + Map settlePlanPayModeMap = new HashMap<>(); + for (DispatchSettlePlanPayMode payMode : settlePlanPayModeList) { + settlePlanPayModeMap.put(payMode.getNo(), payMode); + } + + // 查询门店余额账户 + StoreAccount storeAccount = storeAccountService.find(tenantId, "storeId", storeId); + if (storeAccount == null) { + // 没有账户的,先创建一个 + storeAccount = new StoreAccount(); + storeAccount.setNo(tenantId + storeNo);// 编号 + storeAccount.setStoreId(storeId);// 门店ID + storeAccount.setStoreNo(storeNo);// 门店编号 + storeAccount.setStatus(1);// 状态(1-正常;2-冻结;) + storeAccount.setPayPwd(null);// 支付密码 + storeAccount.setDescription(null);// 备注 + storeAccount.setAmount(0D);// 余额 + storeAccount.setFreezeAmount(0D);// 冻结余额 + storeAccount.setCreateDate(new Date()); + storeAccount.setCreateUser(Constant.CREATE_USER); + storeAccount = storeAccountService.save(tenantId, storeAccount); + } + if (storeAccount == null) { + logger.error("门店余额账户不存在"); + return; + } + + String accountId = storeAccount.getId(); + + // 交班信息 + StoreHandover storeHandover = storeHandoverService.get(tenantId, handoverId); + logger.debug("storeHandover:" + storeHandover); + + criteria = new Criteria(); + criteria.add(Restrictions.eq("accountId", accountId)); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("busNo", storeHandover.getNo())); + List storeAccountDetailList = storeAccountDetailService.getList(tenantId, criteria); + logger.debug("storeAccountDetailList.size:" + storeAccountDetailList.size()); + if (CollectionUtils.isNotEmpty(storeAccountDetailList)) { + logger.error("该信息已计入账户余额"); + return; + } + + criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("ticketId", storeHandover.getClientId())); + criteria.add(Restrictions.eq("busNo", storeHandover.getNo())); + criteria.add(Restrictions.eq("busType", 0));// 业务类型(0-销售;1-充值;) + List storeHandoverDetailPayList = storeHandoverDetailPayService.getList(tenantId, criteria); + logger.debug("storeHandoverDetailPayList:" + JSONUtil.toJSONString(storeHandoverDetailPayList)); + + DispatchSettlePlanPayMode settlePlanPayMode = null; + StoreAccountDetail detail = null; + StoreAccountBusType busType = StoreAccountBusType.HANDOVER; + + Map> payModeDataMap = new LinkedHashMap<>(); + for (StoreHandoverDetailPay pay : storeHandoverDetailPayList) { + settlePlanPayMode = settlePlanPayModeMap.get(pay.getPayModeNo()); + if (settlePlanPayMode != null && settlePlanPayMode.getDeleteFlag() == 0 && settlePlanPayMode.getIncomeFlag() == 1) { + // incomeFlag,是否计入门店余额,0-否;1-是; + // 计入门店余额 + try { + // busMode-营业模式(0-柜台;1-外带;2-电话外卖;3-餐桌;4-美团外卖;5-饿了么;6-百度外卖;7-微信点餐;) + // 01-人民币;02-会员卡;03-银行卡;04-支付宝;05-微信支付; + // 05-微信支付;(7-微信点餐;)微信点餐不计入 + if (StringUtils.equals("05", pay.getPayModeNo()) && pay.getBusMode() == 7 && settlePlan.getWxdcFlag() == 0) { + continue; + } + + if (payModeDataMap.get(pay.getPayModeNo()) == null) { + payModeDataMap.put(pay.getPayModeNo(), new ArrayList<>()); + } + + payModeDataMap.get(pay.getPayModeNo()).add(pay); + } catch (Exception e) { + logger.error("交班入账数据筛选[" + tenantId + "," + storeNo + "," + busNo + "]时发生异常:", e); + } + } + } + + for (String payModeNo : payModeDataMap.keySet()) { + try { + List list = payModeDataMap.get(payModeNo); + BigDecimal amount = BigDecimal.ZERO; + for (StoreHandoverDetailPay pay : list) { + amount = MathUtil.add(amount, new BigDecimal(pay.getMoney())); + } + + detail = new StoreAccountDetail(); + detail.setAccountId(accountId);// 账户ID + detail.setStoreId(storeId);// 门店Id + detail.setStoreNo(storeNo);// 门店编号 + detail.setType(1);// 收支类型(1-收入;2-支出;) + detail.setBusType(Integer.valueOf(busType.getSign()));// 业务类型(1-充值;2-交班;99-其他;) + detail.setBusNo(busNo);// 业务单号 + detail.setBusTime(storeHandover.getDatetimeShift());// 交易时间 + detail.setPayType(payModeNo);// 支付方式,0-银行卡充值1-支付宝充值2-微信支付充值3-配送扣款4-配送退款 + detail.setVoucherNo(busNo);// 凭证号 + detail.setStatus(1);// 0-待确认;1-成功;2-失败; + detail.setAmount(amount.doubleValue());// 发生金额 + detail.setAftAmount(MathUtil.add(new BigDecimal(storeAccount.getAmount()), new BigDecimal(detail.getAmount())).doubleValue());// 发生后余额 + detail.setWorkerNo(storeHandover.getAcceptWorkerNo());// 工号 + detail.setPosNo(storeHandover.getPosNo());// 设备编号 + detail.setSourceSign("pos");// 来源标识 + detail.setDescription("交班入账");// 备注 + detail.setCreateUser(Constant.CREATE_USER); + storeAccount = storeAccountService.save4Recharge(tenantId, storeId, accountId, detail); + } catch (Exception e) { + logger.error("交班入账[" + tenantId + "," + storeNo + "," + busNo + "]时发生异常:", e); + } + } + + } catch (Exception e) { + logger.error(info + ",发生异常", e); + } + + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/DispatchTicketCreateByAutoEvents.java b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/DispatchTicketCreateByAutoEvents.java new file mode 100644 index 0000000..c13d5ae --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/DispatchTicketCreateByAutoEvents.java @@ -0,0 +1,145 @@ +package com.jwsaas.reactor.event; + +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.*; +import com.jwsaas.service.food.*; +import com.jwsaas.util.RandomUtil; +import com.jwsaas.utils.DateUtils; +import org.apache.commons.collections4.CollectionUtils; +import reactor.bus.Event; +import reactor.spring.context.annotation.Consumer; +import reactor.spring.context.annotation.Selector; + +import javax.annotation.Resource; +import java.util.*; + +/** + * 门店要货单审核成功后,自动生成配送单 + * Created by Administrator on 2019\10\24 0024. + */ + +@Consumer +public class DispatchTicketCreateByAutoEvents extends BaseEvents { + @Resource + private AskGoodsTicketService askGoodsTicketService; + @Resource + private AskGoodsDetailService askGoodsDetailService; + @Resource + private DispatchTicketService dispatchTicketService; + @Resource + private StoreService storeService; + @Resource + private ProductService productService; + @Resource + private StorageService storageService; + + /** + * 门店要货单审核成功后,自动生成配送单 + * @param event + */ + @Selector(EventKeys.DISPATCHTICKET_CREATE_BY_ASKGOODSTICKET_AUTO) + public void dispatchTicketCreate(Event> event){ + String info = "门店要货单审核成功后,自动生成配送单"; + Map eventData = event.getData(); + String tenantId = eventData.get("tenantId").toString(); + String ticketId = eventData.get("ticketId").toString(); + String operator = eventData.get("operator").toString(); + try{ + AskGoodsTicket askGoodsTicket = askGoodsTicketService.get(tenantId,ticketId); + Store store = storeService.get(tenantId,askGoodsTicket.getStoreId()); + + Criteria c = new Criteria(); + c.add(Restrictions.eq("askgoodsId",ticketId)); + List dispatchTickets = dispatchTicketService.getList(tenantId,c); + if(CollectionUtils.isEmpty(dispatchTickets)){ + DispatchTicket ticket = new DispatchTicket(); + ticket.setAskgoodsId(ticketId); + ticket.setStoreId(askGoodsTicket.getStoreId()); + ticket.setStatus(0); + ticket.setAskgoodsNo(askGoodsTicket.getNo()); + ticket.setLinkMan(store.getManager()); + ticket.setLinkTelephone(store.getMobile()); + ticket.setAddress(store.getAddress()); + ticket.setNo("DT" + DateUtils.getCurrDatetime() + RandomUtil.randomInt(10, 99)); + ticket.setLogisticsFee(0D); + ticket.setSetMan(operator); + ticket.setSetDate(new Date()); + ticket.setOtherFee(0D); + ticket.setMoney(askGoodsTicket.getTotalMoney()); + ticket.setOrderMoney(askGoodsTicket.getProductMoney()); + ticket.setCreateUser(operator); + ticket.setCreateDate(new Date()); + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketId",ticketId)); + List details = askGoodsDetailService.getList(tenantId,criteria); + + //查找商品默认库存; + Criteria crit = new Criteria(); + crit.add(Restrictions.eq("type",10)); + crit.add(Restrictions.eq("deleteFlag",0)); + crit.add(Restrictions.eq("stopFlag",0)); + crit.add(Restrictions.eq("selfFlag",0)); + crit.add(Restrictions.limit("0","10000")); + List products = productService.getList(tenantId,crit); + Map map = new HashMap<>(); + if(CollectionUtils.isNotEmpty(products)){ + for(Product product : products){ + map.put(product.getId(),product.getStorageId()); + } + } + + List dispatchTicketDetailList = new ArrayList<>(); + List storages = storageService.getList(tenantId,new Criteria()); + String storageId = ""; + String storageName = ""; + if(CollectionUtils.isNotEmpty(storages)){ + storageId = storages.get(0).getId(); + storageName = storages.get(0).getName(); + } + for(AskGoodsDetail detail : details){ + DispatchTicketDetail dispatchTicketDetail = new DispatchTicketDetail(); + dispatchTicketDetail.setStorageId(storageId); + dispatchTicketDetail.setStorageName(storageName); + dispatchTicketDetail.setProductId(detail.getProductId()); + dispatchTicketDetail.setProductNo(detail.getProductNo()); + dispatchTicketDetail.setProductName(detail.getProductName()); + dispatchTicketDetail.setSpecId(detail.getSpecId()); + dispatchTicketDetail.setSpecName(detail.getSpecName()); + dispatchTicketDetail.setProductDescription(detail.getProductDescription()); + dispatchTicketDetail.setAskgoodsAmount(detail.getAmount()); + dispatchTicketDetail.setDispatchAmount(detail.getAmount()); + dispatchTicketDetail.setDispatchUnitId(detail.getDispatchUnitId()); + dispatchTicketDetail.setDispatchUnitName(detail.getDispatchUnitName()); + dispatchTicketDetail.setPrice(detail.getPrice()); + dispatchTicketDetail.setMoney(detail.getMoney()); + dispatchTicketDetail.setDescription(detail.getDescription()); + dispatchTicketDetail.setReceiveAmount(0.0); + dispatchTicketDetail.setDifferenceAmount(0.0); + dispatchTicketDetail.setDifferenceMoney(0.0); + dispatchTicketDetailList.add(dispatchTicketDetail); + } + + DispatchTicketLog log = new DispatchTicketLog(); + log.setStatus(0); // 0-新建,1-驳回,2-审核,3-作废,4-发货,5-收货 + log.setType(0);// 0-新建 1-审核 2-废弃 3-已发货5-已收货 + log.setDescription( "要货单自动转成配送单"); + log.setCreateUser(operator); + log.setCreateDate(new Date()); + log.setTenantId(tenantId); + + DispatchTicket dispatchTicket = dispatchTicketService.saveTicket(tenantId,ticket,dispatchTicketDetailList,log); + if(dispatchTicket != null){ + askGoodsTicket.setStatus(6); + askGoodsTicketService.update(tenantId,askGoodsTicket); + } + } + }catch (Exception e){ + logger.error("tenantId:" + tenantId); + logger.error("ticketId:" + ticketId); + logger.error(info + "发生异常", e); + } + + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/EventKeys.java b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/EventKeys.java new file mode 100644 index 0000000..4f1f7d0 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/EventKeys.java @@ -0,0 +1,53 @@ +package com.jwsaas.reactor.event; + +public class EventKeys { + + // public final static String METHOD_STAT = "methodStat";// 方法调用统计 + + public final static String WORKER_LOGIN = "worker.login";// 员工登录 + public final static String WORKER_LOGOUT = "worker.logout";// 员工登出 + + public final static String POS_MONITOR = "pos.monitor";// POS监控 + public final static String POS_LAST_ACTIVE_TIME = "pos.last.active.time";// POS最后活跃时间 + + public final static String WXDC_ORDER_CREATE = "wxdc.order.create";// 微信点餐订单创建 + public final static String WXDC_ORDER_STORE_CONFIRM = "wxdc.order.store.confirm";// 微信点餐订单,商家确认(接单) + public final static String WXDC_ORDER_STORE_CANCEL = "wxdc.order.store.cancel";// 微信点餐订单,商家取消(拒单) + public final static String WXDC_ORDER_USER_CANCEL = "wxdc.order.user.cancel";// 微信点餐订单,用户取消 + public final static String WXDC_ORDER_PAY_REFUND = "wxdc.order.pay.refund";// 微信点餐订单,退款 + public final static String WXDC_ORDER_PAY_REFUND_LITEAPP = "wxdc.order.pay.refund.liteapp";// 巨为云店点餐订单,退款 + public final static String WXDC_ORDER_AUTO_CANCEL = "wxdc.order.auto.cancel";// 微信点餐订单,商家接单超时,自动取消 + public final static String WXDC_ORDER_AUTO_FINISH = "wxdc.order.auto.finish";// 微信点餐订单,商家接单N分钟后,自动完成 + public final static String WXDC_ORDER_REFUND_USER_APPLY = "wxdc.order.refund.user.apply";// 微信点餐订单,用户申请退单/退款 + public final static String WXDC_ORDER_REFUND_STORE_AGREE = "wxdc.order.refund.store.agree";// 微信点餐订单,商家同意退单/退款 + public final static String WXDC_ORDER_REFUND_STORE_REFUSE = "wxdc.order.refund.store.refuse";// 微信点餐订单,商家拒绝退单/退款 + public final static String WXDC_WEIXINPAY_NOTIFY = "wxdc.weixinpay.notify";// 微信支付异步通知 + public static final String FUYOU_PAY_NOTIFY = "fuyou.liteApp.result.notify";//富友支付结果通知 + public static final String SAOBEI_PAY_NOTIFY = "saobei.liteApp.result.notify";//扫呗结果通知 + + public final static String WXYH_UPDATE_BAIDU_STORE = "wxyh.update.baidu.store";// 微信要货 更新百度门店信息 + + public final static String SALES_ORDER_CREATE = "sales.order.create";// 销售订单创建事件 + + public static final String PROMOTION_TASK_CREATE_NEXT_DAY = "promotion.task.create.nextday";//生成下一天促销任务; + + public final static String ZGCX_LOGIN_OUT = "zgcx.login.out";// 员工密码修改后,掌柜查询需重新登陆 + + public final static String BUSINESS_HANDOVER_STORE_ACCOUNT_RECHARGE = "business.handover.store.account.recharge";// 交班后汇总交班信息计入门店余额事件 + + public final static String STORE_ACCOUNT_WEIXINPAY_NOTIFY = "store.account.weixinpay.notify";// 门店账户余额充值异步通知 + + public static final String SERVERDATAVERSION_UPDATE = "serverdataversion.update";//服务数据版本信息更新; + + + public final static String PROGRAM_ORDER_PAY = "program.order.pay";// 支付成功事件 + public final static String PROGRAM_ORDER_CONFIRM = "program.order.confirm";// 微信点餐接单成功事件 + + public final static String PROGRAM_ORDER_AUTO_CANCEL = "program.order.auto.cancel";// 小程序点餐订单,商家接单超时3分支自动取消 + public final static String PROGRAM_ORDER_AUTO_FINISH = "program.order.auto.finish";// 小程序点餐订单,商家接单20分钟后,自动完成 + public static final String PROGRAM_PROMOTION_TASK_CREATE_NEXT_DAY = "program.promotion.task.create.nextday";//小程序促销,生成下一天促销任务; + public static final String DISPATCHTICKET_CREATE_BY_ASKGOODSTICKET_AUTO = "dispatchTicket.create.by.askGoodsTicket.auto";//门店审核要货单后,自动生成配送单; + + public static final String PROGRAM_ORDER_NO_PAID_AUTO_CANCEL = "program.order.no.paid.cancel";//巨为小程序订单未支付,120分钟自动取消 + public static final String PROGRAM_ORDER_SAOBEI_UPLOAD = "program.order.saobei.upload";//巨为小程序订单扫呗上传; +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/PosEvents.java b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/PosEvents.java new file mode 100644 index 0000000..c4d9ace --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/PosEvents.java @@ -0,0 +1,197 @@ +package com.jwsaas.reactor.event; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; + +import com.jwsaas.Constant; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.PosInfo; +import com.jwsaas.entity.food.Store; +import com.jwsaas.entity.ops.TenantPosInfo; +import com.jwsaas.entity.ops.TenantStoreAuth; +import com.jwsaas.utils.DateUtils; + +import reactor.bus.Event; +import reactor.spring.context.annotation.Consumer; +import reactor.spring.context.annotation.Selector; + +@Consumer +public class PosEvents extends BaseEvents { + + @Resource + private com.jwsaas.service.ops.TenantPosInfoService tenantPosInfoService; + @Resource + private com.jwsaas.service.ops.TenantStoreAuthService tenantStoreAuthService; + @Resource + private com.jwsaas.service.food.PosInfoService posInfoService; + @Resource + private com.jwsaas.service.food.StoreService storeService; + + @Selector(EventKeys.POS_MONITOR) + public void monitor(Event> event) { + String info = "POS监控事件处理"; + logger.debug(">>>>>>>" + info + "。。。"); + + Map eventData = event.getData(); + // String appKey = eventData.get("appKey").toString(); + // String appId = eventData.get("appId").toString(); + // String tenantCode = eventData.get("tenantCode").toString(); + // String appCode = eventData.get("appCode").toString(); + String tenantId = eventData.get("tenantId").toString(); + String storeId = eventData.get("storeId").toString(); + String posNo = eventData.get("posNo").toString(); + String os = eventData.get("os").toString();// 操作系统 + String osType = eventData.get("osType").toString();// 操作系统类型(32-32位;64-64位;) + String softwareVersion = eventData.get("softwareVersion").toString();// 软件版本 + int memoryTotalSize = (int) eventData.get("memoryTotalSize");// 总内存 + int memoryFreeSize = (int) eventData.get("memoryFreeSize");// 剩余内存 + String diskName = eventData.get("diskName") == null ? null : eventData.get("diskName").toString();// 工作盘盘符 + int diskTotalSize = (int) eventData.get("diskTotalSize");// 工作盘磁盘空间 + int diskFreeSize = (int) eventData.get("diskFreeSize");// 工作盘磁盘剩余空间 + int cpuSize = (int) eventData.get("cpuSize");// 处理器数量 + String extend = eventData.get("extend") == null ? null : eventData.get("extend").toString();// 扩展信息 + String storeName = eventData.get("storeName") == null ? null : eventData.get("storeName").toString();// 门店名称 + String aliasName = eventData.get("aliasName") == null ? null : eventData.get("aliasName").toString();// POS别名 + + try { + logger.debug("tenantId:" + tenantId); + logger.debug("storeId:" + storeId); + logger.debug("posNo:" + posNo); + logger.debug("os:" + os); + logger.debug("osType:" + osType); + logger.debug("softwareVersion:" + softwareVersion); + logger.debug("memoryTotalSize:" + memoryTotalSize); + logger.debug("memoryFreeSize:" + memoryFreeSize); + logger.debug("diskName:" + diskName); + logger.debug("diskTotalSize:" + diskTotalSize); + logger.debug("diskFreeSize:" + diskFreeSize); + logger.debug("cpuSize:" + cpuSize); +// if (StringUtils.isBlank(storeName)) { +// Store store = storeService.get(tenantId, storeId); +// storeName = store == null ? null : store.getName(); +// } + Date currentDate = new Date(); + TenantPosInfo tenantPosInfo = new TenantPosInfo(); + tenantPosInfo.setStoreId(storeId); + tenantPosInfo.setPosNo(posNo); + tenantPosInfo.setOs(os);// 操作系统 + tenantPosInfo.setOsType(osType);// 操作系统类型(32-32位;64-64位;) + tenantPosInfo.setSoftwareVersion(softwareVersion);// 软件版本 + tenantPosInfo.setMemoryTotalSize(memoryTotalSize); + tenantPosInfo.setMemoryFreeSize(memoryFreeSize); + tenantPosInfo.setDiskName(diskName); + tenantPosInfo.setDiskTotalSize(diskTotalSize); + tenantPosInfo.setDiskFreeSize(diskFreeSize); + tenantPosInfo.setCpuSize(cpuSize); + tenantPosInfo.setExtend(extend);// 扩展信息 + tenantPosInfo.setMonitorDate(currentDate); + tenantPosInfo.setLastActiveDate(currentDate); + tenantPosInfo.setStoreName(storeName); + tenantPosInfo.setAliasName(aliasName); + tenantPosInfo.setModifyDate(currentDate); + tenantPosInfo.setModifyUser(Constant.CREATE_USER); + int rows = tenantPosInfoService.updateMonitorInfo(Constant.DEFAULT_DB_SIGN, tenantPosInfo); + List listAuth = tenantStoreAuthService.findList(Constant.DEFAULT_DB_SIGN, "storeId", storeId); + if (listAuth != null) { + for (TenantStoreAuth auth : listAuth) { + auth.setLastDate(DateUtils.format(currentDate, "yyyy-MM-dd HH:mm:ss")); + tenantStoreAuthService.update(Constant.DEFAULT_DB_SIGN, auth); + } + } + logger.debug("rows:" + rows); + if (rows == 0) { + saveMissPos(tenantId, storeId, posNo); + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + } + + } + + /** + * 遗漏POS信息处理 + */ + private void saveMissPos(String tenantId, String storeId, String posNo) { + String info = "遗漏POS信息处理"; + logger.debug(">>>>>>>" + info + "。。。"); + logger.debug("tenantId:" + tenantId); + logger.debug("storeId:" + storeId); + logger.debug("posNo:" + posNo); + + try { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", storeId)); + criteria.add(Restrictions.eq("posNo", posNo)); + List posInfoList = posInfoService.getList(tenantId, criteria); + if (CollectionUtils.isNotEmpty(posInfoList)) { + PosInfo posInfo = posInfoList.get(0); + TenantPosInfo tenantPosInfo = new TenantPosInfo(); + tenantPosInfo.setAppSign(posInfo.getAppSign()); + tenantPosInfo.setCpuNumber(posInfo.getCpuNumber()); + tenantPosInfo.setDeleteFlag(posInfo.getDeleteFlag()); + tenantPosInfo.setDescription(posInfo.getDescription()); + tenantPosInfo.setMACAddress(posInfo.getMACAddress()); + tenantPosInfo.setName(posInfo.getName()); + tenantPosInfo.setPosNo(posInfo.getPosNo()); + tenantPosInfo.setSerialNumber(posInfo.getSerialNumber()); + tenantPosInfo.setStatus(0); + tenantPosInfo.setStoreId(posInfo.getStoreId()); + tenantPosInfo.setStoreNo(posInfo.getStoreNo()); + tenantPosInfo.setTenantCode(tenantId); + tenantPosInfo.setTenantId(Constant.DEFAULT_DB_SIGN); + tenantPosInfo.setTerminalType(posInfo.getTerminalType()); + tenantPosInfo.setCreateDate(posInfo.getCreateDate()); + tenantPosInfo.setCreateUser(posInfo.getCreateUser()); + tenantPosInfo.setStoreName(null); + tenantPosInfo.setAliasName(posInfo.getAliasName());// 别名 + tenantPosInfoService.save(Constant.DEFAULT_DB_SIGN, tenantPosInfo); + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + } + } + + @Selector(EventKeys.POS_LAST_ACTIVE_TIME) + public void lastActiveTime(Event> event) { + String info = "POS最后活跃时间事件处理"; + logger.debug(">>>>>>>" + info + "。。。"); + + Map eventData = event.getData(); + // String appKey = eventData.get("appKey").toString(); + // String appId = eventData.get("appId").toString(); + // String tenantCode = eventData.get("tenantCode").toString(); + // String appCode = eventData.get("appCode").toString(); + String tenantId = eventData.get("tenantId").toString(); + String storeId = eventData.get("storeId").toString(); + String posNo = eventData.get("posNo").toString(); + try { + logger.debug("tenantId:" + tenantId); + logger.debug("storeId:" + storeId); + logger.debug("posNo:" + posNo); + + Date currentDate = new Date(); + TenantPosInfo tenantPosInfo = new TenantPosInfo(); + tenantPosInfo.setStoreId(storeId); + tenantPosInfo.setPosNo(posNo); + tenantPosInfo.setLastActiveDate(currentDate); + tenantPosInfo.setModifyDate(currentDate); + tenantPosInfo.setModifyUser(Constant.CREATE_USER); + int rows = tenantPosInfoService.updateLastActiveTime(Constant.DEFAULT_DB_SIGN, tenantPosInfo); + logger.debug("rows:" + rows); + if (rows == 0) { + saveMissPos(tenantId, storeId, posNo); + } + } catch (Exception e) { + logger.error(info + ",发生异常", e); + } + + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/ProgramOrderEvents.java b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/ProgramOrderEvents.java new file mode 100644 index 0000000..892cd56 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/ProgramOrderEvents.java @@ -0,0 +1,162 @@ +package com.jwsaas.reactor.event; + +import java.util.Calendar; +import java.util.Date; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; + +import com.jwsaas.Constant; +import com.jwsaas.entity.task.Schedule; +import com.jwsaas.task.TaskJobHandler; +import com.jwsaas.task.utils.TaskOpenUtils; +import com.jwsaas.util.CronUtil; + +import reactor.bus.Event; +import reactor.spring.context.annotation.Consumer; +import reactor.spring.context.annotation.Selector; + +@Consumer +public class ProgramOrderEvents extends BaseWxdcEvents { + + @Autowired + private TaskOpenUtils taskOpenUtils; + + /** + * 用户支付成功,创建计划任务
+ * 功能说明:用户支付成功,下单完成3分钟商家不接单自动退单. + */ + @Selector(EventKeys.PROGRAM_ORDER_PAY) + public void orderPayAddTask(Event> event) { + String info = "支付成功,创建计划任务"; + logger.info(">>>>>>>" + info + "。。。"); + Map eventData = event.getData(); + String tenantId = eventData.get("tenantId").toString(); + String storeId = eventData.get("storeId").toString(); + String busNo = eventData.get("busNo").toString(); + try { + String currentUser = Constant.CREATE_USER; + /*-------------开启计划任务---------------*/ + Schedule schedule = new Schedule(); + schedule.setSign("Program_" + tenantId + "_" + storeId + "_" + busNo);// 标识 + schedule.setJobDesc("小程序点餐订单[" + tenantId + "," + storeId + "," + busNo + "]");// 任务描述 + Date executorTime = null; + Calendar calendar = Calendar.getInstance(); + + //calendar.add(Calendar.MINUTE, 3);2020-02-27 10:50 将未接单自动退款时间改为5分钟 + //calendar.add(Calendar.MINUTE, 5);2020-03-02 9:07 将未接单自动退款时间改为10分钟 + calendar.add(Calendar.MINUTE, 10); + executorTime = calendar.getTime(); + String jobCron = CronUtil.getCron(executorTime); + schedule.setJobCron(jobCron);// cron表达式 + schedule.setExecutorHandler(TaskJobHandler.PROGRAM_ORDER_AUTO_CANCEL.getSign());// 执行器Handler + String executorParam = "tenantId#" + tenantId + ",storeId#" + storeId + ",busNo#" + busNo; + schedule.setExecutorParam(executorParam);// 执行参数 + schedule.setAlarmEmail(taskOpenUtils.getAlarmEmail());// 报警邮件 + schedule.setAuthor(currentUser);// 负责人 + schedule.setTenantId(tenantId); + schedule.setCreateDate(new Date()); + schedule.setCreateUser(currentUser); + Boolean addTaskResult = taskOpenUtils.saveSchedule(schedule); + if (addTaskResult) { + logger.info("计划任务创建成功--->" + schedule.getJobDesc()); + } else { + logger.warn("计划任务创建失败--->" + schedule.getJobDesc()); + } + } catch (Exception e) { + logger.error(info + "时,发生异常", e); + } + } + + /** + * 商家接单后,创建计划任务
+ *

+ * 功能说明:商家接单后,60分钟订单自动完成. + *

+ */ + @Selector(EventKeys.PROGRAM_ORDER_CONFIRM) + public void orderConfirmAddTask(Event> event) { + String info = "商家接单后,60分钟订单自动完成"; + logger.info(">>>>>>>" + info + "。。。"); + Map eventData = event.getData(); + String tenantId = eventData.get("tenantId").toString(); + String storeId = eventData.get("storeId").toString(); + String busNo = eventData.get("busNo").toString(); + try { + String currentUser = Constant.CREATE_USER; + /*-------------开启计划任务---------------*/ + Schedule schedule = new Schedule(); + schedule.setSign("Program_Auto_Finish_" + tenantId + "_" + storeId + "_" + busNo);// 标识 + schedule.setJobDesc("微信点餐订单[" + tenantId + "," + storeId + "," + busNo + "]");// 任务描述 + Date executorTime = null; + Calendar calendar = Calendar.getInstance(); + //calendar.add(Calendar.MINUTE, 60);2020-03-11 10:30 将时间由60分钟改为120分钟 + calendar.add(Calendar.MINUTE, 120); + executorTime = calendar.getTime(); + String jobCron = CronUtil.getCron(executorTime); + schedule.setJobCron(jobCron);// cron表达式 + schedule.setExecutorHandler(TaskJobHandler.PROGRAM_ORDER_AUTO_FINISH.getSign());// 执行器Handler + String executorParam = "tenantId#" + tenantId + ",storeId#" + storeId + ",busNo#" + busNo; + schedule.setExecutorParam(executorParam);// 执行参数 + schedule.setAlarmEmail(taskOpenUtils.getAlarmEmail());// 报警邮件 + schedule.setAuthor(currentUser);// 负责人 + schedule.setTenantId(tenantId); + schedule.setCreateDate(new Date()); + schedule.setCreateUser(currentUser); + Boolean addTaskResult = taskOpenUtils.saveSchedule(schedule); + if (addTaskResult) { + logger.info("计划任务创建成功--->" + schedule.getJobDesc()); + } else { + logger.warn("计划任务创建失败--->" + schedule.getJobDesc()); + } + } catch (Exception e) { + logger.error(info + "时,发生异常", e); + } + } + + + /** + * 下单后120分钟订单没有支付取消订单,创建计划任务
+ */ + @Selector(EventKeys.PROGRAM_ORDER_NO_PAID_AUTO_CANCEL) + public void orderNopaidAutoCancelTask(Event> event) { + String info = "下单后120分钟订单没有支付取消订单"; + logger.info(">>>>>>>" + info + "。。。"); + Map eventData = event.getData(); + String tenantId = eventData.get("tenantId").toString(); + String storeId = eventData.get("storeId").toString(); + String storeNo = eventData.get("storeNo").toString(); + String busNo = eventData.get("busNo").toString(); + try { + String currentUser = Constant.CREATE_USER; + /*-------------开启计划任务---------------*/ + Schedule schedule = new Schedule(); + schedule.setSign("ProgramOrderCancel_" + tenantId + "_" + storeNo + "_" + busNo);// 标识 + schedule.setJobDesc("巨为小程序点餐订单支付超时自动取消[" + tenantId + "," + storeId + "," + busNo + "]");// 任务描述 + Date executorTime = null; + Calendar calendar = Calendar.getInstance(); + //2020-7-24,将120分钟改为10分钟; + calendar.add(Calendar.MINUTE, 10); + executorTime = calendar.getTime(); + String jobCron = CronUtil.getCron(executorTime); + schedule.setJobCron(jobCron);// cron表达式 + schedule.setExecutorHandler(TaskJobHandler.PROGRAM_ORDER_NOPAID_AUTO_CANCEL.getSign());// 执行器Handler + String executorParam = "tenantId#" + tenantId + ",storeId#" + storeId + ",busNo#" + busNo; + schedule.setExecutorParam(executorParam);// 执行参数 + schedule.setAlarmEmail(taskOpenUtils.getAlarmEmail());// 报警邮件 + schedule.setAuthor(currentUser);// 负责人 + schedule.setTenantId(tenantId); + schedule.setCreateDate(new Date()); + schedule.setCreateUser(currentUser); + Boolean addTaskResult = taskOpenUtils.saveSchedule(schedule); + if (addTaskResult) { + logger.info("计划任务创建成功--->" + schedule.getJobDesc()); + } else { + logger.warn("计划任务创建失败--->" + schedule.getJobDesc()); + } + } catch (Exception e) { + logger.error(info + "时,发生异常", e); + } + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/ProgramOrderSaobeiUploadEvents.java b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/ProgramOrderSaobeiUploadEvents.java new file mode 100644 index 0000000..c005bc3 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/ProgramOrderSaobeiUploadEvents.java @@ -0,0 +1,180 @@ +package com.jwsaas.reactor.event; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.fasterxml.jackson.core.type.TypeReference; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.*; +import com.jwsaas.http.HttpTool; +import com.jwsaas.service.food.*; +import com.jwsaas.util.JSONUtil; +import com.jwsaas.utils.DateUtils; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.http.HttpResponse; +import reactor.bus.Event; +import reactor.spring.context.annotation.Consumer; +import reactor.spring.context.annotation.Selector; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.util.*; + +/*** + * 小程序订单扫呗上传 + * + */ +@Consumer +public class ProgramOrderSaobeiUploadEvents extends BaseEvents { + + @Resource + private ProgramStoreOrderProductService programStoreOrderProductService; + @Resource + private ProgramPaymentParameterService programPaymentParameterService; + @Resource + private PaymentParameterService paymentParameterService; + @Resource + private ProgramSettingService programSettingService; + + /** + * 小程序订单扫呗上传 + */ + @Selector(EventKeys.PROGRAM_ORDER_SAOBEI_UPLOAD) + public void programOrderSaobeiUpload(Event> event) { + String info = "小程序订单扫呗上传"; + logger.error(info+">>>>>>>>>>>>>>>>>>>>>>>>>>>"+event.toString()); + + try { + Map eventData = event.getData(); + + String tenantId = eventData.get("tenantId").toString(); + String ticketId = eventData.get("ticketId").toString(); + String merchant_no = eventData.get("merchant_no").toString(); + String terminal_id = eventData.get("terminal_id").toString(); + String user_id = eventData.get("user_id").toString(); + String out_order_no = eventData.get("out_order_no").toString(); + String out_trade_no = eventData.get("out_trade_no").toString(); + String transaction_id = eventData.get("transaction_id").toString(); + String session_key = eventData.get("session_key").toString(); + String storeNo = eventData.get("storeNo").toString(); + String storeId = eventData.get("storeId").toString(); + Integer total_amount = (Integer) eventData.get("total_amount"); + Integer discount_amount = (Integer) eventData.get("discount_amount"); + Integer user_amount = (Integer) eventData.get("user_amount"); + + List> payParamList = new ArrayList<>(); + List parameters = this.programPaymentParameterService.getPaymentParameterByStoreId(tenantId, storeId); + for (ProgramPaymentParameter paymentParameter : parameters) { + Map map = new HashMap<>(); + map.put("tenantId", paymentParameter.getTenantId()); + map.put("id", paymentParameter.getId()); + map.put("no", paymentParameter.getNo()); + map.put("name", paymentParameter.getName()); + map.put("sign", paymentParameter.getSign()); + Map pbodyMap = JSONUtil.parseObject(paymentParameter.getPbody(), new TypeReference>() { + }); + map.put("pbody", pbodyMap); + map.put("certText", paymentParameter.getCertText()); + if (org.apache.commons.lang3.StringUtils.equalsIgnoreCase("saobei", paymentParameter.getSign())) { + payParamList.add(map); + }else if (org.apache.commons.lang3.StringUtils.equalsIgnoreCase("ccb", paymentParameter.getSign())) { + payParamList.add(map); + } + } + if(CollectionUtils.isEmpty(payParamList)){ + // 获取支付参数 + List parameterList = this.paymentParameterService.getPaymentParameterByStoreId(tenantId, storeId); + for (PaymentParameter paymentParameter : parameterList) { + Map map = new HashMap<>(); + map.put("tenantId", paymentParameter.getTenantId()); + map.put("id", paymentParameter.getId()); + map.put("no", paymentParameter.getNo()); + map.put("name", paymentParameter.getName()); + map.put("sign", paymentParameter.getSign()); + Map pbodyMap = JSONUtil.parseObject(paymentParameter.getPbody(), new TypeReference>() { + }); + map.put("pbody", pbodyMap); + map.put("certText", paymentParameter.getCertText()); + if (org.apache.commons.lang3.StringUtils.equalsIgnoreCase("saobei", paymentParameter.getSign())) { + payParamList.add(map); + }else if (StringUtils.equalsIgnoreCase("ccb", paymentParameter.getSign())) { + payParamList.add(map); + } + } + } + + if(CollectionUtils.isNotEmpty(payParamList)){ + Map payParam = payParamList.get(0); + if (payParam.get("sign").toString().equals("saobei")) { + if (payParam.get("sign").toString().equals("saobei")) { + Map payBoday = (Map) payParam.get("pbody"); + Map paramMap = new LinkedHashMap<>(); + + List> mapList = new ArrayList<>(); + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketId",ticketId)); + List products = programStoreOrderProductService.getList(tenantId,criteria); + if(CollectionUtils.isNotEmpty(products)){ + ProgramSetting setting = programSettingService.get(tenantId, products.get(0).getProgramId()); + Map setMap = JSONUtil.parseObject(setting.getWxBoday(),Map.class); + + paramMap.put("merchant_no", merchant_no); + paramMap.put("terminal_id", terminal_id); + paramMap.put("out_shop_no", storeNo); + paramMap.put("sub_appid", setMap.get("appId")+""); + paramMap.put("openid", user_id); + paramMap.put("login_token", session_key); + paramMap.put("order_entry", "pages/tabbar/launch"); + paramMap.put("total_amount", total_amount); + paramMap.put("discount_amount", discount_amount); + paramMap.put("user_amount", user_amount); + paramMap.put("status", "PAY_SUCCESS"); + paramMap.put("action_time", DateUtils.format(new Date(), "yyyy-MM-dd'T'HH:mm:ss'Z'")); + //logger.error(info+"=========>action_time" + DateUtils.format(new Date(), "yyyy-MM-dd'T'HH:mm:ss'Z'")); + paramMap.put("pay_time", DateUtils.format(new Date(), "yyyy-MM-dd'T'HH:mm:ss'Z'")); + paramMap.put("transaction_id", transaction_id); + paramMap.put("out_trade_no", out_trade_no); + paramMap.put("out_order_no", out_order_no); + Map map = new HashMap<>(); + for(ProgramStoreOrderProduct product : products){ + map.put("out_dish_no",product.getProductNo()); + map.put("name",product.getProductName()); + map.put("price",((Double)(product.getPrice()*100)).intValue()); + map.put("unit","BY_SHARE"); + map.put("count",new BigDecimal(product.getCount()).setScale(2,BigDecimal.ROUND_HALF_UP).floatValue()); + mapList.add(map); + } + paramMap.put("dish_list", mapList); + Object json = JSON.toJSON(paramMap); + //logger.error(info+"=========>请求参数{}", json); + final HttpResponse res = HttpTool.url(payBoday.get("gatewayUrl").toString() + "scancode/110/orderfood").contentType("application/json").body(json.toString()).post(); + final String content = HttpTool.getResponseAsString(res); + logger.error(info+"=========>响应参数{}", content); + + JSONObject parseObject = JSON.parseObject(content); + String return_code = parseObject.getString("return_code"); + String result_code = parseObject.getString("result_code"); + String return_msg = parseObject.getString("return_msg"); + if (return_code.equals("01") && result_code.equals("01")) { + logger.error(info+"门店:"+storeNo+",订单:"+out_trade_no+",上传成功!"); + }else{ + logger.error(info+",失败:"+return_msg); + } + } + } + } + } + + + + + logger.error(info); + + } catch (Exception e) { + logger.error(info + "发生异常", e); + e.printStackTrace(); + } + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/ProgramPromotionTaskEvents.java b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/ProgramPromotionTaskEvents.java new file mode 100644 index 0000000..bdf6011 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/ProgramPromotionTaskEvents.java @@ -0,0 +1,41 @@ +package com.jwsaas.reactor.event; + +import com.jwsaas.service.food.ProgramPromotionTaskService; +import reactor.bus.Event; +import reactor.spring.context.annotation.Consumer; +import reactor.spring.context.annotation.Selector; + +import javax.annotation.Resource; +import java.util.Map; + +/** + * 促销任务相关事件处理 + * Created by Administrator on 2019\8\28 0028. + */ +@Consumer +public class ProgramPromotionTaskEvents extends BaseEvents { + @Resource + private ProgramPromotionTaskService programPromotionTaskService; + + /** + * 生成下一天的促销任务,任务生成后在单据里记录 最末任务日期、最末任务序号; + */ + @Selector(EventKeys.PROGRAM_PROMOTION_TASK_CREATE_NEXT_DAY) + public void taskNextDayCreate(Event> event) { + String info = "生成下一天的促销任务"; + logger.debug(info); + logger.debug("event.data:" + event.getData()); + Map eventData = event.getData(); + String tenantId = eventData.get("tenantId").toString(); + String currentUser = eventData.get("currentUser").toString(); + String ticketId = eventData.get("ticketId").toString(); + String lastTaskEndDate = eventData.get("lastTaskEndDate").toString(); + String lastTaskNo = eventData.get("lastTaskNo").toString(); + try { + programPromotionTaskService.saveNextDayPromotionTask(tenantId,ticketId,lastTaskEndDate,lastTaskNo,currentUser); + } catch (Exception e) { + logger.error("生成下一天的促销任务时,发生异常", e); + } + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/PromotionTaskEvents.java b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/PromotionTaskEvents.java new file mode 100644 index 0000000..f29069b --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/PromotionTaskEvents.java @@ -0,0 +1,42 @@ +package com.jwsaas.reactor.event; + +import com.jwsaas.service.food.PromotionTaskService; +import reactor.bus.Event; +import reactor.spring.context.annotation.Consumer; +import reactor.spring.context.annotation.Selector; + +import javax.annotation.Resource; +import java.util.Map; + +/** + * 促销任务相关事件处理
+ * Created by admin on 2018/1/13. + */ +@Consumer +public class PromotionTaskEvents extends BaseEvents { + + @Resource + private PromotionTaskService promotionTaskService; + + /** + * 生成下一天的促销任务,任务生成后在单据里记录 最末任务日期、最末任务序号; + */ + @Selector(EventKeys.PROMOTION_TASK_CREATE_NEXT_DAY) + public void taskNextDayCreate(Event> event) { + String info = "生成下一天的促销任务"; + logger.debug(info); + logger.debug("event.data:" + event.getData()); + Map eventData = event.getData(); + String tenantId = eventData.get("tenantId").toString(); + String currentUser = eventData.get("currentUser").toString(); + String ticketId = eventData.get("ticketId").toString(); + String lastTaskEndDate = eventData.get("lastTaskEndDate").toString(); + String lastTaskNo = eventData.get("lastTaskNo").toString(); + try { + promotionTaskService.saveNextDayPromotionTask(tenantId,ticketId,lastTaskEndDate,lastTaskNo,currentUser); + } catch (Exception e) { + logger.error("生成下一天的促销任务时,发生异常", e); + } + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/SalesOrderEvents.java b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/SalesOrderEvents.java new file mode 100644 index 0000000..868cc4c --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/SalesOrderEvents.java @@ -0,0 +1,238 @@ +package com.jwsaas.reactor.event; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; + +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.MakeBurden; +import com.jwsaas.entity.food.Product; +import com.jwsaas.entity.food.ProductBurden; +import com.jwsaas.entity.food.StoreBusinessTicket; +import com.jwsaas.entity.food.StoreOrderProduct; +import com.jwsaas.entity.food.StoreOrderProductMake; +import com.jwsaas.entity.food.StoreStorage; +import com.jwsaas.entity.food.TicketPrintSetting; +import com.jwsaas.service.food.MakeBurdenService; +import com.jwsaas.service.food.ProductBurdenService; +import com.jwsaas.service.food.ProductRatioService; +import com.jwsaas.service.food.ProductService; +import com.jwsaas.service.food.ProductStoreStockService; +import com.jwsaas.service.food.StoreBusinessTicketService; +import com.jwsaas.service.food.StoreOrderProductMakeService; +import com.jwsaas.service.food.StoreOrderProductService; +import com.jwsaas.service.food.StoreStorageService; +import com.jwsaas.service.food.TicketPrintSettingService; + +import reactor.bus.Event; +import reactor.spring.context.annotation.Consumer; +import reactor.spring.context.annotation.Selector; + +@Consumer +public class SalesOrderEvents extends BaseEvents { + + @Resource + private TicketPrintSettingService settingService; + @Resource + private StoreBusinessTicketService storeBusinessTicketService;// 前台销售单,cy_store_business_ticket + @Resource + private StoreOrderProductService storeOrderProductService;// 门店产品销售记录,cy_store_order_product + @Resource + private StoreOrderProductMakeService storeOrderProductMakeService;// 门店销售单做法,cy_store_order_product_make + @Resource + private ProductBurdenService productBurdenService;// 产品配料BOM表,cy_product_burden + @Resource + private MakeBurdenService makeBurdenService;// 做法配料BOM表,cy_make_burden + @Resource + private ProductRatioService productRatioService;// 商品库存系数,cy_product_ratio + @Resource + private ProductService productService;// 商品资料,cy_product + @Resource + private StoreStorageService storeStorageService;// 门店仓库 + @Resource + private ProductStoreStockService productStoreStockService;// 门店原料库存,cy_product_store_stock + + /** + * 销售订单创建,库存处理事件 + */ + @Selector(EventKeys.SALES_ORDER_CREATE) + public void salesOrderInventoryProcessing(Event> event) { + String info = "销售订单创建,库存处理事件"; + logger.debug(">>>>>>>" + info + "。。。"); + + Map eventData = event.getData(); + String tenantId = eventData.get("tenantId")== null ? "" : eventData.get("tenantId").toString(); + String ticketId = eventData.get("ticketId") == null ? "" : eventData.get("ticketId").toString(); + if("".equals(tenantId) || "".equals(ticketId)){ + logger.error("ticketId为空"); + return; + } + try { + logger.debug("tenantId:" + tenantId); + logger.debug("ticketId:" + ticketId); + + // 查看设置,是否开启自动耗料处理 + boolean enableZdhl = validEnableZdhl(tenantId); + if (!enableZdhl) { + logger.debug("未启用自动耗料:[" + tenantId + "]"); + return; + } + + logger.debug("自动耗料[" + tenantId + "," + ticketId + "] Start..."); + // 查询订单信息,合并商品信息,做法信息 + // 查询销售订单信息 + StoreBusinessTicket ticket = storeBusinessTicketService.get(tenantId, ticketId); + logger.debug("ticket:{}", ticket); + if (ticket == null) { + logger.debug("销售订单信息不存在:[" + tenantId + "," + ticketId + "]"); + return; + } + + // 查询门店仓库 + String storeId = ticket.getStoreId(); + List storeStorageList = storeStorageService.getListByStoreId(tenantId, storeId); + if (CollectionUtils.isEmpty(storeStorageList)) { + logger.debug("销售订单所属门店没有仓库信息:[" + tenantId + "," + ticketId + "," + storeId + "]"); + return; + } + // 出库仓库 + StoreStorage storeStorage = storeStorageList.get(0); + + // 查询销售订单明细信息 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketId", ticketId)); + List ticketItemList = storeOrderProductService.getList(tenantId, criteria); + logger.debug("ticketItemList:{}", ticketItemList); + + // 查询销售订单做法信息 + criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketId", ticketId)); + List ticketItemMakeList = storeOrderProductMakeService.getList(tenantId, criteria); + logger.debug("ticketItemMakeList:{}", ticketItemMakeList); + + // 合并商品信息 + logger.debug("自动耗料[" + tenantId + "," + ticketId + "] 合并商品信息..."); + List productIdList = new ArrayList(); + List specIdList = new ArrayList(); + for (StoreOrderProduct ticketItem : ticketItemList) { + if (!productIdList.contains(ticketItem.getProductId())) { + productIdList.add(ticketItem.getProductId()); + } + + if (!specIdList.contains(ticketItem.getSpecId())) { + specIdList.add(ticketItem.getSpecId()); + } + } + logger.debug("productIdList:{}", productIdList); + logger.debug("specIdList:{}", specIdList); + + // 合并做法信息 + logger.debug("自动耗料[" + tenantId + "," + ticketId + "] 合并做法信息..."); + List makeIdList = new ArrayList(); + for (StoreOrderProductMake itemMake : ticketItemMakeList) { + if (!makeIdList.contains(itemMake.getMakeId())) { + makeIdList.add(itemMake.getMakeId()); + } + } + logger.debug("makeIdList:{}", makeIdList); + + // 查询产品配料 + List productBurdenList = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(specIdList)) { + criteria = new Criteria(); + criteria.add(Restrictions.in("specId", specIdList)); + productBurdenList = productBurdenService.getList(tenantId, criteria); + } + logger.debug("productBurdenList:{}", productBurdenList); + + // 查询做法配料 + List makeBurdenList = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(makeIdList)) { + criteria = new Criteria(); + criteria.add(Restrictions.in("makeId", makeIdList)); + makeBurdenList = makeBurdenService.getList(tenantId, criteria); + } + logger.debug("makeBurdenList:{}", makeBurdenList); + + // 合并所有ProductId并查找出所有需要管理库存的产品 + List allProductIdList = new ArrayList<>(); + allProductIdList.addAll(productIdList); + + // 产品配料 + for (ProductBurden productBurden : productBurdenList) { + if (!allProductIdList.contains(productBurden.getBurdenProductId())) { + allProductIdList.add(productBurden.getBurdenProductId()); + } + } + + // 做法配料 + for (MakeBurden makeBurden : makeBurdenList) { + if (!allProductIdList.contains(makeBurden.getBurdenProductId())) { + allProductIdList.add(makeBurden.getBurdenProductId()); + } + } + + // 查询出所有需要管理库存的产品 + List stockProductList = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(allProductIdList)) { + criteria = new Criteria(); + criteria.add(Restrictions.in("id", allProductIdList)); + criteria.add(Restrictions.eq("stockFlag", 1));// 管理库存,stockFlag,0-否;1-是; + stockProductList = productService.getList(tenantId, criteria); + } + logger.debug("stockProductList:{}", stockProductList); + + List stockProductIdList = new ArrayList<>(); + stockProductList.forEach(stockProduct -> stockProductIdList.add(stockProduct.getId())); + logger.debug("stockProductIdList:{}", stockProductIdList); + + if (CollectionUtils.isEmpty(stockProductIdList)) { + logger.debug("销售订单中没有需要管理库存的商品:[" + tenantId + "," + ticketId + "]"); + return; + } + + // 扣减库存 + logger.debug("自动耗料[" + tenantId + "," + ticketId + "] 扣减库存..."); + productStoreStockService.saveStockOutBySalesOrder(tenantId, stockProductList, storeStorage, ticket, ticketItemList, ticketItemMakeList, productBurdenList, makeBurdenList); + + // End + logger.debug("自动耗料[" + tenantId + "," + ticketId + "] End..."); + } catch (Exception e) { + logger.error("tenantId:" + tenantId); + logger.error("ticketId:" + ticketId); + logger.error(info + "发生异常", e); + } + } + + /** + * 验证是否启用自动耗料 + */ + private boolean validEnableZdhl(String tenantId) { + String info = "验证[" + tenantId + "]是否启用自动耗料"; + logger.debug(">>>>>>>" + info + "。。。"); + boolean result = false; + try { + // 可引入缓存,验证结果放入缓存10分钟后失效 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketSign", "storeStock")); + List settinglist = settingService.getList(tenantId, criteria); + Map settingMap = new HashMap<>(); + for (TicketPrintSetting setting : settinglist) { + settingMap.put(setting.getKey(), setting); + } + result = settingMap.get("zdhl") != null && StringUtils.equalsIgnoreCase("1", settingMap.get("zdhl").getValue()); + } catch (Exception ex) { + logger.error(info + "时,发生异常", ex); + } + logger.debug(">>>>>>>" + info + "。。。result:" + result); + return result; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/ServerDataVersionUpdateEvents.java b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/ServerDataVersionUpdateEvents.java new file mode 100644 index 0000000..f256929 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/ServerDataVersionUpdateEvents.java @@ -0,0 +1,67 @@ +package com.jwsaas.reactor.event; + +import com.alibaba.dubbo.common.utils.CollectionUtils; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.ServerDataVersion; +import com.jwsaas.service.food.ServerDataVersionService; +import org.apache.commons.lang3.StringUtils; +import reactor.bus.Event; +import reactor.spring.context.annotation.Consumer; +import reactor.spring.context.annotation.Selector; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * 服务版本信息修改; + * Created by Administrator on 2019\2\18 + */ +@Consumer +public class ServerDataVersionUpdateEvents extends BaseEvents { + + private static final String className = "ServerDataVersionUpdateEvents"; + @Resource + private ServerDataVersionService serverDataVersionService; + + + @SuppressWarnings("unchecked") + @Selector(EventKeys.SERVERDATAVERSION_UPDATE) + public void versionUpdate(Event> event){ + + String info = "服务版本信息更新事件"; + logger.debug(info + ">>>>>>>:" + event.getData()); + + Map eventData = event.getData(); + String tenantId = eventData.get("tenantId").toString(); + try { + String dateType = eventData.get("dataType").toString(); + if(StringUtils.isNotEmpty(dateType)){ + Criteria criter = new Criteria(); + criter.add(Restrictions.eq("dataType",dateType)); + List versions = serverDataVersionService.getList(tenantId,criter); + if(CollectionUtils.isNotEmpty(versions)){ + ServerDataVersion version = versions.get(0); + version.setDataVerion(new Date().getTime()+""); + version.setModifyDate(new Date()); + version.setModifyUser("openApi"); + serverDataVersionService.update(tenantId,version); + }else{ + ServerDataVersion version = new ServerDataVersion(); + version.setDataType(dateType); + version.setTenantId(tenantId); + version.setDataVerion(new Date().getTime()+""); + version.setCreateDate(new Date()); + version.setCreateUser("openApi"); + serverDataVersionService.save(tenantId,version); + } + } + } catch (Exception e) { + logger.error(className + ".versionUpdate(" + info + ") 发生异常", e); + } + + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/StoreAccountEvents.java b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/StoreAccountEvents.java new file mode 100644 index 0000000..1d1678e --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/StoreAccountEvents.java @@ -0,0 +1,155 @@ +package com.jwsaas.reactor.event; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; + +import javax.annotation.Resource; + +import org.redisson.api.RMapCache; + +import com.jwsaas.Constant; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.Store; +import com.jwsaas.entity.food.StoreAccount; +import com.jwsaas.entity.food.StoreAccountDetail; +import com.jwsaas.entity.food.StoreAccountRechargeRecord; +import com.jwsaas.service.food.StoreAccountDetailService; +import com.jwsaas.service.food.StoreAccountRechargeRecordService; +import com.jwsaas.service.food.StoreAccountService; +import com.jwsaas.service.food.StoreService; +import com.jwsaas.util.JSONUtil; +import com.jwsaas.util.StringUtils; +import com.jwsaas.utils.MathUtil; + +import reactor.bus.Event; +import reactor.spring.context.annotation.Consumer; +import reactor.spring.context.annotation.Selector; + +/*** + * 门店账户余额异步 + * + * @author louxutao + * + */ +@Consumer +public class StoreAccountEvents extends BaseEvents { + + @Resource + private StoreAccountRechargeRecordService storeAccountRechargeRecordService; + + @Resource + private StoreAccountDetailService storeAccountDetailService; + + @Resource + private StoreService storeService; + + @Resource + private StoreAccountService storeAccountService; + + /** + * 门店账户余额充值-微信异步通知 + */ + @Selector(EventKeys.STORE_ACCOUNT_WEIXINPAY_NOTIFY) + public void salesOrderInventoryProcessing(Event> event) { + String info = "门店账户余额充值-微信支付异步通知处理事件"; + logger.error(info+">>>>>>>>>>>>>>>>>>>>>>>>>>>"); + + try { + Map eventData = event.getData(); + if(null == eventData.get("tradeNo") || StringUtils.isBlank(eventData.get("tradeNo").toString())){ + logger.error(info+" ,时发生异常 单号为空"); + return; + } + String tenantId = eventData.get("tenantId").toString(); + String tradeNo = eventData.get("tradeNo").toString(); + + String clientSign = "wxyh:recharge:"+tradeNo; + RMapCache rechargeMap = redissonClient.getMapCache(clientSign); + if(rechargeMap.keySet().size() > 0){ + logger.error(info+" ,tenantId:{} busNo:",tenantId,tradeNo); + return; + } + rechargeMap.put(clientSign, clientSign, 10, TimeUnit.MINUTES); + rechargeMap.expire(10, TimeUnit.MINUTES); + + String outTradeNo = eventData.get("outTradeNo").toString(); + String prepayId = eventData.get("prepayId").toString(); + String attach = eventData.get("attach").toString(); + String notifyResponse = eventData.get("notifyResponse").toString(); + logger.error(info+", tenantId:{} tradeNo:{} outTradeNo:{} prepayId:{}",tenantId,tradeNo,outTradeNo,prepayId); + + // 充值订单 + StoreAccountRechargeRecord record = storeAccountRechargeRecordService.find(tenantId,"ticketNo", tradeNo); + if (null == record) { + logger.error(info+" tradeNo:{} 订单不存在",tradeNo); + return; + } + if (record.getRechargeStatus() == 2) { + logger.error(info+" tradeNo:{} 订单已充值",tradeNo); + return; + } + Map param = JSONUtil.parseObject(record.getContent(), Map.class); + + // 门店信息 + Store store = storeService.get(tenantId, record.getStoreId()); + if (store == null) { + logger.error(info+" tradeNo:{} 门店ID不存在",tradeNo); + return; + } + + // 账户信息 + StoreAccount storeAccount = storeAccountService.get(tenantId, record.getAccountId()); + if (storeAccount == null) { + logger.error(info+" tradeNo:{} 门店余额账户不存在",tradeNo); + return; + } + + // 充值详情 + StoreAccountDetail detail = storeAccountDetailService.find(tenantId, "voucherNo", record.getPayVoucherNo()); + if(null != detail){ + logger.error(info+" tradeNo:{} 订单已充值",tradeNo); + return; + } + + // 充值 + detail = new StoreAccountDetail(); + detail.setAccountId(record.getAccountId());// 账户ID + detail.setStoreId(record.getStoreId());// 门店Id + detail.setStoreNo(store.getNo());// 门店编号 + detail.setType(1);// 收支类型(1-收入;2-支出;) + detail.setBusType(1);// 业务类型 + detail.setBusNo(tradeNo);// 业务单号 + detail.setBusTime(new Date());// 交易时间 + detail.setPayType(String.valueOf(2));// 支付方式,0-银行卡充值1-支付宝充值2-微信支付充值3-配送扣款4-配送退款 + detail.setVoucherNo(prepayId);// 支付凭证 + detail.setStatus(1);// 0-待确认;1-成功;2-失败; + detail.setAmount(record.getAmount());// 发生金额 + detail.setAftAmount(MathUtil + .add(new BigDecimal(storeAccount.getAmount()), new BigDecimal(record.getAmount())).doubleValue());// 发生后余额 + detail.setWorkerNo(null == param.get("workerNo") ? "999999" : param.get("workerNo").toString());// 工号 + detail.setPosNo(null == param.get("posNo") ? "666666" : param.get("posNo").toString());// 设备编号 + detail.setSourceSign(null == param.get("sourceSign") ? "liteApp" : param.get("sourceSign").toString());// 来源标识 + detail.setDescription(info + " 充值成功");// 备注 + detail.setCreateUser(Constant.CREATE_USER); + storeAccount = storeAccountService.save4Recharge(tenantId, record.getStoreId(), record.getAccountId(),detail); + + // 修改充值订单状态为已支付并且充值 + record.setStatus(2); // 已支付 + record.setRechargeStatus(2);// 已充值 + record.setNotifySign(attach);// 通知标识 + record.setNotifyData(notifyResponse); // 通知内容 + record.setModifyUser(Constant.CREATE_USER); + storeAccountRechargeRecordService.update(tenantId, record); + logger.error(info+" tradeNo:"+tradeNo+" 门店充值成功"); + + } catch (Exception e) { + logger.error(info + "发生异常", e); + e.printStackTrace(); + } + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/WorkerLoginEvents.java b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/WorkerLoginEvents.java new file mode 100644 index 0000000..13e8163 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/WorkerLoginEvents.java @@ -0,0 +1,86 @@ +package com.jwsaas.reactor.event; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import org.apache.commons.collections4.CollectionUtils; + +import com.jwsaas.Constant; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.PosInfo; +import com.jwsaas.entity.ops.TenantPosLoginLog; + +import reactor.bus.Event; +import reactor.spring.context.annotation.Consumer; +import reactor.spring.context.annotation.Selector; + +@Consumer +public class WorkerLoginEvents extends BaseEvents { + + @Resource + private com.jwsaas.service.ops.TenantPosLoginLogService tenantPosLoginLogService; + + @Selector(EventKeys.WORKER_LOGIN) + public void login(Event> event) { + String info = "门店员工登录"; + logger.debug(">>>>>>>" + info + "。。。"); + + Map eventData = event.getData(); + // String appKey = eventData.get("appKey").toString(); + // String appId = eventData.get("appId").toString(); + String tenantCode = eventData.get("tenantCode").toString(); + // String appCode = eventData.get("appCode").toString(); + String tenantId = eventData.get("tenantId").toString(); + String storeId = eventData.get("storeId").toString(); + String storeNo = eventData.get("storeNo").toString(); + String storeName = eventData.get("storeName").toString(); + // String workId = eventData.get("workId").toString(); + // String workNo = eventData.get("workNo").toString(); + // String workName = eventData.get("workName").toString(); + String posNo = eventData.get("posNo").toString(); + Date loginTime = (Date) eventData.get("loginTime"); + PosInfo posInfo = (PosInfo) eventData.get("posInfo"); + + try { + logger.debug("tenantId:" + tenantId); + logger.debug("storeNo:" + storeNo); + logger.debug("storeName:" + storeName); + logger.debug("posNo:" + posNo); + logger.debug("loginTime:" + loginTime); + logger.debug("posInfo:" + posInfo); + + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("tenantCode", tenantId)); + criteria.add(Restrictions.eq("storeNo", storeNo)); + criteria.add(Restrictions.eq("posNo", posNo)); + List tenantPosLoginLogList = tenantPosLoginLogService.getList(Constant.DEFAULT_DB_SIGN, criteria); + TenantPosLoginLog posLoginLog = new TenantPosLoginLog(); + posLoginLog.setTenantCode(tenantCode); + posLoginLog.setStoreId(storeId); + posLoginLog.setStoreNo(storeNo); + posLoginLog.setStoreName(storeName); + posLoginLog.setPosNo(posNo); + posLoginLog.setLoginTime(loginTime);// 登入时间 + posLoginLog.setLogoutTime(null);// 登出时间 + if (CollectionUtils.isNotEmpty(tenantPosLoginLogList)) { + posLoginLog.setId(tenantPosLoginLogList.get(0).getId()); + posLoginLog.setModifyUser(Constant.CREATE_USER); + posLoginLog.setModifyDate(new Date()); + tenantPosLoginLogService.update(Constant.DEFAULT_DB_SIGN, posLoginLog); + } else { + posLoginLog.setAppSign(posInfo.getAppSign());// 应用标识 + posLoginLog.setTerminalType(posInfo.getTerminalType());// 终端类型 + posLoginLog.setCreateUser(Constant.CREATE_USER); + tenantPosLoginLogService.save(Constant.DEFAULT_DB_SIGN, posLoginLog); + } + } catch (Exception e) { + logger.error(info + ",更新POS最后登陆时间时,发生异常", e); + } + + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/WxdcOrderEvents.java b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/WxdcOrderEvents.java new file mode 100644 index 0000000..f363d02 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/WxdcOrderEvents.java @@ -0,0 +1,597 @@ +package com.jwsaas.reactor.event; + +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.jwsaas.Constant; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.food.WxSalesOrder; +import com.jwsaas.entity.food.WxStore; +import com.jwsaas.entity.task.Schedule; +import com.jwsaas.entity.wxdc.WeixinAccount; +import com.jwsaas.entity.wxdc.WeixinUser; +import com.jwsaas.mqtt.MqttClientExt; +import com.jwsaas.task.TaskJobHandler; +import com.jwsaas.task.utils.TaskOpenUtils; +import com.jwsaas.util.CronUtil; +import com.jwsaas.util.DateUtils; +import com.jwsaas.util.JSONUtil; +import com.jwsaas.weixin.TemplateMessageApi; +import com.jwsaas.weixin.WeixinUtil; +import com.jwsaas.weixin.bean.TemplateMessage; +import com.jwsaas.weixin.bean.Token; + +import reactor.bus.Event; +import reactor.spring.context.annotation.Consumer; +import reactor.spring.context.annotation.Selector; + +@Consumer +public class WxdcOrderEvents extends BaseWxdcEvents { + + @Autowired + private com.jwsaas.cache.CacheService cacheService; + @Autowired + private MqttClientExt mqttClient; + @Autowired + private com.jwsaas.service.wxdc.WeixinAccountService weixinAccountService; + @Autowired + private com.jwsaas.service.wxdc.WeixinUserService weixinUserService; + @Autowired + private WeixinUtil weixinUtil; + @Autowired + private TaskOpenUtils taskOpenUtils; + + @Selector(EventKeys.WXDC_ORDER_CREATE) + public void newOrderNotifyStore(Event> event) { + String info = "用户下单成功,通知门店"; + logger.info(">>>>>>>" + info + "。。。"); + Map eventData = event.getData(); + String appKey = eventData.get("appKey").toString(); + String appId = eventData.get("appId").toString(); + String tenantCode = eventData.get("tenantCode").toString(); + String appCode = eventData.get("appCode").toString(); + String wid = eventData.get("wid").toString(); + WxStore wxStore = (WxStore) eventData.get("wxStore"); + WxSalesOrder wxSalesOrder = (WxSalesOrder) eventData.get("wxSalesOrder"); + try { + orderStatusNotify(tenantCode, wxStore.getStoreId(), wxSalesOrder.getId(), 1); + } catch (Exception e) { + logger.error(info + "时,发生异常", e); + } + } + + /** + * 根据微信账户信息和Key,获取模板消息ID + * + * @param weixinAccount + * @param key + * @return + */ + private String getTemplateId(WeixinAccount weixinAccount, String key) { + Map msgMap = new HashMap<>(); + if (StringUtils.isNoneBlank(weixinAccount.getTemplateMsg())) { + msgMap = JSONUtil.parseObject(weixinAccount.getTemplateMsg(), new TypeReference>() { + }); + } + return msgMap.get(key); + } + + @Selector(EventKeys.WXDC_ORDER_CREATE) + public void newOrderNotifyUser(Event> event) { + String info = "用户下单成功,推送模板消息"; + logger.info(">>>>>>>" + info + "。。。"); + Map eventData = event.getData(); + // String appKey = eventData.get("appKey").toString(); + // String appId = eventData.get("appId").toString(); + String tenantCode = eventData.get("tenantCode").toString(); + // String appCode = eventData.get("appCode").toString(); + String wid = eventData.get("wid").toString(); + // WxStore wxStore = (WxStore) eventData.get("wxStore"); + WxSalesOrder wxSalesOrder = (WxSalesOrder) eventData.get("wxSalesOrder"); + try { + WeixinUser weixinUser = null; + Token token = null; + WeixinAccount weixinAccount = null; + // 用户下单成功,发送模板消息 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("hashids", wid)); + List weixinAccountList = weixinAccountService.getList(Constant.DEFAULT_DB_SIGN, criteria); + if (CollectionUtils.isNotEmpty(weixinAccountList) && weixinAccountList.size() == 1) { + weixinAccount = weixinAccountList.get(0); + } + + String templateId = null; + if (weixinAccount != null) { + templateId = getTemplateId(weixinAccount, "orderCreate"); + // String templateId = + // "9-xJQVrJjzt5NIyhQL-XJjG8p1KwjJLAMt6Iki5NPeg";// 点餐成功通知 + } + if (StringUtils.isBlank(templateId)) { + return; + } + + token = weixinUtil.getToken(wid, null, weixinAccount.getAppId(), weixinAccount.getAppSecret()); + logger.info("token:{}", JSONUtil.toJSONString(token)); + weixinUser = getWeixinUser(tenantCode, wxSalesOrder.getMemberId()); + if (weixinUser != null && token != null) { + String openId = weixinUser.getOpenid(); + String tempTitle = "您好,您已成功下单"; + TemplateMessage msg = new TemplateMessage(openId, templateId, tempTitle); + msg.pushData("keyword1", wxSalesOrder.getNo()); // 单号 + msg.pushData("keyword2", wxSalesOrder.getTableNo()); // 台号 + msg.pushData("keyword3", "" + wxSalesOrder.getPeople()); // 人数 + msg.pushData("keyword4", "具体请查看订单详情"); // 商品 + msg.pushData("keyword5", DateUtils.format(wxSalesOrder.getSaleDate(), DateUtils.SHOW_DATETIME_FORMAT)); // 时间 + msg.pushData("remark", "祝您用餐愉快"); + TemplateMessageApi.sendTemplateMessage(token, msg); + } + } catch (Exception e) { + logger.error(info + "时,发生异常", e); + } + } + + /** + * 用户下单成功,创建计划任务
+ *

+ * 功能说明:用户支付成功,下单完成2分钟商家不接单自动退单. + *

+ */ + @Selector(EventKeys.WXDC_ORDER_CREATE) + public void newOrderAddTask(Event> event) { + String info = "用户下单成功,创建计划任务"; + logger.info(">>>>>>>" + info + "。。。"); + Map eventData = event.getData(); + // String appKey = eventData.get("appKey").toString(); + // String appId = eventData.get("appId").toString(); + String tenantCode = eventData.get("tenantCode").toString(); + // String appCode = eventData.get("appCode").toString(); + // String wid = eventData.get("wid").toString(); + WxStore wxStore = (WxStore) eventData.get("wxStore"); + WxSalesOrder wxSalesOrder = (WxSalesOrder) eventData.get("wxSalesOrder"); + try { + String currentUser = Constant.CREATE_USER; + /*-------------开启计划任务---------------*/ + Schedule schedule = new Schedule(); + schedule.setSign("Wxdc_Auto_Cancel_" + tenantCode + "_" + wxStore.getNo() + "_" + wxSalesOrder.getNo());// 标识 + schedule.setJobDesc("微信点餐订单[" + tenantCode + "," + wxStore.getNo() + "," + wxSalesOrder.getNo() + "]");// 任务描述 + Date executorTime = null; + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.MINUTE, StringUtils.equals("373001", tenantCode) ? 5 : 10); + executorTime = calendar.getTime(); + String jobCron = CronUtil.getCron(executorTime); + schedule.setJobCron(jobCron);// cron表达式 + schedule.setExecutorHandler(TaskJobHandler.WXDC_ORDER_AUTO_CANCEL.getSign());// 执行器Handler + String executorParam = "tenantId#" + tenantCode + ",storeNo#" + wxStore.getNo() + ",ticketId#" + wxSalesOrder.getId() + ",ticketNo#" + wxSalesOrder.getNo(); + schedule.setExecutorParam(executorParam);// 执行参数 + schedule.setAlarmEmail(taskOpenUtils.getAlarmEmail());// 报警邮件 + schedule.setAuthor(currentUser);// 负责人 + schedule.setTenantId(tenantCode); + schedule.setCreateDate(new Date()); + schedule.setCreateUser(currentUser); + Boolean addTaskResult = taskOpenUtils.saveSchedule(schedule); + if (addTaskResult) { + logger.info("计划任务创建成功--->" + schedule.getJobDesc()); + } else { + logger.warn("计划任务创建失败--->" + schedule.getJobDesc()); + } + } catch (Exception e) { + logger.error(info + "时,发生异常", e); + } + } + + /** + * 商家接单后,门店相关事件 + */ + @Selector(EventKeys.WXDC_ORDER_STORE_CONFIRM) + public void orderStoreConfirm(Event> event) { + String info = "商家接单后,门店相关事件"; + logger.info(">>>>>>>" + info + "。。。"); + Map eventData = event.getData(); + String appKey = eventData.get("appKey").toString(); + String appId = eventData.get("appId").toString(); + String tenantCode = eventData.get("tenantCode").toString(); + String appCode = eventData.get("appCode").toString(); + String wid = eventData.get("wid").toString(); + WxStore wxStore = (WxStore) eventData.get("wxStore"); + WxSalesOrder wxSalesOrder = (WxSalesOrder) eventData.get("wxSalesOrder"); + try { + orderStatusNotify(tenantCode, wxStore.getStoreId(), wxSalesOrder.getId(), 5); + } catch (Exception e) { + logger.error(info + "时,发生异常", e); + } + } + + /** + * 商家接单后,给用户推送模板消息 + */ + @Selector(EventKeys.WXDC_ORDER_STORE_CONFIRM) + public void orderStoreConfirmNotifyUser(Event> event) { + String info = "商家接单后,给用户推送模板消息"; + logger.info(">>>>>>>" + info + "。。。"); + Map eventData = event.getData(); + String appKey = eventData.get("appKey").toString(); + String appId = eventData.get("appId").toString(); + String tenantCode = eventData.get("tenantCode").toString(); + String appCode = eventData.get("appCode").toString(); + String wid = eventData.get("wid").toString(); + WxStore wxStore = (WxStore) eventData.get("wxStore"); + WxSalesOrder wxSalesOrder = (WxSalesOrder) eventData.get("wxSalesOrder"); + try { + // 商家接单后,通知用户取餐号 + String memberId = wxSalesOrder.getMemberId(); + String topic = "wxdc/cy2/order/" + wid + "/" + memberId; + Map notifyData = new HashMap<>(); + notifyData.put("orderNo", wxSalesOrder.getNo()); + notifyData.put("type", 4); + notifyData.put("status", 1); + notifyData.put("takeNo", wxSalesOrder.getTakeNo());// 取餐号 + sendMessageToUser(topic, notifyData); + + WeixinUser weixinUser = null; + Token token = null; + WeixinAccount weixinAccount = null; + // 商家接单后,给用户推送模板消息 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("hashids", wid)); + List weixinAccountList = weixinAccountService.getList(Constant.DEFAULT_DB_SIGN, criteria); + if (CollectionUtils.isNotEmpty(weixinAccountList) && weixinAccountList.size() == 1) { + weixinAccount = weixinAccountList.get(0); + } + + String templateId = null; + if (weixinAccount != null) { + templateId = getTemplateId(weixinAccount, "storeConfirm"); + // String templateId = + // "vl_OD2Z0nIMSXn3pyWNcisOrVwoSSViBgdZ9tmkNXHg"; + } + if (StringUtils.isBlank(templateId)) { + return; + } + + token = weixinUtil.getToken(wid, null, weixinAccount.getAppId(), weixinAccount.getAppSecret()); + logger.info("token:{}", JSONUtil.toJSONString(token)); + weixinUser = getWeixinUser(tenantCode, wxSalesOrder.getMemberId()); + if (weixinUser != null && token != null) { + String openId = weixinUser.getOpenid(); + String tempTitle = "商家已接单";// 接单提醒 + TemplateMessage msg = new TemplateMessage(openId, templateId, tempTitle); + msg.pushData("keyword1", wxSalesOrder.getNo()); // 订单号 + msg.pushData("keyword2", wxSalesOrder.getTakeNo()); // 取餐码 + msg.pushData("keyword3", wxSalesOrder.getStoreName()); // 就餐门店 + msg.pushData("keyword4", "具体请查看订单详情"); // 下单菜品 + msg.pushData("keyword5", "" + wxSalesOrder.getAmount()); // 订单金额 + msg.pushData("remark", "商家已接单,祝您用餐愉快!"); + TemplateMessageApi.sendTemplateMessage(token, msg); + } + } catch (Exception e) { + logger.error(info + "时,发生异常", e); + } + } + + /** + * 商家接单后,创建计划任务
+ *

+ * 功能说明:商家接单后,60分钟订单自动完成. + *

+ */ + @Selector(EventKeys.WXDC_ORDER_STORE_CONFIRM) + public void orderStoreConfirmAddTask(Event> event) { + String info = "商家接单后,60分钟订单自动完成"; + logger.info(">>>>>>>" + info + "。。。"); + Map eventData = event.getData(); + // String appKey = eventData.get("appKey").toString(); + // String appId = eventData.get("appId").toString(); + String tenantCode = eventData.get("tenantCode").toString(); + // String appCode = eventData.get("appCode").toString(); + // String wid = eventData.get("wid").toString(); + WxStore wxStore = (WxStore) eventData.get("wxStore"); + WxSalesOrder wxSalesOrder = (WxSalesOrder) eventData.get("wxSalesOrder"); + try { + String currentUser = Constant.CREATE_USER; + /*-------------开启计划任务---------------*/ + Schedule schedule = new Schedule(); + schedule.setSign("Wxdc_Auto_Finish_" + tenantCode + "_" + wxStore.getNo() + "_" + wxSalesOrder.getNo());// 标识 + schedule.setJobDesc("微信点餐订单[" + tenantCode + "," + wxStore.getNo() + "," + wxSalesOrder.getNo() + "]");// 任务描述 + Date executorTime = null; + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.MINUTE, 60); + executorTime = calendar.getTime(); + String jobCron = CronUtil.getCron(executorTime); + schedule.setJobCron(jobCron);// cron表达式 + schedule.setExecutorHandler(TaskJobHandler.WXDC_ORDER_AUTO_FINISH.getSign());// 执行器Handler + String executorParam = "tenantId#" + tenantCode + ",storeNo#" + wxStore.getNo() + ",ticketId#" + wxSalesOrder.getId() + ",ticketNo#" + wxSalesOrder.getNo(); + schedule.setExecutorParam(executorParam);// 执行参数 + schedule.setAlarmEmail(taskOpenUtils.getAlarmEmail());// 报警邮件 + schedule.setAuthor(currentUser);// 负责人 + schedule.setTenantId(tenantCode); + schedule.setCreateDate(new Date()); + schedule.setCreateUser(currentUser); + Boolean addTaskResult = taskOpenUtils.saveSchedule(schedule); + if (addTaskResult) { + logger.info("计划任务创建成功--->" + schedule.getJobDesc()); + } else { + logger.warn("计划任务创建失败--->" + schedule.getJobDesc()); + } + } catch (Exception e) { + logger.error(info + "时,发生异常", e); + } + } + + /** + * 商家取消(拒单),门店相关事件 + */ + @Selector(EventKeys.WXDC_ORDER_STORE_CANCEL) + public void orderStoreCancel(Event> event) { + String info = "商家取消(拒单),门店相关事件"; + logger.info(">>>>>>>" + info + "。。。"); + Map eventData = event.getData(); + String appKey = eventData.get("appKey").toString(); + String appId = eventData.get("appId").toString(); + String tenantCode = eventData.get("tenantCode").toString(); + String appCode = eventData.get("appCode").toString(); + String wid = eventData.get("wid").toString(); + WxStore wxStore = (WxStore) eventData.get("wxStore"); + WxSalesOrder wxSalesOrder = (WxSalesOrder) eventData.get("wxSalesOrder"); + try { + orderStatusNotify(tenantCode, wxStore.getStoreId(), wxSalesOrder.getId(), 4); + } catch (Exception e) { + logger.error(info + "时,发生异常", e); + } + } + + /** + * 商家取消(拒单),给用户推送模板消息 + */ + @Selector(EventKeys.WXDC_ORDER_STORE_CANCEL) + public void orderStoreCancelNotifyUser(Event> event) { + String info = "商家取消(拒单),给用户推送模板消息"; + logger.info(">>>>>>>" + info + "。。。"); + Map eventData = event.getData(); + String appKey = eventData.get("appKey").toString(); + String appId = eventData.get("appId").toString(); + String tenantCode = eventData.get("tenantCode").toString(); + String appCode = eventData.get("appCode").toString(); + String wid = eventData.get("wid").toString(); + WxStore wxStore = (WxStore) eventData.get("wxStore"); + WxSalesOrder wxSalesOrder = (WxSalesOrder) eventData.get("wxSalesOrder"); + try { + // 商家拒单后,通知用户 + String memberId = wxSalesOrder.getMemberId(); + String topic = "wxdc/cy2/order/" + wid + "/" + memberId; + Map notifyData = new HashMap<>(); + notifyData.put("orderNo", wxSalesOrder.getNo()); + notifyData.put("type", 3); + notifyData.put("status", 1); + notifyData.put("cancelReason", wxSalesOrder.getCancelReason()); + sendMessageToUser(topic, notifyData); + + WeixinUser weixinUser = null; + Token token = null; + WeixinAccount weixinAccount = null; + // 商家接单后,给用户推送模板消息 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("hashids", wid)); + List weixinAccountList = weixinAccountService.getList(Constant.DEFAULT_DB_SIGN, criteria); + if (CollectionUtils.isNotEmpty(weixinAccountList) && weixinAccountList.size() == 1) { + weixinAccount = weixinAccountList.get(0); + } + + String templateId = null; + if (weixinAccount != null) { + templateId = getTemplateId(weixinAccount, "storeCancel"); + // String templateId = + // "THwSJPvIxqgOUG5NCl0XXYM9KWM8Xj5IbbqVxEj9rtY"; + } + if (StringUtils.isBlank(templateId)) { + return; + } + + token = weixinUtil.getToken(wid, null, weixinAccount.getAppId(), weixinAccount.getAppSecret()); + logger.info("token:{}", JSONUtil.toJSONString(token)); + weixinUser = getWeixinUser(tenantCode, wxSalesOrder.getMemberId()); + if (weixinUser != null && token != null) { + String openId = weixinUser.getOpenid(); + String tempTitle = "订单取消";// 拒单提醒 + TemplateMessage msg = new TemplateMessage(openId, templateId, tempTitle); + msg.pushData("keyword1", DateUtils.format(wxSalesOrder.getSaleDate(), DateUtils.SHOW_DATETIME_FORMAT)); // 下单时间 + msg.pushData("keyword2", "" + wxSalesOrder.getAmount()); // 订单金额 + msg.pushData("keyword3", wxSalesOrder.getStoreName() + "[" + wxSalesOrder.getNo() + "]"); // 订单详情 + msg.pushData("keyword4", "已取消"); // 订单状态 + msg.pushData("keyword5", wxSalesOrder.getCancelReason()); // 取消原因 + msg.pushData("remark", "您的订单已被商家取消,稍后您会收到退款。"); + TemplateMessageApi.sendTemplateMessage(token, msg); + } + } catch (Exception e) { + logger.error(info + "时,发生异常", e); + } + } + + /** + * 用户主动取消订单,用户相关事件 + */ + @Selector(EventKeys.WXDC_ORDER_USER_CANCEL) + public void orderUserCancel(Event> event) { + String info = "用户主动取消订单,用户相关事件"; + logger.info(">>>>>>>" + info + "。。。"); + Map eventData = event.getData(); + String appKey = eventData.get("appKey").toString(); + String appId = eventData.get("appId").toString(); + String tenantCode = eventData.get("tenantCode").toString(); + String appCode = eventData.get("appCode").toString(); + String wid = eventData.get("wid").toString(); + WxStore wxStore = (WxStore) eventData.get("wxStore"); + WxSalesOrder wxSalesOrder = (WxSalesOrder) eventData.get("wxSalesOrder"); + try { + WeixinUser weixinUser = null; + Token token = null; + WeixinAccount weixinAccount = null; + // 用户主动取消订单,给用户推送模板消息 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("hashids", wid)); + List weixinAccountList = weixinAccountService.getList(Constant.DEFAULT_DB_SIGN, criteria); + if (CollectionUtils.isNotEmpty(weixinAccountList) && weixinAccountList.size() == 1) { + weixinAccount = weixinAccountList.get(0); + } + + String templateId = null; + if (weixinAccount != null) { + templateId = getTemplateId(weixinAccount, "userCancel"); + // String templateId = + // "THwSJPvIxqgOUG5NCl0XXYM9KWM8Xj5IbbqVxEj9rtY"; + } + if (StringUtils.isBlank(templateId)) { + return; + } + + token = weixinUtil.getToken(wid, null, weixinAccount.getAppId(), weixinAccount.getAppSecret()); + logger.info("token:{}", JSONUtil.toJSONString(token)); + weixinUser = getWeixinUser(tenantCode, wxSalesOrder.getMemberId()); + if (weixinUser != null && token != null) { + String openId = weixinUser.getOpenid(); + String tempTitle = "您已成功取消该订单"; + TemplateMessage msg = new TemplateMessage(openId, templateId, tempTitle); + msg.pushData("keyword1", DateUtils.format(wxSalesOrder.getSaleDate(), DateUtils.SHOW_DATETIME_FORMAT)); // 下单时间 + msg.pushData("keyword2", "" + wxSalesOrder.getAmount()); // 订单金额 + msg.pushData("keyword3", wxSalesOrder.getStoreName() + "[" + wxSalesOrder.getNo() + "]"); // 订单详情 + msg.pushData("keyword4", "已取消"); // 订单状态 + msg.pushData("keyword5", wxSalesOrder.getCancelReason()); // 取消原因 + msg.pushData("remark", "您已成功取消该订单。如您已支付成功,稍后您会收到退款。"); + TemplateMessageApi.sendTemplateMessage(token, msg); + } + } catch (Exception e) { + logger.error(info + "时,发生异常", e); + } + } + + /** + * 用户主动取消订单,门店相关事件 + */ + @Selector(EventKeys.WXDC_ORDER_USER_CANCEL) + public void orderUserCancelNotifyStore(Event> event) { + String info = "用户主动取消订单,门店相关事件"; + logger.info(">>>>>>>" + info + "。。。"); + Map eventData = event.getData(); + String appKey = eventData.get("appKey").toString(); + String appId = eventData.get("appId").toString(); + String tenantCode = eventData.get("tenantCode").toString(); + String appCode = eventData.get("appCode").toString(); + String wid = eventData.get("wid").toString(); + WxStore wxStore = (WxStore) eventData.get("wxStore"); + WxSalesOrder wxSalesOrder = (WxSalesOrder) eventData.get("wxSalesOrder"); + try { + orderStatusNotify(tenantCode, wxStore.getStoreId(), wxSalesOrder.getId(), 2); + } catch (Exception e) { + logger.error(info + "时,发生异常", e); + } + } + + /** + * 接单超时自动取消,门店相关事件 + */ + @Selector(EventKeys.WXDC_ORDER_AUTO_CANCEL) + public void orderAutoCancelNotifyStore(Event> event) { + String info = "接单超时自动取消,门店相关事件"; + logger.info(">>>>>>>" + info + "。。。"); + Map eventData = event.getData(); + String tenantCode = eventData.get("tenantId").toString(); + // String wid = eventData.get("wid").toString(); + WxSalesOrder wxSalesOrder = (WxSalesOrder) eventData.get("wxSalesOrder"); + try { + orderStatusNotify(tenantCode, wxSalesOrder.getStoreId(), wxSalesOrder.getId(), 3); + } catch (Exception e) { + logger.error(info + "时,发生异常", e); + } + } + + /** + * 接单超时自动取消,用户相关事件 + */ + @Selector(EventKeys.WXDC_ORDER_AUTO_CANCEL) + public void orderAutoCancelNotifyUser(Event> event) { + String info = "商家接单超时自动取消,给用户推送模板消息"; + logger.info(">>>>>>>" + info + "。。。"); + Map eventData = event.getData(); + String tenantCode = eventData.get("tenantId").toString(); + String wid = eventData.get("wid").toString(); + WxSalesOrder wxSalesOrder = (WxSalesOrder) eventData.get("wxSalesOrder"); + try { + // 接单超时自动取消,通知用户 + String memberId = wxSalesOrder.getMemberId(); + String topic = "wxdc/cy2/order/" + wid + "/" + memberId; + Map notifyData = new HashMap<>(); + notifyData.put("orderNo", wxSalesOrder.getNo()); + notifyData.put("type", 3); + notifyData.put("status", 1); + notifyData.put("cancelReason", wxSalesOrder.getCancelReason()); + sendMessageToUser(topic, notifyData); + + WeixinUser weixinUser = null; + Token token = null; + WeixinAccount weixinAccount = null; + // 接单超时自动取消,给用户推送模板消息 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("hashids", wid)); + List weixinAccountList = weixinAccountService.getList(Constant.DEFAULT_DB_SIGN, criteria); + if (CollectionUtils.isNotEmpty(weixinAccountList) && weixinAccountList.size() == 1) { + weixinAccount = weixinAccountList.get(0); + } + + String templateId = null; + if (weixinAccount != null) { + templateId = getTemplateId(weixinAccount, "autoCancel"); + // String templateId = + // "THwSJPvIxqgOUG5NCl0XXYM9KWM8Xj5IbbqVxEj9rtY"; + } + if (StringUtils.isBlank(templateId)) { + return; + } + + token = weixinUtil.getToken(wid, null, weixinAccount.getAppId(), weixinAccount.getAppSecret()); + logger.info("token:{}", JSONUtil.toJSONString(token)); + weixinUser = getWeixinUser(tenantCode, wxSalesOrder.getMemberId()); + if (weixinUser != null && token != null) { + String openId = weixinUser.getOpenid(); + String tempTitle = "接单超时订单自动取消"; + TemplateMessage msg = new TemplateMessage(openId, templateId, tempTitle); + msg.pushData("keyword1", DateUtils.format(wxSalesOrder.getSaleDate(), DateUtils.SHOW_DATETIME_FORMAT)); // 下单时间 + msg.pushData("keyword2", "" + wxSalesOrder.getAmount()); // 订单金额 + msg.pushData("keyword3", wxSalesOrder.getStoreName() + "[" + wxSalesOrder.getNo() + "]"); // 订单详情 + msg.pushData("keyword4", "已取消"); // 订单状态 + msg.pushData("keyword5", wxSalesOrder.getCancelReason()); // 取消原因 + msg.pushData("remark", "接单超时订单自动取消,稍后您会收到退款。"); + TemplateMessageApi.sendTemplateMessage(token, msg); + } + } catch (Exception e) { + logger.error(info + "时,发生异常", e); + } + } + + /** + * 订单自动完成,用户相关事件 + */ + @Selector(EventKeys.WXDC_ORDER_AUTO_FINISH) + public void orderAutoFinishNotifyUser(Event> event) { + String info = "订单自动完成,用户相关事件"; + logger.info(">>>>>>>" + info + "。。。"); + Map eventData = event.getData(); + String tenantId = eventData.get("tenantId").toString(); + String tenantCode = eventData.get("tenantCode").toString(); + String wid = eventData.get("wid").toString(); + WxSalesOrder wxSalesOrder = (WxSalesOrder) eventData.get("wxSalesOrder"); + try { + logger.info(info + ",tenantCode:{},ticketNo:{},", tenantCode, wxSalesOrder.getNo()); + } catch (Exception e) { + logger.error(info + "时,发生异常", e); + } + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/WxdcOrderPayEvents.java b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/WxdcOrderPayEvents.java new file mode 100644 index 0000000..035bba8 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/WxdcOrderPayEvents.java @@ -0,0 +1,914 @@ +package com.jwsaas.reactor.event; + +import java.math.BigDecimal; +import java.net.URLDecoder; +import java.net.URLEncoder; +import java.util.*; + +import javax.annotation.Resource; + +import com.jwsaas.Constants; +import com.jwsaas.entity.food.*; +import com.jwsaas.service.food.StoretableService; +import com.jwsaas.util.*; +import com.jwsaas.util.DateUtils; +import com.jwsaas.util.RandomUtils; +import com.jwsaas.utils.*; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.http.HttpResponse; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.fasterxml.jackson.core.type.TypeReference; +import com.jwsaas.Constant; +import com.jwsaas.api.entity.wxdc.SalesOrderItemEntity; +import com.jwsaas.api.entity.wxdc.SalesOrderItemMakeEntity; +import com.jwsaas.api.entity.wxdc.SalesOrderItemPromoEntity; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.wxdc.WeixinOrderPay; +import com.jwsaas.http.HttpTool; +import com.jwsaas.pay.weixin.api.WeiXinPayApi; +import com.jwsaas.pay.weixin.request.RefundRequest; +import com.jwsaas.pay.weixin.response.RefundResponse; +import com.jwsaas.pay.weixin.utils.SecurityUtils; +import com.jwsaas.weixin.SignUtil; + +import org.dom4j.Document; +import org.dom4j.DocumentHelper; +import org.dom4j.Element; + +import reactor.bus.Event; +import reactor.spring.context.annotation.Consumer; +import reactor.spring.context.annotation.Selector; + +@Consumer +public class WxdcOrderPayEvents extends BaseWxdcEvents { + + private final String workerNo = "999999"; + + @Resource + private com.jwsaas.service.food.WxPaymentParameterService wxPaymentParameterService; + @Resource + private com.jwsaas.service.food.WxSalesOrderService wxSalesOrderService; + @Resource + private com.jwsaas.service.food.WxSalesOrderItemService orderItemService; + @Resource + private com.jwsaas.service.food.WxSalesPaymentService paymentService; + @Resource + private com.jwsaas.service.wxdc.WeixinOrderPayService weixinOrderPayService; + @Resource + private com.jwsaas.service.food.StoreService storeService; + @Resource + private com.jwsaas.service.food.WxGoodsCategoryService wxGoodsCategoryService; + @Resource + private com.jwsaas.service.food.ProductUnitService productUnitService; + @Resource + private com.jwsaas.service.food.WxStoreService wxStoreService; + @Resource + private StoretableService storetableService; + + /** + * 微信点餐订单退款事件 + */ + @SuppressWarnings("unchecked") + @Selector(EventKeys.WXDC_ORDER_PAY_REFUND) + public void orderPayRefund(Event> event) { + String info = "微信点餐订单退款事件"; + logger.info(">>>>>>>" + info + "。。。"); + Map eventData = event.getData(); + // String appKey = eventData.get("appKey").toString(); + // String appId = eventData.get("appId").toString(); + String tenantCode = eventData.get("tenantCode").toString(); + // String appCode = eventData.get("appCode").toString(); + String wid = eventData.get("wid").toString(); + System.out.println(">>>>>>>>>>>>>eventData"); + System.out.println(eventData); + + WxStore wxStore = (WxStore) eventData.get("wxStore"); + WxSalesOrder wxSalesOrder = (WxSalesOrder) eventData.get("wxSalesOrder"); + try { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketId", wxSalesOrder.getId()));// 销售单ID + criteria.add(Restrictions.eq("storeId", wxStore.getId()));// 门店ID + List payList = paymentService.getList(tenantCode, criteria); + // 订单状态判断,先忽略 + + // 记录退款结果 + String currentUser = Constant.CREATE_USER; + // 微信支付退款-会员卡积分订单撤销结果 + Map refundPointResult = null; + List> refundResultList = new ArrayList<>(); + if ("05".equals(wxSalesOrder.getPayMode())) { + boolean refundFlag = true; + // 获取付款信息 + for (WxSalesPayment pay : payList) { + String payMode = pay.getPayMode(); + if (StringUtils.equalsIgnoreCase("05", pay.getPayMode())) { + // 微信支付 + // 获取门店支付参数 + // String erpStoreId = wxStore.getStoreId(); + String wxStoreId = wxStore.getId(); + List source = this.wxPaymentParameterService.getPaymentParameterByStoreId(tenantCode, wxStoreId); + List> payParamList = new ArrayList<>(); + for (WxPaymentParameter paymentParameter : source) { + Map map = new HashMap<>(); + map.put("tenantId", paymentParameter.getTenantId()); + map.put("id", paymentParameter.getId()); + map.put("no", paymentParameter.getNo()); + map.put("name", paymentParameter.getName()); + map.put("sign", paymentParameter.getSign()); + Map pbodyMap = JSONUtil.parseObject(paymentParameter.getPbody(), + new TypeReference>() { + }); + map.put("pbody", pbodyMap); + map.put("certText", paymentParameter.getCertText()); + + if (StringUtils.equals("05", payMode) + && (StringUtils.equalsIgnoreCase("wxpay", paymentParameter.getSign()) + || StringUtils.equalsIgnoreCase("subwxpay", paymentParameter.getSign()) + || StringUtils.equalsIgnoreCase("fbzf", paymentParameter.getSign()))) { + payParamList.add(map); + } + } + if (payParamList.size() == 0) { + logger.error("微信支付参数未配置,退款失败![" + tenantCode + "," + wxSalesOrder.getNo() + "]"); + return; + } + + Map payParam = payParamList.get(0); + + String certText = payParam.get("certText") == null ? null : payParam.get("certText").toString(); + if (StringUtils.isBlank(certText)) { + logger.error("微信支付参数未配置证书,退款失败![" + tenantCode + "," + wxSalesOrder.getNo() + "]"); + return; + } + Map pbodyMap = (Map) payParam.get("pbody"); + String appid = pbodyMap.get("appid").toString();// 公众账号ID + String mchid = pbodyMap.get("mchid").toString();// 商户号 + String subMchid = pbodyMap.get("submchid").toString();// 子商户号 + String appSecret = pbodyMap.get("appsecret").toString();// 密钥 + + String transactionId = pay.getVoucherNo();// 微信订单号 + String outTradeNo = pay.getPayNo();// 商户订单号 + String outRefundNo = tenantCode + wxStore.getNo() + + DateUtils.format(new Date(), DateUtils.DATETIME_FORMAT) + + RandomUtil.randomInt(10, 99);// 商户退款单号 + Double moneyActual = pay.getPaid();// 退款金额 + + RefundRequest refundRequest = new RefundRequest(); + refundRequest.setAppid(appid);// 公众账号ID + refundRequest.setMchId(mchid);// 商户号 + if (StringUtils.isNotBlank(subMchid)) { + refundRequest.setSubMchId(subMchid);// 子商户号 + } + if (StringUtils.isNotBlank(transactionId)) { + refundRequest.setTransactionId(transactionId);// 微信订单号 + } + if (StringUtils.isNotBlank(outTradeNo)) { + refundRequest.setOutTradeNo(outTradeNo);// 商户订单号 + } + refundRequest.setOutRefundNo(outRefundNo);// 商户退款单号 + // refundRequest.setTotalFee(new Double(moneyActual * + // 100).longValue());// 总金额 + refundRequest.setTotalFee(MathUtil + .multiply(BigDecimal.valueOf(moneyActual), BigDecimal.valueOf(100)).longValue());// 总金额 + // refundRequest.setRefundFee(new Double(moneyActual * + // 100).longValue());// 退款金额 + refundRequest.setRefundFee(MathUtil + .multiply(BigDecimal.valueOf(moneyActual), BigDecimal.valueOf(100)).longValue());// 退款金额 + + refundRequest.setOpUserId(currentUser); + String nonceStr = RandomUtil.generateString(32); + refundRequest.setNonceStr(nonceStr); + String sign = SecurityUtils.sign(appSecret, refundRequest); + refundRequest.setSign(sign); + logger.error("WeiXinPayResund--->refundRequest:" + JSONUtil.toJSONString(refundRequest)); + RefundResponse refundResponse = WeiXinPayApi.refund(refundRequest, certText); + logger.error("WeiXinPayResund--->response:" + JSONUtil.toJSONString(refundResponse)); + + boolean refundSuc = StringUtils.equalsIgnoreCase("SUCCESS", refundResponse.getReturnCode()) + && StringUtils.equalsIgnoreCase("SUCCESS", refundResponse.getResultCode()); + Map refundResult = new HashMap<>(); + refundResult.put("orderPay", pay); + refundResult.put("payMode", payMode); + refundResult.put("status", refundSuc); + refundResult.put("response", JSONUtil.toJSONString(refundResponse)); + refundResultList.add(refundResult); + + if (refundFlag && !refundSuc) { + refundFlag = false; + } + } else { + + logger.error(info + "时,发生异常 订单支付方式为微信支付 支付记录中存在非微信支付记录 :" + pay.getPayMode()); + } + } + // 退款成功 撤销会员积分订单 + if (refundFlag) { + // 会员卡退款 + WxSalesPayment pay = payList.get(0); + refundPointResult = refundByCardPay(wid, wxStore, wxSalesOrder, pay); + } + } else if ("02".equals(wxSalesOrder.getPayMode())) { + // 会员卡退款 + WxSalesPayment pay = payList.get(0); + Map refundResult = refundByCardPay(wid, wxStore, wxSalesOrder, pay); + if (null != refundResult) { + refundResultList.add(refundResult); + } else { + logger.error(info + "时,发生异常 会员卡订单撤回异常"); + } + } + + // 退款业务处理 + if (refundResultList.size() > 0) { + wxSalesOrderService.saveOrderPayRefund(tenantCode, wxSalesOrder.getId(), wxSalesOrder.getNo(), + refundResultList, currentUser, refundPointResult); + } + } catch (Exception e) { + logger.error(info + "时,发生异常", e); + } + } + + /** + * 巨为云店-点餐订单退款事件 + */ + @SuppressWarnings("unchecked") + @Selector(EventKeys.WXDC_ORDER_PAY_REFUND_LITEAPP) + public void orderPayRefundLiteApp(Event> event) { + String info = "巨为云店-点餐订单退款事件"; + logger.info(">>>>>>>" + info + "。。。"); + Map eventData = event.getData(); + // String appKey = eventData.get("appKey").toString(); + // String appId = eventData.get("appId").toString(); + String tenantCode = eventData.get("tenantCode").toString(); + // String appCode = eventData.get("appCode").toString(); + String wid = eventData.get("wid").toString(); + System.out.println(">>>>>>>>>>>>>eventData"); + System.out.println(eventData); + + WxStore wxStore = (WxStore) eventData.get("wxStore"); + WxSalesOrder wxSalesOrder = (WxSalesOrder) eventData.get("wxSalesOrder"); + try { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("ticketId", wxSalesOrder.getId()));// 销售单ID + criteria.add(Restrictions.eq("storeId", wxStore.getId()));// 门店ID + List payList = paymentService.getList(tenantCode, criteria); + // 订单状态判断,先忽略 + + // 记录退款结果 + String currentUser = Constant.CREATE_USER; + // 微信支付退款-会员卡积分订单撤销结果 + Map refundPointResult = null; + List> refundResultList = new ArrayList<>(); + if ("05".equals(wxSalesOrder.getPayMode())) { + boolean refundFlag = true; + // 获取付款信息 + for (WxSalesPayment pay : payList) { + String payMode = pay.getPayMode(); + if (StringUtils.equalsIgnoreCase("05", pay.getPayMode())) { + // 微信支付 + // 获取门店支付参数 + // String erpStoreId = wxStore.getStoreId(); + String wxStoreId = wxStore.getId(); + List source = this.wxPaymentParameterService.getPaymentParameterByStoreId(tenantCode, wxStoreId); + List> payParamList = new ArrayList<>(); + for (WxPaymentParameter paymentParameter : source) { + Map map = new HashMap<>(); + map.put("tenantId", paymentParameter.getTenantId()); + map.put("id", paymentParameter.getId()); + map.put("no", paymentParameter.getNo()); + map.put("name", paymentParameter.getName()); + map.put("sign", paymentParameter.getSign()); + Map pbodyMap = JSONUtil.parseObject(paymentParameter.getPbody(), + new TypeReference>() { + }); + map.put("pbody", pbodyMap); + map.put("certText", paymentParameter.getCertText()); + + if (StringUtils.equals("05", payMode) + && (StringUtils.equalsIgnoreCase("wxpay", paymentParameter.getSign()) + || StringUtils.equalsIgnoreCase("subwxpay", paymentParameter.getSign()))) { + payParamList.add(map); + } + } + if (payParamList.size() == 0) { + logger.error("微信支付参数未配置,退款失败![" + tenantCode + "," + wxSalesOrder.getNo() + "]"); + return; + } + + Map payParam = payParamList.get(0); + String certText = payParam.get("certText") == null ? null : payParam.get("certText").toString(); + if (StringUtils.isBlank(certText)) { + logger.error("微信支付参数未配置证书,退款失败![" + tenantCode + "," + wxSalesOrder.getNo() + "]"); + return; + } + Map pbodyMap = (Map) payParam.get("pbody"); + String appid = pbodyMap.get("appid").toString();// 公众账号ID + String mchid = pbodyMap.get("mchid").toString();// 商户号 + String subMchid = pbodyMap.get("submchid").toString();// 子商户号 + String appSecret = pbodyMap.get("appsecret").toString();// 密钥 + + String transactionId = pay.getVoucherNo();// 微信订单号 + String outTradeNo = pay.getPayNo();// 商户订单号 + String outRefundNo = tenantCode + wxStore.getNo() + + DateUtils.format(new Date(), DateUtils.DATETIME_FORMAT) + + RandomUtil.randomInt(10, 99);// 商户退款单号 + Double moneyActual = pay.getPaid();// 退款金额 + + RefundRequest refundRequest = new RefundRequest(); + refundRequest.setAppid(appid);// 公众账号ID + refundRequest.setMchId(mchid);// 商户号 + if (StringUtils.isNotBlank(subMchid)) { + refundRequest.setSubMchId(subMchid);// 子商户号 + } + if (StringUtils.isNotBlank(transactionId)) { + refundRequest.setTransactionId(transactionId);// 微信订单号 + } + if (StringUtils.isNotBlank(outTradeNo)) { + refundRequest.setOutTradeNo(outTradeNo);// 商户订单号 + } + refundRequest.setOutRefundNo(outRefundNo);// 商户退款单号 + refundRequest.setTotalFee(MathUtil + .multiply(BigDecimal.valueOf(moneyActual), BigDecimal.valueOf(100)).longValue());// 总金额 + refundRequest.setRefundFee(MathUtil + .multiply(BigDecimal.valueOf(moneyActual), BigDecimal.valueOf(100)).longValue());// 退款金额 + + refundRequest.setOpUserId(currentUser); + String nonceStr = RandomUtil.generateString(32); + refundRequest.setNonceStr(nonceStr); + String sign = SecurityUtils.sign(appSecret, refundRequest); + refundRequest.setSign(sign); + logger.error("WeiXinPayResund--->refundRequest:" + JSONUtil.toJSONString(refundRequest)); + RefundResponse refundResponse = WeiXinPayApi.refund(refundRequest, certText); + logger.error("WeiXinPayResund--->response:" + JSONUtil.toJSONString(refundResponse)); + + boolean refundSuc = StringUtils.equalsIgnoreCase("SUCCESS", refundResponse.getReturnCode()) + && StringUtils.equalsIgnoreCase("SUCCESS", refundResponse.getResultCode()); + Map refundResult = new HashMap<>(); + refundResult.put("orderPay", pay); + refundResult.put("payMode", payMode); + refundResult.put("status", refundSuc); + refundResult.put("response", JSONUtil.toJSONString(refundResponse)); + refundResultList.add(refundResult); + + if (refundFlag && !refundSuc) { + refundFlag = false; + } + } else { + + logger.error(info + "时,发生异常 订单支付方式为微信支付 支付记录中存在非微信支付记录 :" + pay.getPayMode()); + } + } + // 退款成功 撤销会员积分订单 + if (refundFlag) { + // 会员卡退款 + WxSalesPayment pay = payList.get(0); + refundPointResult = refundByCardPay(wid, wxStore, wxSalesOrder, pay); + } + } else if ("02".equals(wxSalesOrder.getPayMode())) { + // 会员卡退款 + WxSalesPayment pay = payList.get(0); + Map refundResult = refundByCardPay(wid, wxStore, wxSalesOrder, pay); + if (null != refundResult) { + refundResultList.add(refundResult); + } else { + logger.error(info + "时,发生异常 会员卡订单撤回异常"); + } + }else if("09".equals(wxSalesOrder.getPayMode())){ + boolean refundFlag = true; + // 获取付款信息 + for (WxSalesPayment pay : payList) { + String payMode = pay.getPayMode(); + if (StringUtils.equalsIgnoreCase("09", pay.getPayMode())) { + + String wxStoreId = wxStore.getId(); + List source = this.wxPaymentParameterService.getPaymentParameterByStoreId(tenantCode, wxStoreId); + List> payParamList = new ArrayList<>(); + for (WxPaymentParameter paymentParameter : source) { + Map map = new HashMap<>(); + map.put("tenantId", paymentParameter.getTenantId()); + map.put("id", paymentParameter.getId()); + map.put("no", paymentParameter.getNo()); + map.put("name", paymentParameter.getName()); + map.put("sign", paymentParameter.getSign()); + Map pbodyMap = JSONUtil.parseObject(paymentParameter.getPbody(), + new TypeReference>() { + }); + map.put("pbody", pbodyMap); + + if (StringUtils.equalsIgnoreCase("saobei", paymentParameter.getSign())) { + payParamList.add(map); + } + } + if (payParamList.size() == 0) { + logger.error("扫呗参数未配置,退款失败![" + tenantCode + "," + wxSalesOrder.getNo() + "]"); + return; + } + + Map payParam = payParamList.get(0); + if("saobei".equals(payParam.get("sign").toString())){ + // 扫呗退款 + String outTradeNo = pay.getBusNo();// 商户订单号 + String outRefundNo = tenantCode + wxStore.getNo() + + DateUtils.format(new Date(), DateUtils.DATETIME_FORMAT) + + RandomUtil.randomInt(10, 99);// 商户退款单号 + Double moneyActual = pay.getPaid();// 退款金额 + + String response = ""; + boolean refundSuc = false; + + JSONObject jsonObject = saobeiRefund(tenantCode,(Map)payParam.get("pbody"),outTradeNo,outRefundNo,pay.getMoney()); + if("01".equals(jsonObject.get("return_code").toString()) && "01".equals(jsonObject.get("result_code"))){ + refundSuc = true; + logger.debug(info+" 扫呗退款成功 outTradeNo:"+outTradeNo+" orderNo:"+wxSalesOrder.getNo() +" outRefundNo:"+outRefundNo+" moneyActual:"+moneyActual); + }else{ + response = JSON.toJSONString(jsonObject.get("return_msg")); + logger.error(info+" 扫呗退款时发生异常 "+response); + } + Map refundResultMap = new HashMap<>(); + refundResultMap.put("paySign", "saobei"); + refundResultMap.put("orderPay", pay); + refundResultMap.put("payMode", payMode); + refundResultMap.put("status", refundSuc); + refundResultMap.put("response", response); + refundResultList.add(refundResultMap); + } + } else { + + logger.error(info + "时,发生异常 订单支付方式为微信支付 支付记录中存在非微信支付记录 :" + pay.getPayMode()); + } + } + // 退款成功 撤销会员积分订单 + if (refundFlag) { + // 会员卡退款 + WxSalesPayment pay = payList.get(0); + refundPointResult = refundByCardPay(wid, wxStore, wxSalesOrder, pay); + } + } + + // 退款业务处理 + if (refundResultList.size() > 0) { + wxSalesOrderService.saveOrderPayRefund(tenantCode, wxSalesOrder.getId(), wxSalesOrder.getNo(), + refundResultList, currentUser, refundPointResult); + } + } catch (Exception e) { + logger.error(info + "时,发生异常", e); + } + } + + /** + * 扫呗退款; + * @param payParam + * @param outTradeNo + * @param outRefundNo + * @param money + * @return + */ + private JSONObject saobeiRefund(String tenantId,Map payParam, String outTradeNo, String outRefundNo, Double money) { + String info = "扫呗退款"; + logger.debug(info); + JSONObject result = null; + try{ + + + String moneyStr = ((Double)(money*100)).intValue()+""; + //moneyStr = moneyStr.substring(0,moneyStr.indexOf(".")); + WeixinOrderPay pay = weixinOrderPayService.find(Constant.DEFAULT_DB_SIGN,"orderNo",outTradeNo); + + Map paramMap = new LinkedHashMap<>(); + paramMap.put("pay_ver", "100"); + paramMap.put("pay_type", "010"); + paramMap.put("service_id", "30"); + paramMap.put("merchant_no", payParam.get("merchant_no").toString()); + paramMap.put("terminal_id", payParam.get("terminal_id").toString()); + paramMap.put("terminal_trace", outRefundNo); + paramMap.put("terminal_time", DateUtils.format(new Date(), "yyyyMMddHHmmss")); + paramMap.put("refund_fee",moneyStr); + paramMap.put("out_trade_no",pay.getBusNo()); + + + //String paraStrs = SignUtil.getSignCheckContent(paramMap); + String signKey = "&access_token="+payParam.get("signKey").toString(); + String sign = SignUtil.createSign(paramMap,signKey); + paramMap.put("pay_trace", ""); + paramMap.put("pay_time", ""); + paramMap.put("auth_code", ""); + paramMap.put("key_sign", sign); + HttpResponse httpResponse = HttpTool.url(payParam.get("gatewayUrl").toString()+"/pay/100/refund").contentType("application/json").body(JSON.toJSONString(paramMap)).post(); + String content = HttpTool.getResponseAsString(httpResponse); + result = JSON.parseObject(content); + }catch (Exception e){ + logger.error(info + "时,发生异常", e); + } + return result; + } + + /*** + * 会员卡支付退款 + */ + public Map refundByCardPay(String wid, WxStore wxStore, WxSalesOrder wxSalesOrder, + WxSalesPayment pay) { + String info = "微信点餐退款-会员卡退款"; + logger.info(">>>>>>>" + info + "。。。"); + + Map refundResult = null; + try { + // 查询会员卡支付信息 + String tradeVoucherNo = pay.getVoucherNo(); +// String tradeVoucherNo = ""; + String tradeNo = wxSalesOrder.getNo(); + String shopNo = wxStore.getNo(); + String posNo = wxStore.getPosNo(); + JSONObject queryPayResult = cardApiUtils.queryOrder(wid, tradeVoucherNo, tradeNo, shopNo, posNo, workerNo); + + + + if (null != queryPayResult.get("status") && ("1").equals(queryPayResult.getString("status"))) { + + String refundNo = "6666666666"; + String reason = "测试退款"; + // 撤销会员卡支付 + JSONObject cancelPayResult = cardApiUtils.cancelOrder(wid, tradeVoucherNo, tradeNo, refundNo, reason, + shopNo, posNo, workerNo); + if (null != cancelPayResult.get("status") && ("1").equals(cancelPayResult.getString("status"))) { + + JSONObject cancelResult = cancelPayResult.getJSONObject("data"); + // 撤销支付单号和会员系统业务参考号 + Map response = new HashMap(); + response.put("refundNo", refundNo); + response.put("refNo", cancelResult.getString("refNo")); + + refundResult = new HashMap(); + refundResult.put("orderPay", pay); + refundResult.put("payMode", "02"); + refundResult.put("status", true); + refundResult.put("response", JSONUtil.toJSONString(response)); + logger.info("会员卡支付 撤销订单成功:" + JSON.toJSONString(refundResult)); + } else { + logger.error(info + " 时,发生异常 订单[" + wxSalesOrder.getNo() + "] 交易凭证[" + pay.getVoucherNo() + + "] 未查询到会员卡支付信息"); + } + } else { + logger.debug(info + " 时, 订单[" + wxSalesOrder.getNo() + "] 交易凭证[" + pay.getVoucherNo() + + "] 未查询到会员卡支付信息"); + } + } catch (Exception ex) { + logger.error(info + " 时,发生异常", ex); + } + return refundResult; + } + + /** + * 巨为云店点餐-异步上传订单 + */ + @Selector(EventKeys.WXDC_WEIXINPAY_NOTIFY) + public void salesOrderCreate(Event> event) { + String info = "巨为云店点餐-异步上传订单"; + logger.info(">>>>>>>" + info + "。。。"); + + Map eventData = event.getData(); + String tenantId = eventData.get("tenantId").toString(); + String tradeNo = eventData.get("tradeNo").toString(); + String prepayId = eventData.get("prepayId").toString(); + String notifyResponse = eventData.get("notifyResponse").toString(); + + try { + logger.info("tenantId:" + tenantId); + logger.info("tradeNo:" + tradeNo); + logger.info("prepayId:" + prepayId); + + // 微信点单-微信支付 + WeixinOrderPay weixinOrder = weixinOrderPayService.find(Constant.DEFAULT_DB_SIGN, "outTradeNo",tradeNo); + if (null != weixinOrder) { + WxStore wxStore = wxStoreService.get(tenantId, weixinOrder.getStoreId()); + if (weixinOrder.getStatus() != 2) { + WxSalesOrder order = wxSalesOrderService.find(tenantId,"no", weixinOrder.getOrderNo()); + if (null != null) { + logger.error(info + " 订单已上传 ticketId:" + order.getId() + " ticketNo:" + order.getNo()); + } else { + // 更新微信订单为已支付 + weixinOrder.setStatus(1); + weixinOrder.setPayNo(prepayId); + weixinOrder.setSaleDate(DateUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss")); + weixinOrder.setResult("订单支付成功 prepayId:" + prepayId); + weixinOrder.setModifyDate(new Date()); + weixinOrder.setModifyUser(Constant.CREATE_USER); + this.weixinOrderPayService.update(Constant.DEFAULT_DB_SIGN, weixinOrder); + + WxSalesOrder wxSalesOrder = uploadOrder(weixinOrder,tenantId,prepayId); + if (null != wxSalesOrder) { + // 订单已上传 + weixinOrder.setOrderId(wxSalesOrder.getId()); + weixinOrder.setStatus(2); + weixinOrder.setResult(weixinOrder.getResult() + info + " 订单上传成功 "); + weixinOrder.setDescription(info + " 支付成功 订单上传成功 "); + logger.debug(info + " 订单上传成功 orderNo:"+ wxSalesOrder.getNo()); + +// // 会员积分 +// Map orderMap = new HashMap(); +// orderMap.put("wid", wid); +// orderMap.put("user", user); +// orderMap.put("orderPay", weixinOrder); +// giftPoint(orderMap); + } else { + weixinOrder.setStatus(1); + weixinOrder.setResult( weixinOrder.getResult() + " ;订单上传失败 "); + logger.error(weixinOrder.getResult() + info + " 订单上传失败"); + } + + weixinOrder.setModifyDate(new Date()); + weixinOrder.setModifyUser(Constant.CREATE_USER); + this.weixinOrderPayService.update(Constant.DEFAULT_DB_SIGN, weixinOrder); + logger.info(info+" >>>>>>>>>>>>>> 订单["+weixinOrder.getOrderNo()+"] 创建成功"); + + // 订单创建成功,执行后续事件 + logger.debug(">>>>>>>用户下单成功,执行后续事件"); + Map eventDatas = new HashMap<>(); + eventDatas.put("appKey", "appKey"); + eventDatas.put("appId", "appId"); + eventDatas.put("tenantCode", tenantId); + eventDatas.put("appCode", "appCode"); + eventDatas.put("tenantId", tenantId); + eventDatas.put("wid", weixinOrder.getWid()); + eventDatas.put("wxStore", wxStore); + eventDatas.put("wxSalesOrder", wxSalesOrder); + eventBus.notify(EventKeys.WXDC_ORDER_CREATE, Event.wrap(eventDatas)); + + // 发送新订单通知 + orderStatusNotify(tenantId, wxStore.getStoreId(), wxSalesOrder.getId(), 1); + } + } else { + logger.error(info + "订单上传提醒 订单【" + weixinOrder.getOrderNo() + "】" + weixinOrder.getStatus()); + } + } else { + logger.error(info + " 更新订单错误:订单【" + weixinOrder.getOrderNo() + "】不存在"); + } + logger.info(info + " >>>>>>>>>>>>> 结束"); + } catch (Exception e) { + logger.error(info + "发生异常", e); + } + } + + + /** + *扫呗支付异步通知 + * @param evt + */ + @Selector(EventKeys.SAOBEI_PAY_NOTIFY) + public void saobeiNotify(Event> evt) { + String info =" >>>>>>>扫呗支付异步通知 "; + logger.debug(info); + + Map data = evt.getData(); + try { + + String orderNo = data.get("orderNo").toString(); + String transaction_id = data.get("transaction_id").toString(); + String tenantId = data.get("tenantId").toString(); + + logger.debug(info+" transaction_id:{} orderNo:{}",transaction_id,orderNo); + // 微信点单-微信支付 + Criteria criteria = new Criteria(); + //criteria.add(Restrictions.eq("outTradeNo", outTradeNo)); + criteria.add(Restrictions.eq("orderNo", orderNo)); + List weixinOrders = weixinOrderPayService.getList(Constants.DEFAULT_DB_SIGN,criteria); + if(weixinOrders.size()>0){ + WeixinOrderPay weixinOrder = weixinOrders.get(0); + String prepayId = weixinOrder.getPayNo(); + if(StringUtils.isEmpty(prepayId)){ + prepayId = transaction_id; + } + + // 支付成功 上传订单 + + uploadOrder(weixinOrder,tenantId,prepayId); + + // 保存微信支付异步通知信息 +// saveNotifyResponse(account,wid,data,request); + }else{ + logger.error(info+"时发生异常 订单不存在 "); + } + + } catch (Exception ex) { + logger.error("Weixin Pay Unified Order Exception", ex); + } + } + + + + /** + * 上传订单 + * @param weixinOrder + * @param tenantId + * @param prepayId + * @return + */ + public WxSalesOrder uploadOrder(WeixinOrderPay weixinOrder,String tenantId,String prepayId){ + String info = "订单上传"; + WxSalesOrder wxSalesOrder = null; + try { + String storeId = weixinOrder.getStoreId(); + String storeName = weixinOrder.getStoreName(); + String storeNo = weixinOrder.getStoreNo(); + + logger.debug("weixinOrder:" + weixinOrder); + + String createUser = Constant.CREATE_USER; + Date saleDate = new Date(); + String currentDate = DateUtils.format(saleDate, DateUtils.SHOW_DATE_FORMAT); + + wxSalesOrder = new WxSalesOrder(); + wxSalesOrder.setNo(weixinOrder.getOrderNo());// 单据编号 + Integer daySeq = this.wxSalesOrderService.getDaySeqByStoreId(tenantId, currentDate, weixinOrder.getStoreId()); + logger.debug("daySeq:" + daySeq); + // 门店当天的订单流水号(每天流水号从1开始) + wxSalesOrder.setDaySeq(daySeq == null ? "1" : daySeq.toString()); + wxSalesOrder.setWid(weixinOrder.getWid()); + wxSalesOrder.setMemberId(StringUtils.isNoneEmpty(weixinOrder.getMemberId()) ? weixinOrder.getMemberId() : weixinOrder.getUserId());// + wxSalesOrder.setPhone(weixinOrder.getBookMobile());// 用户手机号 + wxSalesOrder.setStoreId(weixinOrder.getStoreId());// 门店ID + wxSalesOrder.setStoreNo(weixinOrder.getStoreNo());// 门店编号 + wxSalesOrder.setStoreName(weixinOrder.getStoreName());// 门店名称 + wxSalesOrder.setStatus(0);// 单据状态 + wxSalesOrder.setRefundStatus(0);// 退单状态 + wxSalesOrder.setChannel("2");// 销售渠道 + wxSalesOrder.setSaleDate(saleDate);// 销售时间 + wxSalesOrder.setTableNo(weixinOrder.getTableNo());// 餐桌号 + if(StringUtils.isEmpty(weixinOrder.getTableName())){ + if(StringUtils.isNotEmpty(weixinOrder.getTableNo())) { + List storetables = storetableService.findList(tenantId, "no", weixinOrder.getTableNo()); + if(CollectionUtils.isNotEmpty(storetables)){ + wxSalesOrder.setTableName(storetables.get(0).getName()); + } + } + }else{ + wxSalesOrder.setTableName(weixinOrder.getTableName()); + } + wxSalesOrder.setPeople(1);// 人数 + wxSalesOrder.setBusMode(Integer.parseInt(weixinOrder.getBusMode()));// 营业模式 + wxSalesOrder.setBookTime(weixinOrder.getBookTime());// 预定时间 + double amount = weixinOrder.getAmount(); + double DiscountTotal = weixinOrder.getDiscountAmount(); + wxSalesOrder.setAmount(amount);// 消费金额 + wxSalesOrder.setDiscountTotal(DiscountTotal);// 优惠额 + Double discount = MathUtil.eq(BigDecimal.ZERO, new BigDecimal(amount)) ? 0 + : MathUtil.divide(new BigDecimal(DiscountTotal), new BigDecimal(amount)).doubleValue(); + wxSalesOrder.setDiscount(discount);// 优惠率 + wxSalesOrder.setReceivable(weixinOrder.getReceiveAmount());// 应收金额 + wxSalesOrder.setMaling(0.0);// 抹零金额 + wxSalesOrder.setPaid(0.0);// 实收金额 + wxSalesOrder.setNoOrg(null);// 原单号 + wxSalesOrder.setBackCause(null);// 退单原因 + wxSalesOrder.setIsMember(StringUtils.isNoneEmpty(weixinOrder.getMemberId()) ? 1: 0);// 是否使用会员卡 + wxSalesOrder.setIsInvalid(0);// 是否失效 + wxSalesOrder.setDescription(weixinOrder.getDescription());// 备注说明 + wxSalesOrder.setCreateUser(createUser); + wxSalesOrder.setPayType("1");// 付款类型(1-在线支付;) + wxSalesOrder.setPayMode(weixinOrder.getPayway());// 付款方式(1-微信支付;) + wxSalesOrder.setPayDate(saleDate);// 付款时间 + //=====微信点餐新增字段 + wxSalesOrder.setBoxFee(weixinOrder.getBoxFee()); + wxSalesOrder.setReceiveName(weixinOrder.getReceiveName()); + wxSalesOrder.setReceiveMobile(weixinOrder.getReceiveMobile()); + wxSalesOrder.setReceiveAddress(weixinOrder.getReceiveAddress()); + wxSalesOrder.setDistributionFee(weixinOrder.getDistributionFee()); + // 订单明细列表 + List orderItemList = new ArrayList<>(); + // 做法信息列表 + List> itemMakeList = new ArrayList<>(); + // 优惠信息列表 + List> itemPromoList = new ArrayList<>(); + String[] itemArray = JSON.parseObject(weixinOrder.getDetails(),String[].class); + for (String itemStr : itemArray) { + SalesOrderItemEntity item = JSON.parseObject(itemStr, SalesOrderItemEntity.class); + WxSalesOrderItem wxSalesOrderItem = new WxSalesOrderItem(); + wxSalesOrderItem.setId(item.getId()); + wxSalesOrderItem.setStoreId(storeId);// 门店ID + wxSalesOrderItem.setStoreNo(storeNo);// 门店编号 + wxSalesOrderItem.setStoreName(storeName);// 门店名称 + wxSalesOrderItem.setTableNo(weixinOrder.getTableNo());// 桌号 + wxSalesOrderItem.setTableName(weixinOrder.getTableName()); + wxSalesOrderItem.setLineNo(item.getLineNo());// 行号 + wxSalesOrderItem.setGoodsId(StringUtils.isNotBlank(item.getGoodsId()) ? item.getGoodsId() : null);// 商品ID + wxSalesOrderItem.setGoodsName(item.getGoodsName());// 商品名称 + wxSalesOrderItem.setSpecName(item.getSpecName());// 规格名称 + wxSalesOrderItem.setCategoryId(StringUtils.isNotBlank(item.getCategoryId()) ? item.getCategoryId() : null);// 分类ID + + WxGoodsCategory category = null; + if (StringUtils.isNotBlank(item.getCategoryId())) { + category = wxGoodsCategoryService.get(tenantId, item.getCategoryId()); + } + wxSalesOrderItem.setCategoryPath(category == null ? null : category.getPath());// 分类路径 + wxSalesOrderItem.setCategoryName(category == null ? null : category.getName());// 分类名称 + + wxSalesOrderItem.setProductId(item.getProductId());// 产品ID + wxSalesOrderItem.setProductNo(item.getProductNo());// 产品编号 + wxSalesOrderItem.setSpecId(item.getSpecId());// 规格ID + + wxSalesOrderItem.setProductUnitId(item.getProductUnitId());// 产品单位ID + ProductUnit productUnit = productUnitService.get(tenantId, item.getProductUnitId()); + wxSalesOrderItem.setProductUnitName(productUnit == null ? "" : productUnit.getName());// 产品单位名称 + + wxSalesOrderItem.setCount(item.getCount());// 数量 + wxSalesOrderItem.setRcount(0.0);// 退菜数量 + wxSalesOrderItem.setPrice(item.getPrice());// 销售价格 + wxSalesOrderItem.setPriceOrg(item.getPriceOrg());// 产品原价 + wxSalesOrderItem.setDiscountPrice(item.getDiscountPrice());// 折后价格 + wxSalesOrderItem.setSaleDate(saleDate);// 销售时间 + wxSalesOrderItem.setAmount(item.getAmount());// 消费金额 + wxSalesOrderItem.setDiscountTotal(item.getDiscountTotal());// 优惠额 + discount = MathUtil.eq(BigDecimal.ZERO, new BigDecimal(item.getAmount())) ? 0 + : MathUtil.divide(new BigDecimal(item.getDiscountTotal()), new BigDecimal(item.getAmount())).doubleValue(); + wxSalesOrderItem.setDiscount(discount);// 优惠率 + wxSalesOrderItem.setReceivable(item.getReceivable());// 应收金额 + + wxSalesOrderItem.setAddPriceTotal(item.getAddPriceTotal());// 加价金额 + wxSalesOrderItem.setDiscountAddTotal(item.getDiscountAddTotal());// 加价优惠金额 + wxSalesOrderItem.setAmountAddTotal(item.getAmountAddTotal());// 加价应收金额 + + wxSalesOrderItem.setAmountTotal(item.getAmountTotal());// 消费总额 + wxSalesOrderItem.setReceivableTotal(item.getReceivableTotal());// 应收总额 + wxSalesOrderItem.setIsMember(0);// 是否使用会员卡 + + wxSalesOrderItem.setIsSuit(item.getIsSuit());// 是否套餐 + wxSalesOrderItem.setSuitId(item.getSuitId());// 套餐主菜ID + wxSalesOrderItem.setParentId(item.getParentId());// 主菜ID + wxSalesOrderItem.setBoxNum(item.getBoxNum());//订单餐盒数量 + wxSalesOrderItem.setBoxPrice(item.getBoxPrice());//订单餐盒费 + orderItemList.add(wxSalesOrderItem); + + // 做法 + List makeList = new ArrayList<>(); + List makes = item.getMakes(); + if( makes != null && makes.size() > 0){ + for (SalesOrderItemMakeEntity makeEntity : makes) { + WxSalesOrderItemMake make = new WxSalesOrderItemMake(); + make.setStoreId(storeId);// 门店ID + make.setStoreNo(storeNo);// 门店编号 + make.setStoreName(storeName);// 门店名称 + make.setMakeId(makeEntity.getMakeId());// 做法ID + make.setMakeName(makeEntity.getMakeName());// 做法名称 + make.setAddPrice(makeEntity.getAddPrice());// 做法加价 + make.setDiscountPrice(makeEntity.getDiscountPrice());// 做法折后加价 + make.setCount(makeEntity.getCount());// 做法数量 + make.setRcount(0.0);// 做法退数量 + make.setAddTotal(makeEntity.getAddTotal());// 加价总额 + make.setDiscountAddTotal(makeEntity.getDiscountAddTotal());// 折后总额 + discount = MathUtil.eq(BigDecimal.ZERO, new BigDecimal(makeEntity.getAddTotal())) ? 0 + : MathUtil.divide(new BigDecimal(makeEntity.getDiscountAddTotal()), new BigDecimal(makeEntity.getAddTotal())).doubleValue(); + make.setDiscount(discount);// 折扣率 + make.setQtyFlag(makeEntity.getMngNum());// 管理数量 + make.setSaleDate(saleDate);// 销售时间 + makeList.add(make); + } + } + + + itemMakeList.add(makeList); + + // 优惠信息 + List promoList = new ArrayList<>(); + List promoEntityList = item.getPromotions() != null ? item.getPromotions() : new ArrayList(); + for (SalesOrderItemPromoEntity promoEntity : promoEntityList) { + WxSalesOrderItemPromo promo = new WxSalesOrderItemPromo(); + promo.setStoreId(storeId);// 门店ID + promo.setType(promoEntity.getType());// 优惠类型 + promo.setInfo(promoEntity.getInfo());// 优惠说明 + promo.setDiscountMoney(promoEntity.getDiscountMoney());// 优惠金额 + promo.setSaleDate(saleDate);// 销售时间 + promoList.add(promo); + } + + itemPromoList.add(promoList); + } + // 付款信息 + WxSalesPayment paymentInfo = new WxSalesPayment(); + paymentInfo.setStoreId(storeId);// 门店ID + paymentInfo.setPayNo(weixinOrder.getOutTradeNo());// 付款单号 + paymentInfo.setPayType("1");// 付款类型 + paymentInfo.setPayMode(weixinOrder.getPayway());// 付款方式 + paymentInfo.setStatus(1);// 单据状态 + paymentInfo.setPaid(wxSalesOrder.getReceivable());// 实收金额 + paymentInfo.setRchange(0.00);// 找零金额 + paymentInfo.setMoney(wxSalesOrder.getReceivable());// 已收金额 + paymentInfo.setVoucherNo(prepayId);// 凭证号 + paymentInfo.setPayDate(saleDate);// 付款时间 + paymentInfo.setPayAccount("");// 付款账号 + paymentInfo.setMemberId(StringUtils.isNoneEmpty(weixinOrder.getMemberId()) ? weixinOrder.getMemberId() : ""); + paymentInfo.setMemo(StringUtils.isNoneEmpty(weixinOrder.getMemberId()) ? weixinOrder.getDescription() : "微信点餐 支付成功");// 备注 + List pays = new ArrayList<>(); + pays.add(paymentInfo); + + wxSalesOrder = wxSalesOrderService.saveExtend(tenantId, wxSalesOrder, orderItemList, itemMakeList, itemPromoList, pays); + + } catch (Exception e) { + e.printStackTrace(); + logger.error(info+"时发生异常:"+e); + } + return wxSalesOrder; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/WxdcOrderRefundEvents.java b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/WxdcOrderRefundEvents.java new file mode 100644 index 0000000..108ec4e --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/WxdcOrderRefundEvents.java @@ -0,0 +1,107 @@ +package com.jwsaas.reactor.event; + +import java.util.HashMap; +import java.util.Map; + +import com.jwsaas.entity.food.WxSalesOrder; +import com.jwsaas.entity.food.WxStore; + +import reactor.bus.Event; +import reactor.spring.context.annotation.Consumer; +import reactor.spring.context.annotation.Selector; + +@Consumer +public class WxdcOrderRefundEvents extends BaseWxdcEvents { + + /** + * 微信点餐订单,用户申请退单/退款事件 + */ + @Selector(EventKeys.WXDC_ORDER_REFUND_USER_APPLY) + public void userApplyRefund(Event> event) { + String info = "微信点餐订单,用户申请退单/退款事件"; + logger.info(">>>>>>>" + info + "。。。"); + Map eventData = event.getData(); + // String appKey = eventData.get("appKey").toString(); + // String appId = eventData.get("appId").toString(); + String tenantCode = eventData.get("tenantCode").toString(); + // String appCode = eventData.get("appCode").toString(); + // String wid = eventData.get("wid").toString(); + WxStore wxStore = (WxStore) eventData.get("wxStore"); + WxSalesOrder wxSalesOrder = (WxSalesOrder) eventData.get("wxSalesOrder"); + try { + logger.info(">>>>>>>wxStore:{}", wxStore); + logger.info(">>>>>>>wxSalesOrder:{}", wxSalesOrder); + orderStatusNotify(tenantCode, wxStore.getStoreId(), wxSalesOrder.getId(), 6); + } catch (Exception e) { + logger.error(info + "时,发生异常", e); + } + } + + /** + * 微信点餐订单,门店同意退款事件 + */ + @Selector(EventKeys.WXDC_ORDER_REFUND_STORE_AGREE) + public void storeAgreeRefund(Event> event) { + String info = "微信点餐订单,门店同意退款事件"; + logger.info(">>>>>>>" + info + "。。。"); + Map eventData = event.getData(); + // String appKey = eventData.get("appKey").toString(); + // String appId = eventData.get("appId").toString(); + // String tenantCode = eventData.get("tenantCode").toString(); + // String appCode = eventData.get("appCode").toString(); + String wid = eventData.get("wid").toString(); + WxStore wxStore = (WxStore) eventData.get("wxStore"); + WxSalesOrder wxSalesOrder = (WxSalesOrder) eventData.get("wxSalesOrder"); + try { + logger.info(">>>>>>>wxStore:{}", wxStore); + logger.info(">>>>>>>wxSalesOrder:{}", wxSalesOrder); + + // 门店同意用户退单请求 + String memberId = wxSalesOrder.getMemberId(); + String topic = "wxdc/cy2/order/" + wid + "/" + memberId; + Map notifyData = new HashMap<>(); + notifyData.put("orderNo", wxSalesOrder.getNo()); + notifyData.put("type", 5); // 商家退款 + notifyData.put("status", 1); + notifyData.put("takeNo", wxSalesOrder.getTakeNo());// 取餐号 + sendMessageToUser(topic, notifyData); + } catch (Exception e) { + logger.error(info + "时,发生异常", e); + } + } + + /** + * 微信点餐订单,门店拒绝退款事件 + */ + @Selector(EventKeys.WXDC_ORDER_REFUND_STORE_REFUSE) + public void storeRefuseRefund(Event> event) { + String info = "微信点餐订单,门店拒绝退款事件"; + logger.info(">>>>>>>" + info + "。。。"); + Map eventData = event.getData(); + // String appKey = eventData.get("appKey").toString(); + // String appId = eventData.get("appId").toString(); + // String tenantCode = eventData.get("tenantCode").toString(); + // String appCode = eventData.get("appCode").toString(); + String wid = eventData.get("wid").toString(); + WxStore wxStore = (WxStore) eventData.get("wxStore"); + WxSalesOrder wxSalesOrder = (WxSalesOrder) eventData.get("wxSalesOrder"); + try { + logger.info(">>>>>>>wxStore:{}", wxStore); + logger.info(">>>>>>>wxSalesOrder:{}", wxSalesOrder); + + // 门店拒绝用户退款通知 + String memberId = wxSalesOrder.getMemberId(); + String topic = "wxdc/cy2/order/" + wid + "/" + memberId; + Map notifyData = new HashMap<>(); + notifyData.put("orderNo", wxSalesOrder.getNo()); + notifyData.put("type", 6); // 商家拒绝退单 + notifyData.put("status", 1); + notifyData.put("storeReason", wxSalesOrder.getStoreReason()); + notifyData.put("takeNo", wxSalesOrder.getTakeNo()); + sendMessageToUser(topic, notifyData); + } catch (Exception e) { + logger.error(info + "时,发生异常", e); + } + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/WxyhEvents.java b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/WxyhEvents.java new file mode 100644 index 0000000..f392af7 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/WxyhEvents.java @@ -0,0 +1,104 @@ +package com.jwsaas.reactor.event; + +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; + +import com.alibaba.fastjson.JSON; +import com.jwsaas.Constant; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.controller.open.BaiDuLbsController; +import com.jwsaas.entity.food.Store; +import com.jwsaas.entity.food.WxStore; +import com.jwsaas.properties.BaiduhProperties; +import com.jwsaas.service.food.WxStoreService; + +import reactor.bus.Event; +import reactor.spring.context.annotation.Consumer; +import reactor.spring.context.annotation.Selector; + +/*** + * 微信要货异步事件 + * @author louxutao + * + */ +@Consumer +public class WxyhEvents extends BaseEvents { + + @Autowired + private BaiduhProperties baiduhProperties; + + @Resource + private WxStoreService wxStoreService; + + @Selector(EventKeys.WXYH_UPDATE_BAIDU_STORE) + public void login(Event> event) { + String info = "event 微信要货-更新百度门店信息"; + logger.info(">>>>>>>" + info + "。。。"); + + Map eventData = event.getData(); + // String appKey = eventData.get("appKey").toString(); + // String appId = eventData.get("appId").toString(); + // String appCode = eventData.get("appCode").toString(); + String tenantId = eventData.get("tenantId").toString(); + String appSign = eventData.get("appSign").toString(); + Store store = (Store) eventData.get("store"); + + try { + logger.info(info+" 门店信息:" + store.getId()+" :"+store.getName()+" :"+store.getNo()); + + // 修改微信门店经纬度信息 + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("storeId", store.getId())); + criteria.add(Restrictions.eq("deleteFlag", 0)); + List wxStores = wxStoreService.getList(tenantId, criteria); + if (wxStores.size() > 0) { + WxStore wxStore = wxStores.get(0); + wxStore.setLatitude(store.getLatitude()); + wxStore.setLongitude(store.getLongitude()); + wxStore.setModifyUser(Constant.CREATE_USER); + wxStoreService.update(tenantId, wxStore); + + Map data = new HashMap(); + data.put("address", store.getAddress()); + + String longitude = String.valueOf(store.getLongitude()); + if (StringUtils.isBlank(longitude)) { + longitude = "22.581329"; + } + String latitude = String.valueOf(store.getLatitude()); + if (StringUtils.isBlank(latitude)) { + latitude = "113.918868"; + } + data.put("longitude", longitude); + data.put("latitude", latitude); + data.put("storeId", store.getId()); + data.put("no", store.getNo()); + data.put("title", wxStore.getName()); + data.put("name", wxStore.getName()); + data.put("wxStoreId", wxStore.getId()); + data.put("enabled", wxStore.getEnabled()); + + // 修改门店信息-同步修改百度门店信息 + Map dataMap = BaiDuLbsController.updateBaiduStore(data, tenantId, appSign,baiduhProperties.getBaiduV4ak(),baiduhProperties.getBakduTableId()); + logger.error(info+" >>>>>> dataMap:"+JSON.toJSONString(dataMap)); + if(null != dataMap && "0".equals(dataMap.get("status").toString())){ + logger.info(info+" >>>>>> 成功"); + logger.info(" >>>>>>> dataMap:"+JSON.toJSONString(dataMap)); + }else{ + logger.info(info+" 时发生异常:"+JSON.toJSONString(dataMap)); + } + } + } catch (Exception e) { + logger.error(info + "发生异常", e); + } + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/ZgcxEvents.java b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/ZgcxEvents.java new file mode 100644 index 0000000..1b6291b --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/reactor/event/ZgcxEvents.java @@ -0,0 +1,65 @@ +package com.jwsaas.reactor.event; + +import java.util.HashMap; +import java.util.Map; + +import org.apache.http.HttpResponse; +import org.springframework.beans.factory.annotation.Autowired; + +import com.jwsaas.http.HttpTool; +import com.jwsaas.properties.ZgxcProperties; + +import reactor.bus.Event; +import reactor.spring.context.annotation.Consumer; +import reactor.spring.context.annotation.Selector; + +/** + * 掌柜查询相关事件 + */ +@Consumer +public class ZgcxEvents extends BaseEvents { + + private static final String className = "ZgcxEvents"; + + @Autowired + private ZgxcProperties zgxcProperties; + + /** + * 员工密码修改后,掌柜查询需重新登陆
+ *

+ * 门店员工重置密码后,绑定该账户的用户(掌柜查询)登陆状态调整为未登陆,下次进入需要重新输入密码 + *

+ */ + @Selector(EventKeys.ZGCX_LOGIN_OUT) + public void loginOut(Event> event) { + String info = "员工密码修改后,掌柜查询需重新登陆"; + logger.debug(info + ">>>>>>>:" + event.getData()); + + Map eventData = event.getData(); + String tenantId = eventData.get("tenantId").toString(); + // String tenantCode = eventData.get("tenantCode").toString(); + String storeNo = eventData.get("storeNo").toString(); + String workerNo = eventData.get("workerNo").toString(); + try { + String apiUrl = zgxcProperties.getApiUrl(); + logger.debug("apiUrl:" + apiUrl); + + Map paramMap = new HashMap(20); + paramMap.put("type", "loginout"); + paramMap.put("tenantId", tenantId); + paramMap.put("storeNo", storeNo); + paramMap.put("workerNo", workerNo); + + long startTime = System.currentTimeMillis(); + HttpResponse response = HttpTool.url(apiUrl).form(paramMap).post(); + long endTime = System.currentTimeMillis(); + logger.debug("请求耗时:" + (endTime - startTime)); + String content = HttpTool.getResponseAsString(response); + logger.debug("content:" + content); + + } catch (Exception e) { + logger.error(className + ".loginOut(" + info + ") 发生异常", e); + } + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/scheduling/AppAuthSchedule.java b/food-open/food-open-api/src/main/java/com/jwsaas/scheduling/AppAuthSchedule.java new file mode 100644 index 0000000..03218e4 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/scheduling/AppAuthSchedule.java @@ -0,0 +1,122 @@ +package com.jwsaas.scheduling; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import com.alibaba.dubbo.config.annotation.Reference; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.controller.BaseController; +import com.jwsaas.entity.food.SplitStorePay; +import com.jwsaas.pager.Pager; +import org.apache.commons.lang3.StringUtils; +import org.redisson.api.RMapCache; +import org.redisson.api.RedissonClient; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.entity.shared.AppAuth; +import com.jwsaas.properties.ApplicationProperties; +import com.jwsaas.utils.AppAuthUtil; +import com.jwsaas.utils.AppKeyUtil; +import com.jwsaas.utils.RedisKeyUtil; +import reactor.spring.context.annotation.Consumer; + +/** + * AppAuth相关任务 + * + * @author 张书祥 + */ +@Component +public class AppAuthSchedule{ + + private static Logger logger = LoggerFactory.getLogger(AppAuthSchedule.class); + + @Resource + private com.jwsaas.service.food.SplitStorePayService splitStorePayService; + @Resource + private ApplicationProperties applicationProperties; + @Resource + private RedissonClient redissonClient; + + private static Map callCounterMap = new HashMap(); + + @Scheduled(cron = "${appauth.callcount.cron}") + public void appCallCountPersistent() { + if (applicationProperties.getCallCountTaskSkip()) { + logger.debug("[" + applicationProperties.getName() + "," + applicationProperties.getSign() + + "] ---> 跳过计划任务(AppAuthSchedule.appCallCountPersistent)。"); + return; + } + + RMapCache allAppSecret = redissonClient.getMapCache(RedisKeyUtil.getKey4AppAuth()); + logger.debug("allAppSecret.size:" + allAppSecret.size()); + + allAppSecret.entrySet().iterator().forEachRemaining(entryMap -> { + String appKey = entryMap.getKey(); + if (StringUtils.isBlank(appKey)) { + return; + } + + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + + long callCounter = AppAuthUtil.getInvokeTimes(appCode).get(); + if (callCounter == 0 || (callCounterMap.get(appKey) != null && callCounter == callCounterMap.get(appKey))) { + logger.debug("调用次数没有发生变化[appKey:" + appKey + ",appId:" + appId + ",tenantCode:" + tenantCode + + ",appCode:" + appCode + ",callCounter:" + callCounter + "]。"); + return; + } + + try { + callCounterMap.put(appKey, callCounter); + + logger.debug("保存方法调用次数[appKey:" + appKey + ",tenantCode:" + tenantCode + ",appId:" + appId + ",appCode:" + + appCode + ",callCounter:" + callCounter + "]成功。"); + } catch (Exception e) { + logger.info("保存方法调用次数[appKey:" + appKey + ",tenantCode:" + tenantCode + ",appId:" + appId + ",appCode:" + + appCode + ",callCounter:" + callCounter + "]时,发生异常", e); + } + + }); + + } + + @Scheduled(cron = "0 50 14 * * ?") // 每天22点30分执行一次 + private void process() throws Exception { + RMapCache allAppSecret = redissonClient.getMapCache(RedisKeyUtil.getKey4AppAuth()); + logger.debug("allAppSecret.size:" + allAppSecret.size()); + allAppSecret.entrySet().iterator().forEachRemaining(entryMap -> { + String appKey = entryMap.getKey(); + if (StringUtils.isBlank(appKey)) { + return; + } + AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey); + String appId = appKeyInfo.getAppId(); + String tenantCode = appKeyInfo.getTenantCode(); + String appCode = appKeyInfo.getAppCode(); + Criteria criter = new Criteria(); + //criter.add(Restrictions.ge("payDate", newdate+" 00:00:00")); + //criter.add(Restrictions.le("payDate", newdate+" 23:59:59")); + criter.add(Restrictions.eq("isInvalid", 0)); + criter.add(Restrictions.eq("payTypeNo", "50")); + // List payModeList = splitStorePayService.getSplitStorePayList(criter); + try { + List payModeList = splitStorePayService.getList(tenantCode, criter); + System.out.println(payModeList.size()); + } catch (Exception e) { + e.printStackTrace(); + } + System.out.println("-----"); + }); + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/scheduling/Monitor.java b/food-open/food-open-api/src/main/java/com/jwsaas/scheduling/Monitor.java new file mode 100644 index 0000000..242b12b --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/scheduling/Monitor.java @@ -0,0 +1,65 @@ +package com.jwsaas.scheduling; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +@Component +public class Monitor { + + private static Logger logger = LoggerFactory.getLogger(Monitor.class); + + @Scheduled(cron = "${monitor.memory.cron}") + public void memory() { + Runtime run = Runtime.getRuntime(); + long max = run.maxMemory(); + long total = run.totalMemory(); + long free = run.freeMemory(); + long usable = max - total + free; + + logger.info("最大内存 = " + transforByteToMega(max)+"MB"); + logger.info("已分配内存 = " + transforByteToMega(total)+"MB"); + logger.info("已分配内存中的剩余空间 = " + transforByteToMega(free)+"MB"); + logger.info("最大可用内存 = " + transforByteToMega(usable)+"MB"); + + } + + private static final int carry = 1024;// 进位 + + /** + * 1KB=1024B + */ + public long transforByteToKilo(long byteSize){ + return byteSize/carry; + } + + /** + * 1MB=1024KB=1024 x 1024B + */ + public long transforByteToMega(long byteSize){ + return transforKiloToMega(transforByteToKilo(byteSize)); + } + + /** + * 1MB=1024KB + */ + public long transforKiloToMega(long kiloSize){ + return kiloSize/carry; + } + + /** + * 1GB=1024MB + */ + public long transforMegaToGiga(long megaSize){ + return megaSize/carry; + } + + /** + * 1TB=1024GB + */ + public long transforGigaToT(long gigaSize){ + return gigaSize/carry; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/servlet/ServletRegister.java b/food-open/food-open-api/src/main/java/com/jwsaas/servlet/ServletRegister.java new file mode 100644 index 0000000..17a89ff --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/servlet/ServletRegister.java @@ -0,0 +1,17 @@ +package com.jwsaas.servlet; + +import org.springframework.boot.web.servlet.ServletRegistrationBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import com.jwsaas.open.WopServlet; + +@Configuration +public class ServletRegister { + + @Bean + public ServletRegistrationBean wopServletRegistrationBean() { + return new ServletRegistrationBean(new WopServlet(), "/api"); + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/task/TaskJobHandler.java b/food-open/food-open-api/src/main/java/com/jwsaas/task/TaskJobHandler.java new file mode 100644 index 0000000..2b9cc78 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/task/TaskJobHandler.java @@ -0,0 +1,37 @@ +package com.jwsaas.task; + +/** + * 计划任务JobHandler + */ +public enum TaskJobHandler { + + PRODUCT_PRICE_ADJUST("productPriceAdjustJobHandler", "商品调价任务"), + WXDC_ORDER_AUTO_CANCEL("wxdcOrderAutoCancelJobHandler", "微信点餐订单超时自动取消任务"), + WXDC_ORDER_AUTO_FINISH("wxdcOrderAutoFinishJobHandler", "微信点餐订单超时自动完成任务"), + + PROGRAM_ORDER_AUTO_CANCEL("programOrderAutoCancelJobHandler", "小程序点餐订单超时自动取消任务"), + PROGRAM_ORDER_AUTO_FINISH("programOrderAutoFinishJobHandler", "小程序点餐订单超时自动完成任务"), + PROGRAM_ORDER_NOPAID_AUTO_CANCEL("ProgramOrderNopaidAutoCancelJobHandler", "巨为小程序下单后120分钟订单没有支付取消订单任务"); + + private TaskJobHandler(String sign, String description) { + this.sign = sign; + this.description = description; + } + + private String sign; + private String description; + + public String getSign() { + return sign; + } + + public String getDescription() { + return description; + } + + @Override + public String toString() { + return super.toString() + "(" + sign + "," + description + ")"; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/task/utils/TaskOpenUtils.java b/food-open/food-open-api/src/main/java/com/jwsaas/task/utils/TaskOpenUtils.java new file mode 100644 index 0000000..1b4b108 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/task/utils/TaskOpenUtils.java @@ -0,0 +1,296 @@ +package com.jwsaas.task.utils; + +import java.util.HashMap; +import java.util.Map; + +import org.apache.http.HttpResponse; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Component; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.jwsaas.entity.task.Schedule; +import com.jwsaas.http.HttpTool; +import com.jwsaas.utils.PropertiesUtil; +import com.jwsaas.utils.UnicodeUtils; + +@Component +@Lazy(false) +public class TaskOpenUtils { + + protected Logger logger = LoggerFactory.getLogger(this.getClass()); + + public static final int SUCCESS_CODE = 200; + + private static final String APP_SIGN = "cy2"; + + private String serverUrl; + private String groupSign;// 执行器标识 + private String alarmEmail;// 报警邮件 + + public TaskOpenUtils() { + this.serverUrl = PropertiesUtil.getValue("application.properties", "schedue.url"); + this.groupSign = PropertiesUtil.getValue("application.properties", "xxl.job.executor.sign"); + this.alarmEmail = PropertiesUtil.getValue("application.properties", "xxl.job.alarm.email"); + } + + /** + * 添加任务信息 + */ + public boolean saveSchedule(Schedule schedule) { + logger.debug("-----------saveSchedule:{}:{}-----------", schedule.getTenantId(), schedule.getSign()); + + boolean result = false; + try { + Map paramMap = new HashMap(20); + paramMap.put("groupSign", groupSign); + paramMap.put("sign", APP_SIGN + "_" + schedule.getSign()); + paramMap.put("jobCron", schedule.getJobCron()); + paramMap.put("jobDesc", UnicodeUtils.toUnicode(schedule.getJobDesc(), false)); + paramMap.put("author", UnicodeUtils.toUnicode(schedule.getAuthor(), false)); + paramMap.put("alarmEmail", schedule.getAlarmEmail()); + paramMap.put("executorHandler", schedule.getExecutorHandler()); + paramMap.put("executorParam", UnicodeUtils.toUnicode(schedule.getExecutorParam(), false)); + + final HttpResponse response = HttpTool.url(serverUrl + "/job/add").form(paramMap).post(); + logger.debug("status:{}", HttpTool.getStatus(response)); + logger.debug("statusOK:{}", HttpTool.isStatusOK(response)); + if (HttpTool.isStatusOK(response)) { + String content = HttpTool.getResponseAsString(response); + JSONObject jsonObject = JSON.parseObject(content); + if (jsonObject.getInteger("code") == SUCCESS_CODE) { + result = true; + } else { + logger.error("saveSchedule>>>>" + JSON.toJSONString(content)); + } + } else { + logger.error("-----------saveSchedule:{}:{}-----------", schedule.getTenantId(), schedule.getSign()); + } + } catch (Exception e) { + e.printStackTrace(); + } + + return result; + } + + /** + * 修改任务信息 + */ + public boolean updateSchedule(Schedule schedule) { + logger.debug("-----------updateSchedule:{}:{}-----------", schedule.getTenantId(), schedule.getSign()); + + boolean result = false; + try { + Map paramMap = new HashMap(20); + paramMap.put("groupSign", groupSign); + paramMap.put("sign", APP_SIGN + "_" + schedule.getSign()); + paramMap.put("jobCron", UnicodeUtils.toUnicode(schedule.getJobCron(), false)); + paramMap.put("jobDesc", UnicodeUtils.toUnicode(schedule.getJobDesc(), false)); + paramMap.put("author", UnicodeUtils.toUnicode(schedule.getAuthor(), false)); + paramMap.put("alarmEmail", schedule.getAlarmEmail()); + paramMap.put("executorHandler", schedule.getExecutorHandler()); + paramMap.put("executorParam", UnicodeUtils.toUnicode(schedule.getExecutorParam(), false)); + + final HttpResponse response = HttpTool.url(serverUrl + "/job/reschedule").form(paramMap).post(); + logger.debug("status:{}", HttpTool.getStatus(response)); + logger.debug("statusOK:{}", HttpTool.isStatusOK(response)); + if (HttpTool.isStatusOK(response)) { + String content = HttpTool.getResponseAsString(response); + JSONObject jsonObject = JSON.parseObject(content); + if (jsonObject.getInteger("code") == SUCCESS_CODE) { + result = true; + } else { + logger.error("updateSchedule>>>>" + JSON.toJSONString(content)); + } + } else { + logger.error("-----------updateSchedule:{}:{}-----------", schedule.getTenantId(), schedule.getSign()); + } + } catch (Exception e) { + e.printStackTrace(); + logger.error("-----------updateSchedule:{}:{}-----------", schedule.getTenantId(), schedule.getSign()); + } + + return result; + } + + /** + * 移除任务信息 + */ + public boolean removeSchedule(Schedule schedule) { + logger.debug("-----------removeSchedule:{}:{}-----------", schedule.getTenantId(), schedule.getSign()); + + boolean result = false; + try { + Map paramMap = new HashMap(20); + paramMap.put("sign", APP_SIGN + "_" + schedule.getSign()); + + final HttpResponse response = HttpTool.url(serverUrl + "/job/remove").form(paramMap).post(); + logger.debug("status:{}", HttpTool.getStatus(response)); + logger.debug("statusOK:{}", HttpTool.isStatusOK(response)); + if (HttpTool.isStatusOK(response)) { + String content = HttpTool.getResponseAsString(response); + JSONObject jsonObject = JSON.parseObject(content); + if (jsonObject.getInteger("code") == SUCCESS_CODE) { + result = true; + } else { + logger.error("removeSchedule>>>>" + JSON.toJSONString(content)); + } + } else { + logger.error("-----------removeSchedule:{}:{}-----------", schedule.getTenantId(), schedule.getSign()); + } + } catch (Exception e) { + logger.error("-----------removeSchedule:{}:{}-----------", schedule.getTenantId(), schedule.getSign()); + e.printStackTrace(); + } + + return result; + } + + /** + * 停止任务 + */ + public boolean pauseSchedule(Schedule schedule) { + logger.debug("-----------pauseSchedule:{}:{}-----------", schedule.getTenantId(), schedule.getSign()); + + boolean result = false; + try { + Map paramMap = new HashMap(20); + paramMap.put("sign", APP_SIGN + "_" + schedule.getSign()); + + final HttpResponse response = HttpTool.url(serverUrl + "/job/pause").form(paramMap).post(); + logger.debug("status:{}", HttpTool.getStatus(response)); + logger.debug("statusOK:{}", HttpTool.isStatusOK(response)); + if (HttpTool.isStatusOK(response)) { + String content = HttpTool.getResponseAsString(response); + JSONObject jsonObject = JSON.parseObject(content); + logger.error("pauseSchedule>>>>" + JSON.toJSONString(content)); + if (jsonObject.getInteger("code") == SUCCESS_CODE) { + result = true; + } else { + logger.error("pauseSchedule>>>>" + JSON.toJSONString(content)); + } + } else { + logger.error("-----------pauseSchedule:{}:{}-----------", schedule.getTenantId(), schedule.getSign()); + } + } catch (Exception e) { + logger.error("-----------pauseSchedule:{}:{}-----------", schedule.getTenantId(), schedule.getSign()); + e.printStackTrace(); + } + + return result; + } + + /** + * 恢复任务 + */ + public boolean resumeSchedule(Schedule schedule) { + logger.debug("-----------resumeSchedule:{}:{}-----------", schedule.getTenantId(), schedule.getSign()); + + boolean result = false; + try { + Map paramMap = new HashMap(20); + paramMap.put("sign", APP_SIGN + "_" + schedule.getSign()); + + final HttpResponse response = HttpTool.url(serverUrl + "/job/resume").form(paramMap).post(); + logger.debug("status:{}", HttpTool.getStatus(response)); + logger.debug("statusOK:{}", HttpTool.isStatusOK(response)); + if (HttpTool.isStatusOK(response)) { + String content = HttpTool.getResponseAsString(response); + JSONObject jsonObject = JSON.parseObject(content); + if (jsonObject.getInteger("code") == SUCCESS_CODE) { + result = true; + } else { + logger.error("resumeSchedule>>>>" + JSON.toJSONString(content)); + } + } else { + logger.error("-----------resumeSchedule:{}:{}-----------", schedule.getTenantId(), schedule.getSign()); + } + } catch (Exception e) { + logger.error("-----------resumeSchedule:{}:{}-----------", schedule.getTenantId(), schedule.getSign()); + e.printStackTrace(); + } + + return result; + } + + /** + * 触发任务 + */ + public boolean triggerSchedule(Schedule schedule) { + logger.debug("-----------triggerSchedule:{}:{}-----------", schedule.getTenantId(), schedule.getSign()); + + boolean result = false; + try { + Map paramMap = new HashMap(20); + paramMap.put("sign", APP_SIGN + "_" + schedule.getSign()); + + final HttpResponse response = HttpTool.url(serverUrl + "/job/trigger").form(paramMap).post(); + logger.debug("status:{}", HttpTool.getStatus(response)); + logger.debug("statusOK:{}", HttpTool.isStatusOK(response)); + if (HttpTool.isStatusOK(response)) { + String content = HttpTool.getResponseAsString(response); + JSONObject jsonObject = JSON.parseObject(content); + if (jsonObject.getInteger("code") == SUCCESS_CODE) { + result = true; + } else { + logger.error("triggerSchedule>>>>" + JSON.toJSONString(content)); + } + } else { + logger.error("-----------triggerSchedule:{}:{}-----------", schedule.getTenantId(), schedule.getSign()); + } + } catch (Exception e) { + logger.error("-----------triggerSchedule:{}:{}-----------", schedule.getTenantId(), schedule.getSign()); + e.printStackTrace(); + } + + return result; + } + + /** + * 查询任务 + */ + public boolean querySchedule(Schedule schedule) { + logger.debug("-----------querySchedule:{}:{}-----------", schedule.getTenantId(), schedule.getSign()); + + boolean result = false; + try { + Map paramMap = new HashMap(20); + paramMap.put("sign", APP_SIGN + "_" + schedule.getSign()); + + final HttpResponse response = HttpTool.url(serverUrl + "/job/query").form(paramMap).post(); + logger.debug("status:{}", HttpTool.getStatus(response)); + logger.debug("statusOK:{}", HttpTool.isStatusOK(response)); + if (HttpTool.isStatusOK(response)) { + String content = HttpTool.getResponseAsString(response); + JSONObject jsonObject = JSON.parseObject(content); + if (jsonObject.getInteger("code") == SUCCESS_CODE) { + result = true; + } else { + logger.error("querySchedule>>>>" + JSON.toJSONString(content)); + } + } else { + logger.error("-----------querySchedule:{}:{}-----------", schedule.getTenantId(), schedule.getSign()); + } + } catch (Exception e) { + logger.error("-----------querySchedule:{}:{}-----------", schedule.getTenantId(), schedule.getSign()); + e.printStackTrace(); + } + + return result; + } + + public String getServerUrl() { + return serverUrl; + } + + public String getGroupSign() { + return groupSign; + } + + public String getAlarmEmail() { + return alarmEmail; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/tonglian/ReturnMsg.java b/food-open/food-open-api/src/main/java/com/jwsaas/tonglian/ReturnMsg.java new file mode 100644 index 0000000..f5870b5 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/tonglian/ReturnMsg.java @@ -0,0 +1,54 @@ +package com.jwsaas.tonglian; + +/** + * @Author 37962 + * @Date 2023/6/12 + */ +public class ReturnMsg { + + private String code; + private String msg; + private String sign; + private String subCode; + private String subMsg; + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public String getSign() { + return sign; + } + + public void setSign(String sign) { + this.sign = sign; + } + + public String getSubCode() { + return subCode; + } + + public void setSubCode(String subCode) { + this.subCode = subCode; + } + + public String getSubMsg() { + return subMsg; + } + + public void setSubMsg(String subMsg) { + this.subMsg = subMsg; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/tonglian/TlCommonConstants.java b/food-open/food-open-api/src/main/java/com/jwsaas/tonglian/TlCommonConstants.java new file mode 100644 index 0000000..04c01df --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/tonglian/TlCommonConstants.java @@ -0,0 +1,54 @@ +package com.jwsaas.tonglian; + +import java.nio.charset.StandardCharsets; + +/** + * @author zzq + * @version 1.0.0 + * @Title {@link} + * @Description + * @date 2020/5/27 + */ +public class TlCommonConstants { + + /** + * 测试接口地址 + */ + public static final String URL = "https://zhttest.sxallinpay.com/prod-api/yunshangtong/openApi/gateway";//测试 + //public static final String URL = "https://zht.sxallinpay.com/prod-api/yunshangtong/openApi/gateway";//正式 + + /** + * 测试接口对接appId + */ + public static final String APP_ID = "1669623779853516801";//测试 + //public static final String APP_ID = "1668228235653623810";//正式 + + /** + * 测试接口对接appKey + */ + public static final String APP_KEY = "eaa59d04162548d581526ef6a81bc8a8";//测试 + //public static final String APP_KEY = "ec684c893a42467a866cc78aad0b7a97";//正式 + + public static final String SUB_APP_ID = "wx242ffa036a357e12";//小程序APPID + //public static final String VSP_CUSID = "56216205814WPCF";//银宝商户号 + + /** + * 测试环境sysId + */ + public static final String SYS_ID = ""; + /** + * 默认字符集 + */ + public static final String DEFAULT_CHARSET = StandardCharsets.UTF_8.toString(); + /** + * 默认签名方式 + */ + public static final String DEFAULT_SIGN_TYPE = "MD5"; + /** + * 默认版本号 + */ + public static final String DEFAULT_VERSION = "1.0"; + + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/tonglian/TlHttpClient.java b/food-open/food-open-api/src/main/java/com/jwsaas/tonglian/TlHttpClient.java new file mode 100644 index 0000000..a95bae2 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/tonglian/TlHttpClient.java @@ -0,0 +1,35 @@ +package com.jwsaas.tonglian; + +import org.apache.commons.lang3.time.DateFormatUtils; + +import java.io.IOException; +import java.util.Date; + +/** + * @author zzq + * @version 1.0.0 + * @Title {@link} + * @Description + * @date 2020/5/27 + */ +public class TlHttpClient { + + public static String post(String method, T body) throws IOException { + TlRequest request = new TlRequest<>(); + request.setAppId(TlCommonConstants.APP_ID); + request.setCharset(TlCommonConstants.DEFAULT_CHARSET); + request.setSignType(TlCommonConstants.DEFAULT_SIGN_TYPE); + request.setVersion(TlCommonConstants.DEFAULT_VERSION); + request.setTimestamp(DateFormatUtils.format(new Date(), "yyyyMMddHHmmss")); + request.setMethod(method); + request.setBizContent(body); + + request.sign(TlCommonConstants.APP_KEY); + + String result = TlHttpUtils.post(TlCommonConstants.URL, request.toMap()); + + request.verify(result); + return result; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/tonglian/TlHttpUtils.java b/food-open/food-open-api/src/main/java/com/jwsaas/tonglian/TlHttpUtils.java new file mode 100644 index 0000000..caa984d --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/tonglian/TlHttpUtils.java @@ -0,0 +1,75 @@ +package com.jwsaas.tonglian; + + +import org.apache.commons.lang3.StringUtils; +import org.apache.http.HttpStatus; +import org.apache.http.NameValuePair; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.util.EntityUtils; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; +import java.util.stream.Collectors; + +/** + * @author zzq + * @version 1.0.0 + * @Title {@link} + * @Description + * @date 2020/5/26 + */ +//@Slf4j +public class TlHttpUtils { + + public static String post(String url, Map parameters) throws IOException { + // @Cleanup + CloseableHttpClient client = httpClientBuilder().build(); + HttpPost post = new HttpPost(url); + List pairList = parameters.entrySet().stream() + .map(entry -> new BasicNameValuePair(entry.getKey(), entry.getValue())) + .collect(Collectors.toList()); + StringJoiner requestBody = new StringJoiner("&"); + for (NameValuePair each : pairList) { + requestBody.add(StringUtils.join(each.getName(), "=", each.getValue())); + } + // log.info("Request url : [{}], parameters : [{}]", url, requestBody); + post.setEntity(new UrlEncodedFormEntity(pairList, StandardCharsets.UTF_8)); + //@Cleanup + CloseableHttpResponse execute = client.execute(post); + int statusCode = execute.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { + throw new IOException( + "Http request error, error message : [" + execute.getStatusLine().getReasonPhrase() + "]"); + } + String result = Objects.isNull(execute.getEntity()) ? "" : EntityUtils.toString(execute.getEntity(), + StandardCharsets.UTF_8.toString()); + // log.info("Response body : [{}]", result); + return result; + } + + private static HttpClientBuilder httpClientBuilder() { + return HttpClients.custom() + .disableAutomaticRetries() + .setDefaultRequestConfig(defaultRequestConfig()); + } + + private static RequestConfig defaultRequestConfig() { + return RequestConfig.custom() + .setConnectTimeout(30_000) + .setSocketTimeout(60_000) + .setConnectionRequestTimeout(5_000) + .build(); + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/tonglian/TlRegister.java b/food-open/food-open-api/src/main/java/com/jwsaas/tonglian/TlRegister.java new file mode 100644 index 0000000..fda972d --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/tonglian/TlRegister.java @@ -0,0 +1,35 @@ +package com.jwsaas.tonglian; + + +import java.io.Serializable; + +public class TlRegister implements Serializable { + + private String customerUserId; + private String memberType; + private String source; + + public String getCustomerUserId() { + return customerUserId; + } + + public void setCustomerUserId(String customerUserId) { + this.customerUserId = customerUserId; + } + + public String getMemberType() { + return memberType; + } + + public void setMemberType(String memberType) { + this.memberType = memberType; + } + + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/tonglian/TlRequest.java b/food-open/food-open-api/src/main/java/com/jwsaas/tonglian/TlRequest.java new file mode 100644 index 0000000..3fb520b --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/tonglian/TlRequest.java @@ -0,0 +1,138 @@ +package com.jwsaas.tonglian; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import org.apache.commons.lang3.StringUtils; + +import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.TreeMap; + +/** + * @author zzq + * @version 1.0.0 + * @Title {@link} + * @Description + * @date 2020/5/26 + */ +public class TlRequest implements Serializable { + + private static final long serialVersionUID = -1128445146065327824L; + + private String appId; + private String version; + private String charset; + private String signType; + private String sign; + private String timestamp; + private String method; + private T bizContent; + + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getCharset() { + return charset; + } + + public void setCharset(String charset) { + this.charset = charset; + } + + public String getSignType() { + return signType; + } + + public void setSignType(String signType) { + this.signType = signType; + } + + public String getSign() { + return sign; + } + + public void setSign(String sign) { + this.sign = sign; + } + + public String getTimestamp() { + return timestamp; + } + + public void setTimestamp(String timestamp) { + this.timestamp = timestamp; + } + + public String getMethod() { + return method; + } + + public void setMethod(String method) { + this.method = method; + } + + public T getBizContent() { + return bizContent; + } + + public void setBizContent(T bizContent) { + this.bizContent = bizContent; + } + + public void sign(String key) { + TreeMap param = new TreeMap<>(); + param.put("appId", appId); + param.put("version", version); + param.put("charset", charset); + param.put("signType", signType); + param.put("timestamp", timestamp); + param.put("method", method); + param.put("bizContent", JSON.toJSONString(bizContent)); + param.put("key", key); + this.sign = TlSignUtils.sign(param); + } + + public Map toMap() { + Map param = new HashMap<>(); + param.put("appId", appId); + param.put("version", version); + param.put("charset", charset); + param.put("signType", signType); + param.put("timestamp", timestamp); + param.put("method", method); + param.put("sign", sign); + param.put("bizContent", JSON.toJSONString(bizContent)); + return param; + } + + public void verify(String result) { + JSONObject jsonObject = JSON.parseObject(result); + TreeMap resultParam = new TreeMap<>(); + for (Entry each : jsonObject.entrySet()) { + resultParam.put(each.getKey(), + Objects.nonNull(each.getValue()) ? String.valueOf(each.getValue()) : StringUtils.EMPTY); + } + resultParam.put("key", TlCommonConstants.APP_KEY); + if (!TlSignUtils.verify(resultParam)) { + throw new RuntimeException("验签不通过"); + } + } + + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/tonglian/TlSignUtils.java b/food-open/food-open-api/src/main/java/com/jwsaas/tonglian/TlSignUtils.java new file mode 100644 index 0000000..637939e --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/tonglian/TlSignUtils.java @@ -0,0 +1,38 @@ +package com.jwsaas.tonglian; + +import org.apache.commons.codec.digest.DigestUtils; +import org.apache.commons.lang3.StringUtils; + +import java.util.Map.Entry; +import java.util.StringJoiner; +import java.util.TreeMap; + +/** + * @author zzq + * @version 1.0.0 + * @Title {@link} + * @Description + * @date 2020/5/27 + */ +//@Slf4j +public class TlSignUtils { + + public static String sign(TreeMap param) { + StringJoiner joiner = new StringJoiner("&"); + for (Entry each : param.entrySet()) { + joiner.add(StringUtils.join(each.getKey(), "=", each.getValue())); + } + // log.info("签名原文 : [{}]", joiner.toString()); + return DigestUtils.md5Hex(joiner.toString()); + } + + public static boolean verify(TreeMap param) { + String originalSign = param.remove("sign"); + String sign = sign(param); + // log.info("原密文 : [{}], MD5签名结果 : [{}]", originalSign, sign); + boolean verify = StringUtils.equals(originalSign, sign); + // log.info("签名验证结果: [{}]", verify ? "通过" : "不通过"); + return verify; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/tonglian/bean/AgentCollectApply.java b/food-open/food-open-api/src/main/java/com/jwsaas/tonglian/bean/AgentCollectApply.java new file mode 100644 index 0000000..8220b36 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/tonglian/bean/AgentCollectApply.java @@ -0,0 +1,192 @@ +package com.jwsaas.tonglian.bean; + +import java.io.Serializable; + +/** + * 托管代收 + * @Author 37962 + * @Date 2023/6/12 + */ +public class AgentCollectApply implements Serializable { + + private static final long serialVersionUID = -7990310382699513609L; + //付款方userid + private String payuserid; + //商户交易单号 + private String reqsn; + //微信openid + private String acct; + //付款方userid类型 + private String payuseridtype; + //收款列表 + private String recieverList; + //交易方式 + private String paytype; + //交易金额 + private Long amount; + //手续费 + private Long fee; + //页面跳转同步通知页面路径 + private String frontUrl; + //服务器异步通知页面路径 + private String backUrl; + //订单有效时间 + private String orderExpireDatetime; + //支付限制 + private String limit_pay; + private String consumer_ip; + //用户付款码 + private String authCode; + //访问终端类型 手机1 PC2 + private String source ; + //备注 + private String remark; + //收银宝商户号 + private String vspCusid; + //收银宝子商户号 + private String subAppid; + + public String getPayuserid() { + return payuserid; + } + + public void setPayuserid(String payuserid) { + this.payuserid = payuserid; + } + + public String getReqsn() { + return reqsn; + } + + public void setReqsn(String reqsn) { + this.reqsn = reqsn; + } + + public String getAcct() { + return acct; + } + + public void setAcct(String acct) { + this.acct = acct; + } + + public String getPayuseridtype() { + return payuseridtype; + } + + public void setPayuseridtype(String payuseridtype) { + this.payuseridtype = payuseridtype; + } + + public String getRecieverList() { + return recieverList; + } + + public void setRecieverList(String recieverList) { + this.recieverList = recieverList; + } + + public String getPaytype() { + return paytype; + } + + public void setPaytype(String paytype) { + this.paytype = paytype; + } + + public Long getAmount() { + return amount; + } + + public void setAmount(Long amount) { + this.amount = amount; + } + + public Long getFee() { + return fee; + } + + public void setFee(Long fee) { + this.fee = fee; + } + + public String getFrontUrl() { + return frontUrl; + } + + public void setFrontUrl(String frontUrl) { + this.frontUrl = frontUrl; + } + + public String getBackUrl() { + return backUrl; + } + + public void setBackUrl(String backUrl) { + this.backUrl = backUrl; + } + + public String getOrderExpireDatetime() { + return orderExpireDatetime; + } + + public void setOrderExpireDatetime(String orderExpireDatetime) { + this.orderExpireDatetime = orderExpireDatetime; + } + + public String getLimit_pay() { + return limit_pay; + } + + public void setLimit_pay(String limit_pay) { + this.limit_pay = limit_pay; + } + + public String getConsumer_ip() { + return consumer_ip; + } + + public void setConsumer_ip(String consumer_ip) { + this.consumer_ip = consumer_ip; + } + + public String getAuthCode() { + return authCode; + } + + public void setAuthCode(String authCode) { + this.authCode = authCode; + } + + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getVspCusid() { + return vspCusid; + } + + public void setVspCusid(String vspCusid) { + this.vspCusid = vspCusid; + } + + public String getSubAppid() { + return subAppid; + } + + public void setSubAppid(String subAppid) { + this.subAppid = subAppid; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/tonglian/bean/OrderRefund.java b/food-open/food-open-api/src/main/java/com/jwsaas/tonglian/bean/OrderRefund.java new file mode 100644 index 0000000..46cb2fb --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/tonglian/bean/OrderRefund.java @@ -0,0 +1,91 @@ +package com.jwsaas.tonglian.bean; + +import java.io.Serializable; + +/** + * @Author 37962 退款参数 + * @Date 2023/9/15 + */ +public class OrderRefund implements Serializable { + + //商户订单号 商户的交易订单号 + private String reqsn; + //原交易订单号 原交易的商户订单号 + private String oldreqsn; + //原订单付款方userid 微信openid,支付宝userid等 + private String payuserid; + //退款金额 单位为分 + private String amount; + //退款方式 D0或D1,默认为D1 + private String refundType; + //托管代收订单中的收款人的退款金额 + private String refundList; + //后台通知地址 + private String backUrl; + //退款备注 + private String remark; + + public String getReqsn() { + return reqsn; + } + + public void setReqsn(String reqsn) { + this.reqsn = reqsn; + } + + public String getOldreqsn() { + return oldreqsn; + } + + public void setOldreqsn(String oldreqsn) { + this.oldreqsn = oldreqsn; + } + + public String getPayuserid() { + return payuserid; + } + + public void setPayuserid(String payuserid) { + this.payuserid = payuserid; + } + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public String getRefundType() { + return refundType; + } + + public void setRefundType(String refundType) { + this.refundType = refundType; + } + + public String getRefundList() { + return refundList; + } + + public void setRefundList(String refundList) { + this.refundList = refundList; + } + + public String getBackUrl() { + return backUrl; + } + + public void setBackUrl(String backUrl) { + this.backUrl = backUrl; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/tonglian/bean/Reqsn.java b/food-open/food-open-api/src/main/java/com/jwsaas/tonglian/bean/Reqsn.java new file mode 100644 index 0000000..b7f91da --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/tonglian/bean/Reqsn.java @@ -0,0 +1,18 @@ +package com.jwsaas.tonglian.bean; + +/** + * @Author 37962 + * @Date 2023/9/11 + */ +public class Reqsn { + //商户订单号 + private String reqsn; + + public String getReqsn() { + return reqsn; + } + + public void setReqsn(String reqsn) { + this.reqsn = reqsn; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/util/AES.java b/food-open/food-open-api/src/main/java/com/jwsaas/util/AES.java new file mode 100644 index 0000000..763004c --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/util/AES.java @@ -0,0 +1,70 @@ +package com.jwsaas.util; + +import java.security.AlgorithmParameters; +import java.security.InvalidAlgorithmParameterException; +import java.security.InvalidKeyException; +import java.security.Key; +import java.security.NoSuchAlgorithmException; +import java.security.NoSuchProviderException; +import java.security.Security; + +import javax.crypto.BadPaddingException; +import javax.crypto.Cipher; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.NoSuchPaddingException; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; + +import org.bouncycastle.jce.provider.BouncyCastleProvider; + +public class AES { + public static boolean initialized = false; + + /** + * AES解密 + * + * @param content + * 密文 + * @return + * @throws InvalidAlgorithmParameterException + * @throws NoSuchProviderException + */ + public byte[] decrypt(byte[] content, byte[] keyByte, byte[] ivByte) throws InvalidAlgorithmParameterException { + initialize(); + try { + Cipher cipher = Cipher.getInstance("AES/CBC/PKCS7Padding"); + Key sKeySpec = new SecretKeySpec(keyByte, "AES"); + cipher.init(Cipher.DECRYPT_MODE, sKeySpec, generateIV(ivByte));// 初始化 + byte[] result = cipher.doFinal(content); + return result; + } catch (NoSuchAlgorithmException e) { + e.printStackTrace(); + } catch (NoSuchPaddingException e) { + e.printStackTrace(); + } catch (InvalidKeyException e) { + e.printStackTrace(); + } catch (IllegalBlockSizeException e) { + e.printStackTrace(); + } catch (BadPaddingException e) { + e.printStackTrace(); + } catch (NoSuchProviderException e) { // TODO Auto-generated catch block + e.printStackTrace(); + } catch (Exception e) { // TODO Auto-generated catch block + e.printStackTrace(); + } + return null; + } + + public static void initialize() { + if (initialized) + return; + Security.addProvider(new BouncyCastleProvider()); + initialized = true; + } // 生成iv + + public static AlgorithmParameters generateIV(byte[] iv) throws Exception { + AlgorithmParameters params = AlgorithmParameters.getInstance("AES"); + params.init(new IvParameterSpec(iv)); + return params; + } +} \ No newline at end of file diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/util/Assert.java b/food-open/food-open-api/src/main/java/com/jwsaas/util/Assert.java new file mode 100644 index 0000000..daa8743 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/util/Assert.java @@ -0,0 +1,125 @@ +package com.jwsaas.util; + +/** + * org.springframework.util.Assert + */ +public abstract class Assert { + + /** + * Assert a boolean expression, throwing an {@code IllegalStateException} if + * the expression evaluates to {@code false}. + *

+ * Call {@link #isTrue} if you wish to throw an + * {@code IllegalArgumentException} on an assertion failure. + * + *

+	 * Assert.state(id == null, "The id property must not already be initialized");
+	 * 
+ * + * @param expression + * a boolean expression + * @param message + * the exception message to use if the assertion fails + * @throws IllegalStateException + * if {@code expression} is {@code false} + */ + public static void state(boolean expression, String message) { + if (!expression) { + throw new IllegalStateException(message); + } + } + + /** + * @deprecated as of 4.3.7, in favor of {@link #state(boolean, String)} + */ + @Deprecated + public static void state(boolean expression) { + state(expression, "[Assertion failed] - this state invariant must be true"); + } + + /** + * Assert a boolean expression, throwing an {@code IllegalArgumentException} + * if the expression evaluates to {@code false}. + * + *
+	 * Assert.isTrue(i > 0, "The value must be greater than zero");
+	 * 
+ * + * @param expression + * a boolean expression + * @param message + * the exception message to use if the assertion fails + * @throws IllegalArgumentException + * if {@code expression} is {@code false} + */ + public static void isTrue(boolean expression, String message) { + if (!expression) { + throw new IllegalArgumentException(message); + } + } + + /** + * @deprecated as of 4.3.7, in favor of {@link #isTrue(boolean, String)} + */ + @Deprecated + public static void isTrue(boolean expression) { + isTrue(expression, "[Assertion failed] - this expression must be true"); + } + + /** + * Assert that an object is {@code null}. + * + *
+	 * Assert.isNull(value, "The value must be null");
+	 * 
+ * + * @param object + * the object to check + * @param message + * the exception message to use if the assertion fails + * @throws IllegalArgumentException + * if the object is not {@code null} + */ + public static void isNull(Object object, String message) { + if (object != null) { + throw new IllegalArgumentException(message); + } + } + + /** + * @deprecated as of 4.3.7, in favor of {@link #isNull(Object, String)} + */ + @Deprecated + public static void isNull(Object object) { + isNull(object, "[Assertion failed] - the object argument must be null"); + } + + /** + * Assert that an object is not {@code null}. + * + *
+	 * Assert.notNull(clazz, "The class must not be null");
+	 * 
+ * + * @param object + * the object to check + * @param message + * the exception message to use if the assertion fails + * @throws IllegalArgumentException + * if the object is {@code null} + */ + public static void notNull(Object object, String message) { + if (object == null) { + throw new IllegalArgumentException(message); + } + } + + /** + * @deprecated as of 4.3.7, in favor of {@link #notNull(Object, String)} + */ + @Deprecated + public static void notNull(Object object) { + notNull(object, "[Assertion failed] - this argument is required; it must not be null"); + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/util/CardApiUtils.java b/food-open/food-open-api/src/main/java/com/jwsaas/util/CardApiUtils.java new file mode 100644 index 0000000..f56f35a --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/util/CardApiUtils.java @@ -0,0 +1,190 @@ +package com.jwsaas.util; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.http.HttpResponse; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Component; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.jwsaas.Constant; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.config.OpenCardApiProperties; +import com.jwsaas.entity.wxdc.WeixinAccount; +import com.jwsaas.http.HttpTool; +import com.jwsaas.service.wxdc.WeixinAccountService; +import com.jwsaas.util.open.BaseCardApiUtils; + +@Component +@Lazy(false) +public class CardApiUtils extends BaseCardApiUtils{ + + private final static Logger logger = LoggerFactory.getLogger(CardApiUtils.class); + + private final static String className = "CardApiUtils"; + + @Autowired + private WeixinAccountService weixinAccountService; + + /*** + * 查询支付记录 + * @param wid + * @param mobile + * @param storeNo + * @param posNo + * @param workerNo + * @return + */ + public JSONObject queryOrder(String wid,String tradeVoucherNo,String tradeNo,String shopNo,String posNo,String workerNo) { + logger.debug(className + " >> queryOrder request >>>>wid:{} tradeNo:{} shopNo:{}", wid , tradeNo, shopNo); + + JSONObject result = new JSONObject(); + try { + WeixinAccount account = null; + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("hashids", wid)); + List weixinAccountList = weixinAccountService.getList(Constant.DEFAULT_DB_SIGN, criteria); + if (CollectionUtils.isNotEmpty(weixinAccountList) && weixinAccountList.size() == 1) { + account = weixinAccountList.get(0); + } + if (account == null) { + logger.warn("not register weixin server"); + return result; + } + + // 获取公众号对应的开放平台参数 + OpenCardApiProperties properties = new OpenCardApiProperties(account.getCards()); + System.out.println("param:"+JSON.toJSONString(properties)); + + Map paramMap = new HashMap(20); + List ignoreSignParams = new ArrayList(); + // 系统级参数 + paramMap.put("appKey", properties.getAppKey()); + paramMap.put("appKey", properties.getAppKey()); + paramMap.put("method", "jw.trade.query"); + paramMap.put("v", properties.getVersion()); + paramMap.put("format", properties.getFormat()); + paramMap.put("locale", properties.getLocale()); + paramMap.put("client", properties.getClient()); + paramMap.put("timestamp", String.valueOf(System.currentTimeMillis())); + // 业务参数 + paramMap.put("tradeVoucherNo", tradeVoucherNo); + paramMap.put("tradeNo", tradeNo); + paramMap.put("shopNo", shopNo); + paramMap.put("posNo", posNo); + paramMap.put("workerNo", workerNo); + paramMap.put("sourceSign","web"); + // 参数签名 + String signValue = this.sign(paramMap, ignoreSignParams, properties.getAppSecret()); + paramMap.put("sign", signValue); + + System.out.println("queryOrder param>>>>>>>>>>>"+JSON.toJSONString(paramMap)); + + long startTime = System.currentTimeMillis(); + final HttpResponse response = HttpTool.url(this.serverUrl).form(paramMap).post(); + long endTime = System.currentTimeMillis(); + System.out.println("请求耗时:" + (endTime - startTime)); + + final String content = HttpTool.getResponseAsString(response); + if (this.isSuccessful(content)) { + logger.debug("queryOrder response:{}", content); + if (this.isSuccessful(content)) { + result = JSON.parseObject(content); + } + } else { + logger.debug("http>resp>:{}", content); + } + } catch (Exception ex) { + logger.error("queryOrder Exception", ex); + } + return result; + } + + /*** + * 撤回支付订单 + * @param wid + * @param tradeVoucherNo + * @param tradeNo + * @param shopNo + * @param posNo + * @param workerNo + * @return + */ + public JSONObject cancelOrder(String wid,String tradeVoucherNo,String tradeNo,String refundNo,String reason,String shopNo,String posNo,String workerNo) { + logger.debug(className + " >> cancelOrder request >>>>wid:{} tradeNo:{} shopNo:{}", wid , tradeNo, shopNo); + + JSONObject result = new JSONObject(); + try { + WeixinAccount account = null; + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("hashids", wid)); + List weixinAccountList = weixinAccountService.getList(Constant.DEFAULT_DB_SIGN, criteria); + if (CollectionUtils.isNotEmpty(weixinAccountList) && weixinAccountList.size() == 1) { + account = weixinAccountList.get(0); + } + if (account == null) { + logger.warn("not register weixin server"); + return null; + } + + // 获取公众号对应的开放平台参数 + OpenCardApiProperties properties = new OpenCardApiProperties(account.getCards()); + System.out.println("param:"+JSON.toJSONString(properties)); + + Map paramMap = new HashMap(20); + List ignoreSignParams = new ArrayList(); + // 系统级参数 + paramMap.put("appKey", properties.getAppKey()); + paramMap.put("method", "jw.trade.cancel"); + paramMap.put("v", properties.getVersion()); + paramMap.put("format", properties.getFormat()); + paramMap.put("locale", properties.getLocale()); + paramMap.put("client", properties.getClient()); + paramMap.put("timestamp", String.valueOf(System.currentTimeMillis())); + + // 业务参数 + paramMap.put("tradeVoucherNo", tradeVoucherNo); + paramMap.put("tradeNo", tradeNo); // 业务单据号 + paramMap.put("ticketNo", refundNo); + paramMap.put("reason", reason); + paramMap.put("shopNo", shopNo); + paramMap.put("posNo", posNo); + paramMap.put("workerNo", workerNo); + paramMap.put("sourceSign","web"); + + ignoreSignParams.add("reason"); + // 参数签名 + String signValue = this.sign(paramMap, ignoreSignParams, properties.getAppSecret()); + paramMap.put("sign", signValue); + + System.out.println("cancelOrder param>>>>>>>>>>>"+JSON.toJSONString(paramMap)); + + long startTime = System.currentTimeMillis(); + final HttpResponse response = HttpTool.url(this.serverUrl).form(paramMap).post(); + long endTime = System.currentTimeMillis(); + System.out.println("请求耗时:" + (endTime - startTime)); + + final String content = HttpTool.getResponseAsString(response); + if (this.isSuccessful(content)) { + logger.debug("cancelOrder response:{}", content); + if (this.isSuccessful(content)) { + result = JSON.parseObject(content); + } + } else { + logger.debug("http>resp>:{}", content); + } + } catch (Exception ex) { + logger.error("cancelOrder Exception", ex); + } + return result; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/util/CronUtil.java b/food-open/food-open-api/src/main/java/com/jwsaas/util/CronUtil.java new file mode 100644 index 0000000..95cb438 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/util/CronUtil.java @@ -0,0 +1,37 @@ +package com.jwsaas.util; + +import java.text.SimpleDateFormat; +import java.util.Date; + +public class CronUtil { + + /*** + * 功能描述:日期转换cron表达式 + * + * @param date + * @param dateFormat + * : e.g:yyyy-MM-dd HH:mm:ss + * @return + */ + public static String formatDateByPattern(Date date, String dateFormat) { + SimpleDateFormat sdf = new SimpleDateFormat(dateFormat); + String formatTimeStr = null; + if (date != null) { + formatTimeStr = sdf.format(date); + } + return formatTimeStr; + } + + /*** + * convert Date to cron ,eg. "0 07 10 15 1 ? 2016" + * + * @param date + * : 时间点 + * @return + */ + public static String getCron(Date date) { + String dateFormat = "ss mm HH dd MM ? yyyy"; + return formatDateByPattern(date, dateFormat); + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/util/DateUtils.java b/food-open/food-open-api/src/main/java/com/jwsaas/util/DateUtils.java new file mode 100644 index 0000000..bbcaf10 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/util/DateUtils.java @@ -0,0 +1,492 @@ +package com.jwsaas.util; + +import org.apache.commons.lang3.StringUtils; + +import java.text.DateFormat; +import java.text.MessageFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; + +/** + * 时间日期的工具类 + * + * @author : 张莹 + */ +public class DateUtils { + + public static final String DATETIME_FORMAT = "yyyyMMddHHmmss"; + public static final SimpleDateFormat SIMPLE_DATE_FORMAT = new SimpleDateFormat(DATETIME_FORMAT); + public static final String DATE_FORMAT = "yyyyMMdd"; + public static final String TIME_FORMAT = "HH:mm:ss"; + public static final String SHOW_DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss"; + public static final String SHOW_DATE_FORMAT = "yyyy-MM-dd"; + + /** + * 得到以yyyy-MM-dd格式表示的当前日期字符串 + */ + public static String getCurrentDate() { + return new SimpleDateFormat(SHOW_DATE_FORMAT).format(new Date()); + } + + /** + * 得到以HH:mm:ss表示的当前时间字符串 + */ + public static String getCurrentTime() { + return new SimpleDateFormat(TIME_FORMAT).format(new Date()); + } + + /** + * 获取当前时间串,格式为:yyyyMMddHHmmss + * + * @return + */ + public static final String getCurrDatetime() { + return format(new Date(), DATETIME_FORMAT); + } + + /** + * 获取当前日期串,格式为yyyyMMdd + * + * @return + */ + public static final String getCurrDate() { + return format(new Date(), DATE_FORMAT); + } + + /** + * 得到以yyyy-MM-dd HH:mm:ss表示的当前时间字符串 + */ + public static String getCurrentDateTime() { + return format(new Date(), SHOW_DATETIME_FORMAT); + } + + public static String getCurrentDateTime(String format) { + return format(new Date(), format); + } + + /** + * @param date + * 时间 + * @param format + * 格式化串 + * @return + */ + public static String format(Date date, String format) { + SimpleDateFormat sdf = new SimpleDateFormat(format); + return sdf.format(date); + } + + /** + * 对{@code date}字符串,采用0右补齐到{@code length}的长度 + * + * @param date + * @param length + * @return + */ + public static String pad0(String date, int length) { + return padChar(date, length, '0'); + } + + /** + * 对{@code date}字符串,采用9右补齐到{@code length}的长度 + * + * @param date + * @param length + * @return + */ + public static String pad9(String date, int length) { + return padChar(date, length, '9'); + } + + private static String padChar(String date, int length, char theChar) { + if (StringUtils.isEmpty(date)) { + date = ""; + } + return StringUtils.rightPad(date, length, theChar); + } + + /** + * {@code time1}是否小于{@code time2},即类似于 + * + *
+	 * time1 < time2
+	 * 
+ * + * 。 如果{@code time2}为null, 则视为最小。 + * + * @param time1 + * 时间字符串,格式为 yyyyMMddHHmmss,不足14位后补0 + * @param time2 + * 时间字符串,格式为 yyyyMMddHHmmss,不足14位后补0 + * @return + */ + public static boolean lessThan(String time1, String time2) { + if (StringUtils.isEmpty(time1)) { + if (StringUtils.isEmpty(time2)) { + return false; + } else { + return true; + } + } else { + return time1.compareTo(time2) < 0; + } + } + + /** + * {@code time1}是否大于{@code time2},即类似于 + * + *
+	 * time1 > time2
+	 * 
+ * + * 。如果{@code time2}为null, 则视为最大。 + * + * @param time1 + * 时间字符串,格式为 yyyyMMddHHmmss,不足14位后补9 + * @param time2 + * 时间字符串,格式为 yyyyMMddHHmmss,不足14位后补9 + * @return + */ + public static boolean greaterThan(String time1, String time2) { + if (StringUtils.isEmpty(time1)) { + if (StringUtils.isEmpty(time2)) { + return false; + } else { + return true; + } + } else { + return time1.compareTo(time2) > 0; + } + } + + /** + * 将datetime字符串时间转换为毫秒数 + * + * @param datetime + * 长度必须大于等于8而小于等于14,格式为 yyyyMMddHHmmss,不足14位后补0 + * @return + */ + public static long toMilliseconds(String datetime) { + return parseDate(datetime).getTime(); + } + + /** + * 将格式为{@link #DATETIME_FORMAT}的时间格式解析为Date对象,{@code datetime}的长度必须大于8小于14. + * + * @param datetime + * @return + */ + public static Date parseDate(String datetime) { + Assert.notNull(datetime, "datetime不能为空"); + Assert.isTrue(datetime.length() >= 4 && datetime.length() <= 14, "长度必须大于等于8而小于等于14"); + DateFormat dateFormat = SIMPLE_DATE_FORMAT; + try { + if (datetime.length() < 14) { + dateFormat = new SimpleDateFormat(DATETIME_FORMAT.substring(0, datetime.length())); + } + return dateFormat.parse(datetime); + } catch (ParseException e) { + throw new IllegalArgumentException("入参datetime:" + datetime + "解析异常,请检查格式必须为:" + DATETIME_FORMAT); + } + } + + /** + * 将字符串时间解析为对象 + * + * @param datetime + * @param format + * @return + */ + public static Date parseDate(String datetime, String format) { + Assert.notNull(datetime, "datetime不能为空"); + Assert.notNull(format, "datetime不能为空"); + Assert.isTrue(datetime.length() == format.length(), "值和格式串的长度不一致"); + DateFormat dateFormat = new SimpleDateFormat(format); + try { + return dateFormat.parse(datetime); + } catch (ParseException e) { + throw new IllegalArgumentException( + MessageFormat.format("入参datetime:{1}解析异常,请检查格式必须为:{2}", datetime, format)); + } + } + + public static int getDayOfWeek() { + Calendar cal = Calendar.getInstance(); + return cal.get(Calendar.DAY_OF_WEEK); + } + + public static int getDayOfWeek(Date date) { + Calendar cal = Calendar.getInstance(); + cal.setTime(date); + return cal.get(Calendar.DAY_OF_WEEK); + } + + public static int getDayOfMonth() { + Calendar cal = Calendar.getInstance(); + return cal.get(Calendar.DAY_OF_MONTH); + } + + public static int getDayOfMonth(Date date) { + Calendar cal = Calendar.getInstance(); + cal.setTime(date); + return cal.get(Calendar.DAY_OF_MONTH); + } + + // 获取某一个月的天数 + public static int getMaxDayOfMonth(Date date) { + Calendar cal = Calendar.getInstance(); + cal.setTime(date); + return cal.getActualMaximum(Calendar.DATE); + } + + // 获取某月的第一天 + public static String getFirstDayOfMonth(String date) { + Calendar cal = Calendar.getInstance(); + cal.setTime(parseDate(date, SHOW_DATE_FORMAT)); + cal.set(Calendar.DAY_OF_MONTH, 1); + return new SimpleDateFormat(SHOW_DATE_FORMAT).format(cal.getTime()); + } + + public static int getDayOfYear() { + Calendar cal = Calendar.getInstance(); + return cal.get(Calendar.DAY_OF_YEAR); + } + + public static int getDayOfYear(Date date) { + Calendar cal = Calendar.getInstance(); + cal.setTime(date); + return cal.get(Calendar.DAY_OF_YEAR); + } + + public static int getDayOfWeek(String date) { + Calendar cal = Calendar.getInstance(); + cal.setTime(parseDate(date, SHOW_DATE_FORMAT)); + return cal.get(Calendar.DAY_OF_WEEK); + } + + public static int getDayOfMonth(String date) { + Calendar cal = Calendar.getInstance(); + cal.setTime(parseDate(date, SHOW_DATE_FORMAT)); + return cal.get(Calendar.DAY_OF_MONTH); + } + + public static int getDayOfYear(String date) { + Calendar cal = Calendar.getInstance(); + cal.setTime(parseDate(date, SHOW_DATE_FORMAT)); + return cal.get(Calendar.DAY_OF_YEAR); + } + + public static int compare(String date1, String date2) { + return compare(date1, date2, SHOW_DATE_FORMAT); + } + + public static int compareTime(String time1, String time2) { + return compareTime(time1, time2, TIME_FORMAT); + } + + public static int compare(String date1, String date2, String format) { + Date d1 = parseDate(date1, format); + Date d2 = parseDate(date2, format); + return d1.compareTo(d2); + } + + public static int compareTime(String time1, String time2, String format) { + String[] arr1 = time1.split(":"); + String[] arr2 = time2.split(":"); + if (arr1.length < 2) { + throw new RuntimeException("错误的时间值:" + time1); + } + if (arr2.length < 2) { + throw new RuntimeException("错误的时间值:" + time2); + } + int h1 = Integer.parseInt(arr1[0]); + int m1 = Integer.parseInt(arr1[1]); + int h2 = Integer.parseInt(arr2[0]); + int m2 = Integer.parseInt(arr2[1]); + int s1 = 0, s2 = 0; + if (arr1.length == 3) { + s1 = Integer.parseInt(arr1[2]); + } + if (arr2.length == 3) { + s2 = Integer.parseInt(arr2[2]); + } + if (h1 < 0 || h1 > 23 || m1 < 0 || m1 > 59 || s1 < 0 || s1 > 59) { + throw new RuntimeException("错误的时间值:" + time1); + } + if (h2 < 0 || h2 > 23 || m2 < 0 || m2 > 59 || s2 < 0 || s2 > 59) { + throw new RuntimeException("错误的时间值:" + time2); + } + if (h1 != h2) { + return h1 > h2 ? 1 : -1; + } else { + if (m1 == m2) { + if (s1 == s2) { + return 0; + } else { + return s1 > s2 ? 1 : -1; + } + } else { + return m1 > m2 ? 1 : -1; + } + } + } + + public static boolean isTime(String time) { + String[] arr = time.split(":"); + if (arr.length < 2) { + return false; + } + try { + int h = Integer.parseInt(arr[0]); + int m = Integer.parseInt(arr[1]); + int s = 0; + if (arr.length == 3) { + s = Integer.parseInt(arr[2]); + } + if (h < 0 || h > 23 || m < 0 || m > 59 || s < 0 || s > 59) { + return false; + } + } catch (Exception e) { + return false; + } + return true; + } + + public static boolean isDate(String date) { + String[] arr = date.split("-"); + if (arr.length < 3) { + return false; + } + try { + int y = Integer.parseInt(arr[0]); + int m = Integer.parseInt(arr[1]); + int d = Integer.parseInt(arr[2]); + if (y < 0 || m > 12 || m < 0 || d < 0 || d > 31) { + return false; + } + } catch (Exception e) { + return false; + } + return true; + } + + public static boolean isWeekend(Date date) { + Calendar cal = Calendar.getInstance(); + cal.setTime(date); + int t = cal.get(Calendar.DAY_OF_WEEK); + if (t == Calendar.SATURDAY || t == Calendar.SUNDAY) { + return true; + } + return false; + } + + public static boolean isWeekend(String str) { + return isWeekend(parseDate(str)); + } + + /** + * 日期date上加count分钟,count为负表示减 + */ + public static Date addMinute(Date date, int count) { + return new Date(date.getTime() + 60000L * count); + } + + /** + * 日期date上加count小时,count为负表示减 + */ + public static Date addHour(Date date, int count) { + return new Date(date.getTime() + 3600000L * count); + } + + /** + * 日期date上加count天,count为负表示减 + */ + public static Date addDay(Date date, int count) { + return new Date(date.getTime() + 86400000L * count); + } + + /** + * 日期date上加count星期,count为负表示减 + */ + public static Date addWeek(Date date, int count) { + Calendar c = Calendar.getInstance(); + c.setTime(date); + c.add(Calendar.WEEK_OF_YEAR, count); + return c.getTime(); + } + + /** + * 日期date上加count月,count为负表示减 + */ + public static Date addMonth(Date date, int count) { + Calendar c = Calendar.getInstance(); + c.setTime(date); + c.add(Calendar.MONTH, count); + return c.getTime(); + } + + /** + * 日期date上加count年,count为负表示减 + */ + public static Date addYear(Date date, int count) { + Calendar c = Calendar.getInstance(); + c.setTime(date); + c.add(Calendar.YEAR, count); + return c.getTime(); + } + + public static String toDisplayDateTime(String date) { + if (StringUtils.isEmpty(date)) + return null; + try { + if (isDate(date)) { + return toDisplayDateTime(parseDate(date, SHOW_DATE_FORMAT)); + } + SimpleDateFormat t = new SimpleDateFormat(SHOW_DATETIME_FORMAT); + Date d = t.parse(date); + return toDisplayDateTime(d); + } catch (ParseException e) { + e.printStackTrace(); + } + return "不是标准格式时间!"; + } + + public static String toDisplayDateTime(Date date) { + long minite = (System.currentTimeMillis() - date.getTime()) / 60000L; + if (minite < 60L) { + return toString(date, "MM-dd") + " " + minite + "分钟前"; + } + if (minite < 1440L) { + return toString(date, "MM-dd") + " " + (minite / 60L) + "小时前"; + } + return toString(date, "MM-dd") + " " + (minite / 1440L) + "天前"; + } + + /** + * 按指定的format输出日期字符串 + */ + public static String toString(Date date, String format) { + SimpleDateFormat t = new SimpleDateFormat(format); + return t.format(date); + } + + // 获得本周第一天 + public static String getFirstDayOfNowWeek() { + Calendar cal = Calendar.getInstance(); + SimpleDateFormat df = new SimpleDateFormat(SHOW_DATE_FORMAT); + cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY); // 获取本周一的日期 + return df.format(cal.getTime()); + } + + // 获取本月第一天 + public static String getFirstDayOfNowMonth() { + Calendar cal = Calendar.getInstance(); + cal.add(Calendar.MONTH, 0); + cal.set(Calendar.DAY_OF_MONTH, 1);// 设置为1号,当前日期既为本月第一天 + SimpleDateFormat df = new SimpleDateFormat(SHOW_DATE_FORMAT); + return df.format(cal.getTime()); + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/util/DesUtil.java b/food-open/food-open-api/src/main/java/com/jwsaas/util/DesUtil.java new file mode 100644 index 0000000..02f45b6 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/util/DesUtil.java @@ -0,0 +1,1030 @@ +package com.jwsaas.util; +import java.util.ArrayList; +import java.util.List; + +public class DesUtil { + public DesUtil() { + } + + private static final String key1 = "$QBOSSY$"; + + private static final String key2 = "$QBOSSY$"; + + private static final String key3 = "$QBOSSY$"; + + public static void main(String[] args) { + DesUtil desObj = new DesUtil(); + String key1 = "$QBOSSY$"; + String key2 = "$QBOSSY$"; + String key3 = "$QBOSSY$"; + String data = "{\"tenantId\":\"373001\",\"storeNo\":\"000001\",\"posNo\":\"00034\",\"workerNo\":\"00001\"}"; + String str = desObj.strEnc(data, key1, key2, key3); + System.out.println(str); + String dec = desObj.strDec("D77D786226F9238C37491BC9649698CE0D68381C27E776FB34C69BEFB3D65F2BDF56245796A447790628BA524D71C88C5E8EBEB345B7AD94EBD404B5C35A77487E441A45A4987F45BD4ED8A3B7951165B48C1800D6804BF7CD94D43F228FEB77076A18FFB0A3C7E71142C5094DCA8EF15DC43957179828BDB11894DBC9F32106EBD404B5C35A77487E441A45A4987F452A732DB7DC87B71C", key1, key2, key3); + System.out.println(dec); + } + + + + public static String strEncWithOutKey(String data){ + return strEnc(data,key1,key2,key3); + } + + public static String strDecWithOutKey(String data){ + return strDec(data,key1,key2,key3); + } + + /** + * DES加密/解密 + * + * @Copyright Copyright (c) 2006 + * @author Guapo + * @see DESCore + */ + + /* + * encrypt the string to string made up of hex return the encrypted string + */ + public static String strEnc(String data, String firstKey, String secondKey, String thirdKey) { + + int leng = data.length(); + String encData = ""; + List firstKeyBt = null, secondKeyBt = null, thirdKeyBt = null; + int firstLength = 0, secondLength = 0, thirdLength = 0; + if (firstKey != null && firstKey != "") { + firstKeyBt = getKeyBytes(firstKey); + firstLength = firstKeyBt.size(); + } + if (secondKey != null && secondKey != "") { + secondKeyBt = getKeyBytes(secondKey); + secondLength = secondKeyBt.size(); + } + if (thirdKey != null && thirdKey != "") { + thirdKeyBt = getKeyBytes(thirdKey); + thirdLength = thirdKeyBt.size(); + } + + if (leng > 0) { + if (leng < 4) { + int[] bt = strToBt(data); + int[] encByte = null; + if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "" && thirdKey != null && thirdKey != "") { + int[] tempBt; + int x, y, z; + tempBt = bt; + for (x = 0; x < firstLength; x++) { + tempBt = enc(tempBt, (int[]) firstKeyBt.get(x)); + } + for (y = 0; y < secondLength; y++) { + tempBt = enc(tempBt, (int[]) secondKeyBt.get(y)); + } + for (z = 0; z < thirdLength; z++) { + tempBt = enc(tempBt, (int[]) thirdKeyBt.get(z)); + } + encByte = tempBt; + } else { + if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "") { + int[] tempBt; + int x, y; + tempBt = bt; + for (x = 0; x < firstLength; x++) { + tempBt = enc(tempBt, (int[]) firstKeyBt.get(x)); + } + for (y = 0; y < secondLength; y++) { + tempBt = enc(tempBt, (int[]) secondKeyBt.get(y)); + } + encByte = tempBt; + } else { + if (firstKey != null && firstKey != "") { + int[] tempBt; + int x = 0; + tempBt = bt; + for (x = 0; x < firstLength; x++) { + tempBt = enc(tempBt, (int[]) firstKeyBt.get(x)); + } + encByte = tempBt; + } + } + } + encData = bt64ToHex(encByte); + } else { + int iterator = (leng / 4); + int remainder = leng % 4; + int i = 0; + for (i = 0; i < iterator; i++) { + String tempData = data.substring(i * 4 + 0, i * 4 + 4); + int[] tempByte = strToBt(tempData); + int[] encByte = null; + if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "" && thirdKey != null && thirdKey != "") { + int[] tempBt; + int x, y, z; + tempBt = tempByte; + for (x = 0; x < firstLength; x++) { + tempBt = enc(tempBt, (int[]) firstKeyBt.get(x)); + } + for (y = 0; y < secondLength; y++) { + tempBt = enc(tempBt, (int[]) secondKeyBt.get(y)); + } + for (z = 0; z < thirdLength; z++) { + tempBt = enc(tempBt, (int[]) thirdKeyBt.get(z)); + } + encByte = tempBt; + } else { + if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "") { + int[] tempBt; + int x, y; + tempBt = tempByte; + for (x = 0; x < firstLength; x++) { + tempBt = enc(tempBt, (int[]) firstKeyBt.get(x)); + } + for (y = 0; y < secondLength; y++) { + tempBt = enc(tempBt, (int[]) secondKeyBt.get(y)); + } + encByte = tempBt; + } else { + if (firstKey != null && firstKey != "") { + int[] tempBt; + int x; + tempBt = tempByte; + for (x = 0; x < firstLength; x++) { + tempBt = enc(tempBt, (int[]) firstKeyBt.get(x)); + } + encByte = tempBt; + } + } + } + encData += bt64ToHex(encByte); + String s = "ss"; + s.substring(0, 1); + } + if (remainder > 0) { + String remainderData = data.substring(iterator * 4 + 0, leng); + int[] tempByte = strToBt(remainderData); + int[] encByte = null; + if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "" && thirdKey != null && thirdKey != "") { + int[] tempBt; + int x, y, z; + tempBt = tempByte; + for (x = 0; x < firstLength; x++) { + tempBt = enc(tempBt, (int[]) firstKeyBt.get(x)); + } + for (y = 0; y < secondLength; y++) { + tempBt = enc(tempBt, (int[]) secondKeyBt.get(y)); + } + for (z = 0; z < thirdLength; z++) { + tempBt = enc(tempBt, (int[]) thirdKeyBt.get(z)); + } + encByte = tempBt; + } else { + if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "") { + int[] tempBt; + int x, y; + tempBt = tempByte; + for (x = 0; x < firstLength; x++) { + tempBt = enc(tempBt, (int[]) firstKeyBt.get(x)); + } + for (y = 0; y < secondLength; y++) { + tempBt = enc(tempBt, (int[]) secondKeyBt.get(y)); + } + encByte = tempBt; + } else { + if (firstKey != null && firstKey != "") { + int[] tempBt; + int x; + tempBt = tempByte; + for (x = 0; x < firstLength; x++) { + tempBt = enc(tempBt, (int[]) firstKeyBt.get(x)); + } + encByte = tempBt; + } + } + } + encData += bt64ToHex(encByte); + } + } + } + return encData; + } + + /* + * decrypt the encrypted string to the original string + * + * return the original string + */ + public static String strDec(String data, String firstKey, String secondKey, String thirdKey) { + int leng = data.length(); + String decStr = ""; + List firstKeyBt = null, secondKeyBt = null, thirdKeyBt = null; + int firstLength = 0, secondLength = 0, thirdLength = 0; + if (firstKey != null && firstKey != "") { + firstKeyBt = getKeyBytes(firstKey); + firstLength = firstKeyBt.size(); + } + if (secondKey != null && secondKey != "") { + secondKeyBt = getKeyBytes(secondKey); + secondLength = secondKeyBt.size(); + } + if (thirdKey != null && thirdKey != "") { + thirdKeyBt = getKeyBytes(thirdKey); + thirdLength = thirdKeyBt.size(); + } + + int iterator = leng / 16; + int i = 0; + for (i = 0; i < iterator; i++) { + String tempData = data.substring(i * 16 + 0, i * 16 + 16); + String strByte = hexToBt64(tempData); + int[] intByte = new int[64]; + int j = 0; + for (j = 0; j < 64; j++) { + intByte[j] = Integer.parseInt(strByte.substring(j, j + 1)); + } + int[] decByte = null; + if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "" && thirdKey != null && thirdKey != "") { + int[] tempBt; + int x, y, z; + tempBt = intByte; + for (x = thirdLength - 1; x >= 0; x--) { + tempBt = dec(tempBt, (int[]) thirdKeyBt.get(x)); + } + for (y = secondLength - 1; y >= 0; y--) { + tempBt = dec(tempBt, (int[]) secondKeyBt.get(y)); + } + for (z = firstLength - 1; z >= 0; z--) { + tempBt = dec(tempBt, (int[]) firstKeyBt.get(z)); + } + decByte = tempBt; + } else { + if (firstKey != null && firstKey != "" && secondKey != null && secondKey != "") { + int[] tempBt; + int x, y, z; + tempBt = intByte; + for (x = secondLength - 1; x >= 0; x--) { + tempBt = dec(tempBt, (int[]) secondKeyBt.get(x)); + } + for (y = firstLength - 1; y >= 0; y--) { + tempBt = dec(tempBt, (int[]) firstKeyBt.get(y)); + } + decByte = tempBt; + } else { + if (firstKey != null && firstKey != "") { + int[] tempBt; + int x, y, z; + tempBt = intByte; + for (x = firstLength - 1; x >= 0; x--) { + tempBt = dec(tempBt, (int[]) firstKeyBt.get(x)); + } + decByte = tempBt; + } + } + } + decStr += byteToString(decByte); + } + return decStr; + } + + /* + * chang the string into the bit array + * + * return bit array(it's length % 64 = 0) + */ + public static List getKeyBytes(String key) { + List keyBytes = new ArrayList(); + int leng = key.length(); + int iterator = (leng / 4); + int remainder = leng % 4; + int i = 0; + for (i = 0; i < iterator; i++) { + keyBytes.add(i, strToBt(key.substring(i * 4 + 0, i * 4 + 4))); + } + if (remainder > 0) { + // keyBytes[i] = strToBt(key.substring(i*4+0,leng)); + keyBytes.add(i, strToBt(key.substring(i * 4 + 0, leng))); + } + return keyBytes; + } + + /* + * chang the string(it's length <= 4) into the bit array + * + * return bit array(it's length = 64) + */ + public static int[] strToBt(String str) { + int leng = str.length(); + int[] bt = new int[64]; + if (leng < 4) { + int i = 0, j = 0, p = 0, q = 0; + for (i = 0; i < leng; i++) { + int k = str.charAt(i); + for (j = 0; j < 16; j++) { + int pow = 1, m = 0; + for (m = 15; m > j; m--) { + pow *= 2; + } + // bt.set(16*i+j,""+(k/pow)%2)); + bt[16 * i + j] = (k / pow) % 2; + } + } + for (p = leng; p < 4; p++) { + int k = 0; + for (q = 0; q < 16; q++) { + int pow = 1, m = 0; + for (m = 15; m > q; m--) { + pow *= 2; + } + // bt[16*p+q]=parseInt(k/pow)%2; + // bt.add(16*p+q,""+((k/pow)%2)); + bt[16 * p + q] = (k / pow) % 2; + } + } + } else { + for (int i = 0; i < 4; i++) { + int k = str.charAt(i); + for (int j = 0; j < 16; j++) { + int pow = 1; + for (int m = 15; m > j; m--) { + pow *= 2; + } + // bt[16*i+j]=parseInt(k/pow)%2; + // bt.add(16*i+j,""+((k/pow)%2)); + bt[16 * i + j] = (k / pow) % 2; + } + } + } + return bt; + } + + /* + * chang the bit(it's length = 4) into the hex + * + * return hex + */ + public static String bt4ToHex(String binary) { + String hex = ""; + if (binary.equalsIgnoreCase("0000")) { + hex = "0"; + } else if (binary.equalsIgnoreCase("0001")) { + hex = "1"; + } else if (binary.equalsIgnoreCase("0010")) { + hex = "2"; + } else if (binary.equalsIgnoreCase("0011")) { + hex = "3"; + } else if (binary.equalsIgnoreCase("0100")) { + hex = "4"; + } else if (binary.equalsIgnoreCase("0101")) { + hex = "5"; + } else if (binary.equalsIgnoreCase("0110")) { + hex = "6"; + } else if (binary.equalsIgnoreCase("0111")) { + hex = "7"; + } else if (binary.equalsIgnoreCase("1000")) { + hex = "8"; + } else if (binary.equalsIgnoreCase("1001")) { + hex = "9"; + } else if (binary.equalsIgnoreCase("1010")) { + hex = "A"; + } else if (binary.equalsIgnoreCase("1011")) { + hex = "B"; + } else if (binary.equalsIgnoreCase("1100")) { + hex = "C"; + } else if (binary.equalsIgnoreCase("1101")) { + hex = "D"; + } else if (binary.equalsIgnoreCase("1110")) { + hex = "E"; + } else if (binary.equalsIgnoreCase("1111")) { + hex = "F"; + } + + return hex; + } + + /* + * chang the hex into the bit(it's length = 4) + * + * return the bit(it's length = 4) + */ + public static String hexToBt4(String hex) { + String binary = ""; + if (hex.equalsIgnoreCase("0")) { + binary = "0000"; + } else if (hex.equalsIgnoreCase("1")) { + binary = "0001"; + } + if (hex.equalsIgnoreCase("2")) { + binary = "0010"; + } + if (hex.equalsIgnoreCase("3")) { + binary = "0011"; + } + if (hex.equalsIgnoreCase("4")) { + binary = "0100"; + } + if (hex.equalsIgnoreCase("5")) { + binary = "0101"; + } + if (hex.equalsIgnoreCase("6")) { + binary = "0110"; + } + if (hex.equalsIgnoreCase("7")) { + binary = "0111"; + } + if (hex.equalsIgnoreCase("8")) { + binary = "1000"; + } + if (hex.equalsIgnoreCase("9")) { + binary = "1001"; + } + if (hex.equalsIgnoreCase("A")) { + binary = "1010"; + } + if (hex.equalsIgnoreCase("B")) { + binary = "1011"; + } + if (hex.equalsIgnoreCase("C")) { + binary = "1100"; + } + if (hex.equalsIgnoreCase("D")) { + binary = "1101"; + } + if (hex.equalsIgnoreCase("E")) { + binary = "1110"; + } + if (hex.equalsIgnoreCase("F")) { + binary = "1111"; + } + return binary; + } + + /* + * chang the bit(it's length = 64) into the string + * + * return string + */ + public static String byteToString(int[] byteData) { + String str = ""; + for (int i = 0; i < 4; i++) { + int count = 0; + for (int j = 0; j < 16; j++) { + int pow = 1; + for (int m = 15; m > j; m--) { + pow *= 2; + } + count += byteData[16 * i + j] * pow; + } + if (count != 0) { + str += "" + (char) (count); + } + } + return str; + } + + public static String bt64ToHex(int[] byteData) { + String hex = ""; + for (int i = 0; i < 16; i++) { + String bt = ""; + for (int j = 0; j < 4; j++) { + bt += byteData[i * 4 + j]; + } + hex += bt4ToHex(bt); + } + return hex; + } + + public static String hexToBt64(String hex) { + String binary = ""; + for (int i = 0; i < 16; i++) { + binary += hexToBt4(hex.substring(i, i + 1)); + } + return binary; + } + + /* + * the 64 bit des core arithmetic + */ + + public static int[] enc(int[] dataByte, int[] keyByte) { + int[][] keys = generateKeys(keyByte); + int[] ipByte = initPermute(dataByte); + int[] ipLeft = new int[32]; + int[] ipRight = new int[32]; + int[] tempLeft = new int[32]; + int i = 0, j = 0, k = 0, m = 0, n = 0; + for (k = 0; k < 32; k++) { + ipLeft[k] = ipByte[k]; + ipRight[k] = ipByte[32 + k]; + } + for (i = 0; i < 16; i++) { + for (j = 0; j < 32; j++) { + tempLeft[j] = ipLeft[j]; + ipLeft[j] = ipRight[j]; + } + int[] key = new int[48]; + for (m = 0; m < 48; m++) { + key[m] = keys[i][m]; + } + int[] tempRight = xor(pPermute(sBoxPermute(xor(expandPermute(ipRight), key))), tempLeft); + for (n = 0; n < 32; n++) { + ipRight[n] = tempRight[n]; + } + + } + + int[] finalData = new int[64]; + for (i = 0; i < 32; i++) { + finalData[i] = ipRight[i]; + finalData[32 + i] = ipLeft[i]; + } + return finallyPermute(finalData); + } + + public static int[] dec(int[] dataByte, int[] keyByte) { + int[][] keys = generateKeys(keyByte); + int[] ipByte = initPermute(dataByte); + int[] ipLeft = new int[32]; + int[] ipRight = new int[32]; + int[] tempLeft = new int[32]; + int i = 0, j = 0, k = 0, m = 0, n = 0; + for (k = 0; k < 32; k++) { + ipLeft[k] = ipByte[k]; + ipRight[k] = ipByte[32 + k]; + } + for (i = 15; i >= 0; i--) { + for (j = 0; j < 32; j++) { + tempLeft[j] = ipLeft[j]; + ipLeft[j] = ipRight[j]; + } + int[] key = new int[48]; + for (m = 0; m < 48; m++) { + key[m] = keys[i][m]; + } + + int[] tempRight = xor(pPermute(sBoxPermute(xor(expandPermute(ipRight), key))), tempLeft); + for (n = 0; n < 32; n++) { + ipRight[n] = tempRight[n]; + } + } + + int[] finalData = new int[64]; + for (i = 0; i < 32; i++) { + finalData[i] = ipRight[i]; + finalData[32 + i] = ipLeft[i]; + } + return finallyPermute(finalData); + } + + public static int[] initPermute(int[] originalData) { + int[] ipByte = new int[64]; + int i = 0, m = 1, n = 0, j, k; + for (i = 0, m = 1, n = 0; i < 4; i++, m += 2, n += 2) { + for (j = 7, k = 0; j >= 0; j--, k++) { + ipByte[i * 8 + k] = originalData[j * 8 + m]; + ipByte[i * 8 + k + 32] = originalData[j * 8 + n]; + } + } + return ipByte; + } + + public static int[] expandPermute(int[] rightData) { + int[] epByte = new int[48]; + int i, j; + for (i = 0; i < 8; i++) { + if (i == 0) { + epByte[i * 6 + 0] = rightData[31]; + } else { + epByte[i * 6 + 0] = rightData[i * 4 - 1]; + } + epByte[i * 6 + 1] = rightData[i * 4 + 0]; + epByte[i * 6 + 2] = rightData[i * 4 + 1]; + epByte[i * 6 + 3] = rightData[i * 4 + 2]; + epByte[i * 6 + 4] = rightData[i * 4 + 3]; + if (i == 7) { + epByte[i * 6 + 5] = rightData[0]; + } else { + epByte[i * 6 + 5] = rightData[i * 4 + 4]; + } + } + return epByte; + } + + public static int[] xor(int[] byteOne, int[] byteTwo) { + // var xorByte = new Array(byteOne.length); + // for(int i = 0;i < byteOne.length; i ++){ + // xorByte[i] = byteOne[i] ^ byteTwo[i]; + // } + // return xorByte; + int[] xorByte = new int[byteOne.length]; + for (int i = 0; i < byteOne.length; i++) { + xorByte[i] = byteOne[i] ^ byteTwo[i]; + } + return xorByte; + } + + public static int[] sBoxPermute(int[] expandByte) { + + // var sBoxByte = new Array(32); + int[] sBoxByte = new int[32]; + String binary = ""; + int[][] s1 = { { 14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7 }, { 0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8 }, { 4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0 }, { 15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13 } }; + + /* Table - s2 */ + int[][] s2 = { { 15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10 }, { 3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5 }, { 0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15 }, { 13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9 } }; + + /* Table - s3 */ + int[][] s3 = { { 10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8 }, { 13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1 }, { 13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7 }, { 1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12 } }; + /* Table - s4 */ + int[][] s4 = { { 7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15 }, { 13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9 }, { 10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4 }, { 3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14 } }; + + /* Table - s5 */ + int[][] s5 = { { 2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9 }, { 14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6 }, { 4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14 }, { 11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3 } }; + + /* Table - s6 */ + int[][] s6 = { { 12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11 }, { 10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8 }, { 9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6 }, { 4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13 } }; + + /* Table - s7 */ + int[][] s7 = { { 4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1 }, { 13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6 }, { 1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2 }, { 6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12 } }; + + /* Table - s8 */ + int[][] s8 = { { 13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7 }, { 1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2 }, { 7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8 }, { 2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11 } }; + + for (int m = 0; m < 8; m++) { + int i = 0, j = 0; + i = expandByte[m * 6 + 0] * 2 + expandByte[m * 6 + 5]; + j = expandByte[m * 6 + 1] * 2 * 2 * 2 + expandByte[m * 6 + 2] * 2 * 2 + expandByte[m * 6 + 3] * 2 + expandByte[m * 6 + 4]; + switch (m) { + case 0: + binary = getBoxBinary(s1[i][j]); + break; + case 1: + binary = getBoxBinary(s2[i][j]); + break; + case 2: + binary = getBoxBinary(s3[i][j]); + break; + case 3: + binary = getBoxBinary(s4[i][j]); + break; + case 4: + binary = getBoxBinary(s5[i][j]); + break; + case 5: + binary = getBoxBinary(s6[i][j]); + break; + case 6: + binary = getBoxBinary(s7[i][j]); + break; + case 7: + binary = getBoxBinary(s8[i][j]); + break; + } + sBoxByte[m * 4 + 0] = Integer.parseInt(binary.substring(0, 1)); + sBoxByte[m * 4 + 1] = Integer.parseInt(binary.substring(1, 2)); + sBoxByte[m * 4 + 2] = Integer.parseInt(binary.substring(2, 3)); + sBoxByte[m * 4 + 3] = Integer.parseInt(binary.substring(3, 4)); + } + return sBoxByte; + } + + public static int[] pPermute(int[] sBoxByte) { + int[] pBoxPermute = new int[32]; + pBoxPermute[0] = sBoxByte[15]; + pBoxPermute[1] = sBoxByte[6]; + pBoxPermute[2] = sBoxByte[19]; + pBoxPermute[3] = sBoxByte[20]; + pBoxPermute[4] = sBoxByte[28]; + pBoxPermute[5] = sBoxByte[11]; + pBoxPermute[6] = sBoxByte[27]; + pBoxPermute[7] = sBoxByte[16]; + pBoxPermute[8] = sBoxByte[0]; + pBoxPermute[9] = sBoxByte[14]; + pBoxPermute[10] = sBoxByte[22]; + pBoxPermute[11] = sBoxByte[25]; + pBoxPermute[12] = sBoxByte[4]; + pBoxPermute[13] = sBoxByte[17]; + pBoxPermute[14] = sBoxByte[30]; + pBoxPermute[15] = sBoxByte[9]; + pBoxPermute[16] = sBoxByte[1]; + pBoxPermute[17] = sBoxByte[7]; + pBoxPermute[18] = sBoxByte[23]; + pBoxPermute[19] = sBoxByte[13]; + pBoxPermute[20] = sBoxByte[31]; + pBoxPermute[21] = sBoxByte[26]; + pBoxPermute[22] = sBoxByte[2]; + pBoxPermute[23] = sBoxByte[8]; + pBoxPermute[24] = sBoxByte[18]; + pBoxPermute[25] = sBoxByte[12]; + pBoxPermute[26] = sBoxByte[29]; + pBoxPermute[27] = sBoxByte[5]; + pBoxPermute[28] = sBoxByte[21]; + pBoxPermute[29] = sBoxByte[10]; + pBoxPermute[30] = sBoxByte[3]; + pBoxPermute[31] = sBoxByte[24]; + return pBoxPermute; + } + + public static int[] finallyPermute(int[] endByte) { + int[] fpByte = new int[64]; + fpByte[0] = endByte[39]; + fpByte[1] = endByte[7]; + fpByte[2] = endByte[47]; + fpByte[3] = endByte[15]; + fpByte[4] = endByte[55]; + fpByte[5] = endByte[23]; + fpByte[6] = endByte[63]; + fpByte[7] = endByte[31]; + fpByte[8] = endByte[38]; + fpByte[9] = endByte[6]; + fpByte[10] = endByte[46]; + fpByte[11] = endByte[14]; + fpByte[12] = endByte[54]; + fpByte[13] = endByte[22]; + fpByte[14] = endByte[62]; + fpByte[15] = endByte[30]; + fpByte[16] = endByte[37]; + fpByte[17] = endByte[5]; + fpByte[18] = endByte[45]; + fpByte[19] = endByte[13]; + fpByte[20] = endByte[53]; + fpByte[21] = endByte[21]; + fpByte[22] = endByte[61]; + fpByte[23] = endByte[29]; + fpByte[24] = endByte[36]; + fpByte[25] = endByte[4]; + fpByte[26] = endByte[44]; + fpByte[27] = endByte[12]; + fpByte[28] = endByte[52]; + fpByte[29] = endByte[20]; + fpByte[30] = endByte[60]; + fpByte[31] = endByte[28]; + fpByte[32] = endByte[35]; + fpByte[33] = endByte[3]; + fpByte[34] = endByte[43]; + fpByte[35] = endByte[11]; + fpByte[36] = endByte[51]; + fpByte[37] = endByte[19]; + fpByte[38] = endByte[59]; + fpByte[39] = endByte[27]; + fpByte[40] = endByte[34]; + fpByte[41] = endByte[2]; + fpByte[42] = endByte[42]; + fpByte[43] = endByte[10]; + fpByte[44] = endByte[50]; + fpByte[45] = endByte[18]; + fpByte[46] = endByte[58]; + fpByte[47] = endByte[26]; + fpByte[48] = endByte[33]; + fpByte[49] = endByte[1]; + fpByte[50] = endByte[41]; + fpByte[51] = endByte[9]; + fpByte[52] = endByte[49]; + fpByte[53] = endByte[17]; + fpByte[54] = endByte[57]; + fpByte[55] = endByte[25]; + fpByte[56] = endByte[32]; + fpByte[57] = endByte[0]; + fpByte[58] = endByte[40]; + fpByte[59] = endByte[8]; + fpByte[60] = endByte[48]; + fpByte[61] = endByte[16]; + fpByte[62] = endByte[56]; + fpByte[63] = endByte[24]; + return fpByte; + } + + public static String getBoxBinary(int i) { + String binary = ""; + switch (i) { + case 0: + binary = "0000"; + break; + case 1: + binary = "0001"; + break; + case 2: + binary = "0010"; + break; + case 3: + binary = "0011"; + break; + case 4: + binary = "0100"; + break; + case 5: + binary = "0101"; + break; + case 6: + binary = "0110"; + break; + case 7: + binary = "0111"; + break; + case 8: + binary = "1000"; + break; + case 9: + binary = "1001"; + break; + case 10: + binary = "1010"; + break; + case 11: + binary = "1011"; + break; + case 12: + binary = "1100"; + break; + case 13: + binary = "1101"; + break; + case 14: + binary = "1110"; + break; + case 15: + binary = "1111"; + break; + } + return binary; + } + + /* + * generate 16 keys for xor + * + */ + public static int[][] generateKeys(int[] keyByte) { + int[] key = new int[56]; + int[][] keys = new int[16][48]; + + // keys[ 0] = new Array(); + // keys[ 1] = new Array(); + // keys[ 2] = new Array(); + // keys[ 3] = new Array(); + // keys[ 4] = new Array(); + // keys[ 5] = new Array(); + // keys[ 6] = new Array(); + // keys[ 7] = new Array(); + // keys[ 8] = new Array(); + // keys[ 9] = new Array(); + // keys[10] = new Array(); + // keys[11] = new Array(); + // keys[12] = new Array(); + // keys[13] = new Array(); + // keys[14] = new Array(); + // keys[15] = new Array(); + int[] loop = new int[] { 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1 }; + + for (int i = 0; i < 7; i++) { + for (int j = 0, k = 7; j < 8; j++, k--) { + key[i * 8 + j] = keyByte[8 * k + i]; + } + } + + int i = 0; + for (i = 0; i < 16; i++) { + int tempLeft = 0; + int tempRight = 0; + for (int j = 0; j < loop[i]; j++) { + tempLeft = key[0]; + tempRight = key[28]; + for (int k = 0; k < 27; k++) { + key[k] = key[k + 1]; + key[28 + k] = key[29 + k]; + } + key[27] = tempLeft; + key[55] = tempRight; + } + // var tempKey = new Array(48); + int[] tempKey = new int[48]; + tempKey[0] = key[13]; + tempKey[1] = key[16]; + tempKey[2] = key[10]; + tempKey[3] = key[23]; + tempKey[4] = key[0]; + tempKey[5] = key[4]; + tempKey[6] = key[2]; + tempKey[7] = key[27]; + tempKey[8] = key[14]; + tempKey[9] = key[5]; + tempKey[10] = key[20]; + tempKey[11] = key[9]; + tempKey[12] = key[22]; + tempKey[13] = key[18]; + tempKey[14] = key[11]; + tempKey[15] = key[3]; + tempKey[16] = key[25]; + tempKey[17] = key[7]; + tempKey[18] = key[15]; + tempKey[19] = key[6]; + tempKey[20] = key[26]; + tempKey[21] = key[19]; + tempKey[22] = key[12]; + tempKey[23] = key[1]; + tempKey[24] = key[40]; + tempKey[25] = key[51]; + tempKey[26] = key[30]; + tempKey[27] = key[36]; + tempKey[28] = key[46]; + tempKey[29] = key[54]; + tempKey[30] = key[29]; + tempKey[31] = key[39]; + tempKey[32] = key[50]; + tempKey[33] = key[44]; + tempKey[34] = key[32]; + tempKey[35] = key[47]; + tempKey[36] = key[43]; + tempKey[37] = key[48]; + tempKey[38] = key[38]; + tempKey[39] = key[55]; + tempKey[40] = key[33]; + tempKey[41] = key[52]; + tempKey[42] = key[45]; + tempKey[43] = key[41]; + tempKey[44] = key[49]; + tempKey[45] = key[35]; + tempKey[46] = key[28]; + tempKey[47] = key[31]; + int m; + switch (i) { + case 0: + for (m = 0; m < 48; m++) { + keys[0][m] = tempKey[m]; + } + break; + case 1: + for (m = 0; m < 48; m++) { + keys[1][m] = tempKey[m]; + } + break; + case 2: + for (m = 0; m < 48; m++) { + keys[2][m] = tempKey[m]; + } + break; + case 3: + for (m = 0; m < 48; m++) { + keys[3][m] = tempKey[m]; + } + break; + case 4: + for (m = 0; m < 48; m++) { + keys[4][m] = tempKey[m]; + } + break; + case 5: + for (m = 0; m < 48; m++) { + keys[5][m] = tempKey[m]; + } + break; + case 6: + for (m = 0; m < 48; m++) { + keys[6][m] = tempKey[m]; + } + break; + case 7: + for (m = 0; m < 48; m++) { + keys[7][m] = tempKey[m]; + } + break; + case 8: + for (m = 0; m < 48; m++) { + keys[8][m] = tempKey[m]; + } + break; + case 9: + for (m = 0; m < 48; m++) { + keys[9][m] = tempKey[m]; + } + break; + case 10: + for (m = 0; m < 48; m++) { + keys[10][m] = tempKey[m]; + } + break; + case 11: + for (m = 0; m < 48; m++) { + keys[11][m] = tempKey[m]; + } + break; + case 12: + for (m = 0; m < 48; m++) { + keys[12][m] = tempKey[m]; + } + break; + case 13: + for (m = 0; m < 48; m++) { + keys[13][m] = tempKey[m]; + } + break; + case 14: + for (m = 0; m < 48; m++) { + keys[14][m] = tempKey[m]; + } + break; + case 15: + for (m = 0; m < 48; m++) { + keys[15][m] = tempKey[m]; + } + break; + } + } + return keys; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/util/DigestUtils.java b/food-open/food-open-api/src/main/java/com/jwsaas/util/DigestUtils.java new file mode 100644 index 0000000..319c22c --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/util/DigestUtils.java @@ -0,0 +1,70 @@ +package com.jwsaas.util; + +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; + +/** + * 签名工具类 + */ +public final class DigestUtils { + + public static final String AES = "AES"; + public static final String MD5 = "MD5"; + public static final String SHA = "SHA"; + public static final String SHA1 = "SHA-1"; + + private static MessageDigest getDigest(final String algorithm) { + try { + return MessageDigest.getInstance(algorithm); + } catch (final NoSuchAlgorithmException e) { + throw new IllegalArgumentException(e); + } + } + + /** + * SHA1签名 + * + * @param content + * 待签名字符串 + * @return 签名后的字符串 + */ + public static String SHA1(String content) { + byte[] data = StringUtils.getBytesUtf8(content); + return HexUtils.encodeHexString(getDigest(SHA1).digest(data)); + } + + /** + * SHA签名 + * + * @param content + * 待签名字符串 + * @return 签名后的字符串 + */ + public static String SHA(String content) { + byte[] data = StringUtils.getBytesUtf8(content); + return HexUtils.encodeHexString(getDigest(SHA).digest(data)); + } + + /** + * MD5签名 + * + * @param content + * 待签名字符串 + * @return 签名后的字符串 + */ + public static String MD5(String content) { + byte[] data = StringUtils.getBytesUtf8(content); + return HexUtils.encodeHexString(getDigest(MD5).digest(data)); + } + + /** + *SHA1签名 + * @param content + * @param isLow 是否小写 ture : 小写 ;false:大写; + * @return + */ + public static String SHA1(String content, boolean isLow) { + byte[] data = StringUtils.getBytesUtf8(content); + return HexUtils.encodeHexString(getDigest(SHA).digest(data),isLow); + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/util/EncryptedDataUtils.java b/food-open/food-open-api/src/main/java/com/jwsaas/util/EncryptedDataUtils.java new file mode 100644 index 0000000..03d9191 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/util/EncryptedDataUtils.java @@ -0,0 +1,27 @@ +package com.jwsaas.util; + +import java.io.UnsupportedEncodingException; +import java.security.InvalidAlgorithmParameterException; + +import org.apache.commons.codec.binary.Base64; + +public class EncryptedDataUtils { + + public static String encryptedData(String encryptedData, String sessionKey, String iv) { + String result = null; + + AES aes = new AES(); + try { + byte[] resultByte = aes.decrypt(Base64.decodeBase64(encryptedData), Base64.decodeBase64(sessionKey), Base64.decodeBase64(iv)); + if (null != resultByte && resultByte.length > 0) { + result = new String(resultByte, "UTF-8"); + } + } catch (InvalidAlgorithmParameterException e) { + e.printStackTrace(); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + + return result; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/util/HexUtils.java b/food-open/food-open-api/src/main/java/com/jwsaas/util/HexUtils.java new file mode 100644 index 0000000..25b067d --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/util/HexUtils.java @@ -0,0 +1,36 @@ +package com.jwsaas.util; + +public final class HexUtils { + /** + * Used to build output as Hex + */ + private static final char[] DIGITS_LOWER = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; + + /** + * Used to build output as Hex + */ + private static final char[] DIGITS_UPPER = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; + + private static char[] encodeHex(final byte[] data, final char[] toDigits) { + final int l = data.length; + final char[] out = new char[l << 1]; + // two characters form the hex value. + for (int i = 0, j = 0; i < l; i++) { + out[j++] = toDigits[(0xF0 & data[i]) >>> 4]; + out[j++] = toDigits[0x0F & data[i]]; + } + return out; + } + + public static String encodeHexString(final byte[] data) { + return new String(encodeHex(data, true)); + } + + public static char[] encodeHex(final byte[] data, final boolean toLowerCase) { + return encodeHex(data, toLowerCase ? DIGITS_LOWER : DIGITS_UPPER); + } + + public static String encodeHexString(byte[] digest, boolean isLow) { + return new String(encodeHex(digest, isLow)); + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/util/HmacSHA1Utils.java b/food-open/food-open-api/src/main/java/com/jwsaas/util/HmacSHA1Utils.java new file mode 100644 index 0000000..f64ec98 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/util/HmacSHA1Utils.java @@ -0,0 +1,48 @@ +package com.jwsaas.util; + +import javax.crypto.Mac; +import javax.crypto.SecretKey; +import javax.crypto.spec.SecretKeySpec; + +public class HmacSHA1Utils { + + private static final String MAC_NAME = "HmacSHA1"; + private static final String ENCODING = "UTF-8"; + + /* + * 展示了一个生成指定算法密钥的过程 初始化HMAC密钥 + * + * @return + * + * @throws Exception + * + * public static String initMacKey() throws Exception { //得到一个 指定算法密钥的密钥生成器 + * KeyGenerator KeyGenerator keyGenerator + * =KeyGenerator.getInstance(MAC_NAME); //生成一个密钥 SecretKey secretKey + * =keyGenerator.generateKey(); return null; } + */ + + /** + * 使用 HMAC-SHA1 签名方法对对encryptText进行签名 + * + * @param encryptText + * 被签名的字符串 + * @param encryptKey + * 密钥 + * @return + * @throws Exception + */ + public static byte[] HmacSHA1Encrypt(String encryptText, String encryptKey) throws Exception { + byte[] data = encryptKey.getBytes(ENCODING); + // 根据给定的字节数组构造一个密钥,第二参数指定一个密钥算法的名称 + SecretKey secretKey = new SecretKeySpec(data, MAC_NAME); + // 生成一个指定 Mac 算法 的 Mac 对象 + Mac mac = Mac.getInstance(MAC_NAME); + // 用给定密钥初始化 Mac 对象 + mac.init(secretKey); + + byte[] text = encryptText.getBytes(ENCODING); + // 完成 Mac 操作 + return mac.doFinal(text); + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/util/HttpUtils.java b/food-open/food-open-api/src/main/java/com/jwsaas/util/HttpUtils.java new file mode 100644 index 0000000..4376ae7 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/util/HttpUtils.java @@ -0,0 +1,108 @@ +package com.jwsaas.util; + +import okhttp3.FormBody; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import org.apache.http.HttpEntity; +import org.apache.http.NameValuePair; +import org.apache.http.client.ClientProtocolException; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.util.EntityUtils; + +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/** + * Created by Ricky on 2016/11/20. + */ +public class HttpUtils { + private static OkHttpClient client = new OkHttpClient(); + + /** + * 发送 post请求访问本地应用并根据传递参数不同返回不同结果 + */ + public void post(String url, Map map, StringBuffer result) { + // 创建默认的httpClient实例. + CloseableHttpClient httpclient = HttpClients.createDefault(); + // 创建httppost + HttpPost httppost = new HttpPost(url); + // 创建参数队列 + List formparams = new ArrayList<>(); + + Iterator it=map.keySet().iterator(); + while(it.hasNext()){ + String key; + String value; + key=it.next().toString(); + value=map.get(key); + + formparams.add(new BasicNameValuePair(key, value)); + } + + UrlEncodedFormEntity uefEntity; + try { + uefEntity = new UrlEncodedFormEntity(formparams, "GBK"); + httppost.setEntity(uefEntity); + + System.out.println("提交请求 " + httppost.getURI()); + CloseableHttpResponse response = httpclient.execute(httppost); + try { + HttpEntity entity = response.getEntity(); + + if (entity != null && result != null) { + result.append(EntityUtils.toString(entity, "GBK")); + } + + // 打印响应状态 + System.out.println(response.getStatusLine()); + } finally { + response.close(); + } + } catch (ClientProtocolException e) { + e.printStackTrace(); + } catch (UnsupportedEncodingException e1) { + e1.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } finally { + // 关闭连接,释放资源 + try { + httpclient.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + + public static String executePost(String httpUrl, Map params) { + String result = ""; + try { + FormBody.Builder formBody = new FormBody.Builder(); + for (String key:params.keySet()) { + formBody.add(key,params.get(key).toString()); + } + final Request request = new Request.Builder().url(httpUrl).post(formBody.build()).build(); + final Response response = client.newCall(request).execute(); + if(response.isSuccessful()){ + result = response.body().string(); + }else{ + //logs.debug("http>resp>:{}", response.body().string()); + } + } catch (IOException e) { + e.printStackTrace(); + } + + return result; + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/util/JSONException.java b/food-open/food-open-api/src/main/java/com/jwsaas/util/JSONException.java new file mode 100644 index 0000000..eba254b --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/util/JSONException.java @@ -0,0 +1,18 @@ +package com.jwsaas.util; + +@SuppressWarnings("serial") +public class JSONException extends RuntimeException { + + public JSONException(){ + super(); + } + + public JSONException(String message){ + super(message); + } + + public JSONException(String message, Throwable cause){ + super(message, cause); + } + +} \ No newline at end of file diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/util/JSONUtil.java b/food-open/food-open-api/src/main/java/com/jwsaas/util/JSONUtil.java new file mode 100644 index 0000000..78c79b2 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/util/JSONUtil.java @@ -0,0 +1,167 @@ +package com.jwsaas.util; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; +import com.fasterxml.jackson.annotation.PropertyAccessor; +import com.fasterxml.jackson.core.JsonEncoding; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationConfig; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.node.ObjectNode; + +public class JSONUtil { + + protected static Logger logger = LoggerFactory.getLogger(JSONUtil.class); + + private static ObjectMapper objectMapper = new ObjectMapper(); + private static final String charsetName = "UTF-8"; + + static { + objectMapper.setVisibility(PropertyAccessor.FIELD, Visibility.ANY); + objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + + SerializationConfig serializationConfig = objectMapper.getSerializationConfig(); + serializationConfig = serializationConfig.without(SerializationFeature.WRAP_ROOT_VALUE) + .with(SerializationFeature.INDENT_OUTPUT); + SerializerProvider serializerProvider = objectMapper.getSerializerProvider(); + serializerProvider.setNullValueSerializer(new JsonSerializer() { + + @Override + public void serialize(Object value, JsonGenerator jgen, SerializerProvider serializers) + throws IOException, JsonProcessingException { + jgen.writeString(""); + } + + }); + } + +// public static ObjectMapper getObjectMapper() { +// return CollectionUtils.deepCopy(objectMapper); +// } + + public static String toJSONString(Object object) { + ByteArrayOutputStream bos = new ByteArrayOutputStream(1024); + try { + JsonGenerator jsonGenerator = objectMapper.getFactory().createGenerator(bos, JsonEncoding.UTF8); + objectMapper.writeValue(jsonGenerator, object); + return bos.toString(charsetName); + } catch (Exception e) { + throw new JSONException(e.getMessage(), e); + } finally { + try { + bos.close(); + } catch (Exception ex) { + logger.error("toJSONString(bos.close) Exception ", ex); + } + } + } + + public static JsonNode parseJsonNode(String text) { + try { + return objectMapper.readTree(text); + } catch (Exception e) { + throw new JSONException(e.getMessage(), e); + } + } + + public static T parseObject(String text, Class clazz) { + try { + return objectMapper.readValue(text, clazz); + } catch (Exception e) { + throw new JSONException(e.getMessage(), e); + } + } + + public static T parseObject(String text, Class clazz, String charsetName) { + try { + return objectMapper.readValue(text.getBytes(charsetName), clazz); + } catch (Exception e) { + throw new JSONException(e.getMessage(), e); + } + } + + public static T parseObject(String text, TypeReference valueTypeRef) { + try { + return objectMapper.readValue(objectMapper.getFactory().createParser(text), valueTypeRef); + } catch (Exception e) { + throw new JSONException(e.getMessage(), e); + } + } + + public static ObjectNode createObjectNode() { + try { + return objectMapper.createObjectNode(); + } catch (Exception e) { + throw new JSONException(e.getMessage(), e); + } + } + + /** + * 从json中读取tagPath处的值 tagPath用 :分隔 + * + * @param json + * @param tagPath + * @return + * @throws Exception + */ + public static List readValueFromJson(String json, String tagPath) throws Exception { + // 返回值 + List value = new ArrayList(); + if (StringUtils.isBlank(json) || StringUtils.isBlank(tagPath)) { + return value; + } + String[] path = tagPath.split(":"); + JsonNode node = objectMapper.readTree(json); + getJsonValue(node, path, value, 1); + return value; + } + + public static void getJsonValue(JsonNode node, String[] path, List values, int nextIndex) { + if (node == null) { + return; + } + // 是路径的最后就直接取值 + if (nextIndex == path.length) { + if (node.isArray()) { + for (int i = 0; i < node.size(); i++) { + JsonNode child = node.get(i).get(path[nextIndex - 1]); + if (child == null) { + continue; + } + values.add(child.toString()); + } + } else { + JsonNode child = node.get(path[nextIndex - 1]); + if (child != null) { + values.add(child.toString()); + } + } + return; + } + // 判断是Node下是集合还是一个节点 + node = node.get(path[nextIndex - 1]); + if (node.isArray()) { + for (int i = 0; i < node.size(); i++) { + getJsonValue(node.get(i), path, values, nextIndex + 1); + } + } else { + getJsonValue(node, path, values, nextIndex + 1); + } + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/util/KeyIdUtil.java b/food-open/food-open-api/src/main/java/com/jwsaas/util/KeyIdUtil.java new file mode 100644 index 0000000..0ddefcd --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/util/KeyIdUtil.java @@ -0,0 +1,33 @@ +package com.jwsaas.util; + +import java.util.Random; +import java.util.UUID; + +/** + * @Author 37962 + * @Date 2023/10/19 + */ +public class KeyIdUtil { + //生成唯一的主键 格式: 时间+随机数 + public static synchronized String getUniqueKey(String str) { + Random random = new Random(); + Integer number = random.nextInt(900000) + 100000; + return str + System.currentTimeMillis()+String.valueOf(number); + } + + /** + * + * @Description: 生成唯一的主键 格式: 19位 + * @Param: + * @return: java.lang.String + */ + public static synchronized String getUUIDKey(String str) { + String uuid= System.currentTimeMillis()+ UUID.randomUUID().toString().replaceAll("-","").substring(0,6); + return str + uuid; + } + + public static void main(String[] args) { + String s=KeyIdUtil.getUniqueKey(""); + System.out.println(s); + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/util/KeyUtil.java b/food-open/food-open-api/src/main/java/com/jwsaas/util/KeyUtil.java new file mode 100644 index 0000000..b5c47ec --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/util/KeyUtil.java @@ -0,0 +1,33 @@ +package com.jwsaas.util; + +import java.util.Random; +import java.util.UUID; + +/** + * @Author 37962 + * @Date 2023/10/19 + */ +public class KeyUtil { + //生成唯一的主键 格式: 时间+随机数 + public static synchronized String getUniqueKey(String str) { + Random random = new Random(); + Integer number = random.nextInt(900000) + 100000; + return str + System.currentTimeMillis()+String.valueOf(number); + } + + /** + * + * @Description: 生成唯一的主键 格式: 19位 + * @Param: + * @return: java.lang.String + */ + public static synchronized String getUUIDKey(String str) { + String uuid= System.currentTimeMillis()+ UUID.randomUUID().toString().replaceAll("-","").substring(0,6); + return str + uuid; + } + + public static void main(String[] args) { + String s=KeyUtil.getUniqueKey(""); + System.out.println(s); + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/util/Md5Hash.java b/food-open/food-open-api/src/main/java/com/jwsaas/util/Md5Hash.java new file mode 100644 index 0000000..3d6cf57 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/util/Md5Hash.java @@ -0,0 +1,33 @@ +package com.jwsaas.util; + +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; + +public class Md5Hash { + + public static final String ALGORITHM_NAME = "MD5"; + + private String source; + + public Md5Hash(String source) { + this.source = source; + } + + public String toHex() { + try { + MessageDigest md = MessageDigest.getInstance(ALGORITHM_NAME); + md.update(this.source.getBytes()); + + byte byteData[] = md.digest(); + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < byteData.length; i++) { + sb.append(Integer.toString((byteData[i] & 0xff) + 0x100, 16).substring(1)); + } + return sb.toString(); + } catch (NoSuchAlgorithmException e) { + e.printStackTrace(); + } + return null; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/util/Pinyin4jUtil.java b/food-open/food-open-api/src/main/java/com/jwsaas/util/Pinyin4jUtil.java new file mode 100644 index 0000000..36a4bdd --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/util/Pinyin4jUtil.java @@ -0,0 +1,82 @@ +package com.jwsaas.util; + +import net.sourceforge.pinyin4j.PinyinHelper; +import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; +import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; +import net.sourceforge.pinyin4j.format.HanyuPinyinToneType; +import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType; +import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination; + +public class Pinyin4jUtil { + + /** + * 将字符串中的中文转化为拼音,其他字符不变 + */ + public static String getPinYin(String src) { + char[] t1 = src.toCharArray(); + String[] t2 = new String[t1.length]; + // 设置汉字拼音输出的格式 + HanyuPinyinOutputFormat t3 = new HanyuPinyinOutputFormat(); + t3.setCaseType(HanyuPinyinCaseType.LOWERCASE); + t3.setToneType(HanyuPinyinToneType.WITHOUT_TONE); + t3.setVCharType(HanyuPinyinVCharType.WITH_V); + String t4 = ""; + int t0 = t1.length; + try { + for (int i = 0; i < t0; i++) { + // 判断能否为汉字字符 + if (Character.toString(t1[i]).matches("[\\u4E00-\\u9FA5]+")) { + t2 = PinyinHelper.toHanyuPinyinStringArray(t1[i], t3);// 将汉字的几种全拼都存到t2数组中 + t4 += t2[0];// 取出该汉字全拼的第一种读音并连接到字符串t4后 + } else { + // 如果不是汉字字符,间接取出字符并连接到字符串t4后 + t4 += Character.toString(t1[i]); + } + } + } catch (BadHanyuPinyinOutputFormatCombination e) { + t4 = src; + e.printStackTrace(); + } + return t4; + } + + /** + * 获取汉字串拼音首字母,英文字符不变 + */ + public static String getPinYinHeadChar(String str) { + String convert = ""; + for (int j = 0; j < str.length(); j++) { + char word = str.charAt(j); + // 提取汉字的首字母 + String[] pinyinArray = PinyinHelper.toHanyuPinyinStringArray(word); + if (pinyinArray != null) { + convert += pinyinArray[0].charAt(0); + } else { + convert += word; + } + } + return convert; + } + + /** + * 将字符串转换成ASCII码 + */ + public static String getCnASCII(String cnStr) { + StringBuffer strBuf = new StringBuffer(); + // 将字符串转换成字节序列 + byte[] bGBK = cnStr.getBytes(); + for (int i = 0; i < bGBK.length; i++) { + // 将每个字符转换成ASCII码 + strBuf.append(Integer.toHexString(bGBK[i] & 0xff)); + } + return strBuf.toString(); + } + + public static void main(String[] args) { + String cnStr = "新飞冰箱--00"; + System.out.println(getPinYin(cnStr)); + System.out.println(getPinYinHeadChar(cnStr)); + System.out.println(getCnASCII(cnStr)); + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/util/RandomUtil.java b/food-open/food-open-api/src/main/java/com/jwsaas/util/RandomUtil.java new file mode 100644 index 0000000..18feee3 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/util/RandomUtil.java @@ -0,0 +1,186 @@ +package com.jwsaas.util; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.Random; + +import org.apache.commons.lang3.RandomUtils; + +public class RandomUtil { + + public static int randomInt(int min, int max) { + return RandomUtils.nextInt(min, max); + } + + public static double randomDouble(double min, double max) { + return RandomUtils.nextDouble(min, max); + } + + /** + * + * @param min + * @param max + * @param scale + * 小数位数 + * @return + */ + public static double randomDouble(double min, double max, int scale) { + return new BigDecimal(RandomUtils.nextDouble(min, max)).setScale(scale, BigDecimal.ROUND_HALF_DOWN).doubleValue(); + } + + public static final String ALLCHAR = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + public static final String LETTERCHAR = "abcdefghijkllmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + public static final String NUMBERCHAR = "0123456789"; + + /** + * 返回一个定长的随机字符串(只包含大小写字母、数字) + * + * @param length + * 随机字符串长度 + * @return 随机字符串 + */ + public static String generateString(int length) { + StringBuffer sb = new StringBuffer(); + Random random = new Random(); + for (int i = 0; i < length; i++) { + sb.append(ALLCHAR.charAt(random.nextInt(ALLCHAR.length()))); + } + return sb.toString(); + } + + /** + * 返回一个定长的随机纯字母字符串(只包含大小写字母) + * + * @param length + * 随机字符串长度 + * @return 随机字符串 + */ + public static String generateMixString(int length) { + StringBuffer sb = new StringBuffer(); + Random random = new Random(); + for (int i = 0; i < length; i++) { + sb.append(ALLCHAR.charAt(random.nextInt(LETTERCHAR.length()))); + } + return sb.toString(); + } + + /** + * 返回一个定长的随机纯大写字母字符串(只包含大小写字母) + * + * @param length + * 随机字符串长度 + * @return 随机字符串 + */ + public static String generateLowerString(int length) { + return generateMixString(length).toLowerCase(); + } + + /** + * 返回一个定长的随机纯小写字母字符串(只包含大小写字母) + * + * @param length + * 随机字符串长度 + * @return 随机字符串 + */ + public static String generateUpperString(int length) { + return generateMixString(length).toUpperCase(); + } + + /** + * 生成一个定长的纯0字符串 + * + * @param length + * 字符串长度 + * @return 纯0字符串 + */ + public static String generateZeroString(int length) { + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < length; i++) { + sb.append('0'); + } + return sb.toString(); + } + + /** + * 根据数字生成一个定长的字符串,长度不够前面补0 + * + * @param num + * 数字 + * @param fixdlenth + * 字符串长度 + * @return 定长的字符串 + */ + public static String toFixdLengthString(long num, int fixdlenth) { + StringBuffer sb = new StringBuffer(); + String strNum = String.valueOf(num); + if (fixdlenth - strNum.length() >= 0) { + sb.append(generateZeroString(fixdlenth - strNum.length())); + } else { + throw new RuntimeException("将数字" + num + "转化为长度为" + fixdlenth + "的字符串发生异常!"); + } + sb.append(strNum); + return sb.toString(); + } + + /** + * 每次生成的len位数都不相同 + * + * @param param + * @return 定长的数字 + */ + public static int getNotSimple(int[] param, int len) { + Random rand = new Random(); + for (int i = param.length; i > 1; i--) { + int index = rand.nextInt(i); + int tmp = param[index]; + param[index] = param[i - 1]; + param[i - 1] = tmp; + } + int result = 0; + for (int i = 0; i < len; i++) { + result = result * 10 + param[i]; + } + return result; + } + + // public static void main(String[] args) { + // // System.out.println("返回一个定长的随机字符串(只包含大小写字母、数字):" + + // // generateString(10)); + // // System.out.println("返回一个定长的随机纯字母字符串(只包含大小写字母):" + + // // generateMixString(10)); + // // System.out.println("返回一个定长的随机纯大写字母字符串(只包含大小写字母):" + + // // generateLowerString(10)); + // // System.out.println("返回一个定长的随机纯小写字母字符串(只包含大小写字母):" + + // // generateUpperString(10)); + // // System.out.println("生成一个定长的纯0字符串:" + generateZeroString(10)); + // // System.out.println("根据数字生成一个定长的字符串,长度不够前面补0:" + + // // toFixdLengthString(123, 10)); + // // int[] in = { 1, 2, 3, 4, 5, 6, 7 }; + // // System.out.println("每次生成的len位数都不相同:" + getNotSimple(in, 3)); + // + // for (int i = 0; i < 10; i++) { + // System.out.println(randomInt(10, 20)); + // } + // + // for (int i = 0; i < 10; i++) { + // System.out.println(randomDouble(10.0, 20.0)); + // } + // + // for (int i = 0; i < 10; i++) { + // System.out.println(randomDouble(10.0, 20.0, 2)); + // } + // + // } + + /** + * 保留两位小数 + * + * @param values + * @return + */ + public static Double format2(Double values) { + return new BigDecimal(Double.toString(values)).setScale(2, RoundingMode.HALF_UP).doubleValue(); + } + + +} \ No newline at end of file diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/util/RandomUtils.java b/food-open/food-open-api/src/main/java/com/jwsaas/util/RandomUtils.java new file mode 100644 index 0000000..c6f77b1 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/util/RandomUtils.java @@ -0,0 +1,95 @@ +package com.jwsaas.util; + +import java.util.Random; +import java.util.UUID; + +/** + * 随机码工具类 + */ +public class RandomUtils { + + private static final String ALLCHAR = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + private static final String LETTERCHAR = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + private static final String NUMBERCHAR = "0123456789"; + + /** + * 返回一个定长的随机字符串(包含数字和大小写字母) + * + * @param length + * 随机数的长度 + * @return + */ + public static String generateString(int length) { + StringBuilder sb = new StringBuilder(length); + Random random = new Random(); + for (int i = 0; i < length; i++) { + sb.append(ALLCHAR.charAt(random.nextInt(ALLCHAR.length()))); + } + return sb.toString(); + } + + /** + * 返回一个定长的随机纯数字字符串(只包含数字) + * + * @param length + * 随机数的长度 + * @return + */ + public static String generateStringByNumberChar(int length) { + StringBuilder sb = new StringBuilder(length); + Random random = new Random(); + for (int i = 0; i < length; i++) { + sb.append(NUMBERCHAR.charAt(random.nextInt(NUMBERCHAR.length()))); + } + return sb.toString(); + } + + /** + * 返回一个定长的随机纯字母字符串(只包含大小写字母) + * + * @param length + * 随机数的长度 + * @return + */ + public static String generateStringByLetterCharr(int length) { + StringBuilder sb = new StringBuilder(length); + Random random = new Random(); + for (int i = 0; i < length; i++) { + sb.append(LETTERCHAR.charAt(random.nextInt(LETTERCHAR.length()))); + } + return sb.toString(); + } + + /** + * 返回一个定长的随机纯大写字母字符串(只包含大小写字母) + * + * @param length + * 随机数的长度 + * @return + */ + public static String generateLowerString(int length) { + return generateStringByLetterCharr(length).toLowerCase(); + } + + /** + * 返回一个定长的随机纯小写字母字符串(只包含大小写字母) + * + * @param length + * 随机数的长度 + * @return + */ + public static String generateUpperString(int length) { + return generateStringByLetterCharr(length).toUpperCase(); + } + + /** + * 随机获取UUID字符串(无中划线) + * + * @return UUID字符串 + */ + public static String getUUID() { + String uuid = UUID.randomUUID().toString(); + return uuid.substring(0, 8) + uuid.substring(9, 13) + uuid.substring(14, 18) + uuid.substring(19, 23) + uuid.substring(24); + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/util/ReflectionUtils.java b/food-open/food-open-api/src/main/java/com/jwsaas/util/ReflectionUtils.java new file mode 100644 index 0000000..4db22d4 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/util/ReflectionUtils.java @@ -0,0 +1,213 @@ +package com.jwsaas.util; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; + +/** + * @title 反射工具类 + * @description 提供对类,字段的反射调用 + */ +public class ReflectionUtils { + + /** + * 获取包包名 + * + * @param obj + * @return + */ + public static String getPackageName(Object obj) { + return obj.getClass().getPackage().getName(); + } + + /** + * 获取字段的泛型参数类型 + * + * @param obj + * @param fieldName + * @return + */ + public static Class getFieldGenericType(Object obj, String fieldName) { + Field field = getAccessibleField(obj, fieldName); + Type type = field.getGenericType(); + if (type instanceof ParameterizedType) { + return (Class) ((ParameterizedType) type).getActualTypeArguments()[0]; + } + return null; + } + + /** + * 调用方法 + * + * @param object + * 对象 + * + * @param propertyName + * 属性名称 + */ + public static Object invokeMethod(Object object, String propertyName) { + try { + Method getterMethod = object.getClass().getMethod(propertyName); + return getterMethod.invoke(object); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + public static Object invokeMethod(Object object, String propertyName, Object... args) { + try { + Method getterMethod = object.getClass().getMethod(propertyName); + return getterMethod.invoke(object, args); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + /** + * 调用Getter方法 + * + * @param object + * 对象 + * + * @param propertyName + * 属性名称 + * @throws SecurityException + * @throws NoSuchMethodException + * @throws InvocationTargetException + * @throws IllegalArgumentException + * @throws IllegalAccessException + */ + public static Object invokeGetterMethod(Object object, String propertyName) throws Exception { + String getterMethodName = null; + Method getterMethod = null; + String propertyNa = null; + if (propertyName.contains(".")) { + propertyNa = StringUtils.substringBefore(propertyName, "."); + getterMethodName = "get" + StringUtils.capitalize(propertyNa); + getterMethod = object.getClass().getMethod(getterMethodName); + return invokeGetterMethod(getterMethod.invoke(object), StringUtils.substringAfter(propertyName, ".")); + } else { + getterMethodName = "get" + StringUtils.capitalize(propertyName); + getterMethod = object.getClass().getMethod(getterMethodName); + return getterMethod.invoke(object); + } + } + + /** + * 调用Setter方法 + * + * @param object + * 对象 + * + * @param propertyName + * 属性名称 + * + * @param propertyValue + * 属性值 + */ + public static void invokeSetterMethod(Object object, String propertyName, Object propertyValue) { + Class setterMethodClass = propertyValue.getClass(); + invokeSetterMethod(object, propertyName, propertyValue, setterMethodClass); + } + + /** + * 调用Setter方法 + * + * @param object + * 对象 + * + * @param propertyName + * 属性名称 + * + * @param propertyValue + * 属性值 + * + * @param setterMethodClass + * 参数类型 + */ + public static void invokeSetterMethod(Object object, String propertyName, Object propertyValue, Class setterMethodClass) { + String setterMethodName = "set" + StringUtils.capitalize(propertyName); + try { + Method setterMethod = object.getClass().getMethod(setterMethodName, setterMethodClass); + setterMethod.invoke(object, propertyValue); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * 获取对象属性值,无视private/protected/getter + * + * @param object + * 对象 + * + * @param fieldName + * 属性名称 + */ + public static Object getFieldValue(Object object, String fieldName) { + Field field = getAccessibleField(object, fieldName); + if (field == null) { + throw new IllegalArgumentException("Could not find field " + fieldName); + } + Object result = null; + try { + result = field.get(object); + } catch (IllegalAccessException e) { + + } + return result; + } + + /** + * 设置对象属性值,无视private/protected/setter + * + * @param object + * 对象 + * + * @param fieldName + * 属性名称 + */ + public static void setFieldValue(Object object, String fieldName, Object value) { + Field field = getAccessibleField(object, fieldName); + if (field == null) { + throw new IllegalArgumentException("Could not find field " + fieldName); + } + try { + field.set(object, value); + } catch (IllegalAccessException e) { + + } + } + + // 获取字段的类型 + public static String getFieldType(Object object, String fieldName) { + Field field = getAccessibleField(object, fieldName); + return field.getType().getSimpleName(); + } + + @SuppressWarnings("unused") + private static Field getAccessibleField(final Object object, final String fieldName) { + for (Class superClass = object.getClass(); superClass != Object.class; superClass = superClass.getSuperclass()) { + try { + Field field = superClass.getDeclaredField(fieldName); + field.setAccessible(true); + return field; + } catch (NoSuchFieldException e) { + return null; + } + } + return null; + } + + public static void makeAccessible(Constructor ctor) { + if ((!Modifier.isPublic(ctor.getModifiers()) || !Modifier.isPublic(ctor.getDeclaringClass().getModifiers())) && !ctor.isAccessible()) { + ctor.setAccessible(true); + } + } +} \ No newline at end of file diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/util/StringUtils.java b/food-open/food-open-api/src/main/java/com/jwsaas/util/StringUtils.java new file mode 100644 index 0000000..86482f0 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/util/StringUtils.java @@ -0,0 +1,205 @@ +package com.jwsaas.util; + +import java.nio.charset.Charset; +import java.util.Iterator; +import java.util.Objects; + +/** + * 字符串工具类 + */ +public final class StringUtils { + + public static final String EMPTY = ""; + public static final int INDEX_NOT_FOUND = -1; + public static final Charset UTF_8 = Charset.forName("UTF-8"); + + private static byte[] getBytes(final String content, final Charset charset) { + if (content == null) { + return null; + } + return content.getBytes(charset); + } + + private static String newString(final byte[] bytes, final Charset charset) { + return bytes == null ? null : new String(bytes, charset); + } + + public static byte[] getBytesUtf8(final String content) { + return getBytes(content, UTF_8); + } + + public static String newStringUtf8(final byte[] bytes) { + return newString(bytes, UTF_8); + } + + public static boolean isEmpty(final CharSequence cs) { + return cs == null || cs.length() == 0; + } + + public static boolean isBlank(final CharSequence cs) { + int strLen; + if (cs == null || (strLen = cs.length()) == 0) { + return true; + } + for (int i = 0; i < strLen; i++) { + if (Character.isWhitespace(cs.charAt(i)) == false) { + return false; + } + } + return true; + } + + public static String capitalize(final String str) { + int strLen; + if (str == null || (strLen = str.length()) == 0) { + return str; + } + + char firstChar = str.charAt(0); + if (Character.isTitleCase(firstChar)) { + // already capitalized + return str; + } + return new StringBuilder(strLen).append(Character.toTitleCase(firstChar)).append(str.substring(1)).toString(); + } + + public static String substringBefore(final String str, final String separator) { + if (isEmpty(str) || separator == null) { + return str; + } + if (separator.isEmpty()) { + return EMPTY; + } + final int pos = str.indexOf(separator); + if (pos == INDEX_NOT_FOUND) { + return str; + } + return str.substring(0, pos); + } + + public static String substringAfter(final String str, final String separator) { + if (isEmpty(str)) { + return str; + } + if (separator == null) { + return EMPTY; + } + final int pos = str.indexOf(separator); + if (pos == INDEX_NOT_FOUND) { + return EMPTY; + } + return str.substring(pos + separator.length()); + } + + public static boolean isNotBlank(final CharSequence cs) { + return !isBlank(cs); + } + + public static String uncapitalize(final String str) { + int strLen; + if (str == null || (strLen = str.length()) == 0) { + return str; + } + + char firstChar = str.charAt(0); + if (Character.isLowerCase(firstChar)) { + // already uncapitalized + return str; + } + + return new StringBuilder(strLen).append(Character.toLowerCase(firstChar)).append(str.substring(1)).toString(); + } + + public static String join(final Object[] array, final char separator) { + if (array == null) { + return null; + } + return join(array, separator, 0, array.length); + } + + public static String join(final Object[] array, final char separator, final int startIndex, final int endIndex) { + if (array == null) { + return null; + } + final int noOfItems = endIndex - startIndex; + if (noOfItems <= 0) { + return EMPTY; + } + final StringBuilder buf = new StringBuilder(noOfItems * 16); + for (int i = startIndex; i < endIndex; i++) { + if (i > startIndex) { + buf.append(separator); + } + if (array[i] != null) { + buf.append(array[i]); + } + } + return buf.toString(); + } + + public static String join(final Iterable iterable, final char separator) { + if (iterable == null) { + return null; + } + return join(iterable.iterator(), separator); + } + + public static String join(final Iterator iterator, final char separator) { + + // handle null, zero and one elements before building a buffer + if (iterator == null) { + return null; + } + if (!iterator.hasNext()) { + return EMPTY; + } + final Object first = iterator.next(); + if (!iterator.hasNext()) { + String result = Objects.toString(first); + return result; + } + + // two or more elements + final StringBuilder buf = new StringBuilder(256); // Java default is 16, + // probably too + // small + if (first != null) { + buf.append(first); + } + + while (iterator.hasNext()) { + buf.append(separator); + final Object obj = iterator.next(); + if (obj != null) { + buf.append(obj); + } + } + + return buf.toString(); + } + + public static String join(final int[] array, final char separator) { + if (array == null) { + return null; + } + return join(array, separator, 0, array.length); + } + + public static String join(final int[] array, final char separator, final int startIndex, final int endIndex) { + if (array == null) { + return null; + } + final int noOfItems = endIndex - startIndex; + if (noOfItems <= 0) { + return EMPTY; + } + final StringBuilder buf = new StringBuilder(noOfItems * 16); + for (int i = startIndex; i < endIndex; i++) { + if (i > startIndex) { + buf.append(separator); + } + buf.append(array[i]); + } + return buf.toString(); + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/util/SybUtil.java b/food-open/food-open-api/src/main/java/com/jwsaas/util/SybUtil.java new file mode 100644 index 0000000..40d8f56 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/util/SybUtil.java @@ -0,0 +1,25 @@ +package com.jwsaas.util; + +import javax.servlet.http.HttpServletRequest; +import java.util.Map; +import java.util.TreeMap; + +public class SybUtil { + + + /** + * 动态遍历获取所有收到的参数,此步非常关键,因为收银宝以后可能会加字段,动态获取可以兼容由于收银宝加字段而引起的签名异常 + * @param request + * @return + */ + public static TreeMap getParams(HttpServletRequest request){ + TreeMap map = new TreeMap(); + Map reqMap = request.getParameterMap(); + for(Object key:reqMap.keySet()){ + String value = ((String[])reqMap.get(key))[0]; + System.out.println(key+";"+value); + map.put(key.toString(),value); + } + return map; + } +} \ No newline at end of file diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/util/TaskSignUtil.java b/food-open/food-open-api/src/main/java/com/jwsaas/util/TaskSignUtil.java new file mode 100644 index 0000000..efa469f --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/util/TaskSignUtil.java @@ -0,0 +1,98 @@ +package com.jwsaas.util; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.commons.lang3.StringUtils; + +import com.jwsaas.utils.RSASignature; + +public class TaskSignUtil { + + /** + * 获取签名参数
+ *

+ * 除去sign、sign_type两个参数外,凡是通知返回回来的参数皆是待验签的参数。
+ *

+ */ + public static Map getSignParamsMap(HttpServletRequest request) { + List ignoreSignParams = new ArrayList(); + ignoreSignParams.add("sign"); + ignoreSignParams.add("sign_type"); + + Map paramsMap = new HashMap<>(); + for (String key : request.getParameterMap().keySet()) { + if (ignoreSignParams.contains(key)) { + // 忽略部分参数 + } else { + paramsMap.put(key, request.getParameter(key)); + } + } + return paramsMap; + } + + /** + * 用私钥对信息生成数字签名 + */ + public static String rsaSign(String content, String privateKey, String charset) throws Exception { + try { + byte[] data = null; + if (StringUtils.isBlank(charset)) { + data = content.getBytes(); + } else { + data = content.getBytes(charset); + } + return RSASignature.sign(data, privateKey); + } catch (Exception e) { + throw new Exception("RSAcontent = " + content + ",charset = " + charset, e); + } + } + + /** + * 用公钥校验数字签名 + */ + public static boolean rsaCheck(Map params, String publicKey, String charset) throws Exception { + String sign = params.get("sign"); + String content = getSignCheckContent(params); + return rsaCheckContent(content, sign, publicKey, charset); + } + + public static String getSignCheckContent(Map params) { + if (params == null) { + return null; + } + params.remove("sign"); + + StringBuffer content = new StringBuffer(); + List keys = new ArrayList(params.keySet()); + Collections.sort(keys); + + for (int i = 0; i < keys.size(); i++) { + String key = keys.get(i); + String value = params.get(key); + content.append((i == 0 ? "" : "&") + key + "=" + value); + } + + return content.toString(); + } + + public static boolean rsaCheckContent(String content, String sign, String publicKey, String charset) throws Exception { + try { + byte[] data = null; + if (StringUtils.isBlank(charset)) { + data = content.getBytes(); + } else { + data = content.getBytes(charset); + } + return RSASignature.verify(data, publicKey, sign); + } catch (Exception e) { + throw new Exception("RSAcontent = " + content + ",sign=" + sign + ",charset = " + charset, e); + } + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/util/URLDecodedUtil.java b/food-open/food-open-api/src/main/java/com/jwsaas/util/URLDecodedUtil.java new file mode 100644 index 0000000..6c757bd --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/util/URLDecodedUtil.java @@ -0,0 +1,24 @@ +package com.jwsaas.util; + +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; + +public class URLDecodedUtil { + + private static String defaultCharset = "UTF-8"; + + public static String decode(String value) { + return decode(value, defaultCharset); + } + + public static String decode(String value, String charset) { + String result = value; + try { + result = URLDecoder.decode(value, charset); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + return result; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/util/URLEncodedUtil.java b/food-open/food-open-api/src/main/java/com/jwsaas/util/URLEncodedUtil.java new file mode 100644 index 0000000..3aba6e7 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/util/URLEncodedUtil.java @@ -0,0 +1,24 @@ +package com.jwsaas.util; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; + +public class URLEncodedUtil { + + private static String defaultCharset = "UTF-8"; + + public static String encode(String value) { + return encode(value, defaultCharset); + } + + public static String encode(String value, String charset) { + String result = value; + try { + result = URLEncoder.encode(value, charset); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + return result; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/util/XStreamUtils.java b/food-open/food-open-api/src/main/java/com/jwsaas/util/XStreamUtils.java new file mode 100644 index 0000000..f1dc300 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/util/XStreamUtils.java @@ -0,0 +1,30 @@ +package com.jwsaas.util; + +import com.thoughtworks.xstream.XStream; +import com.thoughtworks.xstream.io.naming.NoNameCoder; +import com.thoughtworks.xstream.io.xml.DomDriver; +import com.thoughtworks.xstream.io.xml.XppDriver; + +public class XStreamUtils { + + public static String toXml(Object obj) { + XStream xstream = new XStream(new XppDriver(new NoNameCoder())); + xstream.ignoreUnknownElements(); // 忽略未知字段 + xstream.processAnnotations(obj.getClass()); // 识别obj类中的注解 + return xstream.toXML(obj); + + // XStream xstream = new XStream(new DomDriver("utf8")); + // xstream.processAnnotations(obj.getClass()); // 识别obj类中的注解 + // return xstream.toXML(obj).replaceAll("__", "_"); + } + + public static T toBean(String xml, Class clazz) { + XStream xstream = new XStream(new DomDriver()); + xstream.processAnnotations(clazz); + xstream.ignoreUnknownElements(); + @SuppressWarnings("unchecked") + T t = (T) xstream.fromXML(xml); + return t; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/util/file/FileToByteArray.java b/food-open/food-open-api/src/main/java/com/jwsaas/util/file/FileToByteArray.java new file mode 100644 index 0000000..108bc27 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/util/file/FileToByteArray.java @@ -0,0 +1,203 @@ +package com.jwsaas.util.file; + +import java.io.BufferedInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.RandomAccessFile; +import java.nio.ByteBuffer; +import java.nio.MappedByteBuffer; +import java.nio.channels.FileChannel; +import java.nio.channels.FileChannel.MapMode; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class FileToByteArray { + + private static final Logger logger = LoggerFactory.getLogger(FileToByteArray.class); + + /** + * 获得指定文件的byte数组 + */ + public static byte[] getBytes(String filePath) { + byte[] buffer = null; + try { + File file = new File(filePath); + FileInputStream fis = new FileInputStream(file); + ByteArrayOutputStream bos = new ByteArrayOutputStream(1000); + byte[] b = new byte[1000]; + int n; + while ((n = fis.read(b)) != -1) { + bos.write(b, 0, n); + } + fis.close(); + bos.close(); + buffer = bos.toByteArray(); + } catch (FileNotFoundException e) { + logger.error("FileNotFoundException异常", e); + } catch (IOException e) { + logger.error("IOException异常", e); + } + return buffer; + } + + public static byte[] getBytes1(String filePath) { + byte[] buffer = null; + try { + File file = new File(filePath); + FileInputStream fis = new FileInputStream(file); + buffer = new byte[fis.available()]; + long length = fis.read(buffer); + fis.close(); + logger.error("length:" + length); + } catch (FileNotFoundException e) { + logger.error("FileNotFoundException异常", e); + } catch (IOException e) { + logger.error("IOException异常", e); + } + return buffer; + } + + public static byte[] getContent(String filePath) throws IOException { + File file = new File(filePath); + long fileSize = file.length(); + if (fileSize > Integer.MAX_VALUE) { + System.out.println("file too big..."); + return null; + } + FileInputStream fi = new FileInputStream(file); + byte[] buffer = new byte[(int) fileSize]; + int offset = 0; + int numRead = 0; + while (offset < buffer.length && (numRead = fi.read(buffer, offset, buffer.length - offset)) >= 0) { + offset += numRead; + } + fi.close(); + // 确保所有数据均被读取 + if (offset != buffer.length) { + throw new IOException("Could not completely read file " + file.getName()); + } + return buffer; + } + + /** + * the traditional io way + * + * @param filePath + * @return + * @throws IOException + */ + public static byte[] toByteArray(String filePath) throws IOException { + + File f = new File(filePath); + if (!f.exists()) { + throw new FileNotFoundException(filePath); + } + + ByteArrayOutputStream bos = new ByteArrayOutputStream((int) f.length()); + BufferedInputStream in = null; + try { + in = new BufferedInputStream(new FileInputStream(f)); + int buf_size = 1024; + byte[] buffer = new byte[buf_size]; + int len = 0; + while (-1 != (len = in.read(buffer, 0, buf_size))) { + bos.write(buffer, 0, len); + } + return bos.toByteArray(); + } catch (IOException e) { + e.printStackTrace(); + throw e; + } finally { + try { + in.close(); + } catch (IOException e) { + e.printStackTrace(); + } + bos.close(); + } + } + + /** + * NIO way + * + * @param filePath + * @return + * @throws IOException + */ + public static byte[] toByteArray2(String filePath) throws IOException { + + File f = new File(filePath); + if (!f.exists()) { + throw new FileNotFoundException(filePath); + } + + FileChannel channel = null; + FileInputStream fs = null; + try { + fs = new FileInputStream(f); + channel = fs.getChannel(); + ByteBuffer byteBuffer = ByteBuffer.allocate((int) channel.size()); + while ((channel.read(byteBuffer)) > 0) { + // do nothing + // System.out.println("reading"); + } + return byteBuffer.array(); + } catch (IOException e) { + e.printStackTrace(); + throw e; + } finally { + try { + channel.close(); + } catch (IOException e) { + e.printStackTrace(); + } + try { + fs.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + /** + * Mapped File way MappedByteBuffer 可以在处理大文件时,提升性能 + * + * @param filename + * @return + * @throws IOException + */ + public static byte[] toByteArray3(String filePath) throws IOException { + + FileChannel fc = null; + RandomAccessFile randomAccessFile = null; + try { + randomAccessFile = new RandomAccessFile(filePath, "r"); + fc = randomAccessFile.getChannel(); + MappedByteBuffer byteBuffer = fc.map(MapMode.READ_ONLY, 0, fc.size()).load(); + // System.out.println(byteBuffer.isLoaded()); + byte[] result = new byte[(int) fc.size()]; + if (byteBuffer.remaining() > 0) { + // System.out.println("remain"); + byteBuffer.get(result, 0, byteBuffer.remaining()); + } + return result; + } catch (IOException e) { + e.printStackTrace(); + throw e; + } finally { + try { + if (fc != null) { + fc.close(); + randomAccessFile.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/util/file/FileTypeUtils.java b/food-open/food-open-api/src/main/java/com/jwsaas/util/file/FileTypeUtils.java new file mode 100644 index 0000000..e0631fb --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/util/file/FileTypeUtils.java @@ -0,0 +1,225 @@ +package com.jwsaas.util.file; + +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import javax.imageio.ImageIO; +import javax.imageio.ImageReader; +import javax.imageio.stream.ImageInputStream; + +import org.apache.commons.io.FilenameUtils; +import org.apache.commons.lang3.StringUtils; + +public class FileTypeUtils { + + private final static Map FILE_TYPE_MAP = new HashMap(); + + private final static List imageAllowFiles = Arrays.asList(new String[] { "png", "jpg", "jpeg", "gif", "bmp" });/* 允许上传的图片格式 */ + + static { + getAllFileType(); // 初始化文件类型信息 + } + + /** + *

+ * Discription:[getAllFileType,常见文件头信息] + * 注:TXT文件没有文件头 + *

+ */ + private static void getAllFileType() { + FILE_TYPE_MAP.put("jpg", "FFD8FF"); // JPEG (jpg) + FILE_TYPE_MAP.put("png", "89504E47"); // PNG (png) + FILE_TYPE_MAP.put("gif", "47494638"); // GIF (gif) + FILE_TYPE_MAP.put("tif", "49492A00"); // TIFF (tif) + FILE_TYPE_MAP.put("bmp", "424D"); // Windows Bitmap (bmp) + FILE_TYPE_MAP.put("dwg", "41433130"); // CAD (dwg) + FILE_TYPE_MAP.put("html", "68746D6C3E"); // HTML (html) + FILE_TYPE_MAP.put("rtf", "7B5C727466"); // Rich Text Format (rtf) + FILE_TYPE_MAP.put("xml", "3C3F786D6C"); + FILE_TYPE_MAP.put("zip", "504B0304"); + FILE_TYPE_MAP.put("rar", "52617221"); + FILE_TYPE_MAP.put("psd", "38425053"); // Photoshop (psd) + FILE_TYPE_MAP.put("eml", "44656C69766572792D646174653A"); //Email [thorough only] (eml) + FILE_TYPE_MAP.put("dbx", "CFAD12FEC5FD746F"); // Outlook Express (dbx) + FILE_TYPE_MAP.put("pst", "2142444E"); // Outlook (pst) + FILE_TYPE_MAP.put("xls", "D0CF11E0"); // MS Word + FILE_TYPE_MAP.put("doc", "D0CF11E0"); // MS Excel 注意:word 和 excel的文件头一样 + FILE_TYPE_MAP.put("mdb", "5374616E64617264204A"); // MS Access (mdb) + FILE_TYPE_MAP.put("wpd", "FF575043"); // WordPerfect (wpd) + FILE_TYPE_MAP.put("eps", "252150532D41646F6265"); + FILE_TYPE_MAP.put("ps", "252150532D41646F6265"); + FILE_TYPE_MAP.put("pdf", "255044462D312E"); // Adobe Acrobat (pdf) + FILE_TYPE_MAP.put("qdf", "AC9EBD8F"); // Quicken (qdf) + FILE_TYPE_MAP.put("pwl", "E3828596"); // Windows Password (pwl) + FILE_TYPE_MAP.put("wav", "57415645"); // Wave (wav) + FILE_TYPE_MAP.put("avi", "41564920"); + FILE_TYPE_MAP.put("ram", "2E7261FD"); // Real Audio (ram) + FILE_TYPE_MAP.put("rm", "2E524D46"); // Real Media (rm) + FILE_TYPE_MAP.put("mpg", "000001BA"); // + FILE_TYPE_MAP.put("mov", "6D6F6F76"); // Quicktime (mov) + FILE_TYPE_MAP.put("asf", "3026B2758E66CF11"); // Windows Media (asf) + FILE_TYPE_MAP.put("mid", "4D546864"); // MIDI (mid) + } + + /** + *

+ * Discription:[getFileTypeByStream] + *

+ */ + public final static String getFileTypeByStream(byte[] b) { + String filetypeHex = String.valueOf(getFileHexString(b)); + Iterator> entryiterator = FILE_TYPE_MAP.entrySet().iterator(); + while (entryiterator.hasNext()) { + Entry entry = entryiterator.next(); + String fileTypeHexValue = entry.getValue(); + if (filetypeHex.toUpperCase().startsWith(fileTypeHexValue)) { + return entry.getKey(); + } + } + return null; + } + + /** + *

+ * Discription:[getFileByFile,获取文件类型,包括图片,若格式不是已配置的,则返回null] + *

+ */ + public final static String getFileTypeByFile(File file) { + String fileType = null; + byte[] b = new byte[50]; + try { + InputStream is = new FileInputStream(file); + is.read(b); + fileType = getFileTypeByStream(b); + is.close(); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + return fileType; + } + + /** + *

+ * Discription:[getFileHexString] + *

+ */ + public final static String getFileHexString(byte[] b) { + StringBuilder stringBuilder = new StringBuilder(); + if (b == null || b.length <= 0) { + return null; + } + for (int i = 0; i < b.length; i++) { + int v = b[i] & 0xFF; + String hv = Integer.toHexString(v); + if (hv.length() < 2) { + stringBuilder.append(0); + } + stringBuilder.append(hv); + } + return stringBuilder.toString(); + } + + /** + *

+ * Discription:[getImageFileType,获取图片文件实际类型,若不是图片则返回null] + *

+ */ + public final static String getImageFileType(File f) { + if (isImage(f)) { + try { + ImageInputStream iis = ImageIO.createImageInputStream(f); + Iterator iter = ImageIO.getImageReaders(iis); + if (!iter.hasNext()) { + return null; + } + ImageReader reader = iter.next(); + iis.close(); + return reader.getFormatName(); + } catch (IOException e) { + e.printStackTrace(); + return null; + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + return null; + } + + /** + * 只根据后缀名判断是否为图片 + * + * @param file + * @return + */ + public static final boolean isImage(File file) { + return isImage(file, true); + } + + /** + *

+ * Discription:[isImage,判断文件是否为图片] + *

+ * + * @param file + * 源文件 + * @param onlyByExtension + * 是否值验证后缀名 + * @return true 是 | false 否 + */ + public static final boolean isImage(File file, boolean onlyByExtension) { + boolean flag = false; + try { + boolean allowFile = isImageByExtension(file.getName()); + if (onlyByExtension) { + flag = allowFile; + } else { + if (allowFile) { + BufferedImage bufreader = ImageIO.read(file); + int width = bufreader.getWidth(); + int height = bufreader.getHeight(); + if (width == 0 || height == 0) { + flag = false; + } else { + flag = true; + } + } + } + } catch (IOException e) { + flag = false; + e.printStackTrace(); + } catch (Exception e) { + flag = false; + e.printStackTrace(); + } + return flag; + } + + /** + * 只通过后缀名判断是否为图片 + * + * @param fileName + * @return + */ + public static final boolean isImageByExtension(String fileName) { + boolean flag = false; + String fileExtName = FilenameUtils.getExtension(fileName); + if (StringUtils.isNotBlank(fileExtName)) { + flag = imageAllowFiles.contains(fileExtName.toLowerCase()); + } + return flag; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/util/file/FileUtils.java b/food-open/food-open-api/src/main/java/com/jwsaas/util/file/FileUtils.java new file mode 100644 index 0000000..7d07cd6 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/util/file/FileUtils.java @@ -0,0 +1,89 @@ +package com.jwsaas.util.file; + +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.net.FileNameMap; +import java.net.URLConnection; + +import org.apache.commons.io.FilenameUtils; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class FileUtils { + + private static final Logger logger = LoggerFactory.getLogger(FileUtils.class); + + /** + * Get the Mime Type from a File + *

+ * 参考:http://www.rgagnon.com/javadetails/java-0487.html,http://dada89007. + * iteye.com/blog/1392606 + *

+ * + * @param fileName + * @return + */ + public static String getMimeType(String fileName) { + FileNameMap fileNameMap = URLConnection.getFileNameMap(); + String type = fileNameMap.getContentTypeFor(fileName); + logger.debug("type:" + type); + if (StringUtils.isBlank(type)) { + type = FilenameUtils.getExtension(fileName); + } + return type; + } + + /** + * 获得指定文件的byte数组 + */ + public static byte[] getBytes(String filePath) { + byte[] buffer = null; + File file = new File(filePath); + buffer = getBytes(file); + return buffer; + } + + /** + * 获得指定文件的byte数组 + */ + public static byte[] getBytes(File file) { + byte[] buffer = null; + try { + FileInputStream fis = new FileInputStream(file); + buffer = new byte[fis.available()]; + long length = fis.read(buffer); + fis.close(); + logger.debug("length:" + length); + } catch (FileNotFoundException e) { + logger.error("FileNotFoundException异常", e); + } catch (IOException e) { + logger.error("IOException异常", e); + } + return buffer; + } + + public static File getFile(byte[] buffer, String fileParentPath, String fileExtName) { + File file = null; + try { + File dir = new File(fileParentPath); + if (!dir.exists()) { + dir.mkdirs(); + } + file = new File(fileParentPath + File.separator + System.currentTimeMillis() + "." + fileExtName); + OutputStream output = new FileOutputStream(file); + BufferedOutputStream bufferedOutput = new BufferedOutputStream(output); + bufferedOutput.write(buffer); + bufferedOutput.close(); + } catch (Exception e) { + logger.error("Exception异常", e); + } + return file; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/util/open/BaseApiUtils.java b/food-open/food-open-api/src/main/java/com/jwsaas/util/open/BaseApiUtils.java new file mode 100644 index 0000000..68c0032 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/util/open/BaseApiUtils.java @@ -0,0 +1,74 @@ +package com.jwsaas.util.open; + +import java.security.MessageDigest; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Map; + +public class BaseApiUtils { + + protected final String ERROR_TOKEN = "@@$-ERROR_TOKEN$-@@"; + + protected String sign(Map paramValues, List ignoreParamNames, String secret) { + StringBuilder sb = new StringBuilder(); + List paramNames = new ArrayList(paramValues.size()); + paramNames.addAll(paramValues.keySet()); + if (ignoreParamNames != null && ignoreParamNames.size() > 0) { + for (String ignoreParamName : ignoreParamNames) { + paramNames.remove(ignoreParamName); + } + } + Collections.sort(paramNames, new Comparator() { + @Override + public int compare(String o1, String o2) { + return o1.compareTo(o2); + } + }); + + // Collections.sort(paramNames); + + sb.append(secret); + for (String paramName : paramNames) { + sb.append(paramName).append(paramValues.get(paramName)); + } + sb.append(secret); + byte[] sha1Digest = getSHA1Digest(sb.toString()); + return byte2hex(sha1Digest); + } + + /** + * 二进制转十六进制字符串 + * + * @param bytes + * @return + */ + private String byte2hex(byte[] bytes) { + StringBuilder sign = new StringBuilder(); + for (int i = 0; i < bytes.length; i++) { + String hex = Integer.toHexString(bytes[i] & 0xFF); + if (hex.length() == 1) { + sign.append("0"); + } + sign.append(hex.toUpperCase()); + } + return sign.toString(); + } + + private byte[] getSHA1Digest(String data) { + byte[] bytes = null; + try { + MessageDigest md = MessageDigest.getInstance("SHA-1"); + bytes = md.digest(data.getBytes("UTF8")); + } catch (Exception e) { + e.printStackTrace(); + } + return bytes; + } + + protected boolean isSuccessful(String content) { + return !(content.contains(ERROR_TOKEN)); + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/util/open/BaseCardApiUtils.java b/food-open/food-open-api/src/main/java/com/jwsaas/util/open/BaseCardApiUtils.java new file mode 100644 index 0000000..1f292cb --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/util/open/BaseCardApiUtils.java @@ -0,0 +1,21 @@ +package com.jwsaas.util.open; + +/*** + * 会员卡接口参数 + * @author louxutao + * + */ +public class BaseCardApiUtils extends BaseApiUtils{ + + protected String serverUrl = "http://mv2.jwsaas.com/openApi/api"; + protected String serverUrlExtend = "http://mv2.jwsaas.com/openApi/api/open/api/extend"; + + protected String appKey = "n1jm6vnwLmiDgpBMnEay"; + protected String appSecret = "17e489950057920e41afd422945f2e13"; + + protected String format = "json"; + protected String v = "1.0"; + protected String locale = "zh_CN"; + protected String client = "web"; + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/utils/AppAuthUtil.java b/food-open/food-open-api/src/main/java/com/jwsaas/utils/AppAuthUtil.java new file mode 100644 index 0000000..dfce25d --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/utils/AppAuthUtil.java @@ -0,0 +1,76 @@ +package com.jwsaas.utils; + +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.lang3.StringUtils; +import org.redisson.api.RAtomicLong; +import org.redisson.api.RMapCache; +import org.redisson.api.RedissonClient; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.jwsaas.Constant; +import com.jwsaas.condition.Criteria; +import com.jwsaas.condition.Restrictions; +import com.jwsaas.entity.shared.AppAuth; +import com.jwsaas.service.shared.AppAuthService; + +public class AppAuthUtil { + + private static Logger logger = LoggerFactory.getLogger(AppAuthUtil.class); + + private static RedissonClient getRedissonClient() { + return SpringUtils.getBean(RedissonClient.class); + } + + private static AppAuthService getAppAuthService() { + return SpringUtils.getBean(AppAuthService.class); + } + + public static AppAuth getAppAuth(String appKey) { + if (StringUtils.isBlank(appKey)) { + return null; + } + + RMapCache allAppSecret = getRedissonClient().getMapCache(RedisKeyUtil.getKey4AppAuth()); + AppAuth appAuth = allAppSecret.get(appKey); + if (appAuth == null) { + try { + Criteria criteria = new Criteria(); + criteria.add(Restrictions.eq("status", 1)); + criteria.add(Restrictions.eq("appKey", appKey)); + List list = getAppAuthService().getList(Constant.DEFAULT_DB_SIGN, criteria); + if (list != null && list.size() == 1) { + appAuth = list.get(0); + if (appAuth != null) { + allAppSecret.put(appKey, appAuth, 2, TimeUnit.DAYS); + } + } + } catch (Exception e) { + logger.error("从数据库中读取AppAuth[dbSign=" + Constant.DEFAULT_DB_SIGN + ",appKey=" + appKey + "]信息失败,", e); + } + } + return appAuth; + } + + public static RAtomicLong getInvokeTimes(String appCode) { + String redisName = RedisKeyUtil.getKey4InvokeTimes(appCode); + RAtomicLong rAtomicLong = getRedissonClient().getAtomicLong(redisName); + return rAtomicLong; + } + + public static RMapCache> getCallTime() { + String redisName = RedisKeyUtil.getKey4CallTime(); + RMapCache> callTime = getRedissonClient().getMapCache(redisName); + return callTime; + } + + public static Set getAppKeySet() { + RMapCache allAppSecret = getRedissonClient().getMapCache(RedisKeyUtil.getKey4AppAuth()); + return allAppSecret.keySet(); + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/utils/AppKeyUtil.java b/food-open/food-open-api/src/main/java/com/jwsaas/utils/AppKeyUtil.java new file mode 100644 index 0000000..6ff4c62 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/utils/AppKeyUtil.java @@ -0,0 +1,41 @@ +package com.jwsaas.utils; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.jwsaas.bean.AppKeyInfo; +import com.jwsaas.util.Md5Hash; + +public class AppKeyUtil { + + private static Logger logger = LoggerFactory.getLogger(AppKeyUtil.class); + + public static String generate(AppKeyInfo appKeyInfo) { + return HashidsUtil.encode(Long.parseLong(appKeyInfo.getAppId()), Long.parseLong(appKeyInfo.getTenantCode()), + Long.parseLong(appKeyInfo.getAppCode())); + } + + public static AppKeyInfo decode(String appKey) { + try { + appKey="y4l21nByPRTmJ03OvBD7"; + long[] data = HashidsUtil.decode(appKey); + if (data != null && data.length == 3) { + return new AppKeyInfo(data[0] + "", data[1] + "", data[2] + ""); + } + } catch (Exception e) { + logger.error("AppKeyUtil.decode[" + appKey + "]失败", e); + } + return null; + } + + public static String getSecret(AppKeyInfo appKeyInfo) { + return new Md5Hash(appKeyInfo.getAppId() + appKeyInfo.getTenantCode() + appKeyInfo.getAppCode()).toHex(); + } + + public static void main(String[] args) { + long[] data = HashidsUtil.decode("y4l21nByPRTmJ03OvBD7' OR (SELECT*FROM(SELECT(SLEEP(3)))tkrd) limit 1#"); + System.out.println(data[0]); + System.out.println(data[1]); + System.out.println(data[2]); + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/utils/HashidsUtil.java b/food-open/food-open-api/src/main/java/com/jwsaas/utils/HashidsUtil.java new file mode 100644 index 0000000..b0f5868 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/utils/HashidsUtil.java @@ -0,0 +1,65 @@ +package com.jwsaas.utils; + +public class HashidsUtil { + + private static final String salt = "jwsaas.com.food2"; + + public static String encode(long... numbers) { + return encodeEx(salt, numbers); + } + + public static long[] decode(String hash) { + return decodeEx(salt, hash); + } + + public static String encode(final String salt, long... numbers) { + return encodeEx(salt, numbers); + } + + public static long[] decode(final String salt, String hash) { + return decodeEx(salt, hash); + } + + private static String encodeEx(final String salt, long... numbers) { + if (numbers.length == 0) { + return ""; + } + + StringBuilder result = new StringBuilder(); + + int inx = 0; + for (long number : numbers) { + if (number < 0) { + return ""; + } + String hexString = Long.toHexString(number); + String hexStringLength = String.format("%02x", hexString.length()); + result.append(hexStringLength + hexString); + inx++; + } + Hashids hashids = new Hashids(salt); + return hashids.encodeHex(String.format("%02x", inx) + result.toString()); + } + + private static long[] decodeEx(final String salt, String hash) { + int offset = 2; + if (hash.isEmpty() || hash.length() < offset) { + return new long[0]; + } + Hashids hashids = new Hashids(salt); + String decodeString = hashids.decodeHex(hash); + // 取两个字符长度 + int counts = Integer.parseInt(decodeString.substring(0, offset), 16); + long[] result = new long[counts]; + + for (int i = 0; i < counts; i++) { + int len = Integer.parseInt(decodeString.substring(offset, offset + 2), 16); + offset += 2; + result[i] = Long.parseLong(decodeString.substring(offset, offset + len), 16); + offset += len; + } + + return result; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/utils/RedisKeyUtil.java b/food-open/food-open-api/src/main/java/com/jwsaas/utils/RedisKeyUtil.java new file mode 100644 index 0000000..580013a --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/utils/RedisKeyUtil.java @@ -0,0 +1,53 @@ +package com.jwsaas.utils; + +import com.jwsaas.Constant; +import com.jwsaas.properties.ApplicationProperties; + +public class RedisKeyUtil { + + public static final String SEPARATOR = ":"; + + public static String buildKey(String... args) { + if (args == null) + return null; + + int iMax = args.length - 1; + if (iMax == -1) + return null; + + StringBuilder b = new StringBuilder(); + for (int i = 0;; i++) { + b.append(String.valueOf(args[i])); + if (i == iMax) + return b.toString(); + b.append(SEPARATOR); + } + } + + public static String getKey4AppAuth() { + return buildKey(Constant.DEFAULT_REDIS_PREFIX, "appAuth"); + } + + public static String getKey4InvokeTimes(String appCode) { + return buildKey(Constant.DEFAULT_REDIS_PREFIX, "invokeTimes", appCode); + } + + public static String getKey4CallTime() { + return buildKey(Constant.DEFAULT_REDIS_PREFIX, "callTime"); + } + + public static String getKey4Methods(ApplicationProperties applicationProperties) { + return buildKey(Constant.DEFAULT_REDIS_PREFIX, "methods", applicationProperties.getSign()); + } + + public static String getKey4Sessions() { + return buildKey(Constant.DEFAULT_REDIS_PREFIX, "sessions", "map"); + } + + // public static String getKey4MethodStat(String appCode, String + // currentDate) { + // return buildKey(Constants.DEFAULT_REDIS_PREFIX, "methodstat", appCode, + // currentDate); + // } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/weixin/SignUtil.java b/food-open/food-open-api/src/main/java/com/jwsaas/weixin/SignUtil.java new file mode 100644 index 0000000..32d79c3 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/weixin/SignUtil.java @@ -0,0 +1,103 @@ +package com.jwsaas.weixin; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang3.StringUtils; + +import com.jwsaas.utils.RSASignature; + +public class SignUtil { + + /** + * 用私钥对信息生成数字签名 + */ + public static String rsaSign(String content, String privateKey, String charset) throws Exception { + try { + byte[] data = null; + if (StringUtils.isBlank(charset)) { + data = content.getBytes(); + } else { + data = content.getBytes(charset); + } + return RSASignature.sign(data, privateKey); + } catch (Exception e) { + throw new Exception("RSAcontent = " + content + ",charset = " + charset, e); + } + } + + public static String getSignCheckContent(Map params) { + if (params == null) { + return null; + } + params.remove("sign"); + + StringBuffer content = new StringBuffer(); + List keys = new ArrayList(params.keySet()); + Collections.sort(keys); + + for (int i = 0; i < keys.size(); i++) { + String key = keys.get(i); + String value = params.get(key).toString(); + content.append((i == 0 ? "" : "&") + key + "=" + value); + } + + return content.toString(); + } + + public static String createSign(Map map,String secret){ + + StringBuffer sf = new StringBuffer(); + if (map != null && map.keySet().size() > 0) { + Iterator iterator = map.entrySet().iterator(); + while (iterator.hasNext()) { + Map.Entry entry = (Map.Entry) iterator.next(); + sf.append(entry.getKey()+"="+entry.getValue()+"&"); + } + } + + String s = sf.toString(); + //移除最后一个&,如果是md5加密,还要加上secret + String s2 = s.substring(0, s.length() - 1)+secret; + String sign = org.apache.commons.codec.digest.DigestUtils.md5Hex(s2).toString().toUpperCase(); + + return sign; + + } + + + public static String createSignByMD5(Map map,String secret,String charset) throws Exception { + + StringBuffer sf = new StringBuffer(); + if (map != null && map.keySet().size() > 0) { + Iterator iterator = map.entrySet().iterator(); + while (iterator.hasNext()) { + Map.Entry entry = (Map.Entry) iterator.next(); + sf.append(entry.getKey()+"="+entry.getValue()+"&"); + } + } + + String s = sf.toString(); + //移除最后一个&,如果是md5加密,还要加上secret + String s2 = s.substring(0, s.length() - 1)+secret; + byte[] data = null; + if (StringUtils.isBlank(charset)) { + data = s2.getBytes(); + } else { + try { + data = s2.getBytes(charset); + } catch (Exception e) { + throw new Exception("生成签名时,出错", e); + } + } + String sign = org.apache.commons.codec.digest.DigestUtils.md5Hex(data).toString().toUpperCase(); + + return sign; + + } +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/weixin/TemplateMessageApi.java b/food-open/food-open-api/src/main/java/com/jwsaas/weixin/TemplateMessageApi.java new file mode 100644 index 0000000..3997d3c --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/weixin/TemplateMessageApi.java @@ -0,0 +1,27 @@ +package com.jwsaas.weixin; + +import org.apache.http.HttpResponse; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.jwsaas.http.HttpTool; +import com.jwsaas.weixin.bean.TemplateMessage; +import com.jwsaas.weixin.bean.Token; + +public class TemplateMessageApi { + + private static Logger logger = LoggerFactory.getLogger(TemplateMessageApi.class); + + public static JSONObject sendTemplateMessage(Token token, TemplateMessage message) throws Exception { + String url = String.format("https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=%s", token.getAccessToken()); + final HttpResponse response = HttpTool.url(url).body(JSON.toJSONString(message)).post(); + logger.debug("status:{}", HttpTool.getStatus(response)); + logger.debug("statusOK:{}", HttpTool.isStatusOK(response)); + final String content = HttpTool.getResponseAsString(response); + logger.debug("weixin>resp>:{}", content); + return JSON.parseObject(content); + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/weixin/WeixinUtil.java b/food-open/food-open-api/src/main/java/com/jwsaas/weixin/WeixinUtil.java new file mode 100644 index 0000000..172f11c --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/weixin/WeixinUtil.java @@ -0,0 +1,81 @@ +package com.jwsaas.weixin; + +import java.util.HashMap; +import java.util.Map; + +import org.apache.commons.lang3.StringUtils; +import org.apache.http.HttpResponse; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Component; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.jwsaas.http.HttpTool; +import com.jwsaas.properties.WeiXinProperties; +import com.jwsaas.weixin.bean.Token; + +@Component +@Lazy(false) +public class WeixinUtil { + + private static Logger logger = LoggerFactory.getLogger(WeixinUtil.class); + private static final String CHARSET = "UTF-8"; + private static final String RSA_PRIVATE_KEY = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAMRW2Keeo7k2+lK6XhdGnBzvJCg6hu+hvx0oJfkrv1uezdNOZ4ahPDChcm4lfQpQEXzXtOv4MoDgN39rlUtNm7HdfDDYujHvveUHKnuD2QKJQBArgkMkq7Qh0CEZfukTwAE1GcbS89Au/AX+ZAS3ki0VrGTeC19YkHZrLnLJCJuhAgMBAAECgYEAtQGnvWh4YjF4N7qPMgArvlUNzXSfn95LNdMkpwGY6huOf6dBtBGDTwYYW8l97HsClEi9B+qKjNuo7nS9b23+AS+kfx1dkFzw/slDrD36EUWxbWp4K6NLnEShv5JmX7wPCHGERSRnbgPRp9zchkFtwHP2gaJnkW+6N10cwgPveY0CQQDn+wT3E+QMHola/RMTd1Eef/0RyHcSLaVJKmgZuV5rfHnUa4H+56xZzeboYdfBpgOujnRSNLC/tKmrRfCHfkJ3AkEA2KsaQXshLFIc8zOZtY8fNqGa9nvHUgwqzS6HT23O4YDiQaQgcibMQn+HneGn0sjNxvbMmWi7A8UfYTaY/T7ApwJARLdJmDrPIXvmKgqvHOQKJmO5PgxIoRzeShcCsSQEwQglOnQCFNTha9SfIpThCV641nsiH7u144OLgs1721beLwJARJLyvmK//w0GCJr+PQ5NLLc9GmHWlcswCLx/Ks5wOcLW2Tue4UISR8GhJID04quXJS+bVbpl5i2PXu8uwIgJ5QJAM6UkIzSvovpahuhsdUuGolAtmCmrZ5A/c3A8CWNSWDd9KmBXU+S/Hl5L9snD9IQXlg2saSgJ+zrM510Ohl5RUg=="; + + @Autowired + private WeiXinProperties weiXinProperties; + + /** + * 获取微信公众账号token + */ + public Token getToken(String wid, String type, String appId, String appSecret) { + logger.info("getToken>>wid:{}:type:{}:appId:{}", wid, type, appId); + Token token = new Token(); + + try { + if (StringUtils.isBlank(type)) { + type = "token"; // 微信token + } + + Map paramMap = new HashMap(20); + paramMap.put("tenantId", wid); + paramMap.put("appId", appId); + paramMap.put("appSecret", appSecret); + String sign = SignUtil.rsaSign(SignUtil.getSignCheckContent(paramMap), RSA_PRIVATE_KEY, CHARSET); + paramMap.put("sign", sign); + + String url = weiXinProperties.getOauthCenterUrl() + "/weixin/token/getToken"; + final HttpResponse response = HttpTool.url(url).form(paramMap).post(); + logger.debug("status:{}", HttpTool.getStatus(response)); + logger.debug("statusOK:{}", HttpTool.isStatusOK(response)); + if (HttpTool.isStatusOK(response)) { + final String content = HttpTool.getResponseAsString(response); + logger.debug("content:{}", content); + + JSONObject result = JSON.parseObject(content); + String key = "token"; // 微信token + if ("jsticket".equalsIgnoreCase(type)) { + key = "jsTicketToken"; // jsticket票据 + } else if ("apiticket".equalsIgnoreCase(type)) { + key = "apiTicketToken";// 卡券票据 + } + JSONObject object = result.getJSONObject(key); + token.setAccessToken(object.getString("accessToken")); + token.setTime(object.getLongValue("time")); + token.setExpiresIn(object.getIntValue("expiresIn")); + return token; + } else { + logger.error("getToken>>wid:{}:type:{}:appId:{}", wid, type, appId); + } + } catch (Exception e) { + e.printStackTrace(); + logger.error("getToken>>wid:{}:type:{}:appId:{}", wid, type, appId); + } + + return token; + } + +} diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/weixin/bean/TemplateMessage.java b/food-open/food-open-api/src/main/java/com/jwsaas/weixin/bean/TemplateMessage.java new file mode 100644 index 0000000..25a0ccf --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/weixin/bean/TemplateMessage.java @@ -0,0 +1,142 @@ +package com.jwsaas.weixin.bean; + +import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; + +/** + * 模板消息 + * + * @see 模板消息 + */ +public class TemplateMessage implements Serializable { + + private static final long serialVersionUID = 7950608393821661436L; + + /** + * 用户的openid + */ + private String touser; + /** + * 模板ID + */ + private String template_id; + /** + * 点击消息跳转的url + */ + private String url; + /** + * 顶部的颜色值 + */ + private String topcolor = "#FF0000"; + /** + * 数据项 + */ + private Map data; + + public void pushData(String key, String value) { + this.data.put(key, new Item(value)); + } + + public void pushData(String key, String value, String color) { + this.data.put(key, new Item(value, color)); + } + + public TemplateMessage(String touser, String template_id, String title, String url) { + this.touser = touser; + this.template_id = template_id; + this.url = url; + this.data = new HashMap(); + pushData("first", title); + } + + public TemplateMessage(String touser, String template_id, String title) { + this.touser = touser; + this.template_id = template_id; + this.data = new HashMap(); + pushData("first", title); + } + + /** + * 模板消息的数据项 + */ + private static class Item implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 字段值 + */ + private String value; + /** + * 颜色值 + */ + private String color; + + public Item(String value) { + this(value, "#173177"); + } + + public Item(String value, String color) { + this.value = value; + this.color = color; + } + + public String getValue() { + return value; + } + + public String getColor() { + return color; + } + + @Override + public String toString() { + return "$ [value=" + getValue() + ", color=" + getColor() + "]"; + } + } + + public String getTouser() { + return touser; + } + + public void setTouser(String touser) { + this.touser = touser; + } + + public String getTemplate_id() { + return template_id; + } + + public void setTemplate_id(String template_id) { + this.template_id = template_id; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getTopcolor() { + return topcolor; + } + + public void setTopcolor(String topcolor) { + this.topcolor = topcolor; + } + + public Map getData() { + return data; + } + + public void setData(Map data) { + this.data = data; + } + + @Override + public String toString() { + return "TemplateMessage [touser=" + touser + ", template_id=" + template_id + ", url=" + url + ", topcolor=" + topcolor + ", data=" + data + "]"; + } +} \ No newline at end of file diff --git a/food-open/food-open-api/src/main/java/com/jwsaas/weixin/bean/Token.java b/food-open/food-open-api/src/main/java/com/jwsaas/weixin/bean/Token.java new file mode 100644 index 0000000..9251e23 --- /dev/null +++ b/food-open/food-open-api/src/main/java/com/jwsaas/weixin/bean/Token.java @@ -0,0 +1,67 @@ +package com.jwsaas.weixin.bean; + +import java.io.Serializable; + +import com.alibaba.fastjson.annotation.JSONField; + +/** + * access_token是公众号的全局唯一票据,公众号调用各接口时都需使用access_token,正常情况下access_token有效期为7200秒, + * 重复获取将导致上次获取的access_token失效 + */ +public class Token implements Serializable { + + private static final long serialVersionUID = -7564855472419104084L; + + /** + * 获取到的凭证 + */ + @JSONField(name = "access_token") + private String accessToken; + /** + * 凭证有效时间,单位:秒 + */ + @JSONField(name = "expires_in") + private int expiresIn; + /** + * token创建的时间 + */ + private long time; + + public Token() { + + } + + public Token(String accessToken) { + this.accessToken = accessToken; + } + + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } + + public int getExpiresIn() { + return expiresIn; + } + + public void setExpiresIn(int expiresIn) { + this.expiresIn = expiresIn; + } + + public long getTime() { + return time; + } + + public void setTime(long time) { + this.time = time; + } + + @Override + public String toString() { + return "Token [accessToken=" + accessToken + ", expiresIn=" + expiresIn + ", time=" + time + "]"; + } + +} diff --git a/food-open/food-open-api/src/main/lib/libwrapper-macosx-universal-32.jnilib b/food-open/food-open-api/src/main/lib/libwrapper-macosx-universal-32.jnilib new file mode 100644 index 0000000..ae75d31 Binary files /dev/null and b/food-open/food-open-api/src/main/lib/libwrapper-macosx-universal-32.jnilib differ diff --git a/food-open/food-open-api/src/main/lib/libwrapper-macosx-universal-64.jnilib b/food-open/food-open-api/src/main/lib/libwrapper-macosx-universal-64.jnilib new file mode 100644 index 0000000..e7d4102 Binary files /dev/null and b/food-open/food-open-api/src/main/lib/libwrapper-macosx-universal-64.jnilib differ diff --git a/food-open/food-open-api/src/main/lib/wrapper-windows-x86-32.dll b/food-open/food-open-api/src/main/lib/wrapper-windows-x86-32.dll new file mode 100644 index 0000000..6aaa9c1 Binary files /dev/null and b/food-open/food-open-api/src/main/lib/wrapper-windows-x86-32.dll differ diff --git a/food-open/food-open-api/src/main/lib/wrapper-windows-x86-64.dll b/food-open/food-open-api/src/main/lib/wrapper-windows-x86-64.dll new file mode 100644 index 0000000..81f11ce Binary files /dev/null and b/food-open/food-open-api/src/main/lib/wrapper-windows-x86-64.dll differ diff --git a/food-open/food-open-api/src/main/lib/wrapper.jar b/food-open/food-open-api/src/main/lib/wrapper.jar new file mode 100644 index 0000000..70dc5ab Binary files /dev/null and b/food-open/food-open-api/src/main/lib/wrapper.jar differ diff --git a/food-open/food-open-api/src/main/logs/safeToDelete.tmp b/food-open/food-open-api/src/main/logs/safeToDelete.tmp new file mode 100644 index 0000000..e69de29 diff --git a/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-agent.xml b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-agent.xml new file mode 100644 index 0000000..d730083 --- /dev/null +++ b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-agent.xml @@ -0,0 +1,17 @@ + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-coupon.xml b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-coupon.xml new file mode 100644 index 0000000..bb1df92 --- /dev/null +++ b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-coupon.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-dispatch.xml b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-dispatch.xml new file mode 100644 index 0000000..e72cd68 --- /dev/null +++ b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-dispatch.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-program.xml b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-program.xml new file mode 100644 index 0000000..9abc36c --- /dev/null +++ b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-program.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-promotion.xml b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-promotion.xml new file mode 100644 index 0000000..72e2431 --- /dev/null +++ b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-promotion.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-shared.xml b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-shared.xml new file mode 100644 index 0000000..f86d6b3 --- /dev/null +++ b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-shared.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-storage.xml b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-storage.xml new file mode 100644 index 0000000..4774511 --- /dev/null +++ b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-storage.xml @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-store-storage.xml b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-store-storage.xml new file mode 100644 index 0000000..adf0dae --- /dev/null +++ b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-store-storage.xml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-store.xml b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-store.xml new file mode 100644 index 0000000..81ec513 --- /dev/null +++ b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-store.xml @@ -0,0 +1,456 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-task.xml b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-task.xml new file mode 100644 index 0000000..4f7f927 --- /dev/null +++ b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-task.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-user.xml b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-user.xml new file mode 100644 index 0000000..eca105c --- /dev/null +++ b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-user.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-waimai.xml b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-waimai.xml new file mode 100644 index 0000000..48b2654 --- /dev/null +++ b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-waimai.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-weixin.xml b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-weixin.xml new file mode 100644 index 0000000..5875199 --- /dev/null +++ b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-weixin.xml @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-wxdc.xml b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-wxdc.xml new file mode 100644 index 0000000..373e6e3 --- /dev/null +++ b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-wxdc.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-wxyh.xml b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-wxyh.xml new file mode 100644 index 0000000..37fc30a --- /dev/null +++ b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food-wxyh.xml @@ -0,0 +1,19 @@ + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food.xml b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food.xml new file mode 100644 index 0000000..7bbd5a3 --- /dev/null +++ b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-food.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-manager.xml b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-manager.xml new file mode 100644 index 0000000..461a1d3 --- /dev/null +++ b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo-manager.xml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo.xml b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo.xml new file mode 100644 index 0000000..13bd425 --- /dev/null +++ b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-dubbo.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/src/main/resources/META-INF/spring/spring-wop.xml b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-wop.xml new file mode 100644 index 0000000..2d1ce84 --- /dev/null +++ b/food-open/food-open-api/src/main/resources/META-INF/spring/spring-wop.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/src/main/resources/application.properties b/food-open/food-open-api/src/main/resources/application.properties new file mode 100644 index 0000000..4ed764e --- /dev/null +++ b/food-open/food-open-api/src/main/resources/application.properties @@ -0,0 +1,132 @@ +#Global +global.encoding=UTF-8 +global.locale=zh_CN + +#application.sign,application.index\u90FD\u4E0D\u80FD\u91CD\u590D +application.name=food-2.0-openApi +application.owner= +application.sign=local-master +application.description=${application.name} +application.index=0 + +# ServerProperties +server.port=8000 +server.context-path=/openApi +server.compression.enabled=true +server.compression.mime-types=text/html,text/xml,text/plain,text/css,application/json,application/xml +server.compression.min-response-size=2048 + +#dubbo cache address +dubbo.cache.address=/home/project/food/dubbo/food-api.cache + +#Redis\u53C2\u6570 +redis.type=single +redis.host=127.0.0.1 +redis.port=6379 +redis.password=123456 +redis.database=4 +redis.timeout=120000 +redis.pool-max-idle=8 +redis.pool-min-idle=0 +redis.pool-max-active=8 +redis.pool-max-wait=-1 + +#\u5B9A\u65F6\u4EFB\u52A1 +#Schedule +monitor.memory.cron=0 0/2 * * * ? +appauth.callcount.cron=0 0/1 * * * ? +#\u662F\u5426\u8DF3\u8FC7\u8C03\u7528\u6B21\u6570\u8BA1\u5212\u4EFB\u52A1(\u90E8\u7F72\u591A\u4EFD\u65F6\uFF0C\u53EA\u9700\u4E00\u4EFD\u6267\u884C\uFF0C\u5176\u4F59\u90FD\u5E94\u8DF3\u8FC7) +appauth.callcount.skip=false + +#ID +id.worker=1 +id.center=1 +id.sequence=1 + +#\u6CE8\u518C\u4E2D\u5FC3 +zk.connect=127.0.0.1:2181 +# curator or zkclient +zk.client=curator + +#dubbo\u670D\u52A1 +reference.version=2.0.0 +reference.group=default +reference.timeout=30000 +reference.retries=1 + +#FreeMarkerAutoConfiguration +spring.freemarker.cache=false +spring.freemarker.charset=${global.encoding} +#spring.freemarker.prefer-file-system-access=false +spring.freemarker.settings.template_exception_handler=com.jwsaas.freemarker.DefaultTemplateExceptionHandler +spring.freemarker.settings.auto_import=spring.ftl as spring + +# INTERNATIONALIZATION +#\u6307\u5B9Amessage\u7684basename\uFF0C\u591A\u4E2A\u4EE5\u9017\u53F7\u5206\u9694\uFF0C\u5982\u679C\u4E0D\u52A0\u5305\u540D\u7684\u8BDD\uFF0C\u9ED8\u8BA4\u4ECEclasspath\u8DEF\u5F84\u5F00\u59CB\uFF0C\u9ED8\u8BA4: messages +spring.messages.basename=i18n/messages +#\u8BBE\u5B9A\u52A0\u8F7D\u7684\u8D44\u6E90\u6587\u4EF6\u7F13\u5B58\u5931\u6548\u65F6\u95F4\uFF0C-1\u7684\u8BDD\u4E3A\u6C38\u4E0D\u8FC7\u671F\uFF0C\u9ED8\u8BA4\u4E3A-1 +spring.messages.cache-seconds=3600 + +#FastDfs\u914D\u7F6E-fdfs_client.properties +fastdfs.client.connect_timeout=2 +fastdfs.client.network_timeout=30 +fastdfs.client.charset=UTF-8 +fastdfs.client.http.tracker_http_port=80 +fastdfs.client.http.anti_steal_token=no +fastdfs.client.http.secret_key=FastDFS111111111 +#zhangshuxiang aly +fastdfs.client.tracker_server=127.0.0.1:22122 +#\u8BBF\u95EE\u57DF\u540D +fastdfs.client.access_domain=http://img.zhangshuxiang.com + +#MQTT +mqtt.clientId=cy2_openapi_1_bendi_zgt1 +mqtt.host=csiotv2.ffcygl.com +mqtt.port=18830 +mqtt.keepalive=60 +mqtt.connection.timeout=10 + +#\u5FAE\u4FE1 +weixin.oauth.center.url=http://oauth.domain.com + +#Task\u8BA1\u5212\u4EFB\u52A1 +#\u6267\u884C\u5668\u6807\u8BC6 +xxl.job.executor.sign=10001JW_Food +#\u62A5\u8B66\u90AE\u4EF6 +xxl.job.alarm.email=418146746@qq.com +#\u4EFB\u52A1\u8C03\u5EA6\u63A5\u53E3 +schedue.url=http://127.0.0.1:8900/job/schedule/open + +#V2\u638C\u67DC\u67E5\u8BE2\u5F00\u653E\u63A5\u53E3\u5730\u5740 +#zgcx.api.v2.url=http://r.jwsaas.com/wx/api/extend +zgcx.api.v2.url=http://127.0.0.1:8889/wx/api/extend + +#V2\u95E8\u5E97\u8D26\u6237\u4F59\u989D\u5145\u503C-\u5FAE\u4FE1\u652F\u4ED8\u5F02\u6B65\u901A\u77E5\u5730\u5740 +wxyh.api.v2.wxnotify.url=http://127.0.0.1:8000/openApi/open/api/extend/callBack + +#V2\u5C0F\u7A0B\u5E8F\u626B\u5457\u652F\u4ED8-\u5FAE\u4FE1\u652F\u4ED8\u5F02\u6B65\u901A\u77E5\u5730\u5740 +saobeipay.wxnotify.url=http://azkoss.imwork.net/openApi/open/api/extend/callBack/saobeigcwxnotify + +#V2\u5C0F\u7A0B\u5E8F\u626B\u5457\u652F\u4ED8-\u5FAE\u4FE1\u652F\u4ED8\u5F02\u6B65\u901A\u77E5\u5730\u5740 +saobeipay.programnotify.url=http://azkoss.imwork.net/openApi/open/api/extend/callBack/saobeiprogramnotify + +tonglianpay.wxnotify.url=https://csfv2.ffcygl.com/openApi/open/api/extend/callBack/tonglianprogramnotifygcwxnotify + +tonglianpay.programnotify.url=https://csfv2.ffcygl.com/openApi/open/api/extend/callBack/tonglianprogramnotify + +tonglian.signalagentPayotify=https://csfv2.ffcygl.com/openApi/open/api/extend/callBack/signalagentPayotify + +#\u767E\u5EA6\u5730\u56FELBS ak\u548C\u6570\u636E\u8868 id +baidu.api.v4.ak=baiduak +baidu.api.v4.geoTableId=tableId + +#RabbitMQ +spring.rabbitmq.host=47.92.83.179 +spring.rabbitmq.port=5672 +spring.rabbitmq.virtual-host=/dev_test +spring.rabbitmq.publisher-confirms=true +spring.rabbitmq.username=foodcard +spring.rabbitmq.password=zsx235679@ + +#\u9910\u9053\u7B2C\u4E09\u65B9\u914D\u9001\u5730\u5740 +candao.waimai.dispatch.url=http://127.0.0.1:8008 diff --git a/food-open/food-open-api/src/main/resources/erp.properties b/food-open/food-open-api/src/main/resources/erp.properties new file mode 100644 index 0000000..b004bc3 --- /dev/null +++ b/food-open/food-open-api/src/main/resources/erp.properties @@ -0,0 +1,11 @@ +open.api.appKey=appkey +open.api.secret=secret +open.api.version=1.0 +open.api.format=json +open.api.locale=zh_CN +open.api.client=web +open.api.url=http://127.0.0.1/openApi/api + +#\u9910\u996E\u7684appk secret +open.api.food.appKey=appKey +open.api.food.secret=secret diff --git a/food-open/food-open-api/src/main/resources/fdfs_client.conf b/food-open/food-open-api/src/main/resources/fdfs_client.conf new file mode 100644 index 0000000..ef6700c --- /dev/null +++ b/food-open/food-open-api/src/main/resources/fdfs_client.conf @@ -0,0 +1,9 @@ +connect_timeout=2 +network_timeout=30 +charset=UTF-8 +http.tracker_http_port=80 +http.anti_steal_token=no +http.secret_key=FastDFS1111111111 +#JW +tracker_server=127.0.0.1:22122 +access_domain=http://img.zhangshuxiang.com diff --git a/food-open/food-open-api/src/main/resources/i18n/messages.properties b/food-open/food-open-api/src/main/resources/i18n/messages.properties new file mode 100644 index 0000000..a9a1bba --- /dev/null +++ b/food-open/food-open-api/src/main/resources/i18n/messages.properties @@ -0,0 +1,4 @@ +project.name=Food\u5f00\u653e\u5e73\u53f0 +project.description=Food\u5f00\u653e\u5e73\u53f0 +project.version=2.0 +project.softwareName=Food\u7cfb\u7edf diff --git a/food-open/food-open-api/src/main/resources/i18n/wop/ext/error_zh_CN.properties b/food-open/food-open-api/src/main/resources/i18n/wop/ext/error_zh_CN.properties new file mode 100644 index 0000000..63228f8 --- /dev/null +++ b/food-open/food-open-api/src/main/resources/i18n/wop/ext/error_zh_CN.properties @@ -0,0 +1,301 @@ +#\u4e1a\u52a1\u903b\u8f91\u9519\u8bef\u5904\u7406 +#\u683c\u5f0f:isv.xxx-service-error\:yyy=\u9519\u8bef\u63cf\u8ff0\u4fe1\u606f +#\u5176\u4e2d:xxx\u4ee3\u8868\u66b4\u9732\u7684\u65b9\u6cd5\u540d\u79f0,\u5c06\u540d\u79f0\u4e2d.\u66ff\u6362\u4e3a-,yyy\u4ee3\u8868\u9519\u8bef\u5173\u952e\u5b57\uff0c\u4ee5\u533a\u522b\u540c\u4e00\u4e2a\u65b9\u6cd5\u7684\u591a\u79cd\u9519\u8bef + +#\u516c\u5171\u670d\u52a1\u63a5\u53e3\u9519\u8bef +isv.common-sayhello-service-error\:COMMON_SAYHELLO_ERROR=\u83b7\u53d6\u670d\u52a1\u7aef\u5b58\u6d3b\u72b6\u6001\u5931\u8d25 +isv.session-create-service-error\:SESSION_CREATE_ERROR=\u521b\u5efaSession\u5931\u8d25 +isv.session-get-service-error\:SESSION_GET_ERROR=\u83b7\u53d6Session\u5931\u8d25 +isv.session-remove-service-error\:SESSION_REMOVE_ERROR=\u6e05\u9664Session\u5931\u8d25 + +#POS\u76f8\u5173\u63a5\u53e3\u9519\u8bef +isv.pos-setplan-service-error\:COMMON_ERROR=POS\u53c2\u6570\u65b9\u6848\u83b7\u53d6\u5931\u8d25 +isv.pos-setplan-up-service-error\:COMMON_ERROR=POS\u53c2\u6570\u65b9\u6848\u4e0a\u4f20\u5931\u8d25 +isv.pos-setplan-down-service-error\:COMMON_ERROR=POS\u53c2\u6570\u65b9\u6848\u4e0b\u8f7d\u5931\u8d25 +isv.pos-monitor-service-error\:COMMON_ERROR=POS\u76d1\u63a7\u4fe1\u606f\u4fdd\u5b58\u5931\u8d25 +isv.pos-auth-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u6388\u6743\u4fe1\u606f\u5931\u8d25 +isv.tenant-line-auth-service-error\:COMMON_ERROR=\u4e91\u7aef\u4ea7\u54c1\u65f6\u95f4\u6821\u9a8c\u5931\u8d25 +isv.erp-pos-set-service-error\:COMMON_ERROR=\u83b7\u53d6erpPOS\u53c2\u6570\u8bbe\u7f6e\u5931\u8d25 + +#\u95e8\u5e97\u4fe1\u606f\u63a5\u53e3\u9519\u8bef +isv.store-list-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u5217\u8868\u5931\u8d25 +isv.store-message-service-error\:MESSAGE_ERROR=\u83b7\u53d6\u95e8\u5e97\u4fe1\u606f\u5931\u8d25 +isv.store-paytype-service-error\:PAYTYPE_ERROR=\u4ed8\u6b3e\u7c7b\u578b\u83b7\u53d6\u5931\u8d25 +isv.store-paymode-service-error\:PAYMODE_ERROR=\u6536\u94f6\u65b9\u5f0f\u83b7\u53d6\u5931\u8d25 +isv.store-businessplan-service-error\:BUSINESSPLAN_ERROR=\u8425\u4e1a\u65e5\u65b9\u6848\u83b7\u53d6\u5931\u8d25 +isv.store-businessplan-detail-service-error\:BUSINESSPLAN_DETAIL_ERROR=\u8425\u4e1a\u65e5\u65b9\u6848\u73ed\u6b21\u83b7\u53d6\u5931\u8d25 +isv.store-table-area-service-error\:TABLE_AREA_ERROR=\u95e8\u5e97\u9910\u684c\u533a\u57df\u83b7\u53d6\u5931\u8d25 +isv.store-table-type-service-error\:TABLE_TYPE_ERROR=\u95e8\u5e97\u9910\u684c\u7c7b\u578b\u83b7\u53d6\u5931\u8d25 +isv.store-table-service-error\:TABLE_ERROR=\u95e8\u5e97\u9910\u684c\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 +isv.store-brand-service-error\:BRAND_ERROR=\u95e8\u5e97\u54c1\u724c\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 +isv.store-advert-picture-service-error\:ADVERT_PICTURE_ERROR=\u95e8\u5e97\u53cc\u5c4f\u5e7f\u544a\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.store-advert-caption-service-error\:ADVERT_CAPTION_ERROR=\u95e8\u5e97\u53cc\u5c4f\u5b57\u5e55\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.store-print-image-service-error\:PRINT_IMAGE_ERROR=\u95e8\u5e97\u5c0f\u7968\u6253\u5370\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.store-pos-list-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97POS\u4fe1\u606f\u5931\u8d25 +isv.store-feeitem-list-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u8d39\u7528\u9879\u76ee\u5217\u8868\u5931\u8d25 +isv.store-product-coupon-list-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u5546\u54c1\u4f18\u60e0\u5238\u4fe1\u606f\u5931\u8d25 +isv.store-coupon-list-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u4f18\u60e0\u5238\u5217\u8868\u5931\u8d25 +isv.store-coupon-checkout-service-error\:COMMON_ERROR=\u95e8\u5e97\u4f18\u60e0\u5238\u6838\u9500\u6821\u9a8c\u5931\u8d25 +isv.store-coupon-check-service-error\:COMMON_ERROR=\u95e8\u5e97\u4f18\u60e0\u5238\u6838\u9500\u5931\u8d25 +isv.store-sales-order-list-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u9500\u552e\u8ba2\u5355\u5217\u8868\u5931\u8d25 +isv.store-sales-day-summary-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u65e5\u8425\u4e1a\u989d\u6c47\u603b\u5931\u8d25 +isv.store-account-get-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u4f59\u989d\u8d26\u6237\u5931\u8d25 +isv.store-account-detail-list-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u4f59\u989d\u8d26\u6237\u660e\u7ec6\u5217\u8868\u5931\u8d25 +isv.store-account-detail-info-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u4f59\u989d\u8d26\u6237\u660e\u7ec6\u4fe1\u606f\u5931\u8d25 +isv.store-account-recharge-service-error\:COMMON_ERROR=\u95e8\u5e97\u4f59\u989d\u8d26\u6237\u5145\u503c\u5931\u8d25 +isv.store-account-enchashment-apply-service-error\:COMMON_ERROR=\u7533\u8bf7\u95e8\u5e97\u4f59\u989d\u63d0\u73b0\u5931\u8d25 +isv.store-account-enchashment-cancel-service-error\:COMMON_ERROR=\u53d6\u6d88\u95e8\u5e97\u4f59\u989d\u63d0\u73b0\u7533\u8bf7\u5931\u8d25 +isv.store-account-enchashment-list-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u4f59\u989d\u63d0\u73b0\u5217\u8868\u5931\u8d25 +isv.store-account-enchashment-info-service-error\:COMMON_ERROR=\u67e5\u8be2\u95e8\u5e97\u4f59\u989d\u8d26\u6237\u63d0\u73b0\u4fe1\u606f\u8be6\u60c5\u5931\u8d25 +isv.store-account-recharge-parameter-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u8d26\u6237\u5145\u503c\u53c2\u6570\u5931\u8d25 +isv.store-account-recharge-wxpay-unifiedorder-service-error\:COMMON_ERROR=\u95e8\u5e97\u4f59\u989d\u8d26\u6237\u5fae\u4fe1\u5145\u503c\u7edf\u4e00\u4e0b\u5355\u5931\u8d25 +isv.store-account-recharge-wxpay-orderquery-service-error\:COMMON_ERROR=\u95e8\u5e97\u4f59\u989d\u8d26\u6237\u5fae\u4fe1\u5145\u503c\u67e5\u8be2\u8ba2\u5355\u5931\u8d25 +isv.store-dispatch-settle-plan-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u914d\u9001\u7ed3\u7b97\u65b9\u6848\u5931\u8d25 +isv.store-product-burden-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u5546\u54c1\u914d\u65b9\u5931\u8d25 +isv.store-make-burden-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u505a\u6cd5\u914d\u65b9\u5931\u8d25 + +#\u5361\u52a1\u95e8\u5e97\u540c\u6b65\u63a5\u53e3\u9519\u8bef +isv.cardsync-store-type-service-error\:STORE_TYPE_ERROR=\u95e8\u5e97\u7c7b\u578b\u83b7\u53d6\u5931\u8d25 +isv.cardsync-store-message-service-error\:STORE_MESSAGE_ERROR=\u95e8\u5e97\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 +isv.cardsync-store-worker-service-error\:STORE_WORKER_ERROR=\u95e8\u5e97\u5458\u5de5\u83b7\u53d6\u5931\u8d25 +isv.cardsync-worker-store-service-error\:WORKER_STORE_ERROR=\u5458\u5de5\u53ef\u767b\u9646\u95e8\u5e97\u83b7\u53d6\u5931\u8d25 +isv.cardsync-store-pos-service-error\:STORE_POS_ERROR=\u95e8\u5e97POS\u83b7\u53d6\u5931\u8d25 +isv.cardsync-store-paytype-service-error\:STORE_PAYTYPE_ERROR=\u95e8\u5e97\u6536\u94f6\u65b9\u5f0f\u83b7\u53d6\u5931\u8d25 +isv.cardsync-product-type-service-error\:COMMON_ERROR=\u5546\u54c1\u7c7b\u522b\u83b7\u53d6\u5931\u8d25 +isv.cardsync-product-list-service-error\:COMMON_ERROR=\u5546\u54c1\u5217\u8868\u83b7\u53d6\u5931\u8d25 + +#\u83dc\u54c1\u4fe1\u606f\u63a5\u53e3\u9519\u8bef +isv.product-maketype-service-error\:MAKETYPE_ERROR=\u95e8\u5e97\u505a\u6cd5\u7c7b\u578b\u83b7\u53d6\u5931\u8d25 +isv.product-makedetail-service-error\:MAKEDETAIL_ERROR=\u95e8\u5e97\u505a\u6cd5\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 +isv.product-dishunit-service-error\:UNIT_ERROR=\u5546\u54c1\u5355\u4f4d\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 +isv.product-type-service-error\:TYPE_ERROR=\u5546\u54c1\u7c7b\u522b\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 +isv.product-list-service-error\:LIST_ERROR=\u5546\u54c1\u8d44\u6599\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 +isv.product-spec-service-error\:SPEC_ERROR=\u5546\u54c1\u89c4\u683c\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 +isv.product-images-service-error\:IMAGES_ERROR=\u83dc\u54c1\u56fe\u7247\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 +isv.product-ratio-service-error\:RATIO_ERROR=\u5546\u54c1\u7cfb\u6570\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 +isv.product-private-makedetail-service-error\:COMMON_ERROR=\u83b7\u53d6\u5546\u54c1\u79c1\u6709\u505a\u6cd5\u5931\u8d25 +isv.product-suit-service-error\:SUIT_ERROR=\u83b7\u53d6\u5546\u54c1\u5957\u83dc\u4fe1\u606f\u5931\u8d25 +isv.product-brand-service-error\:SUIT_ERROR=\u83b7\u53d6\u54c1\u724c\u4fe1\u606f\u5931\u8d25 +isv.product-store-brand-service-error\:SUIT_ERROR=\u83b7\u53d6\u5546\u54c1\u54c1\u724c\u4fe1\u606f\u5931\u8d25 +isv.store-product-brand-service-error\:SUIT_ERROR=\u83b7\u53d6\u5546\u54c1\u54c1\u724c\u4fe1\u606f\u5931\u8d25 + +#\u5458\u5de5\u4fe1\u606f\u63a5\u53e3\u9519\u8bef +isv.worker-login-service-error\:LOGIN_ERROR=\u5458\u5de5\u767b\u5f55\u9a8c\u8bc1\u5931\u8d25 +isv.worker-list-service-error\:LIST_ERROR=\u95e8\u5e97\u53ef\u767b\u9646\u5458\u5de5\u83b7\u53d6\u5931\u8d25 +isv.worker-posrole-service-error\:POSROLE_ERROR=\u5458\u5de5POS\u89d2\u8272\u6743\u9650\u83b7\u53d6\u5931\u8d25 +isv.worker-posmodule-service-error\:POSMODULE_ERROR=\u5458\u5de5POS\u6a21\u5757\u6743\u9650\u83b7\u53d6\u5931\u8d25 +isv.worker-update-pwd-service-error\:COMMON_ERROR=\u5458\u5de5\u4fee\u6539\u95e8\u5e97\u767b\u9646\u5bc6\u7801\u5931\u8d25 + +#\u6570\u636e\u4e0a\u4f20\u63a5\u53e3\u9519\u8bef +isv.upload-business-order-service-error\:BUSINESS_ORDER_ERROR=\u9500\u552e\u6570\u636e\u4e0a\u4f20\u5931\u8d25 +isv.upload-business-revenue-service-error\:BUSINESS_REVENUE_ERROR=\u975e\u8425\u4e1a\u6536\u5165\u6570\u636e\u4e0a\u4f20\u5931\u8d25 +isv.upload-business-handover-service-error\:BUSINESS_HANDOVER_ERROR=\u4ea4\u73ed\u6570\u636e\u4e0a\u4f20\u5931\u8d25 +isv.upload-business-order-extend-service-error\:COMMON_ERROR=\u9500\u552e\u6570\u636e\u4e0a\u4f20\u5931\u8d25 +isv.upload-business-order-plus-service-error\:COMMON_ERROR=\u9500\u552e\u6570\u636e\u4e0a\u4f20\u5931\u8d25 +isv.upload-business-order-burden-service-error\:COMMON_ERROR=\u8017\u6599\u6570\u636e\u4e0a\u4f20\u5931\u8d25 + +#\u652f\u4ed8\u4fe1\u606f\u9519\u8bef +isv.pay-get-parameter-service-error\:GET_PARAMETER_ERROR=\u652f\u4ed8\u53c2\u6570\u6570\u636e\u4e0b\u8f7d\u5931\u8d25 + +#\u53a8\u6253\u76f8\u5173\u63a5\u53e3\u9519\u8bef +isv.kit-plan-service-error\:PLAN_ERROR=\u53a8\u6253\u65b9\u6848\u6570\u636e\u4e0b\u8f7d\u5931\u8d25 +isv.kit-product-service-error\:PRODUCT_ERROR=\u83dc\u54c1\u53a8\u6253\u5173\u8054\u6570\u636e\u4e0b\u8f7d\u5931\u8d25 + +#\u53a8\u663e\u76f8\u5173\u63a5\u53e3\u9519\u8bef +isv.kds-plan-service-error\:PLAN_ERROR=\u53a8\u663e\u65b9\u6848\u6570\u636e\u4e0b\u8f7d\u5931\u8d25 +isv.kds-product-service-error\:PRODUCT_ERROR=\u83dc\u54c1\u53a8\u663e\u5173\u8054\u6570\u636e\u4e0b\u8f7d\u5931\u8d25 + +#\u95e8\u5e97\u5e93\u5b58\u7ba1\u7406\u76f8\u5173\u63a5\u53e3\u9519\u8bef +isv.store-storage-service-error\:STORAGE_ERROR=\u95e8\u5e97\u4ed3\u5e93\u6570\u636e\u4e0b\u8f7d\u5931\u8d25 +isv.store-askgoods-ticket-service-error\:ASKGOODS_TICKET_ERROR=\u83b7\u53d6\u95e8\u5e97\u8981\u8d27\u5355\u4fe1\u606f\u5931\u8d25 +isv.store-waitSendAskgoods-ticket-service-error\:ASKGOODS_TICKET_ERROR=\u83b7\u53d6\u95e8\u5e97\u8981\u8d27\u5355\u4fe1\u606f\u5931\u8d25 +isv.store-askgoods-detail-service-error\:ASKGOODS_DETAIL_ERROR=\u83b7\u53d6\u95e8\u5e97\u8981\u8d27\u5355\u660e\u7ec6\u5931\u8d25 +isv.store-product-dispatchprice-service-error\:PRODUCT_DISPATCHPRICE_ERROR=\u83b7\u53d6\u95e8\u5e97\u5546\u54c1\u914d\u9001\u4ef7\u683c\u5931\u8d25 +isv.store-askgoods-ticket-add-service-error\:ASKGOODS_TICKET_ADD_ERROR=\u65b0\u589e\u8981\u8d27\u5355\u4fe1\u606f\u5931\u8d25 +isv.store-askgoods-ticket-edit-service-error\:ASKGOODS_TICKET_EDIT_ERROR=\u4fee\u6539\u8981\u8d27\u5355\u4fe1\u606f\u5931\u8d25 +isv.store-askgoods-ticket-status-service-error\:ASKGOODS_TICKET_STATUS_ERROR=\u8981\u8d27\u5355\u72b6\u6001\u53d8\u66f4\u5931\u8d25 +isv.store-askgoods-detial-remove-service-error\:ASKGOODS_DETIAL_REMOVE_ERROR=\u5220\u9664\u8981\u8d27\u5355\u6307\u5b9a\u5546\u54c1\u5931\u8d25 +isv.store-product-stock-service-error\:PRODUCT_STOCK_ERROR=\u5546\u54c1\u5e93\u5b58\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.store-askgoods-template-list-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u8981\u8d27\u6a21\u677f\u4fe1\u606f\u5931\u8d25 +isv.store-askgoods-template-detail-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u8981\u8d27\u6a21\u677f\u660e\u7ec6\u4fe1\u606f\u5931\u8d25 +isv.store-product-stock-sum-service-error\:COMMON_ERROR=\u83b7\u53d6\u5546\u54c1\u95e8\u5e97\u5e93\u5b58\u603b\u6570\u5931\u8d25 +isv.store-dispatch-ticket-service-error\:COMMON_ERROR=\u83b7\u53d6\u914d\u9001\u5355\u4fe1\u606f\u5931\u8d25 +isv.store-dispatch-ticket-detail-service-error\:COMMON_ERROR=\u83b7\u53d6\u914d\u9001\u5355\u660e\u7ec6\u4fe1\u606f\u5931\u8d25 +isv.store-dispatch-ticket-receive-service-error\:COMMON_ERROR=\u914d\u9001\u5355\u9a8c\u6536\u64cd\u4f5c\u5931\u8d25 +isv.store-storage-ticket-type-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u5165\u5e93/\u51fa\u5e93\u7c7b\u578b\u5931\u8d25 +isv.store-storage-ticket-add-service-error\:COMMON_ERROR=\u65b0\u589e\u95e8\u5e97\u5165\u5e93\u5355\u5931\u8d25 +isv.store-storage-ticket-edit-service-error\:COMMON_ERROR=\u4fee\u6539\u95e8\u5e97\u5165\u5e93\u5355\u5931\u8d25 +isv.store-storage-ticket-status-change-service-error\:COMMON_ERROR=\u95e8\u5e97\u5165\u5e93\u5355\u72b6\u6001\u53d8\u66f4\u5931\u8d25 +isv.store-storage-ticket-list-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u5165\u5e93\u5355\u5931\u8d25 +isv.store-storage-ticket-detail-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u5165\u5e93\u5355\u660e\u7ec6\u5931\u8d25 +isv.store-storage-out-ticket-add-service-error\:COMMON_ERROR=\u65b0\u589e\u95e8\u5e97\u51fa\u5e93\u5355\u5931\u8d25 +isv.store-storage-out-ticket-edit-service-error\:COMMON_ERROR=\u4fee\u6539\u95e8\u5e97\u51fa\u5e93\u5355\u5931\u8d25 +isv.store-storage-out-ticket-status-change-service-error\:COMMON_ERROR=\u95e8\u5e97\u51fa\u5e93\u5355\u72b6\u6001\u53d8\u66f4\u5931\u8d25 +isv.store-storage-out-ticket-list-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u51fa\u5e93\u5355\u5931\u8d25 +isv.store-storage-out-ticket-detail-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u51fa\u5e93\u5355\u660e\u7ec6\u5931\u8d25 +isv.store-product-stock-out-summary-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u5546\u54c1\u5e93\u5b58\u6d88\u8017(\u51fa\u5e93)\u6c47\u603b\u5931\u8d25 +isv.store-stock-check-ticket-add-service-error\:COMMON_ERROR=\u65b0\u589e\u95e8\u5e97\u76d8\u70b9\u5355\u5931\u8d25 +isv.store-stock-uncheck-ticket-detail-service-error\:COMMON_ERROR=\u83b7\u53d6\u672a\u5ba1\u6838\u7684\u76d8\u70b9\u5355\u660e\u7ec6\u4fe1\u606f\u5217\u8868\u5931\u8d25 +isv.store-stock-check-ticket-detail-del-service-error\:COMMON_ERROR=\u5220\u9664\u95e8\u5e97\u5e93\u5b58\u76d8\u70b9\u660e\u7ec6\u5931\u8d25 +isv.store-stock-uncheck-ticket-detail-update-service-error\:COMMON_ERROR=\u66f4\u65b0\u672a\u5ba1\u6838\u7684\u76d8\u70b9\u5355\u660e\u7ec6\u4fe1\u606f\u5931\u8d25 +isv.store-stock-uncheck-ticket-status-update-service-error\:COMMON_ERROR=\u66f4\u65b0\u672a\u5ba1\u6838\u7684\u76d8\u70b9\u5355\u72b6\u6001\u5931\u8d25 +isv.store-stock-check-product-valid-service-error\:COMMON_ERROR=\u83b7\u53d6\u53ef\u76d8\u70b9\u5546\u54c1\u4fe1\u606f\u5217\u8868\u5931\u8d25 +isv.store-stock-check-template-list-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u76d8\u70b9\u6a21\u677f\u5217\u8868\u5931\u8d25 +isv.store-stock-check-template-detail-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u76d8\u70b9\u6a21\u677f\u660e\u7ec6\u4fe1\u606f\u5931\u8d25 +isv.store-stock-check-summary-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u76d8\u70b9\u5206\u6790\u4fe1\u606f\u5931\u8d25 +isv.store-recharge-parameter-list-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u5145\u503c\u53c2\u6570\u65b9\u6848\u5217\u8868\u5931\u8d25 +isv.store-receiveDifference-ticket-service-error\:RECEIVE_DIFFERENCE_TICKET_ERROR=\u83b7\u53d6\u914d\u9001\u9a8c\u6536\u5dee\u5f02\u4fe1\u606f\u5931\u8d25 +isv.store-receiveDifference-detail-service-error\:RECEIVE_DIFFERENCE_DETAIL_ERROR=\u83b7\u53d6\u914d\u9001\u9a8c\u6536\u5dee\u5f02\u8be6\u60c5\u4fe1\u606f\u5931\u8d25 +isv.store-askgoods-template-add-service-error\:ASKGOODS_TEMPLATE_ADD_ERROR=\u8981\u8d27\u6a21\u677f\u65b0\u589e\u5931\u8d25 +isv.store-askgoods-template-edit-service-error\:ASKGOODS_TEMPLATE_EDIT_ERROR=\u8981\u8d27\u6a21\u677f\u4fee\u6539\u5931\u8d25 +#\u95e8\u5e97\u8c03\u4ef7\u63a5\u53e3\u9519\u8bef +isv.store-adjustPrice-ticket-service-error\:STORE_ADJUSTPRICE_TICKET_ERROR=\u83b7\u53d6\u8c03\u4ef7\u5355\u4fe1\u606f\u5931\u8d25 +isv.store-adjustPrice-detail-service-error\:STORE_ADJUSTPRICE_DETAIL_ERROR=\u83b7\u53d6\u8c03\u4ef7\u5355\u8be6\u60c5\u4fe1\u606f\u5931\u8d25 +isv.store-adjustPrice-add-service-error\:STORE_ADJUSTPRICE_ADD_ERROR=\u65b0\u589e\u95e8\u5e97\u8c03\u4ef7\u5355\u5931\u8d25 +isv.store-adjustPrice-edit-service-error\:STORE_ADJUSTPRICE_EDIT_ERROR=\u7f16\u8f91\u95e8\u5e97\u8c03\u4ef7\u5355\u5931\u8d25 +isv.store-adjustPrice-audit-service-error\:STORE_ADJUSTPRICE_AUDIT_ERROR=\u5ba1\u6838\u95e8\u5e97\u8c03\u4ef7\u5355\u5931\u8d25 + +#\u5916\u8bbe\u76f8\u5173 +isv.peripheral-card-reader-info-service-error\:CARD_READER_INFO=\u83b7\u53d6\u8bfb\u5361\u5668\u4fe1\u606f\u5931\u8d25 +isv.peripheral-printer-info-service-error\:PRINTER_INFO_INFO=\u95e8\u5e97\u4ed3\u5e93\u6570\u636e\u4e0b\u8f7d\u5931\u8d25 + +#\u5fae\u4fe1\u638c\u67dc\u52a9\u624b\u63a5\u53e3\u9519\u8bef +isv.weixin-worker-store-service-error\:WORKER_STORE_ERROR=\u5458\u5de5\u95e8\u5e97\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.weixin-day-summary-service-error\:DAY_SUMMARY_ERROR=\u95e8\u5e97\u65e5\u8425\u4e1a\u6c47\u603b\u83b7\u53d6\u5931\u8d25 +isv.weixin-day-summary-list-service-error\:DAY_SUMMARY_LIST_ERROR=\u95e8\u5e97\u65e5\u8425\u4e1a\u6c47\u603b\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.weixin-product-rank-service-error\:PRODUCT_RANK_ERROR=\u95e8\u5e97\u9500\u552e\u6392\u884c\u83b7\u53d6\u5931\u8d25 +isv.weixin-order-summary-list-service-error\:ORDER_SUMMARY_LIST_ERROR=\u9500\u552e\u6c47\u603b\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.weixin-category-summary-list-service-error\:CATEGORY_SUMMARY_LIST_ERROR=\u7c7b\u522b\u9500\u552e\u6c47\u603b\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.weixin-time-summary-list-service-error\:TIME_SUMMARY_LIST_ERROR=\u65f6\u6bb5\u9500\u552e\u6c47\u603b\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.weixin-pay-summary-list-service-error\:PAY_SUMMARY_LIST_ERROR=\u652f\u4ed8\u65b9\u5f0f\u6c47\u603b\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.weixin-gross-profit-analysis-service-error\:COMMON_ERROR=\u9500\u552e\u6bdb\u5229\u5206\u6790\u6570\u636e\u83b7\u53d6\u5931\u8d25 +isv.weixin-product-sales-summary-service-error\:COMMON_ERROR=\u4ea7\u54c1\u9500\u552e\u6c47\u603b\u83b7\u53d6\u5931\u8d25 +isv.weixin-waimai-order-statistics-service-error\:COMMON_ERROR=\u5916\u5356\u6c47\u603b\u6570\u636e\u83b7\u53d6\u5931\u8d25 +isv.weixin-day-summary-list-rank-service-error\:DAY_SUMMARY_ERROR=\u95e8\u5e97\u65e5\u8425\u4e1a\u6c47\u603b\u83b7\u53d6\u5931\u8d25 +isv.weixin-worker-module-service-error\:DAY_SUMMARY_ERROR=\u83b7\u53d6\u638c\u67dc\u67e5\u8be2\u5458\u5de5\u6743\u9650\u5931\u8d25 +#\u719f\u5ba2\u4fe1\u606f +isv.visitor-list-service-error\:LIST_ERROR=\u719f\u5ba2\u4fe1\u606f\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.visitor-address-list-service-error\:LIST_ERROR=\u719f\u5ba2\u5730\u5740\u4fe1\u606f\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.visitor-tag-list-service-error\:LIST_ERROR=\u719f\u5ba2\u6807\u7b7e\u4fe1\u606f\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.visitor-add-service-error\:COMMON_ERROR=\u65b0\u589e\u719f\u5ba2\u4fe1\u606f\u5931\u8d25 +isv.visitor-update-service-error\:COMMON_ERROR=\u4fee\u6539\u719f\u5ba2\u4fe1\u606f\u5931\u8d25 +isv.visitor-info-service-error\:COMMON_ERROR=\u67e5\u8be2\u719f\u5ba2\u4fe1\u606f\u5931\u8d25 + +#\u57ce\u5e02\u4fe1\u606f +isv.city-info-list-service-error\:COMMON_ERROR=\u57ce\u5e02\u4fe1\u606f\u5217\u8868\u83b7\u53d6\u5931\u8d25 + +#\u5fae\u4fe1\u70b9\u9910 +isv.wxdc-ad-picture-list-service-error\:COMMON_ERROR=\u5e7f\u544a\u56fe\u7247\u83b7\u53d6\u5931\u8d25 +isv.wxdc-store-list-service-error\:COMMON_ERROR=\u95e8\u5e97\u4fe1\u606f\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.wxdc-store-list-bywid-service-error\:COMMON_ERROR=\u95e8\u5e97\u4fe1\u606f\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.wxdc-store-info-service-error\:COMMON_ERROR=\u95e8\u5e97\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 +isv.wxdc-goods-category-list-service-error\:COMMON_ERROR=\u5546\u54c1\u5206\u7c7b\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 +isv.wxdc-goods-category-service-error\:COMMON_ERROR=\u5546\u54c1\u5206\u7c7b\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 +isv.wxdc-goods-list-service-error\:COMMON_ERROR=\u5546\u54c1\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 +isv.wxdc-goods-make-list-service-error\:COMMON_ERROR=\u5546\u54c1\u505a\u6cd5\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.wxdc-sales-order-create-service-error\:COMMON_ERROR=\u9500\u552e\u8ba2\u5355\u521b\u5efa\u5931\u8d25 +isv.wxdc-sales-order-list-service-error\:COMMON_ERROR=\u9500\u552e\u8ba2\u5355\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.wxdc-sales-order-info-service-error\:COMMON_ERROR=\u9500\u552e\u8ba2\u5355\u8be6\u60c5\u83b7\u53d6\u5931\u8d25 +isv.wxdc-store-pay-parameter-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u652f\u4ed8\u53c2\u6570\u5931\u8d25 +isv.wxdc-sales-order-cancel-service-error\:COMMON_ERROR=\u9500\u552e\u8ba2\u5355\u53d6\u6d88\u5931\u8d25 +isv.wxdc-store-order-list-service-error\:COMMON_ERROR=\u95e8\u5e97\u8ba2\u5355\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.wxdc-store-order-confirm-service-error\:COMMON_ERROR=\u95e8\u5e97\u786e\u8ba4\u8ba2\u5355\u5931\u8d25 +isv.wxdc-store-order-cancel-service-error\:COMMON_ERROR=\u95e8\u5e97\u53d6\u6d88\u8ba2\u5355\u5931\u8d25 +isv.wxdc-store-order-delivery-service-error\:COMMON_ERROR=\u95e8\u5e97\u786e\u8ba4\u9001\u8fbe\u5931\u8d25 +isv.wxdc-store-open-status-update-service-error\:COMMON_ERROR=\u95e8\u5e97\u8425\u4e1a\u72b6\u6001\u4fee\u6539,\u64cd\u4f5c\u5931\u8d25 +isv.wxdc-order-refund-user-apply-service-error\:COMMON_ERROR=\u7528\u6237\u7533\u8bf7\u9000\u6b3e,\u64cd\u4f5c\u5931\u8d25 +isv.wxdc-order-refund-store-refuse-service-error\:COMMON_ERROR=\u95e8\u5e97\u62d2\u7edd\u9000\u6b3e,\u64cd\u4f5c\u5931\u8d25 +isv.wxdc-order-refund-store-agree-service-error\:COMMON_ERROR=\u95e8\u5e97\u540c\u610f\u9000\u6b3e,\u64cd\u4f5c\u5931\u8d25 +isv.wxdc-goods-info-service-error\:COMMON_ERROR=\u83b7\u53d6\u5546\u54c1\u8be6\u7ec6\u4fe1\u606f\u5931\u8d25 +isv.wxdc-goods-sellout-service-error\:COMMON_ERROR=\u5fae\u4fe1\u5546\u54c1\u505c\u552e\u5931\u8d25 +isv.wxdc-goods-sellin-service-error\:COMMON_ERROR=\u5fae\u4fe1\u5546\u54c1\u5f00\u5356\u5931\u8d25 + +#\u4fc3\u9500\u76f8\u5173 +isv.promotion-type-list-service-error\:COMMON_ERROR=\u83b7\u53d6\u4fc3\u9500\u7c7b\u578b\u5931\u8d25 +isv.promotion-store-task-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u4fc3\u9500\u4efb\u52a1\u5217\u8868\u5931\u8d25 + +#\u5c0f\u7a0b\u5e8f\u8981\u8d27\u76f8\u5173 +isv.wxyh-goods-list-service-error\:COMMON_ERROR=\u83b7\u53d6\u5546\u54c1\u5931\u8d25 +isv.wxyh-goods-category-list-service-error\:COMMON_ERROR=\u83b7\u53d6\u54c1\u7c7b\u5931\u8d25 + +#\u5de8\u4e3a\u4e91\u7ba1\u5bb6\u76f8\u5173 +isv.ygj-store-set-service-error\:COMMON_ERROR=\u83b7\u53d6\u5de8\u4e3a\u4e91\u7ba1\u5bb6\u95e8\u5e97\u8bbe\u7f6e\u5931\u8d25 +isv.ygj-worker-module-service-error\:COMMON_ERROR=\u83b7\u53d6\u5de8\u4e3a\u4e91\u7ba1\u5bb6\u5458\u5de5\u6743\u9650\u5931\u8d25 +isv.ygj-add-product-check-service-error\:COMMON_ERROR=\u4e91\u7ba1\u5bb6\u5546\u54c1\u65b0\u5efa\u6821\u9a8c\u5931\u8d25 +isv.ygj-add-product-service-error\:COMMON_ERROR=\u4e91\u7ba1\u5bb6\u5546\u54c1\u65b0\u5efa\u5931\u8d25 +isv.ygj-add-suit-service-error\:COMMON_ERROR=\u4e91\u7ba1\u5bb6\u5957\u9910\u521b\u5efa\u5931\u8d25 +isv.ygj-edit-product-service-error\:COMMON_ERROR=\u4e91\u7ba1\u5bb6\u5546\u54c1\u4fee\u6539\u5931\u8d25 +isv.store-shelfed-goods-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u81ea\u5efa\u5546\u54c1\u4fe1\u606f\u5217\u8868\u5931\u8d25 +isv.ygj-product-type-service-error\:COMMON_ERROR=\u95e8\u5e97\u5546\u54c1\u5206\u7c7b\u83b7\u53d6\u5931\u8d25 +isv.ygj-material-type-service-error\:COMMON_ERROR=\u95e8\u5e97\u539f\u6599\u5206\u7c7b\u83b7\u53d6\u5931\u8d25 +isv.ygj-product-type-more-service-error\:COMMON_ERROR=\u95e8\u5e97\u5546\u54c1\u5206\u7c7b\u83b7\u53d6\u5931\u8d25 +isv.ygj-product-type-check-service-error\:COMMON_ERROR=\u95e8\u5e97\u5546\u54c1\u5206\u7c7b\u83b7\u53d6\u5931\u8d25 +isv.ygj-product-stock-check-service-error\:COMMON_ERROR=\u5546\u54c1\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 +isv.ygj-store-account-summary-service-error\:COMMON_ERROR=\u95e8\u5e97\u8d26\u53f7\u6c47\u603b\u83b7\u53d6\u5931\u8d25 +#\u5916\u5356\u76f8\u5173 +isv.waimai-order-statistics-service-error\:COMMON_ERROR=\u83b7\u53d6\u5916\u5356\u8ba2\u5355\u7edf\u8ba1\u5931\u8d25 + +#\u5efa\u884c\u4e92\u8054\u7f51\u652f\u4ed8\u76f8\u5173 +isv.ccb-pay-ccbparam-get-service-error\:COMMON_ERROR=\u83b7\u53d6\u8bf7\u6c42\u52a0\u5bc6\u5b57\u7b26\u4e32\u5931\u8d25 + +#\u535a\u591aerp\u63a5\u53e3 +isv.erp-material-unit-error\:COMMON_ERROR=\u4eceerp\u4e2d\u83b7\u53d6\u539f\u6599\u5355\u4f4d\u5931\u8d25 +isv.sync-material-type-error\:COMMON_ERROR=\u540c\u6b65\u539f\u6599\u5206\u7c7b\u8d44\u6599\u5931\u8d25 +isv.sync-material-unit-error\:COMMON_ERROR=\u540c\u6b65\u539f\u6599\u5355\u4f4d\u8d44\u6599\u5931\u8d25 +isv.sync-material-error\:COMMON_ERROR=\u540c\u6b65\u539f\u6599\u8d44\u6599\u5931\u8d25 +isv.boduo-product-list-error\:COMMON_ERROR=\u5546\u54c1\u8d44\u6599\u83b7\u53d6\u5931\u8d25 +isv.boduo-product-spec-error\:COMMON_ERROR=\u5546\u54c1\u89c4\u683c\u83b7\u53d6\u5931\u8d25 +isv.boduo-product-ratio-error\:COMMON_ERROR=\u5546\u54c1\u5e93\u5b58\u7cfb\u6570\u83b7\u53d6\u5931\u8d25 + +#\u7f8e\u98df\u5e7f\u573a\u76f8\u5173 +isv.vpos-product-type-label-service-error\:COMMON_ERROR=\u83b7\u53d6\u5206\u7c7b\u6807\u7b7e\u5931\u8d25 +isv.vpos-product-type-service-error\:COMMON_ERROR=\u83b7\u53d6\u5927\u7c7b\u6570\u636e\u5931\u8d25 +isv.vpos-product-type-two-service-error\:COMMON_ERROR=\u83b7\u53d6\u5c0f\u7c7b\u6570\u636e\u5931\u8d25 +isv.vpos-product-service-error\:COMMON_ERROR=\u83b7\u53d6\u5546\u54c1\u6570\u636e\u5931\u8d25 +isv.vpos-order-create-service-error\:COMMON_ERROR=\u8ba2\u5355\u521b\u5efa\u5931\u8d25 +isv.vpos-order-pay-service-error\:COMMON_ERROR=\u8ba2\u5355\u652f\u4ed8\u4e0a\u4f20\u5931\u8d25 +isv.vpos-order-list-error\:COMMON_ERROR=\u8ba2\u5355\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 +isv.vpos-weixin-pay-error\:COMMON_ERROR=\u5fae\u4fe1JSAPI\u652f\u4ed8\u9519\u8bef +isv.vpos-weixin-pay-query-error\:COMMON_ERROR=\u5fae\u4fe1\u652f\u4ed8\u7ed3\u679c\u67e5\u8be2\u5931\u8d25 +isv.vpos-order-cancel-error\:COMMON_ERROR=\u8ba2\u5355\u53d6\u6d88\u5931\u8d25 +isv.vpos-order-detail-error\:COMMON_ERROR=\u8ba2\u5355\u660e\u7ec6\u83b7\u53d6\u5931\u8d25 +isv.vpos-order-edit-error\:COMMON_ERROR=\u8ba2\u5355\u4fee\u6539\u5931\u8d25 +isv.vpos-order-refund-error\:COMMON_ERROR=\u8ba2\u5355\u9000\u6b3e\u5931\u8d25 +isv.vpos-product-stock-error\:COMMON_ERROR=\u5546\u54c1\u5e93\u5b58\u6821\u9a8c\u5931\u8d25 +isv.vpos-order-refund-part-error\:COMMON_ERROR=\u8ba2\u5355\u9000\u6b3e\u5931\u8d25 +#\u7ecf\u8425\u4f1a\u8ba1\u62a5\u8868 +isv.store-cost-ticket-error\:COMMON_ERROR=\u7ecf\u8425\u4f1a\u8ba1\u62a5\u8868\u83b7\u53d6\u5931\u8d25 +isv.store-cost-ticket-detail-error\:COMMON_ERROR=\u7ecf\u8425\u4f1a\u8ba1\u62a5\u8868\u83b7\u53d6\u5931\u8d25 +isv.store-cost-ticket-save-error\:COMMON_ERROR=\u7ecf\u8425\u4f1a\u8ba1\u62a5\u8868\u4fdd\u5b58\u5931\u8d25 +isv.store-cost-ticket-update-error\:COMMON_ERROR=\u7ecf\u8425\u4f1a\u8ba1\u62a5\u8868\u66f4\u65b0\u5931\u8d25 +isv.store-cost-ticket-updatestatus-error\:COMMON_ERROR=\u7ecf\u8425\u4f1a\u8ba1\u62a5\u8868\u72b6\u6001\u53d8\u66f4\u5931\u8d25 +#\u5de8\u4e3a\u5c0f\u7a0b\u5e8f +isv.program-store-list-sync-service-error\:COMMON_ERROR=\u95e8\u5e97\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.program-store-list-service-error\:COMMON_ERROR=\u95e8\u5e97\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.program-store-detail-service-error\:COMMON_ERROR=\u95e8\u5e97\u8be6\u60c5\u83b7\u53d6\u5931\u8d25 +isv.program-store-stop-service-error\:COMMON_ERROR=\u95e8\u5e97\u505c\u4e1a\u5931\u8d25 +isv.program-store-open-service-error\:COMMON_ERROR=\u95e8\u5e97\u5f00\u4e1a\u5931\u8d25 + +isv.program-useraddress-create-service-error\:COMMON_ERROR=\u7528\u6237\u5730\u5740\u6dfb\u52a0\u5931\u8d25 +isv.program-useraddress-update-service-error\:COMMON_ERROR=\u7528\u6237\u5730\u5740\u4fee\u6539\u5931\u8d25 +isv.program-useraddress-list-service-error\:COMMON_ERROR=\u7528\u6237\u5730\u5740\u5220\u9664\u5931\u8d25 +isv.program-useraddress-delete-service-error\:COMMON_ERROR=\u7528\u6237\u5730\u5740\u5217\u8868\u83b7\u53d6\u5931\u8d25 + +isv.program-product-service-error\:COMMON_ERROR=\u95e8\u5e97\u5546\u54c1\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 + +isv.program-order-create-service-error\:COMMON_ERROR=\u7528\u6237\u8ba2\u5355\u521b\u5efa\u5931\u8d25 +isv.program-order-list-service-error\:COMMON_ERROR=\u7528\u6237\u8ba2\u5355\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.program-order-detail-service-error\:COMMON_ERROR=\u7528\u6237\u8ba2\u5355\u8be6\u60c5\u83b7\u53d6\u5931\u8d25 +isv.program-weixin-pay-service-error\:COMMON_ERROR=\u7528\u6237\u5fae\u4fe1\u652f\u4ed8\u7edf\u4e00\u4e0b\u5355\u5931\u8d25 +isv.program-weixin-pay-query-service-error\:COMMON_ERROR=\u7528\u6237\u5fae\u4fe1\u652f\u4ed8\u72b6\u6001\u67e5\u8be2\u5931\u8d25 +isv.program-order-query-bybusno-service-error\:COMMON_ERROR=\u6839\u636e\u8ba2\u5355\u53f7\u83b7\u53d6\u8ba2\u5355\u4fe1\u606f +isv.program-order-confirm-service-error\:COMMON_ERROR=\u5546\u5bb6\u63a5\u5355\u5931\u8d25 +isv.program-order-cancel-service-error\:COMMON_ERROR=\u5546\u5bb6\u62d2\u5355\u5931\u8d25 +isv.program-order-refundagree-service-error\:COMMON_ERROR=\u5546\u5bb6\u540c\u610f\u9000\u6b3e\u5931\u8d25 +isv.program-order-refundreject-service-error\:COMMON_ERROR=\u5546\u5bb6\u62d2\u5355\u9000\u6b3e\u5931\u8d25 +isv.program-handle-order-service-error\:COMMON_ERROR=\u5546\u5bb6\u83b7\u53d6\u5f85\u5904\u7406\u8ba2\u5355\u5931\u8d25 +isv.program-list-order-service-error\:COMMON_ERROR=\u5546\u5bb6\u83b7\u8ba2\u5355\u5217\u8868\u5931\u8d25 +isv.program-order-pay-service-error\:COMMON_ERROR=\u7528\u6237\u4f1a\u5458\u5361\u652f\u4ed8\u4fe1\u606f\u4e0a\u4f20\u5931\u8d25 +isv.program-order-refundapply-service-error\:COMMON_ERROR=\u7528\u6237\u7533\u8bf7\u9000\u6b3e\u5931\u8d25 +isv.program-order-edit-service-error\:COMMON_ERROR=\u4fee\u6539\u8ba2\u5355\u4fe1\u606f\u5931\u8d25 + diff --git a/food-open/food-open-api/src/main/resources/logback.xml b/food-open/food-open-api/src/main/resources/logback.xml new file mode 100644 index 0000000..3f84b06 --- /dev/null +++ b/food-open/food-open-api/src/main/resources/logback.xml @@ -0,0 +1,33 @@ + + + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%-5level] %logger{120} - %msg %n + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/food-open/food-open-api/src/main/resources/templates/error/404.ftl b/food-open/food-open-api/src/main/resources/templates/error/404.ftl new file mode 100644 index 0000000..0254b6e --- /dev/null +++ b/food-open/food-open-api/src/main/resources/templates/error/404.ftl @@ -0,0 +1,20 @@ + + + + + + +<@spring.message "project.name"/> + + +"> + + + + + +404 +点我返回首页 + + diff --git a/food-open/food-open-api/src/main/resources/templates/error/4xx.ftl b/food-open/food-open-api/src/main/resources/templates/error/4xx.ftl new file mode 100644 index 0000000..cfc7fd8 --- /dev/null +++ b/food-open/food-open-api/src/main/resources/templates/error/4xx.ftl @@ -0,0 +1,20 @@ + + + + + + +<@spring.message "project.name"/> + + +"> + + + + + +Something went wrong (4XX): ${status} ${error}
+点我返回首页 + + diff --git a/food-open/food-open-api/src/main/resources/templates/error/5xx.ftl b/food-open/food-open-api/src/main/resources/templates/error/5xx.ftl new file mode 100644 index 0000000..51c54fc --- /dev/null +++ b/food-open/food-open-api/src/main/resources/templates/error/5xx.ftl @@ -0,0 +1,21 @@ + + + + + + +<@spring.message "project.name"/> + + +"> + + + + + +Something went wrong: ${status} ${error}
+request=${springMacroRequestContext}
+点我返回首页 + + diff --git a/food-open/food-open-api/src/main/resources/templates/index.ftl b/food-open/food-open-api/src/main/resources/templates/index.ftl new file mode 100644 index 0000000..691b01c --- /dev/null +++ b/food-open/food-open-api/src/main/resources/templates/index.ftl @@ -0,0 +1,20 @@ + + + + + + +<@spring.message "project.name"/> + + +"> + + + + + +<@spring.message "project.name"/> + + diff --git a/food-open/food-open-api/src/main/resources/templates/spring.ftl b/food-open/food-open-api/src/main/resources/templates/spring.ftl new file mode 100644 index 0000000..1e4e745 --- /dev/null +++ b/food-open/food-open-api/src/main/resources/templates/spring.ftl @@ -0,0 +1,372 @@ +<#ftl strip_whitespace=true> +<#-- + * spring.ftl + * + * This file consists of a collection of FreeMarker macros aimed at easing + * some of the common requirements of web applications - in particular + * handling of forms. + * + * Spring's FreeMarker support will automatically make this file and therefore + * all macros within it available to any application using Spring's + * FreeMarkerConfigurer. + * + * To take advantage of these macros, the "exposeSpringMacroHelpers" property + * of the FreeMarker class needs to be set to "true". This will expose a + * RequestContext under the name "springMacroRequestContext", as needed by + * the macros in this library. + * + * @author Darren Davison + * @author Juergen Hoeller + * @since 1.1 + --> + <#-- + * 张莹 + * 获取contextPath + * 添加 ${base} 方式应用 + --> +<#macro basePath><#if springMacroRequestContext.getContextPath()=="/"><#else>${springMacroRequestContext.getContextPath()} +<#global base><@basePath/> +<#-- + * message + * + * Macro to translate a message code into a message. + --> +<#macro message code>${springMacroRequestContext.getMessage(code)} + +<#-- + * messageText + * + * Macro to translate a message code into a message, + * using the given default text if no message found. + --> +<#macro messageText code, text>${springMacroRequestContext.getMessage(code, text)} + +<#-- + * messageArgs + * + * Macro to translate a message code with arguments into a message. + --> +<#macro messageArgs code, args>${springMacroRequestContext.getMessage(code, args)} + +<#-- + * messageArgsText + * + * Macro to translate a message code with arguments into a message, + * using the given default text if no message found. + --> +<#macro messageArgsText code, args, text>${springMacroRequestContext.getMessage(code, args, text)} + +<#-- + * theme + * + * Macro to translate a theme message code into a message. + --> +<#macro theme code>${springMacroRequestContext.getThemeMessage(code)} + +<#-- + * themeText + * + * Macro to translate a theme message code into a message, + * using the given default text if no message found. + --> +<#macro themeText code, text>${springMacroRequestContext.getThemeMessage(code, text)} + +<#-- + * themeArgs + * + * Macro to translate a theme message code with arguments into a message. + --> +<#macro themeArgs code, args>${springMacroRequestContext.getThemeMessage(code, args)} + +<#-- + * themeArgsText + * + * Macro to translate a theme message code with arguments into a message, + * using the given default text if no message found. + --> +<#macro themeArgsText code, args, text>${springMacroRequestContext.getThemeMessage(code, args, text)} + +<#-- + * url + * + * Takes a relative URL and makes it absolute from the server root by + * adding the context root for the web application. + --> +<#macro url relativeUrl>${springMacroRequestContext.getContextPath()}${relativeUrl} + +<#-- + * bind + * + * Exposes a BindStatus object for the given bind path, which can be + * a bean (e.g. "person") to get global errors, or a bean property + * (e.g. "person.name") to get field errors. Can be called multiple times + * within a form to bind to multiple command objects and/or field names. + * + * This macro will participate in the default HTML escape setting for the given + * RequestContext. This can be customized by calling "setDefaultHtmlEscape" + * on the "springMacroRequestContext" context variable, or via the + * "defaultHtmlEscape" context-param in web.xml (same as for the JSP bind tag). + * Also regards a "htmlEscape" variable in the namespace of this library. + * + * Producing no output, the following context variable will be available + * each time this macro is referenced (assuming you import this library in + * your templates with the namespace 'spring'): + * + * spring.status : a BindStatus instance holding the command object name, + * expression, value, and error messages and codes for the path supplied + * + * @param path : the path (string value) of the value required to bind to. + * Spring defaults to a command name of "command" but this can be overridden + * by user config. + --> +<#macro bind path> + <#if htmlEscape?exists> + <#assign status = springMacroRequestContext.getBindStatus(path, htmlEscape)> + <#else> + <#assign status = springMacroRequestContext.getBindStatus(path)> + + <#-- assign a temporary value, forcing a string representation for any + kind of variable. This temp value is only used in this macro lib --> + <#if status.value?exists && status.value?is_boolean> + <#assign stringStatusValue=status.value?string> + <#else> + <#assign stringStatusValue=status.value?default("")> + + + +<#-- + * bindEscaped + * + * Similar to spring:bind, but takes an explicit HTML escape flag rather + * than relying on the default HTML escape setting. + --> +<#macro bindEscaped path, htmlEscape> + <#assign status = springMacroRequestContext.getBindStatus(path, htmlEscape)> + <#-- assign a temporary value, forcing a string representation for any + kind of variable. This temp value is only used in this macro lib --> + <#if status.value?exists && status.value?is_boolean> + <#assign stringStatusValue=status.value?string> + <#else> + <#assign stringStatusValue=status.value?default("")> + + + +<#-- + * formInput + * + * Display a form input field of type 'text' and bind it to an attribute + * of a command or bean. + * + * @param path the name of the field to bind to + * @param attributes any additional attributes for the element (such as class + * or CSS styles or size + --> +<#macro formInput path attributes="" fieldType="text"> + <@bind path/> + ${stringStatusValue}" ${attributes}<@closeTag/> + + +<#-- + * formPasswordInput + * + * Display a form input field of type 'password' and bind it to an attribute + * of a command or bean. No value will ever be displayed. This functionality + * can also be obtained by calling the formInput macro with a 'type' parameter + * of 'password'. + * + * @param path the name of the field to bind to + * @param attributes any additional attributes for the element (such as class + * or CSS styles or size + --> +<#macro formPasswordInput path attributes=""> + <@formInput path, attributes, "password"/> + + +<#-- + * formHiddenInput + * + * Generate a form input field of type 'hidden' and bind it to an attribute + * of a command or bean. This functionality can also be obtained by calling + * the formInput macro with a 'type' parameter of 'hidden'. + * + * @param path the name of the field to bind to + * @param attributes any additional attributes for the element (such as class + * or CSS styles or size + --> +<#macro formHiddenInput path attributes=""> + <@formInput path, attributes, "hidden"/> + + +<#-- + * formTextarea + * + * Display a text area and bind it to an attribute of a command or bean. + * + * @param path the name of the field to bind to + * @param attributes any additional attributes for the element (such as class + * or CSS styles or size + --> +<#macro formTextarea path attributes=""> + <@bind path/> + + + +<#-- + * formSingleSelect + * + * Show a selectbox (dropdown) input element allowing a single value to be chosen + * from a list of options. + * + * @param path the name of the field to bind to + * @param options a map (value=label) of all the available options + * @param attributes any additional attributes for the element (such as class + * or CSS styles or size +--> +<#macro formSingleSelect path options attributes=""> + <@bind path/> + + + +<#-- + * formMultiSelect + * + * Show a listbox of options allowing the user to make 0 or more choices from + * the list of options. + * + * @param path the name of the field to bind to + * @param options a map (value=label) of all the available options + * @param attributes any additional attributes for the element (such as class + * or CSS styles or size +--> +<#macro formMultiSelect path options attributes=""> + <@bind path/> + + + +<#-- + * formRadioButtons + * + * Show radio buttons. + * + * @param path the name of the field to bind to + * @param options a map (value=label) of all the available options + * @param separator the html tag or other character list that should be used to + * separate each option. Typically ' ' or '
' + * @param attributes any additional attributes for the element (such as class + * or CSS styles or size +--> +<#macro formRadioButtons path options separator attributes=""> + <@bind path/> + <#list options?keys as value> + <#assign id="${status.expression}${value_index}"> + checked="checked" ${attributes}<@closeTag/> + ${separator} + + + +<#-- + * formCheckboxes + * + * Show checkboxes. + * + * @param path the name of the field to bind to + * @param options a map (value=label) of all the available options + * @param separator the html tag or other character list that should be used to + * separate each option. Typically ' ' or '
' + * @param attributes any additional attributes for the element (such as class + * or CSS styles or size +--> +<#macro formCheckboxes path options separator attributes=""> + <@bind path/> + <#list options?keys as value> + <#assign id="${status.expression}${value_index}"> + <#assign isSelected = contains(status.value?default([""]), value)> + checked="checked" ${attributes}<@closeTag/> + ${separator} + + + + +<#-- + * showErrors + * + * Show validation errors for the currently bound field, with + * optional style attributes. + * + * @param separator the html tag or other character list that should be used to + * separate each option. Typically '
'. + * @param classOrStyle either the name of a CSS class element (which is defined in + * the template or an external CSS file) or an inline style. If the value passed in here + * contains a colon (:) then a 'style=' attribute will be used, else a 'class=' attribute + * will be used. +--> +<#macro showErrors separator classOrStyle=""> + <#list status.errorMessages as error> + <#if classOrStyle == ""> + ${error} + <#else> + <#if classOrStyle?index_of(":") == -1><#assign attr="class"><#else><#assign attr="style"> + ${error} + + <#if error_has_next>${separator} + + + +<#-- + * checkSelected + * + * Check a value in a list to see if it is the currently selected value. + * If so, add the 'selected="selected"' text to the output. + * Handles values of numeric and string types. + * This function is used internally but can be accessed by user code if required. + * + * @param value the current value in a list iteration +--> +<#macro checkSelected value> + <#if stringStatusValue?is_number && stringStatusValue == value?number>selected="selected" + <#if stringStatusValue?is_string && stringStatusValue == value>selected="selected" + + +<#-- + * contains + * + * Macro to return true if the list contains the scalar, false if not. + * Surprisingly not a FreeMarker builtin. + * This function is used internally but can be accessed by user code if required. + * + * @param list the list to search for the item + * @param item the item to search for in the list + * @return true if item is found in the list, false otherwise +--> +<#function contains list item> + <#list list as nextInList> + <#if nextInList == item><#return true> + + <#return false> + + +<#-- + * closeTag + * + * Simple macro to close an HTML tag that has no body with '>' or '/>', + * depending on the value of a 'xhtmlCompliant' variable in the namespace + * of this library. +--> +<#macro closeTag> + <#if xhtmlCompliant?exists && xhtmlCompliant>/><#else>> + diff --git a/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-agent.xml b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-agent.xml new file mode 100644 index 0000000..d730083 --- /dev/null +++ b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-agent.xml @@ -0,0 +1,17 @@ + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-coupon.xml b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-coupon.xml new file mode 100644 index 0000000..bb1df92 --- /dev/null +++ b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-coupon.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-dispatch.xml b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-dispatch.xml new file mode 100644 index 0000000..e72cd68 --- /dev/null +++ b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-dispatch.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-program.xml b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-program.xml new file mode 100644 index 0000000..9abc36c --- /dev/null +++ b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-program.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-promotion.xml b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-promotion.xml new file mode 100644 index 0000000..72e2431 --- /dev/null +++ b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-promotion.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-shared.xml b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-shared.xml new file mode 100644 index 0000000..f86d6b3 --- /dev/null +++ b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-shared.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-storage.xml b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-storage.xml new file mode 100644 index 0000000..4774511 --- /dev/null +++ b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-storage.xml @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-store-storage.xml b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-store-storage.xml new file mode 100644 index 0000000..adf0dae --- /dev/null +++ b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-store-storage.xml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-store.xml b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-store.xml new file mode 100644 index 0000000..81ec513 --- /dev/null +++ b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-store.xml @@ -0,0 +1,456 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-task.xml b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-task.xml new file mode 100644 index 0000000..4f7f927 --- /dev/null +++ b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-task.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-user.xml b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-user.xml new file mode 100644 index 0000000..eca105c --- /dev/null +++ b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-user.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-waimai.xml b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-waimai.xml new file mode 100644 index 0000000..48b2654 --- /dev/null +++ b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-waimai.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-weixin.xml b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-weixin.xml new file mode 100644 index 0000000..5875199 --- /dev/null +++ b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-weixin.xml @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-wxdc.xml b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-wxdc.xml new file mode 100644 index 0000000..373e6e3 --- /dev/null +++ b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-wxdc.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-wxyh.xml b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-wxyh.xml new file mode 100644 index 0000000..37fc30a --- /dev/null +++ b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food-wxyh.xml @@ -0,0 +1,19 @@ + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food.xml b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food.xml new file mode 100644 index 0000000..7bbd5a3 --- /dev/null +++ b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-food.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-manager.xml b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-manager.xml new file mode 100644 index 0000000..461a1d3 --- /dev/null +++ b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo-manager.xml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo.xml b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo.xml new file mode 100644 index 0000000..13bd425 --- /dev/null +++ b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-dubbo.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-wop.xml b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-wop.xml new file mode 100644 index 0000000..2d1ce84 --- /dev/null +++ b/food-open/food-open-api/target/classes/BOOT-INF/classes/META-INF/spring/spring-wop.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-api/target/classes/BOOT-INF/classes/erp.properties b/food-open/food-open-api/target/classes/BOOT-INF/classes/erp.properties new file mode 100644 index 0000000..b004bc3 --- /dev/null +++ b/food-open/food-open-api/target/classes/BOOT-INF/classes/erp.properties @@ -0,0 +1,11 @@ +open.api.appKey=appkey +open.api.secret=secret +open.api.version=1.0 +open.api.format=json +open.api.locale=zh_CN +open.api.client=web +open.api.url=http://127.0.0.1/openApi/api + +#\u9910\u996E\u7684appk secret +open.api.food.appKey=appKey +open.api.food.secret=secret diff --git a/food-open/food-open-api/target/classes/BOOT-INF/classes/fdfs_client.conf b/food-open/food-open-api/target/classes/BOOT-INF/classes/fdfs_client.conf new file mode 100644 index 0000000..ef6700c --- /dev/null +++ b/food-open/food-open-api/target/classes/BOOT-INF/classes/fdfs_client.conf @@ -0,0 +1,9 @@ +connect_timeout=2 +network_timeout=30 +charset=UTF-8 +http.tracker_http_port=80 +http.anti_steal_token=no +http.secret_key=FastDFS1111111111 +#JW +tracker_server=127.0.0.1:22122 +access_domain=http://img.zhangshuxiang.com diff --git a/food-open/food-open-api/target/classes/BOOT-INF/classes/i18n/messages.properties b/food-open/food-open-api/target/classes/BOOT-INF/classes/i18n/messages.properties new file mode 100644 index 0000000..a9a1bba --- /dev/null +++ b/food-open/food-open-api/target/classes/BOOT-INF/classes/i18n/messages.properties @@ -0,0 +1,4 @@ +project.name=Food\u5f00\u653e\u5e73\u53f0 +project.description=Food\u5f00\u653e\u5e73\u53f0 +project.version=2.0 +project.softwareName=Food\u7cfb\u7edf diff --git a/food-open/food-open-api/target/classes/BOOT-INF/classes/i18n/wop/ext/error_zh_CN.properties b/food-open/food-open-api/target/classes/BOOT-INF/classes/i18n/wop/ext/error_zh_CN.properties new file mode 100644 index 0000000..63228f8 --- /dev/null +++ b/food-open/food-open-api/target/classes/BOOT-INF/classes/i18n/wop/ext/error_zh_CN.properties @@ -0,0 +1,301 @@ +#\u4e1a\u52a1\u903b\u8f91\u9519\u8bef\u5904\u7406 +#\u683c\u5f0f:isv.xxx-service-error\:yyy=\u9519\u8bef\u63cf\u8ff0\u4fe1\u606f +#\u5176\u4e2d:xxx\u4ee3\u8868\u66b4\u9732\u7684\u65b9\u6cd5\u540d\u79f0,\u5c06\u540d\u79f0\u4e2d.\u66ff\u6362\u4e3a-,yyy\u4ee3\u8868\u9519\u8bef\u5173\u952e\u5b57\uff0c\u4ee5\u533a\u522b\u540c\u4e00\u4e2a\u65b9\u6cd5\u7684\u591a\u79cd\u9519\u8bef + +#\u516c\u5171\u670d\u52a1\u63a5\u53e3\u9519\u8bef +isv.common-sayhello-service-error\:COMMON_SAYHELLO_ERROR=\u83b7\u53d6\u670d\u52a1\u7aef\u5b58\u6d3b\u72b6\u6001\u5931\u8d25 +isv.session-create-service-error\:SESSION_CREATE_ERROR=\u521b\u5efaSession\u5931\u8d25 +isv.session-get-service-error\:SESSION_GET_ERROR=\u83b7\u53d6Session\u5931\u8d25 +isv.session-remove-service-error\:SESSION_REMOVE_ERROR=\u6e05\u9664Session\u5931\u8d25 + +#POS\u76f8\u5173\u63a5\u53e3\u9519\u8bef +isv.pos-setplan-service-error\:COMMON_ERROR=POS\u53c2\u6570\u65b9\u6848\u83b7\u53d6\u5931\u8d25 +isv.pos-setplan-up-service-error\:COMMON_ERROR=POS\u53c2\u6570\u65b9\u6848\u4e0a\u4f20\u5931\u8d25 +isv.pos-setplan-down-service-error\:COMMON_ERROR=POS\u53c2\u6570\u65b9\u6848\u4e0b\u8f7d\u5931\u8d25 +isv.pos-monitor-service-error\:COMMON_ERROR=POS\u76d1\u63a7\u4fe1\u606f\u4fdd\u5b58\u5931\u8d25 +isv.pos-auth-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u6388\u6743\u4fe1\u606f\u5931\u8d25 +isv.tenant-line-auth-service-error\:COMMON_ERROR=\u4e91\u7aef\u4ea7\u54c1\u65f6\u95f4\u6821\u9a8c\u5931\u8d25 +isv.erp-pos-set-service-error\:COMMON_ERROR=\u83b7\u53d6erpPOS\u53c2\u6570\u8bbe\u7f6e\u5931\u8d25 + +#\u95e8\u5e97\u4fe1\u606f\u63a5\u53e3\u9519\u8bef +isv.store-list-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u5217\u8868\u5931\u8d25 +isv.store-message-service-error\:MESSAGE_ERROR=\u83b7\u53d6\u95e8\u5e97\u4fe1\u606f\u5931\u8d25 +isv.store-paytype-service-error\:PAYTYPE_ERROR=\u4ed8\u6b3e\u7c7b\u578b\u83b7\u53d6\u5931\u8d25 +isv.store-paymode-service-error\:PAYMODE_ERROR=\u6536\u94f6\u65b9\u5f0f\u83b7\u53d6\u5931\u8d25 +isv.store-businessplan-service-error\:BUSINESSPLAN_ERROR=\u8425\u4e1a\u65e5\u65b9\u6848\u83b7\u53d6\u5931\u8d25 +isv.store-businessplan-detail-service-error\:BUSINESSPLAN_DETAIL_ERROR=\u8425\u4e1a\u65e5\u65b9\u6848\u73ed\u6b21\u83b7\u53d6\u5931\u8d25 +isv.store-table-area-service-error\:TABLE_AREA_ERROR=\u95e8\u5e97\u9910\u684c\u533a\u57df\u83b7\u53d6\u5931\u8d25 +isv.store-table-type-service-error\:TABLE_TYPE_ERROR=\u95e8\u5e97\u9910\u684c\u7c7b\u578b\u83b7\u53d6\u5931\u8d25 +isv.store-table-service-error\:TABLE_ERROR=\u95e8\u5e97\u9910\u684c\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 +isv.store-brand-service-error\:BRAND_ERROR=\u95e8\u5e97\u54c1\u724c\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 +isv.store-advert-picture-service-error\:ADVERT_PICTURE_ERROR=\u95e8\u5e97\u53cc\u5c4f\u5e7f\u544a\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.store-advert-caption-service-error\:ADVERT_CAPTION_ERROR=\u95e8\u5e97\u53cc\u5c4f\u5b57\u5e55\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.store-print-image-service-error\:PRINT_IMAGE_ERROR=\u95e8\u5e97\u5c0f\u7968\u6253\u5370\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.store-pos-list-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97POS\u4fe1\u606f\u5931\u8d25 +isv.store-feeitem-list-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u8d39\u7528\u9879\u76ee\u5217\u8868\u5931\u8d25 +isv.store-product-coupon-list-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u5546\u54c1\u4f18\u60e0\u5238\u4fe1\u606f\u5931\u8d25 +isv.store-coupon-list-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u4f18\u60e0\u5238\u5217\u8868\u5931\u8d25 +isv.store-coupon-checkout-service-error\:COMMON_ERROR=\u95e8\u5e97\u4f18\u60e0\u5238\u6838\u9500\u6821\u9a8c\u5931\u8d25 +isv.store-coupon-check-service-error\:COMMON_ERROR=\u95e8\u5e97\u4f18\u60e0\u5238\u6838\u9500\u5931\u8d25 +isv.store-sales-order-list-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u9500\u552e\u8ba2\u5355\u5217\u8868\u5931\u8d25 +isv.store-sales-day-summary-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u65e5\u8425\u4e1a\u989d\u6c47\u603b\u5931\u8d25 +isv.store-account-get-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u4f59\u989d\u8d26\u6237\u5931\u8d25 +isv.store-account-detail-list-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u4f59\u989d\u8d26\u6237\u660e\u7ec6\u5217\u8868\u5931\u8d25 +isv.store-account-detail-info-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u4f59\u989d\u8d26\u6237\u660e\u7ec6\u4fe1\u606f\u5931\u8d25 +isv.store-account-recharge-service-error\:COMMON_ERROR=\u95e8\u5e97\u4f59\u989d\u8d26\u6237\u5145\u503c\u5931\u8d25 +isv.store-account-enchashment-apply-service-error\:COMMON_ERROR=\u7533\u8bf7\u95e8\u5e97\u4f59\u989d\u63d0\u73b0\u5931\u8d25 +isv.store-account-enchashment-cancel-service-error\:COMMON_ERROR=\u53d6\u6d88\u95e8\u5e97\u4f59\u989d\u63d0\u73b0\u7533\u8bf7\u5931\u8d25 +isv.store-account-enchashment-list-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u4f59\u989d\u63d0\u73b0\u5217\u8868\u5931\u8d25 +isv.store-account-enchashment-info-service-error\:COMMON_ERROR=\u67e5\u8be2\u95e8\u5e97\u4f59\u989d\u8d26\u6237\u63d0\u73b0\u4fe1\u606f\u8be6\u60c5\u5931\u8d25 +isv.store-account-recharge-parameter-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u8d26\u6237\u5145\u503c\u53c2\u6570\u5931\u8d25 +isv.store-account-recharge-wxpay-unifiedorder-service-error\:COMMON_ERROR=\u95e8\u5e97\u4f59\u989d\u8d26\u6237\u5fae\u4fe1\u5145\u503c\u7edf\u4e00\u4e0b\u5355\u5931\u8d25 +isv.store-account-recharge-wxpay-orderquery-service-error\:COMMON_ERROR=\u95e8\u5e97\u4f59\u989d\u8d26\u6237\u5fae\u4fe1\u5145\u503c\u67e5\u8be2\u8ba2\u5355\u5931\u8d25 +isv.store-dispatch-settle-plan-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u914d\u9001\u7ed3\u7b97\u65b9\u6848\u5931\u8d25 +isv.store-product-burden-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u5546\u54c1\u914d\u65b9\u5931\u8d25 +isv.store-make-burden-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u505a\u6cd5\u914d\u65b9\u5931\u8d25 + +#\u5361\u52a1\u95e8\u5e97\u540c\u6b65\u63a5\u53e3\u9519\u8bef +isv.cardsync-store-type-service-error\:STORE_TYPE_ERROR=\u95e8\u5e97\u7c7b\u578b\u83b7\u53d6\u5931\u8d25 +isv.cardsync-store-message-service-error\:STORE_MESSAGE_ERROR=\u95e8\u5e97\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 +isv.cardsync-store-worker-service-error\:STORE_WORKER_ERROR=\u95e8\u5e97\u5458\u5de5\u83b7\u53d6\u5931\u8d25 +isv.cardsync-worker-store-service-error\:WORKER_STORE_ERROR=\u5458\u5de5\u53ef\u767b\u9646\u95e8\u5e97\u83b7\u53d6\u5931\u8d25 +isv.cardsync-store-pos-service-error\:STORE_POS_ERROR=\u95e8\u5e97POS\u83b7\u53d6\u5931\u8d25 +isv.cardsync-store-paytype-service-error\:STORE_PAYTYPE_ERROR=\u95e8\u5e97\u6536\u94f6\u65b9\u5f0f\u83b7\u53d6\u5931\u8d25 +isv.cardsync-product-type-service-error\:COMMON_ERROR=\u5546\u54c1\u7c7b\u522b\u83b7\u53d6\u5931\u8d25 +isv.cardsync-product-list-service-error\:COMMON_ERROR=\u5546\u54c1\u5217\u8868\u83b7\u53d6\u5931\u8d25 + +#\u83dc\u54c1\u4fe1\u606f\u63a5\u53e3\u9519\u8bef +isv.product-maketype-service-error\:MAKETYPE_ERROR=\u95e8\u5e97\u505a\u6cd5\u7c7b\u578b\u83b7\u53d6\u5931\u8d25 +isv.product-makedetail-service-error\:MAKEDETAIL_ERROR=\u95e8\u5e97\u505a\u6cd5\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 +isv.product-dishunit-service-error\:UNIT_ERROR=\u5546\u54c1\u5355\u4f4d\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 +isv.product-type-service-error\:TYPE_ERROR=\u5546\u54c1\u7c7b\u522b\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 +isv.product-list-service-error\:LIST_ERROR=\u5546\u54c1\u8d44\u6599\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 +isv.product-spec-service-error\:SPEC_ERROR=\u5546\u54c1\u89c4\u683c\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 +isv.product-images-service-error\:IMAGES_ERROR=\u83dc\u54c1\u56fe\u7247\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 +isv.product-ratio-service-error\:RATIO_ERROR=\u5546\u54c1\u7cfb\u6570\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 +isv.product-private-makedetail-service-error\:COMMON_ERROR=\u83b7\u53d6\u5546\u54c1\u79c1\u6709\u505a\u6cd5\u5931\u8d25 +isv.product-suit-service-error\:SUIT_ERROR=\u83b7\u53d6\u5546\u54c1\u5957\u83dc\u4fe1\u606f\u5931\u8d25 +isv.product-brand-service-error\:SUIT_ERROR=\u83b7\u53d6\u54c1\u724c\u4fe1\u606f\u5931\u8d25 +isv.product-store-brand-service-error\:SUIT_ERROR=\u83b7\u53d6\u5546\u54c1\u54c1\u724c\u4fe1\u606f\u5931\u8d25 +isv.store-product-brand-service-error\:SUIT_ERROR=\u83b7\u53d6\u5546\u54c1\u54c1\u724c\u4fe1\u606f\u5931\u8d25 + +#\u5458\u5de5\u4fe1\u606f\u63a5\u53e3\u9519\u8bef +isv.worker-login-service-error\:LOGIN_ERROR=\u5458\u5de5\u767b\u5f55\u9a8c\u8bc1\u5931\u8d25 +isv.worker-list-service-error\:LIST_ERROR=\u95e8\u5e97\u53ef\u767b\u9646\u5458\u5de5\u83b7\u53d6\u5931\u8d25 +isv.worker-posrole-service-error\:POSROLE_ERROR=\u5458\u5de5POS\u89d2\u8272\u6743\u9650\u83b7\u53d6\u5931\u8d25 +isv.worker-posmodule-service-error\:POSMODULE_ERROR=\u5458\u5de5POS\u6a21\u5757\u6743\u9650\u83b7\u53d6\u5931\u8d25 +isv.worker-update-pwd-service-error\:COMMON_ERROR=\u5458\u5de5\u4fee\u6539\u95e8\u5e97\u767b\u9646\u5bc6\u7801\u5931\u8d25 + +#\u6570\u636e\u4e0a\u4f20\u63a5\u53e3\u9519\u8bef +isv.upload-business-order-service-error\:BUSINESS_ORDER_ERROR=\u9500\u552e\u6570\u636e\u4e0a\u4f20\u5931\u8d25 +isv.upload-business-revenue-service-error\:BUSINESS_REVENUE_ERROR=\u975e\u8425\u4e1a\u6536\u5165\u6570\u636e\u4e0a\u4f20\u5931\u8d25 +isv.upload-business-handover-service-error\:BUSINESS_HANDOVER_ERROR=\u4ea4\u73ed\u6570\u636e\u4e0a\u4f20\u5931\u8d25 +isv.upload-business-order-extend-service-error\:COMMON_ERROR=\u9500\u552e\u6570\u636e\u4e0a\u4f20\u5931\u8d25 +isv.upload-business-order-plus-service-error\:COMMON_ERROR=\u9500\u552e\u6570\u636e\u4e0a\u4f20\u5931\u8d25 +isv.upload-business-order-burden-service-error\:COMMON_ERROR=\u8017\u6599\u6570\u636e\u4e0a\u4f20\u5931\u8d25 + +#\u652f\u4ed8\u4fe1\u606f\u9519\u8bef +isv.pay-get-parameter-service-error\:GET_PARAMETER_ERROR=\u652f\u4ed8\u53c2\u6570\u6570\u636e\u4e0b\u8f7d\u5931\u8d25 + +#\u53a8\u6253\u76f8\u5173\u63a5\u53e3\u9519\u8bef +isv.kit-plan-service-error\:PLAN_ERROR=\u53a8\u6253\u65b9\u6848\u6570\u636e\u4e0b\u8f7d\u5931\u8d25 +isv.kit-product-service-error\:PRODUCT_ERROR=\u83dc\u54c1\u53a8\u6253\u5173\u8054\u6570\u636e\u4e0b\u8f7d\u5931\u8d25 + +#\u53a8\u663e\u76f8\u5173\u63a5\u53e3\u9519\u8bef +isv.kds-plan-service-error\:PLAN_ERROR=\u53a8\u663e\u65b9\u6848\u6570\u636e\u4e0b\u8f7d\u5931\u8d25 +isv.kds-product-service-error\:PRODUCT_ERROR=\u83dc\u54c1\u53a8\u663e\u5173\u8054\u6570\u636e\u4e0b\u8f7d\u5931\u8d25 + +#\u95e8\u5e97\u5e93\u5b58\u7ba1\u7406\u76f8\u5173\u63a5\u53e3\u9519\u8bef +isv.store-storage-service-error\:STORAGE_ERROR=\u95e8\u5e97\u4ed3\u5e93\u6570\u636e\u4e0b\u8f7d\u5931\u8d25 +isv.store-askgoods-ticket-service-error\:ASKGOODS_TICKET_ERROR=\u83b7\u53d6\u95e8\u5e97\u8981\u8d27\u5355\u4fe1\u606f\u5931\u8d25 +isv.store-waitSendAskgoods-ticket-service-error\:ASKGOODS_TICKET_ERROR=\u83b7\u53d6\u95e8\u5e97\u8981\u8d27\u5355\u4fe1\u606f\u5931\u8d25 +isv.store-askgoods-detail-service-error\:ASKGOODS_DETAIL_ERROR=\u83b7\u53d6\u95e8\u5e97\u8981\u8d27\u5355\u660e\u7ec6\u5931\u8d25 +isv.store-product-dispatchprice-service-error\:PRODUCT_DISPATCHPRICE_ERROR=\u83b7\u53d6\u95e8\u5e97\u5546\u54c1\u914d\u9001\u4ef7\u683c\u5931\u8d25 +isv.store-askgoods-ticket-add-service-error\:ASKGOODS_TICKET_ADD_ERROR=\u65b0\u589e\u8981\u8d27\u5355\u4fe1\u606f\u5931\u8d25 +isv.store-askgoods-ticket-edit-service-error\:ASKGOODS_TICKET_EDIT_ERROR=\u4fee\u6539\u8981\u8d27\u5355\u4fe1\u606f\u5931\u8d25 +isv.store-askgoods-ticket-status-service-error\:ASKGOODS_TICKET_STATUS_ERROR=\u8981\u8d27\u5355\u72b6\u6001\u53d8\u66f4\u5931\u8d25 +isv.store-askgoods-detial-remove-service-error\:ASKGOODS_DETIAL_REMOVE_ERROR=\u5220\u9664\u8981\u8d27\u5355\u6307\u5b9a\u5546\u54c1\u5931\u8d25 +isv.store-product-stock-service-error\:PRODUCT_STOCK_ERROR=\u5546\u54c1\u5e93\u5b58\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.store-askgoods-template-list-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u8981\u8d27\u6a21\u677f\u4fe1\u606f\u5931\u8d25 +isv.store-askgoods-template-detail-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u8981\u8d27\u6a21\u677f\u660e\u7ec6\u4fe1\u606f\u5931\u8d25 +isv.store-product-stock-sum-service-error\:COMMON_ERROR=\u83b7\u53d6\u5546\u54c1\u95e8\u5e97\u5e93\u5b58\u603b\u6570\u5931\u8d25 +isv.store-dispatch-ticket-service-error\:COMMON_ERROR=\u83b7\u53d6\u914d\u9001\u5355\u4fe1\u606f\u5931\u8d25 +isv.store-dispatch-ticket-detail-service-error\:COMMON_ERROR=\u83b7\u53d6\u914d\u9001\u5355\u660e\u7ec6\u4fe1\u606f\u5931\u8d25 +isv.store-dispatch-ticket-receive-service-error\:COMMON_ERROR=\u914d\u9001\u5355\u9a8c\u6536\u64cd\u4f5c\u5931\u8d25 +isv.store-storage-ticket-type-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u5165\u5e93/\u51fa\u5e93\u7c7b\u578b\u5931\u8d25 +isv.store-storage-ticket-add-service-error\:COMMON_ERROR=\u65b0\u589e\u95e8\u5e97\u5165\u5e93\u5355\u5931\u8d25 +isv.store-storage-ticket-edit-service-error\:COMMON_ERROR=\u4fee\u6539\u95e8\u5e97\u5165\u5e93\u5355\u5931\u8d25 +isv.store-storage-ticket-status-change-service-error\:COMMON_ERROR=\u95e8\u5e97\u5165\u5e93\u5355\u72b6\u6001\u53d8\u66f4\u5931\u8d25 +isv.store-storage-ticket-list-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u5165\u5e93\u5355\u5931\u8d25 +isv.store-storage-ticket-detail-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u5165\u5e93\u5355\u660e\u7ec6\u5931\u8d25 +isv.store-storage-out-ticket-add-service-error\:COMMON_ERROR=\u65b0\u589e\u95e8\u5e97\u51fa\u5e93\u5355\u5931\u8d25 +isv.store-storage-out-ticket-edit-service-error\:COMMON_ERROR=\u4fee\u6539\u95e8\u5e97\u51fa\u5e93\u5355\u5931\u8d25 +isv.store-storage-out-ticket-status-change-service-error\:COMMON_ERROR=\u95e8\u5e97\u51fa\u5e93\u5355\u72b6\u6001\u53d8\u66f4\u5931\u8d25 +isv.store-storage-out-ticket-list-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u51fa\u5e93\u5355\u5931\u8d25 +isv.store-storage-out-ticket-detail-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u51fa\u5e93\u5355\u660e\u7ec6\u5931\u8d25 +isv.store-product-stock-out-summary-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u5546\u54c1\u5e93\u5b58\u6d88\u8017(\u51fa\u5e93)\u6c47\u603b\u5931\u8d25 +isv.store-stock-check-ticket-add-service-error\:COMMON_ERROR=\u65b0\u589e\u95e8\u5e97\u76d8\u70b9\u5355\u5931\u8d25 +isv.store-stock-uncheck-ticket-detail-service-error\:COMMON_ERROR=\u83b7\u53d6\u672a\u5ba1\u6838\u7684\u76d8\u70b9\u5355\u660e\u7ec6\u4fe1\u606f\u5217\u8868\u5931\u8d25 +isv.store-stock-check-ticket-detail-del-service-error\:COMMON_ERROR=\u5220\u9664\u95e8\u5e97\u5e93\u5b58\u76d8\u70b9\u660e\u7ec6\u5931\u8d25 +isv.store-stock-uncheck-ticket-detail-update-service-error\:COMMON_ERROR=\u66f4\u65b0\u672a\u5ba1\u6838\u7684\u76d8\u70b9\u5355\u660e\u7ec6\u4fe1\u606f\u5931\u8d25 +isv.store-stock-uncheck-ticket-status-update-service-error\:COMMON_ERROR=\u66f4\u65b0\u672a\u5ba1\u6838\u7684\u76d8\u70b9\u5355\u72b6\u6001\u5931\u8d25 +isv.store-stock-check-product-valid-service-error\:COMMON_ERROR=\u83b7\u53d6\u53ef\u76d8\u70b9\u5546\u54c1\u4fe1\u606f\u5217\u8868\u5931\u8d25 +isv.store-stock-check-template-list-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u76d8\u70b9\u6a21\u677f\u5217\u8868\u5931\u8d25 +isv.store-stock-check-template-detail-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u76d8\u70b9\u6a21\u677f\u660e\u7ec6\u4fe1\u606f\u5931\u8d25 +isv.store-stock-check-summary-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u76d8\u70b9\u5206\u6790\u4fe1\u606f\u5931\u8d25 +isv.store-recharge-parameter-list-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u5145\u503c\u53c2\u6570\u65b9\u6848\u5217\u8868\u5931\u8d25 +isv.store-receiveDifference-ticket-service-error\:RECEIVE_DIFFERENCE_TICKET_ERROR=\u83b7\u53d6\u914d\u9001\u9a8c\u6536\u5dee\u5f02\u4fe1\u606f\u5931\u8d25 +isv.store-receiveDifference-detail-service-error\:RECEIVE_DIFFERENCE_DETAIL_ERROR=\u83b7\u53d6\u914d\u9001\u9a8c\u6536\u5dee\u5f02\u8be6\u60c5\u4fe1\u606f\u5931\u8d25 +isv.store-askgoods-template-add-service-error\:ASKGOODS_TEMPLATE_ADD_ERROR=\u8981\u8d27\u6a21\u677f\u65b0\u589e\u5931\u8d25 +isv.store-askgoods-template-edit-service-error\:ASKGOODS_TEMPLATE_EDIT_ERROR=\u8981\u8d27\u6a21\u677f\u4fee\u6539\u5931\u8d25 +#\u95e8\u5e97\u8c03\u4ef7\u63a5\u53e3\u9519\u8bef +isv.store-adjustPrice-ticket-service-error\:STORE_ADJUSTPRICE_TICKET_ERROR=\u83b7\u53d6\u8c03\u4ef7\u5355\u4fe1\u606f\u5931\u8d25 +isv.store-adjustPrice-detail-service-error\:STORE_ADJUSTPRICE_DETAIL_ERROR=\u83b7\u53d6\u8c03\u4ef7\u5355\u8be6\u60c5\u4fe1\u606f\u5931\u8d25 +isv.store-adjustPrice-add-service-error\:STORE_ADJUSTPRICE_ADD_ERROR=\u65b0\u589e\u95e8\u5e97\u8c03\u4ef7\u5355\u5931\u8d25 +isv.store-adjustPrice-edit-service-error\:STORE_ADJUSTPRICE_EDIT_ERROR=\u7f16\u8f91\u95e8\u5e97\u8c03\u4ef7\u5355\u5931\u8d25 +isv.store-adjustPrice-audit-service-error\:STORE_ADJUSTPRICE_AUDIT_ERROR=\u5ba1\u6838\u95e8\u5e97\u8c03\u4ef7\u5355\u5931\u8d25 + +#\u5916\u8bbe\u76f8\u5173 +isv.peripheral-card-reader-info-service-error\:CARD_READER_INFO=\u83b7\u53d6\u8bfb\u5361\u5668\u4fe1\u606f\u5931\u8d25 +isv.peripheral-printer-info-service-error\:PRINTER_INFO_INFO=\u95e8\u5e97\u4ed3\u5e93\u6570\u636e\u4e0b\u8f7d\u5931\u8d25 + +#\u5fae\u4fe1\u638c\u67dc\u52a9\u624b\u63a5\u53e3\u9519\u8bef +isv.weixin-worker-store-service-error\:WORKER_STORE_ERROR=\u5458\u5de5\u95e8\u5e97\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.weixin-day-summary-service-error\:DAY_SUMMARY_ERROR=\u95e8\u5e97\u65e5\u8425\u4e1a\u6c47\u603b\u83b7\u53d6\u5931\u8d25 +isv.weixin-day-summary-list-service-error\:DAY_SUMMARY_LIST_ERROR=\u95e8\u5e97\u65e5\u8425\u4e1a\u6c47\u603b\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.weixin-product-rank-service-error\:PRODUCT_RANK_ERROR=\u95e8\u5e97\u9500\u552e\u6392\u884c\u83b7\u53d6\u5931\u8d25 +isv.weixin-order-summary-list-service-error\:ORDER_SUMMARY_LIST_ERROR=\u9500\u552e\u6c47\u603b\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.weixin-category-summary-list-service-error\:CATEGORY_SUMMARY_LIST_ERROR=\u7c7b\u522b\u9500\u552e\u6c47\u603b\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.weixin-time-summary-list-service-error\:TIME_SUMMARY_LIST_ERROR=\u65f6\u6bb5\u9500\u552e\u6c47\u603b\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.weixin-pay-summary-list-service-error\:PAY_SUMMARY_LIST_ERROR=\u652f\u4ed8\u65b9\u5f0f\u6c47\u603b\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.weixin-gross-profit-analysis-service-error\:COMMON_ERROR=\u9500\u552e\u6bdb\u5229\u5206\u6790\u6570\u636e\u83b7\u53d6\u5931\u8d25 +isv.weixin-product-sales-summary-service-error\:COMMON_ERROR=\u4ea7\u54c1\u9500\u552e\u6c47\u603b\u83b7\u53d6\u5931\u8d25 +isv.weixin-waimai-order-statistics-service-error\:COMMON_ERROR=\u5916\u5356\u6c47\u603b\u6570\u636e\u83b7\u53d6\u5931\u8d25 +isv.weixin-day-summary-list-rank-service-error\:DAY_SUMMARY_ERROR=\u95e8\u5e97\u65e5\u8425\u4e1a\u6c47\u603b\u83b7\u53d6\u5931\u8d25 +isv.weixin-worker-module-service-error\:DAY_SUMMARY_ERROR=\u83b7\u53d6\u638c\u67dc\u67e5\u8be2\u5458\u5de5\u6743\u9650\u5931\u8d25 +#\u719f\u5ba2\u4fe1\u606f +isv.visitor-list-service-error\:LIST_ERROR=\u719f\u5ba2\u4fe1\u606f\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.visitor-address-list-service-error\:LIST_ERROR=\u719f\u5ba2\u5730\u5740\u4fe1\u606f\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.visitor-tag-list-service-error\:LIST_ERROR=\u719f\u5ba2\u6807\u7b7e\u4fe1\u606f\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.visitor-add-service-error\:COMMON_ERROR=\u65b0\u589e\u719f\u5ba2\u4fe1\u606f\u5931\u8d25 +isv.visitor-update-service-error\:COMMON_ERROR=\u4fee\u6539\u719f\u5ba2\u4fe1\u606f\u5931\u8d25 +isv.visitor-info-service-error\:COMMON_ERROR=\u67e5\u8be2\u719f\u5ba2\u4fe1\u606f\u5931\u8d25 + +#\u57ce\u5e02\u4fe1\u606f +isv.city-info-list-service-error\:COMMON_ERROR=\u57ce\u5e02\u4fe1\u606f\u5217\u8868\u83b7\u53d6\u5931\u8d25 + +#\u5fae\u4fe1\u70b9\u9910 +isv.wxdc-ad-picture-list-service-error\:COMMON_ERROR=\u5e7f\u544a\u56fe\u7247\u83b7\u53d6\u5931\u8d25 +isv.wxdc-store-list-service-error\:COMMON_ERROR=\u95e8\u5e97\u4fe1\u606f\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.wxdc-store-list-bywid-service-error\:COMMON_ERROR=\u95e8\u5e97\u4fe1\u606f\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.wxdc-store-info-service-error\:COMMON_ERROR=\u95e8\u5e97\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 +isv.wxdc-goods-category-list-service-error\:COMMON_ERROR=\u5546\u54c1\u5206\u7c7b\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 +isv.wxdc-goods-category-service-error\:COMMON_ERROR=\u5546\u54c1\u5206\u7c7b\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 +isv.wxdc-goods-list-service-error\:COMMON_ERROR=\u5546\u54c1\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 +isv.wxdc-goods-make-list-service-error\:COMMON_ERROR=\u5546\u54c1\u505a\u6cd5\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.wxdc-sales-order-create-service-error\:COMMON_ERROR=\u9500\u552e\u8ba2\u5355\u521b\u5efa\u5931\u8d25 +isv.wxdc-sales-order-list-service-error\:COMMON_ERROR=\u9500\u552e\u8ba2\u5355\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.wxdc-sales-order-info-service-error\:COMMON_ERROR=\u9500\u552e\u8ba2\u5355\u8be6\u60c5\u83b7\u53d6\u5931\u8d25 +isv.wxdc-store-pay-parameter-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u652f\u4ed8\u53c2\u6570\u5931\u8d25 +isv.wxdc-sales-order-cancel-service-error\:COMMON_ERROR=\u9500\u552e\u8ba2\u5355\u53d6\u6d88\u5931\u8d25 +isv.wxdc-store-order-list-service-error\:COMMON_ERROR=\u95e8\u5e97\u8ba2\u5355\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.wxdc-store-order-confirm-service-error\:COMMON_ERROR=\u95e8\u5e97\u786e\u8ba4\u8ba2\u5355\u5931\u8d25 +isv.wxdc-store-order-cancel-service-error\:COMMON_ERROR=\u95e8\u5e97\u53d6\u6d88\u8ba2\u5355\u5931\u8d25 +isv.wxdc-store-order-delivery-service-error\:COMMON_ERROR=\u95e8\u5e97\u786e\u8ba4\u9001\u8fbe\u5931\u8d25 +isv.wxdc-store-open-status-update-service-error\:COMMON_ERROR=\u95e8\u5e97\u8425\u4e1a\u72b6\u6001\u4fee\u6539,\u64cd\u4f5c\u5931\u8d25 +isv.wxdc-order-refund-user-apply-service-error\:COMMON_ERROR=\u7528\u6237\u7533\u8bf7\u9000\u6b3e,\u64cd\u4f5c\u5931\u8d25 +isv.wxdc-order-refund-store-refuse-service-error\:COMMON_ERROR=\u95e8\u5e97\u62d2\u7edd\u9000\u6b3e,\u64cd\u4f5c\u5931\u8d25 +isv.wxdc-order-refund-store-agree-service-error\:COMMON_ERROR=\u95e8\u5e97\u540c\u610f\u9000\u6b3e,\u64cd\u4f5c\u5931\u8d25 +isv.wxdc-goods-info-service-error\:COMMON_ERROR=\u83b7\u53d6\u5546\u54c1\u8be6\u7ec6\u4fe1\u606f\u5931\u8d25 +isv.wxdc-goods-sellout-service-error\:COMMON_ERROR=\u5fae\u4fe1\u5546\u54c1\u505c\u552e\u5931\u8d25 +isv.wxdc-goods-sellin-service-error\:COMMON_ERROR=\u5fae\u4fe1\u5546\u54c1\u5f00\u5356\u5931\u8d25 + +#\u4fc3\u9500\u76f8\u5173 +isv.promotion-type-list-service-error\:COMMON_ERROR=\u83b7\u53d6\u4fc3\u9500\u7c7b\u578b\u5931\u8d25 +isv.promotion-store-task-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u4fc3\u9500\u4efb\u52a1\u5217\u8868\u5931\u8d25 + +#\u5c0f\u7a0b\u5e8f\u8981\u8d27\u76f8\u5173 +isv.wxyh-goods-list-service-error\:COMMON_ERROR=\u83b7\u53d6\u5546\u54c1\u5931\u8d25 +isv.wxyh-goods-category-list-service-error\:COMMON_ERROR=\u83b7\u53d6\u54c1\u7c7b\u5931\u8d25 + +#\u5de8\u4e3a\u4e91\u7ba1\u5bb6\u76f8\u5173 +isv.ygj-store-set-service-error\:COMMON_ERROR=\u83b7\u53d6\u5de8\u4e3a\u4e91\u7ba1\u5bb6\u95e8\u5e97\u8bbe\u7f6e\u5931\u8d25 +isv.ygj-worker-module-service-error\:COMMON_ERROR=\u83b7\u53d6\u5de8\u4e3a\u4e91\u7ba1\u5bb6\u5458\u5de5\u6743\u9650\u5931\u8d25 +isv.ygj-add-product-check-service-error\:COMMON_ERROR=\u4e91\u7ba1\u5bb6\u5546\u54c1\u65b0\u5efa\u6821\u9a8c\u5931\u8d25 +isv.ygj-add-product-service-error\:COMMON_ERROR=\u4e91\u7ba1\u5bb6\u5546\u54c1\u65b0\u5efa\u5931\u8d25 +isv.ygj-add-suit-service-error\:COMMON_ERROR=\u4e91\u7ba1\u5bb6\u5957\u9910\u521b\u5efa\u5931\u8d25 +isv.ygj-edit-product-service-error\:COMMON_ERROR=\u4e91\u7ba1\u5bb6\u5546\u54c1\u4fee\u6539\u5931\u8d25 +isv.store-shelfed-goods-service-error\:COMMON_ERROR=\u83b7\u53d6\u95e8\u5e97\u81ea\u5efa\u5546\u54c1\u4fe1\u606f\u5217\u8868\u5931\u8d25 +isv.ygj-product-type-service-error\:COMMON_ERROR=\u95e8\u5e97\u5546\u54c1\u5206\u7c7b\u83b7\u53d6\u5931\u8d25 +isv.ygj-material-type-service-error\:COMMON_ERROR=\u95e8\u5e97\u539f\u6599\u5206\u7c7b\u83b7\u53d6\u5931\u8d25 +isv.ygj-product-type-more-service-error\:COMMON_ERROR=\u95e8\u5e97\u5546\u54c1\u5206\u7c7b\u83b7\u53d6\u5931\u8d25 +isv.ygj-product-type-check-service-error\:COMMON_ERROR=\u95e8\u5e97\u5546\u54c1\u5206\u7c7b\u83b7\u53d6\u5931\u8d25 +isv.ygj-product-stock-check-service-error\:COMMON_ERROR=\u5546\u54c1\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 +isv.ygj-store-account-summary-service-error\:COMMON_ERROR=\u95e8\u5e97\u8d26\u53f7\u6c47\u603b\u83b7\u53d6\u5931\u8d25 +#\u5916\u5356\u76f8\u5173 +isv.waimai-order-statistics-service-error\:COMMON_ERROR=\u83b7\u53d6\u5916\u5356\u8ba2\u5355\u7edf\u8ba1\u5931\u8d25 + +#\u5efa\u884c\u4e92\u8054\u7f51\u652f\u4ed8\u76f8\u5173 +isv.ccb-pay-ccbparam-get-service-error\:COMMON_ERROR=\u83b7\u53d6\u8bf7\u6c42\u52a0\u5bc6\u5b57\u7b26\u4e32\u5931\u8d25 + +#\u535a\u591aerp\u63a5\u53e3 +isv.erp-material-unit-error\:COMMON_ERROR=\u4eceerp\u4e2d\u83b7\u53d6\u539f\u6599\u5355\u4f4d\u5931\u8d25 +isv.sync-material-type-error\:COMMON_ERROR=\u540c\u6b65\u539f\u6599\u5206\u7c7b\u8d44\u6599\u5931\u8d25 +isv.sync-material-unit-error\:COMMON_ERROR=\u540c\u6b65\u539f\u6599\u5355\u4f4d\u8d44\u6599\u5931\u8d25 +isv.sync-material-error\:COMMON_ERROR=\u540c\u6b65\u539f\u6599\u8d44\u6599\u5931\u8d25 +isv.boduo-product-list-error\:COMMON_ERROR=\u5546\u54c1\u8d44\u6599\u83b7\u53d6\u5931\u8d25 +isv.boduo-product-spec-error\:COMMON_ERROR=\u5546\u54c1\u89c4\u683c\u83b7\u53d6\u5931\u8d25 +isv.boduo-product-ratio-error\:COMMON_ERROR=\u5546\u54c1\u5e93\u5b58\u7cfb\u6570\u83b7\u53d6\u5931\u8d25 + +#\u7f8e\u98df\u5e7f\u573a\u76f8\u5173 +isv.vpos-product-type-label-service-error\:COMMON_ERROR=\u83b7\u53d6\u5206\u7c7b\u6807\u7b7e\u5931\u8d25 +isv.vpos-product-type-service-error\:COMMON_ERROR=\u83b7\u53d6\u5927\u7c7b\u6570\u636e\u5931\u8d25 +isv.vpos-product-type-two-service-error\:COMMON_ERROR=\u83b7\u53d6\u5c0f\u7c7b\u6570\u636e\u5931\u8d25 +isv.vpos-product-service-error\:COMMON_ERROR=\u83b7\u53d6\u5546\u54c1\u6570\u636e\u5931\u8d25 +isv.vpos-order-create-service-error\:COMMON_ERROR=\u8ba2\u5355\u521b\u5efa\u5931\u8d25 +isv.vpos-order-pay-service-error\:COMMON_ERROR=\u8ba2\u5355\u652f\u4ed8\u4e0a\u4f20\u5931\u8d25 +isv.vpos-order-list-error\:COMMON_ERROR=\u8ba2\u5355\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 +isv.vpos-weixin-pay-error\:COMMON_ERROR=\u5fae\u4fe1JSAPI\u652f\u4ed8\u9519\u8bef +isv.vpos-weixin-pay-query-error\:COMMON_ERROR=\u5fae\u4fe1\u652f\u4ed8\u7ed3\u679c\u67e5\u8be2\u5931\u8d25 +isv.vpos-order-cancel-error\:COMMON_ERROR=\u8ba2\u5355\u53d6\u6d88\u5931\u8d25 +isv.vpos-order-detail-error\:COMMON_ERROR=\u8ba2\u5355\u660e\u7ec6\u83b7\u53d6\u5931\u8d25 +isv.vpos-order-edit-error\:COMMON_ERROR=\u8ba2\u5355\u4fee\u6539\u5931\u8d25 +isv.vpos-order-refund-error\:COMMON_ERROR=\u8ba2\u5355\u9000\u6b3e\u5931\u8d25 +isv.vpos-product-stock-error\:COMMON_ERROR=\u5546\u54c1\u5e93\u5b58\u6821\u9a8c\u5931\u8d25 +isv.vpos-order-refund-part-error\:COMMON_ERROR=\u8ba2\u5355\u9000\u6b3e\u5931\u8d25 +#\u7ecf\u8425\u4f1a\u8ba1\u62a5\u8868 +isv.store-cost-ticket-error\:COMMON_ERROR=\u7ecf\u8425\u4f1a\u8ba1\u62a5\u8868\u83b7\u53d6\u5931\u8d25 +isv.store-cost-ticket-detail-error\:COMMON_ERROR=\u7ecf\u8425\u4f1a\u8ba1\u62a5\u8868\u83b7\u53d6\u5931\u8d25 +isv.store-cost-ticket-save-error\:COMMON_ERROR=\u7ecf\u8425\u4f1a\u8ba1\u62a5\u8868\u4fdd\u5b58\u5931\u8d25 +isv.store-cost-ticket-update-error\:COMMON_ERROR=\u7ecf\u8425\u4f1a\u8ba1\u62a5\u8868\u66f4\u65b0\u5931\u8d25 +isv.store-cost-ticket-updatestatus-error\:COMMON_ERROR=\u7ecf\u8425\u4f1a\u8ba1\u62a5\u8868\u72b6\u6001\u53d8\u66f4\u5931\u8d25 +#\u5de8\u4e3a\u5c0f\u7a0b\u5e8f +isv.program-store-list-sync-service-error\:COMMON_ERROR=\u95e8\u5e97\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.program-store-list-service-error\:COMMON_ERROR=\u95e8\u5e97\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.program-store-detail-service-error\:COMMON_ERROR=\u95e8\u5e97\u8be6\u60c5\u83b7\u53d6\u5931\u8d25 +isv.program-store-stop-service-error\:COMMON_ERROR=\u95e8\u5e97\u505c\u4e1a\u5931\u8d25 +isv.program-store-open-service-error\:COMMON_ERROR=\u95e8\u5e97\u5f00\u4e1a\u5931\u8d25 + +isv.program-useraddress-create-service-error\:COMMON_ERROR=\u7528\u6237\u5730\u5740\u6dfb\u52a0\u5931\u8d25 +isv.program-useraddress-update-service-error\:COMMON_ERROR=\u7528\u6237\u5730\u5740\u4fee\u6539\u5931\u8d25 +isv.program-useraddress-list-service-error\:COMMON_ERROR=\u7528\u6237\u5730\u5740\u5220\u9664\u5931\u8d25 +isv.program-useraddress-delete-service-error\:COMMON_ERROR=\u7528\u6237\u5730\u5740\u5217\u8868\u83b7\u53d6\u5931\u8d25 + +isv.program-product-service-error\:COMMON_ERROR=\u95e8\u5e97\u5546\u54c1\u4fe1\u606f\u83b7\u53d6\u5931\u8d25 + +isv.program-order-create-service-error\:COMMON_ERROR=\u7528\u6237\u8ba2\u5355\u521b\u5efa\u5931\u8d25 +isv.program-order-list-service-error\:COMMON_ERROR=\u7528\u6237\u8ba2\u5355\u5217\u8868\u83b7\u53d6\u5931\u8d25 +isv.program-order-detail-service-error\:COMMON_ERROR=\u7528\u6237\u8ba2\u5355\u8be6\u60c5\u83b7\u53d6\u5931\u8d25 +isv.program-weixin-pay-service-error\:COMMON_ERROR=\u7528\u6237\u5fae\u4fe1\u652f\u4ed8\u7edf\u4e00\u4e0b\u5355\u5931\u8d25 +isv.program-weixin-pay-query-service-error\:COMMON_ERROR=\u7528\u6237\u5fae\u4fe1\u652f\u4ed8\u72b6\u6001\u67e5\u8be2\u5931\u8d25 +isv.program-order-query-bybusno-service-error\:COMMON_ERROR=\u6839\u636e\u8ba2\u5355\u53f7\u83b7\u53d6\u8ba2\u5355\u4fe1\u606f +isv.program-order-confirm-service-error\:COMMON_ERROR=\u5546\u5bb6\u63a5\u5355\u5931\u8d25 +isv.program-order-cancel-service-error\:COMMON_ERROR=\u5546\u5bb6\u62d2\u5355\u5931\u8d25 +isv.program-order-refundagree-service-error\:COMMON_ERROR=\u5546\u5bb6\u540c\u610f\u9000\u6b3e\u5931\u8d25 +isv.program-order-refundreject-service-error\:COMMON_ERROR=\u5546\u5bb6\u62d2\u5355\u9000\u6b3e\u5931\u8d25 +isv.program-handle-order-service-error\:COMMON_ERROR=\u5546\u5bb6\u83b7\u53d6\u5f85\u5904\u7406\u8ba2\u5355\u5931\u8d25 +isv.program-list-order-service-error\:COMMON_ERROR=\u5546\u5bb6\u83b7\u8ba2\u5355\u5217\u8868\u5931\u8d25 +isv.program-order-pay-service-error\:COMMON_ERROR=\u7528\u6237\u4f1a\u5458\u5361\u652f\u4ed8\u4fe1\u606f\u4e0a\u4f20\u5931\u8d25 +isv.program-order-refundapply-service-error\:COMMON_ERROR=\u7528\u6237\u7533\u8bf7\u9000\u6b3e\u5931\u8d25 +isv.program-order-edit-service-error\:COMMON_ERROR=\u4fee\u6539\u8ba2\u5355\u4fe1\u606f\u5931\u8d25 + diff --git a/food-open/food-open-api/target/classes/BOOT-INF/classes/templates/error/404.ftl b/food-open/food-open-api/target/classes/BOOT-INF/classes/templates/error/404.ftl new file mode 100644 index 0000000..0254b6e --- /dev/null +++ b/food-open/food-open-api/target/classes/BOOT-INF/classes/templates/error/404.ftl @@ -0,0 +1,20 @@ + + + + + + +<@spring.message "project.name"/> + + +"> + + + + + +404 +点我返回首页 + + diff --git a/food-open/food-open-api/target/classes/BOOT-INF/classes/templates/error/4xx.ftl b/food-open/food-open-api/target/classes/BOOT-INF/classes/templates/error/4xx.ftl new file mode 100644 index 0000000..cfc7fd8 --- /dev/null +++ b/food-open/food-open-api/target/classes/BOOT-INF/classes/templates/error/4xx.ftl @@ -0,0 +1,20 @@ + + + + + + +<@spring.message "project.name"/> + + +"> + + + + + +Something went wrong (4XX): ${status} ${error}
+点我返回首页 + + diff --git a/food-open/food-open-api/target/classes/BOOT-INF/classes/templates/error/5xx.ftl b/food-open/food-open-api/target/classes/BOOT-INF/classes/templates/error/5xx.ftl new file mode 100644 index 0000000..51c54fc --- /dev/null +++ b/food-open/food-open-api/target/classes/BOOT-INF/classes/templates/error/5xx.ftl @@ -0,0 +1,21 @@ + + + + + + +<@spring.message "project.name"/> + + +"> + + + + + +Something went wrong: ${status} ${error}
+request=${springMacroRequestContext}
+点我返回首页 + + diff --git a/food-open/food-open-api/target/classes/BOOT-INF/classes/templates/index.ftl b/food-open/food-open-api/target/classes/BOOT-INF/classes/templates/index.ftl new file mode 100644 index 0000000..691b01c --- /dev/null +++ b/food-open/food-open-api/target/classes/BOOT-INF/classes/templates/index.ftl @@ -0,0 +1,20 @@ + + + + + + +<@spring.message "project.name"/> + + +"> + + + + + +<@spring.message "project.name"/> + + diff --git a/food-open/food-open-api/target/classes/BOOT-INF/classes/templates/spring.ftl b/food-open/food-open-api/target/classes/BOOT-INF/classes/templates/spring.ftl new file mode 100644 index 0000000..1e4e745 --- /dev/null +++ b/food-open/food-open-api/target/classes/BOOT-INF/classes/templates/spring.ftl @@ -0,0 +1,372 @@ +<#ftl strip_whitespace=true> +<#-- + * spring.ftl + * + * This file consists of a collection of FreeMarker macros aimed at easing + * some of the common requirements of web applications - in particular + * handling of forms. + * + * Spring's FreeMarker support will automatically make this file and therefore + * all macros within it available to any application using Spring's + * FreeMarkerConfigurer. + * + * To take advantage of these macros, the "exposeSpringMacroHelpers" property + * of the FreeMarker class needs to be set to "true". This will expose a + * RequestContext under the name "springMacroRequestContext", as needed by + * the macros in this library. + * + * @author Darren Davison + * @author Juergen Hoeller + * @since 1.1 + --> + <#-- + * 张莹 + * 获取contextPath + * 添加 ${base} 方式应用 + --> +<#macro basePath><#if springMacroRequestContext.getContextPath()=="/"><#else>${springMacroRequestContext.getContextPath()} +<#global base><@basePath/> +<#-- + * message + * + * Macro to translate a message code into a message. + --> +<#macro message code>${springMacroRequestContext.getMessage(code)} + +<#-- + * messageText + * + * Macro to translate a message code into a message, + * using the given default text if no message found. + --> +<#macro messageText code, text>${springMacroRequestContext.getMessage(code, text)} + +<#-- + * messageArgs + * + * Macro to translate a message code with arguments into a message. + --> +<#macro messageArgs code, args>${springMacroRequestContext.getMessage(code, args)} + +<#-- + * messageArgsText + * + * Macro to translate a message code with arguments into a message, + * using the given default text if no message found. + --> +<#macro messageArgsText code, args, text>${springMacroRequestContext.getMessage(code, args, text)} + +<#-- + * theme + * + * Macro to translate a theme message code into a message. + --> +<#macro theme code>${springMacroRequestContext.getThemeMessage(code)} + +<#-- + * themeText + * + * Macro to translate a theme message code into a message, + * using the given default text if no message found. + --> +<#macro themeText code, text>${springMacroRequestContext.getThemeMessage(code, text)} + +<#-- + * themeArgs + * + * Macro to translate a theme message code with arguments into a message. + --> +<#macro themeArgs code, args>${springMacroRequestContext.getThemeMessage(code, args)} + +<#-- + * themeArgsText + * + * Macro to translate a theme message code with arguments into a message, + * using the given default text if no message found. + --> +<#macro themeArgsText code, args, text>${springMacroRequestContext.getThemeMessage(code, args, text)} + +<#-- + * url + * + * Takes a relative URL and makes it absolute from the server root by + * adding the context root for the web application. + --> +<#macro url relativeUrl>${springMacroRequestContext.getContextPath()}${relativeUrl} + +<#-- + * bind + * + * Exposes a BindStatus object for the given bind path, which can be + * a bean (e.g. "person") to get global errors, or a bean property + * (e.g. "person.name") to get field errors. Can be called multiple times + * within a form to bind to multiple command objects and/or field names. + * + * This macro will participate in the default HTML escape setting for the given + * RequestContext. This can be customized by calling "setDefaultHtmlEscape" + * on the "springMacroRequestContext" context variable, or via the + * "defaultHtmlEscape" context-param in web.xml (same as for the JSP bind tag). + * Also regards a "htmlEscape" variable in the namespace of this library. + * + * Producing no output, the following context variable will be available + * each time this macro is referenced (assuming you import this library in + * your templates with the namespace 'spring'): + * + * spring.status : a BindStatus instance holding the command object name, + * expression, value, and error messages and codes for the path supplied + * + * @param path : the path (string value) of the value required to bind to. + * Spring defaults to a command name of "command" but this can be overridden + * by user config. + --> +<#macro bind path> + <#if htmlEscape?exists> + <#assign status = springMacroRequestContext.getBindStatus(path, htmlEscape)> + <#else> + <#assign status = springMacroRequestContext.getBindStatus(path)> + + <#-- assign a temporary value, forcing a string representation for any + kind of variable. This temp value is only used in this macro lib --> + <#if status.value?exists && status.value?is_boolean> + <#assign stringStatusValue=status.value?string> + <#else> + <#assign stringStatusValue=status.value?default("")> + + + +<#-- + * bindEscaped + * + * Similar to spring:bind, but takes an explicit HTML escape flag rather + * than relying on the default HTML escape setting. + --> +<#macro bindEscaped path, htmlEscape> + <#assign status = springMacroRequestContext.getBindStatus(path, htmlEscape)> + <#-- assign a temporary value, forcing a string representation for any + kind of variable. This temp value is only used in this macro lib --> + <#if status.value?exists && status.value?is_boolean> + <#assign stringStatusValue=status.value?string> + <#else> + <#assign stringStatusValue=status.value?default("")> + + + +<#-- + * formInput + * + * Display a form input field of type 'text' and bind it to an attribute + * of a command or bean. + * + * @param path the name of the field to bind to + * @param attributes any additional attributes for the element (such as class + * or CSS styles or size + --> +<#macro formInput path attributes="" fieldType="text"> + <@bind path/> + ${stringStatusValue}" ${attributes}<@closeTag/> + + +<#-- + * formPasswordInput + * + * Display a form input field of type 'password' and bind it to an attribute + * of a command or bean. No value will ever be displayed. This functionality + * can also be obtained by calling the formInput macro with a 'type' parameter + * of 'password'. + * + * @param path the name of the field to bind to + * @param attributes any additional attributes for the element (such as class + * or CSS styles or size + --> +<#macro formPasswordInput path attributes=""> + <@formInput path, attributes, "password"/> + + +<#-- + * formHiddenInput + * + * Generate a form input field of type 'hidden' and bind it to an attribute + * of a command or bean. This functionality can also be obtained by calling + * the formInput macro with a 'type' parameter of 'hidden'. + * + * @param path the name of the field to bind to + * @param attributes any additional attributes for the element (such as class + * or CSS styles or size + --> +<#macro formHiddenInput path attributes=""> + <@formInput path, attributes, "hidden"/> + + +<#-- + * formTextarea + * + * Display a text area and bind it to an attribute of a command or bean. + * + * @param path the name of the field to bind to + * @param attributes any additional attributes for the element (such as class + * or CSS styles or size + --> +<#macro formTextarea path attributes=""> + <@bind path/> + + + +<#-- + * formSingleSelect + * + * Show a selectbox (dropdown) input element allowing a single value to be chosen + * from a list of options. + * + * @param path the name of the field to bind to + * @param options a map (value=label) of all the available options + * @param attributes any additional attributes for the element (such as class + * or CSS styles or size +--> +<#macro formSingleSelect path options attributes=""> + <@bind path/> + + + +<#-- + * formMultiSelect + * + * Show a listbox of options allowing the user to make 0 or more choices from + * the list of options. + * + * @param path the name of the field to bind to + * @param options a map (value=label) of all the available options + * @param attributes any additional attributes for the element (such as class + * or CSS styles or size +--> +<#macro formMultiSelect path options attributes=""> + <@bind path/> + + + +<#-- + * formRadioButtons + * + * Show radio buttons. + * + * @param path the name of the field to bind to + * @param options a map (value=label) of all the available options + * @param separator the html tag or other character list that should be used to + * separate each option. Typically ' ' or '
' + * @param attributes any additional attributes for the element (such as class + * or CSS styles or size +--> +<#macro formRadioButtons path options separator attributes=""> + <@bind path/> + <#list options?keys as value> + <#assign id="${status.expression}${value_index}"> + checked="checked" ${attributes}<@closeTag/> + ${separator} + + + +<#-- + * formCheckboxes + * + * Show checkboxes. + * + * @param path the name of the field to bind to + * @param options a map (value=label) of all the available options + * @param separator the html tag or other character list that should be used to + * separate each option. Typically ' ' or '
' + * @param attributes any additional attributes for the element (such as class + * or CSS styles or size +--> +<#macro formCheckboxes path options separator attributes=""> + <@bind path/> + <#list options?keys as value> + <#assign id="${status.expression}${value_index}"> + <#assign isSelected = contains(status.value?default([""]), value)> + checked="checked" ${attributes}<@closeTag/> + ${separator} + + + + +<#-- + * showErrors + * + * Show validation errors for the currently bound field, with + * optional style attributes. + * + * @param separator the html tag or other character list that should be used to + * separate each option. Typically '
'. + * @param classOrStyle either the name of a CSS class element (which is defined in + * the template or an external CSS file) or an inline style. If the value passed in here + * contains a colon (:) then a 'style=' attribute will be used, else a 'class=' attribute + * will be used. +--> +<#macro showErrors separator classOrStyle=""> + <#list status.errorMessages as error> + <#if classOrStyle == ""> + ${error} + <#else> + <#if classOrStyle?index_of(":") == -1><#assign attr="class"><#else><#assign attr="style"> + ${error} + + <#if error_has_next>${separator} + + + +<#-- + * checkSelected + * + * Check a value in a list to see if it is the currently selected value. + * If so, add the 'selected="selected"' text to the output. + * Handles values of numeric and string types. + * This function is used internally but can be accessed by user code if required. + * + * @param value the current value in a list iteration +--> +<#macro checkSelected value> + <#if stringStatusValue?is_number && stringStatusValue == value?number>selected="selected" + <#if stringStatusValue?is_string && stringStatusValue == value>selected="selected" + + +<#-- + * contains + * + * Macro to return true if the list contains the scalar, false if not. + * Surprisingly not a FreeMarker builtin. + * This function is used internally but can be accessed by user code if required. + * + * @param list the list to search for the item + * @param item the item to search for in the list + * @return true if item is found in the list, false otherwise +--> +<#function contains list item> + <#list list as nextInList> + <#if nextInList == item><#return true> + + <#return false> + + +<#-- + * closeTag + * + * Simple macro to close an HTML tag that has no body with '>' or '/>', + * depending on the value of a 'xhtmlCompliant' variable in the namespace + * of this library. +--> +<#macro closeTag> + <#if xhtmlCompliant?exists && xhtmlCompliant>/><#else>> + diff --git a/food-open/food-open-api/target/classes/BOOT-INF/lib/open-core-1.0.0.jar b/food-open/food-open-api/target/classes/BOOT-INF/lib/open-core-1.0.0.jar new file mode 100644 index 0000000..8625869 Binary files /dev/null and b/food-open/food-open-api/target/classes/BOOT-INF/lib/open-core-1.0.0.jar differ diff --git a/food-open/food-open-api/target/classes/BOOT-INF/lib/qiniu-logging-plugin-logback-1.0.1.jar b/food-open/food-open-api/target/classes/BOOT-INF/lib/qiniu-logging-plugin-logback-1.0.1.jar new file mode 100644 index 0000000..2c7da6d Binary files /dev/null and b/food-open/food-open-api/target/classes/BOOT-INF/lib/qiniu-logging-plugin-logback-1.0.1.jar differ diff --git a/food-open/food-open-api/target/classes/BOOT-INF/lib/qiniu-pandora-sdk-2.1.0.jar b/food-open/food-open-api/target/classes/BOOT-INF/lib/qiniu-pandora-sdk-2.1.0.jar new file mode 100644 index 0000000..ef61313 Binary files /dev/null and b/food-open/food-open-api/target/classes/BOOT-INF/lib/qiniu-pandora-sdk-2.1.0.jar differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/Application.class b/food-open/food-open-api/target/classes/com/jwsaas/Application.class new file mode 100644 index 0000000..9b90ec2 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/Application.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/Constant.class b/food-open/food-open-api/target/classes/com/jwsaas/Constant.class new file mode 100644 index 0000000..5fa4053 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/Constant.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/Global.class b/food-open/food-open-api/target/classes/com/jwsaas/Global.class new file mode 100644 index 0000000..320136b Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/Global.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/AskTicketMoneyListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/AskTicketMoneyListRequest.class new file mode 100644 index 0000000..04607b3 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/AskTicketMoneyListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/CreateDispatchTicketRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/CreateDispatchTicketRequest.class new file mode 100644 index 0000000..dda6312 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/CreateDispatchTicketRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/DeliveryModeListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/DeliveryModeListRequest.class new file mode 100644 index 0000000..2d023a8 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/DeliveryModeListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/DishToErpSyncRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/DishToErpSyncRequest.class new file mode 100644 index 0000000..2c54a16 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/DishToErpSyncRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/ErpProductRatioRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/ErpProductRatioRequest.class new file mode 100644 index 0000000..5668354 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/ErpProductRatioRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/ErpProductRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/ErpProductRequest.class new file mode 100644 index 0000000..704d4a9 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/ErpProductRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/ErpProductSpecRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/ErpProductSpecRequest.class new file mode 100644 index 0000000..0e9c37b Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/ErpProductSpecRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/ErpStoreAskMaterialRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/ErpStoreAskMaterialRequest.class new file mode 100644 index 0000000..27d58bc Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/ErpStoreAskMaterialRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/ErpToPosMaterialSyncRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/ErpToPosMaterialSyncRequest.class new file mode 100644 index 0000000..83e700b Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/ErpToPosMaterialSyncRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/MaterialDetailRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/MaterialDetailRequest.class new file mode 100644 index 0000000..5c83542 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/MaterialDetailRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/MaterialToErpSyncRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/MaterialToErpSyncRequest.class new file mode 100644 index 0000000..c7b10cd Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/MaterialToErpSyncRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/MaterialTypeRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/MaterialTypeRequest.class new file mode 100644 index 0000000..a49252c Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/MaterialTypeRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/MaterialUnitRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/MaterialUnitRequest.class new file mode 100644 index 0000000..9585cb6 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/MaterialUnitRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/PayMoneyTicketRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/PayMoneyTicketRequest.class new file mode 100644 index 0000000..2449832 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/PayMoneyTicketRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/StoreAskMaterialSyncRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/StoreAskMaterialSyncRequest.class new file mode 100644 index 0000000..01c82a8 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/StoreAskMaterialSyncRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/SyncMaterialRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/SyncMaterialRequest.class new file mode 100644 index 0000000..4ba34b1 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/SyncMaterialRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/SyncMaterialTypeRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/SyncMaterialTypeRequest.class new file mode 100644 index 0000000..3fbfb7c Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/SyncMaterialTypeRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/SyncMaterialUnitRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/SyncMaterialUnitRequest.class new file mode 100644 index 0000000..21e2bfe Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/SyncMaterialUnitRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/V1PosDishToV2Request.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/V1PosDishToV2Request.class new file mode 100644 index 0000000..cf3eed0 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/request/V1PosDishToV2Request.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/response/AskTicketMoneyListResponse.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/response/AskTicketMoneyListResponse.class new file mode 100644 index 0000000..23f35eb Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/response/AskTicketMoneyListResponse.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/response/DeliveryModeListResponse.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/response/DeliveryModeListResponse.class new file mode 100644 index 0000000..a14e7f7 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/response/DeliveryModeListResponse.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/response/MaterialDetailResponse.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/response/MaterialDetailResponse.class new file mode 100644 index 0000000..bca4b65 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/response/MaterialDetailResponse.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/response/MaterialTypeResponse.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/response/MaterialTypeResponse.class new file mode 100644 index 0000000..3ce0c21 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/response/MaterialTypeResponse.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/response/MaterialUnitResponse.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/response/MaterialUnitResponse.class new file mode 100644 index 0000000..bb86bd2 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/response/MaterialUnitResponse.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/response/PayMoneyTicketResponse.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/response/PayMoneyTicketResponse.class new file mode 100644 index 0000000..071a1cc Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/response/PayMoneyTicketResponse.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/response/StoreAskMaterialSyncResponse.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/response/StoreAskMaterialSyncResponse.class new file mode 100644 index 0000000..b53f5b1 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/response/StoreAskMaterialSyncResponse.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/AskGoodsTicketErpService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/AskGoodsTicketErpService.class new file mode 100644 index 0000000..779692d Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/AskGoodsTicketErpService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/DeliveryModeListService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/DeliveryModeListService.class new file mode 100644 index 0000000..d2efae8 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/DeliveryModeListService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/ErpToPosDataService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/ErpToPosDataService.class new file mode 100644 index 0000000..8ad4ff5 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/ErpToPosDataService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/MaterialDetailService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/MaterialDetailService.class new file mode 100644 index 0000000..0ebcfad Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/MaterialDetailService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/MaterialTypeService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/MaterialTypeService.class new file mode 100644 index 0000000..e73c039 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/MaterialTypeService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/MaterialUnitService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/MaterialUnitService.class new file mode 100644 index 0000000..531131a Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/MaterialUnitService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/PosToErpDataService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/PosToErpDataService.class new file mode 100644 index 0000000..3fc3ce0 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/PosToErpDataService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/StoreAskMaterialSyncService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/StoreAskMaterialSyncService.class new file mode 100644 index 0000000..e6b4ce9 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/StoreAskMaterialSyncService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/V1PosToV2PosDataService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/V1PosToV2PosDataService.class new file mode 100644 index 0000000..a4f0b70 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/V1PosToV2PosDataService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/impl/AskGoodsTicketErpServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/impl/AskGoodsTicketErpServiceImpl.class new file mode 100644 index 0000000..5af0065 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/impl/AskGoodsTicketErpServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/impl/DeliveryModeListServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/impl/DeliveryModeListServiceImpl.class new file mode 100644 index 0000000..8129306 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/impl/DeliveryModeListServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/impl/ErpToPosDataServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/impl/ErpToPosDataServiceImpl.class new file mode 100644 index 0000000..0ca8145 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/impl/ErpToPosDataServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/impl/MateriaTypeServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/impl/MateriaTypeServiceImpl.class new file mode 100644 index 0000000..bf6289f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/impl/MateriaTypeServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/impl/MateriaUnitServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/impl/MateriaUnitServiceImpl.class new file mode 100644 index 0000000..4fe4474 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/impl/MateriaUnitServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/impl/MaterialDetailServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/impl/MaterialDetailServiceImpl.class new file mode 100644 index 0000000..ca51c71 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/impl/MaterialDetailServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/impl/PosToErpDataServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/impl/PosToErpDataServiceImpl.class new file mode 100644 index 0000000..638dbb5 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/impl/PosToErpDataServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/impl/StoreAskMaterialSyncServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/impl/StoreAskMaterialSyncServiceImpl.class new file mode 100644 index 0000000..9b765ef Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/impl/StoreAskMaterialSyncServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/impl/V1PosToV2PosDataServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/impl/V1PosToV2PosDataServiceImpl.class new file mode 100644 index 0000000..db097af Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/boduo/erp/service/impl/V1PosToV2PosDataServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/pos/MaterialEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/pos/MaterialEntity.class new file mode 100644 index 0000000..f23699b Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/pos/MaterialEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/pos/MaterialInfo.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/pos/MaterialInfo.class new file mode 100644 index 0000000..d35a993 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/pos/MaterialInfo.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/pos/MaterialTypeEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/pos/MaterialTypeEntity.class new file mode 100644 index 0000000..04d5515 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/pos/MaterialTypeEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/pos/MaterialUnitEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/pos/MaterialUnitEntity.class new file mode 100644 index 0000000..5b708c4 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/pos/MaterialUnitEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/pos/PosSetConfigEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/pos/PosSetConfigEntity.class new file mode 100644 index 0000000..2fb0cec Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/pos/PosSetConfigEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/pos/PosSetModuleEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/pos/PosSetModuleEntity.class new file mode 100644 index 0000000..1f45c93 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/pos/PosSetModuleEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/pos/PosSetResourcesEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/pos/PosSetResourcesEntity.class new file mode 100644 index 0000000..81a22f3 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/pos/PosSetResourcesEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/pos/PosSetShortcutEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/pos/PosSetShortcutEntity.class new file mode 100644 index 0000000..88b13bd Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/pos/PosSetShortcutEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/program/AuthAccessToken.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/program/AuthAccessToken.class new file mode 100644 index 0000000..ba2202f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/program/AuthAccessToken.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/program/ProgramStoreBusinessTicketDeliverEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/program/ProgramStoreBusinessTicketDeliverEntity.class new file mode 100644 index 0000000..b419816 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/program/ProgramStoreBusinessTicketDeliverEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/program/ProgramStoreBusinessTicketEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/program/ProgramStoreBusinessTicketEntity.class new file mode 100644 index 0000000..6661e8b Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/program/ProgramStoreBusinessTicketEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/program/ProgramStoreBusinessTicketInfoEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/program/ProgramStoreBusinessTicketInfoEntity.class new file mode 100644 index 0000000..415cdfc Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/program/ProgramStoreBusinessTicketInfoEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/program/ProgramStoreBusinessTicketSycnEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/program/ProgramStoreBusinessTicketSycnEntity.class new file mode 100644 index 0000000..30b2a5f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/program/ProgramStoreBusinessTicketSycnEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/program/ProgramStoreOrderProductEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/program/ProgramStoreOrderProductEntity.class new file mode 100644 index 0000000..ec02015 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/program/ProgramStoreOrderProductEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/program/ProgramStoreOrderProductInfoEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/program/ProgramStoreOrderProductInfoEntity.class new file mode 100644 index 0000000..bc7cf67 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/program/ProgramStoreOrderProductInfoEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/program/ProgramStoreOrderProductMakeEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/program/ProgramStoreOrderProductMakeEntity.class new file mode 100644 index 0000000..5facd11 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/program/ProgramStoreOrderProductMakeEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/program/ProgramStorePayEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/program/ProgramStorePayEntity.class new file mode 100644 index 0000000..a54da86 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/program/ProgramStorePayEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/AskGoodsDetailEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/AskGoodsDetailEntity.class new file mode 100644 index 0000000..a06fe90 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/AskGoodsDetailEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/AskGoodsTemplateDetailEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/AskGoodsTemplateDetailEntity.class new file mode 100644 index 0000000..387a894 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/AskGoodsTemplateDetailEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/AskGoodsTemplateEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/AskGoodsTemplateEntity.class new file mode 100644 index 0000000..c3b01ba Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/AskGoodsTemplateEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/AskGoodsTicketEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/AskGoodsTicketEntity.class new file mode 100644 index 0000000..210f729 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/AskGoodsTicketEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreCostTicketEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreCostTicketEntity.class new file mode 100644 index 0000000..22c59c0 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreCostTicketEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreCostTicketPayTypeEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreCostTicketPayTypeEntity.class new file mode 100644 index 0000000..ad851aa Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreCostTicketPayTypeEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreCostTicketProductChangeEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreCostTicketProductChangeEntity.class new file mode 100644 index 0000000..7bc4e72 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreCostTicketProductChangeEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreCostTicketProductFixedChangeEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreCostTicketProductFixedChangeEntity.class new file mode 100644 index 0000000..390d20c Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreCostTicketProductFixedChangeEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreCostTicketProductMoreChangeEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreCostTicketProductMoreChangeEntity.class new file mode 100644 index 0000000..d6ac905 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreCostTicketProductMoreChangeEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreCostTicketProductOtherChangeEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreCostTicketProductOtherChangeEntity.class new file mode 100644 index 0000000..73a5f76 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreCostTicketProductOtherChangeEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreCostTicketProductTypeEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreCostTicketProductTypeEntity.class new file mode 100644 index 0000000..1081cc4 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreCostTicketProductTypeEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreStockCheckTicketDetailEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreStockCheckTicketDetailEntity.class new file mode 100644 index 0000000..4ce6270 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreStockCheckTicketDetailEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreStockCheckTicketEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreStockCheckTicketEntity.class new file mode 100644 index 0000000..9c5efff Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreStockCheckTicketEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreStorageOutTicketDetailEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreStorageOutTicketDetailEntity.class new file mode 100644 index 0000000..72fe408 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreStorageOutTicketDetailEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreStorageOutTicketEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreStorageOutTicketEntity.class new file mode 100644 index 0000000..64429e6 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreStorageOutTicketEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreStorageTicketDetailEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreStorageTicketDetailEntity.class new file mode 100644 index 0000000..1e39901 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreStorageTicketDetailEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreStorageTicketEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreStorageTicketEntity.class new file mode 100644 index 0000000..460c4a8 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/storage/StoreStorageTicketEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreBusinessLogEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreBusinessLogEntity.class new file mode 100644 index 0000000..e163b84 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreBusinessLogEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreBusinessOrderBurdenEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreBusinessOrderBurdenEntity.class new file mode 100644 index 0000000..e0be0ab Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreBusinessOrderBurdenEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreBusinessTicketDeliveryEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreBusinessTicketDeliveryEntity.class new file mode 100644 index 0000000..a602a95 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreBusinessTicketDeliveryEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreBusinessTicketEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreBusinessTicketEntity.class new file mode 100644 index 0000000..f18a85f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreBusinessTicketEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreBusinessTicketExtendEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreBusinessTicketExtendEntity.class new file mode 100644 index 0000000..fe38f50 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreBusinessTicketExtendEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreBusinessTicketInfoEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreBusinessTicketInfoEntity.class new file mode 100644 index 0000000..16575ba Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreBusinessTicketInfoEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreBusinessTicketInfoExtendEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreBusinessTicketInfoExtendEntity.class new file mode 100644 index 0000000..a501369 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreBusinessTicketInfoExtendEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreBusinessTicketTableEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreBusinessTicketTableEntity.class new file mode 100644 index 0000000..0c83300 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreBusinessTicketTableEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreCostRevenueEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreCostRevenueEntity.class new file mode 100644 index 0000000..848b199 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreCostRevenueEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreHandoverDetailEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreHandoverDetailEntity.class new file mode 100644 index 0000000..82570fe Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreHandoverDetailEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreHandoverDetailPartEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreHandoverDetailPartEntity.class new file mode 100644 index 0000000..e3217b4 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreHandoverDetailPartEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreHandoverDetailPayEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreHandoverDetailPayEntity.class new file mode 100644 index 0000000..8ae2268 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreHandoverDetailPayEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreHandoverEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreHandoverEntity.class new file mode 100644 index 0000000..62dcc8b Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreHandoverEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreOperationLogEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreOperationLogEntity.class new file mode 100644 index 0000000..f2a85a4 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreOperationLogEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreOrderBurdenEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreOrderBurdenEntity.class new file mode 100644 index 0000000..5265780 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreOrderBurdenEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreOrderProductEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreOrderProductEntity.class new file mode 100644 index 0000000..41bb011 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreOrderProductEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreOrderProductExtendEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreOrderProductExtendEntity.class new file mode 100644 index 0000000..fcf622a Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreOrderProductExtendEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreOrderProductInfoEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreOrderProductInfoEntity.class new file mode 100644 index 0000000..640af46 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreOrderProductInfoEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreOrderProductInfoExtendEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreOrderProductInfoExtendEntity.class new file mode 100644 index 0000000..bf9534c Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreOrderProductInfoExtendEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreOrderProductMakeEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreOrderProductMakeEntity.class new file mode 100644 index 0000000..dc39b29 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreOrderProductMakeEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreOrderProductMakeExtendEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreOrderProductMakeExtendEntity.class new file mode 100644 index 0000000..431d9d1 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StoreOrderProductMakeExtendEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StorePayEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StorePayEntity.class new file mode 100644 index 0000000..3b6aba2 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StorePayEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StorePayExtendEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StorePayExtendEntity.class new file mode 100644 index 0000000..98e26f3 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/upload/StorePayExtendEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/visitor/VisitorAddressEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/visitor/VisitorAddressEntity.class new file mode 100644 index 0000000..c352301 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/visitor/VisitorAddressEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/visitor/VisitorEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/visitor/VisitorEntity.class new file mode 100644 index 0000000..0ecd0d6 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/visitor/VisitorEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/visitor/VisitorTagEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/visitor/VisitorTagEntity.class new file mode 100644 index 0000000..cdeadbb Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/visitor/VisitorTagEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/vpos/VposStoreBusinessTicketEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/vpos/VposStoreBusinessTicketEntity.class new file mode 100644 index 0000000..9cea7b0 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/vpos/VposStoreBusinessTicketEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/vpos/VposStoreBusinessTicketInfoEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/vpos/VposStoreBusinessTicketInfoEntity.class new file mode 100644 index 0000000..0623176 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/vpos/VposStoreBusinessTicketInfoEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/vpos/VposStoreBusinessTicketRefundPartEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/vpos/VposStoreBusinessTicketRefundPartEntity.class new file mode 100644 index 0000000..2306c94 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/vpos/VposStoreBusinessTicketRefundPartEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/vpos/VposStoreOrderProductEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/vpos/VposStoreOrderProductEntity.class new file mode 100644 index 0000000..5e9d87f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/vpos/VposStoreOrderProductEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/vpos/VposStoreOrderProductInfoEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/vpos/VposStoreOrderProductInfoEntity.class new file mode 100644 index 0000000..33a4192 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/vpos/VposStoreOrderProductInfoEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/vpos/VposStoreOrderProductMakeEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/vpos/VposStoreOrderProductMakeEntity.class new file mode 100644 index 0000000..17df5de Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/vpos/VposStoreOrderProductMakeEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/vpos/VposStoreOrderProductMakeRefundPartEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/vpos/VposStoreOrderProductMakeRefundPartEntity.class new file mode 100644 index 0000000..18ae964 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/vpos/VposStoreOrderProductMakeRefundPartEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/vpos/VposStoreOrderProductRefundPartEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/vpos/VposStoreOrderProductRefundPartEntity.class new file mode 100644 index 0000000..d7f2f97 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/vpos/VposStoreOrderProductRefundPartEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/vpos/VposStorePayEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/vpos/VposStorePayEntity.class new file mode 100644 index 0000000..5df8c9b Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/vpos/VposStorePayEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/vpos/VposStorePayRefundPartEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/vpos/VposStorePayRefundPartEntity.class new file mode 100644 index 0000000..6769078 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/vpos/VposStorePayRefundPartEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/wxdc/SalesOrderEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/wxdc/SalesOrderEntity.class new file mode 100644 index 0000000..ed2b34e Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/wxdc/SalesOrderEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/wxdc/SalesOrderItemEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/wxdc/SalesOrderItemEntity.class new file mode 100644 index 0000000..fb295e0 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/wxdc/SalesOrderItemEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/wxdc/SalesOrderItemMakeEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/wxdc/SalesOrderItemMakeEntity.class new file mode 100644 index 0000000..cf936c8 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/wxdc/SalesOrderItemMakeEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/wxdc/SalesOrderItemPromoEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/wxdc/SalesOrderItemPromoEntity.class new file mode 100644 index 0000000..03ee3a5 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/wxdc/SalesOrderItemPromoEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/entity/wxdc/SalesOrderPayEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/wxdc/SalesOrderPayEntity.class new file mode 100644 index 0000000..343c6ac Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/entity/wxdc/SalesOrderPayEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/qimai/request/CategoryUpdateRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/qimai/request/CategoryUpdateRequest.class new file mode 100644 index 0000000..7844eb0 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/qimai/request/CategoryUpdateRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/qimai/service/QiMaiProductTypeService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/qimai/service/QiMaiProductTypeService.class new file mode 100644 index 0000000..283012b Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/qimai/service/QiMaiProductTypeService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/qimai/service/impl/QiMaiBaseServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/qimai/service/impl/QiMaiBaseServiceImpl.class new file mode 100644 index 0000000..340319f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/qimai/service/impl/QiMaiBaseServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/qimai/service/impl/QiMaiProductTypeServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/qimai/service/impl/QiMaiProductTypeServiceImpl.class new file mode 100644 index 0000000..58b08be Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/qimai/service/impl/QiMaiProductTypeServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/AbstractRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/AbstractRequest.class new file mode 100644 index 0000000..4d65ad7 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/AbstractRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/cardsync/ProductListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/cardsync/ProductListRequest.class new file mode 100644 index 0000000..274e626 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/cardsync/ProductListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/cardsync/ProductTypeRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/cardsync/ProductTypeRequest.class new file mode 100644 index 0000000..e34befa Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/cardsync/ProductTypeRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/cardsync/StoreMessageRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/cardsync/StoreMessageRequest.class new file mode 100644 index 0000000..b0acef6 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/cardsync/StoreMessageRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/cardsync/StorePayTypeRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/cardsync/StorePayTypeRequest.class new file mode 100644 index 0000000..504db9b Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/cardsync/StorePayTypeRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/cardsync/StorePosRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/cardsync/StorePosRequest.class new file mode 100644 index 0000000..343fa3e Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/cardsync/StorePosRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/cardsync/StoreTypeRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/cardsync/StoreTypeRequest.class new file mode 100644 index 0000000..20a1d24 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/cardsync/StoreTypeRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/cardsync/StoreWorkerRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/cardsync/StoreWorkerRequest.class new file mode 100644 index 0000000..673fcc2 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/cardsync/StoreWorkerRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/ccb/CcbParamGetRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/ccb/CcbParamGetRequest.class new file mode 100644 index 0000000..a78330b Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/ccb/CcbParamGetRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/common/SayHelloRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/common/SayHelloRequest.class new file mode 100644 index 0000000..81da4a9 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/common/SayHelloRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/common/SessionCreateRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/common/SessionCreateRequest.class new file mode 100644 index 0000000..1e3e3d6 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/common/SessionCreateRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/common/SessionGetRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/common/SessionGetRequest.class new file mode 100644 index 0000000..d13fabb Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/common/SessionGetRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/common/SessionRemoveRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/common/SessionRemoveRequest.class new file mode 100644 index 0000000..ee6ff9b Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/common/SessionRemoveRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/costlimit/CostTicketTemplateRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/costlimit/CostTicketTemplateRequest.class new file mode 100644 index 0000000..9cd2a26 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/costlimit/CostTicketTemplateRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/jwygj/ProductSpecInfoEntity.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/jwygj/ProductSpecInfoEntity.class new file mode 100644 index 0000000..c730352 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/jwygj/ProductSpecInfoEntity.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/jwygj/YgjAddProductCheckRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/jwygj/YgjAddProductCheckRequest.class new file mode 100644 index 0000000..fa5be4c Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/jwygj/YgjAddProductCheckRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/jwygj/YgjAddProductRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/jwygj/YgjAddProductRequest.class new file mode 100644 index 0000000..6a72a94 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/jwygj/YgjAddProductRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/jwygj/YgjAddSuitRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/jwygj/YgjAddSuitRequest.class new file mode 100644 index 0000000..582e874 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/jwygj/YgjAddSuitRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/jwygj/YgjEditProductRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/jwygj/YgjEditProductRequest.class new file mode 100644 index 0000000..dcdafb9 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/jwygj/YgjEditProductRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/jwygj/YgjProductTypeRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/jwygj/YgjProductTypeRequest.class new file mode 100644 index 0000000..e840861 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/jwygj/YgjProductTypeRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/jwygj/YgjStoreAccountSummaryRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/jwygj/YgjStoreAccountSummaryRequest.class new file mode 100644 index 0000000..7d51930 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/jwygj/YgjStoreAccountSummaryRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/jwygj/YgjStoreSetRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/jwygj/YgjStoreSetRequest.class new file mode 100644 index 0000000..6f4bb44 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/jwygj/YgjStoreSetRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/jwygj/YgjWorkerModuleRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/jwygj/YgjWorkerModuleRequest.class new file mode 100644 index 0000000..525191d Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/jwygj/YgjWorkerModuleRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/kds/KdsPlanRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/kds/KdsPlanRequest.class new file mode 100644 index 0000000..1876b2f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/kds/KdsPlanRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/kds/KdsProductRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/kds/KdsProductRequest.class new file mode 100644 index 0000000..d94004f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/kds/KdsProductRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/kit/KitPlanRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/kit/KitPlanRequest.class new file mode 100644 index 0000000..baea8e9 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/kit/KitPlanRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/kit/KitProductRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/kit/KitProductRequest.class new file mode 100644 index 0000000..1212dbe Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/kit/KitProductRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/kms/ProductSalesInfoRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/kms/ProductSalesInfoRequest.class new file mode 100644 index 0000000..9496a0d Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/kms/ProductSalesInfoRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/liteappdc/LiteAppOrderCreateRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/liteappdc/LiteAppOrderCreateRequest.class new file mode 100644 index 0000000..f41da39 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/liteappdc/LiteAppOrderCreateRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/liteappdc/LiteAppSalesOrderCreateRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/liteappdc/LiteAppSalesOrderCreateRequest.class new file mode 100644 index 0000000..3975f77 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/liteappdc/LiteAppSalesOrderCreateRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/liteappdc/LiteAppWxdcSalesOrderCreateRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/liteappdc/LiteAppWxdcSalesOrderCreateRequest.class new file mode 100644 index 0000000..7b7ca73 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/liteappdc/LiteAppWxdcSalesOrderCreateRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/liteappdc/LiteAppWxdcSalesPayDataRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/liteappdc/LiteAppWxdcSalesPayDataRequest.class new file mode 100644 index 0000000..43f4203 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/liteappdc/LiteAppWxdcSalesPayDataRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/ops/CityInfoListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/ops/CityInfoListRequest.class new file mode 100644 index 0000000..1f3107f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/ops/CityInfoListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/pay/PaymentParameterRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/pay/PaymentParameterRequest.class new file mode 100644 index 0000000..24034c1 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/pay/PaymentParameterRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/peripheral/CardReaderInfoRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/peripheral/CardReaderInfoRequest.class new file mode 100644 index 0000000..7c336bf Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/peripheral/CardReaderInfoRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/peripheral/PrinterInfoRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/peripheral/PrinterInfoRequest.class new file mode 100644 index 0000000..7e25c6e Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/peripheral/PrinterInfoRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/pos/ErpPosSetRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/pos/ErpPosSetRequest.class new file mode 100644 index 0000000..1e2cff7 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/pos/ErpPosSetRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/pos/PosAuthRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/pos/PosAuthRequest.class new file mode 100644 index 0000000..db6bb69 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/pos/PosAuthRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/pos/PosMonitorRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/pos/PosMonitorRequest.class new file mode 100644 index 0000000..75c1643 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/pos/PosMonitorRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/pos/PosRegisterRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/pos/PosRegisterRequest.class new file mode 100644 index 0000000..6aad101 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/pos/PosRegisterRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/pos/PosRegisterV1ToV2Request.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/pos/PosRegisterV1ToV2Request.class new file mode 100644 index 0000000..3030ac4 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/pos/PosRegisterV1ToV2Request.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/pos/PosSetPlanDownRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/pos/PosSetPlanDownRequest.class new file mode 100644 index 0000000..7cf12a1 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/pos/PosSetPlanDownRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/pos/PosSetPlanRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/pos/PosSetPlanRequest.class new file mode 100644 index 0000000..f9964df Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/pos/PosSetPlanRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/pos/PosSetPlanUpRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/pos/PosSetPlanUpRequest.class new file mode 100644 index 0000000..23e0357 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/pos/PosSetPlanUpRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/pos/ServerDataVersionRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/pos/ServerDataVersionRequest.class new file mode 100644 index 0000000..38e07c1 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/pos/ServerDataVersionRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/pos/TenantLineAuthRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/pos/TenantLineAuthRequest.class new file mode 100644 index 0000000..9f1828d Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/pos/TenantLineAuthRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/MakeBurdenRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/MakeBurdenRequest.class new file mode 100644 index 0000000..dadc545 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/MakeBurdenRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/ProductBrandRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/ProductBrandRequest.class new file mode 100644 index 0000000..53f7e68 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/ProductBrandRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/ProductBurdenRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/ProductBurdenRequest.class new file mode 100644 index 0000000..4769618 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/ProductBurdenRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/ProductImageRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/ProductImageRequest.class new file mode 100644 index 0000000..189e762 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/ProductImageRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/ProductMakeDetailRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/ProductMakeDetailRequest.class new file mode 100644 index 0000000..1eb2525 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/ProductMakeDetailRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/ProductRatioRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/ProductRatioRequest.class new file mode 100644 index 0000000..b3effb0 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/ProductRatioRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/ProductRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/ProductRequest.class new file mode 100644 index 0000000..41baaae Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/ProductRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/ProductSpecRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/ProductSpecRequest.class new file mode 100644 index 0000000..815b84d Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/ProductSpecRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/ProductSuitDetailRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/ProductSuitDetailRequest.class new file mode 100644 index 0000000..32b59af Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/ProductSuitDetailRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/ProductSuitRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/ProductSuitRequest.class new file mode 100644 index 0000000..9fb03f4 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/ProductSuitRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/ProductTypeRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/ProductTypeRequest.class new file mode 100644 index 0000000..a9cee81 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/ProductTypeRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/ProductUnitRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/ProductUnitRequest.class new file mode 100644 index 0000000..3bd1393 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/ProductUnitRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/StoreMakeDetailRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/StoreMakeDetailRequest.class new file mode 100644 index 0000000..846914b Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/StoreMakeDetailRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/StoreMakeTypeRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/StoreMakeTypeRequest.class new file mode 100644 index 0000000..3aa73e2 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/product/StoreMakeTypeRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramAdvPictureRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramAdvPictureRequest.class new file mode 100644 index 0000000..306b86d Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramAdvPictureRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramEvaluateDownloadRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramEvaluateDownloadRequest.class new file mode 100644 index 0000000..ff65e1c Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramEvaluateDownloadRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramEvaluateUploadRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramEvaluateUploadRequest.class new file mode 100644 index 0000000..fd1d23d Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramEvaluateUploadRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramListOrderRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramListOrderRequest.class new file mode 100644 index 0000000..3ef4d97 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramListOrderRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderCancelRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderCancelRequest.class new file mode 100644 index 0000000..c7c238c Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderCancelRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderConfirmRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderConfirmRequest.class new file mode 100644 index 0000000..85a4ede Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderConfirmRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderCreateRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderCreateRequest.class new file mode 100644 index 0000000..4cc2682 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderCreateRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderCreateSyncRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderCreateSyncRequest.class new file mode 100644 index 0000000..12bad46 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderCreateSyncRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderDetailRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderDetailRequest.class new file mode 100644 index 0000000..ae8b997 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderDetailRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderEditRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderEditRequest.class new file mode 100644 index 0000000..cc665da Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderEditRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderHandlePeriodRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderHandlePeriodRequest.class new file mode 100644 index 0000000..283808e Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderHandlePeriodRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderHandleRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderHandleRequest.class new file mode 100644 index 0000000..50cd7ea Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderHandleRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderListRequest.class new file mode 100644 index 0000000..5f76729 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderPayRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderPayRequest.class new file mode 100644 index 0000000..c3dedc5 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderPayRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderQueryByBusNoRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderQueryByBusNoRequest.class new file mode 100644 index 0000000..b036838 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderQueryByBusNoRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderQueryByTlBusNoRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderQueryByTlBusNoRequest.class new file mode 100644 index 0000000..322a59f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderQueryByTlBusNoRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderRefundAgreeRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderRefundAgreeRequest.class new file mode 100644 index 0000000..aee33e7 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderRefundAgreeRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderRefundApplyRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderRefundApplyRequest.class new file mode 100644 index 0000000..b5fe425 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderRefundApplyRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderRefundRejectRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderRefundRejectRequest.class new file mode 100644 index 0000000..44b07f1 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramOrderRefundRejectRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramProductDetailRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramProductDetailRequest.class new file mode 100644 index 0000000..d1c103a Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramProductDetailRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramProductRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramProductRequest.class new file mode 100644 index 0000000..3a2c603 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramProductRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramProductSaleStatusRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramProductSaleStatusRequest.class new file mode 100644 index 0000000..3726a41 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramProductSaleStatusRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramProductStockRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramProductStockRequest.class new file mode 100644 index 0000000..4b324bc Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramProductStockRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramStoreDetailRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramStoreDetailRequest.class new file mode 100644 index 0000000..ed6993d Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramStoreDetailRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramStoreListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramStoreListRequest.class new file mode 100644 index 0000000..9d5fcce Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramStoreListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramStoreListSyncRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramStoreListSyncRequest.class new file mode 100644 index 0000000..acdf700 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramStoreListSyncRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramStoreOpenRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramStoreOpenRequest.class new file mode 100644 index 0000000..a6a3512 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramStoreOpenRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramStoreStopRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramStoreStopRequest.class new file mode 100644 index 0000000..643186c Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramStoreStopRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramUserAddressCreateRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramUserAddressCreateRequest.class new file mode 100644 index 0000000..da05c91 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramUserAddressCreateRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramUserAddressDeleteRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramUserAddressDeleteRequest.class new file mode 100644 index 0000000..854817d Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramUserAddressDeleteRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramUserAddressListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramUserAddressListRequest.class new file mode 100644 index 0000000..766ac90 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramUserAddressListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramUserAddressUpdateRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramUserAddressUpdateRequest.class new file mode 100644 index 0000000..961d361 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramUserAddressUpdateRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramUserWeixinFormIdRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramUserWeixinFormIdRequest.class new file mode 100644 index 0000000..dd9157c Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramUserWeixinFormIdRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramWeixinPayQueryRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramWeixinPayQueryRequest.class new file mode 100644 index 0000000..b2a7dd7 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramWeixinPayQueryRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramWeixinPayRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramWeixinPayRequest.class new file mode 100644 index 0000000..a621277 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/program/ProgramWeixinPayRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/promotion/PromotionTypeListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/promotion/PromotionTypeListRequest.class new file mode 100644 index 0000000..2c9d8d5 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/promotion/PromotionTypeListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/promotion/StorePromotionTaskRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/promotion/StorePromotionTaskRequest.class new file mode 100644 index 0000000..4248691 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/promotion/StorePromotionTaskRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/split/SplitFoodAccountRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/split/SplitFoodAccountRequest.class new file mode 100644 index 0000000..c24e8cb Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/split/SplitFoodAccountRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/split/SplitShopAccountRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/split/SplitShopAccountRequest.class new file mode 100644 index 0000000..955c24d Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/split/SplitShopAccountRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/split/SplitStorePayRequet.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/split/SplitStorePayRequet.class new file mode 100644 index 0000000..e2903af Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/split/SplitStorePayRequet.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/spwxdc/SpWxdcOrderCreateRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/spwxdc/SpWxdcOrderCreateRequest.class new file mode 100644 index 0000000..6f21cac Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/spwxdc/SpWxdcOrderCreateRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/AskGoodsDetailRemoveRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/AskGoodsDetailRemoveRequest.class new file mode 100644 index 0000000..a10096f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/AskGoodsDetailRemoveRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/AskGoodsDetailRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/AskGoodsDetailRequest.class new file mode 100644 index 0000000..6429b91 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/AskGoodsDetailRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/AskGoodsTemplateAddRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/AskGoodsTemplateAddRequest.class new file mode 100644 index 0000000..069c4ad Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/AskGoodsTemplateAddRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/AskGoodsTemplateDetailRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/AskGoodsTemplateDetailRequest.class new file mode 100644 index 0000000..6fde791 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/AskGoodsTemplateDetailRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/AskGoodsTemplateEditRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/AskGoodsTemplateEditRequest.class new file mode 100644 index 0000000..6e34fb7 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/AskGoodsTemplateEditRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/AskGoodsTemplateListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/AskGoodsTemplateListRequest.class new file mode 100644 index 0000000..2be0a71 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/AskGoodsTemplateListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/AskGoodsTicketAddRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/AskGoodsTicketAddRequest.class new file mode 100644 index 0000000..4aa250e Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/AskGoodsTicketAddRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/AskGoodsTicketEditRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/AskGoodsTicketEditRequest.class new file mode 100644 index 0000000..6f8a0c2 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/AskGoodsTicketEditRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/AskGoodsTicketRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/AskGoodsTicketRequest.class new file mode 100644 index 0000000..4a9863a Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/AskGoodsTicketRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/AskGoodsTicketStatusRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/AskGoodsTicketStatusRequest.class new file mode 100644 index 0000000..daa9036 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/AskGoodsTicketStatusRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/DispatchTicketDetailRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/DispatchTicketDetailRequest.class new file mode 100644 index 0000000..19bc5bd Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/DispatchTicketDetailRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/DispatchTicketReceiveRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/DispatchTicketReceiveRequest.class new file mode 100644 index 0000000..54e710a Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/DispatchTicketReceiveRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/DispatchTicketRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/DispatchTicketRequest.class new file mode 100644 index 0000000..9cf1b08 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/DispatchTicketRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/ProductDispatchPriceRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/ProductDispatchPriceRequest.class new file mode 100644 index 0000000..2e8bfac Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/ProductDispatchPriceRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/ProductStockRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/ProductStockRequest.class new file mode 100644 index 0000000..8aff9ec Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/ProductStockRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreCostTicketDetailRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreCostTicketDetailRequest.class new file mode 100644 index 0000000..0753c74 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreCostTicketDetailRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreCostTicketRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreCostTicketRequest.class new file mode 100644 index 0000000..f15a8f3 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreCostTicketRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreCostTicketSalesInfoRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreCostTicketSalesInfoRequest.class new file mode 100644 index 0000000..3c4900a Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreCostTicketSalesInfoRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreCostTicketSaveRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreCostTicketSaveRequest.class new file mode 100644 index 0000000..9b73279 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreCostTicketSaveRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreCostTicketUpdateRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreCostTicketUpdateRequest.class new file mode 100644 index 0000000..dfb75e8 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreCostTicketUpdateRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreCostTicketUpdateStatusRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreCostTicketUpdateStatusRequest.class new file mode 100644 index 0000000..9c89e08 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreCostTicketUpdateStatusRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreProductStockOutSummaryRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreProductStockOutSummaryRequest.class new file mode 100644 index 0000000..90c37c3 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreProductStockOutSummaryRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreProductStockRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreProductStockRequest.class new file mode 100644 index 0000000..ea95aa6 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreProductStockRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreProductStockSumRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreProductStockSumRequest.class new file mode 100644 index 0000000..84d9116 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreProductStockSumRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStockCheckProductValidRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStockCheckProductValidRequest.class new file mode 100644 index 0000000..a2869ad Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStockCheckProductValidRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStockCheckSummaryRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStockCheckSummaryRequest.class new file mode 100644 index 0000000..9c43530 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStockCheckSummaryRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStockCheckTemplateDetailRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStockCheckTemplateDetailRequest.class new file mode 100644 index 0000000..d8ed182 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStockCheckTemplateDetailRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStockCheckTemplateListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStockCheckTemplateListRequest.class new file mode 100644 index 0000000..1e0af4d Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStockCheckTemplateListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStockCheckTicketAddRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStockCheckTicketAddRequest.class new file mode 100644 index 0000000..138fbf1 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStockCheckTicketAddRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStockCheckTicketDetailDelRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStockCheckTicketDetailDelRequest.class new file mode 100644 index 0000000..b0ebe92 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStockCheckTicketDetailDelRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStockCheckTicketDetailRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStockCheckTicketDetailRequest.class new file mode 100644 index 0000000..0f0c854 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStockCheckTicketDetailRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStockCheckTicketRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStockCheckTicketRequest.class new file mode 100644 index 0000000..de1559c Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStockCheckTicketRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStockUnCheckTicketDetailRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStockUnCheckTicketDetailRequest.class new file mode 100644 index 0000000..0dec575 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStockUnCheckTicketDetailRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStockUnCheckTicketDetailUpdateRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStockUnCheckTicketDetailUpdateRequest.class new file mode 100644 index 0000000..05ba715 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStockUnCheckTicketDetailUpdateRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStockUnCheckTicketStatusUpdateRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStockUnCheckTicketStatusUpdateRequest.class new file mode 100644 index 0000000..bf8cb98 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStockUnCheckTicketStatusUpdateRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageOutTicketAddRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageOutTicketAddRequest.class new file mode 100644 index 0000000..ed4b66f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageOutTicketAddRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageOutTicketDetailRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageOutTicketDetailRequest.class new file mode 100644 index 0000000..91f0de8 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageOutTicketDetailRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageOutTicketEditRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageOutTicketEditRequest.class new file mode 100644 index 0000000..8901541 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageOutTicketEditRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageOutTicketListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageOutTicketListRequest.class new file mode 100644 index 0000000..b0e34d5 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageOutTicketListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageOutTicketStatusChangeRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageOutTicketStatusChangeRequest.class new file mode 100644 index 0000000..4b33c8d Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageOutTicketStatusChangeRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageRequest.class new file mode 100644 index 0000000..ceb0ba9 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageTicketAddRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageTicketAddRequest.class new file mode 100644 index 0000000..6dc602f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageTicketAddRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageTicketDetailRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageTicketDetailRequest.class new file mode 100644 index 0000000..883bae4 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageTicketDetailRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageTicketEditRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageTicketEditRequest.class new file mode 100644 index 0000000..a422d6a Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageTicketEditRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageTicketListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageTicketListRequest.class new file mode 100644 index 0000000..b641793 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageTicketListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageTicketStatusChangeRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageTicketStatusChangeRequest.class new file mode 100644 index 0000000..b6b36da Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageTicketStatusChangeRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageTicketTypeRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageTicketTypeRequest.class new file mode 100644 index 0000000..6381c17 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/storage/StoreStorageTicketTypeRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/AdjustPriceDetailRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/AdjustPriceDetailRequest.class new file mode 100644 index 0000000..6ec6691 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/AdjustPriceDetailRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/AdjustPriceTicketAddRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/AdjustPriceTicketAddRequest.class new file mode 100644 index 0000000..55c4107 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/AdjustPriceTicketAddRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/AdjustPriceTicketAuditRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/AdjustPriceTicketAuditRequest.class new file mode 100644 index 0000000..64649cb Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/AdjustPriceTicketAuditRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/AdjustPriceTicketEditRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/AdjustPriceTicketEditRequest.class new file mode 100644 index 0000000..5535f63 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/AdjustPriceTicketEditRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/AdjustPriceTicketRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/AdjustPriceTicketRequest.class new file mode 100644 index 0000000..cb780e9 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/AdjustPriceTicketRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/BrandRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/BrandRequest.class new file mode 100644 index 0000000..5d77733 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/BrandRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/SalesOrderSummaryRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/SalesOrderSummaryRequest.class new file mode 100644 index 0000000..5db7785 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/SalesOrderSummaryRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountDetailInfoRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountDetailInfoRequest.class new file mode 100644 index 0000000..60b1280 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountDetailInfoRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountDetailInfoRequest2.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountDetailInfoRequest2.class new file mode 100644 index 0000000..6d4798b Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountDetailInfoRequest2.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountDetailListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountDetailListRequest.class new file mode 100644 index 0000000..9da16cc Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountDetailListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountEnchashmentApplyRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountEnchashmentApplyRequest.class new file mode 100644 index 0000000..43c1e7d Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountEnchashmentApplyRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountEnchashmentCancelRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountEnchashmentCancelRequest.class new file mode 100644 index 0000000..0ac0ab5 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountEnchashmentCancelRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountEnchashmentInfoRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountEnchashmentInfoRequest.class new file mode 100644 index 0000000..8347356 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountEnchashmentInfoRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountEnchashmentListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountEnchashmentListRequest.class new file mode 100644 index 0000000..752537d Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountEnchashmentListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountGetRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountGetRequest.class new file mode 100644 index 0000000..8cf2dc6 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountGetRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountRechargeParameterRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountRechargeParameterRequest.class new file mode 100644 index 0000000..5a4a346 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountRechargeParameterRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountRechargeRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountRechargeRequest.class new file mode 100644 index 0000000..f248452 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountRechargeRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountRechargeWeixinPayOrderQueryRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountRechargeWeixinPayOrderQueryRequest.class new file mode 100644 index 0000000..83aecd4 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountRechargeWeixinPayOrderQueryRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountRechargeWeixinPayOrderQueryRequest2.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountRechargeWeixinPayOrderQueryRequest2.class new file mode 100644 index 0000000..ae541e6 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountRechargeWeixinPayOrderQueryRequest2.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountRechargeWeixinPayUnifiedorderRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountRechargeWeixinPayUnifiedorderRequest.class new file mode 100644 index 0000000..6b76bdf Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAccountRechargeWeixinPayUnifiedorderRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAdvertCaptionRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAdvertCaptionRequest.class new file mode 100644 index 0000000..f538a98 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAdvertCaptionRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAdvertPictureRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAdvertPictureRequest.class new file mode 100644 index 0000000..7055a26 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreAdvertPictureRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreBaseRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreBaseRequest.class new file mode 100644 index 0000000..9e4573a Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreBaseRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreBusinessPlanDetailRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreBusinessPlanDetailRequest.class new file mode 100644 index 0000000..115314a Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreBusinessPlanDetailRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreBusinessPlanRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreBusinessPlanRequest.class new file mode 100644 index 0000000..daf0a36 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreBusinessPlanRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreCouponCheckOutRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreCouponCheckOutRequest.class new file mode 100644 index 0000000..a94222e Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreCouponCheckOutRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreCouponCheckRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreCouponCheckRequest.class new file mode 100644 index 0000000..4e61349 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreCouponCheckRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreCouponListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreCouponListRequest.class new file mode 100644 index 0000000..e455f24 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreCouponListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreDispatchSettlePlanGetRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreDispatchSettlePlanGetRequest.class new file mode 100644 index 0000000..9caa95d Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreDispatchSettlePlanGetRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreFeeItemListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreFeeItemListRequest.class new file mode 100644 index 0000000..3ed75ad Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreFeeItemListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreGoodsRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreGoodsRequest.class new file mode 100644 index 0000000..9554c40 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreGoodsRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreInfoRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreInfoRequest.class new file mode 100644 index 0000000..528307f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreInfoRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreListRequest.class new file mode 100644 index 0000000..5b3e64c Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreMessageRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreMessageRequest.class new file mode 100644 index 0000000..ed550ce Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreMessageRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StorePayModeRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StorePayModeRequest.class new file mode 100644 index 0000000..da6d8e9 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StorePayModeRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StorePayTypeRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StorePayTypeRequest.class new file mode 100644 index 0000000..0613224 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StorePayTypeRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StorePosListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StorePosListRequest.class new file mode 100644 index 0000000..43a2a40 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StorePosListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StorePrintImageRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StorePrintImageRequest.class new file mode 100644 index 0000000..c9da036 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StorePrintImageRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreProductCouponListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreProductCouponListRequest.class new file mode 100644 index 0000000..879f0d6 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreProductCouponListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreRechargeParameterListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreRechargeParameterListRequest.class new file mode 100644 index 0000000..be09867 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreRechargeParameterListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreRequest.class new file mode 100644 index 0000000..f62f006 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreSalesDayProductSummaryRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreSalesDayProductSummaryRequest.class new file mode 100644 index 0000000..8b9f523 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreSalesDayProductSummaryRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreSalesDaySummaryRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreSalesDaySummaryRequest.class new file mode 100644 index 0000000..ac481f9 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreSalesDaySummaryRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreSalesOrderListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreSalesOrderListRequest.class new file mode 100644 index 0000000..f44fb22 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreSalesOrderListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreShelfRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreShelfRequest.class new file mode 100644 index 0000000..44c4a6b Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoreShelfRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoretableAreaRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoretableAreaRequest.class new file mode 100644 index 0000000..11fbd29 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoretableAreaRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoretableRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoretableRequest.class new file mode 100644 index 0000000..43832ac Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoretableRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoretableTypeRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoretableTypeRequest.class new file mode 100644 index 0000000..302a6f8 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/store/StoretableTypeRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/upload/BusinessHandoverUploadRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/upload/BusinessHandoverUploadRequest.class new file mode 100644 index 0000000..e885653 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/upload/BusinessHandoverUploadRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/upload/BusinessLogUploadRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/upload/BusinessLogUploadRequest.class new file mode 100644 index 0000000..d64d2fc Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/upload/BusinessLogUploadRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/upload/BusinessOrderBurdenUploadRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/upload/BusinessOrderBurdenUploadRequest.class new file mode 100644 index 0000000..c241130 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/upload/BusinessOrderBurdenUploadRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/upload/BusinessOrderUploadExtendRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/upload/BusinessOrderUploadExtendRequest.class new file mode 100644 index 0000000..d925816 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/upload/BusinessOrderUploadExtendRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/upload/BusinessOrderUploadRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/upload/BusinessOrderUploadRequest.class new file mode 100644 index 0000000..a4293a3 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/upload/BusinessOrderUploadRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/upload/BusinessRevenueUploadRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/upload/BusinessRevenueUploadRequest.class new file mode 100644 index 0000000..748b7f9 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/upload/BusinessRevenueUploadRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/visitor/VisitorAddRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/visitor/VisitorAddRequest.class new file mode 100644 index 0000000..c76aa47 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/visitor/VisitorAddRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/visitor/VisitorAddressListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/visitor/VisitorAddressListRequest.class new file mode 100644 index 0000000..d9d3bdd Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/visitor/VisitorAddressListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/visitor/VisitorInfoRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/visitor/VisitorInfoRequest.class new file mode 100644 index 0000000..c497ce6 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/visitor/VisitorInfoRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/visitor/VisitorListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/visitor/VisitorListRequest.class new file mode 100644 index 0000000..48565df Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/visitor/VisitorListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/visitor/VisitorTagListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/visitor/VisitorTagListRequest.class new file mode 100644 index 0000000..115a112 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/visitor/VisitorTagListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/visitor/VisitorUpdateRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/visitor/VisitorUpdateRequest.class new file mode 100644 index 0000000..d7555bc Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/visitor/VisitorUpdateRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/ProductTypeDetailRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/ProductTypeDetailRequest.class new file mode 100644 index 0000000..17c4318 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/ProductTypeDetailRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposAdPictureRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposAdPictureRequest.class new file mode 100644 index 0000000..96b4fed Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposAdPictureRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposBarCodePayRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposBarCodePayRequest.class new file mode 100644 index 0000000..ebab497 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposBarCodePayRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposOrderCancelRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposOrderCancelRequest.class new file mode 100644 index 0000000..eb2aa7d Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposOrderCancelRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposOrderCreateRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposOrderCreateRequest.class new file mode 100644 index 0000000..d697e3b Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposOrderCreateRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposOrderDetailRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposOrderDetailRequest.class new file mode 100644 index 0000000..a04ef20 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposOrderDetailRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposOrderEditRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposOrderEditRequest.class new file mode 100644 index 0000000..afc26b9 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposOrderEditRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposOrderListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposOrderListRequest.class new file mode 100644 index 0000000..59593b4 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposOrderListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposOrderPayRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposOrderPayRequest.class new file mode 100644 index 0000000..1429e0c Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposOrderPayRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposOrderRefundPartRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposOrderRefundPartRequest.class new file mode 100644 index 0000000..562e3f7 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposOrderRefundPartRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposOrderRefundRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposOrderRefundRequest.class new file mode 100644 index 0000000..ce84704 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposOrderRefundRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposProductEvaluateLevelViewRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposProductEvaluateLevelViewRequest.class new file mode 100644 index 0000000..9b4f049 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposProductEvaluateLevelViewRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposProductEvaluateUploadRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposProductEvaluateUploadRequest.class new file mode 100644 index 0000000..a50ed0e Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposProductEvaluateUploadRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposProductEvaluateViewRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposProductEvaluateViewRequest.class new file mode 100644 index 0000000..62c19ee Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposProductEvaluateViewRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposProductRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposProductRequest.class new file mode 100644 index 0000000..388f216 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposProductRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposProductStockRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposProductStockRequest.class new file mode 100644 index 0000000..559bfda Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposProductStockRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposProductTypeLabelRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposProductTypeLabelRequest.class new file mode 100644 index 0000000..c265146 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposProductTypeLabelRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposProductTypeRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposProductTypeRequest.class new file mode 100644 index 0000000..8cce861 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposProductTypeRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposProductTypeTwoRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposProductTypeTwoRequest.class new file mode 100644 index 0000000..3b9ffc4 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposProductTypeTwoRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposWeixinPayQueryRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposWeixinPayQueryRequest.class new file mode 100644 index 0000000..fc9bac9 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposWeixinPayQueryRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposWeixinPayRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposWeixinPayRequest.class new file mode 100644 index 0000000..47e0e4e Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposWeixinPayRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposWindowsCcbfzInfosRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposWindowsCcbfzInfosRequest.class new file mode 100644 index 0000000..90a0681 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/vpos/VposWindowsCcbfzInfosRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/waimai/OrderStatisticsRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/waimai/OrderStatisticsRequest.class new file mode 100644 index 0000000..3a65f28 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/waimai/OrderStatisticsRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/AgentStoreRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/AgentStoreRequest.class new file mode 100644 index 0000000..8f8e160 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/AgentStoreRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/CategorySummaryListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/CategorySummaryListRequest.class new file mode 100644 index 0000000..39824d6 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/CategorySummaryListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/DaySummaryByDateRangeRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/DaySummaryByDateRangeRequest.class new file mode 100644 index 0000000..37bd26b Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/DaySummaryByDateRangeRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/DaySummaryListByDateRangeRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/DaySummaryListByDateRangeRequest.class new file mode 100644 index 0000000..0740bd1 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/DaySummaryListByDateRangeRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/DaySummaryListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/DaySummaryListRequest.class new file mode 100644 index 0000000..7e21147 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/DaySummaryListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/DaySummaryRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/DaySummaryRequest.class new file mode 100644 index 0000000..b6d24c0 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/DaySummaryRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/GrossProfitAnalysisRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/GrossProfitAnalysisRequest.class new file mode 100644 index 0000000..d9e9e6a Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/GrossProfitAnalysisRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/ManagerWorkerModuleRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/ManagerWorkerModuleRequest.class new file mode 100644 index 0000000..20b522d Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/ManagerWorkerModuleRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/OrderSummaryListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/OrderSummaryListRequest.class new file mode 100644 index 0000000..aa0ab03 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/OrderSummaryListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/PaySummaryListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/PaySummaryListRequest.class new file mode 100644 index 0000000..afe4416 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/PaySummaryListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/ProductRankRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/ProductRankRequest.class new file mode 100644 index 0000000..998dd0d Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/ProductRankRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/ProductSalesSummaryRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/ProductSalesSummaryRequest.class new file mode 100644 index 0000000..3115a5d Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/ProductSalesSummaryRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/SalesDailyByDateRangeRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/SalesDailyByDateRangeRequest.class new file mode 100644 index 0000000..acf507a Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/SalesDailyByDateRangeRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/TimeSummaryListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/TimeSummaryListRequest.class new file mode 100644 index 0000000..6fca42a Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/TimeSummaryListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/VposSalesSummaryRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/VposSalesSummaryRequest.class new file mode 100644 index 0000000..102487e Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/VposSalesSummaryRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/VposUserSeriesRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/VposUserSeriesRequest.class new file mode 100644 index 0000000..b7e9db0 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/VposUserSeriesRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/WaiMaiOrderStatisticsRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/WaiMaiOrderStatisticsRequest.class new file mode 100644 index 0000000..dce984f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/WaiMaiOrderStatisticsRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/WorkerStoreRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/WorkerStoreRequest.class new file mode 100644 index 0000000..09bb184 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/weixin/WorkerStoreRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/worker/WorkerListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/worker/WorkerListRequest.class new file mode 100644 index 0000000..521f9a5 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/worker/WorkerListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/worker/WorkerLoginRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/worker/WorkerLoginRequest.class new file mode 100644 index 0000000..617b657 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/worker/WorkerLoginRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/worker/WorkerPosModuleRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/worker/WorkerPosModuleRequest.class new file mode 100644 index 0000000..0775ca8 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/worker/WorkerPosModuleRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/worker/WorkerPosRoleRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/worker/WorkerPosRoleRequest.class new file mode 100644 index 0000000..cd0748a Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/worker/WorkerPosRoleRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/worker/WorkerUpdatePwdRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/worker/WorkerUpdatePwdRequest.class new file mode 100644 index 0000000..f538b57 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/worker/WorkerUpdatePwdRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/AdPictureListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/AdPictureListRequest.class new file mode 100644 index 0000000..ea3df4f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/AdPictureListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/DistributionAddressRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/DistributionAddressRequest.class new file mode 100644 index 0000000..1215ee2 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/DistributionAddressRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/DistributionRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/DistributionRequest.class new file mode 100644 index 0000000..d442640 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/DistributionRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/GoodsCategoryListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/GoodsCategoryListRequest.class new file mode 100644 index 0000000..f1c330a Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/GoodsCategoryListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/GoodsCategoryRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/GoodsCategoryRequest.class new file mode 100644 index 0000000..07bdefd Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/GoodsCategoryRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/GoodsInfoRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/GoodsInfoRequest.class new file mode 100644 index 0000000..822da37 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/GoodsInfoRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/GoodsInfoZCRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/GoodsInfoZCRequest.class new file mode 100644 index 0000000..a677236 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/GoodsInfoZCRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/GoodsListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/GoodsListRequest.class new file mode 100644 index 0000000..8a7249b Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/GoodsListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/GoodsMakeListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/GoodsMakeListRequest.class new file mode 100644 index 0000000..bb1ce15 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/GoodsMakeListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/GoodsSellInRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/GoodsSellInRequest.class new file mode 100644 index 0000000..0e59e58 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/GoodsSellInRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/GoodsSellOutRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/GoodsSellOutRequest.class new file mode 100644 index 0000000..51431b0 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/GoodsSellOutRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/SalesOrderCancelRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/SalesOrderCancelRequest.class new file mode 100644 index 0000000..6fe4804 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/SalesOrderCancelRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/SalesOrderCreateRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/SalesOrderCreateRequest.class new file mode 100644 index 0000000..4684140 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/SalesOrderCreateRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/SalesOrderInfoRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/SalesOrderInfoRequest.class new file mode 100644 index 0000000..fbdce4f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/SalesOrderInfoRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/SalesOrderListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/SalesOrderListRequest.class new file mode 100644 index 0000000..a941c50 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/SalesOrderListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/StoreAgreeRefundRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/StoreAgreeRefundRequest.class new file mode 100644 index 0000000..d10ccb7 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/StoreAgreeRefundRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/StoreInfoRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/StoreInfoRequest.class new file mode 100644 index 0000000..1b75448 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/StoreInfoRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/StoreListByWidRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/StoreListByWidRequest.class new file mode 100644 index 0000000..51fc12a Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/StoreListByWidRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/StoreListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/StoreListRequest.class new file mode 100644 index 0000000..fc86a64 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/StoreListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/StoreOpenStatusUpdateRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/StoreOpenStatusUpdateRequest.class new file mode 100644 index 0000000..bff6955 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/StoreOpenStatusUpdateRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/StoreOrderCancelRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/StoreOrderCancelRequest.class new file mode 100644 index 0000000..c815e56 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/StoreOrderCancelRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/StoreOrderConfirmRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/StoreOrderConfirmRequest.class new file mode 100644 index 0000000..61cfc06 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/StoreOrderConfirmRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/StoreOrderDeliveryRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/StoreOrderDeliveryRequest.class new file mode 100644 index 0000000..c305d0f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/StoreOrderDeliveryRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/StoreOrderListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/StoreOrderListRequest.class new file mode 100644 index 0000000..c3a323f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/StoreOrderListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/StorePayParameterRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/StorePayParameterRequest.class new file mode 100644 index 0000000..dca318b Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/StorePayParameterRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/StoreRefuseRefundRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/StoreRefuseRefundRequest.class new file mode 100644 index 0000000..a7ae1d3 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/StoreRefuseRefundRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/UserApplyRefundRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/UserApplyRefundRequest.class new file mode 100644 index 0000000..5fcfba5 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/UserApplyRefundRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/WeixinPayUnifiedorderRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/WeixinPayUnifiedorderRequest.class new file mode 100644 index 0000000..5817bec Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/WeixinPayUnifiedorderRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/ZCGoodsCategoryListRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/ZCGoodsCategoryListRequest.class new file mode 100644 index 0000000..23bf7de Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxdc/ZCGoodsCategoryListRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxyh/UpdateWorkerPasswordRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxyh/UpdateWorkerPasswordRequest.class new file mode 100644 index 0000000..0f27631 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxyh/UpdateWorkerPasswordRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxyh/WxyhCategoryRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxyh/WxyhCategoryRequest.class new file mode 100644 index 0000000..e6bc768 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxyh/WxyhCategoryRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxyh/WxyhGoodsRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxyh/WxyhGoodsRequest.class new file mode 100644 index 0000000..219fefb Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/request/wxyh/WxyhGoodsRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/response/CommonResponse.class b/food-open/food-open-api/target/classes/com/jwsaas/api/response/CommonResponse.class new file mode 100644 index 0000000..4e90ce6 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/response/CommonResponse.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/response/common/SayHelloResponse.class b/food-open/food-open-api/target/classes/com/jwsaas/api/response/common/SayHelloResponse.class new file mode 100644 index 0000000..e964a01 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/response/common/SayHelloResponse.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/response/common/SessionCreateResponse.class b/food-open/food-open-api/target/classes/com/jwsaas/api/response/common/SessionCreateResponse.class new file mode 100644 index 0000000..661e79c Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/response/common/SessionCreateResponse.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/response/common/SessionGetResponse.class b/food-open/food-open-api/target/classes/com/jwsaas/api/response/common/SessionGetResponse.class new file mode 100644 index 0000000..16b0955 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/response/common/SessionGetResponse.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/response/mode/CommonDataResponse.class b/food-open/food-open-api/target/classes/com/jwsaas/api/response/mode/CommonDataResponse.class new file mode 100644 index 0000000..8c99ad3 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/response/mode/CommonDataResponse.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/response/mode/CommonErrorCode.class b/food-open/food-open-api/target/classes/com/jwsaas/api/response/mode/CommonErrorCode.class new file mode 100644 index 0000000..83e3c41 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/response/mode/CommonErrorCode.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/response/mode/CommonListResponse.class b/food-open/food-open-api/target/classes/com/jwsaas/api/response/mode/CommonListResponse.class new file mode 100644 index 0000000..12ec84b Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/response/mode/CommonListResponse.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/response/mode/CommonPagerResponse.class b/food-open/food-open-api/target/classes/com/jwsaas/api/response/mode/CommonPagerResponse.class new file mode 100644 index 0000000..329257f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/response/mode/CommonPagerResponse.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/response/mode/DataPageResponse.class b/food-open/food-open-api/target/classes/com/jwsaas/api/response/mode/DataPageResponse.class new file mode 100644 index 0000000..1414578 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/response/mode/DataPageResponse.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/ErpBaseService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/ErpBaseService.class new file mode 100644 index 0000000..77f649d Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/ErpBaseService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/WopService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/WopService.class new file mode 100644 index 0000000..9930d6a Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/WopService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/cardsync/CardsyncService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/cardsync/CardsyncService.class new file mode 100644 index 0000000..86fbb0f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/cardsync/CardsyncService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/ccb/CcbPayService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/ccb/CcbPayService.class new file mode 100644 index 0000000..88e3c6d Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/ccb/CcbPayService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/ccb/impl/CcbPayServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/ccb/impl/CcbPayServiceImpl.class new file mode 100644 index 0000000..73a6fc1 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/ccb/impl/CcbPayServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/common/CommonService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/common/CommonService.class new file mode 100644 index 0000000..9c99a00 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/common/CommonService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/common/SessionService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/common/SessionService.class new file mode 100644 index 0000000..9e71d06 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/common/SessionService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/cost/CostTicketTemplateService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/cost/CostTicketTemplateService.class new file mode 100644 index 0000000..02f2e57 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/cost/CostTicketTemplateService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/cost/impl/CostTicketTemplateServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/cost/impl/CostTicketTemplateServiceImpl.class new file mode 100644 index 0000000..734a1ce Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/cost/impl/CostTicketTemplateServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/ErpBaseServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/ErpBaseServiceImpl.class new file mode 100644 index 0000000..50178ec Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/ErpBaseServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/WopServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/WopServiceImpl.class new file mode 100644 index 0000000..80269d9 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/WopServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/cardsync/CardsyncServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/cardsync/CardsyncServiceImpl.class new file mode 100644 index 0000000..09a5068 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/cardsync/CardsyncServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/common/CommonServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/common/CommonServiceImpl.class new file mode 100644 index 0000000..8f6a11c Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/common/CommonServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/common/SessionServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/common/SessionServiceImpl.class new file mode 100644 index 0000000..969d356 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/common/SessionServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/intelligence/IntelligenceGoodsServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/intelligence/IntelligenceGoodsServiceImpl.class new file mode 100644 index 0000000..5d8d985 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/intelligence/IntelligenceGoodsServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/jwygj/StoreYgjProductServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/jwygj/StoreYgjProductServiceImpl.class new file mode 100644 index 0000000..9abb5f8 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/jwygj/StoreYgjProductServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/jwygj/StoreYgjWorkerServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/jwygj/StoreYgjWorkerServiceImpl.class new file mode 100644 index 0000000..a6bde69 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/jwygj/StoreYgjWorkerServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/kds/KdsServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/kds/KdsServiceImpl.class new file mode 100644 index 0000000..d7d393b Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/kds/KdsServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/kit/KitServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/kit/KitServiceImpl.class new file mode 100644 index 0000000..c500e22 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/kit/KitServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/kms/KmsServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/kms/KmsServiceImpl.class new file mode 100644 index 0000000..ba4afd9 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/kms/KmsServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/ops/CityInfoServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/ops/CityInfoServiceImpl.class new file mode 100644 index 0000000..61369b8 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/ops/CityInfoServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/pay/PayServiceImpl$1.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/pay/PayServiceImpl$1.class new file mode 100644 index 0000000..9835974 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/pay/PayServiceImpl$1.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/pay/PayServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/pay/PayServiceImpl.class new file mode 100644 index 0000000..8ea8cbe Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/pay/PayServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/peripheral/PeripheralServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/peripheral/PeripheralServiceImpl.class new file mode 100644 index 0000000..ea745bd Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/peripheral/PeripheralServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/pos/ErpPosServiceImpl$1.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/pos/ErpPosServiceImpl$1.class new file mode 100644 index 0000000..33b00d0 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/pos/ErpPosServiceImpl$1.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/pos/ErpPosServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/pos/ErpPosServiceImpl.class new file mode 100644 index 0000000..09900ce Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/pos/ErpPosServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/pos/PosSaleClearServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/pos/PosSaleClearServiceImpl.class new file mode 100644 index 0000000..d8943f8 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/pos/PosSaleClearServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/pos/PosServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/pos/PosServiceImpl.class new file mode 100644 index 0000000..7a3501f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/pos/PosServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/product/ProductServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/product/ProductServiceImpl.class new file mode 100644 index 0000000..856819e Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/product/ProductServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/promotion/PromotionServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/promotion/PromotionServiceImpl.class new file mode 100644 index 0000000..676fcc9 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/promotion/PromotionServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/split/SplitLogServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/split/SplitLogServiceImpl.class new file mode 100644 index 0000000..23bf0de Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/split/SplitLogServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/split/SplitSaleServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/split/SplitSaleServiceImpl.class new file mode 100644 index 0000000..7e5b887 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/split/SplitSaleServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/split/SplitServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/split/SplitServiceImpl.class new file mode 100644 index 0000000..fc127b8 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/split/SplitServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/storage/StoreCostTicketServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/storage/StoreCostTicketServiceImpl.class new file mode 100644 index 0000000..fcc5cb2 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/storage/StoreCostTicketServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/storage/StoreDispatchServiceImpl$1.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/storage/StoreDispatchServiceImpl$1.class new file mode 100644 index 0000000..94e5fbf Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/storage/StoreDispatchServiceImpl$1.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/storage/StoreDispatchServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/storage/StoreDispatchServiceImpl.class new file mode 100644 index 0000000..af70334 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/storage/StoreDispatchServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/storage/StoreStockCheckServiceImpl$1.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/storage/StoreStockCheckServiceImpl$1.class new file mode 100644 index 0000000..c87e20a Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/storage/StoreStockCheckServiceImpl$1.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/storage/StoreStockCheckServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/storage/StoreStockCheckServiceImpl.class new file mode 100644 index 0000000..85e4593 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/storage/StoreStockCheckServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/storage/StoreStorageServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/storage/StoreStorageServiceImpl.class new file mode 100644 index 0000000..f158331 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/storage/StoreStorageServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/storage/StoreStorageTicketServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/storage/StoreStorageTicketServiceImpl.class new file mode 100644 index 0000000..0125ea9 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/storage/StoreStorageTicketServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/CouponServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/CouponServiceImpl.class new file mode 100644 index 0000000..9dc4c53 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/CouponServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/ProgramBusinessTicketServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/ProgramBusinessTicketServiceImpl.class new file mode 100644 index 0000000..4fad689 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/ProgramBusinessTicketServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreAccountServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreAccountServiceImpl.class new file mode 100644 index 0000000..09b4b2d Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreAccountServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreAdjustPriceServiceImpl$1.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreAdjustPriceServiceImpl$1.class new file mode 100644 index 0000000..9280332 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreAdjustPriceServiceImpl$1.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreAdjustPriceServiceImpl$2.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreAdjustPriceServiceImpl$2.class new file mode 100644 index 0000000..2a2c98d Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreAdjustPriceServiceImpl$2.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreAdjustPriceServiceImpl$3.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreAdjustPriceServiceImpl$3.class new file mode 100644 index 0000000..f0e1dd8 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreAdjustPriceServiceImpl$3.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreAdjustPriceServiceImpl$4.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreAdjustPriceServiceImpl$4.class new file mode 100644 index 0000000..fe4dabb Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreAdjustPriceServiceImpl$4.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreAdjustPriceServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreAdjustPriceServiceImpl.class new file mode 100644 index 0000000..81b1379 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreAdjustPriceServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreDispatchSettleServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreDispatchSettleServiceImpl.class new file mode 100644 index 0000000..33d3735 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreDispatchSettleServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreInfoServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreInfoServiceImpl.class new file mode 100644 index 0000000..f1849c8 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreInfoServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreRechargeServiceImpl$1.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreRechargeServiceImpl$1.class new file mode 100644 index 0000000..3879877 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreRechargeServiceImpl$1.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreRechargeServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreRechargeServiceImpl.class new file mode 100644 index 0000000..d6c35a5 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreRechargeServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreSalesOrderServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreSalesOrderServiceImpl.class new file mode 100644 index 0000000..a3623de Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreSalesOrderServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreServiceImpl$1.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreServiceImpl$1.class new file mode 100644 index 0000000..57bf54b Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreServiceImpl$1.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreServiceImpl$2.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreServiceImpl$2.class new file mode 100644 index 0000000..1ca0d5f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreServiceImpl$2.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreServiceImpl$3.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreServiceImpl$3.class new file mode 100644 index 0000000..8270d41 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreServiceImpl$3.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreServiceImpl$4.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreServiceImpl$4.class new file mode 100644 index 0000000..5455709 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreServiceImpl$4.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreServiceImpl$5.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreServiceImpl$5.class new file mode 100644 index 0000000..d6da800 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreServiceImpl$5.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreServiceImpl$6.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreServiceImpl$6.class new file mode 100644 index 0000000..e7bd867 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreServiceImpl$6.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreServiceImpl$7.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreServiceImpl$7.class new file mode 100644 index 0000000..e86d761 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreServiceImpl$7.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreServiceImpl$8.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreServiceImpl$8.class new file mode 100644 index 0000000..2b41a85 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreServiceImpl$8.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreServiceImpl.class new file mode 100644 index 0000000..f46d063 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreShelfServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreShelfServiceImpl.class new file mode 100644 index 0000000..b27d0a6 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/store/StoreShelfServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/upload/UploadExtendServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/upload/UploadExtendServiceImpl.class new file mode 100644 index 0000000..063a333 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/upload/UploadExtendServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/upload/UploadServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/upload/UploadServiceImpl.class new file mode 100644 index 0000000..1e92e8e Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/upload/UploadServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/worker/WorkerServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/worker/WorkerServiceImpl.class new file mode 100644 index 0000000..93174f1 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/impl/worker/WorkerServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/intelligence/IntelligenceGoodsService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/intelligence/IntelligenceGoodsService.class new file mode 100644 index 0000000..dd9f6ad Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/intelligence/IntelligenceGoodsService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/jwygj/StoreYgjProductService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/jwygj/StoreYgjProductService.class new file mode 100644 index 0000000..6cf8a9b Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/jwygj/StoreYgjProductService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/jwygj/StoreYgjWorkerService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/jwygj/StoreYgjWorkerService.class new file mode 100644 index 0000000..f625f78 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/jwygj/StoreYgjWorkerService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/kds/KdsService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/kds/KdsService.class new file mode 100644 index 0000000..d7641fa Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/kds/KdsService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/kit/KitService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/kit/KitService.class new file mode 100644 index 0000000..70c2c01 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/kit/KitService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/kms/KmsService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/kms/KmsService.class new file mode 100644 index 0000000..20a6c57 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/kms/KmsService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/liteappdc/LiteAppdcService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/liteappdc/LiteAppdcService.class new file mode 100644 index 0000000..571afad Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/liteappdc/LiteAppdcService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/liteappdc/impl/LiteAppdcServiceImpl$1.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/liteappdc/impl/LiteAppdcServiceImpl$1.class new file mode 100644 index 0000000..2e10ec7 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/liteappdc/impl/LiteAppdcServiceImpl$1.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/liteappdc/impl/LiteAppdcServiceImpl$2.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/liteappdc/impl/LiteAppdcServiceImpl$2.class new file mode 100644 index 0000000..fa194ea Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/liteappdc/impl/LiteAppdcServiceImpl$2.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/liteappdc/impl/LiteAppdcServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/liteappdc/impl/LiteAppdcServiceImpl.class new file mode 100644 index 0000000..358797a Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/liteappdc/impl/LiteAppdcServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/ops/CityInfoService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/ops/CityInfoService.class new file mode 100644 index 0000000..8075093 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/ops/CityInfoService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/pay/PayService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/pay/PayService.class new file mode 100644 index 0000000..ea8a8ce Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/pay/PayService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/peripheral/PeripheralService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/peripheral/PeripheralService.class new file mode 100644 index 0000000..0b91a25 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/peripheral/PeripheralService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/pos/ErpPosService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/pos/ErpPosService.class new file mode 100644 index 0000000..c87bd30 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/pos/ErpPosService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/pos/PosSaleClearService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/pos/PosSaleClearService.class new file mode 100644 index 0000000..53a68f6 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/pos/PosSaleClearService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/pos/PosService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/pos/PosService.class new file mode 100644 index 0000000..b149875 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/pos/PosService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/product/ProductService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/product/ProductService.class new file mode 100644 index 0000000..c6aa267 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/product/ProductService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/ProgramAdvPictureAndEvaluateService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/ProgramAdvPictureAndEvaluateService.class new file mode 100644 index 0000000..f2f613f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/ProgramAdvPictureAndEvaluateService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/ProgramOrderDispatchService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/ProgramOrderDispatchService.class new file mode 100644 index 0000000..e19d895 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/ProgramOrderDispatchService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/ProgramOrderService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/ProgramOrderService.class new file mode 100644 index 0000000..9d90bd8 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/ProgramOrderService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/ProgramProductService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/ProgramProductService.class new file mode 100644 index 0000000..bfe6819 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/ProgramProductService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/ProgramProductSpecService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/ProgramProductSpecService.class new file mode 100644 index 0000000..75c37e6 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/ProgramProductSpecService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/ProgramStoreService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/ProgramStoreService.class new file mode 100644 index 0000000..8a760f7 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/ProgramStoreService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/ProgramUserService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/ProgramUserService.class new file mode 100644 index 0000000..f2fc949 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/ProgramUserService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/SplitStorePayService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/SplitStorePayService.class new file mode 100644 index 0000000..274fb20 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/SplitStorePayService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramAdvPictureAndEvaluateServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramAdvPictureAndEvaluateServiceImpl.class new file mode 100644 index 0000000..dcc5d22 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramAdvPictureAndEvaluateServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderDispatchServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderDispatchServiceImpl.class new file mode 100644 index 0000000..deb2b25 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderDispatchServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$1.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$1.class new file mode 100644 index 0000000..262e851 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$1.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$10.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$10.class new file mode 100644 index 0000000..bb03b1a Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$10.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$11.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$11.class new file mode 100644 index 0000000..b1b5d07 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$11.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$12.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$12.class new file mode 100644 index 0000000..08ef665 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$12.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$13.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$13.class new file mode 100644 index 0000000..b92efdf Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$13.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$14.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$14.class new file mode 100644 index 0000000..b28de37 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$14.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$2.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$2.class new file mode 100644 index 0000000..a9396de Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$2.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$3.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$3.class new file mode 100644 index 0000000..3966e61 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$3.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$4.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$4.class new file mode 100644 index 0000000..7a6a3f1 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$4.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$5.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$5.class new file mode 100644 index 0000000..38146da Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$5.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$6.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$6.class new file mode 100644 index 0000000..5371403 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$6.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$7.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$7.class new file mode 100644 index 0000000..ab0552c Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$7.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$8.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$8.class new file mode 100644 index 0000000..1739d3f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$8.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$9.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$9.class new file mode 100644 index 0000000..9c84a82 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl$9.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl.class new file mode 100644 index 0000000..1103561 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramOrderServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramProductServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramProductServiceImpl.class new file mode 100644 index 0000000..df265ff Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramProductServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramProductSpecServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramProductSpecServiceImpl.class new file mode 100644 index 0000000..8ad1357 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramProductSpecServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramStoreServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramStoreServiceImpl.class new file mode 100644 index 0000000..63fb0a4 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramStoreServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramUserServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramUserServiceImpl.class new file mode 100644 index 0000000..8745086 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/ProgramUserServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/SplitStorePayServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/SplitStorePayServiceImpl.class new file mode 100644 index 0000000..b89eaa5 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/program/impl/SplitStorePayServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/promotion/PromotionService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/promotion/PromotionService.class new file mode 100644 index 0000000..c3ac47c Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/promotion/PromotionService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/split/SplitLogService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/split/SplitLogService.class new file mode 100644 index 0000000..74e08db Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/split/SplitLogService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/split/SplitSaleService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/split/SplitSaleService.class new file mode 100644 index 0000000..0569556 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/split/SplitSaleService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/split/SplitService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/split/SplitService.class new file mode 100644 index 0000000..a280821 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/split/SplitService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/spwxdc/SpWxdcService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/spwxdc/SpWxdcService.class new file mode 100644 index 0000000..e1fb272 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/spwxdc/SpWxdcService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/spwxdc/impl/SpWxdcServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/spwxdc/impl/SpWxdcServiceImpl.class new file mode 100644 index 0000000..df6e62f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/spwxdc/impl/SpWxdcServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/storage/StoreCostTicketService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/storage/StoreCostTicketService.class new file mode 100644 index 0000000..e22165a Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/storage/StoreCostTicketService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/storage/StoreDispatchService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/storage/StoreDispatchService.class new file mode 100644 index 0000000..9a3e23d Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/storage/StoreDispatchService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/storage/StoreStockCheckService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/storage/StoreStockCheckService.class new file mode 100644 index 0000000..7efbebc Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/storage/StoreStockCheckService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/storage/StoreStorageService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/storage/StoreStorageService.class new file mode 100644 index 0000000..2e034f1 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/storage/StoreStorageService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/storage/StoreStorageTicketService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/storage/StoreStorageTicketService.class new file mode 100644 index 0000000..9263d3d Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/storage/StoreStorageTicketService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/store/CouponService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/store/CouponService.class new file mode 100644 index 0000000..61a7b1f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/store/CouponService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/store/ProgramBusinessTicketService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/store/ProgramBusinessTicketService.class new file mode 100644 index 0000000..ac47f5d Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/store/ProgramBusinessTicketService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/store/StoreAccountService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/store/StoreAccountService.class new file mode 100644 index 0000000..3fa53bd Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/store/StoreAccountService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/store/StoreAdjustPriceService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/store/StoreAdjustPriceService.class new file mode 100644 index 0000000..39fd2d5 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/store/StoreAdjustPriceService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/store/StoreDispatchSettleService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/store/StoreDispatchSettleService.class new file mode 100644 index 0000000..97096b2 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/store/StoreDispatchSettleService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/store/StoreInfoService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/store/StoreInfoService.class new file mode 100644 index 0000000..83a1f4f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/store/StoreInfoService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/store/StoreRechargeService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/store/StoreRechargeService.class new file mode 100644 index 0000000..4d71a19 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/store/StoreRechargeService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/store/StoreSalesOrderService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/store/StoreSalesOrderService.class new file mode 100644 index 0000000..e0c4a24 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/store/StoreSalesOrderService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/store/StoreService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/store/StoreService.class new file mode 100644 index 0000000..c4e5c4a Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/store/StoreService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/store/StoreShelfService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/store/StoreShelfService.class new file mode 100644 index 0000000..8545b7a Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/store/StoreShelfService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/upload/UploadExtendService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/upload/UploadExtendService.class new file mode 100644 index 0000000..68ece3f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/upload/UploadExtendService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/upload/UploadService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/upload/UploadService.class new file mode 100644 index 0000000..cf2dd63 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/upload/UploadService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/visitor/VisitorService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/visitor/VisitorService.class new file mode 100644 index 0000000..a1fc153 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/visitor/VisitorService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/visitor/impl/VisitorServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/visitor/impl/VisitorServiceImpl.class new file mode 100644 index 0000000..cde5066 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/visitor/impl/VisitorServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/vpos/VposProductService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/vpos/VposProductService.class new file mode 100644 index 0000000..a4ce4f2 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/vpos/VposProductService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/vpos/impl/VposProductServiceImpl$1.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/vpos/impl/VposProductServiceImpl$1.class new file mode 100644 index 0000000..2758945 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/vpos/impl/VposProductServiceImpl$1.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/vpos/impl/VposProductServiceImpl$2.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/vpos/impl/VposProductServiceImpl$2.class new file mode 100644 index 0000000..6d7e576 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/vpos/impl/VposProductServiceImpl$2.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/vpos/impl/VposProductServiceImpl$3.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/vpos/impl/VposProductServiceImpl$3.class new file mode 100644 index 0000000..4b59ef9 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/vpos/impl/VposProductServiceImpl$3.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/vpos/impl/VposProductServiceImpl$4.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/vpos/impl/VposProductServiceImpl$4.class new file mode 100644 index 0000000..bd6d493 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/vpos/impl/VposProductServiceImpl$4.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/vpos/impl/VposProductServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/vpos/impl/VposProductServiceImpl.class new file mode 100644 index 0000000..1e91d6d Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/vpos/impl/VposProductServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/waimai/WaiMaiService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/waimai/WaiMaiService.class new file mode 100644 index 0000000..7322554 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/waimai/WaiMaiService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/waimai/impl/WaiMaiServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/waimai/impl/WaiMaiServiceImpl.class new file mode 100644 index 0000000..56420d2 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/waimai/impl/WaiMaiServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/weixin/WeiXinService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/weixin/WeiXinService.class new file mode 100644 index 0000000..a11b639 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/weixin/WeiXinService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/weixin/impl/WeiXinServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/weixin/impl/WeiXinServiceImpl.class new file mode 100644 index 0000000..c74b7b1 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/weixin/impl/WeiXinServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/worker/WorkerService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/worker/WorkerService.class new file mode 100644 index 0000000..915bb0a Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/worker/WorkerService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/wxdc/WxdcDistributionService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/wxdc/WxdcDistributionService.class new file mode 100644 index 0000000..c44699f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/wxdc/WxdcDistributionService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/wxdc/WxdcService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/wxdc/WxdcService.class new file mode 100644 index 0000000..2fd8613 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/wxdc/WxdcService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/wxdc/WxdcZCService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/wxdc/WxdcZCService.class new file mode 100644 index 0000000..933dfca Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/wxdc/WxdcZCService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/wxdc/impl/WxdcDistributionServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/wxdc/impl/WxdcDistributionServiceImpl.class new file mode 100644 index 0000000..f2d8494 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/wxdc/impl/WxdcDistributionServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/wxdc/impl/WxdcServiceImpl$1.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/wxdc/impl/WxdcServiceImpl$1.class new file mode 100644 index 0000000..c683e35 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/wxdc/impl/WxdcServiceImpl$1.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/wxdc/impl/WxdcServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/wxdc/impl/WxdcServiceImpl.class new file mode 100644 index 0000000..69ae383 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/wxdc/impl/WxdcServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/wxdc/impl/WxdcZCServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/wxdc/impl/WxdcZCServiceImpl.class new file mode 100644 index 0000000..4f37ff1 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/wxdc/impl/WxdcZCServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/wxyh/WxyhService.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/wxyh/WxyhService.class new file mode 100644 index 0000000..d531632 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/wxyh/WxyhService.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/api/service/wxyh/impl/WxyhServiceImpl.class b/food-open/food-open-api/target/classes/com/jwsaas/api/service/wxyh/impl/WxyhServiceImpl.class new file mode 100644 index 0000000..873503f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/api/service/wxyh/impl/WxyhServiceImpl.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/bean/AppKeyInfo.class b/food-open/food-open-api/target/classes/com/jwsaas/bean/AppKeyInfo.class new file mode 100644 index 0000000..94ba38b Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/bean/AppKeyInfo.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/bean/StoresPrediction.class b/food-open/food-open-api/target/classes/com/jwsaas/bean/StoresPrediction.class new file mode 100644 index 0000000..4dab722 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/bean/StoresPrediction.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/cache/CacheUtil.class b/food-open/food-open-api/target/classes/com/jwsaas/cache/CacheUtil.class new file mode 100644 index 0000000..d45b695 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/cache/CacheUtil.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/cache/data/CacheData.class b/food-open/food-open-api/target/classes/com/jwsaas/cache/data/CacheData.class new file mode 100644 index 0000000..2b2cc32 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/cache/data/CacheData.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/cache/data/ProductRatioCache.class b/food-open/food-open-api/target/classes/com/jwsaas/cache/data/ProductRatioCache.class new file mode 100644 index 0000000..6bb25f0 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/cache/data/ProductRatioCache.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/cache/data/ProductUnitCache.class b/food-open/food-open-api/target/classes/com/jwsaas/cache/data/ProductUnitCache.class new file mode 100644 index 0000000..2068d4d Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/cache/data/ProductUnitCache.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/cache/data/ProgramProductInfoCache.class b/food-open/food-open-api/target/classes/com/jwsaas/cache/data/ProgramProductInfoCache.class new file mode 100644 index 0000000..9a0108c Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/cache/data/ProgramProductInfoCache.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/cache/data/StoreCache.class b/food-open/food-open-api/target/classes/com/jwsaas/cache/data/StoreCache.class new file mode 100644 index 0000000..4bfc314 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/cache/data/StoreCache.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/config/ExpirationMessagePostProcessor.class b/food-open/food-open-api/target/classes/com/jwsaas/config/ExpirationMessagePostProcessor.class new file mode 100644 index 0000000..826d62e Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/config/ExpirationMessagePostProcessor.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/config/MQMessageSender.class b/food-open/food-open-api/target/classes/com/jwsaas/config/MQMessageSender.class new file mode 100644 index 0000000..4afee81 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/config/MQMessageSender.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/config/MqttConfiguration.class b/food-open/food-open-api/target/classes/com/jwsaas/config/MqttConfiguration.class new file mode 100644 index 0000000..5a99bb4 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/config/MqttConfiguration.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/config/OpenApiProperties.class b/food-open/food-open-api/target/classes/com/jwsaas/config/OpenApiProperties.class new file mode 100644 index 0000000..416b37a Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/config/OpenApiProperties.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/config/OpenCardApiProperties.class b/food-open/food-open-api/target/classes/com/jwsaas/config/OpenCardApiProperties.class new file mode 100644 index 0000000..f120d56 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/config/OpenCardApiProperties.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/config/RabbitConstant.class b/food-open/food-open-api/target/classes/com/jwsaas/config/RabbitConstant.class new file mode 100644 index 0000000..b09711b Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/config/RabbitConstant.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/config/RabbitMQConfig.class b/food-open/food-open-api/target/classes/com/jwsaas/config/RabbitMQConfig.class new file mode 100644 index 0000000..9c0eca6 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/config/RabbitMQConfig.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/config/ReactorConfiguration.class b/food-open/food-open-api/target/classes/com/jwsaas/config/ReactorConfiguration.class new file mode 100644 index 0000000..d7d3574 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/config/ReactorConfiguration.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/config/RedissonConfiguration$RedisType.class b/food-open/food-open-api/target/classes/com/jwsaas/config/RedissonConfiguration$RedisType.class new file mode 100644 index 0000000..85c9b70 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/config/RedissonConfiguration$RedisType.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/config/RedissonConfiguration.class b/food-open/food-open-api/target/classes/com/jwsaas/config/RedissonConfiguration.class new file mode 100644 index 0000000..72f50f6 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/config/RedissonConfiguration.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/config/SchedulingConfiguration.class b/food-open/food-open-api/target/classes/com/jwsaas/config/SchedulingConfiguration.class new file mode 100644 index 0000000..7c1dc43 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/config/SchedulingConfiguration.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/BaseController.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/BaseController.class new file mode 100644 index 0000000..2637d4c Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/BaseController.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/IndexController.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/IndexController.class new file mode 100644 index 0000000..8691f86 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/IndexController.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/callback/CallBackController.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/callback/CallBackController.class new file mode 100644 index 0000000..31787ab Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/callback/CallBackController.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/callback/CandaoDispatchCallBackController.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/callback/CandaoDispatchCallBackController.class new file mode 100644 index 0000000..078ee0c Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/callback/CandaoDispatchCallBackController.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/open/ApiExtendController$1.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/ApiExtendController$1.class new file mode 100644 index 0000000..5f39036 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/ApiExtendController$1.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/open/ApiExtendController$2.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/ApiExtendController$2.class new file mode 100644 index 0000000..4a78caf Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/ApiExtendController$2.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/open/ApiExtendController$3.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/ApiExtendController$3.class new file mode 100644 index 0000000..bb1b97d Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/ApiExtendController$3.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/open/ApiExtendController$4.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/ApiExtendController$4.class new file mode 100644 index 0000000..aa4614c Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/ApiExtendController$4.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/open/ApiExtendController$5.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/ApiExtendController$5.class new file mode 100644 index 0000000..a015180 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/ApiExtendController$5.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/open/ApiExtendController$6.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/ApiExtendController$6.class new file mode 100644 index 0000000..66072da Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/ApiExtendController$6.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/open/ApiExtendController.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/ApiExtendController.class new file mode 100644 index 0000000..e1c05b5 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/ApiExtendController.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$1.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$1.class new file mode 100644 index 0000000..c721350 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$1.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$10.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$10.class new file mode 100644 index 0000000..120c8a6 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$10.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$11.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$11.class new file mode 100644 index 0000000..1fd1bad Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$11.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$12.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$12.class new file mode 100644 index 0000000..3275b3b Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$12.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$13.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$13.class new file mode 100644 index 0000000..7f78edb Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$13.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$14.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$14.class new file mode 100644 index 0000000..81bd002 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$14.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$2.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$2.class new file mode 100644 index 0000000..7c3e62e Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$2.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$3.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$3.class new file mode 100644 index 0000000..c7963c7 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$3.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$4.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$4.class new file mode 100644 index 0000000..6435d4b Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$4.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$5.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$5.class new file mode 100644 index 0000000..fe05023 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$5.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$6.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$6.class new file mode 100644 index 0000000..b5f57f2 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$6.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$7.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$7.class new file mode 100644 index 0000000..e802507 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$7.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$8.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$8.class new file mode 100644 index 0000000..ed51fd3 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$8.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$9.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$9.class new file mode 100644 index 0000000..29f56a5 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController$9.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController.class new file mode 100644 index 0000000..1233211 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaiDuLbsController.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaseOpenController.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaseOpenController.class new file mode 100644 index 0000000..a906105 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/BaseOpenController.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/open/MqttController.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/MqttController.class new file mode 100644 index 0000000..960c0c7 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/MqttController.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/open/TaskController$1.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/TaskController$1.class new file mode 100644 index 0000000..780da1e Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/TaskController$1.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/open/TaskController$2.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/TaskController$2.class new file mode 100644 index 0000000..3bf7715 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/TaskController$2.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/open/TaskController$3.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/TaskController$3.class new file mode 100644 index 0000000..926beef Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/TaskController$3.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/open/TaskController$4.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/TaskController$4.class new file mode 100644 index 0000000..1351981 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/TaskController$4.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/open/TaskController$5.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/TaskController$5.class new file mode 100644 index 0000000..eefa4e5 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/TaskController$5.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/open/TaskController$6.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/TaskController$6.class new file mode 100644 index 0000000..52aed45 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/TaskController$6.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/controller/open/TaskController.class b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/TaskController.class new file mode 100644 index 0000000..2b59ab1 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/controller/open/TaskController.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/freemarker/DefaultTemplateExceptionHandler.class b/food-open/food-open-api/target/classes/com/jwsaas/freemarker/DefaultTemplateExceptionHandler.class new file mode 100644 index 0000000..bc36231 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/freemarker/DefaultTemplateExceptionHandler.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/http/HTTPRequest$1.class b/food-open/food-open-api/target/classes/com/jwsaas/http/HTTPRequest$1.class new file mode 100644 index 0000000..cf28fdf Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/http/HTTPRequest$1.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/http/HTTPRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/http/HTTPRequest.class new file mode 100644 index 0000000..00417db Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/http/HTTPRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/http/HTTPResponseCallback.class b/food-open/food-open-api/target/classes/com/jwsaas/http/HTTPResponseCallback.class new file mode 100644 index 0000000..98b68f6 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/http/HTTPResponseCallback.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/http/HttpConstants.class b/food-open/food-open-api/target/classes/com/jwsaas/http/HttpConstants.class new file mode 100644 index 0000000..b5ad96e Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/http/HttpConstants.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/http/HttpTool.class b/food-open/food-open-api/target/classes/com/jwsaas/http/HttpTool.class new file mode 100644 index 0000000..e78475e Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/http/HttpTool.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/http/callbacks/HTTPByteCallback.class b/food-open/food-open-api/target/classes/com/jwsaas/http/callbacks/HTTPByteCallback.class new file mode 100644 index 0000000..1f6d4ba Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/http/callbacks/HTTPByteCallback.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/http/callbacks/HTTPStatusCheckCallback.class b/food-open/food-open-api/target/classes/com/jwsaas/http/callbacks/HTTPStatusCheckCallback.class new file mode 100644 index 0000000..bd9d371 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/http/callbacks/HTTPStatusCheckCallback.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/http/callbacks/HTTPStringCallback.class b/food-open/food-open-api/target/classes/com/jwsaas/http/callbacks/HTTPStringCallback.class new file mode 100644 index 0000000..e68b110 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/http/callbacks/HTTPStringCallback.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/mqtt/MqttClientExt$1.class b/food-open/food-open-api/target/classes/com/jwsaas/mqtt/MqttClientExt$1.class new file mode 100644 index 0000000..9374ea2 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/mqtt/MqttClientExt$1.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/mqtt/MqttClientExt.class b/food-open/food-open-api/target/classes/com/jwsaas/mqtt/MqttClientExt.class new file mode 100644 index 0000000..e5905c2 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/mqtt/MqttClientExt.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/mqtt/PushCallback.class b/food-open/food-open-api/target/classes/com/jwsaas/mqtt/PushCallback.class new file mode 100644 index 0000000..c9035e5 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/mqtt/PushCallback.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/mqtt/Topic.class b/food-open/food-open-api/target/classes/com/jwsaas/mqtt/Topic.class new file mode 100644 index 0000000..daece52 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/mqtt/Topic.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/open/converter/DateConverter.class b/food-open/food-open-api/target/classes/com/jwsaas/open/converter/DateConverter.class new file mode 100644 index 0000000..8c00c74 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/open/converter/DateConverter.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/open/interceptor/ReservedInterceptor.class b/food-open/food-open-api/target/classes/com/jwsaas/open/interceptor/ReservedInterceptor.class new file mode 100644 index 0000000..c38e7dd Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/open/interceptor/ReservedInterceptor.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/open/listener/DefaultAfterDoServiceEventListener.class b/food-open/food-open-api/target/classes/com/jwsaas/open/listener/DefaultAfterDoServiceEventListener.class new file mode 100644 index 0000000..028a5be Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/open/listener/DefaultAfterDoServiceEventListener.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/open/listener/DefaultAfterStartedEventListener.class b/food-open/food-open-api/target/classes/com/jwsaas/open/listener/DefaultAfterStartedEventListener.class new file mode 100644 index 0000000..299e1a4 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/open/listener/DefaultAfterStartedEventListener.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/open/security/redis/RedisAppSecretManager.class b/food-open/food-open-api/target/classes/com/jwsaas/open/security/redis/RedisAppSecretManager.class new file mode 100644 index 0000000..6e8c087 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/open/security/redis/RedisAppSecretManager.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/open/security/redis/RedisInvokeTimesController.class b/food-open/food-open-api/target/classes/com/jwsaas/open/security/redis/RedisInvokeTimesController.class new file mode 100644 index 0000000..562d1eb Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/open/security/redis/RedisInvokeTimesController.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/open/security/redis/RedisServiceAccessController.class b/food-open/food-open-api/target/classes/com/jwsaas/open/security/redis/RedisServiceAccessController.class new file mode 100644 index 0000000..84fe8a8 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/open/security/redis/RedisServiceAccessController.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/open/session/redis/RedisSessionBindInterceptor.class b/food-open/food-open-api/target/classes/com/jwsaas/open/session/redis/RedisSessionBindInterceptor.class new file mode 100644 index 0000000..5213a64 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/open/session/redis/RedisSessionBindInterceptor.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/open/session/redis/RedisSessionManager.class b/food-open/food-open-api/target/classes/com/jwsaas/open/session/redis/RedisSessionManager.class new file mode 100644 index 0000000..646cea6 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/open/session/redis/RedisSessionManager.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/pager/Pager.class b/food-open/food-open-api/target/classes/com/jwsaas/pager/Pager.class new file mode 100644 index 0000000..eaa602f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/pager/Pager.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/api/WeiXinPayApi.class b/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/api/WeiXinPayApi.class new file mode 100644 index 0000000..dfb8859 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/api/WeiXinPayApi.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/request/PayNotifyRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/request/PayNotifyRequest.class new file mode 100644 index 0000000..34e3279 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/request/PayNotifyRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/request/QueryOrderRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/request/QueryOrderRequest.class new file mode 100644 index 0000000..9a7d322 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/request/QueryOrderRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/request/QueryRefundRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/request/QueryRefundRequest.class new file mode 100644 index 0000000..c8db9f6 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/request/QueryRefundRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/request/RefundRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/request/RefundRequest.class new file mode 100644 index 0000000..ee99494 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/request/RefundRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/request/UnifiedOrderRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/request/UnifiedOrderRequest.class new file mode 100644 index 0000000..55bd492 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/request/UnifiedOrderRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/response/PayNotifyResponse.class b/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/response/PayNotifyResponse.class new file mode 100644 index 0000000..b3f932d Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/response/PayNotifyResponse.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/response/QueryOrderResponse.class b/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/response/QueryOrderResponse.class new file mode 100644 index 0000000..960359e Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/response/QueryOrderResponse.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/response/QueryRefundResponse.class b/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/response/QueryRefundResponse.class new file mode 100644 index 0000000..b6e2b94 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/response/QueryRefundResponse.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/response/RefundResponse.class b/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/response/RefundResponse.class new file mode 100644 index 0000000..08d5417 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/response/RefundResponse.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/response/UnifiedOrderResponse.class b/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/response/UnifiedOrderResponse.class new file mode 100644 index 0000000..52dccd0 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/response/UnifiedOrderResponse.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/utils/SecurityUtils$1.class b/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/utils/SecurityUtils$1.class new file mode 100644 index 0000000..5b0c1d6 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/utils/SecurityUtils$1.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/utils/SecurityUtils.class b/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/utils/SecurityUtils.class new file mode 100644 index 0000000..08b2f40 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/pay/weixin/utils/SecurityUtils.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/properties/ApplicationProperties.class b/food-open/food-open-api/target/classes/com/jwsaas/properties/ApplicationProperties.class new file mode 100644 index 0000000..2b9a561 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/properties/ApplicationProperties.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/properties/BaiduhProperties.class b/food-open/food-open-api/target/classes/com/jwsaas/properties/BaiduhProperties.class new file mode 100644 index 0000000..c548cd9 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/properties/BaiduhProperties.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/properties/CandaoProperties.class b/food-open/food-open-api/target/classes/com/jwsaas/properties/CandaoProperties.class new file mode 100644 index 0000000..7b33c23 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/properties/CandaoProperties.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/properties/FdfsClientProperties.class b/food-open/food-open-api/target/classes/com/jwsaas/properties/FdfsClientProperties.class new file mode 100644 index 0000000..df3bfe3 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/properties/FdfsClientProperties.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/properties/RedisProperties.class b/food-open/food-open-api/target/classes/com/jwsaas/properties/RedisProperties.class new file mode 100644 index 0000000..029b99b Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/properties/RedisProperties.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/properties/SaoBeiPayProperties.class b/food-open/food-open-api/target/classes/com/jwsaas/properties/SaoBeiPayProperties.class new file mode 100644 index 0000000..2761d2f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/properties/SaoBeiPayProperties.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/properties/TongLianPayProperties.class b/food-open/food-open-api/target/classes/com/jwsaas/properties/TongLianPayProperties.class new file mode 100644 index 0000000..b956dc3 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/properties/TongLianPayProperties.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/properties/WeiXinProperties.class b/food-open/food-open-api/target/classes/com/jwsaas/properties/WeiXinProperties.class new file mode 100644 index 0000000..20bfd3d Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/properties/WeiXinProperties.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/properties/WxyhProperties.class b/food-open/food-open-api/target/classes/com/jwsaas/properties/WxyhProperties.class new file mode 100644 index 0000000..791a8ee Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/properties/WxyhProperties.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/properties/ZgxcProperties.class b/food-open/food-open-api/target/classes/com/jwsaas/properties/ZgxcProperties.class new file mode 100644 index 0000000..c2dbf87 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/properties/ZgxcProperties.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/quartz/SchedulerTack.class b/food-open/food-open-api/target/classes/com/jwsaas/quartz/SchedulerTack.class new file mode 100644 index 0000000..08e8617 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/quartz/SchedulerTack.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/BaseEvents.class b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/BaseEvents.class new file mode 100644 index 0000000..12556dd Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/BaseEvents.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/BaseWxdcEvents.class b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/BaseWxdcEvents.class new file mode 100644 index 0000000..164c622 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/BaseWxdcEvents.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/BusinessHandoverEvents.class b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/BusinessHandoverEvents.class new file mode 100644 index 0000000..147527b Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/BusinessHandoverEvents.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/DispatchTicketCreateByAutoEvents.class b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/DispatchTicketCreateByAutoEvents.class new file mode 100644 index 0000000..f3430b4 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/DispatchTicketCreateByAutoEvents.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/EventKeys.class b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/EventKeys.class new file mode 100644 index 0000000..b7619d8 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/EventKeys.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/PosEvents.class b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/PosEvents.class new file mode 100644 index 0000000..fe34d42 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/PosEvents.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/ProgramOrderEvents.class b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/ProgramOrderEvents.class new file mode 100644 index 0000000..dcfe6b6 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/ProgramOrderEvents.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/ProgramOrderSaobeiUploadEvents$1.class b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/ProgramOrderSaobeiUploadEvents$1.class new file mode 100644 index 0000000..f7ed620 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/ProgramOrderSaobeiUploadEvents$1.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/ProgramOrderSaobeiUploadEvents$2.class b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/ProgramOrderSaobeiUploadEvents$2.class new file mode 100644 index 0000000..77f7aa2 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/ProgramOrderSaobeiUploadEvents$2.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/ProgramOrderSaobeiUploadEvents.class b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/ProgramOrderSaobeiUploadEvents.class new file mode 100644 index 0000000..e8c538b Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/ProgramOrderSaobeiUploadEvents.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/ProgramPromotionTaskEvents.class b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/ProgramPromotionTaskEvents.class new file mode 100644 index 0000000..9359f27 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/ProgramPromotionTaskEvents.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/PromotionTaskEvents.class b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/PromotionTaskEvents.class new file mode 100644 index 0000000..231937c Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/PromotionTaskEvents.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/SalesOrderEvents.class b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/SalesOrderEvents.class new file mode 100644 index 0000000..b90d9fc Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/SalesOrderEvents.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/ServerDataVersionUpdateEvents.class b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/ServerDataVersionUpdateEvents.class new file mode 100644 index 0000000..cb76988 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/ServerDataVersionUpdateEvents.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/StoreAccountEvents.class b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/StoreAccountEvents.class new file mode 100644 index 0000000..da5feb5 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/StoreAccountEvents.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/WorkerLoginEvents.class b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/WorkerLoginEvents.class new file mode 100644 index 0000000..143f12b Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/WorkerLoginEvents.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/WxdcOrderEvents$1.class b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/WxdcOrderEvents$1.class new file mode 100644 index 0000000..45172bd Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/WxdcOrderEvents$1.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/WxdcOrderEvents.class b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/WxdcOrderEvents.class new file mode 100644 index 0000000..c7a7962 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/WxdcOrderEvents.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/WxdcOrderPayEvents$1.class b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/WxdcOrderPayEvents$1.class new file mode 100644 index 0000000..0e7ebdc Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/WxdcOrderPayEvents$1.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/WxdcOrderPayEvents$2.class b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/WxdcOrderPayEvents$2.class new file mode 100644 index 0000000..a11dbf4 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/WxdcOrderPayEvents$2.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/WxdcOrderPayEvents$3.class b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/WxdcOrderPayEvents$3.class new file mode 100644 index 0000000..ba1a038 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/WxdcOrderPayEvents$3.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/WxdcOrderPayEvents.class b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/WxdcOrderPayEvents.class new file mode 100644 index 0000000..5870c78 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/WxdcOrderPayEvents.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/WxdcOrderRefundEvents.class b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/WxdcOrderRefundEvents.class new file mode 100644 index 0000000..80ca8a6 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/WxdcOrderRefundEvents.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/WxyhEvents.class b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/WxyhEvents.class new file mode 100644 index 0000000..83319ec Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/WxyhEvents.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/ZgcxEvents.class b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/ZgcxEvents.class new file mode 100644 index 0000000..2b1218d Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/reactor/event/ZgcxEvents.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/scheduling/AppAuthSchedule.class b/food-open/food-open-api/target/classes/com/jwsaas/scheduling/AppAuthSchedule.class new file mode 100644 index 0000000..1afec69 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/scheduling/AppAuthSchedule.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/scheduling/Monitor.class b/food-open/food-open-api/target/classes/com/jwsaas/scheduling/Monitor.class new file mode 100644 index 0000000..205952b Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/scheduling/Monitor.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/servlet/ServletRegister.class b/food-open/food-open-api/target/classes/com/jwsaas/servlet/ServletRegister.class new file mode 100644 index 0000000..085c638 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/servlet/ServletRegister.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/task/TaskJobHandler.class b/food-open/food-open-api/target/classes/com/jwsaas/task/TaskJobHandler.class new file mode 100644 index 0000000..a0762bb Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/task/TaskJobHandler.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/task/utils/TaskOpenUtils.class b/food-open/food-open-api/target/classes/com/jwsaas/task/utils/TaskOpenUtils.class new file mode 100644 index 0000000..c91e0b8 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/task/utils/TaskOpenUtils.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/tonglian/ReturnMsg.class b/food-open/food-open-api/target/classes/com/jwsaas/tonglian/ReturnMsg.class new file mode 100644 index 0000000..53532e2 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/tonglian/ReturnMsg.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/tonglian/TlCommonConstants.class b/food-open/food-open-api/target/classes/com/jwsaas/tonglian/TlCommonConstants.class new file mode 100644 index 0000000..c01841f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/tonglian/TlCommonConstants.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/tonglian/TlHttpClient.class b/food-open/food-open-api/target/classes/com/jwsaas/tonglian/TlHttpClient.class new file mode 100644 index 0000000..b09a518 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/tonglian/TlHttpClient.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/tonglian/TlHttpUtils.class b/food-open/food-open-api/target/classes/com/jwsaas/tonglian/TlHttpUtils.class new file mode 100644 index 0000000..62591c1 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/tonglian/TlHttpUtils.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/tonglian/TlRegister.class b/food-open/food-open-api/target/classes/com/jwsaas/tonglian/TlRegister.class new file mode 100644 index 0000000..e989fd5 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/tonglian/TlRegister.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/tonglian/TlRequest.class b/food-open/food-open-api/target/classes/com/jwsaas/tonglian/TlRequest.class new file mode 100644 index 0000000..a35e76a Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/tonglian/TlRequest.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/tonglian/TlSignUtils.class b/food-open/food-open-api/target/classes/com/jwsaas/tonglian/TlSignUtils.class new file mode 100644 index 0000000..7c37efe Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/tonglian/TlSignUtils.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/tonglian/bean/AgentCollectApply.class b/food-open/food-open-api/target/classes/com/jwsaas/tonglian/bean/AgentCollectApply.class new file mode 100644 index 0000000..be51adc Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/tonglian/bean/AgentCollectApply.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/tonglian/bean/OrderRefund.class b/food-open/food-open-api/target/classes/com/jwsaas/tonglian/bean/OrderRefund.class new file mode 100644 index 0000000..de91b6c Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/tonglian/bean/OrderRefund.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/tonglian/bean/Reqsn.class b/food-open/food-open-api/target/classes/com/jwsaas/tonglian/bean/Reqsn.class new file mode 100644 index 0000000..8bb2562 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/tonglian/bean/Reqsn.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/util/AES.class b/food-open/food-open-api/target/classes/com/jwsaas/util/AES.class new file mode 100644 index 0000000..b305d3c Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/util/AES.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/util/Assert.class b/food-open/food-open-api/target/classes/com/jwsaas/util/Assert.class new file mode 100644 index 0000000..0b83e5a Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/util/Assert.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/util/CardApiUtils.class b/food-open/food-open-api/target/classes/com/jwsaas/util/CardApiUtils.class new file mode 100644 index 0000000..7e2af46 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/util/CardApiUtils.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/util/CronUtil.class b/food-open/food-open-api/target/classes/com/jwsaas/util/CronUtil.class new file mode 100644 index 0000000..76a0558 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/util/CronUtil.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/util/DateUtils.class b/food-open/food-open-api/target/classes/com/jwsaas/util/DateUtils.class new file mode 100644 index 0000000..1e750fe Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/util/DateUtils.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/util/DesUtil.class b/food-open/food-open-api/target/classes/com/jwsaas/util/DesUtil.class new file mode 100644 index 0000000..f90c745 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/util/DesUtil.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/util/DigestUtils.class b/food-open/food-open-api/target/classes/com/jwsaas/util/DigestUtils.class new file mode 100644 index 0000000..377c29a Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/util/DigestUtils.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/util/EncryptedDataUtils.class b/food-open/food-open-api/target/classes/com/jwsaas/util/EncryptedDataUtils.class new file mode 100644 index 0000000..156fffb Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/util/EncryptedDataUtils.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/util/HexUtils.class b/food-open/food-open-api/target/classes/com/jwsaas/util/HexUtils.class new file mode 100644 index 0000000..b417ec7 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/util/HexUtils.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/util/HmacSHA1Utils.class b/food-open/food-open-api/target/classes/com/jwsaas/util/HmacSHA1Utils.class new file mode 100644 index 0000000..fd71d09 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/util/HmacSHA1Utils.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/util/HttpUtils.class b/food-open/food-open-api/target/classes/com/jwsaas/util/HttpUtils.class new file mode 100644 index 0000000..b6e016b Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/util/HttpUtils.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/util/JSONException.class b/food-open/food-open-api/target/classes/com/jwsaas/util/JSONException.class new file mode 100644 index 0000000..8b7b8e1 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/util/JSONException.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/util/JSONUtil$1.class b/food-open/food-open-api/target/classes/com/jwsaas/util/JSONUtil$1.class new file mode 100644 index 0000000..1f2fd66 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/util/JSONUtil$1.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/util/JSONUtil.class b/food-open/food-open-api/target/classes/com/jwsaas/util/JSONUtil.class new file mode 100644 index 0000000..a68f571 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/util/JSONUtil.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/util/KeyIdUtil.class b/food-open/food-open-api/target/classes/com/jwsaas/util/KeyIdUtil.class new file mode 100644 index 0000000..ed4c6a2 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/util/KeyIdUtil.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/util/KeyUtil.class b/food-open/food-open-api/target/classes/com/jwsaas/util/KeyUtil.class new file mode 100644 index 0000000..53b82ff Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/util/KeyUtil.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/util/Md5Hash.class b/food-open/food-open-api/target/classes/com/jwsaas/util/Md5Hash.class new file mode 100644 index 0000000..a17dec0 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/util/Md5Hash.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/util/Pinyin4jUtil.class b/food-open/food-open-api/target/classes/com/jwsaas/util/Pinyin4jUtil.class new file mode 100644 index 0000000..b9b70a1 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/util/Pinyin4jUtil.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/util/RandomUtil.class b/food-open/food-open-api/target/classes/com/jwsaas/util/RandomUtil.class new file mode 100644 index 0000000..a2619c8 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/util/RandomUtil.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/util/RandomUtils.class b/food-open/food-open-api/target/classes/com/jwsaas/util/RandomUtils.class new file mode 100644 index 0000000..a702f97 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/util/RandomUtils.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/util/ReflectionUtils.class b/food-open/food-open-api/target/classes/com/jwsaas/util/ReflectionUtils.class new file mode 100644 index 0000000..7fc88f1 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/util/ReflectionUtils.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/util/StringUtils.class b/food-open/food-open-api/target/classes/com/jwsaas/util/StringUtils.class new file mode 100644 index 0000000..b776732 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/util/StringUtils.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/util/SybUtil.class b/food-open/food-open-api/target/classes/com/jwsaas/util/SybUtil.class new file mode 100644 index 0000000..a59690e Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/util/SybUtil.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/util/TaskSignUtil.class b/food-open/food-open-api/target/classes/com/jwsaas/util/TaskSignUtil.class new file mode 100644 index 0000000..9890b8f Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/util/TaskSignUtil.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/util/URLDecodedUtil.class b/food-open/food-open-api/target/classes/com/jwsaas/util/URLDecodedUtil.class new file mode 100644 index 0000000..12d0cf2 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/util/URLDecodedUtil.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/util/URLEncodedUtil.class b/food-open/food-open-api/target/classes/com/jwsaas/util/URLEncodedUtil.class new file mode 100644 index 0000000..1825067 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/util/URLEncodedUtil.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/util/XStreamUtils.class b/food-open/food-open-api/target/classes/com/jwsaas/util/XStreamUtils.class new file mode 100644 index 0000000..e155ec6 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/util/XStreamUtils.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/util/file/FileToByteArray.class b/food-open/food-open-api/target/classes/com/jwsaas/util/file/FileToByteArray.class new file mode 100644 index 0000000..fea2168 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/util/file/FileToByteArray.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/util/file/FileTypeUtils.class b/food-open/food-open-api/target/classes/com/jwsaas/util/file/FileTypeUtils.class new file mode 100644 index 0000000..c1c36ba Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/util/file/FileTypeUtils.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/util/file/FileUtils.class b/food-open/food-open-api/target/classes/com/jwsaas/util/file/FileUtils.class new file mode 100644 index 0000000..58f159c Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/util/file/FileUtils.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/util/open/BaseApiUtils$1.class b/food-open/food-open-api/target/classes/com/jwsaas/util/open/BaseApiUtils$1.class new file mode 100644 index 0000000..b06dac6 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/util/open/BaseApiUtils$1.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/util/open/BaseApiUtils.class b/food-open/food-open-api/target/classes/com/jwsaas/util/open/BaseApiUtils.class new file mode 100644 index 0000000..754c9af Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/util/open/BaseApiUtils.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/util/open/BaseCardApiUtils.class b/food-open/food-open-api/target/classes/com/jwsaas/util/open/BaseCardApiUtils.class new file mode 100644 index 0000000..be40cfc Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/util/open/BaseCardApiUtils.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/utils/AppAuthUtil.class b/food-open/food-open-api/target/classes/com/jwsaas/utils/AppAuthUtil.class new file mode 100644 index 0000000..19f2d02 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/utils/AppAuthUtil.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/utils/AppKeyUtil.class b/food-open/food-open-api/target/classes/com/jwsaas/utils/AppKeyUtil.class new file mode 100644 index 0000000..2ec74a4 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/utils/AppKeyUtil.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/utils/HashidsUtil.class b/food-open/food-open-api/target/classes/com/jwsaas/utils/HashidsUtil.class new file mode 100644 index 0000000..339504a Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/utils/HashidsUtil.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/utils/RedisKeyUtil.class b/food-open/food-open-api/target/classes/com/jwsaas/utils/RedisKeyUtil.class new file mode 100644 index 0000000..61f7bca Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/utils/RedisKeyUtil.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/weixin/SignUtil.class b/food-open/food-open-api/target/classes/com/jwsaas/weixin/SignUtil.class new file mode 100644 index 0000000..f7ce3ae Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/weixin/SignUtil.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/weixin/TemplateMessageApi.class b/food-open/food-open-api/target/classes/com/jwsaas/weixin/TemplateMessageApi.class new file mode 100644 index 0000000..b521fb1 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/weixin/TemplateMessageApi.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/weixin/WeixinUtil.class b/food-open/food-open-api/target/classes/com/jwsaas/weixin/WeixinUtil.class new file mode 100644 index 0000000..1fac6be Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/weixin/WeixinUtil.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/weixin/bean/TemplateMessage$Item.class b/food-open/food-open-api/target/classes/com/jwsaas/weixin/bean/TemplateMessage$Item.class new file mode 100644 index 0000000..c86d861 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/weixin/bean/TemplateMessage$Item.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/weixin/bean/TemplateMessage.class b/food-open/food-open-api/target/classes/com/jwsaas/weixin/bean/TemplateMessage.class new file mode 100644 index 0000000..1ef5635 Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/weixin/bean/TemplateMessage.class differ diff --git a/food-open/food-open-api/target/classes/com/jwsaas/weixin/bean/Token.class b/food-open/food-open-api/target/classes/com/jwsaas/weixin/bean/Token.class new file mode 100644 index 0000000..aedde2a Binary files /dev/null and b/food-open/food-open-api/target/classes/com/jwsaas/weixin/bean/Token.class differ diff --git a/food-open/food-open-api/target/food-open-api-2.0.0.jar b/food-open/food-open-api/target/food-open-api-2.0.0.jar new file mode 100644 index 0000000..7650c58 Binary files /dev/null and b/food-open/food-open-api/target/food-open-api-2.0.0.jar differ diff --git a/food-open/food-open-api/target/food-open-api-2.0.0.jar.original b/food-open/food-open-api/target/food-open-api-2.0.0.jar.original new file mode 100644 index 0000000..10a3417 Binary files /dev/null and b/food-open/food-open-api/target/food-open-api-2.0.0.jar.original differ diff --git a/food-open/food-open-api/target/food-open-api-2.0.0.zip b/food-open/food-open-api/target/food-open-api-2.0.0.zip new file mode 100644 index 0000000..a5abeab Binary files /dev/null and b/food-open/food-open-api/target/food-open-api-2.0.0.zip differ diff --git a/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/install.bat b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/install.bat new file mode 100644 index 0000000..046a68c --- /dev/null +++ b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/install.bat @@ -0,0 +1,140 @@ +@echo off +setlocal + +rem +rem Copyright (c) 1999, 2016 Tanuki Software, Ltd. +rem http://www.tanukisoftware.com +rem All rights reserved. +rem +rem This software is the proprietary information of Tanuki Software. +rem You shall use it only in accordance with the terms of the +rem license agreement you entered into with Tanuki Software. +rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html +rem +rem Java Service Wrapper general passthrough startup script. +rem + +rem ----------------------------------------------------------------------------- +rem These settings can be modified to fit the needs of your application +rem Optimized for use with version 3.5.28 of the Wrapper. + +rem The base name for the Wrapper binary. +set _WRAPPER_BASE=wrapper + +rem The directory where the Wrapper binary (.exe) file is located. It can be +rem either an absolute or a relative path. If the path contains any special +rem characters, please make sure to quote the variable. +set _WRAPPER_DIR= + +rem The name and location of the Wrapper configuration file. This will be used +rem if the user does not specify a configuration file as the first parameter to +rem this script. +set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf" + +rem Makes it possible to override the Wrapper configuration file by specifying it +rem as the first parameter. +rem set _WRAPPER_CONF_OVERRIDE=true + +rem _PASS_THROUGH tells the script to pass all parameters through to the JVM +rem as is. +rem If _WRAPPER_CONF_OVERRIDE is specified then all parameters will be passed. +rem If not set then all parameters starting with the second will be passed. +set _PASS_THROUGH=true + +rem Do not modify anything beyond this point +rem ----------------------------------------------------------------------------- + +rem +rem Resolve the real path of the wrapper.exe +rem For non NT systems, the _REALPATH and _WRAPPER_CONF values +rem can be hard-coded below and the following test removed. +rem +if "%OS%"=="Windows_NT" goto nt +echo This script only works with NT-based versions of Windows. +goto :eof + +:nt +rem Find the application home. +rem if no path path specified do the default action +IF not DEFINED _WRAPPER_DIR goto dir_undefined +set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%" +if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\" +rem check if absolute path +if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path +if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path +rem everythig else means relative path +set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%" +goto pathfound + +:dir_undefined +rem Use a relative path to the wrapper %~dp0 is location of current script under NT +set _REALPATH="%~dp0" +goto pathfound +:absolute_path +rem Use an absolute path to the wrapper +set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%" + +:pathfound +rem +rem Decide on the specific Wrapper binary to use (See delta-pack) +rem +if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe" +goto search +:amd64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe" +goto search +:ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe" +goto search +:search +set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%" +if exist %_WRAPPER_EXE% goto conf +set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe" +if exist %_WRAPPER_EXE% goto conf +echo Unable to locate a Wrapper executable using any of the following names: +echo %_WRAPPER_L_EXE% +echo %_WRAPPER_EXE% +pause +goto :eof + +rem +rem Find the wrapper.conf +rem +:conf +if [%_WRAPPER_CONF_OVERRIDE%]==[true] ( + set _WRAPPER_CONF="%~f1" + if not [%_WRAPPER_CONF%]==[""] ( + shift + goto :startup + ) +) +set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%" + +rem +rem Start the Wrapper +rem +:startup +if not [%_PASS_THROUGH%]==[true] ( + if not [%1]==[] ( + echo WARNING: Extra arguments will be ignored. Please check usage in the batch file. + ) +) + +rem Collect the application parameters +:parameters +set _PARAMETERS=%_PARAMETERS% %1 +shift +if not [%1]==[] goto :parameters + +if not [%_PASS_THROUGH%]==[true] ( + %_WRAPPER_EXE% -i %_WRAPPER_CONF% +) else ( + %_WRAPPER_EXE% -i %_WRAPPER_CONF% -- %_PARAMETERS% +) +if not errorlevel 1 goto :eof +pause + + diff --git a/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/middleware b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/middleware new file mode 100644 index 0000000..3f3ad3f --- /dev/null +++ b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/middleware @@ -0,0 +1,2162 @@ +#! /bin/sh + +# +# Copyright (c) 1999, 2016 Tanuki Software, Ltd. +# http://www.tanukisoftware.com +# All rights reserved. +# +# This software is the proprietary information of Tanuki Software. +# You shall use it only in accordance with the terms of the +# license agreement you entered into with Tanuki Software. +# http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html +# +# Java Service Wrapper sh script. Suitable for starting and stopping +# wrapped Java applications on UNIX platforms. +# + +#----------------------------------------------------------------------------- +# These settings can be modified to fit the needs of your application +# Optimized for use with version 3.5.28 of the Wrapper. + +#******************************************************************** +# NOTE - This script has been modified to run the TestWrapper sample +# application and should NOT be used as a base for your own +# applications. All of the documentation assumes that you are +# working from the default source script: +# WRAPPER_HOME/src/bin/sh.script.in +#******************************************************************** + +# IMPORTANT - Please always stop and uninstall an application before making +# any changes to this file. Failure to do so could remove the +# script's ability to control the application. + +# Initialization block for the install_initd and remove_initd scripts used by +# SUSE linux, CentOS and RHEL distributions. +# Note: From CentOS 6, make sure the BEGIN INIT INFO section is before any line +# of code otherwise the service won't be displayed in the Service +# Configuration GUI. +### BEGIN INIT INFO +# Provides: wrapper +# Required-Start: $local_fs $network $syslog +# Should-Start: +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Wrapper Sample Application +# Description: Wrapper Sample Application Description +### END INIT INFO + +# Application +APP_NAME="Food-2.0 Open Api" +APP_LONG_NAME="Food-2.0 Open Api Application" + +# If uncommented (and set to false), APP_NAME and APP_LONG_NAME will no longer +# be passed to the wrapper. See documentation for details. +#APP_NAME_PASS_TO_WRAPPER=false + +# Wrapper +WRAPPER_CMD="./wrapper" +WRAPPER_CONF="../conf/wrapper.conf" + +# Priority at which to run the wrapper. See "man nice" for valid priorities. +# nice is only used if a priority is specified. +PRIORITY= + +# Location of the pid file. +PIDDIR="." + +# PIDFILE_CHECK_PID tells the script to double check whether the pid in the pid +# file actually exists and belongs to this application. When not set, only +# check the pid, but not what it is. This is only needed when multiple +# applications need to share the same pid file. +PIDFILE_CHECK_PID=true + +# FIXED_COMMAND tells the script to use a hard coded action rather than +# expecting the first parameter of the command line to be the command. +# By default the command will will be expected to be the first parameter. +#FIXED_COMMAND=console + +# PASS_THROUGH tells the script to pass all arguments through to the JVM +# as is. If FIXED_COMMAND is specified then all arguments will be passed. +# If not set then all arguments starting with the second will be passed. +PASS_THROUGH=true + +# If uncommented, causes the Wrapper to be shutdown using an anchor file. +# When launched with the 'start' command, it will also ignore all INT and +# TERM signals. +#IGNORE_SIGNALS=true + +# Wrapper will start the JVM asynchronously. Your application may have some +# initialization tasks and it may be desirable to wait a few seconds +# before returning. For example, to delay the invocation of following +# startup scripts. Setting WAIT_AFTER_STARTUP to a positive number will +# cause the start command to delay for the indicated period of time +# (in seconds). +# +WAIT_AFTER_STARTUP=0 + +# If set, wait for the wrapper to report that the daemon has started +WAIT_FOR_STARTED_STATUS=true +WAIT_FOR_STARTED_TIMEOUT=120 + +# If set, the status, start_msg and stop_msg commands will print out detailed +# state information on the Wrapper and Java processes. +#DETAIL_STATUS=true + +# If set, the 'pause' and 'resume' commands will be enabled. These make it +# possible to pause the JVM or Java application without completely stopping +# the Wrapper. See the wrapper.pausable and wrapper.pausable.stop_jvm +# properties for more information. +#PAUSABLE=true + +# If specified, the Wrapper will be run as the specified user. +# IMPORTANT - Make sure that the user has the required privileges to write +# the PID file and wrapper.log files. Failure to be able to write the log +# file will cause the Wrapper to exit without any way to write out an error +# message. +# NOTE - This will set the user which is used to run the Wrapper as well as +# the JVM and is not useful in situations where a privileged resource or +# port needs to be allocated prior to the user being changed. +#RUN_AS_USER= + +# Set the full path to the 'su' command (substitute user). +# NOTE - In case 'su' is not in the PATH, you can set the absolute path here, +# for example: +# SU_BIN=/bin/su +# NOTE - For Red Hat, the script will use '/sbin/runuser' if it is present and +# ignore the value of SU_BIN. +SU_BIN=su + +# Set option for 'su'. +# In case the user set in RUN_AS_USER has no bash set, the 'su' command will fail. +# The workaround for GNU/Linux system is to specify which bash to use with +# the '-s' option. +#SU_OPTS="-s /bin/bash" + +# Set the full path to the 'id' command. +# For example: +# ID_BIN=/usr/bin/id +ID_BIN=id + +# By default we show a detailed usage block. Uncomment to show brief usage. +#BRIEF_USAGE=true + +# OS service management tool: flag for using Upstart when installing (rather than init.d rc.d) +USE_UPSTART= + +# OS service management tool: flag for using systemd when installing +USE_SYSTEMD= + +# When installing on Mac OSX platforms, the following domain will be used to +# prefix the plist file name. +PLIST_DOMAIN=org.tanukisoftware.wrapper + +# When installing on Mac OSX platforms, this parameter controls whether the daemon +# is to be kept continuously running or to let demand and conditions control the +# invocation. +MACOSX_KEEP_RUNNING="false" + +# The following two lines are used by the chkconfig command. Change as is +# appropriate for your application. They should remain commented. +# chkconfig: 2345 20 80 +# description: Test Wrapper Sample Application + +# Set run level to use when installing the application to start and stop on +# system startup and shutdown. It is important that the application always +# be uninstalled before making any changes to the run levels. +# It is also possible to specify different run levels based on the individual +# platform. When doing so this script will look for defined run levels in +# the following order: +# 1) "RUN_LEVEL_S_$DIST_OS" or "RUN_LEVEL_K_$DIST_OS", where "$DIST_OS" is +# the value of DIST_OS. "RUN_LEVEL_S_solaris=20" for example. +# 2) RUN_LEVEL_S or RUN_LEVEL_K, to specify specify start or stop run levels. +# 3) RUN_LEVEL, to specify a general run level. +RUN_LEVEL=20 + +# Do not modify anything beyond this point +#----------------------------------------------------------------------------- + +# check if we are running under Cygwin terminal. +# Note: on some OS's (for example Solaris, MacOS), -o is not a valid parameter +# and it shows an error message. We redirect stderr to null so the error message +# doesn't show up. +CYGWIN=`uname -o 2>/dev/null` +if [ "$CYGWIN" = "Cygwin" ] +then + eval echo `gettext 'This script is not compatible with Cygwin. Please use the Wrapper batch files to control the Wrapper.'` + exit 1 +fi + +if [ -n "$FIXED_COMMAND" ] +then + COMMAND="$FIXED_COMMAND" +else + COMMAND="$1" +fi + +# check if there is a parameter "sysd" +SYSD= +if [ $# -gt 1 ] ; then + if [ $2 = "sysd" ] ; then + SYSD=1 + fi +fi + +# default location for the service file +SYSTEMD_SERVICE_FILE="/etc/systemd/system/$APP_NAME.service" + +# Required for HP-UX Startup +if [ `uname -s` = "HP-UX" -o `uname -s` = "HP-UX64" ] ; then + PATH=$PATH:/usr/bin +fi + +# Get the fully qualified path to the script +case $0 in + /*) + SCRIPT="$0" + ;; + *) + PWD=`pwd` + SCRIPT="$PWD/$0" + ;; +esac + +# Resolve the true real path without any sym links. +CHANGED=true +while [ "X$CHANGED" != "X" ] +do + # Change spaces to ":" so the tokens can be parsed. + SAFESCRIPT=`echo $SCRIPT | sed -e 's; ;:;g'` + # Get the real path to this script, resolving any symbolic links + TOKENS=`echo $SAFESCRIPT | sed -e 's;/; ;g'` + REALPATH= + for C in $TOKENS; do + # Change any ":" in the token back to a space. + C=`echo $C | sed -e 's;:; ;g'` + REALPATH="$REALPATH/$C" + # If REALPATH is a sym link, resolve it. Loop for nested links. + while [ -h "$REALPATH" ] ; do + LS="`ls -ld "$REALPATH"`" + LINK="`expr "$LS" : '.*-> \(.*\)$'`" + if expr "$LINK" : '/.*' > /dev/null; then + # LINK is absolute. + REALPATH="$LINK" + else + # LINK is relative. + REALPATH="`dirname "$REALPATH"`""/$LINK" + fi + done + done + + if [ "$REALPATH" = "$SCRIPT" ] + then + CHANGED="" + else + SCRIPT="$REALPATH" + fi +done + +# Get the location of the script. +REALDIR=`dirname "$REALPATH"` +# Normalize the path +REALDIR=`cd "${REALDIR}"; pwd` + +# If the PIDDIR is relative, set its value relative to the full REALPATH to avoid problems if +# the working directory is later changed. +FIRST_CHAR=`echo $PIDDIR | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + PIDDIR=$REALDIR/$PIDDIR +fi +# Same test for WRAPPER_CMD +FIRST_CHAR=`echo $WRAPPER_CMD | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CMD=$REALDIR/$WRAPPER_CMD +fi +# Same test for WRAPPER_CONF +FIRST_CHAR=`echo $WRAPPER_CONF | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CONF=$REALDIR/$WRAPPER_CONF +fi + +# Process ID +ANCHORFILE="$PIDDIR/$APP_NAME.anchor" +COMMANDFILE="$PIDDIR/$APP_NAME.command" +STATUSFILE="$PIDDIR/$APP_NAME.status" +JAVASTATUSFILE="$PIDDIR/$APP_NAME.java.status" +PIDFILE="$PIDDIR/$APP_NAME.pid" +LOCKDIR="/var/lock/subsys" +LOCKFILE="$LOCKDIR/$APP_NAME" +pid="" + +# Resolve the location of the 'ps' command +PS_BIN="/usr/ucb/ps" + if [ ! -x "$PS_BIN" ] + then + PS_BIN="/usr/bin/ps" + if [ ! -x "$PS_BIN" ] + then + PS_BIN="/bin/ps" + if [ ! -x "$PS_BIN" ] + then + eval echo `gettext 'Unable to locate "ps".'` + eval echo `gettext 'Please report this message along with the location of the command on your system.'` + exit 1 + fi + fi + fi + +TR_BIN="/usr/bin/tr" +if [ ! -x "$TR_BIN" ] +then + TR_BIN="/bin/tr" + if [ ! -x "$TR_BIN" ] + then + eval echo `gettext 'Unable to locate "tr".'` + eval echo `gettext 'Please report this message along with the location of the command on your system.'` + exit 1 + fi +fi +# Resolve the os +DIST_OS=`uname -s | $TR_BIN "[A-Z]" "[a-z]" | $TR_BIN -d ' '` +case "$DIST_OS" in + 'sunos') + DIST_OS="solaris" + ;; + 'hp-ux' | 'hp-ux64') + # HP-UX needs the XPG4 version of ps (for -o args) + DIST_OS="hpux" + UNIX95="" + export UNIX95 + ;; + 'darwin') + DIST_OS="macosx" + ;; + 'unix_sv') + DIST_OS="unixware" + ;; + 'os/390') + DIST_OS="zos" + ;; +esac + +# Compare Versions $1<$2=0, $1==$2=1, $1>$2=2 +compareVersions () { + if [ "$1" = "$2" ] + then + return 1 + else + local i=1 + while true + do + local v1=`echo "$1" | cut -d '.' -f $i` + local v2=`echo "$2" | cut -d '.' -f $i` + if [ "X$v1" = "X" ] + then + if [ "X$v2" = "X" ] + then + return 1 + fi + v1="0" + elif [ "X$v2" = "X" ] + then + v2="0" + fi + if [ $v1 -lt $v2 ] + then + return 0 + elif [ $v1 -gt $v2 ] + then + return 2 + fi + i=`expr $i + 1` + done + fi +} + +# Resolve the architecture +if [ "$DIST_OS" = "macosx" ] +then + OS_VER=`sw_vers | grep 'ProductVersion:' | grep -o '[0-9]*\.[0-9]*\.[0-9]*\|[0-9]*\.[0-9]*'` + DIST_ARCH="universal" + compareVersions "$OS_VER" "10.5.0" + if [[ $? < 1 ]] + then + DIST_BITS="32" + KEY_KEEP_ALIVE="OnDemand" + else + # Note: "OnDemand" has been deprecated and replaced from Mac OS X 10.5 by "KeepAlive" + KEY_KEEP_ALIVE="KeepAlive" + + if [ "X`/usr/sbin/sysctl -n hw.cpu64bit_capable`" = "X1" ] + then + DIST_BITS="64" + else + DIST_BITS="32" + fi + fi + APP_PLIST_BASE=${PLIST_DOMAIN}.${APP_NAME} + APP_PLIST=${APP_PLIST_BASE}.plist +else + if [ "$DIST_OS" = "linux" ] + then + DIST_ARCH= + else + DIST_ARCH=`uname -p 2>/dev/null | $TR_BIN "[A-Z]" "[a-z]" | $TR_BIN -d ' '` + fi + if [ "X$DIST_ARCH" = "X" ] + then + DIST_ARCH="unknown" + fi + if [ "$DIST_ARCH" = "unknown" ] + then + DIST_ARCH=`uname -m 2>/dev/null | $TR_BIN "[A-Z]" "[a-z]" | $TR_BIN -d ' '` + fi + case "$DIST_ARCH" in + 'athlon' | 'i386' | 'i486' | 'i586' | 'i686') + DIST_ARCH="x86" + if [ "${DIST_OS}" = "solaris" ] ; then + DIST_BITS=`isainfo -b` + else + DIST_BITS="32" + fi + ;; + 'amd64' | 'x86_64') + DIST_ARCH="x86" + DIST_BITS="64" + ;; + 'ia32') + DIST_ARCH="ia" + DIST_BITS="32" + ;; + 'ia64' | 'ia64n' | 'ia64w') + DIST_ARCH="ia" + DIST_BITS="64" + ;; + 'ip27') + DIST_ARCH="mips" + DIST_BITS="32" + ;; + 'power' | 'powerpc' | 'power_pc' | 'ppc64') + if [ "${DIST_ARCH}" = "ppc64" ] ; then + DIST_BITS="64" + else + DIST_BITS="32" + fi + DIST_ARCH="ppc" + if [ "${DIST_OS}" = "aix" ] ; then + if [ `getconf KERNEL_BITMODE` -eq 64 ]; then + DIST_BITS="64" + else + DIST_BITS="32" + fi + fi + ;; + 'pa_risc' | 'pa-risc') + DIST_ARCH="parisc" + if [ `getconf KERNEL_BITS` -eq 64 ]; then + DIST_BITS="64" + else + DIST_BITS="32" + fi + ;; + 'sun4u' | 'sparcv9' | 'sparc') + DIST_ARCH="sparc" + DIST_BITS=`isainfo -b` + ;; + '9000/800' | '9000/785') + DIST_ARCH="parisc" + if [ `getconf KERNEL_BITS` -eq 64 ]; then + DIST_BITS="64" + else + DIST_BITS="32" + fi + ;; + '2064' | '2066' | '2084' | '2086' | '2094' | '2096' | '2097' | '2098' | '2817') + DIST_ARCH="390" + DIST_BITS="64" + ;; + armv*) + if [ -z "`readelf -A /proc/self/exe | grep Tag_ABI_VFP_args`" ] ; then + DIST_ARCH="armel" + DIST_BITS="32" + else + DIST_ARCH="armhf" + DIST_BITS="32" + fi + ;; + esac +fi + +# OSX always places Java in the same location so we can reliably set JAVA_HOME +if [ "$DIST_OS" = "macosx" ] +then + if [ -z "$JAVA_HOME" ]; then + if [ -x /usr/libexec/java_home ]; then + JAVA_HOME=`/usr/libexec/java_home`; export JAVA_HOME + else + JAVA_HOME="/Library/Java/Home"; export JAVA_HOME + fi + fi +fi + +# Test Echo +ECHOTEST=`echo -n "x"` +if [ "$ECHOTEST" = "x" ] +then + ECHOOPT="-n " + ECHOOPTC="" +else + ECHOOPT="" + ECHOOPTC="\c" +fi + + +gettext() { + "$WRAPPER_CMD" --translate "$1" "$WRAPPER_CONF" 2>/dev/null + if [ $? != 0 ] ; then + echo "$1" + fi +} + +outputFile() { + if [ -f "$1" ] + then + eval echo `gettext ' $1 Found but not executable.'`; + else + echo " $1" + fi +} + +# Decide on the wrapper binary to use. +# If the bits of the OS could be detected, we will try to look for the +# binary with the correct bits value. If it doesn't exist, fall back +# and look for the 32-bit binary. If that doesn't exist either then +# look for the default. +WRAPPER_TEST_CMD="" +if [ -f "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-$DIST_BITS" ] +then + WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-$DIST_BITS" + if [ ! -x "$WRAPPER_TEST_CMD" ] + then + chmod +x "$WRAPPER_TEST_CMD" 2>/dev/null + fi + if [ -x "$WRAPPER_TEST_CMD" ] + then + WRAPPER_CMD="$WRAPPER_TEST_CMD" + else + outputFile "$WRAPPER_TEST_CMD" + WRAPPER_TEST_CMD="" + fi +fi +if [ -f "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" -a -z "$WRAPPER_TEST_CMD" ] +then + WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" + if [ ! -x "$WRAPPER_TEST_CMD" ] + then + chmod +x "$WRAPPER_TEST_CMD" 2>/dev/null + fi + if [ -x "$WRAPPER_TEST_CMD" ] + then + WRAPPER_CMD="$WRAPPER_TEST_CMD" + else + outputFile "$WRAPPER_TEST_CMD" + WRAPPER_TEST_CMD="" + fi +fi +if [ -f "$WRAPPER_CMD" -a -z "$WRAPPER_TEST_CMD" ] +then + WRAPPER_TEST_CMD="$WRAPPER_CMD" + if [ ! -x "$WRAPPER_TEST_CMD" ] + then + chmod +x "$WRAPPER_TEST_CMD" 2>/dev/null + fi + if [ -x "$WRAPPER_TEST_CMD" ] + then + WRAPPER_CMD="$WRAPPER_TEST_CMD" + else + outputFile "$WRAPPER_TEST_CMD" + WRAPPER_TEST_CMD="" + fi +fi +if [ -z "$WRAPPER_TEST_CMD" ] +then + eval echo `gettext 'Unable to locate any of the following binaries:'` + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-$DIST_BITS" + if [ ! "$DIST_BITS" = "32" ] + then + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" + fi + outputFile "$WRAPPER_CMD" + + exit 1 +fi + + +# Build the nice clause +if [ "X$PRIORITY" = "X" ] +then + CMDNICE="" +else + CMDNICE="nice -$PRIORITY" +fi + +# Build the anchor file clause. +if [ "X$IGNORE_SIGNALS" = "X" ] +then + ANCHORPROP= + IGNOREPROP= +else + ANCHORPROP=wrapper.anchorfile=\"$ANCHORFILE\" + IGNOREPROP=wrapper.ignore_signals=TRUE +fi + +# Build the status file clause. +if [ "X$DETAIL_STATUS$WAIT_FOR_STARTED_STATUS" = "X" ] +then + STATUSPROP= +else + STATUSPROP="wrapper.statusfile=\"$STATUSFILE\" wrapper.java.statusfile=\"$JAVASTATUSFILE\"" +fi + +# Build the command file clause. +if [ -n "$PAUSABLE" ] +then + COMMANDPROP="wrapper.commandfile=\"$COMMANDFILE\" wrapper.pausable=TRUE" +else + COMMANDPROP= +fi + +if [ ! -n "$WAIT_FOR_STARTED_STATUS" ] +then + WAIT_FOR_STARTED_STATUS=true +fi + +if [ $WAIT_FOR_STARTED_STATUS = true ] ; then + DETAIL_STATUS=true +fi + + +# Build the lock file clause. Only create a lock file if the lock directory exists on this platform. +LOCKPROP= +if [ -d $LOCKDIR ] +then + if [ -w $LOCKDIR ] + then + LOCKPROP=wrapper.lockfile=\"$LOCKFILE\" + fi +fi + +# Build app name clause +if [ ! -n "$APP_NAME_PASS_TO_WRAPPER" ] +then + APP_NAME_PASS_TO_WRAPPER=true +fi +if [ $APP_NAME_PASS_TO_WRAPPER = false ] +then + APPNAMEPROP= +else + APPNAMEPROP="wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\"" +fi + +# Decide on run levels. +RUN_LEVEL_S_DIST_OS_TMP=`eval "echo \$\{RUN_LEVEL_S_${DIST_OS}\}"` +RUN_LEVEL_S_DIST_OS=`eval "echo ${RUN_LEVEL_S_DIST_OS_TMP}"` +if [ "X${RUN_LEVEL_S_DIST_OS}" != "X" ] ; then + APP_RUN_LEVEL_S=${RUN_LEVEL_S_DIST_OS} +elif [ "X$RUN_LEVEL_S" != "X" ] ; then + APP_RUN_LEVEL_S=$RUN_LEVEL_S +else + APP_RUN_LEVEL_S=$RUN_LEVEL +fi +APP_RUN_LEVEL_S_CHECK=`echo "$APP_RUN_LEVEL_S" | sed "s/[(0-9)*]/0/g"` +if [ "X${APP_RUN_LEVEL_S_CHECK}" != "X00" ] ; then + eval echo `gettext 'Run level \"${APP_RUN_LEVEL_S}\" must be numeric and have a length of two \(00-99\).'` + exit 1; +fi +RUN_LEVEL_K_DIST_OS_TMP=`eval "echo \$\{RUN_LEVEL_K_${DIST_OS}\}"` +RUN_LEVEL_K_DIST_OS=`eval "echo ${RUN_LEVEL_K_DIST_OS_TMP}"` +if [ "X${RUN_LEVEL_K_DIST_OS}" != "X" ] ; then + APP_RUN_LEVEL_K=${RUN_LEVEL_K_DIST_OS} +elif [ "X$RUN_LEVEL_K" != "X" ] ; then + APP_RUN_LEVEL_K=$RUN_LEVEL_K +else + APP_RUN_LEVEL_K=$RUN_LEVEL +fi +APP_RUN_LEVEL_K_CHECK=`echo "$APP_RUN_LEVEL_K" | sed "s/[(0-9)*]/0/g"` +if [ "X${APP_RUN_LEVEL_K_CHECK}" != "X00" ] ; then + eval echo `gettext 'Run level \"${APP_RUN_LEVEL_K}\" must be numeric and have a length of two \(00-99\).'` + exit 1; +fi + +prepAdditionalParams() { + ADDITIONAL_PARA="" + if [ ! -n "$PASS_THROUGH" ] + then + PASS_THROUGH=false + fi + if [ $PASS_THROUGH = true ] ; then + ADDITIONAL_PARA="--" + while [ -n "$1" ] ; do + ADDITIONAL_PARA="$ADDITIONAL_PARA \"$1\"" + shift + done + elif [ -n "$1" ] ; then + eval echo `gettext "WARNING: Extra arguments will be ignored. Please run \'$0 help\' for usage."` + fi +} + +checkUser() { + # $1 touchLock flag + # $2.. [command] args + + # Check the configured user. If necessary rerun this script as the desired user. + if [ "X$RUN_AS_USER" != "X" ] + then + # Resolve the location of the 'id' command + ID_BIN="/usr/xpg4/bin/id" + if [ ! -x "$ID_BIN" ] + then + ID_BIN="/usr/bin/id" + if [ ! -x "$ID_BIN" ] + then + eval echo `gettext 'Unable to locate "id".'` + eval echo `gettext 'Please report this message along with the location of the command on your system.'` + exit 1 + fi + fi + + if [ "`$ID_BIN -u -n`" = "$RUN_AS_USER" ] + then + # Already running as the configured user. Avoid password prompts by not calling su. + RUN_AS_USER="" + fi + fi + if [ "X$RUN_AS_USER" != "X" ] + then + if [ "`$ID_BIN -u -n "$RUN_AS_USER" 2>/dev/null`" != "$RUN_AS_USER" ] + then + eval echo `gettext 'User $RUN_AS_USER does not exist.'` + exit 1 + fi + + # If LOCKPROP and $RUN_AS_USER are defined then the new user will most likely not be + # able to create the lock file. The Wrapper will be able to update this file once it + # is created but will not be able to delete it on shutdown. If $1 is set then + # the lock file should be created for the current command + if [ "X$LOCKPROP" != "X" ] + then + if [ "X$1" != "X" ] + then + # Resolve the primary group + RUN_AS_GROUP=`groups $RUN_AS_USER | awk '{print $3}' | tail -1` + if [ "X$RUN_AS_GROUP" = "X" ] + then + RUN_AS_GROUP=$RUN_AS_USER + fi + touch $LOCKFILE + chown $RUN_AS_USER:$RUN_AS_GROUP $LOCKFILE + fi + fi + + # Still want to change users, recurse. This means that the user will only be + # prompted for a password once. Variables shifted by 1 + shift + + # Wrap the parameters so they can be passed. + ADDITIONAL_PARA="" + while [ -n "$1" ] ; do + if [ "$1" = 'installstart' ] ; then + # At this point the service is already installed. When we will fork the process we only need to start the service. + ADDITIONAL_PARA="$ADDITIONAL_PARA \"start\"" + else + ADDITIONAL_PARA="$ADDITIONAL_PARA \"$1\"" + fi + shift + done + + # Use "runuser" if this exists. + # runuser should be used on RedHat in preference to su. + if test -f "/sbin/runuser" + then + /sbin/runuser - $RUN_AS_USER -c "\"$REALPATH\" $ADDITIONAL_PARA" + else + $SU_BIN - $RUN_AS_USER -c "\"$REALPATH\" $ADDITIONAL_PARA" $SU_OPTS + fi + RUN_AS_USER_EXITCODE=$? + + # we check if the previous command has failed + if [ $RUN_AS_USER_EXITCODE -ne 0 ] + then + if [ $RUN_AS_USER_EXITCODE -eq 1 ] + then + checkForkCommand + else + eval echo `gettext 'Error executing the requested command with user \"$RUN_AS_USER\" \(error code $RUN_AS_USER_EXITCODE\).'` + echo "" + fi + fi + + # Now that we are the original user again, we may need to clean up the lock file. + if [ "X$LOCKPROP" != "X" ] + then + getpid + if [ "X$pid" = "X" ] + then + # Wrapper is not running so make sure the lock file is deleted. + if [ -f "$LOCKFILE" ] + then + rm "$LOCKFILE" + fi + fi + fi + + exit $RUN_AS_USER_EXITCODE + fi +} + +# Try to fork by executing a simple command. +# With this function, we want to make sure we are able to fork. +checkForkCommand() { + + if test -f "/sbin/runuser" + then + /sbin/runuser - $RUN_AS_USER -c "ls \"$REALPATH\"" > /dev/null 2>&1 & + else + $SU_BIN - $RUN_AS_USER -c "ls \"$REALPATH\"" $SU_OPTS > /dev/null 2>&1 & + fi + CHECK_EXITCODE=$? + + if [ $CHECK_EXITCODE -ne 0 ] + then + # clearly a problem with forking + eval echo `gettext 'Error: unable to create fork process.'` + eval echo `gettext 'Advice:'` + eval echo `gettext 'One possible cause of failure is when the user \(\"$RUN_AS_USER\"\) has no shell.'` + eval echo `gettext 'In this case, two solutions are available by editing the script file:'` + eval echo `gettext '1. Use \"SU_OPTS\" to set the shell for the user.'` + eval echo `gettext '2. Use a OS service management tool (only available on some platforms).'` + echo "" + fi +} + +getpid() { + pid="" + if [ -f "$PIDFILE" ] + then + if [ -r "$PIDFILE" ] + then + pid=`cat "$PIDFILE"` + if [ "X$pid" != "X" ] + then + if [ "X$PIDFILE_CHECK_PID" != "X" ] + then + # It is possible that 'a' process with the pid exists but that it is not the + # correct process. This can happen in a number of cases, but the most + # common is during system startup after an unclean shutdown. + # The ps statement below looks for the specific wrapper command running as + # the pid. If it is not found then the pid file is considered to be stale. + case "$DIST_OS" in + 'freebsd') + pidtest=`$PS_BIN -p $pid -o args | tail -1` + if [ "X$pidtest" = "XCOMMAND" ] + then + pidtest="" + fi + ;; + 'macosx') + pidtest=`$PS_BIN -ww -p $pid -o command | grep -F "$WRAPPER_CMD" | tail -1` + ;; + 'solaris') + if [ -f "/usr/bin/pargs" ] + then + pidtest=`pargs $pid | fgrep "$WRAPPER_CMD" | tail -1` + else + case "$PS_BIN" in + '/usr/ucb/ps') + pidtest=`$PS_BIN -auxww $pid | fgrep "$WRAPPER_CMD" | tail -1` + ;; + '/usr/bin/ps') + TRUNCATED_CMD=`$PS_BIN -o comm -p $pid | tail -1` + COUNT=`echo $TRUNCATED_CMD | wc -m` + COUNT=`echo ${COUNT}` + COUNT=`expr $COUNT - 1` + TRUNCATED_CMD=`echo $WRAPPER_CMD | cut -c1-$COUNT` + pidtest=`$PS_BIN -o comm -p $pid | fgrep "$TRUNCATED_CMD" | tail -1` + ;; + '/bin/ps') + TRUNCATED_CMD=`$PS_BIN -o comm -p $pid | tail -1` + COUNT=`echo $TRUNCATED_CMD | wc -m` + COUNT=`echo ${COUNT}` + COUNT=`expr $COUNT - 1` + TRUNCATED_CMD=`echo $WRAPPER_CMD | cut -c1-$COUNT` + pidtest=`$PS_BIN -o comm -p $pid | fgrep "$TRUNCATED_CMD" | tail -1` + ;; + *) + echo "Unsupported ps command $PS_BIN" + exit 1 + ;; + esac + fi + ;; + 'hpux') + pidtest=`$PS_BIN -p $pid -x -o args | grep -F "$WRAPPER_CMD" | tail -1` + ;; + 'zos') + TRUNCATED_CMD=`$PS_BIN -p $pid -o args | tail -1` + COUNT=`echo $TRUNCATED_CMD | wc -m` + COUNT=`echo ${COUNT}` + COUNT=`expr $COUNT - 1` + TRUNCATED_CMD=`echo $WRAPPER_CMD | cut -c1-$COUNT` + pidtest=`$PS_BIN -p $pid -o args | grep -F "$TRUNCATED_CMD" | tail -1` + ;; + *) + pidtest=`$PS_BIN -p $pid -o args | grep -F "$WRAPPER_CMD" | tail -1` + ;; + esac + else + # Check to see whether the pid exists as a running process, but in this mode, don't check what that pid is. + case "$DIST_OS" in + 'solaris') + case "$PS_BIN" in + '/usr/ucb/ps') + pidtest=`$PS_BIN $pid | grep "$pid" | awk '{print $1}' | tail -1` + ;; + '/usr/bin/ps') + pidtest=`$PS_BIN -p $pid -o pid | grep "$pid" | tail -1` + ;; + '/bin/ps') + pidtest=`$PS_BIN -p $pid -o pid | grep "$pid" | tail -1` + ;; + *) + echo "Unsupported ps command $PS_BIN" + exit 1 + ;; + esac + ;; + *) + pidtest=`$PS_BIN -p $pid -o pid | grep "$pid" | tail -1` + ;; + esac + fi + + if [ "X$pidtest" = "X" ] + then + # This is a stale pid file. + rm -f "$PIDFILE" + eval echo `gettext 'Removed stale pid file: $PIDFILE'` + pid="" + fi + fi + else + eval echo `gettext 'Cannot read $PIDFILE.'` + exit 1 + fi + fi +} + +getstatus() { + STATUS= + if [ -f "$STATUSFILE" ] + then + if [ -r "$STATUSFILE" ] + then + STATUS=`cat "$STATUSFILE"` + fi + fi + if [ "X$STATUS" = "X" ] + then + STATUS="Unknown" + fi + + JAVASTATUS= + if [ -f "$JAVASTATUSFILE" ] + then + if [ -r "$JAVASTATUSFILE" ] + then + JAVASTATUS=`cat "$JAVASTATUSFILE"` + fi + fi + if [ "X$JAVASTATUS" = "X" ] + then + JAVASTATUS="Unknown" + fi +} + +testpid() { + case "$DIST_OS" in + 'solaris') + case "$PS_BIN" in + '/usr/ucb/ps') + pid=`$PS_BIN $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` + ;; + '/usr/bin/ps') + pid=`$PS_BIN -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` + ;; + '/bin/ps') + pid=`$PS_BIN -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` + ;; + *) + echo "Unsupported ps command $PS_BIN" + exit 1 + ;; + esac + ;; + *) + pid=`$PS_BIN -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` 2>/dev/null + ;; + esac + if [ "X$pid" = "X" ] + then + # Process is gone so remove the pid file. + rm -f "$PIDFILE" + pid="" + fi +} + +launchdtrap() { + stopit + exit +} + +waitforwrapperstop() { + getpid + while [ "X$pid" != "X" ] ; do + sleep 1 + getpid + done +} + +launchinternal() { + getpid + trap launchdtrap TERM + if [ "X$pid" = "X" ] + then + prepAdditionalParams "$@" + + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.daemonize=TRUE $APPNAMEPROP $ANCHORPROP $IGNOREPROP $STATUSPROP $COMMANDPROP $LOCKPROP wrapper.script.version=3.5.28 $ADDITIONAL_PARA" + eval $COMMAND_LINE + else + eval echo `gettext '$APP_LONG_NAME is already running.'` + exit 1 + fi + # launchd expects that this script stay up and running so we need to do our own monitoring of the Wrapper process. + if [ $WAIT_FOR_STARTED_STATUS = true ] + then + waitforwrapperstop + fi +} + +console() { + eval echo `gettext 'Running $APP_LONG_NAME...'` + getpid + if [ "X$pid" = "X" ] + then + trap '' 3 + + prepAdditionalParams "$@" + + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" $APPNAMEPROP $ANCHORPROP $STATUSPROP $COMMANDPROP $LOCKPROP wrapper.script.version=3.5.28 $ADDITIONAL_PARA" + eval $COMMAND_LINE + else + eval echo `gettext '$APP_LONG_NAME is already running.'` + exit 1 + fi +} + +waitforjavastartup() { + getstatus + eval echo $ECHOOPT `gettext 'Waiting for $APP_LONG_NAME...$ECHOOPTC'` + + # Wait until the timeout or we have something besides Unknown. + counter=15 + while [ "$JAVASTATUS" = "Unknown" -a $counter -gt 0 -a -n "$JAVASTATUS" ] ; do + echo $ECHOOPT".$ECHOOPTC" + sleep 1 + getstatus + counter=`expr $counter - 1` + done + + if [ -n "$WAIT_FOR_STARTED_TIMEOUT" ] ; then + counter=$WAIT_FOR_STARTED_TIMEOUT + else + counter=120 + fi + while [ "$JAVASTATUS" != "STARTED" -a "$JAVASTATUS" != "Unknown" -a $counter -gt 0 -a -n "$JAVASTATUS" ] ; do + echo $ECHOOPT".$ECHOOPTC" + sleep 1 + getstatus + counter=`expr $counter - 1` + done + echo "" +} + +startwait() { + if [ $WAIT_FOR_STARTED_STATUS = true ] + then + waitforjavastartup + fi + # Sleep for a few seconds to allow for intialization if required + # then test to make sure we're still running. + # + i=0 + while [ $i -lt $WAIT_AFTER_STARTUP ] + do + sleep 1 + echo $ECHOOPT".$ECHOOPTC" + i=`expr $i + 1` + done + if [ $WAIT_AFTER_STARTUP -gt 0 -o $WAIT_FOR_STARTED_STATUS = true ] + then + getpid + if [ "X$pid" = "X" ] + then + eval echo `gettext ' WARNING: $APP_LONG_NAME may have failed to start.'` + exit 1 + else + eval echo `gettext ' running: PID:$pid'` + fi + else + echo "" + fi +} + +mustBeRootOrExit() { + if [ `id | sed 's/^uid=//;s/(.*$//'` != "0" ] ; then + eval echo `gettext 'Must be root to perform this action.'` + exit 1 + fi +} + + +macosxStart() { + # The daemon has been installed. + eval echo `gettext 'Starting $APP_LONG_NAME. Detected Mac OSX and installed launchd daemon.'` + mustBeRootOrExit + + getpid + if [ "X$pid" != "X" ] ; then + eval echo `gettext '$APP_LONG_NAME is already running.'` + exit 1 + fi + + # If the daemon was just installed, it may not be loaded. + LOADED_PLIST=`launchctl list | grep ${APP_PLIST_BASE}` + if [ "X${LOADED_PLIST}" = "X" ] ; then + launchctl load /Library/LaunchDaemons/${APP_PLIST} + fi + # If launchd is set to run the daemon already at Load, we don't need to call start + getpid + if [ "X$pid" = "X" ] ; then + launchctl start ${APP_PLIST_BASE} + fi + + startwait +} + +macosxStop() { + # The daemon should be running. + eval echo `gettext 'Stopping $APP_LONG_NAME...'` + mustBeRootOrExit + + getpid + if [ "X$pid" = "X" ] ; then + eval echo `gettext '$APP_LONG_NAME is not running.'` + exit 1 + else + if [ "$MACOSX_KEEP_RUNNING" = "true" ] ; then + echo "" + eval echo `gettext 'Daemon is set to be kept continuously running and it will be automatically restarted.'` + eval echo `gettext 'To stop the daemon you need to uninstall it.'` + eval echo `gettext 'If you want to use the \"stop\" argument, you need to find MACOSX_KEEP_RUNNING'` + eval echo `gettext 'at the beginning of the script file and set it to \"false\".'` + echo "" + fi + launchctl stop ${APP_PLIST_BASE} + fi +} + +macosxRestart() { + # The daemon should be running. + eval echo `gettext 'Restarting $APP_LONG_NAME...'` + mustBeRootOrExit + + getpid + if [ "X$pid" = "X" ] ; then + eval echo `gettext '$APP_LONG_NAME is not running.'` + exit 1 + else + if [ "$MACOSX_KEEP_RUNNING" = "true" ] ; then + # by stopping it, launchd will automatically restart it + launchctl stop ${APP_PLIST_BASE} + else + launchctl unload "/Library/LaunchDaemons/${APP_PLIST}" + sleep 1 + launchctl load "/Library/LaunchDaemons/${APP_PLIST}" + fi + fi + + startwait +} + +upstartstart() { + # The daemon has been installed. + eval echo `gettext 'Starting $APP_LONG_NAME. Detected Linux and installed upstart.'` + mustBeRootOrExit + + getpid + if [ "X$pid" != "X" ] ; then + eval echo `gettext '$APP_LONG_NAME is already running.'` + exit 1 + fi + + /sbin/start ${APP_NAME} + + startwait +} + +upstartStop() { + # The daemon has been installed. + eval echo `gettext 'Stopping $APP_LONG_NAME...'` + mustBeRootOrExit + + getpid + if [ "X$pid" = "X" ] ; then + eval echo `gettext '$APP_LONG_NAME is not running.'` + exit 1 + fi + + /sbin/stop ${APP_NAME} +} + +upstartRestart() { + # The daemon has been installed. + eval echo `gettext 'Restarting $APP_LONG_NAME...'` + mustBeRootOrExit + + getpid + if [ "X$pid" = "X" ] ; then + eval echo `gettext '$APP_LONG_NAME is not running.'` + exit 1 + fi + + /sbin/restart ${APP_NAME} + + startwait +} + +systemdInstall() { + eval echo `gettext ' Installing the $APP_LONG_NAME daemon using systemd...'` + if [ -f "${REALDIR}/${APP_NAME}.service" ] ; then + eval echo `gettext ' a custom service file ${APP_NAME}.service found'` + cp "${REALDIR}/${APP_NAME}.service" "${SYSTEMD_SERVICE_FILE}" + else + eval echo `gettext ' creating default service file...'` + echo "[Unit]" > "${SYSTEMD_SERVICE_FILE}" + echo "Description=${APP_LONG_NAME}" >> "${SYSTEMD_SERVICE_FILE}" + echo "After=syslog.target" >> "${SYSTEMD_SERVICE_FILE}" + echo "" >> "${SYSTEMD_SERVICE_FILE}" + echo "[Service]" >> "${SYSTEMD_SERVICE_FILE}" + echo "Type=forking" >> "${SYSTEMD_SERVICE_FILE}" + echo "ExecStart=${REALPATH} start sysd" >> "${SYSTEMD_SERVICE_FILE}" + echo "ExecStop=${REALPATH} stop sysd" >> "${SYSTEMD_SERVICE_FILE}" + if [ "X${RUN_AS_USER}" != "X" ] ; then + echo "User=${RUN_AS_USER}" >> "${SYSTEMD_SERVICE_FILE}" + fi + echo "" >> "${SYSTEMD_SERVICE_FILE}" + echo "[Install]" >> "${SYSTEMD_SERVICE_FILE}" + echo "WantedBy=multi-user.target" >> "${SYSTEMD_SERVICE_FILE}" + + systemctl daemon-reload + systemctl enable "${APP_NAME}" + fi +} + +systemdStart() { + # check if the service file is present + if [ -f "${SYSTEMD_SERVICE_FILE}" ] ; then + eval echo `gettext 'Reading file ${SYSTEMD_SERVICE_FILE}'` + else + eval echo `gettext 'No service file detected. Did you install the service?'` + exit 1 + fi + + systemctl start $APP_NAME + if [ $? -ne 0 ] ; then + eval echo `gettext 'Failed to start service $APP_NAME'` + exit 1 + fi + + startwait +} + +systemdStop() { + systemctl stop $APP_NAME + if [ $? -ne 0 ] ; then + eval echo `gettext 'Failed to stop service $APP_NAME'` + exit 1 + fi +} + +systemdRestart() { + systemctl restart $APP_NAME + if [ $? -ne 0 ] ; then + eval echo `gettext 'Failed to restart service $APP_NAME'` + exit 1 + fi + + startwait +} + +systemdRemove() { + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon from systemd...'` + systemctl disable $APP_NAME + rm "/etc/systemd/system/${APP_NAME}.service" + systemctl daemon-reload +} + +srcInstall() { + if [ "X$RUN_AS_USER" = "X" ] ; then + USERID="0" + else + USERID=`$ID_BIN -u "$RUN_AS_USER"` + if [ $? -ne 0 ] ; then + eval echo `gettext 'Failed to get user id for $RUN_AS_USER'` + exit 1 + fi + fi + /usr/bin/mkssys -s "$APP_NAME" -p "$REALPATH" -a "launchdinternal" -u "$USERID" -f 9 -n 15 -S + /usr/sbin/mkitab "$APP_NAME":2:once:"/usr/bin/startsrc -s \"${APP_NAME}\" >/dev/console 2>&1" +} + +srcStart() { + startsrc -s "${APP_NAME}" + if [ $? -ne 0 ] ; then + eval echo `gettext 'Failed to start service $APP_NAME'` + exit 1 + fi + + startwait +} + +srcStop() { + stopsrc -s "${APP_NAME}" + if [ $? -ne 0 ] ; then + eval echo `gettext 'Failed to stop service $APP_NAME'` + exit 1 + fi +} + +srcRestart() { + srcStop + srcStart +} + +start() { + eval echo `gettext 'Starting $APP_LONG_NAME...'` + getpid + if [ "X$pid" = "X" ] + then + prepAdditionalParams "$@" + + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.daemonize=TRUE $APPNAMEPROP $ANCHORPROP $IGNOREPROP $STATUSPROP $COMMANDPROP $LOCKPROP wrapper.script.version=3.5.28 $ADDITIONAL_PARA" + eval $COMMAND_LINE + else + eval echo `gettext '$APP_LONG_NAME is already running.'` + exit 1 + fi + + startwait +} + +stopit() { + # $1 exit if down flag + + eval echo `gettext 'Stopping $APP_LONG_NAME...'` + getpid + if [ "X$pid" = "X" ] + then + eval echo `gettext '$APP_LONG_NAME was not running.'` + if [ "X$1" = "X1" ] + then + exit 1 + fi + else + if [ "X$IGNORE_SIGNALS" = "X" ] + then + # Running so try to stop it. + kill $pid + if [ $? -ne 0 ] + then + # An explanation for the failure should have been given + eval echo `gettext 'Unable to stop $APP_LONG_NAME.'` + exit 1 + fi + else + rm -f "$ANCHORFILE" + if [ -f "$ANCHORFILE" ] + then + # An explanation for the failure should have been given + eval echo `gettext 'Unable to stop $APP_LONG_NAME.'` + exit 1 + fi + fi + + # We can not predict how long it will take for the wrapper to + # actually stop as it depends on settings in wrapper.conf. + # Loop until it does. + savepid=$pid + CNT=0 + TOTCNT=0 + while [ "X$pid" != "X" ] + do + # Show a waiting message every 5 seconds. + if [ "$CNT" -lt "5" ] + then + CNT=`expr $CNT + 1` + else + eval echo `gettext 'Waiting for $APP_LONG_NAME to exit...'` + CNT=0 + fi + TOTCNT=`expr $TOTCNT + 1` + + sleep 1 + + testpid + done + + pid=$savepid + testpid + if [ "X$pid" != "X" ] + then + eval echo `gettext 'Failed to stop $APP_LONG_NAME.'` + exit 1 + else + eval echo `gettext 'Stopped $APP_LONG_NAME.'` + fi + fi +} + +pause() { + eval echo `gettext 'Pausing $APP_LONG_NAME.'` +} + +resume() { + eval echo `gettext 'Resuming $APP_LONG_NAME.'` +} + +status() { + getpid + if [ "X$pid" = "X" ] + then + eval echo `gettext '$APP_LONG_NAME is not running.'` + exit 1 + else + if [ "X$DETAIL_STATUS" = "X" ] + then + eval echo `gettext '$APP_LONG_NAME is running: PID:$pid'` + else + getstatus + eval echo `gettext '$APP_LONG_NAME is running: PID:$pid, Wrapper:$STATUS, Java:$JAVASTATUS'` + fi + exit 0 + fi +} + +# Make sure APP_NAME is less than 14 characters, otherwise in AIX, the command +# "lsitab" will fail +validateAppNameLength() { + if [ ${#APP_NAME} -gt 14 ] ; then + eval echo `gettext ' APP_NAME (${APP_NAME}) must be less than 14 characters long'` + exit 1 + fi +} + +installUpstart() { + eval echo `gettext ' Installing the $APP_LONG_NAME daemon using upstart..'` + if [ -f "${REALDIR}/${APP_NAME}.install" ] ; then + eval echo `gettext ' a custom upstart conf file ${APP_NAME}.install found'` + cp "${REALDIR}/${APP_NAME}.install" "/etc/init/${APP_NAME}.conf" + else + eval echo `gettext ' creating default upstart conf file..'` + echo "# ${APP_NAME} - ${APP_LONG_NAME}" > "/etc/init/${APP_NAME}.conf" + echo "description \"${APP_LONG_NAME}\"" >> "/etc/init/${APP_NAME}.conf" + echo "author \"Tanuki Software Ltd. \"" >> "/etc/init/${APP_NAME}.conf" + echo "start on runlevel [2345]" >> "/etc/init/${APP_NAME}.conf" + echo "stop on runlevel [!2345]" >> "/etc/init/${APP_NAME}.conf" + echo "env LANG=${LANG}" >> "/etc/init/${APP_NAME}.conf" + echo "exec \"${REALPATH}\" upstartinternal" >> "/etc/init/${APP_NAME}.conf" + fi +} + +installdaemon() { + mustBeRootOrExit + + APP_NAME_LOWER=`echo "$APP_NAME" | $TR_BIN "[A-Z]" "[a-z]"` + if [ "$DIST_OS" = "solaris" ] ; then + eval echo `gettext 'Detected Solaris:'` + if [ -f "/etc/init.d/$APP_NAME" -o -L "/etc/init.d/$APP_NAME" ] ; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed.'` + if [ "$COMMAND" != 'installstart' ] ; then + exit 1 + fi + else + eval echo `gettext ' Installing the $APP_LONG_NAME daemon..'` + ln -s "$REALPATH" "/etc/init.d/$APP_NAME" + for i in `ls "/etc/rc3.d/K"??"$APP_NAME_LOWER" "/etc/rc3.d/S"??"$APP_NAME_LOWER" 2>/dev/null` ; do + eval echo `gettext ' Removing unexpected file before proceeding: $i'` + rm -f $i + done + ln -s "/etc/init.d/$APP_NAME" "/etc/rc3.d/K${APP_RUN_LEVEL_K}$APP_NAME_LOWER" + ln -s "/etc/init.d/$APP_NAME" "/etc/rc3.d/S${APP_RUN_LEVEL_S}$APP_NAME_LOWER" + fi + elif [ "$DIST_OS" = "linux" ] ; then + if [ -f /etc/redhat-release -o -f /etc/redhat_version -o -f /etc/fedora-release ] ; then + eval echo `gettext 'Detected RHEL or Fedora:'` + if [ -f "/etc/init.d/$APP_NAME" -o -L "/etc/init.d/$APP_NAME" -o -f "/etc/init/${APP_NAME}.conf" ] ; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed.'` + if [ "$COMMAND" != 'installstart' ] ; then + exit 1 + fi + elif [ -n "$USE_SYSTEMD" -a -d "/etc/systemd" ] ; then + systemdInstall + else + if [ -n "$USE_UPSTART" -a -d "/etc/init" ] ; then + installUpstart + else + eval echo `gettext ' Installing the $APP_LONG_NAME daemon..'` + ln -s "$REALPATH" "/etc/init.d/$APP_NAME" + /sbin/chkconfig --add "$APP_NAME" + /sbin/chkconfig "$APP_NAME" on + fi + fi + elif [ -f /etc/SuSE-release ] ; then + eval echo `gettext 'Detected SuSE or SLES:'` + if [ -f "/etc/init.d/$APP_NAME" -o -L "/etc/init.d/$APP_NAME" ] ; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed.'` + if [ "$COMMAND" != 'installstart' ] ; then + exit 1 + fi + elif [ -n "$USE_SYSTEMD" -a -d "/etc/systemd" ] ; then + systemdInstall + else + eval echo `gettext ' Installing the $APP_LONG_NAME daemon..'` + ln -s "$REALPATH" "/etc/init.d/$APP_NAME" + insserv "/etc/init.d/$APP_NAME" + fi + elif [ -f /etc/lsb-release -o -f /etc/debian_version -o -f /etc/debian_release ] ; then + eval echo `gettext 'Detected Ubuntu or Debian:'` + if [ -f "/etc/init.d/$APP_NAME" -o -L "/etc/init.d/$APP_NAME" -o -f "/etc/init/${APP_NAME}.conf" ] ; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed.'` + if [ "$COMMAND" != 'installstart' ] ; then + exit 1 + fi + else + if [ -n "$USE_SYSTEMD" -a -d "/etc/systemd" ] ; then + systemdInstall + elif [ -n "$USE_UPSTART" -a -d "/etc/init" ] ; then + installUpstart + else + eval echo `gettext ' Installing the $APP_LONG_NAME daemon using init.d..'` + ln -s "$REALPATH" "/etc/init.d/$APP_NAME" + update-rc.d "$APP_NAME" defaults + fi + fi + else + eval echo `gettext 'Detected Linux:'` + if [ -f "/etc/init.d/$APP_NAME" -o -L "/etc/init.d/$APP_NAME" ] ; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed.'` + if [ "$COMMAND" != 'installstart' ] ; then + exit 1 + fi + else + eval echo `gettext ' Installing the $APP_LONG_NAME daemon..'` + ln -s "$REALPATH" /etc/init.d/$APP_NAME + for i in `ls "/etc/rc3.d/K"??"$APP_NAME_LOWER" "/etc/rc5.d/K"??"$APP_NAME_LOWER" "/etc/rc3.d/S"??"$APP_NAME_LOWER" "/etc/rc5.d/S"??"$APP_NAME_LOWER" 2>/dev/null` ; do + eval echo `gettext ' Removing unexpected file before proceeding: $i'` + rm -f $i + done + ln -s "/etc/init.d/$APP_NAME" "/etc/rc3.d/K${APP_RUN_LEVEL_K}$APP_NAME_LOWER" + ln -s "/etc/init.d/$APP_NAME" "/etc/rc3.d/S${APP_RUN_LEVEL_S}$APP_NAME_LOWER" + ln -s "/etc/init.d/$APP_NAME" "/etc/rc5.d/S${APP_RUN_LEVEL_S}$APP_NAME_LOWER" + ln -s "/etc/init.d/$APP_NAME" "/etc/rc5.d/K${APP_RUN_LEVEL_K}$APP_NAME_LOWER" + fi + fi + elif [ "$DIST_OS" = "hpux" ] ; then + eval echo `gettext 'Detected HP-UX:'` + if [ -f "/sbin/init.d/$APP_NAME" -o -L "/sbin/init.d/$APP_NAME" ] ; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed.'` + if [ "$COMMAND" != 'installstart' ] ; then + exit 1 + fi + else + eval echo `gettext ' Installing the $APP_LONG_NAME daemon..'` + ln -s "$REALPATH" "/sbin/init.d/$APP_NAME" + for i in `ls "/sbin/rc3.d/K"??"$APP_NAME_LOWER" "/sbin/rc3.d/S"??"$APP_NAME_LOWER" 2>/dev/null` ; do + eval echo `gettext ' Removing unexpected file before proceeding: $i'` + rm -f $i + done + ln -s "/sbin/init.d/$APP_NAME" "/sbin/rc3.d/K${APP_RUN_LEVEL_K}$APP_NAME_LOWER" + ln -s "/sbin/init.d/$APP_NAME" "/sbin/rc3.d/S${APP_RUN_LEVEL_S}$APP_NAME_LOWER" + fi + elif [ "$DIST_OS" = "aix" ] ; then + eval echo `gettext 'Detected AIX:'` + validateAppNameLength + if [ -f "/etc/rc.d/init.d/$APP_NAME" ] ; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed as rc.d script.'` + if [ "$COMMAND" != 'installstart' ] ; then + exit 1 + fi + elif [ -n "`/usr/sbin/lsitab $APP_NAME`" -a -n "`/usr/bin/lssrc -S -s $APP_NAME`" ] ; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed as SRC service.'` + if [ "$COMMAND" != 'installstart' ] ; then + exit 1 + fi + else + eval echo `gettext ' Installing the $APP_LONG_NAME daemon..'` + if [ -n "`/usr/sbin/lsitab install_assist`" ] ; then + eval echo `gettext ' The task /usr/sbin/install_assist was found in the inittab, this might cause problems for all subsequent tasks to launch at this process is known to block the init task. Please make sure this task is not needed anymore and remove/deactivate it.'` + fi + for i in `ls "/etc/rc.d/rc2.d/K"??"$APP_NAME_LOWER" "/etc/rc.d/rc2.d/S"??"$APP_NAME_LOWER" 2>/dev/null` ; do + eval echo `gettext ' Removing unexpected file before proceeding: $i'` + rm -f $i + done + srcInstall + fi + elif [ "$DIST_OS" = "freebsd" ] ; then + eval echo `gettext 'Detected FreeBSD:'` + if [ -f "/etc/rc.d/$APP_NAME" -o -L "/etc/rc.d/$APP_NAME" ] ; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed.'` + if [ "$COMMAND" != 'installstart' ] ; then + exit 1 + fi + else + eval echo `gettext ' Installing the $APP_LONG_NAME daemon..'` + sed -i .bak "/${APP_NAME}_enable=\"YES\"/d" /etc/rc.conf + if [ -f "${REALDIR}/${APP_NAME}.install" ] ; then + ln -s "${REALDIR}/${APP_NAME}.install" "/etc/rc.d/$APP_NAME" + else + echo '#!/bin/sh' > "/etc/rc.d/$APP_NAME" + echo "#" >> "/etc/rc.d/$APP_NAME" + echo "# PROVIDE: $APP_NAME" >> "/etc/rc.d/$APP_NAME" + echo "# REQUIRE: NETWORKING" >> "/etc/rc.d/$APP_NAME" + echo "# KEYWORD: shutdown" >> "/etc/rc.d/$APP_NAME" + echo ". /etc/rc.subr" >> "/etc/rc.d/$APP_NAME" + echo "name=\"$APP_NAME\"" >> "/etc/rc.d/$APP_NAME" + echo "rcvar=\`set_rcvar\`" >> "/etc/rc.d/$APP_NAME" + echo "command=\"${REALPATH}\"" >> "/etc/rc.d/$APP_NAME" + echo 'start_cmd="${name}_start"' >> "/etc/rc.d/$APP_NAME" + echo 'load_rc_config $name' >> "/etc/rc.d/$APP_NAME" + echo 'status_cmd="${name}_status"' >> "/etc/rc.d/$APP_NAME" + echo 'stop_cmd="${name}_stop"' >> "/etc/rc.d/$APP_NAME" + echo "${APP_NAME}_status() {" >> "/etc/rc.d/$APP_NAME" + echo '${command} status' >> "/etc/rc.d/$APP_NAME" + echo '}' >> "/etc/rc.d/$APP_NAME" + echo "${APP_NAME}_stop() {" >> "/etc/rc.d/$APP_NAME" + echo '${command} stop' >> "/etc/rc.d/$APP_NAME" + echo '}' >> "/etc/rc.d/$APP_NAME" + echo "${APP_NAME}_start() {" >> "/etc/rc.d/$APP_NAME" + echo '${command} start' >> "/etc/rc.d/$APP_NAME" + echo '}' >> "/etc/rc.d/$APP_NAME" + echo 'run_rc_command "$1"' >> "/etc/rc.d/$APP_NAME" + fi + echo "${APP_NAME}_enable=\"YES\"" >> /etc/rc.conf + chmod 555 "/etc/rc.d/$APP_NAME" + fi + elif [ "$DIST_OS" = "macosx" ] ; then + eval echo `gettext 'Detected Mac OSX:'` + if [ -f "/Library/LaunchDaemons/${APP_PLIST}" -o -L "/Library/LaunchDaemons/${APP_PLIST}" ] ; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed.'` + if [ "$COMMAND" != 'installstart' ] ; then + exit 1 + fi + else + eval echo `gettext ' Installing the $APP_LONG_NAME daemon..'` + if [ -f "${REALDIR}/${APP_PLIST}" ] ; then + ln -s "${REALDIR}/${APP_PLIST}" "/Library/LaunchDaemons/${APP_PLIST}" + else + echo "" > "/Library/LaunchDaemons/${APP_PLIST}" + echo "> "/Library/LaunchDaemons/${APP_PLIST}" + echo "\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">" >> "/Library/LaunchDaemons/${APP_PLIST}" + echo "" >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " " >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " Label" >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " ${APP_PLIST_BASE}" >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " ProgramArguments" >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " " >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " ${REALPATH}" >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " launchdinternal" >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " " >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " ${KEY_KEEP_ALIVE}" >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " <${MACOSX_KEEP_RUNNING}/>" >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " RunAtLoad" >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " " >> "/Library/LaunchDaemons/${APP_PLIST}" + if [ "X$RUN_AS_USER" != "X" ] ; then + echo " UserName" >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " ${RUN_AS_USER}" >> "/Library/LaunchDaemons/${APP_PLIST}" + fi + echo " " >> "/Library/LaunchDaemons/${APP_PLIST}" + echo "" >> "/Library/LaunchDaemons/${APP_PLIST}" + fi + chmod 555 "/Library/LaunchDaemons/${APP_PLIST}" + fi + elif [ "$DIST_OS" = "zos" ] ; then + eval echo `gettext 'Detected z/OS:'` + if [ -f /etc/rc.bak ] ; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed.'` + if [ "$COMMAND" != 'installstart' ] ; then + exit 1 + fi + else + eval echo `gettext ' Installing the $APP_LONG_NAME daemon..'` + cp /etc/rc /etc/rc.bak + sed "s:echo /etc/rc script executed, \`date\`::g" /etc/rc.bak > /etc/rc + echo "_BPX_JOBNAME='${APP_NAME}' \"${REALDIR}/${APP_NAME}\" start" >>/etc/rc + echo '/etc/rc script executed, `date`' >>/etc/rc + fi + else + eval echo `gettext 'Install not currently supported for $DIST_OS'` + exit 1 + fi +} + +startdaemon() { + if [ "$DIST_OS" = "macosx" ] ; then + if [ ! -f "/Library/LaunchDaemons/${APP_PLIST}" ] ; then + eval echo `gettext 'The $APP_LONG_NAME daemon is not currently installed.'` + else + macosxStart + fi + elif [ "$DIST_OS" = "linux" -a -f "/etc/init/${APP_NAME}.conf" ] ; then + upstartstart + elif [ "$DIST_OS" = "linux" -a -n "$USE_SYSTEMD" -a -z "$SYSD" ] ; then + systemdStart + elif [ "$DIST_OS" = "aix" ] && [ -n "`/usr/bin/lssrc -S -s $APP_NAME`" ] ; then + srcStart + else + if [ -n "$SYSD" ] ; then + shift + fi + + checkUser touchlock "$@" + if [ ! -n "$FIXED_COMMAND" ] ; then + shift + fi + start "$@" + fi +} + +removedaemon() { + mustBeRootOrExit + + APP_NAME_LOWER=`echo "$APP_NAME" | $TR_BIN "[A-Z]" "[a-z]"` + if [ "$DIST_OS" = "solaris" ] ; then + eval echo `gettext 'Detected Solaris:'` + if [ -f "/etc/init.d/$APP_NAME" -o -L "/etc/init.d/$APP_NAME" ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon...'` + for i in `ls "/etc/rc3.d/K"??"$APP_NAME_LOWER" "/etc/rc3.d/S"??"$APP_NAME_LOWER" "/etc/init.d/$APP_NAME" 2>/dev/null` ; do + rm -f $i + done + else + eval echo `gettext ' The $APP_LONG_NAME daemon is not currently installed.'` + exit 1 + fi + elif [ "$DIST_OS" = "linux" ] ; then + if [ -f /etc/redhat-release -o -f /etc/redhat_version -o -f /etc/fedora-release ] ; then + eval echo `gettext 'Detected RHEL or Fedora:'` + if [ -f "/etc/init.d/$APP_NAME" -o -L "/etc/init.d/$APP_NAME" ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon...'` + /sbin/chkconfig "$APP_NAME" off + /sbin/chkconfig --del "$APP_NAME" + rm -f "/etc/init.d/$APP_NAME" + elif [ -n "$USE_SYSTEMD" -a -f "${SYSTEMD_SERVICE_FILE}" ] ; then + systemdRemove + elif [ -f "/etc/init/${APP_NAME}.conf" ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon from upstart...'` + rm "/etc/init/${APP_NAME}.conf" + else + eval echo `gettext ' The $APP_LONG_NAME daemon is not currently installed.'` + exit 1 + fi + elif [ -f /etc/SuSE-release ] ; then + eval echo `gettext 'Detected SuSE or SLES:'` + if [ -f "/etc/init.d/$APP_NAME" -o -L "/etc/init.d/$APP_NAME" ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon...'` + insserv -r "/etc/init.d/$APP_NAME" + rm -f "/etc/init.d/$APP_NAME" + elif [ -n "$USE_SYSTEMD" -a -f "${SYSTEMD_SERVICE_FILE}" ] ; then + systemdRemove + else + eval echo `gettext ' The $APP_LONG_NAME daemon is not currently installed.'` + exit 1 + fi + elif [ -f /etc/lsb-release -o -f /etc/debian_version -o -f /etc/debian_release ] ; then + eval echo `gettext 'Detected Ubuntu or Debian:'` + if [ -f "/etc/init.d/$APP_NAME" -o -L "/etc/init.d/$APP_NAME" ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon from init.d...'` + update-rc.d -f "$APP_NAME" remove + rm -f "/etc/init.d/$APP_NAME" + elif [ -n "$USE_SYSTEMD" -a -f "${SYSTEMD_SERVICE_FILE}" ] ; then + systemdRemove + elif [ -f "/etc/init/${APP_NAME}.conf" ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon from upstart...'` + rm "/etc/init/${APP_NAME}.conf" + else + eval echo `gettext ' The $APP_LONG_NAME daemon is not currently installed.'` + exit 1 + fi + else + eval echo `gettext 'Detected Linux:'` + if [ -f "/etc/init.d/$APP_NAME" -o -L "/etc/init.d/$APP_NAME" ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon...'` + for i in `ls "/etc/rc3.d/K"??"$APP_NAME_LOWER" "/etc/rc5.d/K"??"$APP_NAME_LOWER" "/etc/rc3.d/S"??"$APP_NAME_LOWER" "/etc/rc5.d/S"??"$APP_NAME_LOWER" "/etc/init.d/$APP_NAME" 2>/dev/null` ; do + rm -f $i + done + else + eval echo `gettext ' The $APP_LONG_NAME daemon is not currently installed.'` + exit 1 + fi + fi + elif [ "$DIST_OS" = "hpux" ] ; then + eval echo `gettext 'Detected HP-UX:'` + if [ -f "/sbin/init.d/$APP_NAME" -o -L "/sbin/init.d/$APP_NAME" ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon...'` + for i in `ls "/sbin/rc3.d/K"??"$APP_NAME_LOWER" "/sbin/rc3.d/S"??"$APP_NAME_LOWER" "/sbin/init.d/$APP_NAME" 2>/dev/null` ; do + rm -f $i + done + else + eval echo `gettext ' The $APP_LONG_NAME daemon is not currently installed.'` + exit 1 + fi + elif [ "$DIST_OS" = "aix" ] ; then + eval echo `gettext 'Detected AIX:'` + validateAppNameLength + if [ -f "/etc/rc.d/init.d/$APP_NAME" -o -L "/etc/rc.d/init.d/$APP_NAME" -o -n "`/usr/sbin/lsitab $APP_NAME`" -o -n "`/usr/bin/lssrc -S -s $APP_NAME`" ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon...'` + if [ -f "/etc/rc.d/init.d/$APP_NAME" -o -L "/etc/rc.d/init.d/$APP_NAME" ] ; then + for i in `ls "/etc/rc.d/rc2.d/K"??"$APP_NAME_LOWER" "/etc/rc.d/rc2.d/S"??"$APP_NAME_LOWER" "/etc/rc.d/init.d/$APP_NAME" 2>/dev/null` ; do + rm -f $i + done + fi + if [ -n "`/usr/sbin/lsitab $APP_NAME`" -o -n "`/usr/bin/lssrc -S -s $APP_NAME`" ] ; then + /usr/sbin/rmitab $APP_NAME + /usr/bin/rmssys -s $APP_NAME + fi + else + eval echo `gettext ' The $APP_LONG_NAME daemon is not currently installed.'` + exit 1 + fi + elif [ "$DIST_OS" = "freebsd" ] ; then + eval echo `gettext 'Detected FreeBSD:'` + if [ -f "/etc/rc.d/$APP_NAME" -o -L "/etc/rc.d/$APP_NAME" ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon...'` + for i in "/etc/rc.d/$APP_NAME" + do + rm -f $i + done + sed -i .bak "/${APP_NAME}_enable=\"YES\"/d" /etc/rc.conf + else + eval echo `gettext ' The $APP_LONG_NAME daemon is not currently installed.'` + exit 1 + fi + elif [ "$DIST_OS" = "macosx" ] ; then + eval echo `gettext 'Detected Mac OSX:'` + if [ -f "/Library/LaunchDaemons/${APP_PLIST}" -o -L "/Library/LaunchDaemons/${APP_PLIST}" ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon...'` + # Make sure the plist is installed + LOADED_PLIST=`launchctl list | grep ${APP_PLIST_BASE}` + if [ "X${LOADED_PLIST}" != "X" ] ; then + launchctl unload "/Library/LaunchDaemons/${APP_PLIST}" + fi + rm -f "/Library/LaunchDaemons/${APP_PLIST}" + else + eval echo `gettext ' The $APP_LONG_NAME daemon is not currently installed.'` + exit 1 + fi + elif [ "$DIST_OS" = "zos" ] ; then + eval echo `gettext 'Detected z/OS:'` + if [ -f /etc/rc.bak ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon...'` + cp /etc/rc /etc/rc.bak + sed "s/_BPX_JOBNAME=\'APP_NAME\'.*//g" /etc/rc.bak > /etc/rc + rm /etc/rc.bak + else + eval echo `gettext ' The $APP_LONG_NAME daemon is not currently installed.'` + exit 1 + fi + else + eval echo `gettext 'Remove not currently supported for $DIST_OS'` + exit 1 + fi +} + +dump() { + eval echo `gettext 'Dumping $APP_LONG_NAME...'` + getpid + if [ "X$pid" = "X" ] + then + eval echo `gettext '$APP_LONG_NAME was not running.'` + else + kill -3 $pid + + if [ $? -ne 0 ] + then + eval echo `gettext 'Failed to dump $APP_LONG_NAME.'` + exit 1 + else + eval echo `gettext 'Dumped $APP_LONG_NAME.'` + fi + fi +} + +# Used by HP-UX init scripts. +startmsg() { + getpid + if [ "X$pid" = "X" ] + then + eval echo `gettext 'Starting $APP_LONG_NAME... Wrapper:Stopped'` + else + if [ "X$DETAIL_STATUS" = "X" ] + then + eval echo `gettext 'Starting $APP_LONG_NAME... Wrapper:Running'` + else + getstatus + eval echo `gettext 'Starting $APP_LONG_NAME... Wrapper:$STATUS, Java:$JAVASTATUS'` + fi + fi +} + +# Used by HP-UX init scripts. +stopmsg() { + getpid + if [ "X$pid" = "X" ] + then + eval echo `gettext 'Stopping $APP_LONG_NAME... Wrapper:Stopped'` + else + if [ "X$DETAIL_STATUS" = "X" ] + then + eval echo `gettext 'Stopping $APP_LONG_NAME... Wrapper:Running'` + else + getstatus + eval echo `gettext 'Stopping $APP_LONG_NAME... Wrapper:$STATUS, Java:$JAVASTATUS'` + fi + fi +} + +showUsage() { + # $1 bad command + + if [ -n "$1" ] + then + eval echo `gettext 'Unexpected command: $1'` + echo ""; + fi + + eval MSG=`gettext 'Usage: '` + if [ -n "$FIXED_COMMAND" ] ; then + if [ -n "$PASS_THROUGH" ] ; then + echo "${MSG} $0 {JavaAppArgs}" + else + echo "${MSG} $0" + fi + else + if [ -n "$PAUSABLE" ] ; then + if [ -n "$PASS_THROUGH" ] ; then + echo "${MSG} $0 [ console {JavaAppArgs} | start {JavaAppArgs} | stop | restart {JavaAppArgs} | condrestart {JavaAppArgs} | pause | resume | status | install | installstart | remove | dump ]" + else + echo "${MSG} $0 [ console | start | stop | restart | condrestart | pause | resume | status | install | installstart | remove | dump ]" + fi + else + if [ -n "$PASS_THROUGH" ] ; then + echo "${MSG} $0 [ console {JavaAppArgs} | start {JavaAppArgs} | stop | restart {JavaAppArgs} | condrestart {JavaAppArgs} | status | install | installstart | remove | dump ]" + else + echo "${MSG} $0 [ console | start | stop | restart | condrestart | status | install | installstart | remove | dump ]" + fi + fi + fi + + if [ ! -n "$BRIEF_USAGE" ] + then + echo ""; + if [ ! -n "$FIXED_COMMAND" ] ; then + echo "`gettext 'Commands:'`" + echo "`gettext ' console Launch in the current console.'`" + echo "`gettext ' start Start in the background as a daemon process.'`" + echo "`gettext ' stop Stop if running as a daemon or in another console.'`" + echo "`gettext ' restart Stop if running and then start.'`" + echo "`gettext ' condrestart Restart only if already running.'`" + if [ -n "$PAUSABLE" ] ; then + echo "`gettext ' pause Pause if running.'`" + echo "`gettext ' resume Resume if paused.'`" + fi + echo "`gettext ' status Query the current status.'`" + echo "`gettext ' install Install to start automatically when system boots.'`" + echo "`gettext ' installstart Install and start running as a daemon process.'`" + echo "`gettext ' remove Uninstall.'`" + echo "`gettext ' dump Request a Java thread dump if running.'`" + echo ""; + fi + if [ -n "$PASS_THROUGH" ] ; then + echo "`gettext 'JavaAppArgs: Zero or more arguments which will be passed to the Java application.'`" + echo ""; + fi + fi + + exit 1 +} + +docommand() { + case "$COMMAND" in + 'console') + checkUser touchlock "$@" + if [ ! -n "$FIXED_COMMAND" ] ; then + shift + fi + console "$@" + ;; + + 'start') + startdaemon "$@" + ;; + + 'stop') + if [ "$DIST_OS" = "macosx" -a -f "/Library/LaunchDaemons/${APP_PLIST}" ] ; then + macosxStop + elif [ "$DIST_OS" = "linux" -a -f "/etc/init/${APP_NAME}.conf" ] ; then + upstartStop + elif [ "$DIST_OS" = "linux" -a -n "$USE_SYSTEMD" -a -z "$SYSD" ] ; then + systemdStop + elif [ "$DIST_OS" = "aix" ] && [ "`/usr/bin/lssrc -S -s $APP_NAME`" ] ; then + srcStop + else + checkUser "" "$COMMAND" + stopit "0" + fi + ;; + + 'restart') + if [ "$DIST_OS" = "macosx" ] ; then + if [ ! -f "/Library/LaunchDaemons/${APP_PLIST}" ] ; then + eval echo `gettext '$APP_NAME was not installed.'` + else + macosxRestart + fi + elif [ "$DIST_OS" = "linux" -a -f "/etc/init/${APP_NAME}.conf" ] ; then + upstartRestart + elif [ "$DIST_OS" = "linux" -a -n "$USE_SYSTEMD" -a -z "$SYSD" ] ; then + systemdRestart + elif [ "$DIST_OS" = "aix" ] && [ "`/usr/bin/lssrc -S -s $APP_NAME`" ] ; then + srcRestart + else + if [ -n "$SMF" ] ; then + shift + fi + checkUser touchlock "$COMMAND" + if [ ! -n "$FIXED_COMMAND" ] ; then + shift + fi + stopit "0" + start "$@" + fi + ;; + + 'condrestart') + checkUser touchlock "$COMMAND" + if [ ! -n "$FIXED_COMMAND" ] ; then + shift + fi + stopit "1" + start "$@" + ;; + + 'pause') + if [ -n "$PAUSABLE" ] + then + pause + else + showUsage "$COMMAND" + fi + ;; + + 'resume') + if [ -n "$PAUSABLE" ] + then + resume + else + showUsage "$COMMAND" + fi + ;; + + 'status') + status + ;; + + 'install') + installdaemon "$@" + ;; + + 'installstart') + installdaemon "$@" + startdaemon "$@" + ;; + + 'remove') + removedaemon + ;; + + 'dump') + checkUser "" "$COMMAND" + dump + ;; + + 'start_msg') + # Internal command called by launchd on HP-UX. + checkUser "" "$COMMAND" + startmsg + ;; + + 'stop_msg') + # Internal command called by launchd on HP-UX. + checkUser "" "$COMMAND" + stopmsg + ;; + + 'launchdinternal' | 'upstartinternal') + if [ ! "$DIST_OS" = "macosx" -o ! -f "/Library/LaunchDaemons/${APP_PLIST}" ] ; then + checkUser touchlock "$@" + fi + # Internal command called by launchd on Max OSX. + # We do not want to call checkUser here as it is handled in the launchd plist file. Doing it here would confuse launchd. + if [ ! -n "$FIXED_COMMAND" ] ; then + shift + fi + launchinternal "$@" + ;; + + *) + showUsage "$COMMAND" + ;; + esac +} + +docommand "$@" + +exit 0 diff --git a/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/pause.bat b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/pause.bat new file mode 100644 index 0000000..65a2166 --- /dev/null +++ b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/pause.bat @@ -0,0 +1,135 @@ +@echo off +setlocal + +rem +rem Copyright (c) 1999, 2016 Tanuki Software, Ltd. +rem http://www.tanukisoftware.com +rem All rights reserved. +rem +rem This software is the proprietary information of Tanuki Software. +rem You shall use it only in accordance with the terms of the +rem license agreement you entered into with Tanuki Software. +rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html +rem +rem Java Service Wrapper general startup script. +rem + +rem ----------------------------------------------------------------------------- +rem These settings can be modified to fit the needs of your application +rem Optimized for use with version 3.5.28 of the Wrapper. + +rem The base name for the Wrapper binary. +set _WRAPPER_BASE=wrapper + +rem The directory where the Wrapper binary (.exe) file is located. It can be +rem either an absolute or a relative path. If the path contains any special +rem characters, please make sure to quote the variable. +set _WRAPPER_DIR= + +rem The name and location of the Wrapper configuration file. This will be used +rem if the user does not specify a configuration file as the first parameter to +rem this script. +set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf" + +rem Makes it possible to override the Wrapper configuration file by specifying it +rem as the first parameter. +rem set _WRAPPER_CONF_OVERRIDE=true + +rem Note that it is only possible to pass parameters through to the JVM when +rem installing the service, or when running in a console. + +rem Do not modify anything beyond this point +rem ----------------------------------------------------------------------------- + +rem +rem Resolve the real path of the wrapper.exe +rem For non NT systems, the _REALPATH and _WRAPPER_CONF values +rem can be hard-coded below and the following test removed. +rem +if "%OS%"=="Windows_NT" goto nt +echo This script only works with NT-based versions of Windows. +goto :eof + +:nt +rem Find the application home. +rem if no path path specified do the default action +IF not DEFINED _WRAPPER_DIR goto dir_undefined +set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%" +if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\" +rem check if absolute path +if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path +if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path +rem everythig else means relative path +set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%" +goto pathfound + +:dir_undefined +rem Use a relative path to the wrapper %~dp0 is location of current script under NT +set _REALPATH="%~dp0" +goto pathfound +:absolute_path +rem Use an absolute path to the wrapper +set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%" + +:pathfound +rem +rem Decide on the specific Wrapper binary to use (See delta-pack) +rem +if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe" +goto search +:amd64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe" +goto search +:ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe" +goto search +:search +set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%" +if exist %_WRAPPER_EXE% goto conf +set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe" +if exist %_WRAPPER_EXE% goto conf +echo Unable to locate a Wrapper executable using any of the following names: +echo %_WRAPPER_L_EXE% +echo %_WRAPPER_EXE% +pause +goto :eof + +rem +rem Find the wrapper.conf +rem +:conf +if [%_WRAPPER_CONF_OVERRIDE%]==[true] ( + set _WRAPPER_CONF="%~f1" + if not [%_WRAPPER_CONF%]==[""] ( + shift + goto :startup + ) +) +set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%" + +rem +rem Start the Wrapper +rem +:startup +if not [%_PASS_THROUGH%]==[true] ( + if not [%1]==[] ( + echo WARNING: Extra arguments will be ignored. Please check usage in the batch file. + ) +) + +rem Collect the application parameters +:parameters +set _PARAMETERS=%_PARAMETERS% %1 +shift +if not [%1]==[] goto :parameters + +if not [%_PASS_THROUGH%]==[true] ( + %_WRAPPER_EXE% -a %_WRAPPER_CONF% +) else ( + %_WRAPPER_EXE% -a %_WRAPPER_CONF% -- %_PARAMETERS% +) +if not errorlevel 1 goto :eof +pause diff --git a/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/query.bat b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/query.bat new file mode 100644 index 0000000..5638a44 --- /dev/null +++ b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/query.bat @@ -0,0 +1,135 @@ +@echo off +setlocal + +rem +rem Copyright (c) 1999, 2016 Tanuki Software, Ltd. +rem http://www.tanukisoftware.com +rem All rights reserved. +rem +rem This software is the proprietary information of Tanuki Software. +rem You shall use it only in accordance with the terms of the +rem license agreement you entered into with Tanuki Software. +rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html +rem +rem Java Service Wrapper general startup script. +rem + +rem ----------------------------------------------------------------------------- +rem These settings can be modified to fit the needs of your application +rem Optimized for use with version 3.5.28 of the Wrapper. + +rem The base name for the Wrapper binary. +set _WRAPPER_BASE=wrapper + +rem The directory where the Wrapper binary (.exe) file is located. It can be +rem either an absolute or a relative path. If the path contains any special +rem characters, please make sure to quote the variable. +set _WRAPPER_DIR= + +rem The name and location of the Wrapper configuration file. This will be used +rem if the user does not specify a configuration file as the first parameter to +rem this script. +set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf" + +rem Makes it possible to override the Wrapper configuration file by specifying it +rem as the first parameter. +rem set _WRAPPER_CONF_OVERRIDE=true + +rem Note that it is only possible to pass parameters through to the JVM when +rem installing the service, or when running in a console. + +rem Do not modify anything beyond this point +rem ----------------------------------------------------------------------------- + +rem +rem Resolve the real path of the wrapper.exe +rem For non NT systems, the _REALPATH and _WRAPPER_CONF values +rem can be hard-coded below and the following test removed. +rem +if "%OS%"=="Windows_NT" goto nt +echo This script only works with NT-based versions of Windows. +goto :eof + +:nt +rem Find the application home. +rem if no path path specified do the default action +IF not DEFINED _WRAPPER_DIR goto dir_undefined +set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%" +if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\" +rem check if absolute path +if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path +if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path +rem everythig else means relative path +set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%" +goto pathfound + +:dir_undefined +rem Use a relative path to the wrapper %~dp0 is location of current script under NT +set _REALPATH="%~dp0" +goto pathfound +:absolute_path +rem Use an absolute path to the wrapper +set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%" + +:pathfound +rem +rem Decide on the specific Wrapper binary to use (See delta-pack) +rem +if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe" +goto search +:amd64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe" +goto search +:ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe" +goto search +:search +set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%" +if exist %_WRAPPER_EXE% goto conf +set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe" +if exist %_WRAPPER_EXE% goto conf +echo Unable to locate a Wrapper executable using any of the following names: +echo %_WRAPPER_L_EXE% +echo %_WRAPPER_EXE% +pause +goto :eof + +rem +rem Find the wrapper.conf +rem +:conf +if [%_WRAPPER_CONF_OVERRIDE%]==[true] ( + set _WRAPPER_CONF="%~f1" + if not [%_WRAPPER_CONF%]==[""] ( + shift + goto :startup + ) +) +set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%" + +rem +rem Start the Wrapper +rem +:startup +if not [%_PASS_THROUGH%]==[true] ( + if not [%1]==[] ( + echo WARNING: Extra arguments will be ignored. Please check usage in the batch file. + ) +) + +rem Collect the application parameters +:parameters +set _PARAMETERS=%_PARAMETERS% %1 +shift +if not [%1]==[] goto :parameters + +if not [%_PASS_THROUGH%]==[true] ( + %_WRAPPER_EXE% -q %_WRAPPER_CONF% +) else ( + %_WRAPPER_EXE% -q %_WRAPPER_CONF% -- %_PARAMETERS% +) +if not errorlevel 1 goto :eof +pause diff --git a/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/resume.bat b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/resume.bat new file mode 100644 index 0000000..8b4d6ea --- /dev/null +++ b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/resume.bat @@ -0,0 +1,135 @@ +@echo off +setlocal + +rem +rem Copyright (c) 1999, 2016 Tanuki Software, Ltd. +rem http://www.tanukisoftware.com +rem All rights reserved. +rem +rem This software is the proprietary information of Tanuki Software. +rem You shall use it only in accordance with the terms of the +rem license agreement you entered into with Tanuki Software. +rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html +rem +rem Java Service Wrapper general startup script. +rem + +rem ----------------------------------------------------------------------------- +rem These settings can be modified to fit the needs of your application +rem Optimized for use with version 3.5.28 of the Wrapper. + +rem The base name for the Wrapper binary. +set _WRAPPER_BASE=wrapper + +rem The directory where the Wrapper binary (.exe) file is located. It can be +rem either an absolute or a relative path. If the path contains any special +rem characters, please make sure to quote the variable. +set _WRAPPER_DIR= + +rem The name and location of the Wrapper configuration file. This will be used +rem if the user does not specify a configuration file as the first parameter to +rem this script. +set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf" + +rem Makes it possible to override the Wrapper configuration file by specifying it +rem as the first parameter. +rem set _WRAPPER_CONF_OVERRIDE=true + +rem Note that it is only possible to pass parameters through to the JVM when +rem installing the service, or when running in a console. + +rem Do not modify anything beyond this point +rem ----------------------------------------------------------------------------- + +rem +rem Resolve the real path of the wrapper.exe +rem For non NT systems, the _REALPATH and _WRAPPER_CONF values +rem can be hard-coded below and the following test removed. +rem +if "%OS%"=="Windows_NT" goto nt +echo This script only works with NT-based versions of Windows. +goto :eof + +:nt +rem Find the application home. +rem if no path path specified do the default action +IF not DEFINED _WRAPPER_DIR goto dir_undefined +set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%" +if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\" +rem check if absolute path +if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path +if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path +rem everythig else means relative path +set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%" +goto pathfound + +:dir_undefined +rem Use a relative path to the wrapper %~dp0 is location of current script under NT +set _REALPATH="%~dp0" +goto pathfound +:absolute_path +rem Use an absolute path to the wrapper +set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%" + +:pathfound +rem +rem Decide on the specific Wrapper binary to use (See delta-pack) +rem +if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe" +goto search +:amd64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe" +goto search +:ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe" +goto search +:search +set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%" +if exist %_WRAPPER_EXE% goto conf +set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe" +if exist %_WRAPPER_EXE% goto conf +echo Unable to locate a Wrapper executable using any of the following names: +echo %_WRAPPER_L_EXE% +echo %_WRAPPER_EXE% +pause +goto :eof + +rem +rem Find the wrapper.conf +rem +:conf +if [%_WRAPPER_CONF_OVERRIDE%]==[true] ( + set _WRAPPER_CONF="%~f1" + if not [%_WRAPPER_CONF%]==[""] ( + shift + goto :startup + ) +) +set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%" + +rem +rem Start the Wrapper +rem +:startup +if not [%_PASS_THROUGH%]==[true] ( + if not [%1]==[] ( + echo WARNING: Extra arguments will be ignored. Please check usage in the batch file. + ) +) + +rem Collect the application parameters +:parameters +set _PARAMETERS=%_PARAMETERS% %1 +shift +if not [%1]==[] goto :parameters + +if not [%_PASS_THROUGH%]==[true] ( + %_WRAPPER_EXE% -e %_WRAPPER_CONF% +) else ( + %_WRAPPER_EXE% -e %_WRAPPER_CONF% -- %_PARAMETERS% +) +if not errorlevel 1 goto :eof +pause diff --git a/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/run.bat b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/run.bat new file mode 100644 index 0000000..8672708 --- /dev/null +++ b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/run.bat @@ -0,0 +1,156 @@ +@echo off +setlocal + +rem +rem Copyright (c) 1999, 2016 Tanuki Software, Ltd. +rem http://www.tanukisoftware.com +rem All rights reserved. +rem +rem This software is the proprietary information of Tanuki Software. +rem You shall use it only in accordance with the terms of the +rem license agreement you entered into with Tanuki Software. +rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html +rem +rem Java Service Wrapper general passthrough startup script. +rem + +rem ----------------------------------------------------------------------------- +rem These settings can be modified to fit the needs of your application +rem Optimized for use with version 3.5.28 of the Wrapper. +rem +rem ******************************************************************** +rem NOTE - This script has been modified to run the TestWrapper sample +rem application and should NOT be used as a base for your own +rem applications. All of the documentation assumes that you are +rem working from the default source script: +rem WRAPPER_HOME/src/bin/App.bat.in +rem ******************************************************************** +rem +rem ******************************************************************** +rem NOTE - This script has been modified to run the TestWrapper sample +rem application and should NOT be used as a base for your own +rem applications. All of the documentation assumes that you are +rem working from the default source script: +rem WRAPPER_HOME/src/bin/App.bat.in +rem ******************************************************************** + +rem The base name for the Wrapper binary. +set _WRAPPER_BASE=wrapper + +rem The directory where the Wrapper binary (.exe) file is located. It can be +rem either an absolute or a relative path. If the path contains any special +rem characters, please make sure to quote the variable. +set _WRAPPER_DIR= + +rem The name and location of the Wrapper configuration file. This will be used +rem if the user does not specify a configuration file as the first parameter to +rem this script. +set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf" + +rem Makes it possible to override the Wrapper configuration file by specifying it +rem as the first parameter. +rem set _WRAPPER_CONF_OVERRIDE=true + +rem _PASS_THROUGH tells the script to pass all parameters through to the JVM +rem as is. +rem If _WRAPPER_CONF_OVERRIDE is specified then all parameters will be passed. +rem If not set then all parameters starting with the second will be passed. +set _PASS_THROUGH=true + +rem Do not modify anything beyond this point +rem ----------------------------------------------------------------------------- + +rem +rem Resolve the real path of the wrapper.exe +rem For non NT systems, the _REALPATH and _WRAPPER_CONF values +rem can be hard-coded below and the following test removed. +rem +if "%OS%"=="Windows_NT" goto nt +echo This script only works with NT-based versions of Windows. +goto :eof + +:nt +rem Find the application home. +rem if no path path specified do the default action +IF not DEFINED _WRAPPER_DIR goto dir_undefined +set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%" +if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\" +rem check if absolute path +if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path +if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path +rem everythig else means relative path +set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%" +goto pathfound + +:dir_undefined +rem Use a relative path to the wrapper %~dp0 is location of current script under NT +set _REALPATH="%~dp0" +goto pathfound +:absolute_path +rem Use an absolute path to the wrapper +set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%" + +:pathfound +rem +rem Decide on the specific Wrapper binary to use (See delta-pack) +rem +if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe" +goto search +:amd64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe" +goto search +:ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe" +goto search +:search +set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%" +if exist %_WRAPPER_EXE% goto conf +set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe" +if exist %_WRAPPER_EXE% goto conf +echo Unable to locate a Wrapper executable using any of the following names: +echo %_WRAPPER_L_EXE% +echo %_WRAPPER_EXE% +pause +goto :eof + +rem +rem Find the wrapper.conf +rem +:conf +if [%_WRAPPER_CONF_OVERRIDE%]==[true] ( + set _WRAPPER_CONF="%~f1" + if not [%_WRAPPER_CONF%]==[""] ( + shift + goto :startup + ) +) +set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%" + +rem +rem Start the Wrapper +rem +:startup +if not [%_PASS_THROUGH%]==[true] ( + if not [%1]==[] ( + echo WARNING: Extra arguments will be ignored. Please check usage in the batch file. + ) +) + +rem Collect the application parameters +:parameters +set _PARAMETERS=%_PARAMETERS% %1 +shift +if not [%1]==[] goto :parameters + +if not [%_PASS_THROUGH%]==[true] ( + %_WRAPPER_EXE% -c %_WRAPPER_CONF% +) else ( + %_WRAPPER_EXE% -c %_WRAPPER_CONF% -- %_PARAMETERS% +) +if not errorlevel 1 goto :eof +pause + + diff --git a/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/start.bat b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/start.bat new file mode 100644 index 0000000..d7d5e85 --- /dev/null +++ b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/start.bat @@ -0,0 +1,135 @@ +@echo off +setlocal + +rem +rem Copyright (c) 1999, 2016 Tanuki Software, Ltd. +rem http://www.tanukisoftware.com +rem All rights reserved. +rem +rem This software is the proprietary information of Tanuki Software. +rem You shall use it only in accordance with the terms of the +rem license agreement you entered into with Tanuki Software. +rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html +rem +rem Java Service Wrapper general startup script. +rem + +rem ----------------------------------------------------------------------------- +rem These settings can be modified to fit the needs of your application +rem Optimized for use with version 3.5.28 of the Wrapper. + +rem The base name for the Wrapper binary. +set _WRAPPER_BASE=wrapper + +rem The directory where the Wrapper binary (.exe) file is located. It can be +rem either an absolute or a relative path. If the path contains any special +rem characters, please make sure to quote the variable. +set _WRAPPER_DIR= + +rem The name and location of the Wrapper configuration file. This will be used +rem if the user does not specify a configuration file as the first parameter to +rem this script. +set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf" + +rem Makes it possible to override the Wrapper configuration file by specifying it +rem as the first parameter. +rem set _WRAPPER_CONF_OVERRIDE=true + +rem Note that it is only possible to pass parameters through to the JVM when +rem installing the service, or when running in a console. + +rem Do not modify anything beyond this point +rem ----------------------------------------------------------------------------- + +rem +rem Resolve the real path of the wrapper.exe +rem For non NT systems, the _REALPATH and _WRAPPER_CONF values +rem can be hard-coded below and the following test removed. +rem +if "%OS%"=="Windows_NT" goto nt +echo This script only works with NT-based versions of Windows. +goto :eof + +:nt +rem Find the application home. +rem if no path path specified do the default action +IF not DEFINED _WRAPPER_DIR goto dir_undefined +set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%" +if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\" +rem check if absolute path +if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path +if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path +rem everythig else means relative path +set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%" +goto pathfound + +:dir_undefined +rem Use a relative path to the wrapper %~dp0 is location of current script under NT +set _REALPATH="%~dp0" +goto pathfound +:absolute_path +rem Use an absolute path to the wrapper +set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%" + +:pathfound +rem +rem Decide on the specific Wrapper binary to use (See delta-pack) +rem +if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe" +goto search +:amd64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe" +goto search +:ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe" +goto search +:search +set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%" +if exist %_WRAPPER_EXE% goto conf +set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe" +if exist %_WRAPPER_EXE% goto conf +echo Unable to locate a Wrapper executable using any of the following names: +echo %_WRAPPER_L_EXE% +echo %_WRAPPER_EXE% +pause +goto :eof + +rem +rem Find the wrapper.conf +rem +:conf +if [%_WRAPPER_CONF_OVERRIDE%]==[true] ( + set _WRAPPER_CONF="%~f1" + if not [%_WRAPPER_CONF%]==[""] ( + shift + goto :startup + ) +) +set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%" + +rem +rem Start the Wrapper +rem +:startup +if not [%_PASS_THROUGH%]==[true] ( + if not [%1]==[] ( + echo WARNING: Extra arguments will be ignored. Please check usage in the batch file. + ) +) + +rem Collect the application parameters +:parameters +set _PARAMETERS=%_PARAMETERS% %1 +shift +if not [%1]==[] goto :parameters + +if not [%_PASS_THROUGH%]==[true] ( + %_WRAPPER_EXE% -t %_WRAPPER_CONF% +) else ( + %_WRAPPER_EXE% -t %_WRAPPER_CONF% -- %_PARAMETERS% +) +if not errorlevel 1 goto :eof +pause diff --git a/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/stop.bat b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/stop.bat new file mode 100644 index 0000000..49d717c --- /dev/null +++ b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/stop.bat @@ -0,0 +1,135 @@ +@echo off +setlocal + +rem +rem Copyright (c) 1999, 2016 Tanuki Software, Ltd. +rem http://www.tanukisoftware.com +rem All rights reserved. +rem +rem This software is the proprietary information of Tanuki Software. +rem You shall use it only in accordance with the terms of the +rem license agreement you entered into with Tanuki Software. +rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html +rem +rem Java Service Wrapper general startup script. +rem + +rem ----------------------------------------------------------------------------- +rem These settings can be modified to fit the needs of your application +rem Optimized for use with version 3.5.28 of the Wrapper. + +rem The base name for the Wrapper binary. +set _WRAPPER_BASE=wrapper + +rem The directory where the Wrapper binary (.exe) file is located. It can be +rem either an absolute or a relative path. If the path contains any special +rem characters, please make sure to quote the variable. +set _WRAPPER_DIR= + +rem The name and location of the Wrapper configuration file. This will be used +rem if the user does not specify a configuration file as the first parameter to +rem this script. +set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf" + +rem Makes it possible to override the Wrapper configuration file by specifying it +rem as the first parameter. +rem set _WRAPPER_CONF_OVERRIDE=true + +rem Note that it is only possible to pass parameters through to the JVM when +rem installing the service, or when running in a console. + +rem Do not modify anything beyond this point +rem ----------------------------------------------------------------------------- + +rem +rem Resolve the real path of the wrapper.exe +rem For non NT systems, the _REALPATH and _WRAPPER_CONF values +rem can be hard-coded below and the following test removed. +rem +if "%OS%"=="Windows_NT" goto nt +echo This script only works with NT-based versions of Windows. +goto :eof + +:nt +rem Find the application home. +rem if no path path specified do the default action +IF not DEFINED _WRAPPER_DIR goto dir_undefined +set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%" +if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\" +rem check if absolute path +if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path +if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path +rem everythig else means relative path +set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%" +goto pathfound + +:dir_undefined +rem Use a relative path to the wrapper %~dp0 is location of current script under NT +set _REALPATH="%~dp0" +goto pathfound +:absolute_path +rem Use an absolute path to the wrapper +set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%" + +:pathfound +rem +rem Decide on the specific Wrapper binary to use (See delta-pack) +rem +if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe" +goto search +:amd64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe" +goto search +:ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe" +goto search +:search +set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%" +if exist %_WRAPPER_EXE% goto conf +set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe" +if exist %_WRAPPER_EXE% goto conf +echo Unable to locate a Wrapper executable using any of the following names: +echo %_WRAPPER_L_EXE% +echo %_WRAPPER_EXE% +pause +goto :eof + +rem +rem Find the wrapper.conf +rem +:conf +if [%_WRAPPER_CONF_OVERRIDE%]==[true] ( + set _WRAPPER_CONF="%~f1" + if not [%_WRAPPER_CONF%]==[""] ( + shift + goto :startup + ) +) +set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%" + +rem +rem Start the Wrapper +rem +:startup +if not [%_PASS_THROUGH%]==[true] ( + if not [%1]==[] ( + echo WARNING: Extra arguments will be ignored. Please check usage in the batch file. + ) +) + +rem Collect the application parameters +:parameters +set _PARAMETERS=%_PARAMETERS% %1 +shift +if not [%1]==[] goto :parameters + +if not [%_PASS_THROUGH%]==[true] ( + %_WRAPPER_EXE% -p %_WRAPPER_CONF% +) else ( + %_WRAPPER_EXE% -p %_WRAPPER_CONF% -- %_PARAMETERS% +) +if not errorlevel 1 goto :eof +pause diff --git a/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/uninstall.bat b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/uninstall.bat new file mode 100644 index 0000000..6ee6d07 --- /dev/null +++ b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/uninstall.bat @@ -0,0 +1,135 @@ +@echo off +setlocal + +rem +rem Copyright (c) 1999, 2016 Tanuki Software, Ltd. +rem http://www.tanukisoftware.com +rem All rights reserved. +rem +rem This software is the proprietary information of Tanuki Software. +rem You shall use it only in accordance with the terms of the +rem license agreement you entered into with Tanuki Software. +rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html +rem +rem Java Service Wrapper general startup script. +rem + +rem ----------------------------------------------------------------------------- +rem These settings can be modified to fit the needs of your application +rem Optimized for use with version 3.5.28 of the Wrapper. + +rem The base name for the Wrapper binary. +set _WRAPPER_BASE=wrapper + +rem The directory where the Wrapper binary (.exe) file is located. It can be +rem either an absolute or a relative path. If the path contains any special +rem characters, please make sure to quote the variable. +set _WRAPPER_DIR= + +rem The name and location of the Wrapper configuration file. This will be used +rem if the user does not specify a configuration file as the first parameter to +rem this script. +set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf" + +rem Makes it possible to override the Wrapper configuration file by specifying it +rem as the first parameter. +rem set _WRAPPER_CONF_OVERRIDE=true + +rem Note that it is only possible to pass parameters through to the JVM when +rem installing the service, or when running in a console. + +rem Do not modify anything beyond this point +rem ----------------------------------------------------------------------------- + +rem +rem Resolve the real path of the wrapper.exe +rem For non NT systems, the _REALPATH and _WRAPPER_CONF values +rem can be hard-coded below and the following test removed. +rem +if "%OS%"=="Windows_NT" goto nt +echo This script only works with NT-based versions of Windows. +goto :eof + +:nt +rem Find the application home. +rem if no path path specified do the default action +IF not DEFINED _WRAPPER_DIR goto dir_undefined +set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%" +if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\" +rem check if absolute path +if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path +if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path +rem everythig else means relative path +set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%" +goto pathfound + +:dir_undefined +rem Use a relative path to the wrapper %~dp0 is location of current script under NT +set _REALPATH="%~dp0" +goto pathfound +:absolute_path +rem Use an absolute path to the wrapper +set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%" + +:pathfound +rem +rem Decide on the specific Wrapper binary to use (See delta-pack) +rem +if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe" +goto search +:amd64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe" +goto search +:ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe" +goto search +:search +set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%" +if exist %_WRAPPER_EXE% goto conf +set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe" +if exist %_WRAPPER_EXE% goto conf +echo Unable to locate a Wrapper executable using any of the following names: +echo %_WRAPPER_L_EXE% +echo %_WRAPPER_EXE% +pause +goto :eof + +rem +rem Find the wrapper.conf +rem +:conf +if [%_WRAPPER_CONF_OVERRIDE%]==[true] ( + set _WRAPPER_CONF="%~f1" + if not [%_WRAPPER_CONF%]==[""] ( + shift + goto :startup + ) +) +set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%" + +rem +rem Start the Wrapper +rem +:startup +if not [%_PASS_THROUGH%]==[true] ( + if not [%1]==[] ( + echo WARNING: Extra arguments will be ignored. Please check usage in the batch file. + ) +) + +rem Collect the application parameters +:parameters +set _PARAMETERS=%_PARAMETERS% %1 +shift +if not [%1]==[] goto :parameters + +if not [%_PASS_THROUGH%]==[true] ( + %_WRAPPER_EXE% -r %_WRAPPER_CONF% +) else ( + %_WRAPPER_EXE% -r %_WRAPPER_CONF% -- %_PARAMETERS% +) +if not errorlevel 1 goto :eof +pause diff --git a/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/wrapper-linux-x86-32 b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/wrapper-linux-x86-32 new file mode 100644 index 0000000..ff3509f Binary files /dev/null and b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/wrapper-linux-x86-32 differ diff --git a/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/wrapper-linux-x86-64 b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/wrapper-linux-x86-64 new file mode 100644 index 0000000..e72b0e0 Binary files /dev/null and b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/wrapper-linux-x86-64 differ diff --git a/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/wrapper-macosx-universal-32 b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/wrapper-macosx-universal-32 new file mode 100644 index 0000000..9a36a5c Binary files /dev/null and b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/wrapper-macosx-universal-32 differ diff --git a/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/wrapper-macosx-universal-64 b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/wrapper-macosx-universal-64 new file mode 100644 index 0000000..6587d2c Binary files /dev/null and b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/wrapper-macosx-universal-64 differ diff --git a/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/wrapper-windows-x86-32.exe b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/wrapper-windows-x86-32.exe new file mode 100644 index 0000000..9762dbf Binary files /dev/null and b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/wrapper-windows-x86-32.exe differ diff --git a/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/wrapper-windows-x86-64.exe b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/wrapper-windows-x86-64.exe new file mode 100644 index 0000000..122ec17 Binary files /dev/null and b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/bin/wrapper-windows-x86-64.exe differ diff --git a/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/conf/application.properties b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/conf/application.properties new file mode 100644 index 0000000..4ed764e --- /dev/null +++ b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/conf/application.properties @@ -0,0 +1,132 @@ +#Global +global.encoding=UTF-8 +global.locale=zh_CN + +#application.sign,application.index\u90FD\u4E0D\u80FD\u91CD\u590D +application.name=food-2.0-openApi +application.owner= +application.sign=local-master +application.description=${application.name} +application.index=0 + +# ServerProperties +server.port=8000 +server.context-path=/openApi +server.compression.enabled=true +server.compression.mime-types=text/html,text/xml,text/plain,text/css,application/json,application/xml +server.compression.min-response-size=2048 + +#dubbo cache address +dubbo.cache.address=/home/project/food/dubbo/food-api.cache + +#Redis\u53C2\u6570 +redis.type=single +redis.host=127.0.0.1 +redis.port=6379 +redis.password=123456 +redis.database=4 +redis.timeout=120000 +redis.pool-max-idle=8 +redis.pool-min-idle=0 +redis.pool-max-active=8 +redis.pool-max-wait=-1 + +#\u5B9A\u65F6\u4EFB\u52A1 +#Schedule +monitor.memory.cron=0 0/2 * * * ? +appauth.callcount.cron=0 0/1 * * * ? +#\u662F\u5426\u8DF3\u8FC7\u8C03\u7528\u6B21\u6570\u8BA1\u5212\u4EFB\u52A1(\u90E8\u7F72\u591A\u4EFD\u65F6\uFF0C\u53EA\u9700\u4E00\u4EFD\u6267\u884C\uFF0C\u5176\u4F59\u90FD\u5E94\u8DF3\u8FC7) +appauth.callcount.skip=false + +#ID +id.worker=1 +id.center=1 +id.sequence=1 + +#\u6CE8\u518C\u4E2D\u5FC3 +zk.connect=127.0.0.1:2181 +# curator or zkclient +zk.client=curator + +#dubbo\u670D\u52A1 +reference.version=2.0.0 +reference.group=default +reference.timeout=30000 +reference.retries=1 + +#FreeMarkerAutoConfiguration +spring.freemarker.cache=false +spring.freemarker.charset=${global.encoding} +#spring.freemarker.prefer-file-system-access=false +spring.freemarker.settings.template_exception_handler=com.jwsaas.freemarker.DefaultTemplateExceptionHandler +spring.freemarker.settings.auto_import=spring.ftl as spring + +# INTERNATIONALIZATION +#\u6307\u5B9Amessage\u7684basename\uFF0C\u591A\u4E2A\u4EE5\u9017\u53F7\u5206\u9694\uFF0C\u5982\u679C\u4E0D\u52A0\u5305\u540D\u7684\u8BDD\uFF0C\u9ED8\u8BA4\u4ECEclasspath\u8DEF\u5F84\u5F00\u59CB\uFF0C\u9ED8\u8BA4: messages +spring.messages.basename=i18n/messages +#\u8BBE\u5B9A\u52A0\u8F7D\u7684\u8D44\u6E90\u6587\u4EF6\u7F13\u5B58\u5931\u6548\u65F6\u95F4\uFF0C-1\u7684\u8BDD\u4E3A\u6C38\u4E0D\u8FC7\u671F\uFF0C\u9ED8\u8BA4\u4E3A-1 +spring.messages.cache-seconds=3600 + +#FastDfs\u914D\u7F6E-fdfs_client.properties +fastdfs.client.connect_timeout=2 +fastdfs.client.network_timeout=30 +fastdfs.client.charset=UTF-8 +fastdfs.client.http.tracker_http_port=80 +fastdfs.client.http.anti_steal_token=no +fastdfs.client.http.secret_key=FastDFS111111111 +#zhangshuxiang aly +fastdfs.client.tracker_server=127.0.0.1:22122 +#\u8BBF\u95EE\u57DF\u540D +fastdfs.client.access_domain=http://img.zhangshuxiang.com + +#MQTT +mqtt.clientId=cy2_openapi_1_bendi_zgt1 +mqtt.host=csiotv2.ffcygl.com +mqtt.port=18830 +mqtt.keepalive=60 +mqtt.connection.timeout=10 + +#\u5FAE\u4FE1 +weixin.oauth.center.url=http://oauth.domain.com + +#Task\u8BA1\u5212\u4EFB\u52A1 +#\u6267\u884C\u5668\u6807\u8BC6 +xxl.job.executor.sign=10001JW_Food +#\u62A5\u8B66\u90AE\u4EF6 +xxl.job.alarm.email=418146746@qq.com +#\u4EFB\u52A1\u8C03\u5EA6\u63A5\u53E3 +schedue.url=http://127.0.0.1:8900/job/schedule/open + +#V2\u638C\u67DC\u67E5\u8BE2\u5F00\u653E\u63A5\u53E3\u5730\u5740 +#zgcx.api.v2.url=http://r.jwsaas.com/wx/api/extend +zgcx.api.v2.url=http://127.0.0.1:8889/wx/api/extend + +#V2\u95E8\u5E97\u8D26\u6237\u4F59\u989D\u5145\u503C-\u5FAE\u4FE1\u652F\u4ED8\u5F02\u6B65\u901A\u77E5\u5730\u5740 +wxyh.api.v2.wxnotify.url=http://127.0.0.1:8000/openApi/open/api/extend/callBack + +#V2\u5C0F\u7A0B\u5E8F\u626B\u5457\u652F\u4ED8-\u5FAE\u4FE1\u652F\u4ED8\u5F02\u6B65\u901A\u77E5\u5730\u5740 +saobeipay.wxnotify.url=http://azkoss.imwork.net/openApi/open/api/extend/callBack/saobeigcwxnotify + +#V2\u5C0F\u7A0B\u5E8F\u626B\u5457\u652F\u4ED8-\u5FAE\u4FE1\u652F\u4ED8\u5F02\u6B65\u901A\u77E5\u5730\u5740 +saobeipay.programnotify.url=http://azkoss.imwork.net/openApi/open/api/extend/callBack/saobeiprogramnotify + +tonglianpay.wxnotify.url=https://csfv2.ffcygl.com/openApi/open/api/extend/callBack/tonglianprogramnotifygcwxnotify + +tonglianpay.programnotify.url=https://csfv2.ffcygl.com/openApi/open/api/extend/callBack/tonglianprogramnotify + +tonglian.signalagentPayotify=https://csfv2.ffcygl.com/openApi/open/api/extend/callBack/signalagentPayotify + +#\u767E\u5EA6\u5730\u56FELBS ak\u548C\u6570\u636E\u8868 id +baidu.api.v4.ak=baiduak +baidu.api.v4.geoTableId=tableId + +#RabbitMQ +spring.rabbitmq.host=47.92.83.179 +spring.rabbitmq.port=5672 +spring.rabbitmq.virtual-host=/dev_test +spring.rabbitmq.publisher-confirms=true +spring.rabbitmq.username=foodcard +spring.rabbitmq.password=zsx235679@ + +#\u9910\u9053\u7B2C\u4E09\u65B9\u914D\u9001\u5730\u5740 +candao.waimai.dispatch.url=http://127.0.0.1:8008 diff --git a/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/conf/erp.properties b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/conf/erp.properties new file mode 100644 index 0000000..b004bc3 --- /dev/null +++ b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/conf/erp.properties @@ -0,0 +1,11 @@ +open.api.appKey=appkey +open.api.secret=secret +open.api.version=1.0 +open.api.format=json +open.api.locale=zh_CN +open.api.client=web +open.api.url=http://127.0.0.1/openApi/api + +#\u9910\u996E\u7684appk secret +open.api.food.appKey=appKey +open.api.food.secret=secret diff --git a/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/conf/logback.xml b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/conf/logback.xml new file mode 100644 index 0000000..3f84b06 --- /dev/null +++ b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/conf/logback.xml @@ -0,0 +1,33 @@ + + + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%-5level] %logger{120} - %msg %n + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/conf/wrapper.conf b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/conf/wrapper.conf new file mode 100644 index 0000000..e249441 --- /dev/null +++ b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/conf/wrapper.conf @@ -0,0 +1,60 @@ +encoding=UTF-8 +wrapper.lang=zh_CN +#using the system default JDK environment variable +wrapper.java.command=java +#set.JAVA_HOME=/home/jdk1.8.0_65 +#wrapper.java.command=%JAVA_HOME%/bin/java +wrapper.java.command.loglevel=INFO + +wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp +wrapper.java.classpath.1=./ +wrapper.java.classpath.2=../conf/ +wrapper.java.classpath.3=../lib/*.jar + +wrapper.java.library.path.1=../lib + +wrapper.java.additional.auto_bits=TRUE +#set the default parameters +wrapper.java.additional.1=-Xms512m +wrapper.java.additional.2=-Xmx1024m +wrapper.java.additional.3=-XX:PermSize=256m +wrapper.java.additional.4=-XX:MaxPermSize=512m +wrapper.java.additional.5=-Djava.net.preferIPv4Stack=true +wrapper.java.additional.6=-Dsun.lang.ClassLoader.allowArraySyntax=true + +# Initial Java Heap Size (in MB) +wrapper.java.initmemory=128 +# Maximum Java Heap Size (in MB) +wrapper.java.maxmemory=512 + +# Application parameters. Add parameters as needed starting from 1 +wrapper.app.parameter.1=org.springframework.boot.loader.JarLauncher +wrapper.app.parameter.2=--spring.config.location=../conf/application.properties +wrapper.app.parameter.3=--logging.config=../conf/logback.xml +wrapper.app.parameter.4=--logging.path=../logs + +wrapper.filter.trigger.1=java.lang.OutOfMemoryError +wrapper.filter.action.1=RESTART + +wrapper.console.format=PM +wrapper.console.loglevel=INFO + +wrapper.logfile=../logs/server_YYYYMMDD.log +wrapper.logfile.rollmode=DATE +wrapper.logfile.format=LPTM +wrapper.logfile.loglevel=INFO +wrapper.logfile.maxsize=0 +wrapper.logfile.maxfiles=0 +wrapper.syslog.loglevel=NONE + +wrapper.ignore_sequence_gaps=TRUE +wrapper.pidfile.strict=TRUE + +wrapper.console.title=Food-2.0 Open Api Application + +wrapper.name=food2_open_api +wrapper.displayname=Food-2.0 Open Api Application +wrapper.description=Food-2.0 Open Api Application +wrapper.ntservice.dependency.1= +wrapper.ntservice.starttype=AUTO_START +wrapper.ntservice.interactive=false diff --git a/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/lib/food-open-api-2.0.0.jar b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/lib/food-open-api-2.0.0.jar new file mode 100644 index 0000000..7650c58 Binary files /dev/null and b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/lib/food-open-api-2.0.0.jar differ diff --git a/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/lib/libwrapper-macosx-universal-32.jnilib b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/lib/libwrapper-macosx-universal-32.jnilib new file mode 100644 index 0000000..ae75d31 Binary files /dev/null and b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/lib/libwrapper-macosx-universal-32.jnilib differ diff --git a/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/lib/libwrapper-macosx-universal-64.jnilib b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/lib/libwrapper-macosx-universal-64.jnilib new file mode 100644 index 0000000..e7d4102 Binary files /dev/null and b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/lib/libwrapper-macosx-universal-64.jnilib differ diff --git a/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/lib/wrapper-windows-x86-32.dll b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/lib/wrapper-windows-x86-32.dll new file mode 100644 index 0000000..6aaa9c1 Binary files /dev/null and b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/lib/wrapper-windows-x86-32.dll differ diff --git a/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/lib/wrapper-windows-x86-64.dll b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/lib/wrapper-windows-x86-64.dll new file mode 100644 index 0000000..81f11ce Binary files /dev/null and b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/lib/wrapper-windows-x86-64.dll differ diff --git a/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/lib/wrapper.jar b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/lib/wrapper.jar new file mode 100644 index 0000000..70dc5ab Binary files /dev/null and b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/lib/wrapper.jar differ diff --git a/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/logs/safeToDelete.tmp b/food-open/food-open-api/target/food-open-api-2.0.0/food-open-api-2.0.0/logs/safeToDelete.tmp new file mode 100644 index 0000000..e69de29 diff --git a/food-open/food-open-api/target/maven-archiver/pom.properties b/food-open/food-open-api/target/maven-archiver/pom.properties new file mode 100644 index 0000000..8c58835 --- /dev/null +++ b/food-open/food-open-api/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Sun Dec 31 22:05:24 CST 2023 +version=2.0.0 +groupId=com.jwsaas +artifactId=food-open-api diff --git a/food-open/food-open-api/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/food-open/food-open-api/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..faf9b99 --- /dev/null +++ b/food-open/food-open-api/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,763 @@ +com\jwsaas\api\entity\upload\StoreHandoverDetailPartEntity.class +com\jwsaas\api\request\storage\StoreStorageOutTicketDetailRequest.class +com\jwsaas\util\open\BaseApiUtils$1.class +com\jwsaas\api\request\storage\StoreCostTicketRequest.class +com\jwsaas\api\request\store\StoreSalesOrderListRequest.class +com\jwsaas\api\response\mode\CommonListResponse.class +com\jwsaas\api\request\visitor\VisitorTagListRequest.class +com\jwsaas\api\service\impl\ops\CityInfoServiceImpl.class +com\jwsaas\api\request\wxdc\StoreOpenStatusUpdateRequest.class +com\jwsaas\api\request\vpos\VposOrderCreateRequest.class +com\jwsaas\api\boduo\erp\request\ErpProductSpecRequest.class +com\jwsaas\api\service\storage\StoreStorageService.class +com\jwsaas\api\request\promotion\PromotionTypeListRequest.class +com\jwsaas\api\request\weixin\DaySummaryListRequest.class +com\jwsaas\api\service\impl\peripheral\PeripheralServiceImpl.class +com\jwsaas\api\entity\program\ProgramStoreBusinessTicketInfoEntity.class +com\jwsaas\api\service\upload\UploadExtendService.class +com\jwsaas\reactor\event\WxyhEvents.class +com\jwsaas\api\qimai\service\QiMaiProductTypeService.class +com\jwsaas\api\request\weixin\AgentStoreRequest.class +com\jwsaas\api\request\storage\StoreStorageTicketAddRequest.class +com\jwsaas\api\entity\storage\StoreCostTicketEntity.class +com\jwsaas\api\boduo\erp\service\MaterialTypeService.class +com\jwsaas\reactor\event\WxdcOrderPayEvents$2.class +com\jwsaas\api\request\program\ProgramWeixinPayQueryRequest.class +com\jwsaas\pay\weixin\request\QueryOrderRequest.class +com\jwsaas\api\boduo\erp\response\MaterialUnitResponse.class +com\jwsaas\api\request\wxyh\WxyhGoodsRequest.class +com\jwsaas\reactor\event\ProgramOrderSaobeiUploadEvents.class +com\jwsaas\api\request\worker\WorkerUpdatePwdRequest.class +com\jwsaas\http\HTTPRequest$1.class +com\jwsaas\api\request\store\StoreCouponCheckOutRequest.class +com\jwsaas\api\boduo\erp\request\MaterialUnitRequest.class +com\jwsaas\api\entity\upload\StoreOrderProductExtendEntity.class +com\jwsaas\open\security\redis\RedisServiceAccessController.class +com\jwsaas\api\entity\program\ProgramStoreBusinessTicketSycnEntity.class +com\jwsaas\api\entity\storage\StoreCostTicketProductTypeEntity.class +com\jwsaas\controller\open\BaiDuLbsController$6.class +com\jwsaas\api\request\storage\StoreStorageTicketListRequest.class +com\jwsaas\config\MqttConfiguration.class +com\jwsaas\api\service\program\ProgramOrderService.class +com\jwsaas\api\service\program\ProgramStoreService.class +com\jwsaas\config\SchedulingConfiguration.class +com\jwsaas\api\service\impl\pos\ErpPosServiceImpl.class +com\jwsaas\api\service\impl\worker\WorkerServiceImpl.class +com\jwsaas\api\service\program\impl\ProgramOrderServiceImpl$5.class +com\jwsaas\bean\StoresPrediction.class +com\jwsaas\api\service\promotion\PromotionService.class +com\jwsaas\api\boduo\erp\service\DeliveryModeListService.class +com\jwsaas\util\CardApiUtils.class +com\jwsaas\api\request\storage\StoreStockCheckTemplateDetailRequest.class +com\jwsaas\reactor\event\EventKeys.class +com\jwsaas\api\entity\storage\StoreCostTicketProductChangeEntity.class +com\jwsaas\util\RandomUtil.class +com\jwsaas\util\JSONUtil.class +com\jwsaas\api\request\store\StoreProductCouponListRequest.class +com\jwsaas\api\entity\upload\StoreBusinessLogEntity.class +com\jwsaas\api\request\weixin\DaySummaryListByDateRangeRequest.class +com\jwsaas\api\request\program\ProgramProductSaleStatusRequest.class +com\jwsaas\api\request\worker\WorkerListRequest.class +com\jwsaas\api\request\storage\AskGoodsTicketEditRequest.class +com\jwsaas\controller\open\BaiDuLbsController$14.class +com\jwsaas\api\response\common\SessionCreateResponse.class +com\jwsaas\api\entity\vpos\VposStoreOrderProductMakeEntity.class +com\jwsaas\api\request\vpos\VposProductTypeTwoRequest.class +com\jwsaas\controller\open\TaskController$6.class +com\jwsaas\api\service\pay\PayService.class +com\jwsaas\api\request\program\ProgramOrderQueryByBusNoRequest.class +com\jwsaas\open\session\redis\RedisSessionManager.class +com\jwsaas\api\entity\wxdc\SalesOrderItemMakeEntity.class +com\jwsaas\api\request\worker\WorkerPosModuleRequest.class +com\jwsaas\controller\open\ApiExtendController$2.class +com\jwsaas\api\entity\storage\StoreStorageTicketEntity.class +com\jwsaas\config\RedissonConfiguration.class +com\jwsaas\api\service\impl\cardsync\CardsyncServiceImpl.class +com\jwsaas\api\request\weixin\SalesDailyByDateRangeRequest.class +com\jwsaas\Constant.class +com\jwsaas\api\request\program\ProgramUserWeixinFormIdRequest.class +com\jwsaas\api\request\cardsync\StorePosRequest.class +com\jwsaas\api\service\impl\storage\StoreDispatchServiceImpl.class +com\jwsaas\controller\open\ApiExtendController.class +com\jwsaas\tonglian\TlCommonConstants.class +com\jwsaas\api\request\storage\StoreStockUnCheckTicketDetailUpdateRequest.class +com\jwsaas\api\boduo\erp\request\MaterialToErpSyncRequest.class +com\jwsaas\api\request\store\StorePosListRequest.class +com\jwsaas\api\request\kds\KdsProductRequest.class +com\jwsaas\api\request\storage\AskGoodsDetailRequest.class +com\jwsaas\api\request\pos\PosAuthRequest.class +com\jwsaas\util\RandomUtils.class +com\jwsaas\api\request\storage\StoreStorageOutTicketListRequest.class +com\jwsaas\util\HmacSHA1Utils.class +com\jwsaas\http\callbacks\HTTPStatusCheckCallback.class +com\jwsaas\api\service\spwxdc\SpWxdcService.class +com\jwsaas\util\HttpUtils.class +com\jwsaas\api\request\program\ProgramAdvPictureRequest.class +com\jwsaas\api\qimai\request\CategoryUpdateRequest.class +com\jwsaas\api\request\liteappdc\LiteAppOrderCreateRequest.class +com\jwsaas\api\request\worker\WorkerLoginRequest.class +com\jwsaas\api\service\liteappdc\LiteAppdcService.class +com\jwsaas\api\boduo\erp\service\impl\AskGoodsTicketErpServiceImpl.class +com\jwsaas\api\service\impl\store\StoreAdjustPriceServiceImpl.class +com\jwsaas\properties\CandaoProperties.class +com\jwsaas\pay\weixin\response\PayNotifyResponse.class +com\jwsaas\api\entity\program\ProgramStoreBusinessTicketDeliverEntity.class +com\jwsaas\api\request\product\ProductRatioRequest.class +com\jwsaas\api\request\store\StoreSalesDayProductSummaryRequest.class +com\jwsaas\http\HTTPResponseCallback.class +com\jwsaas\api\request\wxdc\GoodsCategoryRequest.class +com\jwsaas\api\request\store\StoretableRequest.class +com\jwsaas\weixin\bean\TemplateMessage$Item.class +com\jwsaas\api\request\storage\DispatchTicketReceiveRequest.class +com\jwsaas\api\service\impl\store\StoreAccountServiceImpl.class +com\jwsaas\cache\data\CacheData.class +com\jwsaas\api\request\upload\BusinessRevenueUploadRequest.class +com\jwsaas\api\request\visitor\VisitorUpdateRequest.class +com\jwsaas\reactor\event\ServerDataVersionUpdateEvents.class +com\jwsaas\api\request\weixin\CategorySummaryListRequest.class +com\jwsaas\api\request\wxdc\StoreOrderCancelRequest.class +com\jwsaas\api\request\pos\PosMonitorRequest.class +com\jwsaas\api\request\visitor\VisitorInfoRequest.class +com\jwsaas\api\entity\vpos\VposStorePayEntity.class +com\jwsaas\api\request\cardsync\StorePayTypeRequest.class +com\jwsaas\api\request\storage\StoreStorageTicketEditRequest.class +com\jwsaas\api\request\jwygj\ProductSpecInfoEntity.class +com\jwsaas\api\service\common\CommonService.class +com\jwsaas\api\boduo\erp\request\PayMoneyTicketRequest.class +com\jwsaas\http\callbacks\HTTPByteCallback.class +com\jwsaas\reactor\event\SalesOrderEvents.class +com\jwsaas\api\request\jwygj\YgjAddProductRequest.class +com\jwsaas\api\request\wxdc\ZCGoodsCategoryListRequest.class +com\jwsaas\tonglian\bean\Reqsn.class +com\jwsaas\task\utils\TaskOpenUtils.class +com\jwsaas\weixin\bean\Token.class +com\jwsaas\api\request\product\ProductImageRequest.class +com\jwsaas\pay\weixin\request\RefundRequest.class +com\jwsaas\api\entity\upload\StoreBusinessTicketDeliveryEntity.class +com\jwsaas\api\boduo\erp\service\impl\MateriaUnitServiceImpl.class +com\jwsaas\api\entity\upload\StoreOrderProductEntity.class +com\jwsaas\api\request\visitor\VisitorAddressListRequest.class +com\jwsaas\api\request\vpos\VposProductEvaluateUploadRequest.class +com\jwsaas\api\service\wxdc\impl\WxdcServiceImpl$1.class +com\jwsaas\api\request\program\ProgramOrderListRequest.class +com\jwsaas\api\service\storage\StoreStockCheckService.class +com\jwsaas\tonglian\TlHttpUtils.class +com\jwsaas\config\OpenCardApiProperties.class +com\jwsaas\api\entity\storage\StoreStorageOutTicketEntity.class +com\jwsaas\api\request\vpos\VposAdPictureRequest.class +com\jwsaas\util\JSONException.class +com\jwsaas\tonglian\TlHttpClient.class +com\jwsaas\api\request\storage\StoreStorageTicketDetailRequest.class +com\jwsaas\open\security\redis\RedisAppSecretManager.class +com\jwsaas\api\request\wxdc\WeixinPayUnifiedorderRequest.class +com\jwsaas\api\request\wxdc\UserApplyRefundRequest.class +com\jwsaas\api\service\jwygj\StoreYgjWorkerService.class +com\jwsaas\api\entity\upload\StoreBusinessTicketEntity.class +com\jwsaas\api\service\impl\upload\UploadServiceImpl.class +com\jwsaas\tonglian\TlRequest.class +com\jwsaas\controller\open\ApiExtendController$3.class +com\jwsaas\api\request\ccb\CcbParamGetRequest.class +com\jwsaas\reactor\event\WxdcOrderPayEvents$3.class +com\jwsaas\api\service\waimai\WaiMaiService.class +com\jwsaas\api\request\wxdc\GoodsCategoryListRequest.class +com\jwsaas\reactor\event\StoreAccountEvents.class +com\jwsaas\reactor\event\PosEvents.class +com\jwsaas\api\request\store\StoreBaseRequest.class +com\jwsaas\api\boduo\erp\response\MaterialDetailResponse.class +com\jwsaas\api\service\impl\store\StoreServiceImpl$4.class +com\jwsaas\api\request\storage\StoreStockCheckTicketRequest.class +com\jwsaas\api\request\weixin\DaySummaryRequest.class +com\jwsaas\api\request\vpos\VposOrderRefundPartRequest.class +com\jwsaas\properties\ZgxcProperties.class +com\jwsaas\api\request\program\ProgramProductDetailRequest.class +com\jwsaas\api\request\weixin\PaySummaryListRequest.class +com\jwsaas\properties\ApplicationProperties.class +com\jwsaas\api\boduo\erp\request\DishToErpSyncRequest.class +com\jwsaas\api\request\program\ProgramOrderRefundApplyRequest.class +com\jwsaas\api\request\storage\StoreStockUnCheckTicketStatusUpdateRequest.class +com\jwsaas\api\request\costlimit\CostTicketTemplateRequest.class +com\jwsaas\api\request\wxdc\StorePayParameterRequest.class +com\jwsaas\api\service\impl\store\StoreAdjustPriceServiceImpl$2.class +com\jwsaas\api\request\cardsync\ProductTypeRequest.class +com\jwsaas\api\request\split\SplitShopAccountRequest.class +com\jwsaas\api\request\liteappdc\LiteAppSalesOrderCreateRequest.class +com\jwsaas\api\request\vpos\VposOrderRefundRequest.class +com\jwsaas\pay\weixin\api\WeiXinPayApi.class +com\jwsaas\api\request\wxdc\StoreOrderListRequest.class +com\jwsaas\api\request\store\StoreBusinessPlanRequest.class +com\jwsaas\api\service\impl\storage\StoreStorageServiceImpl.class +com\jwsaas\api\entity\vpos\VposStoreOrderProductMakeRefundPartEntity.class +com\jwsaas\api\request\jwygj\YgjAddProductCheckRequest.class +com\jwsaas\api\service\impl\store\StoreAdjustPriceServiceImpl$1.class +com\jwsaas\open\listener\DefaultAfterDoServiceEventListener.class +com\jwsaas\api\service\impl\WopServiceImpl.class +com\jwsaas\properties\WeiXinProperties.class +com\jwsaas\api\request\program\ProgramProductRequest.class +com\jwsaas\api\request\weixin\WorkerStoreRequest.class +com\jwsaas\api\request\program\ProgramUserAddressDeleteRequest.class +com\jwsaas\api\request\wxdc\StoreOrderConfirmRequest.class +com\jwsaas\pay\weixin\utils\SecurityUtils$1.class +com\jwsaas\controller\open\ApiExtendController$6.class +com\jwsaas\api\request\storage\StoreStorageTicketTypeRequest.class +com\jwsaas\api\request\storage\StoreStorageOutTicketEditRequest.class +com\jwsaas\api\service\impl\store\StoreServiceImpl$5.class +com\jwsaas\api\boduo\erp\request\MaterialTypeRequest.class +com\jwsaas\controller\open\BaseOpenController.class +com\jwsaas\api\service\program\impl\ProgramOrderServiceImpl$1.class +com\jwsaas\api\request\wxdc\GoodsListRequest.class +com\jwsaas\api\service\impl\store\StoreAdjustPriceServiceImpl$3.class +com\jwsaas\api\service\store\StoreRechargeService.class +com\jwsaas\api\entity\visitor\VisitorAddressEntity.class +com\jwsaas\api\request\product\ProductBurdenRequest.class +com\jwsaas\api\entity\storage\StoreStorageOutTicketDetailEntity.class +com\jwsaas\api\request\storage\AskGoodsTicketStatusRequest.class +com\jwsaas\properties\TongLianPayProperties.class +com\jwsaas\api\request\store\StoreFeeItemListRequest.class +com\jwsaas\api\request\wxyh\UpdateWorkerPasswordRequest.class +com\jwsaas\api\request\wxyh\WxyhCategoryRequest.class +com\jwsaas\api\request\peripheral\CardReaderInfoRequest.class +com\jwsaas\api\request\store\StoreSalesDaySummaryRequest.class +com\jwsaas\weixin\SignUtil.class +com\jwsaas\api\service\kds\KdsService.class +com\jwsaas\pay\weixin\response\RefundResponse.class +com\jwsaas\config\ReactorConfiguration.class +com\jwsaas\utils\RedisKeyUtil.class +com\jwsaas\api\entity\visitor\VisitorEntity.class +com\jwsaas\api\service\impl\store\StoreServiceImpl$6.class +com\jwsaas\api\entity\storage\StoreCostTicketProductMoreChangeEntity.class +com\jwsaas\api\request\store\StoreAccountRechargeRequest.class +com\jwsaas\http\HttpConstants.class +com\jwsaas\controller\open\TaskController$5.class +com\jwsaas\api\entity\upload\StoreHandoverDetailPayEntity.class +com\jwsaas\api\request\storage\DispatchTicketDetailRequest.class +com\jwsaas\api\service\impl\promotion\PromotionServiceImpl.class +com\jwsaas\api\service\intelligence\IntelligenceGoodsService.class +com\jwsaas\api\entity\storage\StoreCostTicketProductFixedChangeEntity.class +com\jwsaas\open\security\redis\RedisInvokeTimesController.class +com\jwsaas\api\request\wxdc\GoodsInfoRequest.class +com\jwsaas\api\request\product\ProductSpecRequest.class +com\jwsaas\api\service\vpos\impl\VposProductServiceImpl$2.class +com\jwsaas\config\OpenApiProperties.class +com\jwsaas\api\entity\storage\AskGoodsTemplateDetailEntity.class +com\jwsaas\api\request\program\ProgramOrderCancelRequest.class +com\jwsaas\api\request\vpos\VposWeixinPayQueryRequest.class +com\jwsaas\controller\open\BaiDuLbsController$5.class +com\jwsaas\api\entity\upload\StoreOrderProductMakeExtendEntity.class +com\jwsaas\api\request\split\SplitStorePayRequet.class +com\jwsaas\util\StringUtils.class +com\jwsaas\api\request\program\ProgramOrderCreateSyncRequest.class +com\jwsaas\api\request\visitor\VisitorAddRequest.class +com\jwsaas\api\boduo\erp\service\impl\ErpToPosDataServiceImpl.class +com\jwsaas\controller\callback\CallBackController.class +com\jwsaas\cache\data\ProductUnitCache.class +com\jwsaas\api\service\impl\storage\StoreStockCheckServiceImpl.class +com\jwsaas\controller\open\BaiDuLbsController$10.class +com\jwsaas\api\entity\upload\StoreBusinessTicketExtendEntity.class +com\jwsaas\api\entity\pos\PosSetResourcesEntity.class +com\jwsaas\api\service\impl\kit\KitServiceImpl.class +com\jwsaas\api\service\pos\PosService.class +com\jwsaas\api\request\liteappdc\LiteAppWxdcSalesOrderCreateRequest.class +com\jwsaas\api\service\vpos\impl\VposProductServiceImpl$4.class +com\jwsaas\api\service\impl\pay\PayServiceImpl$1.class +com\jwsaas\api\request\vpos\VposProductStockRequest.class +com\jwsaas\api\entity\upload\StoreCostRevenueEntity.class +com\jwsaas\cache\data\ProgramProductInfoCache.class +com\jwsaas\api\request\jwygj\YgjStoreSetRequest.class +com\jwsaas\api\request\storage\AskGoodsTicketAddRequest.class +com\jwsaas\api\request\jwygj\YgjStoreAccountSummaryRequest.class +com\jwsaas\api\request\visitor\VisitorListRequest.class +com\jwsaas\mqtt\PushCallback.class +com\jwsaas\controller\open\BaiDuLbsController$7.class +com\jwsaas\api\entity\storage\AskGoodsDetailEntity.class +com\jwsaas\api\request\weixin\ProductRankRequest.class +com\jwsaas\api\request\promotion\StorePromotionTaskRequest.class +com\jwsaas\reactor\event\WxdcOrderPayEvents.class +com\jwsaas\reactor\event\BaseWxdcEvents.class +com\jwsaas\api\request\storage\StoreCostTicketSaveRequest.class +com\jwsaas\api\service\peripheral\PeripheralService.class +com\jwsaas\controller\open\BaiDuLbsController$12.class +com\jwsaas\api\request\wxdc\StoreAgreeRefundRequest.class +com\jwsaas\api\boduo\erp\service\V1PosToV2PosDataService.class +com\jwsaas\api\request\program\ProgramEvaluateDownloadRequest.class +com\jwsaas\config\ExpirationMessagePostProcessor.class +com\jwsaas\util\ReflectionUtils.class +com\jwsaas\api\request\program\ProgramStoreListRequest.class +com\jwsaas\api\service\kms\KmsService.class +com\jwsaas\api\request\store\AdjustPriceTicketRequest.class +com\jwsaas\api\request\common\SessionCreateRequest.class +com\jwsaas\api\request\store\BrandRequest.class +com\jwsaas\controller\open\BaiDuLbsController$13.class +com\jwsaas\util\file\FileUtils.class +com\jwsaas\util\Pinyin4jUtil.class +com\jwsaas\api\request\storage\StoreStockCheckTemplateListRequest.class +com\jwsaas\util\open\BaseApiUtils.class +com\jwsaas\api\boduo\erp\response\StoreAskMaterialSyncResponse.class +com\jwsaas\api\request\program\ProgramStoreStopRequest.class +com\jwsaas\api\boduo\erp\service\ErpToPosDataService.class +com\jwsaas\api\entity\pos\MaterialUnitEntity.class +com\jwsaas\api\request\wxdc\DistributionAddressRequest.class +com\jwsaas\api\request\program\ProgramOrderHandleRequest.class +com\jwsaas\api\request\store\StoreCouponCheckRequest.class +com\jwsaas\api\service\wxdc\WxdcService.class +com\jwsaas\controller\open\TaskController$2.class +com\jwsaas\api\request\store\AdjustPriceTicketAddRequest.class +com\jwsaas\api\service\upload\UploadService.class +com\jwsaas\api\service\WopService.class +com\jwsaas\controller\open\BaiDuLbsController$8.class +com\jwsaas\reactor\event\BusinessHandoverEvents.class +com\jwsaas\api\entity\pos\PosSetModuleEntity.class +com\jwsaas\api\service\store\StoreAccountService.class +com\jwsaas\api\service\visitor\VisitorService.class +com\jwsaas\api\service\impl\ErpBaseServiceImpl.class +com\jwsaas\api\service\impl\kds\KdsServiceImpl.class +com\jwsaas\api\request\program\ProgramWeixinPayRequest.class +com\jwsaas\api\entity\pos\MaterialInfo.class +com\jwsaas\api\service\vpos\impl\VposProductServiceImpl.class +com\jwsaas\api\request\wxdc\SalesOrderCancelRequest.class +com\jwsaas\api\request\store\StoreCouponListRequest.class +com\jwsaas\api\service\pos\ErpPosService.class +com\jwsaas\api\entity\storage\StoreCostTicketProductOtherChangeEntity.class +com\jwsaas\mqtt\MqttClientExt$1.class +com\jwsaas\api\request\store\StoreMessageRequest.class +com\jwsaas\api\request\storage\StoreStockCheckTicketDetailDelRequest.class +com\jwsaas\api\service\impl\storage\StoreStorageTicketServiceImpl.class +com\jwsaas\api\request\common\SayHelloRequest.class +com\jwsaas\api\boduo\erp\service\impl\V1PosToV2PosDataServiceImpl.class +com\jwsaas\api\request\vpos\VposOrderPayRequest.class +com\jwsaas\api\service\split\SplitService.class +com\jwsaas\api\request\worker\WorkerPosRoleRequest.class +com\jwsaas\api\service\program\impl\ProgramStoreServiceImpl.class +com\jwsaas\api\boduo\erp\request\SyncMaterialTypeRequest.class +com\jwsaas\api\request\jwygj\YgjProductTypeRequest.class +com\jwsaas\api\request\product\ProductSuitRequest.class +com\jwsaas\api\boduo\erp\request\ErpToPosMaterialSyncRequest.class +com\jwsaas\api\service\cost\impl\CostTicketTemplateServiceImpl.class +com\jwsaas\util\CronUtil.class +com\jwsaas\api\service\store\StoreInfoService.class +com\jwsaas\api\service\wxdc\WxdcZCService.class +com\jwsaas\api\boduo\erp\response\DeliveryModeListResponse.class +com\jwsaas\api\request\store\StoreAccountGetRequest.class +com\jwsaas\api\entity\pos\MaterialEntity.class +com\jwsaas\api\boduo\erp\service\AskGoodsTicketErpService.class +com\jwsaas\api\service\program\impl\SplitStorePayServiceImpl.class +com\jwsaas\api\request\product\StoreMakeDetailRequest.class +com\jwsaas\api\request\pos\TenantLineAuthRequest.class +com\jwsaas\api\entity\vpos\VposStoreOrderProductRefundPartEntity.class +com\jwsaas\open\session\redis\RedisSessionBindInterceptor.class +com\jwsaas\api\request\pos\ServerDataVersionRequest.class +com\jwsaas\util\file\FileTypeUtils.class +com\jwsaas\api\entity\upload\StorePayEntity.class +com\jwsaas\controller\open\BaiDuLbsController$4.class +com\jwsaas\api\boduo\erp\service\MaterialUnitService.class +com\jwsaas\api\request\cardsync\StoreMessageRequest.class +com\jwsaas\bean\AppKeyInfo.class +com\jwsaas\open\interceptor\ReservedInterceptor.class +com\jwsaas\api\request\wxdc\StoreListRequest.class +com\jwsaas\utils\HashidsUtil.class +com\jwsaas\api\boduo\erp\response\MaterialTypeResponse.class +com\jwsaas\api\request\store\StoreListRequest.class +com\jwsaas\api\response\mode\CommonErrorCode.class +com\jwsaas\api\entity\program\AuthAccessToken.class +com\jwsaas\api\request\weixin\VposUserSeriesRequest.class +com\jwsaas\controller\open\TaskController$3.class +com\jwsaas\api\request\wxdc\DistributionRequest.class +com\jwsaas\reactor\event\PromotionTaskEvents.class +com\jwsaas\api\entity\storage\StoreStockCheckTicketEntity.class +com\jwsaas\reactor\event\ProgramOrderEvents.class +com\jwsaas\api\request\program\ProgramOrderConfirmRequest.class +com\jwsaas\api\boduo\erp\service\StoreAskMaterialSyncService.class +com\jwsaas\api\request\storage\StoreStorageOutTicketStatusChangeRequest.class +com\jwsaas\api\service\vpos\impl\VposProductServiceImpl$1.class +com\jwsaas\api\service\program\impl\ProgramUserServiceImpl.class +com\jwsaas\config\RabbitConstant.class +com\jwsaas\api\request\upload\BusinessLogUploadRequest.class +com\jwsaas\config\RedissonConfiguration$RedisType.class +com\jwsaas\controller\open\BaiDuLbsController$1.class +com\jwsaas\api\service\impl\split\SplitLogServiceImpl.class +com\jwsaas\api\service\impl\jwygj\StoreYgjWorkerServiceImpl.class +com\jwsaas\api\service\store\ProgramBusinessTicketService.class +com\jwsaas\api\request\product\StoreMakeTypeRequest.class +com\jwsaas\controller\open\BaiDuLbsController$2.class +com\jwsaas\api\request\upload\BusinessOrderUploadRequest.class +com\jwsaas\api\boduo\erp\request\MaterialDetailRequest.class +com\jwsaas\api\request\vpos\ProductTypeDetailRequest.class +com\jwsaas\api\request\pos\ErpPosSetRequest.class +com\jwsaas\tonglian\bean\AgentCollectApply.class +com\jwsaas\api\request\vpos\VposWeixinPayRequest.class +com\jwsaas\controller\open\BaiDuLbsController$3.class +com\jwsaas\api\request\store\StoreGoodsRequest.class +com\jwsaas\api\request\wxdc\AdPictureListRequest.class +com\jwsaas\api\request\store\AdjustPriceTicketAuditRequest.class +com\jwsaas\controller\open\TaskController$1.class +com\jwsaas\pay\weixin\request\PayNotifyRequest.class +com\jwsaas\api\service\program\impl\ProgramOrderDispatchServiceImpl.class +com\jwsaas\api\boduo\erp\service\PosToErpDataService.class +com\jwsaas\api\entity\vpos\VposStoreBusinessTicketRefundPartEntity.class +com\jwsaas\api\service\ops\CityInfoService.class +com\jwsaas\api\entity\vpos\VposStoreOrderProductEntity.class +com\jwsaas\weixin\WeixinUtil.class +com\jwsaas\api\entity\pos\PosSetShortcutEntity.class +com\jwsaas\api\entity\vpos\VposStoreBusinessTicketEntity.class +com\jwsaas\api\service\impl\split\SplitServiceImpl.class +com\jwsaas\api\request\program\ProgramStoreDetailRequest.class +com\jwsaas\api\service\cardsync\CardsyncService.class +com\jwsaas\api\boduo\erp\response\PayMoneyTicketResponse.class +com\jwsaas\api\service\program\impl\ProgramProductSpecServiceImpl.class +com\jwsaas\util\Md5Hash.class +com\jwsaas\api\request\storage\StoreStockCheckSummaryRequest.class +com\jwsaas\api\request\weixin\WaiMaiOrderStatisticsRequest.class +com\jwsaas\api\request\vpos\VposProductTypeRequest.class +com\jwsaas\http\HttpTool.class +com\jwsaas\properties\SaoBeiPayProperties.class +com\jwsaas\api\entity\program\ProgramStoreBusinessTicketEntity.class +com\jwsaas\api\request\program\ProgramOrderQueryByTlBusNoRequest.class +com\jwsaas\api\service\split\SplitLogService.class +com\jwsaas\api\request\storage\StoreStockCheckProductValidRequest.class +com\jwsaas\api\request\store\StoreInfoRequest.class +com\jwsaas\api\request\upload\BusinessHandoverUploadRequest.class +com\jwsaas\utils\AppKeyUtil.class +com\jwsaas\api\entity\visitor\VisitorTagEntity.class +com\jwsaas\pay\weixin\response\UnifiedOrderResponse.class +com\jwsaas\api\request\storage\StoreCostTicketUpdateRequest.class +com\jwsaas\api\request\program\ProgramEvaluateUploadRequest.class +com\jwsaas\util\DateUtils.class +com\jwsaas\api\service\impl\upload\UploadExtendServiceImpl.class +com\jwsaas\api\request\program\ProgramUserAddressListRequest.class +com\jwsaas\reactor\event\ProgramPromotionTaskEvents.class +com\jwsaas\api\boduo\erp\request\V1PosDishToV2Request.class +com\jwsaas\api\request\jwygj\YgjWorkerModuleRequest.class +com\jwsaas\api\request\cardsync\StoreTypeRequest.class +com\jwsaas\api\request\vpos\VposOrderListRequest.class +com\jwsaas\api\service\impl\intelligence\IntelligenceGoodsServiceImpl.class +com\jwsaas\api\request\product\ProductMakeDetailRequest.class +com\jwsaas\controller\open\TaskController$4.class +com\jwsaas\api\request\store\StoreAccountEnchashmentInfoRequest.class +com\jwsaas\api\service\impl\store\StoreRechargeServiceImpl$1.class +com\jwsaas\api\request\storage\AskGoodsTemplateEditRequest.class +com\jwsaas\api\request\storage\StoreProductStockOutSummaryRequest.class +com\jwsaas\api\boduo\erp\service\impl\StoreAskMaterialSyncServiceImpl.class +com\jwsaas\utils\AppAuthUtil.class +com\jwsaas\api\service\impl\pos\PosServiceImpl.class +com\jwsaas\util\open\BaseCardApiUtils.class +com\jwsaas\api\service\impl\store\StoreAdjustPriceServiceImpl$4.class +com\jwsaas\api\request\common\SessionGetRequest.class +com\jwsaas\api\service\split\SplitSaleService.class +com\jwsaas\api\request\product\MakeBurdenRequest.class +com\jwsaas\cache\CacheUtil.class +com\jwsaas\api\service\impl\store\ProgramBusinessTicketServiceImpl.class +com\jwsaas\api\service\common\SessionService.class +com\jwsaas\api\request\program\ProgramStoreOpenRequest.class +com\jwsaas\api\service\program\impl\ProgramProductServiceImpl.class +com\jwsaas\api\request\program\ProgramOrderRefundRejectRequest.class +com\jwsaas\api\service\vpos\impl\VposProductServiceImpl$3.class +com\jwsaas\api\entity\wxdc\SalesOrderPayEntity.class +com\jwsaas\mqtt\MqttClientExt.class +com\jwsaas\reactor\event\WxdcOrderEvents.class +com\jwsaas\api\request\store\StoreAccountEnchashmentCancelRequest.class +com\jwsaas\api\request\wxdc\GoodsSellOutRequest.class +com\jwsaas\api\request\storage\AskGoodsTicketRequest.class +com\jwsaas\api\request\weixin\OrderSummaryListRequest.class +com\jwsaas\quartz\SchedulerTack.class +com\jwsaas\controller\open\MqttController.class +com\jwsaas\controller\open\BaiDuLbsController$11.class +com\jwsaas\reactor\event\ZgcxEvents.class +com\jwsaas\api\service\impl\pos\PosSaleClearServiceImpl.class +com\jwsaas\util\DigestUtils.class +com\jwsaas\api\service\impl\product\ProductServiceImpl.class +com\jwsaas\open\converter\DateConverter.class +com\jwsaas\api\request\store\StoreAccountRechargeWeixinPayUnifiedorderRequest.class +com\jwsaas\api\entity\wxdc\SalesOrderItemEntity.class +com\jwsaas\api\entity\upload\StoreHandoverDetailEntity.class +com\jwsaas\api\request\wxdc\GoodsMakeListRequest.class +com\jwsaas\api\entity\upload\StorePayExtendEntity.class +com\jwsaas\api\service\impl\store\StoreRechargeServiceImpl.class +com\jwsaas\util\TaskSignUtil.class +com\jwsaas\api\service\liteappdc\impl\LiteAppdcServiceImpl.class +com\jwsaas\api\request\jwygj\YgjEditProductRequest.class +com\jwsaas\api\entity\pos\PosSetConfigEntity.class +com\jwsaas\api\request\wxdc\SalesOrderListRequest.class +com\jwsaas\api\service\program\impl\ProgramOrderServiceImpl$8.class +com\jwsaas\api\service\weixin\WeiXinService.class +com\jwsaas\api\request\store\StoreAdvertCaptionRequest.class +com\jwsaas\api\request\kit\KitProductRequest.class +com\jwsaas\api\boduo\erp\request\CreateDispatchTicketRequest.class +com\jwsaas\api\request\peripheral\PrinterInfoRequest.class +com\jwsaas\api\service\liteappdc\impl\LiteAppdcServiceImpl$1.class +com\jwsaas\api\request\wxdc\SalesOrderInfoRequest.class +com\jwsaas\api\service\program\ProgramOrderDispatchService.class +com\jwsaas\api\service\pos\PosSaleClearService.class +com\jwsaas\api\request\program\ProgramUserAddressCreateRequest.class +com\jwsaas\api\request\store\SalesOrderSummaryRequest.class +com\jwsaas\api\service\program\impl\ProgramOrderServiceImpl$7.class +com\jwsaas\api\request\program\ProgramListOrderRequest.class +com\jwsaas\api\request\storage\AskGoodsTemplateAddRequest.class +com\jwsaas\util\Assert.class +com\jwsaas\api\qimai\service\impl\QiMaiBaseServiceImpl.class +com\jwsaas\pay\weixin\utils\SecurityUtils.class +com\jwsaas\weixin\bean\TemplateMessage.class +com\jwsaas\controller\open\BaiDuLbsController$9.class +com\jwsaas\properties\BaiduhProperties.class +com\jwsaas\api\request\weixin\VposSalesSummaryRequest.class +com\jwsaas\api\entity\pos\MaterialTypeEntity.class +com\jwsaas\util\AES.class +com\jwsaas\api\request\jwygj\YgjAddSuitRequest.class +com\jwsaas\api\request\storage\StoreStorageTicketStatusChangeRequest.class +com\jwsaas\api\service\program\impl\ProgramOrderServiceImpl$2.class +com\jwsaas\properties\WxyhProperties.class +com\jwsaas\tonglian\TlSignUtils.class +com\jwsaas\api\request\store\StoreAccountDetailInfoRequest2.class +com\jwsaas\api\entity\upload\StoreBusinessTicketTableEntity.class +com\jwsaas\controller\open\ApiExtendController$4.class +com\jwsaas\api\service\impl\store\StoreServiceImpl$3.class +com\jwsaas\api\entity\storage\StoreStorageTicketDetailEntity.class +com\jwsaas\api\request\vpos\VposOrderEditRequest.class +com\jwsaas\api\request\store\StoreShelfRequest.class +com\jwsaas\api\request\storage\StoreCostTicketSalesInfoRequest.class +com\jwsaas\api\request\wxdc\StoreInfoRequest.class +com\jwsaas\api\request\pay\PaymentParameterRequest.class +com\jwsaas\api\request\upload\BusinessOrderUploadExtendRequest.class +com\jwsaas\api\entity\program\ProgramStorePayEntity.class +com\jwsaas\api\service\impl\store\StoreServiceImpl$2.class +com\jwsaas\api\request\store\StorePrintImageRequest.class +com\jwsaas\api\entity\vpos\VposStoreBusinessTicketInfoEntity.class +com\jwsaas\api\request\pos\PosSetPlanDownRequest.class +com\jwsaas\api\entity\upload\StoreOrderProductInfoEntity.class +com\jwsaas\api\request\program\ProgramUserAddressUpdateRequest.class +com\jwsaas\http\HTTPRequest.class +com\jwsaas\api\request\pos\PosSetPlanRequest.class +com\jwsaas\api\request\product\ProductUnitRequest.class +com\jwsaas\http\callbacks\HTTPStringCallback.class +com\jwsaas\api\service\impl\store\StoreServiceImpl$8.class +com\jwsaas\api\service\cost\CostTicketTemplateService.class +com\jwsaas\api\request\store\AdjustPriceTicketEditRequest.class +com\jwsaas\api\request\store\StoreAccountDetailListRequest.class +com\jwsaas\api\request\storage\AskGoodsTemplateListRequest.class +com\jwsaas\api\entity\vpos\VposStoreOrderProductInfoEntity.class +com\jwsaas\util\KeyIdUtil.class +com\jwsaas\api\request\program\ProgramOrderRefundAgreeRequest.class +com\jwsaas\api\request\vpos\VposOrderCancelRequest.class +com\jwsaas\api\request\storage\AskGoodsDetailRemoveRequest.class +com\jwsaas\api\entity\upload\StoreHandoverEntity.class +com\jwsaas\api\request\vpos\VposProductEvaluateLevelViewRequest.class +com\jwsaas\api\service\impl\store\StoreServiceImpl$7.class +com\jwsaas\api\qimai\service\impl\QiMaiProductTypeServiceImpl.class +com\jwsaas\api\request\program\ProgramOrderHandlePeriodRequest.class +com\jwsaas\api\service\impl\kms\KmsServiceImpl.class +com\jwsaas\util\URLEncodedUtil.class +com\jwsaas\api\request\weixin\TimeSummaryListRequest.class +com\jwsaas\controller\open\ApiExtendController$5.class +com\jwsaas\api\service\impl\common\CommonServiceImpl.class +com\jwsaas\api\request\wxdc\GoodsSellInRequest.class +com\jwsaas\util\EncryptedDataUtils.class +com\jwsaas\api\response\common\SessionGetResponse.class +com\jwsaas\api\request\store\StorePayModeRequest.class +com\jwsaas\api\service\impl\pos\ErpPosServiceImpl$1.class +com\jwsaas\util\XStreamUtils.class +com\jwsaas\api\request\store\StoretableTypeRequest.class +com\jwsaas\api\request\storage\StoreProductStockSumRequest.class +com\jwsaas\api\entity\upload\StoreBusinessOrderBurdenEntity.class +com\jwsaas\api\request\storage\StoreProductStockRequest.class +com\jwsaas\api\boduo\erp\request\StoreAskMaterialSyncRequest.class +com\jwsaas\api\entity\storage\AskGoodsTicketEntity.class +com\jwsaas\api\service\worker\WorkerService.class +com\jwsaas\reactor\event\ProgramOrderSaobeiUploadEvents$1.class +com\jwsaas\api\service\program\impl\ProgramOrderServiceImpl$3.class +com\jwsaas\api\entity\storage\StoreStockCheckTicketDetailEntity.class +com\jwsaas\util\SybUtil.class +com\jwsaas\api\boduo\erp\request\ErpProductRatioRequest.class +com\jwsaas\api\service\impl\store\StoreInfoServiceImpl.class +com\jwsaas\api\service\storage\StoreCostTicketService.class +com\jwsaas\tonglian\ReturnMsg.class +com\jwsaas\api\request\wxdc\StoreRefuseRefundRequest.class +com\jwsaas\config\MQMessageSender.class +com\jwsaas\api\request\waimai\OrderStatisticsRequest.class +com\jwsaas\api\service\impl\store\StoreServiceImpl.class +com\jwsaas\controller\open\TaskController.class +com\jwsaas\api\boduo\erp\response\AskTicketMoneyListResponse.class +com\jwsaas\api\request\vpos\VposProductEvaluateViewRequest.class +com\jwsaas\api\request\liteappdc\LiteAppWxdcSalesPayDataRequest.class +com\jwsaas\api\request\product\ProductSuitDetailRequest.class +com\jwsaas\api\request\wxdc\GoodsInfoZCRequest.class +com\jwsaas\api\boduo\erp\service\MaterialDetailService.class +com\jwsaas\api\request\weixin\ProductSalesSummaryRequest.class +com\jwsaas\api\service\ErpBaseService.class +com\jwsaas\api\request\cardsync\ProductListRequest.class +com\jwsaas\reactor\event\DispatchTicketCreateByAutoEvents.class +com\jwsaas\api\request\product\ProductBrandRequest.class +com\jwsaas\api\service\visitor\impl\VisitorServiceImpl.class +com\jwsaas\api\service\impl\storage\StoreStockCheckServiceImpl$1.class +com\jwsaas\api\request\store\StoreAccountRechargeWeixinPayOrderQueryRequest.class +com\jwsaas\api\service\impl\store\CouponServiceImpl.class +com\jwsaas\api\service\impl\storage\StoreCostTicketServiceImpl.class +com\jwsaas\api\request\store\StoreAccountRechargeWeixinPayOrderQueryRequest2.class +com\jwsaas\api\request\program\ProgramProductStockRequest.class +com\jwsaas\reactor\event\ProgramOrderSaobeiUploadEvents$2.class +com\jwsaas\config\RabbitMQConfig.class +com\jwsaas\api\entity\vpos\VposStorePayRefundPartEntity.class +com\jwsaas\api\request\pos\PosRegisterV1ToV2Request.class +com\jwsaas\util\HexUtils.class +com\jwsaas\api\boduo\erp\request\ErpStoreAskMaterialRequest.class +com\jwsaas\controller\callback\CandaoDispatchCallBackController.class +com\jwsaas\tonglian\TlRegister.class +com\jwsaas\api\service\ccb\impl\CcbPayServiceImpl.class +com\jwsaas\api\service\program\impl\ProgramOrderServiceImpl.class +com\jwsaas\api\boduo\erp\service\impl\DeliveryModeListServiceImpl.class +com\jwsaas\api\boduo\erp\request\DeliveryModeListRequest.class +com\jwsaas\api\request\program\ProgramOrderEditRequest.class +com\jwsaas\api\request\program\ProgramStoreListSyncRequest.class +com\jwsaas\api\boduo\erp\request\ErpProductRequest.class +com\jwsaas\cache\data\StoreCache.class +com\jwsaas\api\request\vpos\VposOrderDetailRequest.class +com\jwsaas\api\request\upload\BusinessOrderBurdenUploadRequest.class +com\jwsaas\controller\BaseController.class +com\jwsaas\api\entity\upload\StoreOrderProductMakeEntity.class +com\jwsaas\api\request\vpos\VposProductTypeLabelRequest.class +com\jwsaas\api\request\store\StoreBusinessPlanDetailRequest.class +com\jwsaas\controller\open\ApiExtendController$1.class +com\jwsaas\api\entity\storage\StoreCostTicketPayTypeEntity.class +com\jwsaas\api\request\split\SplitFoodAccountRequest.class +com\jwsaas\api\entity\upload\StoreBusinessTicketInfoEntity.class +com\jwsaas\api\request\product\ProductTypeRequest.class +com\jwsaas\api\service\program\impl\ProgramOrderServiceImpl$4.class +com\jwsaas\api\request\storage\StoreStorageRequest.class +com\jwsaas\reactor\event\WxdcOrderPayEvents$1.class +com\jwsaas\api\request\vpos\VposWindowsCcbfzInfosRequest.class +com\jwsaas\api\service\program\impl\ProgramOrderServiceImpl$14.class +com\jwsaas\api\request\storage\StoreStorageOutTicketAddRequest.class +com\jwsaas\api\response\mode\CommonPagerResponse.class +com\jwsaas\reactor\event\BaseEvents.class +com\jwsaas\api\entity\program\ProgramStoreOrderProductMakeEntity.class +com\jwsaas\api\request\AbstractRequest.class +com\jwsaas\api\request\storage\StoreStockUnCheckTicketDetailRequest.class +com\jwsaas\api\service\impl\pay\PayServiceImpl.class +com\jwsaas\api\service\impl\store\StoreServiceImpl$1.class +com\jwsaas\api\response\mode\DataPageResponse.class +com\jwsaas\api\service\product\ProductService.class +com\jwsaas\pay\weixin\request\QueryRefundRequest.class +com\jwsaas\api\request\ops\CityInfoListRequest.class +com\jwsaas\api\request\vpos\VposBarCodePayRequest.class +com\jwsaas\api\request\store\StoreRechargeParameterListRequest.class +com\jwsaas\api\request\store\StoreAccountEnchashmentApplyRequest.class +com\jwsaas\api\service\wxyh\WxyhService.class +com\jwsaas\api\service\spwxdc\impl\SpWxdcServiceImpl.class +com\jwsaas\tonglian\bean\OrderRefund.class +com\jwsaas\api\service\program\impl\ProgramOrderServiceImpl$6.class +com\jwsaas\api\service\wxdc\impl\WxdcZCServiceImpl.class +com\jwsaas\api\service\wxdc\WxdcDistributionService.class +com\jwsaas\api\service\ccb\CcbPayService.class +com\jwsaas\cache\data\ProductRatioCache.class +com\jwsaas\api\entity\upload\StoreBusinessTicketInfoExtendEntity.class +com\jwsaas\api\request\storage\StoreCostTicketUpdateStatusRequest.class +com\jwsaas\api\request\store\StoreAccountRechargeParameterRequest.class +com\jwsaas\api\boduo\erp\service\impl\PosToErpDataServiceImpl.class +com\jwsaas\weixin\TemplateMessageApi.class +com\jwsaas\api\request\store\AdjustPriceDetailRequest.class +com\jwsaas\reactor\event\WxdcOrderEvents$1.class +com\jwsaas\api\request\product\ProductRequest.class +com\jwsaas\util\KeyUtil.class +com\jwsaas\api\boduo\erp\request\AskTicketMoneyListRequest.class +com\jwsaas\api\request\store\StorePayTypeRequest.class +com\jwsaas\scheduling\Monitor.class +com\jwsaas\util\URLDecodedUtil.class +com\jwsaas\api\service\program\impl\ProgramOrderServiceImpl$9.class +com\jwsaas\api\service\storage\StoreStorageTicketService.class +com\jwsaas\api\service\wxdc\impl\WxdcDistributionServiceImpl.class +com\jwsaas\api\request\storage\AskGoodsTemplateDetailRequest.class +com\jwsaas\api\request\kds\KdsPlanRequest.class +com\jwsaas\api\boduo\erp\service\impl\MateriaTypeServiceImpl.class +com\jwsaas\controller\IndexController.class +com\jwsaas\api\request\common\SessionRemoveRequest.class +com\jwsaas\api\request\weixin\DaySummaryByDateRangeRequest.class +com\jwsaas\scheduling\AppAuthSchedule.class +com\jwsaas\api\request\storage\StoreStockCheckTicketAddRequest.class +com\jwsaas\api\entity\storage\AskGoodsTemplateEntity.class +com\jwsaas\api\request\kit\KitPlanRequest.class +com\jwsaas\api\entity\program\ProgramStoreOrderProductInfoEntity.class +com\jwsaas\api\response\CommonResponse.class +com\jwsaas\api\request\wxdc\StoreListByWidRequest.class +com\jwsaas\api\service\impl\storage\StoreDispatchServiceImpl$1.class +com\jwsaas\api\service\kit\KitService.class +com\jwsaas\api\service\liteappdc\impl\LiteAppdcServiceImpl$2.class +com\jwsaas\api\service\wxyh\impl\WxyhServiceImpl.class +com\jwsaas\api\request\vpos\VposProductRequest.class +com\jwsaas\api\service\program\ProgramProductService.class +com\jwsaas\properties\RedisProperties.class +com\jwsaas\api\response\common\SayHelloResponse.class +com\jwsaas\api\entity\upload\StoreOperationLogEntity.class +com\jwsaas\api\request\storage\ProductStockRequest.class +com\jwsaas\api\entity\program\ProgramStoreOrderProductEntity.class +com\jwsaas\api\request\store\StoreDispatchSettlePlanGetRequest.class +com\jwsaas\api\service\store\StoreSalesOrderService.class +com\jwsaas\api\entity\upload\StoreOrderBurdenEntity.class +com\jwsaas\open\listener\DefaultAfterStartedEventListener.class +com\jwsaas\api\boduo\erp\service\impl\MaterialDetailServiceImpl.class +com\jwsaas\api\boduo\erp\request\SyncMaterialRequest.class +com\jwsaas\api\request\program\ProgramOrderDetailRequest.class +com\jwsaas\reactor\event\WxdcOrderRefundEvents.class +com\jwsaas\api\service\impl\store\StoreShelfServiceImpl.class +com\jwsaas\api\service\store\StoreDispatchSettleService.class +com\jwsaas\api\service\impl\store\StoreSalesOrderServiceImpl.class +com\jwsaas\reactor\event\WorkerLoginEvents.class +com\jwsaas\api\request\storage\StoreCostTicketDetailRequest.class +com\jwsaas\api\service\program\SplitStorePayService.class +com\jwsaas\pager\Pager.class +com\jwsaas\api\service\program\ProgramAdvPictureAndEvaluateService.class +com\jwsaas\api\service\wxdc\impl\WxdcServiceImpl.class +com\jwsaas\api\request\store\StoretableAreaRequest.class +com\jwsaas\controller\open\BaiDuLbsController.class +com\jwsaas\api\request\storage\ProductDispatchPriceRequest.class +com\jwsaas\api\request\spwxdc\SpWxdcOrderCreateRequest.class +com\jwsaas\Application.class +com\jwsaas\api\request\pos\PosSetPlanUpRequest.class +com\jwsaas\mqtt\Topic.class +com\jwsaas\api\service\store\StoreShelfService.class +com\jwsaas\api\request\store\StoreAdvertPictureRequest.class +com\jwsaas\servlet\ServletRegister.class +com\jwsaas\api\request\program\ProgramOrderCreateRequest.class +com\jwsaas\api\entity\upload\StoreOrderProductInfoExtendEntity.class +com\jwsaas\api\request\weixin\GrossProfitAnalysisRequest.class +com\jwsaas\pay\weixin\response\QueryOrderResponse.class +com\jwsaas\util\DesUtil.class +com\jwsaas\api\request\pos\PosRegisterRequest.class +com\jwsaas\api\service\waimai\impl\WaiMaiServiceImpl.class +com\jwsaas\util\file\FileToByteArray.class +com\jwsaas\api\service\impl\store\StoreDispatchSettleServiceImpl.class +com\jwsaas\api\service\program\impl\ProgramOrderServiceImpl$13.class +com\jwsaas\api\request\wxdc\SalesOrderCreateRequest.class +com\jwsaas\api\service\jwygj\StoreYgjProductService.class +com\jwsaas\api\service\store\CouponService.class +com\jwsaas\api\service\program\impl\ProgramOrderServiceImpl$10.class +com\jwsaas\api\service\storage\StoreDispatchService.class +com\jwsaas\api\service\store\StoreAdjustPriceService.class +com\jwsaas\api\request\cardsync\StoreWorkerRequest.class +com\jwsaas\api\service\impl\jwygj\StoreYgjProductServiceImpl.class +com\jwsaas\properties\FdfsClientProperties.class +com\jwsaas\api\request\wxdc\StoreOrderDeliveryRequest.class +com\jwsaas\api\entity\wxdc\SalesOrderEntity.class +com\jwsaas\api\service\vpos\VposProductService.class +com\jwsaas\api\request\storage\StoreStockCheckTicketDetailRequest.class +com\jwsaas\api\request\store\StoreAccountDetailInfoRequest.class +com\jwsaas\Global.class +com\jwsaas\task\TaskJobHandler.class +com\jwsaas\api\service\impl\split\SplitSaleServiceImpl.class +com\jwsaas\api\request\program\ProgramOrderPayRequest.class +com\jwsaas\api\service\impl\common\SessionServiceImpl.class +com\jwsaas\api\service\program\ProgramUserService.class +com\jwsaas\api\service\store\StoreService.class +com\jwsaas\freemarker\DefaultTemplateExceptionHandler.class +com\jwsaas\api\service\program\impl\ProgramOrderServiceImpl$11.class +com\jwsaas\api\request\storage\DispatchTicketRequest.class +com\jwsaas\api\service\program\impl\ProgramAdvPictureAndEvaluateServiceImpl.class +com\jwsaas\api\boduo\erp\request\SyncMaterialUnitRequest.class +com\jwsaas\api\request\store\StoreRequest.class +com\jwsaas\util\JSONUtil$1.class +com\jwsaas\api\response\mode\CommonDataResponse.class +com\jwsaas\api\request\weixin\ManagerWorkerModuleRequest.class +com\jwsaas\api\entity\wxdc\SalesOrderItemPromoEntity.class +com\jwsaas\api\service\weixin\impl\WeiXinServiceImpl.class +com\jwsaas\pay\weixin\request\UnifiedOrderRequest.class +com\jwsaas\api\request\store\StoreAccountEnchashmentListRequest.class +com\jwsaas\pay\weixin\response\QueryRefundResponse.class +com\jwsaas\api\service\program\ProgramProductSpecService.class +com\jwsaas\api\service\program\impl\ProgramOrderServiceImpl$12.class +com\jwsaas\api\request\kms\ProductSalesInfoRequest.class diff --git a/food-open/food-open-api/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/food-open/food-open-api/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..85b7661 --- /dev/null +++ b/food-open/food-open-api/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,686 @@ +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\wxdc\SalesOrderEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramStoreListSyncRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\StoreStockCheckTicketRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\tonglian\bean\Reqsn.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\util\DateUtils.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\store\StoreServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\ProductDispatchPriceRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreAccountGetRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\vpos\VposWeixinPayRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\program\ProgramOrderService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\config\RedissonConfiguration.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\response\DeliveryModeListResponse.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\common\SessionGetRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\pos\ErpPosServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\store\CouponService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\request\PayMoneyTicketRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\StoreCostTicketUpdateRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\properties\WxyhProperties.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\weixin\WaiMaiOrderStatisticsRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\upload\StoreHandoverDetailPartEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\cardsync\StorePosRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\storage\StoreStockCheckService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\StoreStorageRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\weixin\GrossProfitAnalysisRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\upload\StorePayEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\response\common\SessionGetResponse.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\pay\weixin\response\UnifiedOrderResponse.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreCouponCheckOutRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\visitor\VisitorAddressListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\product\ProductUnitRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\upload\StoreBusinessTicketExtendEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreAccountRechargeWeixinPayOrderQueryRequest2.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoretableAreaRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\vpos\ProductTypeDetailRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\pos\TenantLineAuthRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreAccountRechargeParameterRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\visitor\VisitorListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\jwygj\StoreYgjWorkerServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\wxdc\impl\WxdcZCServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\wxdc\GoodsSellInRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\wxdc\StoreAgreeRefundRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\jwygj\YgjProductTypeRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\store\StoreAccountService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\weixin\WeixinUtil.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\cardsync\ProductTypeRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\wxdc\DistributionAddressRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\pos\PosSetResourcesEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\Global.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\util\Md5Hash.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\request\MaterialToErpSyncRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\StoreStockCheckTicketDetailRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\wxyh\UpdateWorkerPasswordRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\pos\MaterialInfo.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\wxdc\SalesOrderItemPromoEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\program\AuthAccessToken.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreRechargeParameterListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\StoreCostTicketSalesInfoRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreAccountEnchashmentCancelRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\jwygj\YgjStoreAccountSummaryRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramOrderRefundApplyRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\upload\UploadExtendServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\cardsync\StorePayTypeRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\promotion\PromotionServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\cache\data\ProductRatioCache.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\freemarker\DefaultTemplateExceptionHandler.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\util\URLDecodedUtil.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\AskGoodsDetailRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\scheduling\Monitor.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\util\HexUtils.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\wxyh\WxyhCategoryRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\config\ReactorConfiguration.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\open\security\redis\RedisInvokeTimesController.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\util\file\FileTypeUtils.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreCouponListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\ErpBaseServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\pos\PosSetConfigEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\weixin\DaySummaryByDateRangeRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StorePrintImageRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\service\impl\DeliveryModeListServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\upload\StoreBusinessTicketInfoExtendEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StorePayModeRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\reactor\event\BusinessHandoverEvents.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\AbstractRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\worker\WorkerService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\pos\PosSetShortcutEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\vpos\VposStoreBusinessTicketEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramProductDetailRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\StoreStorageTicketDetailRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\qimai\request\CategoryUpdateRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\store\StoreSalesOrderServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\service\impl\ErpToPosDataServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\visitor\impl\VisitorServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramProductStockRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\pay\weixin\request\QueryRefundRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\common\SessionRemoveRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\vpos\VposProductStockRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\pos\PosSaleClearService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\pos\ServerDataVersionRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\vpos\VposAdPictureRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\split\SplitServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\request\MaterialUnitRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\pos\PosSaleClearServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\storage\StoreCostTicketPayTypeEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\controller\open\ApiExtendController.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\storage\StoreStorageTicketService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\product\ProductImageRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\vpos\VposProductEvaluateLevelViewRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\store\StoreService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\reactor\event\WxdcOrderRefundEvents.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\service\MaterialDetailService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\visitor\VisitorAddressEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\AdjustPriceTicketAddRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\program\impl\ProgramUserServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\weixin\impl\WeiXinServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\service\impl\MateriaTypeServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\AdjustPriceDetailRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\visitor\VisitorService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\StoreStockCheckTemplateListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\StoreStockCheckSummaryRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\vpos\VposProductService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\controller\open\TaskController.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\StoreStockCheckProductValidRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\open\session\redis\RedisSessionBindInterceptor.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\liteappdc\LiteAppdcService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\config\MQMessageSender.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\ProductStockRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\worker\WorkerUpdatePwdRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\promotion\PromotionService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\vpos\VposStoreOrderProductInfoEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\util\StringUtils.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\bean\StoresPrediction.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramOrderHandlePeriodRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\product\ProductTypeRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\AskGoodsTemplateListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\StoreCostTicketUpdateStatusRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\util\JSONException.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\store\StoreRechargeServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\tonglian\TlCommonConstants.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\weixin\bean\TemplateMessage.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\pay\weixin\request\UnifiedOrderRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\upload\BusinessOrderBurdenUploadRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\upload\StoreOrderProductInfoExtendEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\StoreCostTicketSaveRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\product\ProductSuitDetailRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\wxdc\StoreOrderConfirmRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\response\StoreAskMaterialSyncResponse.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreSalesDaySummaryRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\visitor\VisitorEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramWeixinPayRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\response\PayMoneyTicketResponse.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\vpos\VposWindowsCcbfzInfosRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\request\SyncMaterialTypeRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\StoreStockUnCheckTicketDetailRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\reactor\event\WxyhEvents.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\response\MaterialDetailResponse.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreAccountEnchashmentApplyRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\program\ProgramStoreBusinessTicketEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\store\ProgramBusinessTicketServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\http\HttpConstants.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreBaseRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\kit\KitPlanRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\request\ErpStoreAskMaterialRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\kms\KmsServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\open\interceptor\ReservedInterceptor.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\response\AskTicketMoneyListResponse.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\kds\KdsPlanRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\program\impl\ProgramOrderServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\wxdc\StoreOpenStatusUpdateRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\util\URLEncodedUtil.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\properties\TongLianPayProperties.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\weixin\ProductRankRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\request\StoreAskMaterialSyncRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\weixin\AgentStoreRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\response\common\SayHelloResponse.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\util\KeyIdUtil.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\vpos\VposProductRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\weixin\ProductSalesSummaryRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\store\StoreAccountServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\wxdc\GoodsCategoryRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\tonglian\TlSignUtils.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\storage\AskGoodsTicketEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\upload\BusinessRevenueUploadRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\config\RabbitConstant.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\StoreProductStockSumRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\properties\WeiXinProperties.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\util\AES.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramOrderQueryByTlBusNoRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\http\callbacks\HTTPStatusCheckCallback.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\program\ProgramUserService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreAccountRechargeWeixinPayUnifiedorderRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\StoreStorageTicketListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\peripheral\PeripheralServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\reactor\event\ZgcxEvents.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\liteappdc\LiteAppOrderCreateRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\store\StoreRechargeService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\weixin\SignUtil.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\wxdc\GoodsSellOutRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\cardsync\StoreWorkerRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\liteappdc\impl\LiteAppdcServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\config\MqttConfiguration.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\product\ProductBrandRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\product\ProductRatioRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\pay\weixin\response\QueryOrderResponse.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreCouponCheckRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\store\StoreDispatchSettleService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\program\SplitStorePayService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\wxdc\StoreOrderDeliveryRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\cache\data\ProductUnitCache.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\reactor\event\BaseWxdcEvents.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\open\listener\DefaultAfterDoServiceEventListener.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\worker\WorkerLoginRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\storage\StoreStorageOutTicketDetailEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\storage\StoreCostTicketServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\http\HTTPResponseCallback.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\kds\KdsService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\weixin\bean\Token.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\StoreStockCheckTicketDetailDelRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\program\ProgramAdvPictureAndEvaluateService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\pay\weixin\utils\SecurityUtils.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\StoreStorageTicketAddRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\liteappdc\LiteAppSalesOrderCreateRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\split\SplitService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\qimai\service\impl\QiMaiBaseServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\vpos\VposStorePayRefundPartEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\vpos\VposBarCodePayRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\util\JSONUtil.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\AdjustPriceTicketEditRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\open\security\redis\RedisAppSecretManager.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\upload\StoreHandoverDetailEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\util\CardApiUtils.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\http\callbacks\HTTPStringCallback.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\properties\BaiduhProperties.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreShelfRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\request\ErpToPosMaterialSyncRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\storage\StoreStockCheckTicketDetailEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\store\StoreSalesOrderService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\request\AskTicketMoneyListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\upload\StoreOrderProductMakeExtendEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\StoreStockCheckTemplateDetailRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\open\security\redis\RedisServiceAccessController.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\reactor\event\DispatchTicketCreateByAutoEvents.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\storage\StoreCostTicketProductMoreChangeEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\response\mode\CommonErrorCode.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\wxyh\WxyhService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\vpos\VposStorePayEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\worker\WorkerPosRoleRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\program\ProgramStoreOrderProductEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\qimai\service\impl\QiMaiProductTypeServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\storage\StoreStockCheckTicketEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\vpos\VposProductTypeTwoRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\jwygj\StoreYgjProductService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\wxdc\SalesOrderPayEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\vpos\VposOrderListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\visitor\VisitorAddRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\controller\open\MqttController.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreAdvertPictureRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\storage\StoreStorageServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\upload\UploadExtendService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\reactor\event\PosEvents.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\StoreStockCheckTicketAddRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\vpos\VposOrderDetailRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\program\impl\SplitStorePayServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\properties\ZgxcProperties.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\request\MaterialTypeRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\weixin\DaySummaryListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\vpos\VposProductEvaluateViewRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\promotion\StorePromotionTaskRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\program\impl\ProgramOrderDispatchServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreBusinessPlanDetailRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\pay\weixin\api\WeiXinPayApi.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\reactor\event\ProgramOrderSaobeiUploadEvents.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\response\mode\CommonDataResponse.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\upload\BusinessHandoverUploadRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreAccountRechargeRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\common\CommonServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\util\file\FileToByteArray.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\product\ProductSpecRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\vpos\VposOrderRefundPartRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\weixin\TimeSummaryListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\vpos\VposWeixinPayQueryRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\pos\PosSetPlanDownRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\pos\PosService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\upload\UploadService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\product\ProductService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\program\ProgramProductSpecService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\StoreStorageOutTicketStatusChangeRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\weixin\WorkerStoreRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\upload\BusinessLogUploadRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\weixin\PaySummaryListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\program\ProgramStoreOrderProductInfoEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\product\ProductServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\program\ProgramStoreOrderProductMakeEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\storage\StoreStorageOutTicketEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\AskGoodsDetailRemoveRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\upload\UploadServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\upload\StoreBusinessOrderBurdenEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\promotion\PromotionTypeListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoretableTypeRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\properties\SaoBeiPayProperties.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramOrderEditRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\response\mode\CommonListResponse.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramOrderRefundRejectRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\visitor\VisitorTagEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\common\CommonService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\storage\StoreStockCheckServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\wxdc\StoreInfoRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\reactor\event\WxdcOrderPayEvents.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\StoreStorageOutTicketListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\upload\StoreBusinessLogEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\split\SplitSaleServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\service\ErpToPosDataService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\config\OpenApiProperties.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\storage\AskGoodsDetailEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\task\TaskJobHandler.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\StoreProductStockOutSummaryRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\StoreStockUnCheckTicketDetailUpdateRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\liteappdc\LiteAppWxdcSalesPayDataRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\vpos\VposOrderPayRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\cardsync\ProductListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\weixin\DaySummaryListByDateRangeRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\wxdc\StoreListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\waimai\WaiMaiService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\upload\StoreBusinessTicketTableEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\pay\PaymentParameterRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\util\Assert.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\tonglian\TlHttpClient.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\pos\PosSetPlanRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\split\SplitStorePayRequet.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\visitor\VisitorUpdateRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\store\StoreDispatchSettleServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\response\common\SessionCreateResponse.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreGoodsRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\product\StoreMakeDetailRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramAdvPictureRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\common\SessionServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\wxdc\WxdcService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramEvaluateUploadRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\upload\StoreOperationLogEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\pos\PosMonitorRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\product\MakeBurdenRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreSalesDayProductSummaryRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\Application.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\jwygj\YgjStoreSetRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\service\AskGoodsTicketErpService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\pos\PosServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\pay\weixin\response\QueryRefundResponse.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\vpos\impl\VposProductServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\weixin\VposUserSeriesRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\visitor\VisitorInfoRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\properties\ApplicationProperties.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\wxdc\SalesOrderInfoRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\ccb\CcbPayService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\store\StoreAdjustPriceService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\reactor\event\ProgramPromotionTaskEvents.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\request\ErpProductRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\jwygj\YgjAddSuitRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\reactor\event\BaseEvents.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\storage\StoreDispatchServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\wxdc\impl\WxdcServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\AskGoodsTemplateDetailRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\weixin\CategorySummaryListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\pos\PosRegisterV1ToV2Request.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\StoreStorageOutTicketAddRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\split\SplitLogServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\kds\KdsServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\request\CreateDispatchTicketRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\reactor\event\StoreAccountEvents.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\util\KeyUtil.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\util\ReflectionUtils.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreDispatchSettlePlanGetRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\wxdc\GoodsInfoRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\store\StoreShelfServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\product\StoreMakeTypeRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\service\StoreAskMaterialSyncService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\storage\AskGoodsTemplateDetailEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\controller\callback\CallBackController.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\common\SayHelloRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\intelligence\IntelligenceGoodsServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\wxdc\StorePayParameterRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\controller\open\BaseOpenController.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\program\ProgramStoreBusinessTicketSycnEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\mqtt\PushCallback.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\wxdc\SalesOrderListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\StoreProductStockRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\storage\StoreDispatchService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\StoreStorageTicketStatusChangeRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\open\listener\DefaultAfterStartedEventListener.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\utils\HashidsUtil.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\weixin\DaySummaryRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\ops\CityInfoService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\AskGoodsTicketStatusRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\StoreStorageOutTicketDetailRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreProductCouponListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\wxdc\GoodsCategoryListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\upload\StoreHandoverDetailPayEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreAccountDetailInfoRequest2.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\wxdc\GoodsMakeListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreSalesOrderListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\program\impl\ProgramProductSpecServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\request\ErpProductSpecRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\ops\CityInfoServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreInfoRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\ErpBaseService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramOrderCreateSyncRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramOrderCancelRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\util\Pinyin4jUtil.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\util\DesUtil.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\AskGoodsTemplateAddRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\common\SessionService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\product\ProductSuitRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramUserAddressCreateRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\liteappdc\LiteAppWxdcSalesOrderCreateRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\program\ProgramOrderDispatchService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\upload\StoreHandoverEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\program\ProgramStorePayEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\AdjustPriceTicketAuditRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoretableRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreMessageRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\wxdc\GoodsListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\kit\KitProductRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\cardsync\CardsyncServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\upload\StoreOrderProductEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\wxdc\SalesOrderCancelRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\split\SplitFoodAccountRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\spwxdc\SpWxdcOrderCreateRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\split\SplitSaleService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramOrderPayRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\vpos\VposProductTypeLabelRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\upload\StoreBusinessTicketInfoEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramOrderDetailRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\spwxdc\SpWxdcService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\mqtt\Topic.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\controller\open\BaiDuLbsController.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\vpos\VposStoreBusinessTicketInfoEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\service\impl\PosToErpDataServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\store\StoreAdjustPriceServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\response\CommonResponse.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\cache\data\CacheData.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\vpos\VposOrderRefundRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\cardsync\StoreTypeRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\response\MaterialTypeResponse.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\pos\ErpPosSetRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\util\EncryptedDataUtils.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\BrandRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\bean\AppKeyInfo.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\pos\PosSetPlanUpRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\SalesOrderSummaryRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\kit\KitServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\pos\PosSetModuleEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\WopServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\jwygj\YgjAddProductRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\reactor\event\ServerDataVersionUpdateEvents.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\storage\AskGoodsTemplateEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramUserAddressDeleteRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramUserAddressListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\visitor\VisitorTagListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\quartz\SchedulerTack.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\utils\AppAuthUtil.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreAdvertCaptionRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\pos\MaterialEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\vpos\VposProductEvaluateUploadRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\upload\StoreBusinessTicketDeliveryEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\kms\KmsService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\program\ProgramStoreBusinessTicketDeliverEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\split\SplitShopAccountRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramEvaluateDownloadRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\upload\StoreCostRevenueEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramOrderConfirmRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\storage\StoreStorageTicketDetailEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\vpos\VposStoreOrderProductMakeRefundPartEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\weixin\VposSalesSummaryRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\program\impl\ProgramAdvPictureAndEvaluateServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\storage\StoreCostTicketProductTypeEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\AdjustPriceTicketRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\AskGoodsTicketAddRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\weixin\OrderSummaryListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\request\ErpProductRatioRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\upload\BusinessOrderUploadExtendRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\store\StoreInfoServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\kit\KitService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\storage\StoreStorageTicketEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\controller\BaseController.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\worker\WorkerPosModuleRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\product\ProductRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\cache\CacheUtil.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\http\HttpTool.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreAccountDetailInfoRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\wxyh\WxyhGoodsRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\program\ProgramStoreBusinessTicketInfoEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\jwygj\YgjWorkerModuleRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\wxdc\UserApplyRefundRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\util\DigestUtils.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\reactor\event\SalesOrderEvents.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\pos\PosAuthRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\service\impl\StoreAskMaterialSyncServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\storage\StoreStorageService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\cache\data\ProgramProductInfoCache.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\reactor\event\ProgramOrderEvents.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\vpos\VposStoreOrderProductMakeEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\service\MaterialUnitService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\response\MaterialUnitResponse.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\servlet\ServletRegister.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\vpos\VposStoreOrderProductRefundPartEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\cardsync\CardsyncService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\service\DeliveryModeListService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\WopService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\request\V1PosDishToV2Request.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\store\StoreInfoService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\split\SplitLogService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\Constant.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\service\V1PosToV2PosDataService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\request\SyncMaterialUnitRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\service\MaterialTypeService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\cost\CostTicketTemplateService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\wxdc\WxdcZCService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\upload\BusinessOrderUploadRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\DispatchTicketRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\upload\StoreBusinessTicketEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\worker\WorkerServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\peripheral\PrinterInfoRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\service\impl\AskGoodsTicketErpServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\storage\StoreCostTicketEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramProductSaleStatusRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\pay\weixin\response\PayNotifyResponse.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\request\MaterialDetailRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\pay\PayServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\open\converter\DateConverter.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\tonglian\TlHttpUtils.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\util\open\BaseApiUtils.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\vpos\VposStoreBusinessTicketRefundPartEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\reactor\event\EventKeys.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\tonglian\TlRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\response\mode\DataPageResponse.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\wxdc\SalesOrderCreateRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\config\SchedulingConfiguration.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\wxdc\StoreOrderCancelRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\jwygj\ProductSpecInfoEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\jwygj\StoreYgjWorkerService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\AskGoodsTicketEditRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramStoreDetailRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\util\RandomUtil.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\intelligence\IntelligenceGoodsService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\store\StoreShelfService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\properties\RedisProperties.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\util\file\FileUtils.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\http\callbacks\HTTPByteCallback.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StorePayTypeRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\util\XStreamUtils.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\AskGoodsTicketRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\StoreStockUnCheckTicketStatusUpdateRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\vpos\VposOrderCreateRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\ops\CityInfoListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\wxdc\GoodsInfoZCRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\pos\PosRegisterRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\wxdc\ZCGoodsCategoryListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StorePosListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\weixin\WeiXinService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\kds\KdsProductRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\pay\weixin\request\RefundRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\common\SessionCreateRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\DispatchTicketReceiveRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramOrderListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\AskGoodsTemplateEditRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\program\ProgramStoreService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\controller\callback\CandaoDispatchCallBackController.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\properties\CandaoProperties.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\pay\weixin\request\QueryOrderRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\StoreCostTicketRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreFeeItemListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\reactor\event\WxdcOrderEvents.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\pos\MaterialTypeEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\storage\StoreCostTicketService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\util\CronUtil.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramStoreOpenRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\store\ProgramBusinessTicketService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\pay\weixin\request\PayNotifyRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\ccb\CcbParamGetRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\weixin\SalesDailyByDateRangeRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\storage\StoreStorageTicketServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\upload\StoreOrderProductExtendEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\waimai\OrderStatisticsRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\response\mode\CommonPagerResponse.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\tonglian\ReturnMsg.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramStoreListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\config\RabbitMQConfig.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\pager\Pager.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramProductRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramWeixinPayQueryRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\vpos\VposProductTypeRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\product\ProductMakeDetailRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\util\RandomUtils.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\StoreCostTicketDetailRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\program\impl\ProgramStoreServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramUserWeixinFormIdRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreAccountDetailListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\tonglian\bean\AgentCollectApply.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\utils\AppKeyUtil.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\wxdc\WeixinPayUnifiedorderRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\service\impl\V1PosToV2PosDataServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\utils\RedisKeyUtil.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\http\HTTPRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\peripheral\CardReaderInfoRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\cardsync\StoreMessageRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\costlimit\CostTicketTemplateRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\controller\IndexController.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\jwygj\YgjAddProductCheckRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\pos\ErpPosService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\request\DeliveryModeListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\upload\StoreOrderBurdenEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\service\impl\MaterialDetailServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramOrderHandleRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\StoreStorageTicketTypeRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\jwygj\StoreYgjProductServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\program\ProgramProductService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\cache\data\StoreCache.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\request\SyncMaterialRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\service\PosToErpDataService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreAccountEnchashmentInfoRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\wxdc\WxdcDistributionService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\upload\StoreOrderProductInfoEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\pay\weixin\response\RefundResponse.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\wxdc\SalesOrderItemEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\worker\WorkerListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\upload\StoreOrderProductMakeEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\StoreStorageTicketEditRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\util\SybUtil.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\vpos\VposStoreOrderProductEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramUserAddressUpdateRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramOrderRefundAgreeRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\service\impl\MateriaUnitServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\wxdc\AdPictureListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\wxdc\SalesOrderItemMakeEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramOrderQueryByBusNoRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\product\ProductBurdenRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\wxdc\StoreOrderListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\StoreStorageOutTicketEditRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\program\impl\ProgramProductServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramListOrderRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\waimai\impl\WaiMaiServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\open\session\redis\RedisSessionManager.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\spwxdc\impl\SpWxdcServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\storage\StoreCostTicketProductChangeEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\weixin\ManagerWorkerModuleRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\boduo\erp\request\DishToErpSyncRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\mqtt\MqttClientExt.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramStoreStopRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreAccountEnchashmentListRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\vpos\VposOrderCancelRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\wxdc\impl\WxdcDistributionServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\wxdc\DistributionRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\reactor\event\WorkerLoginEvents.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreBusinessPlanRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\peripheral\PeripheralService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\wxdc\StoreListByWidRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\task\utils\TaskOpenUtils.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\tonglian\bean\OrderRefund.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\util\HttpUtils.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\qimai\service\QiMaiProductTypeService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\pos\MaterialUnitEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\config\OpenCardApiProperties.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\jwygj\YgjEditProductRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\store\StoreAccountRechargeWeixinPayOrderQueryRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\wxyh\impl\WxyhServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\properties\FdfsClientProperties.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\upload\StorePayExtendEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\weixin\TemplateMessageApi.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\config\ExpirationMessagePostProcessor.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\tonglian\TlRegister.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\program\ProgramOrderCreateRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\storage\StoreCostTicketProductOtherChangeEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\wxdc\StoreRefuseRefundRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\reactor\event\PromotionTaskEvents.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\entity\storage\StoreCostTicketProductFixedChangeEntity.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\pay\PayService.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\util\open\BaseCardApiUtils.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\kms\ProductSalesInfoRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\storage\DispatchTicketDetailRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\scheduling\AppAuthSchedule.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\request\vpos\VposOrderEditRequest.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\impl\store\CouponServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\cost\impl\CostTicketTemplateServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\util\TaskSignUtil.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\api\service\ccb\impl\CcbPayServiceImpl.java +E:\food\food\food-open\food-open-api\src\main\java\com\jwsaas\util\HmacSHA1Utils.java diff --git a/food-open/food-open-api/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/food-open/food-open-api/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst new file mode 100644 index 0000000..e69de29 diff --git a/food-open/food-open-web/.classpath b/food-open/food-open-web/.classpath new file mode 100644 index 0000000..a5d9509 --- /dev/null +++ b/food-open/food-open-web/.classpath @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/food-open/food-open-web/.project b/food-open/food-open-web/.project new file mode 100644 index 0000000..d94dd25 --- /dev/null +++ b/food-open/food-open-web/.project @@ -0,0 +1,23 @@ + + + food-open-web + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/food-open/food-open-web/.settings/org.eclipse.core.resources.prefs b/food-open/food-open-web/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..839d647 --- /dev/null +++ b/food-open/food-open-web/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,5 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/main/resources=UTF-8 +encoding//src/test/java=UTF-8 +encoding/=UTF-8 diff --git a/food-open/food-open-web/.settings/org.eclipse.jdt.core.prefs b/food-open/food-open-web/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..2f5cc74 --- /dev/null +++ b/food-open/food-open-web/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/food-open/food-open-web/.settings/org.eclipse.m2e.core.prefs b/food-open/food-open-web/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..f897a7f --- /dev/null +++ b/food-open/food-open-web/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/food-open/food-open-web/assembly.xml b/food-open/food-open-web/assembly.xml new file mode 100644 index 0000000..a87a265 --- /dev/null +++ b/food-open/food-open-web/assembly.xml @@ -0,0 +1,49 @@ + + + package + + dir + zip + + true + + + src/main/bin + bin + + + src/main/resources + conf + + application.properties + logback.xml + + + + src/main/conf + conf + + + src/main/logs + logs + + + src/main/lib + lib + + + src/main/temp + temp + + + + + ${project.build.directory}/${artifactId}-${version}.jar + lib + ${artifactId}-${version}.jar + + + \ No newline at end of file diff --git a/food-open/food-open-web/food-open-web.iml b/food-open/food-open-web/food-open-web.iml new file mode 100644 index 0000000..e0747e6 --- /dev/null +++ b/food-open/food-open-web/food-open-web.iml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-web/pom.xml b/food-open/food-open-web/pom.xml new file mode 100644 index 0000000..a99c8c3 --- /dev/null +++ b/food-open/food-open-web/pom.xml @@ -0,0 +1,93 @@ + + + 4.0.0 + + com.jwsaas + food-open + 2.0.0 + + food-open-web + + food-open-web + http://maven.apache.org + + + UTF-8 + 1.5.8.RELEASE + + + + + + org.springframework.boot + spring-boot-dependencies + ${spring.boot.version} + pom + import + + + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-freemarker + + + org.apache.commons + commons-lang3 + + + + + + + org.springframework.boot + spring-boot-maven-plugin + 2.5.6 + + + + repackage + + + + + + maven-assembly-plugin + + false + + assembly.xml + + + + + make-assembly + package + + single + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + application.properties + logback.xml + + + + + + + diff --git a/food-open/food-open-web/src/main/bin/install.bat b/food-open/food-open-web/src/main/bin/install.bat new file mode 100644 index 0000000..046a68c --- /dev/null +++ b/food-open/food-open-web/src/main/bin/install.bat @@ -0,0 +1,140 @@ +@echo off +setlocal + +rem +rem Copyright (c) 1999, 2016 Tanuki Software, Ltd. +rem http://www.tanukisoftware.com +rem All rights reserved. +rem +rem This software is the proprietary information of Tanuki Software. +rem You shall use it only in accordance with the terms of the +rem license agreement you entered into with Tanuki Software. +rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html +rem +rem Java Service Wrapper general passthrough startup script. +rem + +rem ----------------------------------------------------------------------------- +rem These settings can be modified to fit the needs of your application +rem Optimized for use with version 3.5.28 of the Wrapper. + +rem The base name for the Wrapper binary. +set _WRAPPER_BASE=wrapper + +rem The directory where the Wrapper binary (.exe) file is located. It can be +rem either an absolute or a relative path. If the path contains any special +rem characters, please make sure to quote the variable. +set _WRAPPER_DIR= + +rem The name and location of the Wrapper configuration file. This will be used +rem if the user does not specify a configuration file as the first parameter to +rem this script. +set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf" + +rem Makes it possible to override the Wrapper configuration file by specifying it +rem as the first parameter. +rem set _WRAPPER_CONF_OVERRIDE=true + +rem _PASS_THROUGH tells the script to pass all parameters through to the JVM +rem as is. +rem If _WRAPPER_CONF_OVERRIDE is specified then all parameters will be passed. +rem If not set then all parameters starting with the second will be passed. +set _PASS_THROUGH=true + +rem Do not modify anything beyond this point +rem ----------------------------------------------------------------------------- + +rem +rem Resolve the real path of the wrapper.exe +rem For non NT systems, the _REALPATH and _WRAPPER_CONF values +rem can be hard-coded below and the following test removed. +rem +if "%OS%"=="Windows_NT" goto nt +echo This script only works with NT-based versions of Windows. +goto :eof + +:nt +rem Find the application home. +rem if no path path specified do the default action +IF not DEFINED _WRAPPER_DIR goto dir_undefined +set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%" +if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\" +rem check if absolute path +if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path +if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path +rem everythig else means relative path +set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%" +goto pathfound + +:dir_undefined +rem Use a relative path to the wrapper %~dp0 is location of current script under NT +set _REALPATH="%~dp0" +goto pathfound +:absolute_path +rem Use an absolute path to the wrapper +set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%" + +:pathfound +rem +rem Decide on the specific Wrapper binary to use (See delta-pack) +rem +if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe" +goto search +:amd64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe" +goto search +:ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe" +goto search +:search +set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%" +if exist %_WRAPPER_EXE% goto conf +set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe" +if exist %_WRAPPER_EXE% goto conf +echo Unable to locate a Wrapper executable using any of the following names: +echo %_WRAPPER_L_EXE% +echo %_WRAPPER_EXE% +pause +goto :eof + +rem +rem Find the wrapper.conf +rem +:conf +if [%_WRAPPER_CONF_OVERRIDE%]==[true] ( + set _WRAPPER_CONF="%~f1" + if not [%_WRAPPER_CONF%]==[""] ( + shift + goto :startup + ) +) +set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%" + +rem +rem Start the Wrapper +rem +:startup +if not [%_PASS_THROUGH%]==[true] ( + if not [%1]==[] ( + echo WARNING: Extra arguments will be ignored. Please check usage in the batch file. + ) +) + +rem Collect the application parameters +:parameters +set _PARAMETERS=%_PARAMETERS% %1 +shift +if not [%1]==[] goto :parameters + +if not [%_PASS_THROUGH%]==[true] ( + %_WRAPPER_EXE% -i %_WRAPPER_CONF% +) else ( + %_WRAPPER_EXE% -i %_WRAPPER_CONF% -- %_PARAMETERS% +) +if not errorlevel 1 goto :eof +pause + + diff --git a/food-open/food-open-web/src/main/bin/middleware b/food-open/food-open-web/src/main/bin/middleware new file mode 100644 index 0000000..2f9fce5 --- /dev/null +++ b/food-open/food-open-web/src/main/bin/middleware @@ -0,0 +1,2162 @@ +#! /bin/sh + +# +# Copyright (c) 1999, 2016 Tanuki Software, Ltd. +# http://www.tanukisoftware.com +# All rights reserved. +# +# This software is the proprietary information of Tanuki Software. +# You shall use it only in accordance with the terms of the +# license agreement you entered into with Tanuki Software. +# http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html +# +# Java Service Wrapper sh script. Suitable for starting and stopping +# wrapped Java applications on UNIX platforms. +# + +#----------------------------------------------------------------------------- +# These settings can be modified to fit the needs of your application +# Optimized for use with version 3.5.28 of the Wrapper. + +#******************************************************************** +# NOTE - This script has been modified to run the TestWrapper sample +# application and should NOT be used as a base for your own +# applications. All of the documentation assumes that you are +# working from the default source script: +# WRAPPER_HOME/src/bin/sh.script.in +#******************************************************************** + +# IMPORTANT - Please always stop and uninstall an application before making +# any changes to this file. Failure to do so could remove the +# script's ability to control the application. + +# Initialization block for the install_initd and remove_initd scripts used by +# SUSE linux, CentOS and RHEL distributions. +# Note: From CentOS 6, make sure the BEGIN INIT INFO section is before any line +# of code otherwise the service won't be displayed in the Service +# Configuration GUI. +### BEGIN INIT INFO +# Provides: wrapper +# Required-Start: $local_fs $network $syslog +# Should-Start: +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Wrapper Sample Application +# Description: Wrapper Sample Application Description +### END INIT INFO + +# Application +APP_NAME="Food-2.0 Open Web" +APP_LONG_NAME="Food-2.0 Open Web Application" + +# If uncommented (and set to false), APP_NAME and APP_LONG_NAME will no longer +# be passed to the wrapper. See documentation for details. +#APP_NAME_PASS_TO_WRAPPER=false + +# Wrapper +WRAPPER_CMD="./wrapper" +WRAPPER_CONF="../conf/wrapper.conf" + +# Priority at which to run the wrapper. See "man nice" for valid priorities. +# nice is only used if a priority is specified. +PRIORITY= + +# Location of the pid file. +PIDDIR="." + +# PIDFILE_CHECK_PID tells the script to double check whether the pid in the pid +# file actually exists and belongs to this application. When not set, only +# check the pid, but not what it is. This is only needed when multiple +# applications need to share the same pid file. +PIDFILE_CHECK_PID=true + +# FIXED_COMMAND tells the script to use a hard coded action rather than +# expecting the first parameter of the command line to be the command. +# By default the command will will be expected to be the first parameter. +#FIXED_COMMAND=console + +# PASS_THROUGH tells the script to pass all arguments through to the JVM +# as is. If FIXED_COMMAND is specified then all arguments will be passed. +# If not set then all arguments starting with the second will be passed. +PASS_THROUGH=true + +# If uncommented, causes the Wrapper to be shutdown using an anchor file. +# When launched with the 'start' command, it will also ignore all INT and +# TERM signals. +#IGNORE_SIGNALS=true + +# Wrapper will start the JVM asynchronously. Your application may have some +# initialization tasks and it may be desirable to wait a few seconds +# before returning. For example, to delay the invocation of following +# startup scripts. Setting WAIT_AFTER_STARTUP to a positive number will +# cause the start command to delay for the indicated period of time +# (in seconds). +# +WAIT_AFTER_STARTUP=0 + +# If set, wait for the wrapper to report that the daemon has started +WAIT_FOR_STARTED_STATUS=true +WAIT_FOR_STARTED_TIMEOUT=120 + +# If set, the status, start_msg and stop_msg commands will print out detailed +# state information on the Wrapper and Java processes. +#DETAIL_STATUS=true + +# If set, the 'pause' and 'resume' commands will be enabled. These make it +# possible to pause the JVM or Java application without completely stopping +# the Wrapper. See the wrapper.pausable and wrapper.pausable.stop_jvm +# properties for more information. +#PAUSABLE=true + +# If specified, the Wrapper will be run as the specified user. +# IMPORTANT - Make sure that the user has the required privileges to write +# the PID file and wrapper.log files. Failure to be able to write the log +# file will cause the Wrapper to exit without any way to write out an error +# message. +# NOTE - This will set the user which is used to run the Wrapper as well as +# the JVM and is not useful in situations where a privileged resource or +# port needs to be allocated prior to the user being changed. +#RUN_AS_USER= + +# Set the full path to the 'su' command (substitute user). +# NOTE - In case 'su' is not in the PATH, you can set the absolute path here, +# for example: +# SU_BIN=/bin/su +# NOTE - For Red Hat, the script will use '/sbin/runuser' if it is present and +# ignore the value of SU_BIN. +SU_BIN=su + +# Set option for 'su'. +# In case the user set in RUN_AS_USER has no bash set, the 'su' command will fail. +# The workaround for GNU/Linux system is to specify which bash to use with +# the '-s' option. +#SU_OPTS="-s /bin/bash" + +# Set the full path to the 'id' command. +# For example: +# ID_BIN=/usr/bin/id +ID_BIN=id + +# By default we show a detailed usage block. Uncomment to show brief usage. +#BRIEF_USAGE=true + +# OS service management tool: flag for using Upstart when installing (rather than init.d rc.d) +USE_UPSTART= + +# OS service management tool: flag for using systemd when installing +USE_SYSTEMD= + +# When installing on Mac OSX platforms, the following domain will be used to +# prefix the plist file name. +PLIST_DOMAIN=org.tanukisoftware.wrapper + +# When installing on Mac OSX platforms, this parameter controls whether the daemon +# is to be kept continuously running or to let demand and conditions control the +# invocation. +MACOSX_KEEP_RUNNING="false" + +# The following two lines are used by the chkconfig command. Change as is +# appropriate for your application. They should remain commented. +# chkconfig: 2345 20 80 +# description: Test Wrapper Sample Application + +# Set run level to use when installing the application to start and stop on +# system startup and shutdown. It is important that the application always +# be uninstalled before making any changes to the run levels. +# It is also possible to specify different run levels based on the individual +# platform. When doing so this script will look for defined run levels in +# the following order: +# 1) "RUN_LEVEL_S_$DIST_OS" or "RUN_LEVEL_K_$DIST_OS", where "$DIST_OS" is +# the value of DIST_OS. "RUN_LEVEL_S_solaris=20" for example. +# 2) RUN_LEVEL_S or RUN_LEVEL_K, to specify specify start or stop run levels. +# 3) RUN_LEVEL, to specify a general run level. +RUN_LEVEL=20 + +# Do not modify anything beyond this point +#----------------------------------------------------------------------------- + +# check if we are running under Cygwin terminal. +# Note: on some OS's (for example Solaris, MacOS), -o is not a valid parameter +# and it shows an error message. We redirect stderr to null so the error message +# doesn't show up. +CYGWIN=`uname -o 2>/dev/null` +if [ "$CYGWIN" = "Cygwin" ] +then + eval echo `gettext 'This script is not compatible with Cygwin. Please use the Wrapper batch files to control the Wrapper.'` + exit 1 +fi + +if [ -n "$FIXED_COMMAND" ] +then + COMMAND="$FIXED_COMMAND" +else + COMMAND="$1" +fi + +# check if there is a parameter "sysd" +SYSD= +if [ $# -gt 1 ] ; then + if [ $2 = "sysd" ] ; then + SYSD=1 + fi +fi + +# default location for the service file +SYSTEMD_SERVICE_FILE="/etc/systemd/system/$APP_NAME.service" + +# Required for HP-UX Startup +if [ `uname -s` = "HP-UX" -o `uname -s` = "HP-UX64" ] ; then + PATH=$PATH:/usr/bin +fi + +# Get the fully qualified path to the script +case $0 in + /*) + SCRIPT="$0" + ;; + *) + PWD=`pwd` + SCRIPT="$PWD/$0" + ;; +esac + +# Resolve the true real path without any sym links. +CHANGED=true +while [ "X$CHANGED" != "X" ] +do + # Change spaces to ":" so the tokens can be parsed. + SAFESCRIPT=`echo $SCRIPT | sed -e 's; ;:;g'` + # Get the real path to this script, resolving any symbolic links + TOKENS=`echo $SAFESCRIPT | sed -e 's;/; ;g'` + REALPATH= + for C in $TOKENS; do + # Change any ":" in the token back to a space. + C=`echo $C | sed -e 's;:; ;g'` + REALPATH="$REALPATH/$C" + # If REALPATH is a sym link, resolve it. Loop for nested links. + while [ -h "$REALPATH" ] ; do + LS="`ls -ld "$REALPATH"`" + LINK="`expr "$LS" : '.*-> \(.*\)$'`" + if expr "$LINK" : '/.*' > /dev/null; then + # LINK is absolute. + REALPATH="$LINK" + else + # LINK is relative. + REALPATH="`dirname "$REALPATH"`""/$LINK" + fi + done + done + + if [ "$REALPATH" = "$SCRIPT" ] + then + CHANGED="" + else + SCRIPT="$REALPATH" + fi +done + +# Get the location of the script. +REALDIR=`dirname "$REALPATH"` +# Normalize the path +REALDIR=`cd "${REALDIR}"; pwd` + +# If the PIDDIR is relative, set its value relative to the full REALPATH to avoid problems if +# the working directory is later changed. +FIRST_CHAR=`echo $PIDDIR | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + PIDDIR=$REALDIR/$PIDDIR +fi +# Same test for WRAPPER_CMD +FIRST_CHAR=`echo $WRAPPER_CMD | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CMD=$REALDIR/$WRAPPER_CMD +fi +# Same test for WRAPPER_CONF +FIRST_CHAR=`echo $WRAPPER_CONF | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CONF=$REALDIR/$WRAPPER_CONF +fi + +# Process ID +ANCHORFILE="$PIDDIR/$APP_NAME.anchor" +COMMANDFILE="$PIDDIR/$APP_NAME.command" +STATUSFILE="$PIDDIR/$APP_NAME.status" +JAVASTATUSFILE="$PIDDIR/$APP_NAME.java.status" +PIDFILE="$PIDDIR/$APP_NAME.pid" +LOCKDIR="/var/lock/subsys" +LOCKFILE="$LOCKDIR/$APP_NAME" +pid="" + +# Resolve the location of the 'ps' command +PS_BIN="/usr/ucb/ps" + if [ ! -x "$PS_BIN" ] + then + PS_BIN="/usr/bin/ps" + if [ ! -x "$PS_BIN" ] + then + PS_BIN="/bin/ps" + if [ ! -x "$PS_BIN" ] + then + eval echo `gettext 'Unable to locate "ps".'` + eval echo `gettext 'Please report this message along with the location of the command on your system.'` + exit 1 + fi + fi + fi + +TR_BIN="/usr/bin/tr" +if [ ! -x "$TR_BIN" ] +then + TR_BIN="/bin/tr" + if [ ! -x "$TR_BIN" ] + then + eval echo `gettext 'Unable to locate "tr".'` + eval echo `gettext 'Please report this message along with the location of the command on your system.'` + exit 1 + fi +fi +# Resolve the os +DIST_OS=`uname -s | $TR_BIN "[A-Z]" "[a-z]" | $TR_BIN -d ' '` +case "$DIST_OS" in + 'sunos') + DIST_OS="solaris" + ;; + 'hp-ux' | 'hp-ux64') + # HP-UX needs the XPG4 version of ps (for -o args) + DIST_OS="hpux" + UNIX95="" + export UNIX95 + ;; + 'darwin') + DIST_OS="macosx" + ;; + 'unix_sv') + DIST_OS="unixware" + ;; + 'os/390') + DIST_OS="zos" + ;; +esac + +# Compare Versions $1<$2=0, $1==$2=1, $1>$2=2 +compareVersions () { + if [ "$1" = "$2" ] + then + return 1 + else + local i=1 + while true + do + local v1=`echo "$1" | cut -d '.' -f $i` + local v2=`echo "$2" | cut -d '.' -f $i` + if [ "X$v1" = "X" ] + then + if [ "X$v2" = "X" ] + then + return 1 + fi + v1="0" + elif [ "X$v2" = "X" ] + then + v2="0" + fi + if [ $v1 -lt $v2 ] + then + return 0 + elif [ $v1 -gt $v2 ] + then + return 2 + fi + i=`expr $i + 1` + done + fi +} + +# Resolve the architecture +if [ "$DIST_OS" = "macosx" ] +then + OS_VER=`sw_vers | grep 'ProductVersion:' | grep -o '[0-9]*\.[0-9]*\.[0-9]*\|[0-9]*\.[0-9]*'` + DIST_ARCH="universal" + compareVersions "$OS_VER" "10.5.0" + if [[ $? < 1 ]] + then + DIST_BITS="32" + KEY_KEEP_ALIVE="OnDemand" + else + # Note: "OnDemand" has been deprecated and replaced from Mac OS X 10.5 by "KeepAlive" + KEY_KEEP_ALIVE="KeepAlive" + + if [ "X`/usr/sbin/sysctl -n hw.cpu64bit_capable`" = "X1" ] + then + DIST_BITS="64" + else + DIST_BITS="32" + fi + fi + APP_PLIST_BASE=${PLIST_DOMAIN}.${APP_NAME} + APP_PLIST=${APP_PLIST_BASE}.plist +else + if [ "$DIST_OS" = "linux" ] + then + DIST_ARCH= + else + DIST_ARCH=`uname -p 2>/dev/null | $TR_BIN "[A-Z]" "[a-z]" | $TR_BIN -d ' '` + fi + if [ "X$DIST_ARCH" = "X" ] + then + DIST_ARCH="unknown" + fi + if [ "$DIST_ARCH" = "unknown" ] + then + DIST_ARCH=`uname -m 2>/dev/null | $TR_BIN "[A-Z]" "[a-z]" | $TR_BIN -d ' '` + fi + case "$DIST_ARCH" in + 'athlon' | 'i386' | 'i486' | 'i586' | 'i686') + DIST_ARCH="x86" + if [ "${DIST_OS}" = "solaris" ] ; then + DIST_BITS=`isainfo -b` + else + DIST_BITS="32" + fi + ;; + 'amd64' | 'x86_64') + DIST_ARCH="x86" + DIST_BITS="64" + ;; + 'ia32') + DIST_ARCH="ia" + DIST_BITS="32" + ;; + 'ia64' | 'ia64n' | 'ia64w') + DIST_ARCH="ia" + DIST_BITS="64" + ;; + 'ip27') + DIST_ARCH="mips" + DIST_BITS="32" + ;; + 'power' | 'powerpc' | 'power_pc' | 'ppc64') + if [ "${DIST_ARCH}" = "ppc64" ] ; then + DIST_BITS="64" + else + DIST_BITS="32" + fi + DIST_ARCH="ppc" + if [ "${DIST_OS}" = "aix" ] ; then + if [ `getconf KERNEL_BITMODE` -eq 64 ]; then + DIST_BITS="64" + else + DIST_BITS="32" + fi + fi + ;; + 'pa_risc' | 'pa-risc') + DIST_ARCH="parisc" + if [ `getconf KERNEL_BITS` -eq 64 ]; then + DIST_BITS="64" + else + DIST_BITS="32" + fi + ;; + 'sun4u' | 'sparcv9' | 'sparc') + DIST_ARCH="sparc" + DIST_BITS=`isainfo -b` + ;; + '9000/800' | '9000/785') + DIST_ARCH="parisc" + if [ `getconf KERNEL_BITS` -eq 64 ]; then + DIST_BITS="64" + else + DIST_BITS="32" + fi + ;; + '2064' | '2066' | '2084' | '2086' | '2094' | '2096' | '2097' | '2098' | '2817') + DIST_ARCH="390" + DIST_BITS="64" + ;; + armv*) + if [ -z "`readelf -A /proc/self/exe | grep Tag_ABI_VFP_args`" ] ; then + DIST_ARCH="armel" + DIST_BITS="32" + else + DIST_ARCH="armhf" + DIST_BITS="32" + fi + ;; + esac +fi + +# OSX always places Java in the same location so we can reliably set JAVA_HOME +if [ "$DIST_OS" = "macosx" ] +then + if [ -z "$JAVA_HOME" ]; then + if [ -x /usr/libexec/java_home ]; then + JAVA_HOME=`/usr/libexec/java_home`; export JAVA_HOME + else + JAVA_HOME="/Library/Java/Home"; export JAVA_HOME + fi + fi +fi + +# Test Echo +ECHOTEST=`echo -n "x"` +if [ "$ECHOTEST" = "x" ] +then + ECHOOPT="-n " + ECHOOPTC="" +else + ECHOOPT="" + ECHOOPTC="\c" +fi + + +gettext() { + "$WRAPPER_CMD" --translate "$1" "$WRAPPER_CONF" 2>/dev/null + if [ $? != 0 ] ; then + echo "$1" + fi +} + +outputFile() { + if [ -f "$1" ] + then + eval echo `gettext ' $1 Found but not executable.'`; + else + echo " $1" + fi +} + +# Decide on the wrapper binary to use. +# If the bits of the OS could be detected, we will try to look for the +# binary with the correct bits value. If it doesn't exist, fall back +# and look for the 32-bit binary. If that doesn't exist either then +# look for the default. +WRAPPER_TEST_CMD="" +if [ -f "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-$DIST_BITS" ] +then + WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-$DIST_BITS" + if [ ! -x "$WRAPPER_TEST_CMD" ] + then + chmod +x "$WRAPPER_TEST_CMD" 2>/dev/null + fi + if [ -x "$WRAPPER_TEST_CMD" ] + then + WRAPPER_CMD="$WRAPPER_TEST_CMD" + else + outputFile "$WRAPPER_TEST_CMD" + WRAPPER_TEST_CMD="" + fi +fi +if [ -f "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" -a -z "$WRAPPER_TEST_CMD" ] +then + WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" + if [ ! -x "$WRAPPER_TEST_CMD" ] + then + chmod +x "$WRAPPER_TEST_CMD" 2>/dev/null + fi + if [ -x "$WRAPPER_TEST_CMD" ] + then + WRAPPER_CMD="$WRAPPER_TEST_CMD" + else + outputFile "$WRAPPER_TEST_CMD" + WRAPPER_TEST_CMD="" + fi +fi +if [ -f "$WRAPPER_CMD" -a -z "$WRAPPER_TEST_CMD" ] +then + WRAPPER_TEST_CMD="$WRAPPER_CMD" + if [ ! -x "$WRAPPER_TEST_CMD" ] + then + chmod +x "$WRAPPER_TEST_CMD" 2>/dev/null + fi + if [ -x "$WRAPPER_TEST_CMD" ] + then + WRAPPER_CMD="$WRAPPER_TEST_CMD" + else + outputFile "$WRAPPER_TEST_CMD" + WRAPPER_TEST_CMD="" + fi +fi +if [ -z "$WRAPPER_TEST_CMD" ] +then + eval echo `gettext 'Unable to locate any of the following binaries:'` + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-$DIST_BITS" + if [ ! "$DIST_BITS" = "32" ] + then + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" + fi + outputFile "$WRAPPER_CMD" + + exit 1 +fi + + +# Build the nice clause +if [ "X$PRIORITY" = "X" ] +then + CMDNICE="" +else + CMDNICE="nice -$PRIORITY" +fi + +# Build the anchor file clause. +if [ "X$IGNORE_SIGNALS" = "X" ] +then + ANCHORPROP= + IGNOREPROP= +else + ANCHORPROP=wrapper.anchorfile=\"$ANCHORFILE\" + IGNOREPROP=wrapper.ignore_signals=TRUE +fi + +# Build the status file clause. +if [ "X$DETAIL_STATUS$WAIT_FOR_STARTED_STATUS" = "X" ] +then + STATUSPROP= +else + STATUSPROP="wrapper.statusfile=\"$STATUSFILE\" wrapper.java.statusfile=\"$JAVASTATUSFILE\"" +fi + +# Build the command file clause. +if [ -n "$PAUSABLE" ] +then + COMMANDPROP="wrapper.commandfile=\"$COMMANDFILE\" wrapper.pausable=TRUE" +else + COMMANDPROP= +fi + +if [ ! -n "$WAIT_FOR_STARTED_STATUS" ] +then + WAIT_FOR_STARTED_STATUS=true +fi + +if [ $WAIT_FOR_STARTED_STATUS = true ] ; then + DETAIL_STATUS=true +fi + + +# Build the lock file clause. Only create a lock file if the lock directory exists on this platform. +LOCKPROP= +if [ -d $LOCKDIR ] +then + if [ -w $LOCKDIR ] + then + LOCKPROP=wrapper.lockfile=\"$LOCKFILE\" + fi +fi + +# Build app name clause +if [ ! -n "$APP_NAME_PASS_TO_WRAPPER" ] +then + APP_NAME_PASS_TO_WRAPPER=true +fi +if [ $APP_NAME_PASS_TO_WRAPPER = false ] +then + APPNAMEPROP= +else + APPNAMEPROP="wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\"" +fi + +# Decide on run levels. +RUN_LEVEL_S_DIST_OS_TMP=`eval "echo \$\{RUN_LEVEL_S_${DIST_OS}\}"` +RUN_LEVEL_S_DIST_OS=`eval "echo ${RUN_LEVEL_S_DIST_OS_TMP}"` +if [ "X${RUN_LEVEL_S_DIST_OS}" != "X" ] ; then + APP_RUN_LEVEL_S=${RUN_LEVEL_S_DIST_OS} +elif [ "X$RUN_LEVEL_S" != "X" ] ; then + APP_RUN_LEVEL_S=$RUN_LEVEL_S +else + APP_RUN_LEVEL_S=$RUN_LEVEL +fi +APP_RUN_LEVEL_S_CHECK=`echo "$APP_RUN_LEVEL_S" | sed "s/[(0-9)*]/0/g"` +if [ "X${APP_RUN_LEVEL_S_CHECK}" != "X00" ] ; then + eval echo `gettext 'Run level \"${APP_RUN_LEVEL_S}\" must be numeric and have a length of two \(00-99\).'` + exit 1; +fi +RUN_LEVEL_K_DIST_OS_TMP=`eval "echo \$\{RUN_LEVEL_K_${DIST_OS}\}"` +RUN_LEVEL_K_DIST_OS=`eval "echo ${RUN_LEVEL_K_DIST_OS_TMP}"` +if [ "X${RUN_LEVEL_K_DIST_OS}" != "X" ] ; then + APP_RUN_LEVEL_K=${RUN_LEVEL_K_DIST_OS} +elif [ "X$RUN_LEVEL_K" != "X" ] ; then + APP_RUN_LEVEL_K=$RUN_LEVEL_K +else + APP_RUN_LEVEL_K=$RUN_LEVEL +fi +APP_RUN_LEVEL_K_CHECK=`echo "$APP_RUN_LEVEL_K" | sed "s/[(0-9)*]/0/g"` +if [ "X${APP_RUN_LEVEL_K_CHECK}" != "X00" ] ; then + eval echo `gettext 'Run level \"${APP_RUN_LEVEL_K}\" must be numeric and have a length of two \(00-99\).'` + exit 1; +fi + +prepAdditionalParams() { + ADDITIONAL_PARA="" + if [ ! -n "$PASS_THROUGH" ] + then + PASS_THROUGH=false + fi + if [ $PASS_THROUGH = true ] ; then + ADDITIONAL_PARA="--" + while [ -n "$1" ] ; do + ADDITIONAL_PARA="$ADDITIONAL_PARA \"$1\"" + shift + done + elif [ -n "$1" ] ; then + eval echo `gettext "WARNING: Extra arguments will be ignored. Please run \'$0 help\' for usage."` + fi +} + +checkUser() { + # $1 touchLock flag + # $2.. [command] args + + # Check the configured user. If necessary rerun this script as the desired user. + if [ "X$RUN_AS_USER" != "X" ] + then + # Resolve the location of the 'id' command + ID_BIN="/usr/xpg4/bin/id" + if [ ! -x "$ID_BIN" ] + then + ID_BIN="/usr/bin/id" + if [ ! -x "$ID_BIN" ] + then + eval echo `gettext 'Unable to locate "id".'` + eval echo `gettext 'Please report this message along with the location of the command on your system.'` + exit 1 + fi + fi + + if [ "`$ID_BIN -u -n`" = "$RUN_AS_USER" ] + then + # Already running as the configured user. Avoid password prompts by not calling su. + RUN_AS_USER="" + fi + fi + if [ "X$RUN_AS_USER" != "X" ] + then + if [ "`$ID_BIN -u -n "$RUN_AS_USER" 2>/dev/null`" != "$RUN_AS_USER" ] + then + eval echo `gettext 'User $RUN_AS_USER does not exist.'` + exit 1 + fi + + # If LOCKPROP and $RUN_AS_USER are defined then the new user will most likely not be + # able to create the lock file. The Wrapper will be able to update this file once it + # is created but will not be able to delete it on shutdown. If $1 is set then + # the lock file should be created for the current command + if [ "X$LOCKPROP" != "X" ] + then + if [ "X$1" != "X" ] + then + # Resolve the primary group + RUN_AS_GROUP=`groups $RUN_AS_USER | awk '{print $3}' | tail -1` + if [ "X$RUN_AS_GROUP" = "X" ] + then + RUN_AS_GROUP=$RUN_AS_USER + fi + touch $LOCKFILE + chown $RUN_AS_USER:$RUN_AS_GROUP $LOCKFILE + fi + fi + + # Still want to change users, recurse. This means that the user will only be + # prompted for a password once. Variables shifted by 1 + shift + + # Wrap the parameters so they can be passed. + ADDITIONAL_PARA="" + while [ -n "$1" ] ; do + if [ "$1" = 'installstart' ] ; then + # At this point the service is already installed. When we will fork the process we only need to start the service. + ADDITIONAL_PARA="$ADDITIONAL_PARA \"start\"" + else + ADDITIONAL_PARA="$ADDITIONAL_PARA \"$1\"" + fi + shift + done + + # Use "runuser" if this exists. + # runuser should be used on RedHat in preference to su. + if test -f "/sbin/runuser" + then + /sbin/runuser - $RUN_AS_USER -c "\"$REALPATH\" $ADDITIONAL_PARA" + else + $SU_BIN - $RUN_AS_USER -c "\"$REALPATH\" $ADDITIONAL_PARA" $SU_OPTS + fi + RUN_AS_USER_EXITCODE=$? + + # we check if the previous command has failed + if [ $RUN_AS_USER_EXITCODE -ne 0 ] + then + if [ $RUN_AS_USER_EXITCODE -eq 1 ] + then + checkForkCommand + else + eval echo `gettext 'Error executing the requested command with user \"$RUN_AS_USER\" \(error code $RUN_AS_USER_EXITCODE\).'` + echo "" + fi + fi + + # Now that we are the original user again, we may need to clean up the lock file. + if [ "X$LOCKPROP" != "X" ] + then + getpid + if [ "X$pid" = "X" ] + then + # Wrapper is not running so make sure the lock file is deleted. + if [ -f "$LOCKFILE" ] + then + rm "$LOCKFILE" + fi + fi + fi + + exit $RUN_AS_USER_EXITCODE + fi +} + +# Try to fork by executing a simple command. +# With this function, we want to make sure we are able to fork. +checkForkCommand() { + + if test -f "/sbin/runuser" + then + /sbin/runuser - $RUN_AS_USER -c "ls \"$REALPATH\"" > /dev/null 2>&1 & + else + $SU_BIN - $RUN_AS_USER -c "ls \"$REALPATH\"" $SU_OPTS > /dev/null 2>&1 & + fi + CHECK_EXITCODE=$? + + if [ $CHECK_EXITCODE -ne 0 ] + then + # clearly a problem with forking + eval echo `gettext 'Error: unable to create fork process.'` + eval echo `gettext 'Advice:'` + eval echo `gettext 'One possible cause of failure is when the user \(\"$RUN_AS_USER\"\) has no shell.'` + eval echo `gettext 'In this case, two solutions are available by editing the script file:'` + eval echo `gettext '1. Use \"SU_OPTS\" to set the shell for the user.'` + eval echo `gettext '2. Use a OS service management tool (only available on some platforms).'` + echo "" + fi +} + +getpid() { + pid="" + if [ -f "$PIDFILE" ] + then + if [ -r "$PIDFILE" ] + then + pid=`cat "$PIDFILE"` + if [ "X$pid" != "X" ] + then + if [ "X$PIDFILE_CHECK_PID" != "X" ] + then + # It is possible that 'a' process with the pid exists but that it is not the + # correct process. This can happen in a number of cases, but the most + # common is during system startup after an unclean shutdown. + # The ps statement below looks for the specific wrapper command running as + # the pid. If it is not found then the pid file is considered to be stale. + case "$DIST_OS" in + 'freebsd') + pidtest=`$PS_BIN -p $pid -o args | tail -1` + if [ "X$pidtest" = "XCOMMAND" ] + then + pidtest="" + fi + ;; + 'macosx') + pidtest=`$PS_BIN -ww -p $pid -o command | grep -F "$WRAPPER_CMD" | tail -1` + ;; + 'solaris') + if [ -f "/usr/bin/pargs" ] + then + pidtest=`pargs $pid | fgrep "$WRAPPER_CMD" | tail -1` + else + case "$PS_BIN" in + '/usr/ucb/ps') + pidtest=`$PS_BIN -auxww $pid | fgrep "$WRAPPER_CMD" | tail -1` + ;; + '/usr/bin/ps') + TRUNCATED_CMD=`$PS_BIN -o comm -p $pid | tail -1` + COUNT=`echo $TRUNCATED_CMD | wc -m` + COUNT=`echo ${COUNT}` + COUNT=`expr $COUNT - 1` + TRUNCATED_CMD=`echo $WRAPPER_CMD | cut -c1-$COUNT` + pidtest=`$PS_BIN -o comm -p $pid | fgrep "$TRUNCATED_CMD" | tail -1` + ;; + '/bin/ps') + TRUNCATED_CMD=`$PS_BIN -o comm -p $pid | tail -1` + COUNT=`echo $TRUNCATED_CMD | wc -m` + COUNT=`echo ${COUNT}` + COUNT=`expr $COUNT - 1` + TRUNCATED_CMD=`echo $WRAPPER_CMD | cut -c1-$COUNT` + pidtest=`$PS_BIN -o comm -p $pid | fgrep "$TRUNCATED_CMD" | tail -1` + ;; + *) + echo "Unsupported ps command $PS_BIN" + exit 1 + ;; + esac + fi + ;; + 'hpux') + pidtest=`$PS_BIN -p $pid -x -o args | grep -F "$WRAPPER_CMD" | tail -1` + ;; + 'zos') + TRUNCATED_CMD=`$PS_BIN -p $pid -o args | tail -1` + COUNT=`echo $TRUNCATED_CMD | wc -m` + COUNT=`echo ${COUNT}` + COUNT=`expr $COUNT - 1` + TRUNCATED_CMD=`echo $WRAPPER_CMD | cut -c1-$COUNT` + pidtest=`$PS_BIN -p $pid -o args | grep -F "$TRUNCATED_CMD" | tail -1` + ;; + *) + pidtest=`$PS_BIN -p $pid -o args | grep -F "$WRAPPER_CMD" | tail -1` + ;; + esac + else + # Check to see whether the pid exists as a running process, but in this mode, don't check what that pid is. + case "$DIST_OS" in + 'solaris') + case "$PS_BIN" in + '/usr/ucb/ps') + pidtest=`$PS_BIN $pid | grep "$pid" | awk '{print $1}' | tail -1` + ;; + '/usr/bin/ps') + pidtest=`$PS_BIN -p $pid -o pid | grep "$pid" | tail -1` + ;; + '/bin/ps') + pidtest=`$PS_BIN -p $pid -o pid | grep "$pid" | tail -1` + ;; + *) + echo "Unsupported ps command $PS_BIN" + exit 1 + ;; + esac + ;; + *) + pidtest=`$PS_BIN -p $pid -o pid | grep "$pid" | tail -1` + ;; + esac + fi + + if [ "X$pidtest" = "X" ] + then + # This is a stale pid file. + rm -f "$PIDFILE" + eval echo `gettext 'Removed stale pid file: $PIDFILE'` + pid="" + fi + fi + else + eval echo `gettext 'Cannot read $PIDFILE.'` + exit 1 + fi + fi +} + +getstatus() { + STATUS= + if [ -f "$STATUSFILE" ] + then + if [ -r "$STATUSFILE" ] + then + STATUS=`cat "$STATUSFILE"` + fi + fi + if [ "X$STATUS" = "X" ] + then + STATUS="Unknown" + fi + + JAVASTATUS= + if [ -f "$JAVASTATUSFILE" ] + then + if [ -r "$JAVASTATUSFILE" ] + then + JAVASTATUS=`cat "$JAVASTATUSFILE"` + fi + fi + if [ "X$JAVASTATUS" = "X" ] + then + JAVASTATUS="Unknown" + fi +} + +testpid() { + case "$DIST_OS" in + 'solaris') + case "$PS_BIN" in + '/usr/ucb/ps') + pid=`$PS_BIN $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` + ;; + '/usr/bin/ps') + pid=`$PS_BIN -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` + ;; + '/bin/ps') + pid=`$PS_BIN -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` + ;; + *) + echo "Unsupported ps command $PS_BIN" + exit 1 + ;; + esac + ;; + *) + pid=`$PS_BIN -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` 2>/dev/null + ;; + esac + if [ "X$pid" = "X" ] + then + # Process is gone so remove the pid file. + rm -f "$PIDFILE" + pid="" + fi +} + +launchdtrap() { + stopit + exit +} + +waitforwrapperstop() { + getpid + while [ "X$pid" != "X" ] ; do + sleep 1 + getpid + done +} + +launchinternal() { + getpid + trap launchdtrap TERM + if [ "X$pid" = "X" ] + then + prepAdditionalParams "$@" + + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.daemonize=TRUE $APPNAMEPROP $ANCHORPROP $IGNOREPROP $STATUSPROP $COMMANDPROP $LOCKPROP wrapper.script.version=3.5.28 $ADDITIONAL_PARA" + eval $COMMAND_LINE + else + eval echo `gettext '$APP_LONG_NAME is already running.'` + exit 1 + fi + # launchd expects that this script stay up and running so we need to do our own monitoring of the Wrapper process. + if [ $WAIT_FOR_STARTED_STATUS = true ] + then + waitforwrapperstop + fi +} + +console() { + eval echo `gettext 'Running $APP_LONG_NAME...'` + getpid + if [ "X$pid" = "X" ] + then + trap '' 3 + + prepAdditionalParams "$@" + + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" $APPNAMEPROP $ANCHORPROP $STATUSPROP $COMMANDPROP $LOCKPROP wrapper.script.version=3.5.28 $ADDITIONAL_PARA" + eval $COMMAND_LINE + else + eval echo `gettext '$APP_LONG_NAME is already running.'` + exit 1 + fi +} + +waitforjavastartup() { + getstatus + eval echo $ECHOOPT `gettext 'Waiting for $APP_LONG_NAME...$ECHOOPTC'` + + # Wait until the timeout or we have something besides Unknown. + counter=15 + while [ "$JAVASTATUS" = "Unknown" -a $counter -gt 0 -a -n "$JAVASTATUS" ] ; do + echo $ECHOOPT".$ECHOOPTC" + sleep 1 + getstatus + counter=`expr $counter - 1` + done + + if [ -n "$WAIT_FOR_STARTED_TIMEOUT" ] ; then + counter=$WAIT_FOR_STARTED_TIMEOUT + else + counter=120 + fi + while [ "$JAVASTATUS" != "STARTED" -a "$JAVASTATUS" != "Unknown" -a $counter -gt 0 -a -n "$JAVASTATUS" ] ; do + echo $ECHOOPT".$ECHOOPTC" + sleep 1 + getstatus + counter=`expr $counter - 1` + done + echo "" +} + +startwait() { + if [ $WAIT_FOR_STARTED_STATUS = true ] + then + waitforjavastartup + fi + # Sleep for a few seconds to allow for intialization if required + # then test to make sure we're still running. + # + i=0 + while [ $i -lt $WAIT_AFTER_STARTUP ] + do + sleep 1 + echo $ECHOOPT".$ECHOOPTC" + i=`expr $i + 1` + done + if [ $WAIT_AFTER_STARTUP -gt 0 -o $WAIT_FOR_STARTED_STATUS = true ] + then + getpid + if [ "X$pid" = "X" ] + then + eval echo `gettext ' WARNING: $APP_LONG_NAME may have failed to start.'` + exit 1 + else + eval echo `gettext ' running: PID:$pid'` + fi + else + echo "" + fi +} + +mustBeRootOrExit() { + if [ `id | sed 's/^uid=//;s/(.*$//'` != "0" ] ; then + eval echo `gettext 'Must be root to perform this action.'` + exit 1 + fi +} + + +macosxStart() { + # The daemon has been installed. + eval echo `gettext 'Starting $APP_LONG_NAME. Detected Mac OSX and installed launchd daemon.'` + mustBeRootOrExit + + getpid + if [ "X$pid" != "X" ] ; then + eval echo `gettext '$APP_LONG_NAME is already running.'` + exit 1 + fi + + # If the daemon was just installed, it may not be loaded. + LOADED_PLIST=`launchctl list | grep ${APP_PLIST_BASE}` + if [ "X${LOADED_PLIST}" = "X" ] ; then + launchctl load /Library/LaunchDaemons/${APP_PLIST} + fi + # If launchd is set to run the daemon already at Load, we don't need to call start + getpid + if [ "X$pid" = "X" ] ; then + launchctl start ${APP_PLIST_BASE} + fi + + startwait +} + +macosxStop() { + # The daemon should be running. + eval echo `gettext 'Stopping $APP_LONG_NAME...'` + mustBeRootOrExit + + getpid + if [ "X$pid" = "X" ] ; then + eval echo `gettext '$APP_LONG_NAME is not running.'` + exit 1 + else + if [ "$MACOSX_KEEP_RUNNING" = "true" ] ; then + echo "" + eval echo `gettext 'Daemon is set to be kept continuously running and it will be automatically restarted.'` + eval echo `gettext 'To stop the daemon you need to uninstall it.'` + eval echo `gettext 'If you want to use the \"stop\" argument, you need to find MACOSX_KEEP_RUNNING'` + eval echo `gettext 'at the beginning of the script file and set it to \"false\".'` + echo "" + fi + launchctl stop ${APP_PLIST_BASE} + fi +} + +macosxRestart() { + # The daemon should be running. + eval echo `gettext 'Restarting $APP_LONG_NAME...'` + mustBeRootOrExit + + getpid + if [ "X$pid" = "X" ] ; then + eval echo `gettext '$APP_LONG_NAME is not running.'` + exit 1 + else + if [ "$MACOSX_KEEP_RUNNING" = "true" ] ; then + # by stopping it, launchd will automatically restart it + launchctl stop ${APP_PLIST_BASE} + else + launchctl unload "/Library/LaunchDaemons/${APP_PLIST}" + sleep 1 + launchctl load "/Library/LaunchDaemons/${APP_PLIST}" + fi + fi + + startwait +} + +upstartstart() { + # The daemon has been installed. + eval echo `gettext 'Starting $APP_LONG_NAME. Detected Linux and installed upstart.'` + mustBeRootOrExit + + getpid + if [ "X$pid" != "X" ] ; then + eval echo `gettext '$APP_LONG_NAME is already running.'` + exit 1 + fi + + /sbin/start ${APP_NAME} + + startwait +} + +upstartStop() { + # The daemon has been installed. + eval echo `gettext 'Stopping $APP_LONG_NAME...'` + mustBeRootOrExit + + getpid + if [ "X$pid" = "X" ] ; then + eval echo `gettext '$APP_LONG_NAME is not running.'` + exit 1 + fi + + /sbin/stop ${APP_NAME} +} + +upstartRestart() { + # The daemon has been installed. + eval echo `gettext 'Restarting $APP_LONG_NAME...'` + mustBeRootOrExit + + getpid + if [ "X$pid" = "X" ] ; then + eval echo `gettext '$APP_LONG_NAME is not running.'` + exit 1 + fi + + /sbin/restart ${APP_NAME} + + startwait +} + +systemdInstall() { + eval echo `gettext ' Installing the $APP_LONG_NAME daemon using systemd...'` + if [ -f "${REALDIR}/${APP_NAME}.service" ] ; then + eval echo `gettext ' a custom service file ${APP_NAME}.service found'` + cp "${REALDIR}/${APP_NAME}.service" "${SYSTEMD_SERVICE_FILE}" + else + eval echo `gettext ' creating default service file...'` + echo "[Unit]" > "${SYSTEMD_SERVICE_FILE}" + echo "Description=${APP_LONG_NAME}" >> "${SYSTEMD_SERVICE_FILE}" + echo "After=syslog.target" >> "${SYSTEMD_SERVICE_FILE}" + echo "" >> "${SYSTEMD_SERVICE_FILE}" + echo "[Service]" >> "${SYSTEMD_SERVICE_FILE}" + echo "Type=forking" >> "${SYSTEMD_SERVICE_FILE}" + echo "ExecStart=${REALPATH} start sysd" >> "${SYSTEMD_SERVICE_FILE}" + echo "ExecStop=${REALPATH} stop sysd" >> "${SYSTEMD_SERVICE_FILE}" + if [ "X${RUN_AS_USER}" != "X" ] ; then + echo "User=${RUN_AS_USER}" >> "${SYSTEMD_SERVICE_FILE}" + fi + echo "" >> "${SYSTEMD_SERVICE_FILE}" + echo "[Install]" >> "${SYSTEMD_SERVICE_FILE}" + echo "WantedBy=multi-user.target" >> "${SYSTEMD_SERVICE_FILE}" + + systemctl daemon-reload + systemctl enable "${APP_NAME}" + fi +} + +systemdStart() { + # check if the service file is present + if [ -f "${SYSTEMD_SERVICE_FILE}" ] ; then + eval echo `gettext 'Reading file ${SYSTEMD_SERVICE_FILE}'` + else + eval echo `gettext 'No service file detected. Did you install the service?'` + exit 1 + fi + + systemctl start $APP_NAME + if [ $? -ne 0 ] ; then + eval echo `gettext 'Failed to start service $APP_NAME'` + exit 1 + fi + + startwait +} + +systemdStop() { + systemctl stop $APP_NAME + if [ $? -ne 0 ] ; then + eval echo `gettext 'Failed to stop service $APP_NAME'` + exit 1 + fi +} + +systemdRestart() { + systemctl restart $APP_NAME + if [ $? -ne 0 ] ; then + eval echo `gettext 'Failed to restart service $APP_NAME'` + exit 1 + fi + + startwait +} + +systemdRemove() { + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon from systemd...'` + systemctl disable $APP_NAME + rm "/etc/systemd/system/${APP_NAME}.service" + systemctl daemon-reload +} + +srcInstall() { + if [ "X$RUN_AS_USER" = "X" ] ; then + USERID="0" + else + USERID=`$ID_BIN -u "$RUN_AS_USER"` + if [ $? -ne 0 ] ; then + eval echo `gettext 'Failed to get user id for $RUN_AS_USER'` + exit 1 + fi + fi + /usr/bin/mkssys -s "$APP_NAME" -p "$REALPATH" -a "launchdinternal" -u "$USERID" -f 9 -n 15 -S + /usr/sbin/mkitab "$APP_NAME":2:once:"/usr/bin/startsrc -s \"${APP_NAME}\" >/dev/console 2>&1" +} + +srcStart() { + startsrc -s "${APP_NAME}" + if [ $? -ne 0 ] ; then + eval echo `gettext 'Failed to start service $APP_NAME'` + exit 1 + fi + + startwait +} + +srcStop() { + stopsrc -s "${APP_NAME}" + if [ $? -ne 0 ] ; then + eval echo `gettext 'Failed to stop service $APP_NAME'` + exit 1 + fi +} + +srcRestart() { + srcStop + srcStart +} + +start() { + eval echo `gettext 'Starting $APP_LONG_NAME...'` + getpid + if [ "X$pid" = "X" ] + then + prepAdditionalParams "$@" + + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.daemonize=TRUE $APPNAMEPROP $ANCHORPROP $IGNOREPROP $STATUSPROP $COMMANDPROP $LOCKPROP wrapper.script.version=3.5.28 $ADDITIONAL_PARA" + eval $COMMAND_LINE + else + eval echo `gettext '$APP_LONG_NAME is already running.'` + exit 1 + fi + + startwait +} + +stopit() { + # $1 exit if down flag + + eval echo `gettext 'Stopping $APP_LONG_NAME...'` + getpid + if [ "X$pid" = "X" ] + then + eval echo `gettext '$APP_LONG_NAME was not running.'` + if [ "X$1" = "X1" ] + then + exit 1 + fi + else + if [ "X$IGNORE_SIGNALS" = "X" ] + then + # Running so try to stop it. + kill $pid + if [ $? -ne 0 ] + then + # An explanation for the failure should have been given + eval echo `gettext 'Unable to stop $APP_LONG_NAME.'` + exit 1 + fi + else + rm -f "$ANCHORFILE" + if [ -f "$ANCHORFILE" ] + then + # An explanation for the failure should have been given + eval echo `gettext 'Unable to stop $APP_LONG_NAME.'` + exit 1 + fi + fi + + # We can not predict how long it will take for the wrapper to + # actually stop as it depends on settings in wrapper.conf. + # Loop until it does. + savepid=$pid + CNT=0 + TOTCNT=0 + while [ "X$pid" != "X" ] + do + # Show a waiting message every 5 seconds. + if [ "$CNT" -lt "5" ] + then + CNT=`expr $CNT + 1` + else + eval echo `gettext 'Waiting for $APP_LONG_NAME to exit...'` + CNT=0 + fi + TOTCNT=`expr $TOTCNT + 1` + + sleep 1 + + testpid + done + + pid=$savepid + testpid + if [ "X$pid" != "X" ] + then + eval echo `gettext 'Failed to stop $APP_LONG_NAME.'` + exit 1 + else + eval echo `gettext 'Stopped $APP_LONG_NAME.'` + fi + fi +} + +pause() { + eval echo `gettext 'Pausing $APP_LONG_NAME.'` +} + +resume() { + eval echo `gettext 'Resuming $APP_LONG_NAME.'` +} + +status() { + getpid + if [ "X$pid" = "X" ] + then + eval echo `gettext '$APP_LONG_NAME is not running.'` + exit 1 + else + if [ "X$DETAIL_STATUS" = "X" ] + then + eval echo `gettext '$APP_LONG_NAME is running: PID:$pid'` + else + getstatus + eval echo `gettext '$APP_LONG_NAME is running: PID:$pid, Wrapper:$STATUS, Java:$JAVASTATUS'` + fi + exit 0 + fi +} + +# Make sure APP_NAME is less than 14 characters, otherwise in AIX, the command +# "lsitab" will fail +validateAppNameLength() { + if [ ${#APP_NAME} -gt 14 ] ; then + eval echo `gettext ' APP_NAME (${APP_NAME}) must be less than 14 characters long'` + exit 1 + fi +} + +installUpstart() { + eval echo `gettext ' Installing the $APP_LONG_NAME daemon using upstart..'` + if [ -f "${REALDIR}/${APP_NAME}.install" ] ; then + eval echo `gettext ' a custom upstart conf file ${APP_NAME}.install found'` + cp "${REALDIR}/${APP_NAME}.install" "/etc/init/${APP_NAME}.conf" + else + eval echo `gettext ' creating default upstart conf file..'` + echo "# ${APP_NAME} - ${APP_LONG_NAME}" > "/etc/init/${APP_NAME}.conf" + echo "description \"${APP_LONG_NAME}\"" >> "/etc/init/${APP_NAME}.conf" + echo "author \"Tanuki Software Ltd. \"" >> "/etc/init/${APP_NAME}.conf" + echo "start on runlevel [2345]" >> "/etc/init/${APP_NAME}.conf" + echo "stop on runlevel [!2345]" >> "/etc/init/${APP_NAME}.conf" + echo "env LANG=${LANG}" >> "/etc/init/${APP_NAME}.conf" + echo "exec \"${REALPATH}\" upstartinternal" >> "/etc/init/${APP_NAME}.conf" + fi +} + +installdaemon() { + mustBeRootOrExit + + APP_NAME_LOWER=`echo "$APP_NAME" | $TR_BIN "[A-Z]" "[a-z]"` + if [ "$DIST_OS" = "solaris" ] ; then + eval echo `gettext 'Detected Solaris:'` + if [ -f "/etc/init.d/$APP_NAME" -o -L "/etc/init.d/$APP_NAME" ] ; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed.'` + if [ "$COMMAND" != 'installstart' ] ; then + exit 1 + fi + else + eval echo `gettext ' Installing the $APP_LONG_NAME daemon..'` + ln -s "$REALPATH" "/etc/init.d/$APP_NAME" + for i in `ls "/etc/rc3.d/K"??"$APP_NAME_LOWER" "/etc/rc3.d/S"??"$APP_NAME_LOWER" 2>/dev/null` ; do + eval echo `gettext ' Removing unexpected file before proceeding: $i'` + rm -f $i + done + ln -s "/etc/init.d/$APP_NAME" "/etc/rc3.d/K${APP_RUN_LEVEL_K}$APP_NAME_LOWER" + ln -s "/etc/init.d/$APP_NAME" "/etc/rc3.d/S${APP_RUN_LEVEL_S}$APP_NAME_LOWER" + fi + elif [ "$DIST_OS" = "linux" ] ; then + if [ -f /etc/redhat-release -o -f /etc/redhat_version -o -f /etc/fedora-release ] ; then + eval echo `gettext 'Detected RHEL or Fedora:'` + if [ -f "/etc/init.d/$APP_NAME" -o -L "/etc/init.d/$APP_NAME" -o -f "/etc/init/${APP_NAME}.conf" ] ; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed.'` + if [ "$COMMAND" != 'installstart' ] ; then + exit 1 + fi + elif [ -n "$USE_SYSTEMD" -a -d "/etc/systemd" ] ; then + systemdInstall + else + if [ -n "$USE_UPSTART" -a -d "/etc/init" ] ; then + installUpstart + else + eval echo `gettext ' Installing the $APP_LONG_NAME daemon..'` + ln -s "$REALPATH" "/etc/init.d/$APP_NAME" + /sbin/chkconfig --add "$APP_NAME" + /sbin/chkconfig "$APP_NAME" on + fi + fi + elif [ -f /etc/SuSE-release ] ; then + eval echo `gettext 'Detected SuSE or SLES:'` + if [ -f "/etc/init.d/$APP_NAME" -o -L "/etc/init.d/$APP_NAME" ] ; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed.'` + if [ "$COMMAND" != 'installstart' ] ; then + exit 1 + fi + elif [ -n "$USE_SYSTEMD" -a -d "/etc/systemd" ] ; then + systemdInstall + else + eval echo `gettext ' Installing the $APP_LONG_NAME daemon..'` + ln -s "$REALPATH" "/etc/init.d/$APP_NAME" + insserv "/etc/init.d/$APP_NAME" + fi + elif [ -f /etc/lsb-release -o -f /etc/debian_version -o -f /etc/debian_release ] ; then + eval echo `gettext 'Detected Ubuntu or Debian:'` + if [ -f "/etc/init.d/$APP_NAME" -o -L "/etc/init.d/$APP_NAME" -o -f "/etc/init/${APP_NAME}.conf" ] ; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed.'` + if [ "$COMMAND" != 'installstart' ] ; then + exit 1 + fi + else + if [ -n "$USE_SYSTEMD" -a -d "/etc/systemd" ] ; then + systemdInstall + elif [ -n "$USE_UPSTART" -a -d "/etc/init" ] ; then + installUpstart + else + eval echo `gettext ' Installing the $APP_LONG_NAME daemon using init.d..'` + ln -s "$REALPATH" "/etc/init.d/$APP_NAME" + update-rc.d "$APP_NAME" defaults + fi + fi + else + eval echo `gettext 'Detected Linux:'` + if [ -f "/etc/init.d/$APP_NAME" -o -L "/etc/init.d/$APP_NAME" ] ; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed.'` + if [ "$COMMAND" != 'installstart' ] ; then + exit 1 + fi + else + eval echo `gettext ' Installing the $APP_LONG_NAME daemon..'` + ln -s "$REALPATH" /etc/init.d/$APP_NAME + for i in `ls "/etc/rc3.d/K"??"$APP_NAME_LOWER" "/etc/rc5.d/K"??"$APP_NAME_LOWER" "/etc/rc3.d/S"??"$APP_NAME_LOWER" "/etc/rc5.d/S"??"$APP_NAME_LOWER" 2>/dev/null` ; do + eval echo `gettext ' Removing unexpected file before proceeding: $i'` + rm -f $i + done + ln -s "/etc/init.d/$APP_NAME" "/etc/rc3.d/K${APP_RUN_LEVEL_K}$APP_NAME_LOWER" + ln -s "/etc/init.d/$APP_NAME" "/etc/rc3.d/S${APP_RUN_LEVEL_S}$APP_NAME_LOWER" + ln -s "/etc/init.d/$APP_NAME" "/etc/rc5.d/S${APP_RUN_LEVEL_S}$APP_NAME_LOWER" + ln -s "/etc/init.d/$APP_NAME" "/etc/rc5.d/K${APP_RUN_LEVEL_K}$APP_NAME_LOWER" + fi + fi + elif [ "$DIST_OS" = "hpux" ] ; then + eval echo `gettext 'Detected HP-UX:'` + if [ -f "/sbin/init.d/$APP_NAME" -o -L "/sbin/init.d/$APP_NAME" ] ; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed.'` + if [ "$COMMAND" != 'installstart' ] ; then + exit 1 + fi + else + eval echo `gettext ' Installing the $APP_LONG_NAME daemon..'` + ln -s "$REALPATH" "/sbin/init.d/$APP_NAME" + for i in `ls "/sbin/rc3.d/K"??"$APP_NAME_LOWER" "/sbin/rc3.d/S"??"$APP_NAME_LOWER" 2>/dev/null` ; do + eval echo `gettext ' Removing unexpected file before proceeding: $i'` + rm -f $i + done + ln -s "/sbin/init.d/$APP_NAME" "/sbin/rc3.d/K${APP_RUN_LEVEL_K}$APP_NAME_LOWER" + ln -s "/sbin/init.d/$APP_NAME" "/sbin/rc3.d/S${APP_RUN_LEVEL_S}$APP_NAME_LOWER" + fi + elif [ "$DIST_OS" = "aix" ] ; then + eval echo `gettext 'Detected AIX:'` + validateAppNameLength + if [ -f "/etc/rc.d/init.d/$APP_NAME" ] ; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed as rc.d script.'` + if [ "$COMMAND" != 'installstart' ] ; then + exit 1 + fi + elif [ -n "`/usr/sbin/lsitab $APP_NAME`" -a -n "`/usr/bin/lssrc -S -s $APP_NAME`" ] ; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed as SRC service.'` + if [ "$COMMAND" != 'installstart' ] ; then + exit 1 + fi + else + eval echo `gettext ' Installing the $APP_LONG_NAME daemon..'` + if [ -n "`/usr/sbin/lsitab install_assist`" ] ; then + eval echo `gettext ' The task /usr/sbin/install_assist was found in the inittab, this might cause problems for all subsequent tasks to launch at this process is known to block the init task. Please make sure this task is not needed anymore and remove/deactivate it.'` + fi + for i in `ls "/etc/rc.d/rc2.d/K"??"$APP_NAME_LOWER" "/etc/rc.d/rc2.d/S"??"$APP_NAME_LOWER" 2>/dev/null` ; do + eval echo `gettext ' Removing unexpected file before proceeding: $i'` + rm -f $i + done + srcInstall + fi + elif [ "$DIST_OS" = "freebsd" ] ; then + eval echo `gettext 'Detected FreeBSD:'` + if [ -f "/etc/rc.d/$APP_NAME" -o -L "/etc/rc.d/$APP_NAME" ] ; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed.'` + if [ "$COMMAND" != 'installstart' ] ; then + exit 1 + fi + else + eval echo `gettext ' Installing the $APP_LONG_NAME daemon..'` + sed -i .bak "/${APP_NAME}_enable=\"YES\"/d" /etc/rc.conf + if [ -f "${REALDIR}/${APP_NAME}.install" ] ; then + ln -s "${REALDIR}/${APP_NAME}.install" "/etc/rc.d/$APP_NAME" + else + echo '#!/bin/sh' > "/etc/rc.d/$APP_NAME" + echo "#" >> "/etc/rc.d/$APP_NAME" + echo "# PROVIDE: $APP_NAME" >> "/etc/rc.d/$APP_NAME" + echo "# REQUIRE: NETWORKING" >> "/etc/rc.d/$APP_NAME" + echo "# KEYWORD: shutdown" >> "/etc/rc.d/$APP_NAME" + echo ". /etc/rc.subr" >> "/etc/rc.d/$APP_NAME" + echo "name=\"$APP_NAME\"" >> "/etc/rc.d/$APP_NAME" + echo "rcvar=\`set_rcvar\`" >> "/etc/rc.d/$APP_NAME" + echo "command=\"${REALPATH}\"" >> "/etc/rc.d/$APP_NAME" + echo 'start_cmd="${name}_start"' >> "/etc/rc.d/$APP_NAME" + echo 'load_rc_config $name' >> "/etc/rc.d/$APP_NAME" + echo 'status_cmd="${name}_status"' >> "/etc/rc.d/$APP_NAME" + echo 'stop_cmd="${name}_stop"' >> "/etc/rc.d/$APP_NAME" + echo "${APP_NAME}_status() {" >> "/etc/rc.d/$APP_NAME" + echo '${command} status' >> "/etc/rc.d/$APP_NAME" + echo '}' >> "/etc/rc.d/$APP_NAME" + echo "${APP_NAME}_stop() {" >> "/etc/rc.d/$APP_NAME" + echo '${command} stop' >> "/etc/rc.d/$APP_NAME" + echo '}' >> "/etc/rc.d/$APP_NAME" + echo "${APP_NAME}_start() {" >> "/etc/rc.d/$APP_NAME" + echo '${command} start' >> "/etc/rc.d/$APP_NAME" + echo '}' >> "/etc/rc.d/$APP_NAME" + echo 'run_rc_command "$1"' >> "/etc/rc.d/$APP_NAME" + fi + echo "${APP_NAME}_enable=\"YES\"" >> /etc/rc.conf + chmod 555 "/etc/rc.d/$APP_NAME" + fi + elif [ "$DIST_OS" = "macosx" ] ; then + eval echo `gettext 'Detected Mac OSX:'` + if [ -f "/Library/LaunchDaemons/${APP_PLIST}" -o -L "/Library/LaunchDaemons/${APP_PLIST}" ] ; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed.'` + if [ "$COMMAND" != 'installstart' ] ; then + exit 1 + fi + else + eval echo `gettext ' Installing the $APP_LONG_NAME daemon..'` + if [ -f "${REALDIR}/${APP_PLIST}" ] ; then + ln -s "${REALDIR}/${APP_PLIST}" "/Library/LaunchDaemons/${APP_PLIST}" + else + echo "" > "/Library/LaunchDaemons/${APP_PLIST}" + echo "> "/Library/LaunchDaemons/${APP_PLIST}" + echo "\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">" >> "/Library/LaunchDaemons/${APP_PLIST}" + echo "" >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " " >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " Label" >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " ${APP_PLIST_BASE}" >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " ProgramArguments" >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " " >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " ${REALPATH}" >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " launchdinternal" >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " " >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " ${KEY_KEEP_ALIVE}" >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " <${MACOSX_KEEP_RUNNING}/>" >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " RunAtLoad" >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " " >> "/Library/LaunchDaemons/${APP_PLIST}" + if [ "X$RUN_AS_USER" != "X" ] ; then + echo " UserName" >> "/Library/LaunchDaemons/${APP_PLIST}" + echo " ${RUN_AS_USER}" >> "/Library/LaunchDaemons/${APP_PLIST}" + fi + echo " " >> "/Library/LaunchDaemons/${APP_PLIST}" + echo "" >> "/Library/LaunchDaemons/${APP_PLIST}" + fi + chmod 555 "/Library/LaunchDaemons/${APP_PLIST}" + fi + elif [ "$DIST_OS" = "zos" ] ; then + eval echo `gettext 'Detected z/OS:'` + if [ -f /etc/rc.bak ] ; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed.'` + if [ "$COMMAND" != 'installstart' ] ; then + exit 1 + fi + else + eval echo `gettext ' Installing the $APP_LONG_NAME daemon..'` + cp /etc/rc /etc/rc.bak + sed "s:echo /etc/rc script executed, \`date\`::g" /etc/rc.bak > /etc/rc + echo "_BPX_JOBNAME='${APP_NAME}' \"${REALDIR}/${APP_NAME}\" start" >>/etc/rc + echo '/etc/rc script executed, `date`' >>/etc/rc + fi + else + eval echo `gettext 'Install not currently supported for $DIST_OS'` + exit 1 + fi +} + +startdaemon() { + if [ "$DIST_OS" = "macosx" ] ; then + if [ ! -f "/Library/LaunchDaemons/${APP_PLIST}" ] ; then + eval echo `gettext 'The $APP_LONG_NAME daemon is not currently installed.'` + else + macosxStart + fi + elif [ "$DIST_OS" = "linux" -a -f "/etc/init/${APP_NAME}.conf" ] ; then + upstartstart + elif [ "$DIST_OS" = "linux" -a -n "$USE_SYSTEMD" -a -z "$SYSD" ] ; then + systemdStart + elif [ "$DIST_OS" = "aix" ] && [ -n "`/usr/bin/lssrc -S -s $APP_NAME`" ] ; then + srcStart + else + if [ -n "$SYSD" ] ; then + shift + fi + + checkUser touchlock "$@" + if [ ! -n "$FIXED_COMMAND" ] ; then + shift + fi + start "$@" + fi +} + +removedaemon() { + mustBeRootOrExit + + APP_NAME_LOWER=`echo "$APP_NAME" | $TR_BIN "[A-Z]" "[a-z]"` + if [ "$DIST_OS" = "solaris" ] ; then + eval echo `gettext 'Detected Solaris:'` + if [ -f "/etc/init.d/$APP_NAME" -o -L "/etc/init.d/$APP_NAME" ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon...'` + for i in `ls "/etc/rc3.d/K"??"$APP_NAME_LOWER" "/etc/rc3.d/S"??"$APP_NAME_LOWER" "/etc/init.d/$APP_NAME" 2>/dev/null` ; do + rm -f $i + done + else + eval echo `gettext ' The $APP_LONG_NAME daemon is not currently installed.'` + exit 1 + fi + elif [ "$DIST_OS" = "linux" ] ; then + if [ -f /etc/redhat-release -o -f /etc/redhat_version -o -f /etc/fedora-release ] ; then + eval echo `gettext 'Detected RHEL or Fedora:'` + if [ -f "/etc/init.d/$APP_NAME" -o -L "/etc/init.d/$APP_NAME" ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon...'` + /sbin/chkconfig "$APP_NAME" off + /sbin/chkconfig --del "$APP_NAME" + rm -f "/etc/init.d/$APP_NAME" + elif [ -n "$USE_SYSTEMD" -a -f "${SYSTEMD_SERVICE_FILE}" ] ; then + systemdRemove + elif [ -f "/etc/init/${APP_NAME}.conf" ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon from upstart...'` + rm "/etc/init/${APP_NAME}.conf" + else + eval echo `gettext ' The $APP_LONG_NAME daemon is not currently installed.'` + exit 1 + fi + elif [ -f /etc/SuSE-release ] ; then + eval echo `gettext 'Detected SuSE or SLES:'` + if [ -f "/etc/init.d/$APP_NAME" -o -L "/etc/init.d/$APP_NAME" ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon...'` + insserv -r "/etc/init.d/$APP_NAME" + rm -f "/etc/init.d/$APP_NAME" + elif [ -n "$USE_SYSTEMD" -a -f "${SYSTEMD_SERVICE_FILE}" ] ; then + systemdRemove + else + eval echo `gettext ' The $APP_LONG_NAME daemon is not currently installed.'` + exit 1 + fi + elif [ -f /etc/lsb-release -o -f /etc/debian_version -o -f /etc/debian_release ] ; then + eval echo `gettext 'Detected Ubuntu or Debian:'` + if [ -f "/etc/init.d/$APP_NAME" -o -L "/etc/init.d/$APP_NAME" ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon from init.d...'` + update-rc.d -f "$APP_NAME" remove + rm -f "/etc/init.d/$APP_NAME" + elif [ -n "$USE_SYSTEMD" -a -f "${SYSTEMD_SERVICE_FILE}" ] ; then + systemdRemove + elif [ -f "/etc/init/${APP_NAME}.conf" ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon from upstart...'` + rm "/etc/init/${APP_NAME}.conf" + else + eval echo `gettext ' The $APP_LONG_NAME daemon is not currently installed.'` + exit 1 + fi + else + eval echo `gettext 'Detected Linux:'` + if [ -f "/etc/init.d/$APP_NAME" -o -L "/etc/init.d/$APP_NAME" ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon...'` + for i in `ls "/etc/rc3.d/K"??"$APP_NAME_LOWER" "/etc/rc5.d/K"??"$APP_NAME_LOWER" "/etc/rc3.d/S"??"$APP_NAME_LOWER" "/etc/rc5.d/S"??"$APP_NAME_LOWER" "/etc/init.d/$APP_NAME" 2>/dev/null` ; do + rm -f $i + done + else + eval echo `gettext ' The $APP_LONG_NAME daemon is not currently installed.'` + exit 1 + fi + fi + elif [ "$DIST_OS" = "hpux" ] ; then + eval echo `gettext 'Detected HP-UX:'` + if [ -f "/sbin/init.d/$APP_NAME" -o -L "/sbin/init.d/$APP_NAME" ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon...'` + for i in `ls "/sbin/rc3.d/K"??"$APP_NAME_LOWER" "/sbin/rc3.d/S"??"$APP_NAME_LOWER" "/sbin/init.d/$APP_NAME" 2>/dev/null` ; do + rm -f $i + done + else + eval echo `gettext ' The $APP_LONG_NAME daemon is not currently installed.'` + exit 1 + fi + elif [ "$DIST_OS" = "aix" ] ; then + eval echo `gettext 'Detected AIX:'` + validateAppNameLength + if [ -f "/etc/rc.d/init.d/$APP_NAME" -o -L "/etc/rc.d/init.d/$APP_NAME" -o -n "`/usr/sbin/lsitab $APP_NAME`" -o -n "`/usr/bin/lssrc -S -s $APP_NAME`" ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon...'` + if [ -f "/etc/rc.d/init.d/$APP_NAME" -o -L "/etc/rc.d/init.d/$APP_NAME" ] ; then + for i in `ls "/etc/rc.d/rc2.d/K"??"$APP_NAME_LOWER" "/etc/rc.d/rc2.d/S"??"$APP_NAME_LOWER" "/etc/rc.d/init.d/$APP_NAME" 2>/dev/null` ; do + rm -f $i + done + fi + if [ -n "`/usr/sbin/lsitab $APP_NAME`" -o -n "`/usr/bin/lssrc -S -s $APP_NAME`" ] ; then + /usr/sbin/rmitab $APP_NAME + /usr/bin/rmssys -s $APP_NAME + fi + else + eval echo `gettext ' The $APP_LONG_NAME daemon is not currently installed.'` + exit 1 + fi + elif [ "$DIST_OS" = "freebsd" ] ; then + eval echo `gettext 'Detected FreeBSD:'` + if [ -f "/etc/rc.d/$APP_NAME" -o -L "/etc/rc.d/$APP_NAME" ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon...'` + for i in "/etc/rc.d/$APP_NAME" + do + rm -f $i + done + sed -i .bak "/${APP_NAME}_enable=\"YES\"/d" /etc/rc.conf + else + eval echo `gettext ' The $APP_LONG_NAME daemon is not currently installed.'` + exit 1 + fi + elif [ "$DIST_OS" = "macosx" ] ; then + eval echo `gettext 'Detected Mac OSX:'` + if [ -f "/Library/LaunchDaemons/${APP_PLIST}" -o -L "/Library/LaunchDaemons/${APP_PLIST}" ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon...'` + # Make sure the plist is installed + LOADED_PLIST=`launchctl list | grep ${APP_PLIST_BASE}` + if [ "X${LOADED_PLIST}" != "X" ] ; then + launchctl unload "/Library/LaunchDaemons/${APP_PLIST}" + fi + rm -f "/Library/LaunchDaemons/${APP_PLIST}" + else + eval echo `gettext ' The $APP_LONG_NAME daemon is not currently installed.'` + exit 1 + fi + elif [ "$DIST_OS" = "zos" ] ; then + eval echo `gettext 'Detected z/OS:'` + if [ -f /etc/rc.bak ] ; then + stopit "0" + eval echo `gettext ' Removing $APP_LONG_NAME daemon...'` + cp /etc/rc /etc/rc.bak + sed "s/_BPX_JOBNAME=\'APP_NAME\'.*//g" /etc/rc.bak > /etc/rc + rm /etc/rc.bak + else + eval echo `gettext ' The $APP_LONG_NAME daemon is not currently installed.'` + exit 1 + fi + else + eval echo `gettext 'Remove not currently supported for $DIST_OS'` + exit 1 + fi +} + +dump() { + eval echo `gettext 'Dumping $APP_LONG_NAME...'` + getpid + if [ "X$pid" = "X" ] + then + eval echo `gettext '$APP_LONG_NAME was not running.'` + else + kill -3 $pid + + if [ $? -ne 0 ] + then + eval echo `gettext 'Failed to dump $APP_LONG_NAME.'` + exit 1 + else + eval echo `gettext 'Dumped $APP_LONG_NAME.'` + fi + fi +} + +# Used by HP-UX init scripts. +startmsg() { + getpid + if [ "X$pid" = "X" ] + then + eval echo `gettext 'Starting $APP_LONG_NAME... Wrapper:Stopped'` + else + if [ "X$DETAIL_STATUS" = "X" ] + then + eval echo `gettext 'Starting $APP_LONG_NAME... Wrapper:Running'` + else + getstatus + eval echo `gettext 'Starting $APP_LONG_NAME... Wrapper:$STATUS, Java:$JAVASTATUS'` + fi + fi +} + +# Used by HP-UX init scripts. +stopmsg() { + getpid + if [ "X$pid" = "X" ] + then + eval echo `gettext 'Stopping $APP_LONG_NAME... Wrapper:Stopped'` + else + if [ "X$DETAIL_STATUS" = "X" ] + then + eval echo `gettext 'Stopping $APP_LONG_NAME... Wrapper:Running'` + else + getstatus + eval echo `gettext 'Stopping $APP_LONG_NAME... Wrapper:$STATUS, Java:$JAVASTATUS'` + fi + fi +} + +showUsage() { + # $1 bad command + + if [ -n "$1" ] + then + eval echo `gettext 'Unexpected command: $1'` + echo ""; + fi + + eval MSG=`gettext 'Usage: '` + if [ -n "$FIXED_COMMAND" ] ; then + if [ -n "$PASS_THROUGH" ] ; then + echo "${MSG} $0 {JavaAppArgs}" + else + echo "${MSG} $0" + fi + else + if [ -n "$PAUSABLE" ] ; then + if [ -n "$PASS_THROUGH" ] ; then + echo "${MSG} $0 [ console {JavaAppArgs} | start {JavaAppArgs} | stop | restart {JavaAppArgs} | condrestart {JavaAppArgs} | pause | resume | status | install | installstart | remove | dump ]" + else + echo "${MSG} $0 [ console | start | stop | restart | condrestart | pause | resume | status | install | installstart | remove | dump ]" + fi + else + if [ -n "$PASS_THROUGH" ] ; then + echo "${MSG} $0 [ console {JavaAppArgs} | start {JavaAppArgs} | stop | restart {JavaAppArgs} | condrestart {JavaAppArgs} | status | install | installstart | remove | dump ]" + else + echo "${MSG} $0 [ console | start | stop | restart | condrestart | status | install | installstart | remove | dump ]" + fi + fi + fi + + if [ ! -n "$BRIEF_USAGE" ] + then + echo ""; + if [ ! -n "$FIXED_COMMAND" ] ; then + echo "`gettext 'Commands:'`" + echo "`gettext ' console Launch in the current console.'`" + echo "`gettext ' start Start in the background as a daemon process.'`" + echo "`gettext ' stop Stop if running as a daemon or in another console.'`" + echo "`gettext ' restart Stop if running and then start.'`" + echo "`gettext ' condrestart Restart only if already running.'`" + if [ -n "$PAUSABLE" ] ; then + echo "`gettext ' pause Pause if running.'`" + echo "`gettext ' resume Resume if paused.'`" + fi + echo "`gettext ' status Query the current status.'`" + echo "`gettext ' install Install to start automatically when system boots.'`" + echo "`gettext ' installstart Install and start running as a daemon process.'`" + echo "`gettext ' remove Uninstall.'`" + echo "`gettext ' dump Request a Java thread dump if running.'`" + echo ""; + fi + if [ -n "$PASS_THROUGH" ] ; then + echo "`gettext 'JavaAppArgs: Zero or more arguments which will be passed to the Java application.'`" + echo ""; + fi + fi + + exit 1 +} + +docommand() { + case "$COMMAND" in + 'console') + checkUser touchlock "$@" + if [ ! -n "$FIXED_COMMAND" ] ; then + shift + fi + console "$@" + ;; + + 'start') + startdaemon "$@" + ;; + + 'stop') + if [ "$DIST_OS" = "macosx" -a -f "/Library/LaunchDaemons/${APP_PLIST}" ] ; then + macosxStop + elif [ "$DIST_OS" = "linux" -a -f "/etc/init/${APP_NAME}.conf" ] ; then + upstartStop + elif [ "$DIST_OS" = "linux" -a -n "$USE_SYSTEMD" -a -z "$SYSD" ] ; then + systemdStop + elif [ "$DIST_OS" = "aix" ] && [ "`/usr/bin/lssrc -S -s $APP_NAME`" ] ; then + srcStop + else + checkUser "" "$COMMAND" + stopit "0" + fi + ;; + + 'restart') + if [ "$DIST_OS" = "macosx" ] ; then + if [ ! -f "/Library/LaunchDaemons/${APP_PLIST}" ] ; then + eval echo `gettext '$APP_NAME was not installed.'` + else + macosxRestart + fi + elif [ "$DIST_OS" = "linux" -a -f "/etc/init/${APP_NAME}.conf" ] ; then + upstartRestart + elif [ "$DIST_OS" = "linux" -a -n "$USE_SYSTEMD" -a -z "$SYSD" ] ; then + systemdRestart + elif [ "$DIST_OS" = "aix" ] && [ "`/usr/bin/lssrc -S -s $APP_NAME`" ] ; then + srcRestart + else + if [ -n "$SMF" ] ; then + shift + fi + checkUser touchlock "$COMMAND" + if [ ! -n "$FIXED_COMMAND" ] ; then + shift + fi + stopit "0" + start "$@" + fi + ;; + + 'condrestart') + checkUser touchlock "$COMMAND" + if [ ! -n "$FIXED_COMMAND" ] ; then + shift + fi + stopit "1" + start "$@" + ;; + + 'pause') + if [ -n "$PAUSABLE" ] + then + pause + else + showUsage "$COMMAND" + fi + ;; + + 'resume') + if [ -n "$PAUSABLE" ] + then + resume + else + showUsage "$COMMAND" + fi + ;; + + 'status') + status + ;; + + 'install') + installdaemon "$@" + ;; + + 'installstart') + installdaemon "$@" + startdaemon "$@" + ;; + + 'remove') + removedaemon + ;; + + 'dump') + checkUser "" "$COMMAND" + dump + ;; + + 'start_msg') + # Internal command called by launchd on HP-UX. + checkUser "" "$COMMAND" + startmsg + ;; + + 'stop_msg') + # Internal command called by launchd on HP-UX. + checkUser "" "$COMMAND" + stopmsg + ;; + + 'launchdinternal' | 'upstartinternal') + if [ ! "$DIST_OS" = "macosx" -o ! -f "/Library/LaunchDaemons/${APP_PLIST}" ] ; then + checkUser touchlock "$@" + fi + # Internal command called by launchd on Max OSX. + # We do not want to call checkUser here as it is handled in the launchd plist file. Doing it here would confuse launchd. + if [ ! -n "$FIXED_COMMAND" ] ; then + shift + fi + launchinternal "$@" + ;; + + *) + showUsage "$COMMAND" + ;; + esac +} + +docommand "$@" + +exit 0 diff --git a/food-open/food-open-web/src/main/bin/pause.bat b/food-open/food-open-web/src/main/bin/pause.bat new file mode 100644 index 0000000..65a2166 --- /dev/null +++ b/food-open/food-open-web/src/main/bin/pause.bat @@ -0,0 +1,135 @@ +@echo off +setlocal + +rem +rem Copyright (c) 1999, 2016 Tanuki Software, Ltd. +rem http://www.tanukisoftware.com +rem All rights reserved. +rem +rem This software is the proprietary information of Tanuki Software. +rem You shall use it only in accordance with the terms of the +rem license agreement you entered into with Tanuki Software. +rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html +rem +rem Java Service Wrapper general startup script. +rem + +rem ----------------------------------------------------------------------------- +rem These settings can be modified to fit the needs of your application +rem Optimized for use with version 3.5.28 of the Wrapper. + +rem The base name for the Wrapper binary. +set _WRAPPER_BASE=wrapper + +rem The directory where the Wrapper binary (.exe) file is located. It can be +rem either an absolute or a relative path. If the path contains any special +rem characters, please make sure to quote the variable. +set _WRAPPER_DIR= + +rem The name and location of the Wrapper configuration file. This will be used +rem if the user does not specify a configuration file as the first parameter to +rem this script. +set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf" + +rem Makes it possible to override the Wrapper configuration file by specifying it +rem as the first parameter. +rem set _WRAPPER_CONF_OVERRIDE=true + +rem Note that it is only possible to pass parameters through to the JVM when +rem installing the service, or when running in a console. + +rem Do not modify anything beyond this point +rem ----------------------------------------------------------------------------- + +rem +rem Resolve the real path of the wrapper.exe +rem For non NT systems, the _REALPATH and _WRAPPER_CONF values +rem can be hard-coded below and the following test removed. +rem +if "%OS%"=="Windows_NT" goto nt +echo This script only works with NT-based versions of Windows. +goto :eof + +:nt +rem Find the application home. +rem if no path path specified do the default action +IF not DEFINED _WRAPPER_DIR goto dir_undefined +set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%" +if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\" +rem check if absolute path +if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path +if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path +rem everythig else means relative path +set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%" +goto pathfound + +:dir_undefined +rem Use a relative path to the wrapper %~dp0 is location of current script under NT +set _REALPATH="%~dp0" +goto pathfound +:absolute_path +rem Use an absolute path to the wrapper +set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%" + +:pathfound +rem +rem Decide on the specific Wrapper binary to use (See delta-pack) +rem +if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe" +goto search +:amd64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe" +goto search +:ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe" +goto search +:search +set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%" +if exist %_WRAPPER_EXE% goto conf +set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe" +if exist %_WRAPPER_EXE% goto conf +echo Unable to locate a Wrapper executable using any of the following names: +echo %_WRAPPER_L_EXE% +echo %_WRAPPER_EXE% +pause +goto :eof + +rem +rem Find the wrapper.conf +rem +:conf +if [%_WRAPPER_CONF_OVERRIDE%]==[true] ( + set _WRAPPER_CONF="%~f1" + if not [%_WRAPPER_CONF%]==[""] ( + shift + goto :startup + ) +) +set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%" + +rem +rem Start the Wrapper +rem +:startup +if not [%_PASS_THROUGH%]==[true] ( + if not [%1]==[] ( + echo WARNING: Extra arguments will be ignored. Please check usage in the batch file. + ) +) + +rem Collect the application parameters +:parameters +set _PARAMETERS=%_PARAMETERS% %1 +shift +if not [%1]==[] goto :parameters + +if not [%_PASS_THROUGH%]==[true] ( + %_WRAPPER_EXE% -a %_WRAPPER_CONF% +) else ( + %_WRAPPER_EXE% -a %_WRAPPER_CONF% -- %_PARAMETERS% +) +if not errorlevel 1 goto :eof +pause diff --git a/food-open/food-open-web/src/main/bin/query.bat b/food-open/food-open-web/src/main/bin/query.bat new file mode 100644 index 0000000..5638a44 --- /dev/null +++ b/food-open/food-open-web/src/main/bin/query.bat @@ -0,0 +1,135 @@ +@echo off +setlocal + +rem +rem Copyright (c) 1999, 2016 Tanuki Software, Ltd. +rem http://www.tanukisoftware.com +rem All rights reserved. +rem +rem This software is the proprietary information of Tanuki Software. +rem You shall use it only in accordance with the terms of the +rem license agreement you entered into with Tanuki Software. +rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html +rem +rem Java Service Wrapper general startup script. +rem + +rem ----------------------------------------------------------------------------- +rem These settings can be modified to fit the needs of your application +rem Optimized for use with version 3.5.28 of the Wrapper. + +rem The base name for the Wrapper binary. +set _WRAPPER_BASE=wrapper + +rem The directory where the Wrapper binary (.exe) file is located. It can be +rem either an absolute or a relative path. If the path contains any special +rem characters, please make sure to quote the variable. +set _WRAPPER_DIR= + +rem The name and location of the Wrapper configuration file. This will be used +rem if the user does not specify a configuration file as the first parameter to +rem this script. +set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf" + +rem Makes it possible to override the Wrapper configuration file by specifying it +rem as the first parameter. +rem set _WRAPPER_CONF_OVERRIDE=true + +rem Note that it is only possible to pass parameters through to the JVM when +rem installing the service, or when running in a console. + +rem Do not modify anything beyond this point +rem ----------------------------------------------------------------------------- + +rem +rem Resolve the real path of the wrapper.exe +rem For non NT systems, the _REALPATH and _WRAPPER_CONF values +rem can be hard-coded below and the following test removed. +rem +if "%OS%"=="Windows_NT" goto nt +echo This script only works with NT-based versions of Windows. +goto :eof + +:nt +rem Find the application home. +rem if no path path specified do the default action +IF not DEFINED _WRAPPER_DIR goto dir_undefined +set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%" +if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\" +rem check if absolute path +if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path +if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path +rem everythig else means relative path +set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%" +goto pathfound + +:dir_undefined +rem Use a relative path to the wrapper %~dp0 is location of current script under NT +set _REALPATH="%~dp0" +goto pathfound +:absolute_path +rem Use an absolute path to the wrapper +set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%" + +:pathfound +rem +rem Decide on the specific Wrapper binary to use (See delta-pack) +rem +if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe" +goto search +:amd64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe" +goto search +:ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe" +goto search +:search +set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%" +if exist %_WRAPPER_EXE% goto conf +set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe" +if exist %_WRAPPER_EXE% goto conf +echo Unable to locate a Wrapper executable using any of the following names: +echo %_WRAPPER_L_EXE% +echo %_WRAPPER_EXE% +pause +goto :eof + +rem +rem Find the wrapper.conf +rem +:conf +if [%_WRAPPER_CONF_OVERRIDE%]==[true] ( + set _WRAPPER_CONF="%~f1" + if not [%_WRAPPER_CONF%]==[""] ( + shift + goto :startup + ) +) +set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%" + +rem +rem Start the Wrapper +rem +:startup +if not [%_PASS_THROUGH%]==[true] ( + if not [%1]==[] ( + echo WARNING: Extra arguments will be ignored. Please check usage in the batch file. + ) +) + +rem Collect the application parameters +:parameters +set _PARAMETERS=%_PARAMETERS% %1 +shift +if not [%1]==[] goto :parameters + +if not [%_PASS_THROUGH%]==[true] ( + %_WRAPPER_EXE% -q %_WRAPPER_CONF% +) else ( + %_WRAPPER_EXE% -q %_WRAPPER_CONF% -- %_PARAMETERS% +) +if not errorlevel 1 goto :eof +pause diff --git a/food-open/food-open-web/src/main/bin/resume.bat b/food-open/food-open-web/src/main/bin/resume.bat new file mode 100644 index 0000000..8b4d6ea --- /dev/null +++ b/food-open/food-open-web/src/main/bin/resume.bat @@ -0,0 +1,135 @@ +@echo off +setlocal + +rem +rem Copyright (c) 1999, 2016 Tanuki Software, Ltd. +rem http://www.tanukisoftware.com +rem All rights reserved. +rem +rem This software is the proprietary information of Tanuki Software. +rem You shall use it only in accordance with the terms of the +rem license agreement you entered into with Tanuki Software. +rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html +rem +rem Java Service Wrapper general startup script. +rem + +rem ----------------------------------------------------------------------------- +rem These settings can be modified to fit the needs of your application +rem Optimized for use with version 3.5.28 of the Wrapper. + +rem The base name for the Wrapper binary. +set _WRAPPER_BASE=wrapper + +rem The directory where the Wrapper binary (.exe) file is located. It can be +rem either an absolute or a relative path. If the path contains any special +rem characters, please make sure to quote the variable. +set _WRAPPER_DIR= + +rem The name and location of the Wrapper configuration file. This will be used +rem if the user does not specify a configuration file as the first parameter to +rem this script. +set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf" + +rem Makes it possible to override the Wrapper configuration file by specifying it +rem as the first parameter. +rem set _WRAPPER_CONF_OVERRIDE=true + +rem Note that it is only possible to pass parameters through to the JVM when +rem installing the service, or when running in a console. + +rem Do not modify anything beyond this point +rem ----------------------------------------------------------------------------- + +rem +rem Resolve the real path of the wrapper.exe +rem For non NT systems, the _REALPATH and _WRAPPER_CONF values +rem can be hard-coded below and the following test removed. +rem +if "%OS%"=="Windows_NT" goto nt +echo This script only works with NT-based versions of Windows. +goto :eof + +:nt +rem Find the application home. +rem if no path path specified do the default action +IF not DEFINED _WRAPPER_DIR goto dir_undefined +set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%" +if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\" +rem check if absolute path +if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path +if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path +rem everythig else means relative path +set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%" +goto pathfound + +:dir_undefined +rem Use a relative path to the wrapper %~dp0 is location of current script under NT +set _REALPATH="%~dp0" +goto pathfound +:absolute_path +rem Use an absolute path to the wrapper +set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%" + +:pathfound +rem +rem Decide on the specific Wrapper binary to use (See delta-pack) +rem +if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe" +goto search +:amd64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe" +goto search +:ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe" +goto search +:search +set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%" +if exist %_WRAPPER_EXE% goto conf +set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe" +if exist %_WRAPPER_EXE% goto conf +echo Unable to locate a Wrapper executable using any of the following names: +echo %_WRAPPER_L_EXE% +echo %_WRAPPER_EXE% +pause +goto :eof + +rem +rem Find the wrapper.conf +rem +:conf +if [%_WRAPPER_CONF_OVERRIDE%]==[true] ( + set _WRAPPER_CONF="%~f1" + if not [%_WRAPPER_CONF%]==[""] ( + shift + goto :startup + ) +) +set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%" + +rem +rem Start the Wrapper +rem +:startup +if not [%_PASS_THROUGH%]==[true] ( + if not [%1]==[] ( + echo WARNING: Extra arguments will be ignored. Please check usage in the batch file. + ) +) + +rem Collect the application parameters +:parameters +set _PARAMETERS=%_PARAMETERS% %1 +shift +if not [%1]==[] goto :parameters + +if not [%_PASS_THROUGH%]==[true] ( + %_WRAPPER_EXE% -e %_WRAPPER_CONF% +) else ( + %_WRAPPER_EXE% -e %_WRAPPER_CONF% -- %_PARAMETERS% +) +if not errorlevel 1 goto :eof +pause diff --git a/food-open/food-open-web/src/main/bin/run.bat b/food-open/food-open-web/src/main/bin/run.bat new file mode 100644 index 0000000..8672708 --- /dev/null +++ b/food-open/food-open-web/src/main/bin/run.bat @@ -0,0 +1,156 @@ +@echo off +setlocal + +rem +rem Copyright (c) 1999, 2016 Tanuki Software, Ltd. +rem http://www.tanukisoftware.com +rem All rights reserved. +rem +rem This software is the proprietary information of Tanuki Software. +rem You shall use it only in accordance with the terms of the +rem license agreement you entered into with Tanuki Software. +rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html +rem +rem Java Service Wrapper general passthrough startup script. +rem + +rem ----------------------------------------------------------------------------- +rem These settings can be modified to fit the needs of your application +rem Optimized for use with version 3.5.28 of the Wrapper. +rem +rem ******************************************************************** +rem NOTE - This script has been modified to run the TestWrapper sample +rem application and should NOT be used as a base for your own +rem applications. All of the documentation assumes that you are +rem working from the default source script: +rem WRAPPER_HOME/src/bin/App.bat.in +rem ******************************************************************** +rem +rem ******************************************************************** +rem NOTE - This script has been modified to run the TestWrapper sample +rem application and should NOT be used as a base for your own +rem applications. All of the documentation assumes that you are +rem working from the default source script: +rem WRAPPER_HOME/src/bin/App.bat.in +rem ******************************************************************** + +rem The base name for the Wrapper binary. +set _WRAPPER_BASE=wrapper + +rem The directory where the Wrapper binary (.exe) file is located. It can be +rem either an absolute or a relative path. If the path contains any special +rem characters, please make sure to quote the variable. +set _WRAPPER_DIR= + +rem The name and location of the Wrapper configuration file. This will be used +rem if the user does not specify a configuration file as the first parameter to +rem this script. +set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf" + +rem Makes it possible to override the Wrapper configuration file by specifying it +rem as the first parameter. +rem set _WRAPPER_CONF_OVERRIDE=true + +rem _PASS_THROUGH tells the script to pass all parameters through to the JVM +rem as is. +rem If _WRAPPER_CONF_OVERRIDE is specified then all parameters will be passed. +rem If not set then all parameters starting with the second will be passed. +set _PASS_THROUGH=true + +rem Do not modify anything beyond this point +rem ----------------------------------------------------------------------------- + +rem +rem Resolve the real path of the wrapper.exe +rem For non NT systems, the _REALPATH and _WRAPPER_CONF values +rem can be hard-coded below and the following test removed. +rem +if "%OS%"=="Windows_NT" goto nt +echo This script only works with NT-based versions of Windows. +goto :eof + +:nt +rem Find the application home. +rem if no path path specified do the default action +IF not DEFINED _WRAPPER_DIR goto dir_undefined +set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%" +if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\" +rem check if absolute path +if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path +if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path +rem everythig else means relative path +set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%" +goto pathfound + +:dir_undefined +rem Use a relative path to the wrapper %~dp0 is location of current script under NT +set _REALPATH="%~dp0" +goto pathfound +:absolute_path +rem Use an absolute path to the wrapper +set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%" + +:pathfound +rem +rem Decide on the specific Wrapper binary to use (See delta-pack) +rem +if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe" +goto search +:amd64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe" +goto search +:ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe" +goto search +:search +set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%" +if exist %_WRAPPER_EXE% goto conf +set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe" +if exist %_WRAPPER_EXE% goto conf +echo Unable to locate a Wrapper executable using any of the following names: +echo %_WRAPPER_L_EXE% +echo %_WRAPPER_EXE% +pause +goto :eof + +rem +rem Find the wrapper.conf +rem +:conf +if [%_WRAPPER_CONF_OVERRIDE%]==[true] ( + set _WRAPPER_CONF="%~f1" + if not [%_WRAPPER_CONF%]==[""] ( + shift + goto :startup + ) +) +set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%" + +rem +rem Start the Wrapper +rem +:startup +if not [%_PASS_THROUGH%]==[true] ( + if not [%1]==[] ( + echo WARNING: Extra arguments will be ignored. Please check usage in the batch file. + ) +) + +rem Collect the application parameters +:parameters +set _PARAMETERS=%_PARAMETERS% %1 +shift +if not [%1]==[] goto :parameters + +if not [%_PASS_THROUGH%]==[true] ( + %_WRAPPER_EXE% -c %_WRAPPER_CONF% +) else ( + %_WRAPPER_EXE% -c %_WRAPPER_CONF% -- %_PARAMETERS% +) +if not errorlevel 1 goto :eof +pause + + diff --git a/food-open/food-open-web/src/main/bin/start.bat b/food-open/food-open-web/src/main/bin/start.bat new file mode 100644 index 0000000..d7d5e85 --- /dev/null +++ b/food-open/food-open-web/src/main/bin/start.bat @@ -0,0 +1,135 @@ +@echo off +setlocal + +rem +rem Copyright (c) 1999, 2016 Tanuki Software, Ltd. +rem http://www.tanukisoftware.com +rem All rights reserved. +rem +rem This software is the proprietary information of Tanuki Software. +rem You shall use it only in accordance with the terms of the +rem license agreement you entered into with Tanuki Software. +rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html +rem +rem Java Service Wrapper general startup script. +rem + +rem ----------------------------------------------------------------------------- +rem These settings can be modified to fit the needs of your application +rem Optimized for use with version 3.5.28 of the Wrapper. + +rem The base name for the Wrapper binary. +set _WRAPPER_BASE=wrapper + +rem The directory where the Wrapper binary (.exe) file is located. It can be +rem either an absolute or a relative path. If the path contains any special +rem characters, please make sure to quote the variable. +set _WRAPPER_DIR= + +rem The name and location of the Wrapper configuration file. This will be used +rem if the user does not specify a configuration file as the first parameter to +rem this script. +set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf" + +rem Makes it possible to override the Wrapper configuration file by specifying it +rem as the first parameter. +rem set _WRAPPER_CONF_OVERRIDE=true + +rem Note that it is only possible to pass parameters through to the JVM when +rem installing the service, or when running in a console. + +rem Do not modify anything beyond this point +rem ----------------------------------------------------------------------------- + +rem +rem Resolve the real path of the wrapper.exe +rem For non NT systems, the _REALPATH and _WRAPPER_CONF values +rem can be hard-coded below and the following test removed. +rem +if "%OS%"=="Windows_NT" goto nt +echo This script only works with NT-based versions of Windows. +goto :eof + +:nt +rem Find the application home. +rem if no path path specified do the default action +IF not DEFINED _WRAPPER_DIR goto dir_undefined +set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%" +if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\" +rem check if absolute path +if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path +if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path +rem everythig else means relative path +set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%" +goto pathfound + +:dir_undefined +rem Use a relative path to the wrapper %~dp0 is location of current script under NT +set _REALPATH="%~dp0" +goto pathfound +:absolute_path +rem Use an absolute path to the wrapper +set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%" + +:pathfound +rem +rem Decide on the specific Wrapper binary to use (See delta-pack) +rem +if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe" +goto search +:amd64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe" +goto search +:ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe" +goto search +:search +set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%" +if exist %_WRAPPER_EXE% goto conf +set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe" +if exist %_WRAPPER_EXE% goto conf +echo Unable to locate a Wrapper executable using any of the following names: +echo %_WRAPPER_L_EXE% +echo %_WRAPPER_EXE% +pause +goto :eof + +rem +rem Find the wrapper.conf +rem +:conf +if [%_WRAPPER_CONF_OVERRIDE%]==[true] ( + set _WRAPPER_CONF="%~f1" + if not [%_WRAPPER_CONF%]==[""] ( + shift + goto :startup + ) +) +set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%" + +rem +rem Start the Wrapper +rem +:startup +if not [%_PASS_THROUGH%]==[true] ( + if not [%1]==[] ( + echo WARNING: Extra arguments will be ignored. Please check usage in the batch file. + ) +) + +rem Collect the application parameters +:parameters +set _PARAMETERS=%_PARAMETERS% %1 +shift +if not [%1]==[] goto :parameters + +if not [%_PASS_THROUGH%]==[true] ( + %_WRAPPER_EXE% -t %_WRAPPER_CONF% +) else ( + %_WRAPPER_EXE% -t %_WRAPPER_CONF% -- %_PARAMETERS% +) +if not errorlevel 1 goto :eof +pause diff --git a/food-open/food-open-web/src/main/bin/stop.bat b/food-open/food-open-web/src/main/bin/stop.bat new file mode 100644 index 0000000..49d717c --- /dev/null +++ b/food-open/food-open-web/src/main/bin/stop.bat @@ -0,0 +1,135 @@ +@echo off +setlocal + +rem +rem Copyright (c) 1999, 2016 Tanuki Software, Ltd. +rem http://www.tanukisoftware.com +rem All rights reserved. +rem +rem This software is the proprietary information of Tanuki Software. +rem You shall use it only in accordance with the terms of the +rem license agreement you entered into with Tanuki Software. +rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html +rem +rem Java Service Wrapper general startup script. +rem + +rem ----------------------------------------------------------------------------- +rem These settings can be modified to fit the needs of your application +rem Optimized for use with version 3.5.28 of the Wrapper. + +rem The base name for the Wrapper binary. +set _WRAPPER_BASE=wrapper + +rem The directory where the Wrapper binary (.exe) file is located. It can be +rem either an absolute or a relative path. If the path contains any special +rem characters, please make sure to quote the variable. +set _WRAPPER_DIR= + +rem The name and location of the Wrapper configuration file. This will be used +rem if the user does not specify a configuration file as the first parameter to +rem this script. +set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf" + +rem Makes it possible to override the Wrapper configuration file by specifying it +rem as the first parameter. +rem set _WRAPPER_CONF_OVERRIDE=true + +rem Note that it is only possible to pass parameters through to the JVM when +rem installing the service, or when running in a console. + +rem Do not modify anything beyond this point +rem ----------------------------------------------------------------------------- + +rem +rem Resolve the real path of the wrapper.exe +rem For non NT systems, the _REALPATH and _WRAPPER_CONF values +rem can be hard-coded below and the following test removed. +rem +if "%OS%"=="Windows_NT" goto nt +echo This script only works with NT-based versions of Windows. +goto :eof + +:nt +rem Find the application home. +rem if no path path specified do the default action +IF not DEFINED _WRAPPER_DIR goto dir_undefined +set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%" +if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\" +rem check if absolute path +if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path +if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path +rem everythig else means relative path +set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%" +goto pathfound + +:dir_undefined +rem Use a relative path to the wrapper %~dp0 is location of current script under NT +set _REALPATH="%~dp0" +goto pathfound +:absolute_path +rem Use an absolute path to the wrapper +set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%" + +:pathfound +rem +rem Decide on the specific Wrapper binary to use (See delta-pack) +rem +if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe" +goto search +:amd64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe" +goto search +:ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe" +goto search +:search +set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%" +if exist %_WRAPPER_EXE% goto conf +set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe" +if exist %_WRAPPER_EXE% goto conf +echo Unable to locate a Wrapper executable using any of the following names: +echo %_WRAPPER_L_EXE% +echo %_WRAPPER_EXE% +pause +goto :eof + +rem +rem Find the wrapper.conf +rem +:conf +if [%_WRAPPER_CONF_OVERRIDE%]==[true] ( + set _WRAPPER_CONF="%~f1" + if not [%_WRAPPER_CONF%]==[""] ( + shift + goto :startup + ) +) +set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%" + +rem +rem Start the Wrapper +rem +:startup +if not [%_PASS_THROUGH%]==[true] ( + if not [%1]==[] ( + echo WARNING: Extra arguments will be ignored. Please check usage in the batch file. + ) +) + +rem Collect the application parameters +:parameters +set _PARAMETERS=%_PARAMETERS% %1 +shift +if not [%1]==[] goto :parameters + +if not [%_PASS_THROUGH%]==[true] ( + %_WRAPPER_EXE% -p %_WRAPPER_CONF% +) else ( + %_WRAPPER_EXE% -p %_WRAPPER_CONF% -- %_PARAMETERS% +) +if not errorlevel 1 goto :eof +pause diff --git a/food-open/food-open-web/src/main/bin/uninstall.bat b/food-open/food-open-web/src/main/bin/uninstall.bat new file mode 100644 index 0000000..6ee6d07 --- /dev/null +++ b/food-open/food-open-web/src/main/bin/uninstall.bat @@ -0,0 +1,135 @@ +@echo off +setlocal + +rem +rem Copyright (c) 1999, 2016 Tanuki Software, Ltd. +rem http://www.tanukisoftware.com +rem All rights reserved. +rem +rem This software is the proprietary information of Tanuki Software. +rem You shall use it only in accordance with the terms of the +rem license agreement you entered into with Tanuki Software. +rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html +rem +rem Java Service Wrapper general startup script. +rem + +rem ----------------------------------------------------------------------------- +rem These settings can be modified to fit the needs of your application +rem Optimized for use with version 3.5.28 of the Wrapper. + +rem The base name for the Wrapper binary. +set _WRAPPER_BASE=wrapper + +rem The directory where the Wrapper binary (.exe) file is located. It can be +rem either an absolute or a relative path. If the path contains any special +rem characters, please make sure to quote the variable. +set _WRAPPER_DIR= + +rem The name and location of the Wrapper configuration file. This will be used +rem if the user does not specify a configuration file as the first parameter to +rem this script. +set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf" + +rem Makes it possible to override the Wrapper configuration file by specifying it +rem as the first parameter. +rem set _WRAPPER_CONF_OVERRIDE=true + +rem Note that it is only possible to pass parameters through to the JVM when +rem installing the service, or when running in a console. + +rem Do not modify anything beyond this point +rem ----------------------------------------------------------------------------- + +rem +rem Resolve the real path of the wrapper.exe +rem For non NT systems, the _REALPATH and _WRAPPER_CONF values +rem can be hard-coded below and the following test removed. +rem +if "%OS%"=="Windows_NT" goto nt +echo This script only works with NT-based versions of Windows. +goto :eof + +:nt +rem Find the application home. +rem if no path path specified do the default action +IF not DEFINED _WRAPPER_DIR goto dir_undefined +set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%" +if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\" +rem check if absolute path +if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path +if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path +rem everythig else means relative path +set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%" +goto pathfound + +:dir_undefined +rem Use a relative path to the wrapper %~dp0 is location of current script under NT +set _REALPATH="%~dp0" +goto pathfound +:absolute_path +rem Use an absolute path to the wrapper +set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%" + +:pathfound +rem +rem Decide on the specific Wrapper binary to use (See delta-pack) +rem +if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64 +if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe" +goto search +:amd64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe" +goto search +:ia64 +set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe" +goto search +:search +set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%" +if exist %_WRAPPER_EXE% goto conf +set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe" +if exist %_WRAPPER_EXE% goto conf +echo Unable to locate a Wrapper executable using any of the following names: +echo %_WRAPPER_L_EXE% +echo %_WRAPPER_EXE% +pause +goto :eof + +rem +rem Find the wrapper.conf +rem +:conf +if [%_WRAPPER_CONF_OVERRIDE%]==[true] ( + set _WRAPPER_CONF="%~f1" + if not [%_WRAPPER_CONF%]==[""] ( + shift + goto :startup + ) +) +set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%" + +rem +rem Start the Wrapper +rem +:startup +if not [%_PASS_THROUGH%]==[true] ( + if not [%1]==[] ( + echo WARNING: Extra arguments will be ignored. Please check usage in the batch file. + ) +) + +rem Collect the application parameters +:parameters +set _PARAMETERS=%_PARAMETERS% %1 +shift +if not [%1]==[] goto :parameters + +if not [%_PASS_THROUGH%]==[true] ( + %_WRAPPER_EXE% -r %_WRAPPER_CONF% +) else ( + %_WRAPPER_EXE% -r %_WRAPPER_CONF% -- %_PARAMETERS% +) +if not errorlevel 1 goto :eof +pause diff --git a/food-open/food-open-web/src/main/bin/wrapper-linux-x86-32 b/food-open/food-open-web/src/main/bin/wrapper-linux-x86-32 new file mode 100644 index 0000000..ff3509f Binary files /dev/null and b/food-open/food-open-web/src/main/bin/wrapper-linux-x86-32 differ diff --git a/food-open/food-open-web/src/main/bin/wrapper-linux-x86-64 b/food-open/food-open-web/src/main/bin/wrapper-linux-x86-64 new file mode 100644 index 0000000..e72b0e0 Binary files /dev/null and b/food-open/food-open-web/src/main/bin/wrapper-linux-x86-64 differ diff --git a/food-open/food-open-web/src/main/bin/wrapper-macosx-universal-32 b/food-open/food-open-web/src/main/bin/wrapper-macosx-universal-32 new file mode 100644 index 0000000..9a36a5c Binary files /dev/null and b/food-open/food-open-web/src/main/bin/wrapper-macosx-universal-32 differ diff --git a/food-open/food-open-web/src/main/bin/wrapper-macosx-universal-64 b/food-open/food-open-web/src/main/bin/wrapper-macosx-universal-64 new file mode 100644 index 0000000..6587d2c Binary files /dev/null and b/food-open/food-open-web/src/main/bin/wrapper-macosx-universal-64 differ diff --git a/food-open/food-open-web/src/main/bin/wrapper-windows-x86-32.exe b/food-open/food-open-web/src/main/bin/wrapper-windows-x86-32.exe new file mode 100644 index 0000000..9762dbf Binary files /dev/null and b/food-open/food-open-web/src/main/bin/wrapper-windows-x86-32.exe differ diff --git a/food-open/food-open-web/src/main/bin/wrapper-windows-x86-64.exe b/food-open/food-open-web/src/main/bin/wrapper-windows-x86-64.exe new file mode 100644 index 0000000..122ec17 Binary files /dev/null and b/food-open/food-open-web/src/main/bin/wrapper-windows-x86-64.exe differ diff --git a/food-open/food-open-web/src/main/conf/wrapper.conf b/food-open/food-open-web/src/main/conf/wrapper.conf new file mode 100644 index 0000000..04d1b04 --- /dev/null +++ b/food-open/food-open-web/src/main/conf/wrapper.conf @@ -0,0 +1,60 @@ +encoding=UTF-8 +wrapper.lang=zh_CN +#using the system default JDK environment variable +wrapper.java.command=java +#set.JAVA_HOME=/home/jdk1.8.0_65 +#wrapper.java.command=%JAVA_HOME%/bin/java +wrapper.java.command.loglevel=INFO + +wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp +wrapper.java.classpath.1=./ +wrapper.java.classpath.2=../conf/ +wrapper.java.classpath.3=../lib/*.jar + +wrapper.java.library.path.1=../lib + +wrapper.java.additional.auto_bits=TRUE +#set the default parameters +wrapper.java.additional.1=-Xms512m +wrapper.java.additional.2=-Xmx1024m +wrapper.java.additional.3=-XX:PermSize=256m +wrapper.java.additional.4=-XX:MaxPermSize=512m +wrapper.java.additional.5=-Djava.net.preferIPv4Stack=true +wrapper.java.additional.6=-Dsun.lang.ClassLoader.allowArraySyntax=true + +# Initial Java Heap Size (in MB) +wrapper.java.initmemory=128 +# Maximum Java Heap Size (in MB) +wrapper.java.maxmemory=512 + +# Application parameters. Add parameters as needed starting from 1 +wrapper.app.parameter.1=org.springframework.boot.loader.JarLauncher +wrapper.app.parameter.2=--spring.config.location=../conf/application.properties +wrapper.app.parameter.3=--logging.config=../conf/logback.xml +wrapper.app.parameter.4=--logging.path=../logs + +wrapper.filter.trigger.1=java.lang.OutOfMemoryError +wrapper.filter.action.1=RESTART + +wrapper.console.format=PM +wrapper.console.loglevel=INFO + +wrapper.logfile=../logs/server_YYYYMMDD.log +wrapper.logfile.rollmode=DATE +wrapper.logfile.format=LPTM +wrapper.logfile.loglevel=INFO +wrapper.logfile.maxsize=0 +wrapper.logfile.maxfiles=0 +wrapper.syslog.loglevel=NONE + +wrapper.ignore_sequence_gaps=TRUE +wrapper.pidfile.strict=TRUE + +wrapper.console.title=Food-2.0 Open Web Application + +wrapper.name=food2_open_web +wrapper.displayname=Food-2.0 Open Web Application +wrapper.description=Food-2.0 Open Web Application +wrapper.ntservice.dependency.1= +wrapper.ntservice.starttype=AUTO_START +wrapper.ntservice.interactive=false diff --git a/food-open/food-open-web/src/main/java/com/jwsaas/Application.java b/food-open/food-open-web/src/main/java/com/jwsaas/Application.java new file mode 100644 index 0000000..997e073 --- /dev/null +++ b/food-open/food-open-web/src/main/java/com/jwsaas/Application.java @@ -0,0 +1,13 @@ +package com.jwsaas; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class Application { + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } + +} diff --git a/food-open/food-open-web/src/main/java/com/jwsaas/Global.java b/food-open/food-open-web/src/main/java/com/jwsaas/Global.java new file mode 100644 index 0000000..45cb259 --- /dev/null +++ b/food-open/food-open-web/src/main/java/com/jwsaas/Global.java @@ -0,0 +1,10 @@ +package com.jwsaas; + +public class Global { + + public static final String NAME = "开放接口文档"; + public static final String SIGN = "open"; + public static final String OPEN = "open"; + public static final String OPEN_PATH = "/" + OPEN; + +} diff --git a/food-open/food-open-web/src/main/java/com/jwsaas/controller/BaseController.java b/food-open/food-open-web/src/main/java/com/jwsaas/controller/BaseController.java new file mode 100644 index 0000000..f9b792f --- /dev/null +++ b/food-open/food-open-web/src/main/java/com/jwsaas/controller/BaseController.java @@ -0,0 +1,36 @@ +package com.jwsaas.controller; + +import javax.servlet.http.HttpServletRequest; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public abstract class BaseController { + + protected Logger logger = LoggerFactory.getLogger(getClass()); + + // 获取Parameter + public String getParameter(HttpServletRequest request, String name) { + return request.getParameter(name); + } + + // 获取Parameter数组 + public String[] getParameterValues(HttpServletRequest request, String name) { + return request.getParameterValues(name); + } + + public String getIpAddress(HttpServletRequest request) { + String ip = request.getHeader("x-forwarded-for"); + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("Proxy-Client-IP"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("WL-Proxy-Client-IP"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getRemoteAddr(); + } + return ip; + } + +} diff --git a/food-open/food-open-web/src/main/java/com/jwsaas/controller/IndexController.java b/food-open/food-open-web/src/main/java/com/jwsaas/controller/IndexController.java new file mode 100644 index 0000000..36787c3 --- /dev/null +++ b/food-open/food-open-web/src/main/java/com/jwsaas/controller/IndexController.java @@ -0,0 +1,15 @@ +package com.jwsaas.controller; + +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; + +@Controller +public class IndexController extends BaseController { + + @RequestMapping(value = { "", "index" }) + public String index(Model model) { + return "index"; + } + +} diff --git a/food-open/food-open-web/src/main/java/com/jwsaas/controller/open/IndexController.java b/food-open/food-open-web/src/main/java/com/jwsaas/controller/open/IndexController.java new file mode 100644 index 0000000..08862d4 --- /dev/null +++ b/food-open/food-open-web/src/main/java/com/jwsaas/controller/open/IndexController.java @@ -0,0 +1,121 @@ +package com.jwsaas.controller.open; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; + +import com.jwsaas.Global; + +@Controller(Global.SIGN + "IndexController") +@RequestMapping(Global.OPEN_PATH) +public class IndexController { + + private Logger logger = LoggerFactory.getLogger(getClass()); + + private static List needSession = new ArrayList<>(); + static { + // needSession.add("open/operator/change_pwd");// + // 操作员修改密码(operator.change.pwd) + // needSession.add("open/operator/logout");// 操作员登出(operator.logout) + // needSession.add("open/operator/download");// 操作员下载(operator.download) + } + + @RequestMapping(value = { "", "/index" }) + public String index(@RequestParam(required = false, value = "page") String value, Model model) { + + logger.debug("IndexController ====== value:" + value); + + if (StringUtils.isNotEmpty(value)) { + + if (isNeedSession(value)) { + model.addAttribute("requiredSessionId", "yes"); + } + + return value; + } + + return "open/index"; + } + + @RequestMapping(value = { "", "/third" }) + public String third(@RequestParam(required = false, value = "page") String value, Model model) { + if (StringUtils.isNotEmpty(value)) { + + if (isNeedSession(value)) { + model.addAttribute("requiredSessionId", "yes"); + } + + return value; + } + + return "open/third"; + } + + @RequestMapping(value = { "", "/thirdxiangtian" }) + public String thirdxiangtian(@RequestParam(required = false, value = "page") String value, Model model) { + if (StringUtils.isNotEmpty(value)) { + + if (isNeedSession(value)) { + model.addAttribute("requiredSessionId", "yes"); + } + + return value; + } + + return "open/third_xiangtian"; + } + + @RequestMapping(value = { "", "/boduoerp" }) + public String boDuoErp(@RequestParam(required = false, value = "page") String value, Model model) { + if (StringUtils.isNotEmpty(value)) { + + if (isNeedSession(value)) { + model.addAttribute("requiredSessionId", "yes"); + } + + return value; + } + + return "open/boduo/index"; + } + + @RequestMapping(value = { "", "/thirdboduo" }) + public String thirdboduo(@RequestParam(required = false, value = "page") String value, Model model) { + if (StringUtils.isNotEmpty(value)) { + + if (isNeedSession(value)) { + model.addAttribute("requiredSessionId", "yes"); + } + + return value; + } + + return "open/third_boduo"; + } + + @RequestMapping(value = { "", "/tidian" }) + public String Tidian(@RequestParam(required = false, value = "page") String value, Model model) { + if (StringUtils.isNotEmpty(value)) { + + if (isNeedSession(value)) { + model.addAttribute("requiredSessionId", "yes"); + } + + return value; + } + + return "open/tidian/index"; + } + + private boolean isNeedSession(String value) { + return needSession.contains(value); + } + +} diff --git a/food-open/food-open-web/src/main/java/com/jwsaas/freemarker/DefaultTemplateExceptionHandler.java b/food-open/food-open-web/src/main/java/com/jwsaas/freemarker/DefaultTemplateExceptionHandler.java new file mode 100644 index 0000000..58a8c7c --- /dev/null +++ b/food-open/food-open-web/src/main/java/com/jwsaas/freemarker/DefaultTemplateExceptionHandler.java @@ -0,0 +1,27 @@ +package com.jwsaas.freemarker; + +import java.io.IOException; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import freemarker.core.Environment; +import freemarker.template.TemplateException; +import freemarker.template.TemplateExceptionHandler; + +public class DefaultTemplateExceptionHandler implements TemplateExceptionHandler { + + private static final Logger logger = LoggerFactory.getLogger(DefaultTemplateExceptionHandler.class); + + public void handleTemplateException(TemplateException te, Environment env, java.io.Writer out) + throws TemplateException { + try { + logger.info("handleTemplateException"); + + out.write("[ERROR: " + te.getMessage() + "]"); + } catch (IOException e) { + throw new TemplateException("Failed to print error message. Cause: " + e, env); + } + } + +} diff --git a/food-open/food-open-web/src/main/lib/libwrapper-macosx-universal-32.jnilib b/food-open/food-open-web/src/main/lib/libwrapper-macosx-universal-32.jnilib new file mode 100644 index 0000000..ae75d31 Binary files /dev/null and b/food-open/food-open-web/src/main/lib/libwrapper-macosx-universal-32.jnilib differ diff --git a/food-open/food-open-web/src/main/lib/libwrapper-macosx-universal-64.jnilib b/food-open/food-open-web/src/main/lib/libwrapper-macosx-universal-64.jnilib new file mode 100644 index 0000000..e7d4102 Binary files /dev/null and b/food-open/food-open-web/src/main/lib/libwrapper-macosx-universal-64.jnilib differ diff --git a/food-open/food-open-web/src/main/lib/wrapper-windows-x86-32.dll b/food-open/food-open-web/src/main/lib/wrapper-windows-x86-32.dll new file mode 100644 index 0000000..6aaa9c1 Binary files /dev/null and b/food-open/food-open-web/src/main/lib/wrapper-windows-x86-32.dll differ diff --git a/food-open/food-open-web/src/main/lib/wrapper-windows-x86-64.dll b/food-open/food-open-web/src/main/lib/wrapper-windows-x86-64.dll new file mode 100644 index 0000000..81f11ce Binary files /dev/null and b/food-open/food-open-web/src/main/lib/wrapper-windows-x86-64.dll differ diff --git a/food-open/food-open-web/src/main/lib/wrapper.jar b/food-open/food-open-web/src/main/lib/wrapper.jar new file mode 100644 index 0000000..70dc5ab Binary files /dev/null and b/food-open/food-open-web/src/main/lib/wrapper.jar differ diff --git a/food-open/food-open-web/src/main/logs/safeToDelete.tmp b/food-open/food-open-web/src/main/logs/safeToDelete.tmp new file mode 100644 index 0000000..e69de29 diff --git a/food-open/food-open-web/src/main/resources/application.properties b/food-open/food-open-web/src/main/resources/application.properties new file mode 100644 index 0000000..a7f7870 --- /dev/null +++ b/food-open/food-open-web/src/main/resources/application.properties @@ -0,0 +1,24 @@ +#Global +global.encoding=UTF-8 +global.locale=zh_CN + +#ServerProperties +server.port=8100 +server.context-path=/openDoc +server.compression.enabled=true +server.compression.mime-types=text/html,text/xml,text/plain,text/css,application/json,application/xml +server.compression.min-response-size=2048 + +#FreeMarkerAutoConfiguration +spring.freemarker.cache=false +spring.freemarker.charset=${global.encoding} +#spring.freemarker.prefer-file-system-access=false +spring.freemarker.settings.template_exception_handler=com.jwsaas.freemarker.DefaultTemplateExceptionHandler +spring.freemarker.settings.auto_import=spring.ftl as spring + +# INTERNATIONALIZATION +#\u6307\u5b9amessage\u7684basename\uff0c\u591a\u4e2a\u4ee5\u9017\u53f7\u5206\u9694\uff0c\u5982\u679c\u4e0d\u52a0\u5305\u540d\u7684\u8bdd\uff0c\u9ed8\u8ba4\u4ececlasspath\u8def\u5f84\u5f00\u59cb\uff0c\u9ed8\u8ba4: messages +spring.messages.basename=i18n/messages +#\u8bbe\u5b9a\u52a0\u8f7d\u7684\u8d44\u6e90\u6587\u4ef6\u7f13\u5b58\u5931\u6548\u65f6\u95f4\uff0c-1\u7684\u8bdd\u4e3a\u6c38\u4e0d\u8fc7\u671f\uff0c\u9ed8\u8ba4\u4e3a-1 +spring.messages.cache-seconds=3600 + diff --git a/food-open/food-open-web/src/main/resources/i18n/messages.properties b/food-open/food-open-web/src/main/resources/i18n/messages.properties new file mode 100644 index 0000000..34776aa --- /dev/null +++ b/food-open/food-open-web/src/main/resources/i18n/messages.properties @@ -0,0 +1,5 @@ +project.name=Food\u5F00\u653E\u5E73\u53F0 +project.boduo.name=\u535A\u591A\u5F00\u653E\u5E73\u53F0 +project.description=Food\u5F00\u653E\u5E73\u53F0 +project.version=2.0 +project.softwareName=Food\u7CFB\u7EDF diff --git a/food-open/food-open-web/src/main/resources/logback.xml b/food-open/food-open-web/src/main/resources/logback.xml new file mode 100644 index 0000000..7e12361 --- /dev/null +++ b/food-open/food-open-web/src/main/resources/logback.xml @@ -0,0 +1,15 @@ + + + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%-5level] %logger{120} - %msg %n + + + + + + + + diff --git a/food-open/food-open-web/src/main/resources/static/assets/css/ace-fonts.css b/food-open/food-open-web/src/main/resources/static/assets/css/ace-fonts.css new file mode 100644 index 0000000..c08c134 --- /dev/null +++ b/food-open/food-open-web/src/main/resources/static/assets/css/ace-fonts.css @@ -0,0 +1,13 @@ +/* included only when we don't want to use fonts from google server */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 300; + src: local('Open Sans Light'), local('OpenSans-Light'), url(../fonts/OpenSans-300.woff) format('woff'); +} +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 400; + src: local('Open Sans'), local('OpenSans'), url(../fonts/OpenSans-400.woff) format('woff'); +} \ No newline at end of file diff --git a/food-open/food-open-web/src/main/resources/static/assets/css/ace-part2.css b/food-open/food-open-web/src/main/resources/static/assets/css/ace-part2.css new file mode 100644 index 0000000..4da02fa --- /dev/null +++ b/food-open/food-open-web/src/main/resources/static/assets/css/ace-part2.css @@ -0,0 +1,5715 @@ +.timeline-style2 .timeline-info { + width: 100px; +} +.timeline-style2 .timeline-indicator { + font-size: 0; + height: 12px; + line-height: 12px; + width: 12px; + border-width: 1px !important; + background-color: #FFFFFF !important; + position: absolute; + left: 85px; + top: 3px; + opacity: 1; + border-radius: 100%; + display: inline-block; + padding: 0; +} +.timeline-style2 .timeline-date { + display: inline-block; + width: 72px; + text-align: right; + margin-right: 25px; + color: #777; +} +.timeline-style2 .timeline-item .widget-box { + margin-left: 112px; +} +.timeline-style2 .timeline-label { + width: 75px; + text-align: center; + margin-left: 0; + margin-bottom: 10px; + text-align: right; + color: #666; + font-size: 14px; +} +.timeline-time { + text-align: center; + position: static; +} +.dataTables_length select { + width: 70px; + height: 25px; + padding: 2px 3px; +} +.dataTables_length label { + font-weight: normal; +} +.dataTables_filter { + text-align: right; +} +.dataTables_filter input[type=text], +.dataTables_filter input[type=search] { + width: 125px; + height: 18px; + line-height: 18px; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + padding: 4px 6px; +} +.dataTables_filter label { + font-weight: normal; +} +.dataTables_info { + font-size: 14px; +} +.dataTables_paginate { + text-align: right; +} +.dataTables_paginate .pagination { + margin: 0 12px; +} +.dataTables_wrapper label { + display: inline-block; + font-size: 13px; +} +.dataTables_wrapper input[type=text], +.dataTables_wrapper input[type=search], +.dataTables_wrapper select { + margin-bottom: 0 !important; + margin: 0 4px; +} +.dataTables_wrapper .row { + margin: 0 !important; +} +.dataTables_wrapper .row:first-child { + padding-top: 12px; + padding-bottom: 12px; + background-color: #EFF3F8; +} +.dataTables_wrapper .row:first-child + .dataTable { + border-top: 1px solid #dddddd; + border-bottom: 1px solid #dddddd; +} +.dataTables_wrapper .row:last-child { + border-bottom: 1px solid #e0e0e0; + padding-top: 12px; + padding-bottom: 12px; + background-color: #EFF3F8; +} +.dataTables_wrapper .dataTables_scroll + .row { + border-top: 1px solid #e0e0e0; +} +.dataTable { + margin-bottom: 0; +} +.dataTable > thead > tr > th[class*=sort] { + cursor: pointer; +} +.dataTable > thead > tr > th[class*=sort]:after { + float: right; + display: inline; + content: "\f0dc"; + font-family: FontAwesome; + font-size: 13px; + font-weight: normal; + color: #555; +} +.dataTable > thead > tr > th[class*=sort]:hover { + color: #547ea8; +} +.dataTable > thead > tr > th[class*=sorting_] { + color: #307ecc; +} +.dataTable > thead > tr > th.sorting_desc, +.dataTable > thead > tr > th.sorting_asc { + background-image: -webkit-linear-gradient(top, #eff3f8 0%, #e3e7ed 100%); + background-image: -o-linear-gradient(top, #eff3f8 0%, #e3e7ed 100%); + background-image: linear-gradient(to bottom, #eff3f8 0%, #e3e7ed 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffeff3f8', endColorstr='#ffe3e7ed', GradientType=0); +} +.dataTable > thead > tr > th.sorting_desc:after { + content: "\f0dd"; + top: -6px; + color: #307ecc; +} +.dataTable > thead > tr > th.sorting_asc:after { + content: "\f0de"; + top: 4px; + color: #307ecc; +} +.dataTable > thead > tr > th.sorting_disabled { + cursor: inherit; +} +.dataTable > thead > tr > th.sorting_disabled:after { + display: none; +} +.dataTables_scrollHead + .dataTables_scrollBody > .dataTable > thead > tr > th:after { + display: none; +} +.dataTables_scrollHeadInner { + width: auto !important; +} +.dataTables_scrollHeadInner > .dataTable > thead > tr > th { + border-bottom-width: 0 !important; +} +.dataTables_borderWrap .dataTables_scrollBody, +.dataTables_borderWrap .dataTables_scrollHead { + border: 1px solid #dddddd !important; + border-width: 0 1px !important; +} +.dataTables_borderWrap .dataTables_scrollBody .table-bordered, +.dataTables_borderWrap .dataTables_scrollHead .table-bordered { + border-left-width: 0; + border-right-width: 0; +} +.dataTables_borderWrap .dataTables_scrollBody .table-bordered > thead > tr > th:first-child, +.dataTables_borderWrap .dataTables_scrollHead .table-bordered > thead > tr > th:first-child, +.dataTables_borderWrap .dataTables_scrollBody .table-bordered > tbody > tr > td:first-child, +.dataTables_borderWrap .dataTables_scrollHead .table-bordered > tbody > tr > td:first-child { + border-left-width: 0; +} +.dataTables_borderWrap .dataTables_scrollBody .table-bordered > thead > tr > th:last-child, +.dataTables_borderWrap .dataTables_scrollHead .table-bordered > thead > tr > th:last-child, +.dataTables_borderWrap .dataTables_scrollBody .table-bordered > tbody > tr > td:last-child, +.dataTables_borderWrap .dataTables_scrollHead .table-bordered > tbody > tr > td:last-child { + border-right-width: 0; +} +table.dataTable { + clear: both; + max-width: none !important; +} +table.dataTable th:active { + outline: none; +} +div.dataTables_scrollHead table { + margin-bottom: 0 !important; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; +} +div.dataTables_scrollHead table thead tr:last-child th:first-child, +div.dataTables_scrollHead table thead tr:last-child td:first-child { + border-bottom-left-radius: 0 !important; + border-bottom-right-radius: 0 !important; +} +div.dataTables_scrollBody table { + border-top: none; + margin-top: 0 !important; + margin-bottom: 0 !important; +} +div.dataTables_scrollBody tbody tr:first-child th, +div.dataTables_scrollBody tbody tr:first-child td { + border-top: none; +} +div.dataTables_scrollFoot table { + margin-top: 0 !important; + border-top: none; +} +.DTTT_Print .main-content { + margin-left: 0 !important; + margin-right: 0 !important; +} +.DTTT_Print .navbar-fixed-top + .main-container { + padding-top: 0; +} +.tableTools-container { + margin-bottom: 8px; +} +.tableTools-alert.gritter-item-wrapper { + padding: 12px 11px 8px; + z-index: 1999; +} +ul.ColVis_collection { + z-index: 2002; +} +ul.ColVis_collection > li > a { + padding: 0; +} +ul.ColVis_collection > li > a:focus { + outline: none; +} +ul.ColVis_collection > li.ColVis_Special { + border-top: 1px solid #DDD; +} +ul.ColVis_collection > li.ColVis_Special > a { + padding: 6px 11px 7px; + text-align: center; +} +ul.ColVis_collection label { + margin: auto; + padding: 6px 11px 7px; + display: block; + cursor: pointer; +} +div.ColVis_catcher { + position: absolute; + z-index: 1101; +} +div.ColVis_collectionBackground { + position: fixed; + top: 0; + left: 0; + height: 100%; + width: 100%; + background-color: black; + z-index: 1100; +} +.fc-toolbar h2 { + font-size: 22px; + color: #65A0CE; +} +.fc-unthemed th, +.fc-unthemed td, +.fc-unthemed hr, +.fc-unthemed thead, +.fc-unthemed tbody, +.fc-unthemed .fc-row, +.fc-unthemed .fc-popover { + border-color: #BCD4E5; +} +.fc-unthemed .fc-today { + background: #FFC; +} +.fc-event { + border-width: 0; + color: #ffffff; + padding: 1px 1px 2px 2px; + border-radius: 0; +} +.fc-event:not([class*="label-"]) { + background-color: #abbac3; +} +.fc-event.label-yellow { + color: #996633; +} +.fc-event.label-light { + color: #888888; +} +.label-yellow .fc-event { + color: #996633; +} +.label-light .fc-event { + color: #888; +} +[class*="label-"] > .fc-event, +[class*="label-"] > .fc-event > .fc-event-skin.fc-event-head { + background-color: inherit; +} +.fc-event.ui-draggable-dragging { + cursor: move; +} +.fc-event.fc-event-vert, +.fc-event-vert > .fc-event { + padding: 0 0 1px; +} +.fc-day-number { + color: #2E6589; + opacity: 1; + filter: alpha(opacity=100); +} +.fc-widget-header, +.fc .fc-axis { + background: #ECF2F7; + color: #8090A0; +} +.fc-event-hori, +.fc-event-vert { + border-radius: 0 !important; + border-color: transparent; +} +.fc-event-vert .fc-event-content { + padding-left: 1px; + padding-right: 1px; +} +.fc-event-vert .fc-event-time { + padding: 0; +} +.fc-state-default { + border: none; +} +.fc-state-default, +.fc-state-default .fc-button-inner { + border: none; + background-color: #abbac3; + color: #FFF; + background-image: none; + box-shadow: none; + text-shadow: none; + border-radius: 0 !important; + margin-left: 2px; +} +.fc-state-default .fc-button-effect { + display: none; +} +.fc-state-disabled, +.fc-state-disabled .fc-button-inner { + opacity: 0.75; + filter: alpha(opacity=75); + color: #DDD; +} +.fc-state-active, +.fc-state-active .fc-button-inner { + border-color: #4F99C6; + background-color: #6FB3E0; +} +.fc-state-hover, +.fc-state-hover .fc-button-inner { + background-color: #8B9AA3; +} +.fc .fc-button-group > * { + margin: 0 1px 0 0; +} +.external-event { + margin: 6px 0; + padding: 0; + cursor: default; + display: block; + font-size: 13px; + line-height: 28px; + color: #ffffff; +} +.external-event:not([class*="label-"]) { + background-color: #abbac3; +} +.external-event:hover { + opacity: 1; + filter: alpha(opacity=100); +} +.external-event.ui-draggable-dragging { + cursor: move; +} +.external-event.label-yellow { + color: #996633; +} +.external-event.label-light { + color: #888888; +} +.external-event > .ace-icon:first-child { + display: inline-block; + height: 32px; + width: 32px; + text-align: center; + line-height: 30px; + margin-right: 5px; + font-size: 15px; + border-right: 1px solid #FFF; +} +/** +.widget-main { + .fc { + position:relative; + top:-40px; + + > .fc-header { + position:relative; + z-index:10; + } + + .fc-header-space { + padding-left:2px; + } + } + + .fc-header-title > h2 { + font-size: floor(@base-font-size * 1.4); + line-height: 36px; + } + + .fc-content { + top:-14px; + z-index:11; + } + + .fc-button-content { + height:37px; + line-height:36px; + } + +} +*/ +@media only screen and (max-width: 480px) { + .fc-header td { + display: block; + width: auto; + text-align: left; + } +} +.chosen-container + .help-inline { + vertical-align: middle; +} +/** +.chosen-select { + display: inline !important; //for validation plugin to work it must be displayed + visibility: hidden; + opacity: 0; + position: absolute; + z-index: -1; + width: 0; + height: 0; + border-width: 0; +} +*/ +.chosen-container, +[class*="chosen-container"] { + vertical-align: middle; +} +.chosen-container > .chosen-single, +[class*="chosen-container"] > .chosen-single { + line-height: 28px; + height: 32px; + box-shadow: none; + background: #FAFAFA; +} +.chosen-choices { + box-shadow: none !important; +} +.chosen-container-single .chosen-single abbr { + background: none; +} +.chosen-container-single .chosen-single abbr:after { + content: "\f00d"; + display: inline-block; + color: #888; + font-family: FontAwesome; + font-size: 13px; + position: absolute; + right: 0; + top: -7px; +} +.chosen-container-single .chosen-single abbr:hover:after { + color: #464646; +} +.chosen-container-single.chosen-disabled .chosen-single abbr:hover:after { + color: #464646; +} +.chosen-single div b { + background: none !important; +} +.chosen-single div b:before { + content: "\f0d7"; + display: inline-block; + color: #888; + font-family: FontAwesome; + font-size: 12px; + position: relative; + top: -1px; + left: 1px; +} +.chosen-container-active.chosen-with-drop .chosen-single div b:before { + content: "\f0d8"; +} +.chosen-container-single .chosen-search { + position: relative; +} +.chosen-container-single .chosen-search input[type="text"] { + background: none; + border-radius: 0; + line-height: 28px; + height: 28px; +} +.chosen-container-single .chosen-search:after { + content: "\f002"; + display: inline-block; + color: #888; + font-family: FontAwesome; + font-size: 14px; + position: absolute; + top: 8px; + right: 12px; +} +.chosen-container-multi .chosen-choices li.search-field input[type="text"] { + height: 25px; +} +.chosen-container-multi .chosen-choices li.search-choice { + line-height: 16px; + padding-bottom: 4px; +} +.chosen-container-multi .chosen-choices li.search-choice .search-choice-close { + background: none; +} +.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:before { + content: "\f00d"; + display: inline-block; + color: #888; + font-family: FontAwesome; + font-size: 13px; + position: absolute; + right: 2px; + top: -1px; +} +.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover { + text-decoration: none; +} +.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover:before { + color: #464646; +} +.chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close:before { + color: #464646; +} +.chosen-container .chosen-results-scroll-down span, +.chosen-container .chosen-results-scroll-up span { + background: none; +} +.chosen-container .chosen-results-scroll-down span:before, +.chosen-container .chosen-results-scroll-up span:before { + content: "\f0d7"; + display: inline-block; + color: #888; + font-family: FontAwesome; + font-size: 12px; + position: relative; + top: -1px; + left: 1px; +} +.chosen-container .chosen-results-scroll-up span:before { + content: "\f0d8"; +} +.chosen-container-active .chosen-single-with-drop div b:before { + content: "\f0d8"; +} +.chosen-rtl .chosen-search input[type="text"] { + background: none; +} +.chosen-rtl .chosen-search:after { + content: ""; + display: none; +} +.chosen-rtl .chosen-search:before { + content: "\f002"; + display: inline-block; + color: #888; + font-family: FontAwesome; + font-size: 14px; + position: absolute; + top: 9px; + left: 12px; +} +/** chosen - etc */ +.chosen-container-single .chosen-single { + border-radius: 0; +} +.chosen-container .chosen-results li.highlighted { + background: #316AC5; + color: #FFF; +} +.chosen-container-single .chosen-drop { + border-radius: 0; + border-bottom: 3px solid #4492C9; + border-color: #4492C9; +} +.chosen-single.chosen-single-with-drop, +.chosen-container-active .chosen-single { + border-color: #4492C9; +} +.form-group.has-error .chosen-single { + border-color: #f2a696 !important; +} +.form-group.has-info .chosen-single { + border-color: #72aec2 !important; +} +.form-group.has-warning .chosen-single { + border-color: #e3c94c !important; +} +.form-group.has-success .chosen-single { + border-color: #9cc573 !important; +} +.chosen-container-active.chosen-with-drop .chosen-single { + border-color: #4492C9; +} +.chosen-container .chosen-drop { + display: none; +} +.chosen-container.chosen-with-drop .chosen-drop { + left: auto; + right: auto; + display: block; +} +@media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-resolution: 144dpi) { + .chosen-rtl .chosen-search input[type="text"], + .chosen-container-single .chosen-single abbr, + .chosen-container-single .chosen-single div b, + .chosen-container-single .chosen-search input[type="text"], + .chosen-container-multi .chosen-choices li.search-choice .search-choice-close, + .chosen-container .chosen-results-scroll-down span, + .chosen-container .chosen-results-scroll-up span { + background-image: none !important; + background-repeat: no-repeat !important; + background-size: auto !important; + } +} +.tag-input-style + .chosen-container-multi .chosen-choices li.search-choice { + background-image: none; + background-color: #91b8d0; + color: #FFFFFF; + display: inline-block; + font-size: 13px; + font-weight: normal; + margin-bottom: 3px; + margin-right: 3px; + padding: 6px 22px 7px 9px; + position: relative; + text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.15); + transition: all 0.2s ease 0s; + vertical-align: baseline; + white-space: nowrap; + border: none; + -webkit-box-shadow: none; + box-shadow: none; + border-radius: 0; +} +.tag-input-style + .chosen-container-multi .chosen-choices li.search-choice .search-choice-close { + position: absolute; + top: 0; + bottom: 0; + right: 0; + width: 18px; + height: auto; + line-height: 25px; + text-align: center; +} +.tag-input-style + .chosen-container-multi .chosen-choices li.search-choice .search-choice-close:before { + color: #FFF; + position: static; + font-size: 11px; +} +.tag-input-style + .chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover { + background-color: rgba(0, 0, 0, 0.2); +} +.tag-input-style + .chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover:before { + color: #FFF; +} +.tag-input-style + .chosen-container-multi.chosen-rtl .chosen-choices li.search-choice { + padding: 6px 9px 7px 22px; + margin-left: 0; + margin-right: 3px !important; +} +.tag-input-style + .chosen-container-multi.chosen-rtl .chosen-choices li.search-choice .search-choice-close { + right: auto; + left: 0; +} +.select2-container .select2-choice { + border-radius: 0; + height: 32px; + line-height: 28px; +} +.select2-container.select2-drop-above .select2-choice { + border-radius: 0; +} +.select2-container[class*="input-"] { + max-width: none; +} +.select2-container.input-mini { + min-width: 100px; +} +.select2-container .select2-choice abbr, +.select2-search-choice-close { + background: none; +} +.select2-container .select2-choice abbr:before, +.select2-search-choice-close:before { + font-family: FontAwesome; + font-size: 12px; + display: inline; + content: "\f00d"; + color: #888; + position: relative; + top: -1px; +} +.select2-container .select2-choice abbr:hover:before, +.select2-search-choice-close:hover:before { + color: #555; +} +.select2-container .select2-choice abbr:before { + top: -7px; +} +.select2-search-choice-close:hover { + text-decoration: none !important; +} +.select2-drop { + border-radius: 0; + border: 1px solid #4492C9; + border-width: 0 1px 3px; +} +.select2-drop.select2-drop-above { + border-radius: 0; +} +.select2-container .select2-choice { + background: #FAFAFA none; +} +.select2-container-active .select2-choice, +.select2-container-active .select2-choices, +.select2-dropdown-open.select2-drop-above .select2-choice, +.select2-dropdown-open.select2-drop-above .select2-choices, +.select2-container-multi.select2-container-active .select2-choices { + border-color: #4492C9; +} +.select2-results .select2-highlighted { + background: #316AC5; +} +.select2-container .select2-choice .select2-arrow { + border-radius: 0; + background: transparent none; + border: none; +} +.select2-container .select2-choice .select2-arrow b { + background: none; +} +.select2-container .select2-choice .select2-arrow b:before { + font-family: FontAwesome; + font-size: 12px; + display: inline; + content: "\f0d7"; + color: #888; + position: relative; + left: 5px; +} +.select2-dropdown-open .select2-choice .select2-arrow b:before { + content: "\f0d8"; +} +.select2-search .select2-input { + background: #fff none; + margin-top: 4px; +} +.select2-search:after { + font-family: FontAwesome; + font-size: 14px; + display: inline; + content: "\f002"; + color: #777; + position: relative; + top: 0; + left: -20px; + z-index: 0; +} +.select2-dropdown-open.select2-drop-above .select2-choice, +.select2-dropdown-open.select2-drop-above .select2-choices { + background-image: none; + background-color: #F6F6F6; +} +.select2-container-multi .select2-choices .select2-search-field input { + border: none !important; + -webkit-box-shadow: none !important; + box-shadow: none !important; + background: none !important; + font-size: 14px; +} +.select2-container-multi .select2-choices .select2-search-choice { + line-height: 16px; + padding-bottom: 4px; +} +.select2-container-active .select2-choice, +.select2-container-active .select2-choices, +.select2-container-multi.select2-container-active .select2-choices, +.select2-dropdown-open.select2-drop-above .select2-choice, +.select2-dropdown-open.select2-drop-above .select2-choices { + -webkit-box-shadow: none; + box-shadow: none; +} +.select2-search input.select2-active { + background-color: #FFF; + position: relative; + z-index: 1; +} +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 144dpi) { + .select2-search input, + .select2-search-choice-close, + .select2-container .select2-choice abbr, + .select2-container .select2-choice div b { + background-image: none !important; + background-size: auto !important; + } + .select2-search input { + background-position: auto !important; + } +} +.select2-container-active.select2-dropdown-open .select2-choice { + background-image: -webkit-linear-gradient(top, #eeeeee 0%, #ffffff 100%); + background-image: -o-linear-gradient(top, #eeeeee 0%, #ffffff 100%); + background-image: linear-gradient(to bottom, #eeeeee 0%, #ffffff 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffeeeeee', endColorstr='#ffffffff', GradientType=0); +} +.select2-container-active.select2-drop-above .select2-choice { + background-image: -webkit-linear-gradient(top, #ffffff 0%, #eeeeee 100%); + background-image: -o-linear-gradient(top, #ffffff 0%, #eeeeee 100%); + background-image: linear-gradient(to bottom, #ffffff 0%, #eeeeee 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffeeeeee', GradientType=0); +} +.form-group.has-error .select2-choice, +.form-group.has-error .select2-choices { + border-color: #f2a696 !important; +} +.form-group.has-info .select2-choice, +.form-group.has-info .select2-choices { + border-color: #72aec2 !important; +} +.form-group.has-warning .select2-choice, +.form-group.has-warning .select2-choices { + border-color: #e3c94c !important; +} +.form-group.has-success .select2-choice, +.form-group.has-success .select2-choices { + border-color: #9cc573 !important; +} +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 144dpi) { + .select2-search input, + .select2-search-choice-close, + .select2-container .select2-choice abbr, + .select2-container .select2-choice .select2-arrow b { + background-image: none !important; + background-repeat: no-repeat !important; + background-size: auto !important; + } + .select2-search input { + background-position: auto !important; + } +} +.select2-container-multi.tag-input-style .select2-choices .select2-search-choice { + background-image: none; + background-color: #91b8d0; + color: #FFFFFF; + display: inline-block; + font-size: 13px; + font-weight: normal; + margin-bottom: 3px; + margin-right: 0; + padding: 6px 22px 7px 9px; + position: relative; + text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.15); + transition: all 0.2s ease 0s; + vertical-align: baseline; + white-space: nowrap; + border: none; + -webkit-box-shadow: none; + box-shadow: none; + border-radius: 0; +} +.select2-container-multi.tag-input-style .select2-choices .select2-search-choice .select2-search-choice-close { + position: absolute; + top: 0; + bottom: 0; + right: 0; + left: auto; + width: 18px; + height: auto; + line-height: 25px; + text-align: center; +} +.select2-container-multi.tag-input-style .select2-choices .select2-search-choice .select2-search-choice-close:before { + color: #FFF; + position: static; + font-size: 11px; +} +.select2-container-multi.tag-input-style .select2-choices .select2-search-choice .select2-search-choice-close:hover { + background-color: rgba(0, 0, 0, 0.2); +} +.select2-container-multi.tag-input-style .select2-choices .select2-search-choice .select2-search-choice-close:hover:before { + color: #FFF; +} +#colorbox:focus, +#colorbox:active { + outline: none; +} +#cboxTopLeft, +#cboxTopCenter, +#cboxTopRight, +#cboxMiddleLeft, +#cboxMiddleRight, +#cboxBottomLeft, +#cboxBottomCenter, +#cboxBottomRight { + background: none !important; + opacity: 0; +} +#cboxContent { + border: 12px solid #000; + background-color: #FFF; + padding: 7px; +} +#cboxOverlay { + background: rgba(0, 0, 0, 0.95); + background: #000; +} +#cboxCurrent { + left: 64px; + margin-bottom: 4px; + font-size: 14px; +} +#cboxTitle { + margin-bottom: 4px; + font-size: 14px; + color: #777; +} +#cboxNext, +#cboxPrevious, +#cboxClose { + background: none; + text-indent: 0; + width: 26px; + height: 26px; + line-height: 22px; + padding: 0 4px; + text-align: center; + border: 2px solid #999; + border-radius: 16px; + color: #666; + font-size: 12px; + margin-left: 5px; + margin-bottom: 5px; +} +#cboxNext:hover, +#cboxPrevious:hover { + color: #333; + border-color: #666; +} +#cboxContent { + overflow: visible; +} +#cboxClose { + background-color: #000; + border: 2px solid #FFF; + border-radius: 32px; + color: #FFF; + font-size: 21px; + height: 28px; + width: 28px; + padding-bottom: 2px; + margin-left: 0; + right: -14px; + top: -14px; +} +#cboxLoadingOverlay { + background: none !important; +} +#cboxLoadingGraphic { + background: #FFF none !important; + text-align: center; +} +#cboxLoadingGraphic > .ace-icon { + display: inline-block; + background-color: #FFF; + border-radius: 8px; + width: 32px; + height: 32px; + position: relative; + top: 48%; + text-align: center; + vertical-align: middle; + font-size: 24px; + color: #FE7E3E; +} +.ace-spinner { + display: inline-block; +} +.ace-spinner .spinbox-buttons.btn-group-vertical { + min-width: 18px; +} +.ace-spinner .spinbox-buttons.btn-group-vertical > .btn { + font-size: 10px; + padding: 0; + width: 22px; + height: 16px; + line-height: 8px; + margin-left: 0; +} +.ace-spinner .spinbox-buttons.btn-group-vertical > .btn:first-child { + margin-top: 0; +} +.ace-spinner .spinbox-buttons.btn-group-vertical > .btn > .ace-icon { + margin: 0; + padding: 0; +} +.ace-spinner .spinbox-buttons.btn-group-vertical > .btn + .btn { + margin-top: 2px; +} +.ace-spinner .spinbox-buttons.btn-group-vertical > .btn-xs { + height: 14px; + line-height: 7px; +} +.ace-spinner .spinbox-buttons.btn-group-vertical > .btn-lg { + height: 22px; + line-height: 10px; + width: 22px; +} +.ace-spinner .spinbox-buttons > button.btn.spinbox-up:active { + top: -1px; +} +.ace-spinner:not(.touch-spinner) .spinbox-buttons > .btn > .ace-icon { + margin-top: -1px; +} +.ace-spinner.touch-spinner .spinbox-buttons { + margin: 0; + font-size: 0; +} +.ace-spinner.touch-spinner .spinbox-buttons .btn-sm { + width: 32px; +} +.ace-spinner.touch-spinner .spinbox-buttons .btn-xs { + width: 24px; +} +.ace-spinner.touch-spinner .spinbox-buttons .btn-lg { + width: 40px; +} +.ace-spinner.touch-spinner .spinbox-buttons > .btn { + margin: 0 1px !important; +} +.ace-spinner.touch-spinner .spinbox-buttons > .btn-xs { + padding-top: 3px; + padding-bottom: 3px; +} +.ace-spinner.touch-spinner .spinbox-buttons > .btn > .ace-icon { + vertical-align: middle; + display: inline-block; +} +.steps { + list-style: none; + display: table; + width: 100%; + padding: 0; + margin: 0; + position: relative; +} +.steps li { + display: table-cell; + text-align: center; + width: 1%; +} +.steps li .step { + border: 5px solid #ced1d6; + color: #546474; + font-size: 15px; + border-radius: 100%; + background-color: #FFF; + position: relative; + z-index: 2; + display: inline-block; + width: 40px; + height: 40px; + line-height: 30px; + text-align: center; +} +.steps li:before { + display: block; + content: ""; + width: 100%; + height: 1px; + font-size: 0; + overflow: hidden; + border-top: 4px solid #CED1D6; + position: relative; + top: 21px; + z-index: 1; +} +.steps li.last-child:before { + max-width: 50%; + width: 50%; +} +.steps li:last-child:before { + max-width: 50%; + width: 50%; +} +.steps li:first-child:before { + max-width: 51%; + left: 50%; +} +.steps li.active:before, +.steps li.complete:before, +.steps li.active .step, +.steps li.complete .step { + border-color: #5293c4; +} +.steps li.complete .step { + cursor: default; + color: #FFF; + -webkit-transition: transform ease 0.1s; + -o-transition: transform ease 0.1s; + transition: transform ease 0.1s; +} +.steps li.complete .step:before { + display: block; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + line-height: 30px; + text-align: center; + border-radius: 100%; + content: "\f00c"; + background-color: #FFF; + z-index: 3; + font-family: FontAwesome; + font-size: 17px; + color: #87ba21; +} +.steps li.complete:hover .step { + -moz-transform: scale(1.1); + -webkit-transform: scale(1.1); + -o-transform: scale(1.1); + -ms-transform: scale(1.1); + transform: scale(1.1); + border-color: #80afd4; +} +.steps li.complete:hover:before { + border-color: #80afd4; +} +.steps li .title { + display: block; + margin-top: 4px; + max-width: 100%; + color: #949ea7; + font-size: 14px; + z-index: 104; + text-align: center; + table-layout: fixed; + word-wrap: break-word; +} +.steps li.complete .title, +.steps li.active .title { + color: #2b3d53; +} +.step-content { + position: relative; +} +.step-content .step-pane { + display: none; + min-height: 200px; + padding: 4px 8px 12px; +} +.step-content .step-pane.active { + display: block; +} +.wizard-actions { + text-align: right; +} +@media only screen and (max-width: 767px) { + .steps li .step { + width: 30px; + height: 30px; + line-height: 24px; + border-width: 3px; + } + .steps li:before, + .steps li:after { + border-width: 3px; + } + .steps li.complete .step:before { + line-height: 24px; + font-size: 13px; + } + .steps li:before { + top: 16px; + } + .step-content .step-pane { + padding: 4px 4px 6px; + min-height: 150px; + } +} +.tree { + margin: auto; + padding: 0 0 0 9px; + overflow-x: hidden; + overflow-y: auto; + position: relative; +} +.tree:before { + display: inline-block; + content: ""; + position: absolute; + top: -20px; + bottom: 16px; + left: 0; + z-index: 1; + border: 1px dotted #67b2dd; + border-width: 0 0 0 1px; +} +.tree .tree-branch-name, +.tree .tree-item-name { + cursor: pointer; +} +.tree .tree-branch { + width: auto; + min-height: 20px; + cursor: pointer; +} +.tree .tree-branch .tree-branch-header { + position: relative; + height: 20px; + line-height: 20px; +} +.tree .tree-branch .tree-branch-header:hover { + background-color: #F0F7FC; +} +.tree .tree-branch .tree-branch-header .tree-branch-name, +.tree .tree-item .tree-item-name { + display: inline; + z-index: 2; +} +.tree .tree-branch .tree-branch-header > .tree-branch-name > .ace-icon:first-child, +.tree .tree-item > .tree-item-name > .ace-icon:first-child { + display: inline-block; + position: relative; + z-index: 2; + top: -1px; +} +.tree .tree-branch > .tree-branch-header > .tree-branch-name > .tree-label { + margin-left: 2px; +} +.tree .tree-branch > .tree-branch-header > .tree-branch-name > .ace-icon:first-child { + margin: -2px 0 0 -2px; +} +.tree .tree-branch:last-child:after { + display: inline-block; + content: ""; + position: absolute; + z-index: 1; + top: 15px; + bottom: 0; + left: -15px; + border-left: 1px solid #FFF; +} +.tree .tree-branch .tree-branch-children { + margin: 0 0 0 23px; + padding: 0; + position: relative; +} +.tree .tree-branch .tree-branch-children:before { + display: inline-block; + content: ""; + position: absolute; + z-index: 1; + top: -14px; + bottom: 16px; + left: -14px; + border: 1px dotted #67b2dd; + border-width: 0 0 0 1px; +} +.tree .tree-item { + position: relative; + height: 20px; + line-height: 20px; + cursor: pointer; +} +.tree .tree-item:hover { + background-color: #F0F7FC; +} +.tree .tree-item > .tree-item-name > .ace-icon:first-child { + margin-right: 3px; +} +.tree .tree-item > .tree-item-name > .tree-label > .ace-icon:first-child { + margin-left: 3px; + margin-right: 3px; +} +.tree .tree-item > .ace-icon:first-child { + margin-top: -1px; +} +.tree .tree-branch, +.tree .tree-item { + position: relative; + list-style: none; +} +.tree .tree-branch:before, +.tree .tree-item:before { + display: inline-block; + content: ""; + position: absolute; + top: 14px; + left: -13px; + width: 18px; + height: 0; + border-top: 1px dotted #67b2dd; + z-index: 1; +} +.tree .tree-selected { + background-color: rgba(98, 168, 209, 0.1); + color: #6398B0; +} +.tree .tree-selected:hover { + background-color: rgba(98, 168, 209, 0.1); +} +.tree .tree-item, +.tree .tree-branch { + border: 1px solid #FFF; +} +.tree .tree-branch .tree-branch-header { + border-radius: 0; +} +.tree .tree-item, +.tree .tree-branch .tree-branch-header { + margin: 0; + padding: 5px; + color: #4D6878; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} +.tree .tree-item > .tree-item-name > .ace-icon:first-child { + color: #F9E8CE; + width: 13px; + height: 13px; + line-height: 13px; + font-size: 11px; + text-align: center; + border-radius: 3px; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + background-color: #FAFAFA; + border: 1px solid #CCC; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); +} +.tree .tree-selected > .tree-item-name > .ace-icon:first-child { + background-color: #F9A021; + border-color: #F9A021; + color: #FFF; +} +.tree .tree-plus.ace-icon:first-child, +.tree .tree-minus.ace-icon:first-child { + display: inline-block; + font-style: normal; + border: 1px solid #DDD; + vertical-align: middle; + height: 11px; + width: 11px; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + text-align: center; + border: 1px solid #8BAEBF; + line-height: 10px; + background-color: #FFF; + position: relative; + z-index: 2; +} +.tree .tree-plus.ace-icon:first-child:before, +.tree .tree-minus.ace-icon:first-child:before { + content: ""; + display: block; + width: 7px; + height: 0; + border-top: 1px solid #4D6878; + position: absolute; + top: 5px; + left: 2px; +} +.tree .tree-plus.ace-icon:first-child:after { + content: ""; + display: block; + height: 7px; + width: 0; + border-left: 1px solid #4D6878; + position: absolute; + top: 2px; + left: 5px; +} +.tree .tree-unselectable .tree-item > .tree-item-name > .tree-label > .ace-icon:first-child { + color: #5084A0; + width: 13px; + height: 13px; + line-height: 13px; + font-size: 10px; + text-align: center; + border-radius: 0; + background-color: transparent; + border: none; + box-shadow: none; +} +.tree .ace-icon[class*="-down"] { + transform: rotate(-45deg); +} +.tree .ace-icon[class*="-download"] { + transform: none; +} +.tree .fa-spin { + height: auto; +} +.tree .tree-loading { + margin-left: 36px; +} +.tree img { + display: inline; + veritcal-align: middle; +} +.gritter-item-wrapper { + background-image: none !important; + box-shadow: 0 2px 10px rgba(50, 50, 50, 0.5); + background: rgba(50, 50, 50, 0.92); +} +.gritter-item-wrapper.gritter-info { + background: rgba(49, 81, 133, 0.92); +} +.gritter-item-wrapper.gritter-error { + background: rgba(153, 40, 18, 0.92); +} +.gritter-item-wrapper.gritter-success { + background: rgba(89, 131, 75, 0.92); +} +.gritter-item-wrapper.gritter-warning { + background: rgba(190, 112, 31, 0.92); +} +.gritter-item-wrapper.gritter-light { + background: rgba(245, 245, 245, 0.95); + border: 1px solid #BBB; +} +.gritter-item-wrapper.gritter-light.gritter-info { + background: rgba(232, 242, 255, 0.95); +} +.gritter-item-wrapper.gritter-light.gritter-info .gritter-item { + color: #4A577D; +} +.gritter-item-wrapper.gritter-light.gritter-error { + background: rgba(255, 235, 235, 0.95); +} +.gritter-item-wrapper.gritter-light.gritter-error .gritter-item { + color: #894A38; +} +.gritter-item-wrapper.gritter-light.gritter-success { + background: rgba(239, 250, 227, 0.95); +} +.gritter-item-wrapper.gritter-light.gritter-success .gritter-item { + color: #416131; +} +.gritter-item-wrapper.gritter-light.gritter-warning { + background: rgba(252, 248, 227, 0.95); +} +.gritter-item-wrapper.gritter-light.gritter-warning .gritter-item { + color: #946446; +} +.gritter-item p { + line-height: 1.8; +} +.gritter-top, +.gritter-bottom, +.gritter-item { + background-image: none; +} +.gritter-close { + left: auto; + right: 3px; + background-image: none; + width: 18px; + height: 18px; + line-height: 17px; + text-align: center; + border: 2px solid transparent; + border-radius: 16px; + color: #E17B67; +} +.gritter-close:before { + font-family: FontAwesome; + font-size: 16px; + content: "\f00d"; +} +.gritter-info .gritter-close { + color: #FFA500; +} +.gritter-error .gritter-close, +.gritter-success .gritter-close, +.gritter-warning .gritter-close { + color: #FFEA07; +} +.gritter-close:hover { + color: #FFF !important; +} +.gritter-title { + text-shadow: none; +} +.gritter-light .gritter-item, +.gritter-light .gritter-bottom, +.gritter-light .gritter-top, +.gritter-light .gritter-close { + background-image: none; + color: #444; +} +.gritter-light .gritter-title { + text-shadow: none; +} +.gritter-light .gritter-close:hover { + color: #8A3104 !important; +} +.gritter-center { + position: fixed; + left: 33%; + right: 33%; + top: 33%; +} +@media only screen and (max-width: 767px) { + .gritter-center { + left: 16%; + right: 16%; + top: 30%; + } +} +@media only screen and (max-width: 480px) { + .gritter-center { + left: 30px; + right: 30px; + } +} +@media only screen and (max-width: 320px) { + .gritter-center { + left: 10px; + right: 10px; + } +} +.wysiwyg-editor { + max-height: 250px; + height: 250px; + background-color: #F7F8FA; + border-collapse: separate; + border: 1px solid #BBC0CA; + padding: 4px; + box-sizing: content-box; + overflow-y: scroll; + overflow-x: hidden; + outline: none; +} +.wysiwyg-editor:focus { + background-color: #FFF; +} +.wysiwyg-toolbar { + line-height: 33px; + margin: 0 !important; + position: relative; +} +.wysiwyg-toolbar .dropdown-menu { + text-align: left; +} +.wysiwyg-toolbar .btn-group { + float: none !important; + font-size: 0; +} +.wysiwyg-toolbar .btn-group > .btn { + float: none; + padding-left: 0; + padding-right: 0; + text-align: center; + margin-left: 1px; + /** + &.active:after { + border-color: transparent; + border-style: solid; + border-top-color: inherit; + border-width: 6px 14px; + bottom: -13px; + left: 0; + right: 0; + } + */ +} +.wysiwyg-toolbar .btn-group > .btn > .ace-icon:first-child { + font-size: 14px; + width: 25px; + max-width: 25px; + display: inline-block; + border-width: 1px !important; +} +.wysiwyg-toolbar .btn-group > .btn.dropdown-toggle > .ace-icon:last-child { + margin-right: 4px; +} +.wysiwyg-style1 .btn-group > .btn, +.wysiwyg-style2 .btn-group > .btn, +.wysiwyg-style1 .btn-group > .inline > .btn, +.wysiwyg-style2 .btn-group > .inline > .btn { + margin: 0 !important; + background: #FFF !important; + border-width: 0 !important; + color: #ADB3BE !important; + text-shadow: none !important; +} +.wysiwyg-style1 .btn-group > .btn.active, +.wysiwyg-style2 .btn-group > .btn.active, +.wysiwyg-style1 .btn-group > .inline > .btn.active, +.wysiwyg-style2 .btn-group > .inline > .btn.active { + color: #5B80CE !important; +} +.wysiwyg-style1 .btn-group > .btn.active:after, +.wysiwyg-style2 .btn-group > .btn.active:after, +.wysiwyg-style1 .btn-group > .inline > .btn.active:after, +.wysiwyg-style2 .btn-group > .inline > .btn.active:after { + display: none; +} +.wysiwyg-style1 .btn-group, +.wysiwyg-style2 .btn-group { + position: relative; +} +.wysiwyg-style1 .btn-group:after, +.wysiwyg-style2 .btn-group:after { + display: block; + content: ""; + position: absolute; + left: -2px; + top: 6px; + bottom: 6px; + width: 0; + max-width: 0; + border-left: 1px solid #E1E6EA; +} +.wysiwyg-style1 .btn-group:first-child:after, +.wysiwyg-style2 .btn-group:first-child:after { + display: none; +} +.wysiwyg-style2 { + background-color: #E5E5E5; +} +.wysiwyg-style2 + .wysiwyg-editor { + border-color: #DDD; + background-color: #FFF; + border-top: none; +} +.wysiwyg-style2 .btn-group > .btn, +.wysiwyg-style2 .btn-group > .inline > .btn { + margin: 0 1px 0 0 !important; + background: #FFF !important; + border: none !important; + color: #8D939E !important; + text-shadow: none !important; +} +.wysiwyg-style2 .btn-group > .btn.active, +.wysiwyg-style2 .btn-group > .inline > .btn.active { + color: #FFF !important; + background: #6AAEDF !important; +} +.wysiwyg-style2 .btn-group:after { + display: none; +} +.wysiwyg-toolbar .btn-colorpicker { + width: 24px; + height: 24px; + position: relative; + background: #87B87F; + /* Old browsers */ + background: -moz-linear-gradient(top, #cf3e73 10%, #ffffff 20%, #2283c5 30%, #ffffff 40%, #87b87f 50%, #ffffff 60%, #ffb752 70%, #ffffff 80%, #d15b47 90%, #ffffff 100%); + /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(10%, #cf3e73), color-stop(20%, #ffffff), color-stop(30%, #2283c5), color-stop(40%, #ffffff), color-stop(50%, #87b87f), color-stop(60%, #ffffff), color-stop(70%, #ffb752), color-stop(80%, #ffffff), color-stop(90%, #d15b47), color-stop(100%, #ffffff)); + /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #cf3e73 10%, #ffffff 20%, #2283c5 30%, #ffffff 40%, #87b87f 50%, #ffffff 60%, #ffb752 70%, #ffffff 80%, #d15b47 90%, #ffffff 100%); + /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #cf3e73 10%, #ffffff 20%, #2283c5 30%, #ffffff 40%, #87b87f 50%, #ffffff 60%, #ffb752 70%, #ffffff 80%, #d15b47 90%, #ffffff 100%); + /* Opera11.10+ */ + background: -ms-linear-gradient(top, #cf3e73 10%, #ffffff 20%, #2283c5 30%, #ffffff 40%, #87b87f 50%, #ffffff 60%, #ffb752 70%, #ffffff 80%, #d15b47 90%, #ffffff 100%); + /* IE10+ */ + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#CF3E73', endColorstr='#FFB752', GradientType=0); + /* IE6-9 */ + background: linear-gradient(top, #cf3e73 10%, #ffffff 20%, #2283c5 30%, #ffffff 40%, #87b87f 50%, #ffffff 60%, #ffb752 70%, #ffffff 80%, #d15b47 90%, #ffffff 100%); + /* W3C */ +} +.wysiwyg-toolbar .dropdown-colorpicker > .dropdown-menu { + top: auto; +} +.wysiwyg-toolbar input[type=file] { + position: fixed; + z-index: -10; + opacity: 0; + max-width: 0; + max-height: 0; + display: block; +} +.wysiwyg-toolbar .wysiwyg-choose-file { + display: inline-block; + width: auto; + margin: 4px auto 0; + padding-left: 5px; + padding-right: 5px; +} +.wysiwyg-toolbar .dropdown-menu input[type=text] { + margin-left: 8px; + margin-bottom: 0; +} +.wysiwyg-toolbar .dropdown-menu input[type=text].form-control { + min-width: 150px; +} +.wysiwyg-toolbar .dropdown-menu .btn { + margin-right: 8px; + margin-left: 8px; +} +.wysiwyg-style1 .btn-colorpicker { + width: 20px; + height: 20px; + margin-left: 4px; +} +@media screen and (-webkit-min-device-pixel-ratio: 0) { + /* for adding image resize functionality in chrome and safari */ + .wysiwyg-editor img { + display: inline !important; + } + .wysiwyg-editor .ui-wrapper { + border: 1px dotted #D00; + overflow: visible !important; + /* because it's image only, so it's ok */ + display: inline-block !important; + vertical-align: middle; + } + .wysiwyg-editor .ui-wrapper:after { + content: ""; + display: block; + position: absolute; + right: -3px; + bottom: -3px; + width: 7px; + height: 7px; + border: 1px solid #D00; + background-color: #FFF; + z-index: 1; + } +} +/* inside widget */ +.widget-header .wysiwyg-toolbar { + background-color: transparent; +} +.widget-header .wysiwyg-toolbar .btn-group > .btn, +.widget-header .wysiwyg-toolbar .btn-group > .inline > .btn { + border-color: transparent; + background: rgba(255, 255, 255, 0.25) !important; + color: #FFF !important; + min-width: 32px; + border-width: 1px !important; + border-radius: 4px !important; + padding: 2px 1px 4px; +} +.widget-header .wysiwyg-toolbar .btn-group > .btn.active, +.widget-header .wysiwyg-toolbar .btn-group > .inline > .btn.active { + background: rgba(0, 0, 0, 0.25) !important; +} +.widget-body .wysiwyg-editor { + border-width: 0; +} +.wysiwyg-speech-input { + width: 20px !important; + color: transparent !important; + background: transparent none !important; + border-width: 0 !important; + -moz-transform: scale(2.0, 2.0); + -webkit-transform: scale(2.0, 2.0); + -o-transform: scale(2.0, 2.0); + -ms-transform: scale(2.0, 2.0); + transform: scale(2.0, 2.0); + -webkit-box-shadow: none !important; + box-shadow: none !important; + position: absolute; + right: 0; + top: -10px; + cursor: pointer; +} +.wysiwyg-speech-input:focus { + -webkit-box-shadow: none !important; + box-shadow: none !important; +} +.widget-body .md-header { + margin-top: -30px; + margin-left: 9px; +} +.widget-body .md-header .btn { + border-color: transparent; + background: rgba(255, 255, 255, 0.25) !important; + color: #FFF !important; + text-align: center; + min-width: 32px; + border-width: 1px !important; + border-radius: 4px !important; + padding: 2px 4px 4px; +} +.widget-body .md-header .btn > .ace-icon { + font-size: 14px; + width: 25px; + max-width: 25px; + display: inline-block; +} +.widget-body .md-header .btn-inverse { + background: rgba(0, 0, 0, 0.25) !important; + padding-right: 5px; + margin-left: 4px; +} +.md-fullscreen-controls { + display: none; +} +.widget-body .md-preview { + padding: 8px; + min-height: 200px; +} +.widget-body .md-input { + border: none !important; + box-shadow: none !important; + display: block; + margin-bottom: 0; + background-color: rgba(48, 126, 204, 0.07); + padding: 8px; + width: 100%; +} +.widget-body .md-input:focus { + background-color: #FFF; + box-shadow: none !important; +} +.editable-container .popover-title { + color: #438EB9; +} +.editable-click { + border-bottom: 1px dashed #BBB; + cursor: pointer; + font-weight: normal; +} +img.editable-click { + border: 1px dotted #BBB; +} +.editable-click:hover { + border-color: #0088CC; + color: #0088CC; +} +img.editable-click:hover { + opacity: 0.75; + filter: alpha(opacity=75); +} +.editable-buttons, +.editable-input { + display: inline-block; +} +.editable-buttons { + margin-left: 1px; +} +.editable-buttons .btn { + padding: 0; + width: 28px; + line-height: 24px; + border-width: 3px; + font-size: 12px; + margin: 0 1px 0 0; +} +.editable-buttons .btn > .ace-icon { + margin: 0; +} +.editable-clear-x { + cursor: pointer; + color: #888; + background: none; +} +.editable-clear-x:hover { + color: #D15B47; +} +.editable-clear-x:before { + display: inline-block; + content: "\f057"; + font-family: FontAwesome; + font-size: 15px; + position: absolute; + margin-top: -9px; + width: 16px; + height: 30px; + line-height: 30px; + text-align: center; +} +.editable-input .ace-spinner { + margin-right: 8px; +} +.editable-input .ace-spinner .spinner-input { + width: 100%; +} +.editable-inline .editable-slider { + margin-top: 10px; + margin-right: 4px; +} +.editable-popup .editable-slider { + display: block; + margin-bottom: 16px; + margin-top: 4px; +} +.editable-slider input[type=text] { + display: none; +} +.editable-slider input[type=range] { + outline: none !important; +} +.editable-input .ace-file-input { + display: block; +} +.editable-image .ace-file-multiple .ace-file-container.selected { + border-color: transparent; +} +.editable-image + .editable-buttons, +.editable-wysiwyg + .editable-buttons { + display: block; + text-align: center; + margin-top: 8px; +} +.editable-wysiwyg { + width: 95%; +} +.editable-wysiwyg .wysiwyg-editor { + height: auto; + overflow-y: hidden; +} +.editableform .input-append.dropdown-menu { + display: none; +} +.editableform .open .input-append.dropdown-menu { + display: block; +} +.editable-container .editableform { + margin-bottom: 10px; +} +.editable-inline .editableform { + margin-bottom: 0; +} +.editableform .control-group { + display: block; +} +.editableform-loading { + background: none; +} +.editableform-loading .ace-icon, +.editableform-loading .progress { + position: relative; + top: 35%; +} +.input-group.date .input-group-addon { + cursor: pointer; +} +.datepicker td, +.daterangepicker td, +.datepicker th, +.daterangepicker th { + border-radius: 0 !important; + font-size: 13px; +} +.datepicker td.active, +.daterangepicker td.active, +.datepicker td.active:hover, +.daterangepicker td.active:hover { + background: #2283c5 !important; +} +.datepicker td.active.disabled, +.daterangepicker td.active.disabled, +.datepicker td.active.disabled:hover, +.daterangepicker td.active.disabled:hover { + background: #8b9aa3 !important; +} +.datepicker td, +.datepicker th { + min-width: 32px; +} +.datepicker-dropdown.datepicker-orient-bottom:after, +.datepicker-dropdown.datepicker-orient-bottom:before { + top: auto; +} +.daterangepicker .calendar-date { + border-radius: 0; +} +.datepicker-months .month, +.datepicker-years .year { + border-radius: 0 !important; +} +.datepicker-months .month.active, +.datepicker-years .year.active, +.datepicker-months .month.active:hover, +.datepicker-years .year.active:hover, +.datepicker-months .month.active:focus, +.datepicker-years .year.active:focus, +.datepicker-months .month.active:active, +.datepicker-years .year.active:active { + background-image: none !important; + background-color: #2283c5 !important; +} +.bootstrap-timepicker-widget table td input { + width: 32px; +} +.well .datepicker table tr td.day:hover { + background-color: #7d8893; + color: #FFF; +} +.bootstrap-timepicker-widget table td a:hover { + border-radius: 0; +} +.daterangepicker.opensleft:before, +.daterangepicker.opensright:before { + -moz-border-bottom-colors: rgba(0, 0, 0, 0.2); +} +.daterangepicker.opensleft:after, +.daterangepicker.opensright:after { + -moz-border-bottom-colors: #fff; +} +.datepicker-dropdown:before { + -moz-border-bottom-colors: rgba(0, 0, 0, 0.2); +} +.datepicker-dropdown:after { + -moz-border-bottom-colors: #fff; +} +.datepicker-dropdown.datepicker-orient-bottom:before { + -moz-border-top-colors: #999; +} +.datepicker-dropdown.datepicker-orient-bottom:after { + -moz-border-top-colors: #FFF; +} +.bootstrap-timepicker-widget.dropdown-menu:before { + -moz-border-bottom-colors: rgba(0, 0, 0, 0.2); +} +.bootstrap-timepicker-widget.dropdown-menu:after { + -moz-border-bottom-colors: #FFF; +} +.bootstrap-timepicker-widget.timepicker-orient-bottom:before { + -moz-border-top-colors: #999; +} +.bootstrap-timepicker-widget.timepicker-orient-bottom:after { + -moz-border-top-colors: #FFF; +} +.bootstrap-datetimepicker-widget [class=btn] { + border-width: 0 !important; + background-color: transparent !important; + color: #7399b8 !important; + text-shadow: none !important; +} +.bootstrap-datetimepicker-widget [class=btn]:hover { + color: #1B6AAA !important; +} +.bootstrap-datetimepicker-widget .btn.btn-primary { + border-width: 3px !important; +} +.bootstrap-datetimepicker-widget .picker-switch { + margin-bottom: 2px; +} +.bootstrap-datetimepicker-widget .picker-switch .btn { + width: 90% !important; + background-color: #EEE !important; + color: #478fca !important; + font-size: 16px; +} +.bootstrap-datetimepicker-widget .picker-switch .btn:hover { + background-color: #e3edf5 !important; +} +.bootstrap-datetimepicker-widget td span { + border-radius: 0; +} +.bootstrap-datetimepicker-widget .timepicker-hour, +.bootstrap-datetimepicker-widget .timepicker-minute, +.bootstrap-datetimepicker-widget .timepicker-second { + color: #555 !important; +} +.ui-slider { + background-color: #D5D5D5; +} +.ui-slider-horizontal { + height: 9px; +} +.ui-slider-vertical { + width: 9px; +} +.ui-slider .ui-slider-handle { + border-radius: 0; + width: 1.45em; + height: 1.45em; + background-color: #F8F8F8; + border: 1px solid; +} +.ui-slider .ui-slider-handle:before, +.ui-slider .ui-slider-handle:after { + display: block; + content: ""; + position: absolute; + top: 4px; + left: 5px; + width: 4px; + height: 8px; + border: 1px solid; + border-width: 0 1px; + border-color: inherit; +} +.ui-slider .ui-slider-handle:after { + left: 8px; + border-width: 0 1px 0 0; +} +.ui-slider .ui-slider-handle:hover { + background-color: #FFF; +} +.ui-slider .ui-slider-handle:hover, +.ui-slider .ui-slider-handle:focus, +.ui-slider .ui-slider-handle:active { + outline: none; + -webkit-box-shadow: 1px 1px 1px 0px rgba(0,0,0,.3); + box-shadow: 1px 1px 1px 0px rgba(0,0,0,.3); +} +.ui-slider-horizontal .ui-slider-handle { + margin-left: -0.725em; + top: -0.4em; +} +.ui-slider-vertical .ui-slider-handle { + left: -0.35em; + margin-bottom: -0.65em; +} +.ui-slider-small.ui-slider-horizontal { + height: 5px; +} +.ui-slider-small.ui-slider-vertical { + width: 5px; +} +.ui-slider-small .ui-slider-handle { + border-radius: 100%; + width: 17px; + height: 17px; + margin-bottom: -0.45em; + left: -0.35em; +} +.ui-slider-small .ui-slider-handle:before, +.ui-slider-small .ui-slider-handle:after { + height: 7px; + left: 5px; + width: 3px; +} +.ui-slider-small .ui-slider-handle:after { + left: 7px; +} +.ui-slider-simple .ui-slider-handle:after, +.ui-slider-simple .ui-slider-handle:before { + display: none; +} +/* colors */ +.ui-slider-range { + background-color: #4aa4ce; +} +.ui-slider-handle { + outline: none !important; + border-color: #4aa4ce !important; +} +.ui-state-disabled.ui-slider { + background-color: #E5E5E5; +} +.ui-state-disabled .ui-slider-range { + background-color: #8daebe; +} +.ui-state-disabled .ui-slider-handle { + -webkit-box-shadow: none !important; + box-shadow: none !important; + border-color: #8daebe !important; +} +.ui-slider-green .ui-slider-range { + background-color: #8bbc67; +} +.ui-slider-green .ui-slider-handle { + border-color: #8bbc67 !important; +} +.ui-slider-green.ui-state-disabled .ui-slider-range { + background-color: #aab0a6; +} +.ui-slider-green.ui-state-disabled .ui-slider-handle { + border-color: #aab0a6 !important; +} +.ui-slider-red .ui-slider-range { + background-color: #d36e6e; +} +.ui-slider-red .ui-slider-handle { + border-color: #d36e6e !important; +} +.ui-slider-red.ui-state-disabled .ui-slider-range { + background-color: #c8acac; +} +.ui-slider-red.ui-state-disabled .ui-slider-handle { + border-color: #c8acac !important; +} +.ui-slider-purple .ui-slider-range { + background-color: #ac68ba; +} +.ui-slider-purple .ui-slider-handle { + border-color: #ac68ba !important; +} +.ui-slider-purple.ui-state-disabled .ui-slider-range { + background-color: #ada7ae; +} +.ui-slider-purple.ui-state-disabled .ui-slider-handle { + border-color: #ada7ae !important; +} +.ui-slider-orange .ui-slider-range { + background-color: #efad62; +} +.ui-slider-orange .ui-slider-handle { + border-color: #efad62 !important; +} +.ui-slider-orange.ui-state-disabled .ui-slider-range { + background-color: #e0c4a4; +} +.ui-slider-orange.ui-state-disabled .ui-slider-handle { + border-color: #e0c4a4 !important; +} +.ui-slider-dark .ui-slider-range { + background-color: #606060; +} +.ui-slider-dark .ui-slider-handle { + border-color: #606060 !important; +} +.ui-slider-dark.ui-state-disabled .ui-slider-range { + background-color: #7a7a7a; +} +.ui-slider-dark.ui-state-disabled .ui-slider-handle { + border-color: #7a7a7a !important; +} +.ui-slider-pink .ui-slider-range { + background-color: #d6487e; +} +.ui-slider-pink .ui-slider-handle { + border-color: #d6487e !important; +} +.ui-slider-pink.ui-state-disabled .ui-slider-range { + background-color: #c38ea2; +} +.ui-slider-pink.ui-state-disabled .ui-slider-handle { + border-color: #c38ea2 !important; +} +.ui-datepicker { + background-color: #FFF; + border: 1px solid rgba(0, 0, 0, 0.2); + -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); +} +.ui-datepicker .ui-datepicker-prev, +.ui-datepicker .ui-datepicker-next { + height: 26px; + min-width: 32px; + max-width: 32px; + text-align: center; + cursor: pointer; + color: transparent; + line-height: 26px; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} +.ui-datepicker .ui-datepicker-prev .ui-icon, +.ui-datepicker .ui-datepicker-next .ui-icon { + color: transparent; + visibility: hidden; +} +.ui-datepicker .ui-datepicker-prev:hover, +.ui-datepicker .ui-datepicker-next:hover { + background-color: #EEE; + text-decoration: none; +} +.ui-datepicker .ui-datepicker-prev:before, +.ui-datepicker .ui-datepicker-next:before { + display: inline; + font-family: FontAwesome; + font-size: 14px; + content: "\f060"; + color: #393939; +} +.ui-datepicker .ui-datepicker-prev-hover, +.ui-datepicker .ui-datepicker-next-hover { + top: 2px; +} +.ui-datepicker .ui-datepicker-next:before { + content: "\f061"; +} +.ui-datepicker .ui-datepicker-prev-hover { + left: 2px; +} +.ui-datepicker .ui-datepicker-next-hover { + right: 2px; +} +.ui-datepicker td { + padding: 0; +} +.ui-datepicker td > a, +.ui-datepicker td > span { + display: inline-block; + height: 22px; + min-width: 24px; + max-width: 24px; + text-align: center; + color: #393939; + font-size: 13px; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} +.ui-datepicker td > a:hover { + background-color: #EEE; +} +.ui-datepicker td > a.ui-state-highlight { + background-color: #D5E5EF; +} +.ui-datepicker td > a.ui-state-active { + background-color: #2283c5; + color: #FFF; +} +.ui-datepicker td > a.ui-priority-secondary { + color: #888; +} +.ui-datepicker td > span { + color: #999; +} +.ui-datepicker td .ui-datepicker-title select { + height: 24px; + line-height: 24px; + padding: 2px 3px; +} +.ui-datepicker td .ui-datepicker-buttonpane { + background-color: #DDD; + height: 1px; +} +/* dialog */ +.ui-widget-overlay { + background: rgba(0, 0, 0, 0.25); + opacity: 1 !important; + filter: alpha(opacity=100) !important; + z-index: 1039 !important; +} +.ui-dialog, +.ui-jqdialog { + z-index: 1040 !important; + background-color: #FFF; + padding: 0; + border: 1px solid #DDD; + -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); +} +.ui-dialog .ui-dialog-titlebar, +.ui-jqdialog .ui-dialog-titlebar, +.ui-dialog .ui-jqdialog-titlebar, +.ui-jqdialog .ui-jqdialog-titlebar { + background-color: #F1F1F1; + font-size: 16px; + color: #669fc7; + padding: 0; +} +.ui-dialog .ui-dialog-title, +.ui-jqdialog .ui-dialog-title, +.ui-dialog .ui-jqdialog-title, +.ui-jqdialog .ui-jqdialog-title { + float: none !important; + width: auto; +} +.ui-dialog .widget-header, +.ui-jqdialog .widget-header { + margin: 0; + border-width: 0 0 1px 0; +} +.ui-dialog .ui-dialog-buttonpane, +.ui-jqdialog .ui-dialog-buttonpane, +.ui-dialog .ui-jqdialog-buttonpane, +.ui-jqdialog .ui-jqdialog-buttonpane { + background-color: #eff3f8; + border-top: 1px solid #e4e9ee; +} +.ui-dialog .ui-dialog-buttonpane button, +.ui-jqdialog .ui-dialog-buttonpane button, +.ui-dialog .ui-jqdialog-buttonpane button, +.ui-jqdialog .ui-jqdialog-buttonpane button { + font-size: 14px; +} +.ui-dialog .ui-dialog-titlebar-close, +.ui-jqdialog .ui-dialog-titlebar-close, +.ui-dialog .ui-jqdialog-titlebar-close, +.ui-jqdialog .ui-jqdialog-titlebar-close { + border: none; + background: transparent; + opacity: 0.4; + color: #d15b47; + padding: 0; + top: 50%; + right: 8px !important; + text-align: center; +} +.ui-dialog .ui-dialog-titlebar-close:before, +.ui-jqdialog .ui-dialog-titlebar-close:before, +.ui-dialog .ui-jqdialog-titlebar-close:before, +.ui-jqdialog .ui-jqdialog-titlebar-close:before { + content: "\f00d"; + display: inline; + font-family: FontAwesome; + font-size: 16px; +} +.ui-dialog .ui-dialog-titlebar-close:hover, +.ui-jqdialog .ui-dialog-titlebar-close:hover, +.ui-dialog .ui-jqdialog-titlebar-close:hover, +.ui-jqdialog .ui-jqdialog-titlebar-close:hover { + opacity: 1; + text-decoration: none; + padding: 0; +} +.ui-dialog .ui-dialog-titlebar-close .ui-button-text, +.ui-jqdialog .ui-dialog-titlebar-close .ui-button-text, +.ui-dialog .ui-jqdialog-titlebar-close .ui-button-text, +.ui-jqdialog .ui-jqdialog-titlebar-close .ui-button-text { + text-indent: 0; + visibility: hidden; +} +.ui-dialog .widget-header .ui-dialog-titlebar-close, +.ui-jqdialog .widget-header .ui-dialog-titlebar-close, +.ui-dialog .widget-header .ui-jqdialog-titlebar-close, +.ui-jqdialog .widget-header .ui-jqdialog-titlebar-close { + right: 10px !important; +} +/* accordion */ +.ui-accordion .ui-accordion-header { + color: #478fca; + font-weight: normal; + background-color: #F9F9F9; + border: 1px solid #cdd8e3; + padding: 8px 8px 9px 24px; +} +.ui-accordion .ui-accordion-header:hover { + color: #6ea6cc; + background-color: #f1f8fd; +} +.ui-accordion .ui-accordion-header.ui-state-active { + color: #4c8fbd; + background-color: #eef4f9; + position: relative; + font-weight: bold; +} +.ui-accordion .ui-accordion-header .ui-accordion-header-icon { + text-indent: 0; + margin-top: 0; + position: absolute; + left: 10px; + top: 7px; +} +.ui-accordion .ui-accordion-header .ui-accordion-header-icon:before { + display: inline; + font-family: FontAwesome; + font-size: 15px; + content: "\f0da"; +} +.ui-accordion .ui-accordion-header.ui-state-active .ui-accordion-header-icon:before { + content: "\f0d7"; + font-weight: normal; +} +.ui-accordion .ui-accordion-content { + border: 1px solid #cdd8e3; + border-top-width: 0; + padding: 11px 16px; +} +/* tabs */ +.ui-tabs .ui-tabs-nav { + padding: 0; + border-bottom: 1px solid #C5D0DC; +} +.ui-tabs .ui-tabs-nav li.ui-state-default > a { + background-color: #F9F9F9; + border: 1px solid #C5D0DC; + border-bottom-width: 0; + color: #999; + line-height: 16px; + margin-right: -1px; + z-index: 11; + padding: 8px 12px; + position: relative; + top: 2px; +} +.ui-tabs .ui-tabs-nav li > a:focus { + outline: none; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active > a { + background-color: #FFF; + border: 1px solid; + border-color: #4C8FBD #C5D0DC transparent; + border-top-width: 2px; + -webkit-box-shadow: 0 -2px 3px 0 rgba(0, 0, 0, 0.15); + box-shadow: 0 -2px 3px 0 rgba(0, 0, 0, 0.15); + color: #576373; + position: relative; + top: 1px; +} +.ui-tabs .ui-tabs-panel { + border: 1px solid #C5D0DC; + border-top-width: 0; + margin: 0; + left: auto; + right: auto; + top: auto; + bottom: auto; +} +/* menu */ +.ui-menu { + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + width: 150px; + -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); + background-color: #FFF; + border: 1px solid rgba(0, 0, 0, 0.2); + padding: 3px; +} +.ui-menu .ui-state-focus, +.ui-menu .ui-state-active { + margin: auto; +} +.ui-menu .ui-menu-item { + padding: 5px 10px 6px; + color: #444; + cursor: pointer; + display: block; + -webkit-box-sizing: inherit; + -moz-box-sizing: inherit; + box-sizing: inherit; +} +.ui-menu .ui-menu-item .ui-menu-icon { + float: right; + position: relative; + left: auto; + right: 4px; + bottom: auto; + text-indent: 0; +} +.ui-menu .ui-menu-item .ui-menu-icon:before { + content: "\f105"; + font-family: FontAwesome; + font-size: 14px; + display: inline; +} +.ui-menu .ui-menu-item:hover, +.ui-menu .ui-state-focus, +.ui-menu .ui-state-active, +.ui-menu .ui-menu-item:hover > .ui-menu-icon, +.ui-menu .ui-state-focus > .ui-menu-icon, +.ui-menu .ui-state-active > .ui-menu-icon { + text-decoration: none; + background-color: #4f99c6; + color: #FFF; + margin: auto; + font-weight: normal; +} +.ui-menu .ui-menu-item:hover .ui-menu-icon, +.ui-menu .ui-state-focus .ui-menu-icon, +.ui-menu .ui-state-active .ui-menu-icon, +.ui-menu .ui-menu-item:hover > .ui-menu-icon .ui-menu-icon, +.ui-menu .ui-state-focus > .ui-menu-icon .ui-menu-icon, +.ui-menu .ui-state-active > .ui-menu-icon .ui-menu-icon { + color: #FFF; +} +.ui-menu .ui-state-disabled, +.ui-menu .ui-state-disabled .ui-menu-icon { + color: #999; + cursor: default; +} +.ui-menu .ui-state-disabled:hover, +.ui-menu .ui-state-disabled.ui-state-focus, +.ui-menu .ui-state-disabled.ui-state-active, +.ui-menu .ui-state-disabled:hover .ui-menu-icon, +.ui-menu .ui-state-disabled.ui-state-focus .ui-menu-icon, +.ui-menu .ui-state-disabled.ui-state-active .ui-menu-icon { + background-color: #FFF; + color: #999; +} +/* auto complete */ +.ui-autocomplete { + background-color: #FFF; + border: 1px solid rgba(0, 0, 0, 0.2); + -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); +} +.ui-autocomplete-category { + padding: 6px; + position: relative; + background-color: #eef4f9; + color: #478fca; + font-weight: bolder; + border: 1px solid #DAE6ED; + border-width: 1px 0; +} +.ui-spinner-button { + border-width: 0 !important; + font-size: 10px; + height: 16px; + line-height: 16px; + width: 18px; + color: #FFFFFF !important; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25) !important; + display: inline-block; + position: absolute; + text-align: center; + padding: 0; +} +.ui-spinner-button > .ace-icon { + width: 18px; + display: inline-block; +} +.ui-spinner-up { + top: 0; + right: 5px; +} +.ui-spinner-down { + bottom: 3px; + right: 5px; +} +.ui-spinner-input { + margin-top: 0; + padding: 5px; + max-width: 100px; + font-size: 14px; +} +.ui-tooltip { + background-color: #444; + color: #FFF; +} +.ui-progressbar { + background-color: #f5f5f5; + height: 22px; +} +.ui-progressbar .ui-progressbar-value { + margin: 0; +} +.ui-progressbar .ui-progressbar-value[class="progress-bar"] { + background-color: #2a91d8; +} +.ui-selectmenu-button { + border: 1px solid #aaa; +} +.ui-selectmenu-button[aria-expanded=true] { + border-color: #4492C9; +} +.ui-selectmenu-button span.ui-icon { + text-indent: 0; + margin-top: -10px; +} +.ui-selectmenu-button .ui-icon:before { + content: "\f0d7"; + display: inline-block; + color: #888; + font-family: FontAwesome; + font-size: 14px; +} +.ui-jqgrid .ui-jqgrid-view, +.ui-jqgrid .ui-paging-info, +.ui-jqgrid .ui-pg-table, +.ui-jqgrid .ui-pg-selbox { + font-size: 13px; +} +.ui-jqgrid .ui-jqgrid-title { + float: left; + margin: 8px; +} +.ui-jqgrid .ui-jqgrid-title-rtl { + float: right; + margin: 8px; +} +.ui-jqgrid-view > .ui-jqgrid-titlebar { + height: 40px; + line-height: 24px; + color: #FFF; + background: #307ecc; + padding: 0; + font-size: 15px; +} +.ui-jqgrid tr.jqgrow.ui-row-rtl td:last-child { + border-right: none; + border-left: 1px solid #E1E1E1; +} +.ui-jqgrid .ui-jqgrid-hdiv { + background-color: #eff3f8; + border: 1px solid #D3D3D3; + border-width: 1px 0 0 1px; + line-height: 15px; + font-weight: bold; + color: #777; + text-shadow: none; +} +.ui-jqgrid .ui-jqgrid-htable thead { + background-color: #eff3f8; +} +.ui-jqgrid .ui-jqgrid-htable th span.ui-jqgrid-resize { + height: 45px !important; +} +.ui-jqgrid .ui-jqgrid-htable th div { + padding-top: 12px; + padding-bottom: 12px; +} +.ui-jqgrid-hdiv .ui-jqgrid-htable { + border-top: none; +} +.ui-jqgrid-hdiv .ui-jqgrid-htable { + border-top: 1px solid #E1E1E1; +} +.ui-jqgrid-titlebar { + position: relative; + top: 1px; + z-index: 1; +} +.ui-jqgrid tr.jqgrow, +.ui-jqgrid tr.ui-row-ltr, +.ui-jqgrid tr.ui-row-rtl { + border: none; +} +.ui-jqgrid tr.ui-row-ltr td, +.ui-jqgrid tr.ui-row-rtl td { + border-bottom: 1px solid #E1E1E1; + padding: 6px 4px; + border-color: #E1E1E1; +} +.ui-jqgrid tr.ui-state-highlight.ui-row-ltr td { + border-right-color: #C7D3A9; +} +.ui-jqgrid tr.ui-state-highlight.ui-row-rtl td { + border-left-color: #C7D3A9; +} +.ui-jqgrid-btable .ui-widget-content.ui-priority-secondary { + background-image: none; + background-color: #F9F9F9; + opacity: 1; +} +.ui-jqgrid-btable .ui-widget-content.ui-state-hover { + background-image: none; + background-color: #EFF4F7; + opacity: 1; +} +.ui-jqgrid-btable .ui-widget-content.ui-state-highlight { + background-color: #E4EFC9; +} +.ui-jqgrid .ui-jqgrid-pager { + line-height: 15px; + height: 55px; + padding-top: 3px !important; + padding-bottom: 5px !important; + background-color: #eff3f8 !important; + border-bottom: 1px solid #E1E1E1 !important; + border-top: 1px solid #E1E1E1 !important; +} +.ui-jqgrid .ui-pg-input { + font-size: inherit; + width: 24px; + height: 20px; + line-height: 16px; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + text-align: center; + padding-top: 1px; + padding-bottom: 1px; +} +.ui-jqgrid .ui-pg-selbox { + display: block; + height: 24px; + width: 60px; + margin: 0; + padding: 1px; + line-height: normal; +} +.ui-jqgrid .ui-jqgrid-htable th div { + overflow: visible; +} +.ui-jqgrid .ui-pager-control { + height: 50px; + position: relative; + padding-left: 9px; + padding-right: 9px; +} +.ui-jqgrid .ui-jqgrid-toppager { + height: auto !important; + background-color: #eff3f8; + border-bottom: 1px solid #E1E1E1 !important; +} +.ui-jqgrid .jqgrow .editable { + max-width: 90%; + max-width: calc(92%) !important; +} +.ui-pg-table .navtable .ui-corner-all { + border-radius: 0; +} +.ui-jqgrid .ui-pg-button:hover { + padding: 1px; +} +.ui-jqgrid .ui-pg-button .ui-separator { + margin-left: 4px; + margin-right: 4px; + border-color: #C9D4DB; +} +.ui-jqgrid .ui-jqgrid-btable { + border-left: 1px solid #E1E1E1; +} +.ui-jqgrid .ui-jqgrid-bdiv { + border-top: 1px solid #E1E1E1; +} +.ui-jqgrid .loading { + position: absolute; + top: 45%; + left: 45%; + width: auto; + height: auto; + z-index: 101; + padding: 6px; + margin: 5px; + text-align: center; + font-weight: bold; + font-size: 12px; + background-color: #FFF; + border: 2px solid #8EB8D1; + color: #E2B018; +} +.ui-jqgrid .ui-search-toolbar { + border-top: 1px solid #E1E1E1; +} +.ui-jqgrid .ui-jqgrid-labels { + border-bottom: none; + background: #F2F2F2; + background-image: -webkit-linear-gradient(top, #f8f8f8 0%, #ececec 100%); + background-image: -o-linear-gradient(top, #f8f8f8 0%, #ececec 100%); + background-image: linear-gradient(to bottom, #f8f8f8 0%, #ececec 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff8f8f8', endColorstr='#ffececec', GradientType=0); + padding: 0 !important; + border-left: 1px solid #E1E1E1 !important; +} +.ui-jqgrid .ui-jqgrid-labels th { + border-right: 1px solid #E1E1E1 !important; + text-align: left !important; +} +/* checkbox container */ +.ui-jqgrid-labels th[id*="_cb"]:first-child > div { + padding-top: 0; + text-align: center !important; +} +.ui-jqgrid-sortable { + padding-left: 4px; + font-size: 13px; + color: #777; + font-weight: bold; +} +.ui-jqgrid-sortable:hover { + color: #547ea8; +} +th[aria-selected=true] { + background-image: -webkit-linear-gradient(top, #eff3f8 0%, #e3e7ed 100%); + background-image: -o-linear-gradient(top, #eff3f8 0%, #e3e7ed 100%); + background-image: linear-gradient(to bottom, #eff3f8 0%, #e3e7ed 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffeff3f8', endColorstr='#ffe3e7ed', GradientType=0); +} +th[aria-selected=true] .ui-jqgrid-sortable { + color: #307ecc; +} +.ui-jqgrid .ui-icon { + text-indent: 0; + color: #307ecc; + float: none; + right: 2px; +} +.rtl .ui-jqgrid .ui-icon { + right: auto; + left: 2px; +} +.ui-jqgrid .ui-icon.ui-state-disabled { + color: #BBB; +} +.ui-jqgrid .ui-icon.ui-state-disabled:hover { + padding: 0; +} +.ui-grid-ico-sort:before { + display: inline; + content: "\f0d7"; + font-family: FontAwesome; + font-size: 12px; +} +.ui-icon-asc:before { + content: "\f0d8"; +} +.ui-pg-table > tbody > tr > .ui-pg-button > .ui-icon { + display: inline-block; + padding: 0; + width: 24px; + height: 24px; + line-height: 22px; + text-align: center; + position: static; + float: none; + margin: 0 2px !important; + color: #808080; + border: 1px solid #CCC; + background-color: #FFF; + border-radius: 100%; +} +.ui-pg-table > tbody > tr > .ui-pg-button > .ui-icon:hover { + color: #699AB5; + border-color: #699AB5; +} +.ui-pg-table > tbody > tr > .ui-pg-button > .ui-icon:before { + width: 20px; + text-align: center; + display: inline-block; +} +.ui-pg-table > tbody > tr > .ui-pg-button.ui-state-disabled .ui-icon { + color: #B0B0B0; + background-color: #F7F7F7; + border-color: #DDD; + -moz-transform: scale(0.9); + -webkit-transform: scale(0.9); + -o-transform: scale(0.9); + -ms-transform: scale(0.9); + transform: scale(0.9); +} +.ui-jqgrid-btable input, +.ui-jqgrid-btable textarea, +.ui-jqgrid-btable select { + padding: 2px; + width: auto; + max-width: 100%; + margin-bottom: 0; +} +.ui-jqgrid-btable select { + padding: 1px; + height: 25px; + line-height: 25px; +} +.ui-pg-div .ui-icon { + display: inline-block; + width: 18px; + float: none; + position: static; + text-align: center; + opacity: 0.85; + -webkit-transition: all 0.12s; + -o-transition: all 0.12s; + transition: all 0.12s; + margin: 0 1px; + vertical-align: middle; + cursor: pointer; + font-size: 17px; +} +.ui-pg-div .ui-icon:hover { + -moz-transform: scale(1.2); + -webkit-transform: scale(1.2); + -o-transform: scale(1.2); + -ms-transform: scale(1.2); + transform: scale(1.2); + opacity: 1; + position: static; + margin: 0 1px; +} +.ui-pg-div .ui-icon:before { + font-family: FontAwesome; + display: inline; +} +.ui-jqgrid .ui-icon-pencil { + color: #478FCA; +} +.ui-jqgrid .ui-icon-pencil:before { + content: "\f040"; +} +.ui-jqgrid .ui-icon-trash { + color: #DD5A43; +} +.ui-jqgrid .ui-icon-trash:before { + content: "\f014"; +} +.ui-jqgrid .ui-icon-disk { + color: #69AA46; +} +.ui-jqgrid .ui-icon-disk:before { + content: "\f00c"; +} +.ui-jqgrid .ui-icon-cancel { + color: #DD5A43; +} +.ui-jqgrid .ui-icon-cancel:before { + content: "\f00d"; +} +.ui-jqdialog-content, +.ui-jqdialog .ui-jqdialog-content { + font-size: 13px; + padding: 4px 0 0; +} +.ui-jqdialog-content .formdata, +.ui-jqdialog .ui-jqdialog-content .formdata { + font-size: 13px; + padding: 6px 12px; +} +.ui-jqdialog-content .form-view-data, +.ui-jqdialog .ui-jqdialog-content .form-view-data { + vertical-align: middle; + font-size: 13px; +} +.ui-jqdialog-content[id*="alertcnt_"], +.ui-jqdialog .ui-jqdialog-content[id*="alertcnt_"] { + padding: 8px 11px; +} +.ui-jqdialog-content .CaptionTD { + font-size: 12px; + text-align: right; + color: #666; +} +.ui-jqdialog-content .FormData { + border-bottom: 1px dotted #E8E8E8; +} +.ui-jqdialog-content .FormData:last-child { + border-bottom: none; +} +.ui-jqdialog-content .FormData > td { + padding-top: 6px; + padding-bottom: 6px; +} +.ui-jqdialog-content input.FormElement { + width: auto; +} +.ui-jqdialog-content select.FormElement { + padding: 1px; + height: 25px; + line-height: 25px; + width: auto; +} +.ui-jqdialog-content td.EditButton { + padding: 8px; +} +.EditTable { + background-color: #eff3f8; + border-top: 1px solid #D6E1EA !important; + padding: 8px; +} +.EditTable tr:first-child { + display: none; +} +.EditTable .navButton .fm-button { + float: none !important; + width: auto !important; + margin: 1px 1px 2px !important; + background-color: transparent; + border-radius: 100%; +} +.EditTable .navButton .fm-button:hover { + background-color: transparent; +} +.EditTable .navButton .fm-button:focus { + outline: none; +} +.EditTable .navButton .fm-button .ace-icon { + display: inline-block; + color: #999; + border: 1px solid #AAA; + width: 26px; + height: 26px; + line-height: 26px; + text-align: center; + border-radius: 100%; + background-color: #FFF; +} +.EditTable .navButton .fm-button:hover .ace-icon { + color: #699AB5; + border-color: #699AB5; +} +.EditTable .navButton .fm-button.ui-state-disabled .ace-icon, +.EditTable .navButton .fm-button.ui-state-disabled:hover .ace-icon { + color: #BBB; + border-color: #CCC; + -moz-transform: scale(0.88); + -webkit-transform: scale(0.88); + -o-transform: scale(0.88); + -ms-transform: scale(0.88); + transform: scale(0.88); +} +.FormGrid .EditTable { + background-color: #FFF; + border-top: none !important; + padding: 0; +} +.FormGrid .EditTable tr:first-child { + display: none; +} +.ui-jqgrid .ui-jqgrid-view input, +.ui-jqgrid .ui-jqgrid-view select, +.ui-jqgrid .ui-jqgrid-view textarea, +.ui-jqgrid .ui-jqgrid-view button { + font-size: 13px; +} +.ui-jqdialog-content .searchFilter select { + padding: 1px; + height: 26px; + line-height: 26px; + width: auto; + max-width: 95%; + margin-bottom: 0; +} +.ui-jqdialog-content .searchFilter .input-elm { + margin-bottom: 0; + height: 18px; + line-height: 18px; + width: 95% !important; + padding-left: 1px; + padding-right: 1px; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} +.ui-jqdialog-content .searchFilter table { + margin-left: 4px; +} +.ui-jqdialog-content .searchFilter tr td { + padding: 5px 0; +} +.ui-jqdialog-content .searchFilter .add-group, +.ui-jqdialog-content .searchFilter .add-rule, +.ui-jqdialog-content .searchFilter .delete-group { + margin-left: 4px !important; + font-size: 15px !important; +} +.ui-jqdialog-content .searchFilter .delete-rule { + border: none; + background-color: #FFF; + color: #D15B47; + font-size: 20px; + width: 22px; + line-height: 10px; + padding: 0; + text-shadow: none !important; + display: inline-block; + -webkit-transition: all 0.1s; + -o-transition: all 0.1s; + transition: all 0.1s; + opacity: 0.85; +} +.ui-jqdialog-content .searchFilter .delete-rule:hover { + -moz-transform: scale(1.1); + -webkit-transform: scale(1.1); + -o-transform: scale(1.1); + -ms-transform: scale(1.1); + transform: scale(1.1); + color: #B74635; + opacity: 1; +} +.ui-jqdialog-content .searchFilter .queryresult { + margin-bottom: 11px; +} +.ui-jqdialog-content .searchFilter .queryresult td.query { + padding: 6px 11px; + border: 1px solid #E1E1E1; + background-color: #EEEEEE; +} +.ui-jqdialog-content .searchFilter .queryresult td.query:empty { + display: none; +} +.ui-state-error { + background-color: #f2dede; + border: 1px solid #ebccd1; + color: #a94442; + margin: 4px 4px 8px; + padding: 6px 10px; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); + font-size: 13px; +} +.ui-jqdialog .ui-widget-header { + background-image: -webkit-linear-gradient(top, #ffffff 0%, #eeeeee 100%); + background-image: -o-linear-gradient(top, #ffffff 0%, #eeeeee 100%); + background-image: linear-gradient(to bottom, #ffffff 0%, #eeeeee 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffeeeeee', GradientType=0); + border-image: none; + border-bottom: 1px solid solid; + color: #669FC7; + min-height: 38px; + position: relative; +} +.ui-jqdialog .ui-widget-header .ui-jqdialog-title { + line-height: 38px; + margin: 0; + padding: 0; + padding-left: 12px; + text-align: left; +} +.widget-header .ui-jqdialog-title { + padding-left: 0 !important; + padding-right: 0 !important; +} +.ui-jqdialog .ui-widget-header .widget-header { + border-bottom: none; +} +.ui-jqdialog .ui-jqdialog-titlebar { + border-bottom: 1px solid #DDD !important; +} +.fm-button { + margin: 0 4px; +} +.fm-button:not(.btn) { + background-color: #abbac3; + border-radius: 0 ; + box-shadow: none; + color: #FFFFFF ; + cursor: pointer; + display: inline-block; + font-size: 13px; + line-height: 28px; + padding: 0 12px 1px; + margin: 0 8px; + position: relative; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + -webkit-transition: all 0.15s; + -o-transition: all 0.15s; + transition: all 0.15s; + vertical-align: middle; +} +.fm-button.ui-state-default:hover { + background-color: #8b9aa3; +} +.ui-jqgrid .ui-jqgrid-htable .ui-search-toolbar th { + height: 30px; + padding-top: 2px; + white-space: normal; +} +.ui-jqgrid .ui-jqgrid-htable .ui-search-toolbar th div { + padding-top: 0; + padding-bottom: 0; + height: 30px; + line-height: 26px; +} +.ui-jqgrid .ui-jqgrid-titlebar-close { + top: 10%; + height: auto; + padding: 0; + margin: 2px 8px 0 0; + text-align: center; + border-radius: 4px; +} +.ui-jqgrid .ui-jqgrid-titlebar-close:hover { + background-color: rgba(255, 255, 255, 0.2); +} +.ui-jqgrid .ui-jqgrid-titlebar-close .ui-icon:before { + display: inline-block; + font-family: FontAwesome; + content: "\f077"; + color: #FFF; +} +.ui-jqgrid .ui-jqgrid-titlebar-close .ui-icon-circle-triangle-s:before { + content: "\f078"; +} +.ui-jqgrid .tree-wrap-ltr { + margin: 0 4px; + float: none; + display: inline; +} +.ui-jqgrid .tree-wrap-rtl { + margin: 2px 4px 0; +} +.ui-jqgrid .ui-subgrid { + border-bottom: 1px solid #E1E1E1; + background-color: #F6FAFF; +} +.ui-jqgrid .ui-subgrid .ui-jqgrid-btable { + background-color: #FFF; +} +.ui-jqgrid .ui-subgrid .ui-jqgrid .ui-jqgrid-hdiv { + background-color: transparent; + margin-top: 4px; +} +.ui-jqgrid .ui-subgrid .ui-jqgrid .ui-jqgrid-hdiv .ui-jqgrid-htable .ui-jqgrid-labels { + border-bottom: 1px solid #E1E1E1; + background: #F1F1F1; +} +.ui-jqgrid .ui-subgrid .ui-jqgrid .ui-jqgrid-hdiv .ui-jqgrid-htable th[aria-selected="true"] { + background: #E5E9EF; +} +.ui-jqgrid .ui-subgrid .ui-jqgrid .ui-jqgrid-hdiv .ui-jqgrid-htable th .ui-jqgrid-sortable { + font-size: 12px; +} +.ui-jqgrid .ui-subgrid .ui-jqgrid .ui-jqgrid-hdiv .ui-jqgrid-htable th div { + padding-top: 8px; + padding-bottom: 8px; +} +.ui-jqgrid .ui-subgrid .ui-jqgrid .ui-jqgrid-hdiv .ui-jqgrid-htable th span.ui-jqgrid-resize { + height: 36px !important; +} +.ui-jqgrid .ui-subgrid .ui-jqgrid .ui-jqgrid-bdiv { + height: auto !important; + max-height: 150px; + margin-bottom: 4px; + border-top-width: 0; + border-bottom: 1px solid #E1E1E1; +} +.ui-jqgrid .ui-sgcollapsed > a:hover { + text-decoration: none; +} +@media only screen and (max-width: 767px) { + .ui-jqgrid .ui-jqgrid-pager { + height: 90px; + } + .ui-jqgrid .ui-jqgrid-pager > .ui-pager-control { + height: 85px; + padding-top: 9px; + } + .ui-jqgrid .ui-jqgrid-pager > .ui-pager-control > .ui-pg-table > tbody > tr > td { + vertical-align: top; + } + .ui-jqgrid .ui-jqgrid-pager > .ui-pager-control > .ui-pg-table > tbody > tr > td#grid-pager_center { + width: 0 !important; + position: static; + } + .ui-jqgrid .ui-jqgrid-pager > .ui-pager-control > .ui-pg-table > tbody > tr > td#grid-pager_center > .ui-pg-table { + margin: 36px auto 0; + position: absolute; + right: 0; + left: 0; + text-align: center; + } +} +@media only screen and (max-width: 767px) and (-webkit-min-device-pixel-ratio: 0) { + .ui-jqgrid .ui-jqgrid-pager > .ui-pager-control > .ui-pg-table > tbody > tr > td#grid-pager_center > .ui-pg-table { + width: 300px; + } +} +.dd { + position: relative; + display: block; + margin: 0; + padding: 0; + max-width: 600px; + list-style: none; + line-height: 20px; +} +.dd-list { + display: block; + position: relative; + margin: 0; + padding: 0; + list-style: none; +} +.dd-list .dd-list { + padding-left: 30px; +} +.dd-collapsed .dd-list { + display: none; +} +.dd-item, +.dd-empty, +.dd-placeholder { + display: block; + position: relative; + margin: 0; + padding: 0; + min-height: 20px; + line-height: 20px; +} +.dd-handle, +.dd2-content { + display: block; + min-height: 38px; + margin: 5px 0; + padding: 8px 12px; + background: #F8FAFF; + border: 1px solid #DAE2EA; + color: #7C9EB2; + text-decoration: none; + font-weight: bold; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.dd-handle:hover, +.dd2-content:hover { + color: #438EB9; + background: #F4F6F7; + border-color: #DCE2E8; +} +.dd-handle[class*="btn-"], +.dd2-content[class*="btn-"] { + color: #FFF; + border: none; + padding: 9px 12px; +} +.dd-handle[class*="btn-"]:hover, +.dd2-content[class*="btn-"]:hover { + opacity: 0.85; + color: #FFF; +} +.dd2-handle + .dd2-content, +.dd2-handle + .dd2-content[class*="btn-"] { + padding-left: 44px; +} +.dd-handle[class*="btn-"]:hover, +.dd2-content[class*="btn-"] .dd2-handle[class*="btn-"]:hover + .dd2-content[class*="btn-"] { + color: #FFF; +} +.dd-item > button:hover ~ .dd-handle, +.dd-item > button:hover ~ .dd2-content { + color: #438EB9; + background: #F4F6F7; + border-color: #DCE2E8; +} +.dd-item > button:hover ~ .dd-handle[class*="btn-"], +.dd-item > button:hover ~ .dd2-content[class*="btn-"] { + opacity: 0.85; + color: #FFF; +} +.dd2-handle:hover ~ .dd2-content { + color: #438EB9; + background: #F4F6F7; + border-color: #DCE2E8; +} +.dd2-handle:hover ~ .dd2-content[class*="btn-"] { + opacity: 0.85; + color: #FFF; +} +.dd2-item.dd-item > button { + margin-left: 34px; +} +.dd-item > button { + display: block; + position: relative; + z-index: 1; + cursor: pointer; + float: left; + width: 25px; + height: 20px; + margin: 5px 1px 5px 5px; + padding: 0; + text-indent: 100%; + white-space: nowrap; + overflow: hidden; + border: 0; + background: transparent; + font-size: 12px; + line-height: 1; + text-align: center; + font-weight: bold; + top: 4px; + left: 1px; + color: #707070; +} +.dd-item > button:before { + font-family: FontAwesome; + content: '\f067'; + display: block; + position: absolute; + width: 100%; + text-align: center; + text-indent: 0; + font-weight: normal; + font-size: 14px; +} +.dd-item > button[data-action="collapse"]:before { + content: '\f068'; +} +.dd-item > button:hover { + color: #707070; +} +.dd-item.dd-colored > button, +.dd-item.dd-colored > button:hover { + color: #EEE; +} +.dd-placeholder, +.dd-empty { + margin: 5px 0; + padding: 0; + min-height: 30px; + background: #F0F9FF; + border: 2px dashed #BED2DB; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.dd-empty { + border-color: #AAA; + border-style: solid; + background-color: #e5e5e5; +} +.dd-dragel { + position: absolute; + pointer-events: none; + z-index: 999; + opacity: 0.8; +} +.dd-dragel > li > .dd-handle { + color: #4B92BE; + background: #F1F5FA; + border-color: #D6E1EA; + border-left: 2px solid #777; + position: relative; +} +.dd-dragel > li > .dd-handle[class*="btn-"] { + color: #FFF; +} +.dd-dragel > .dd-item > .dd-handle { + margin-top: 0; +} +.dd-list > li[class*="item-"] { + border-width: 0; + padding: 0; +} +.dd-list > li[class*="item-"] > .dd-handle { + border-left: 2px solid; + border-left-color: inherit; +} +.dd-list > li > .dd-handle .sticker { + position: absolute; + right: 0; + top: 0; +} +.dd2-handle, +.dd-dragel > li > .dd2-handle { + left: 0; + top: 0; + width: 36px; + margin: 0; + border-width: 1px 1px 0 0; + text-align: center; + padding: 0 !important; + line-height: 38px; + height: 38px; + background: #EBEDF2; + border: 1px solid #DEE4EA; + cursor: pointer; + overflow: hidden; + position: absolute; + z-index: 1; +} +.dd2-handle:hover, +.dd-dragel > li > .dd2-handle { + background: #E3E8ED; +} +.dd2-content[class*="btn-"] { + text-shadow: none !important; +} +.dd2-handle[class*="btn-"] { + text-shadow: none !important; + background: rgba(0, 0, 0, 0.1) !important; + border-right: 1px solid #EEE; +} +.dd2-handle[class*="btn-"]:hover { + background: rgba(0, 0, 0, 0.08) !important; +} +.dd-dragel .dd2-handle[class*="btn-"] { + border-color: transparent; + border-right-color: #EEE; +} +.dd2-handle.btn-yellow { + text-shadow: none !important; + background: rgba(0, 0, 0, 0.05) !important; + border-right: 1px solid #FFF; +} +.dd2-handle.btn-yellow:hover { + background: rgba(0, 0, 0, 0.08) !important; +} +.dd-dragel .dd2-handle.btn-yellow { + border-color: transparent; + border-right-color: #FFF; +} +.dd-item > .dd2-handle .drag-icon { + display: none; +} +.dd-dragel > .dd-item > .dd2-handle .drag-icon { + display: inline; +} +.dd-dragel > .dd-item > .dd2-handle .normal-icon { + display: none; +} +.dropzone { + border-radius: 0; + border: 1px solid rgba(0, 0, 0, 0.06); +} +.dropzone .dz-default.dz-message { + background-image: none; + font-size: 24px; + text-align: center; + line-height: 32px; + left: 0; + width: 100%; + margin-left: auto; +} +.dropzone .dz-default.dz-message span { + display: inline; + color: #555; +} +.dropzone .dz-default.dz-message span .upload-icon { + opacity: 0.7; + filter: alpha(opacity=70); + margin-top: 8px; + cursor: pointer; +} +.dropzone .dz-default.dz-message span .upload-icon:hover { + opacity: 1; + filter: alpha(opacity=100); +} +.dropzone .dz-preview .dz-error-mark, +.dropzone-previews .dz-preview .dz-error-mark, +.dropzone .dz-preview .dz-success-mark, +.dropzone-previews .dz-preview .dz-success-mark { + background-image: none; + background-color: rgba(255, 255, 255, 0.8); + border-radius: 100%; + text-align: center; + line-height: 35px; +} +.dropzone .dz-preview .dz-error-mark:before, +.dropzone-previews .dz-preview .dz-error-mark:before { + font-family: FontAwesome; + font-size: 30px; + color: #DB6262; + content: "\f00d"; +} +.dropzone .dz-preview .dz-success-mark:before, +.dropzone-previews .dz-preview .dz-success-mark:before { + font-family: FontAwesome; + font-size: 30px; + color: #6DA552; + content: "\f00c"; +} +.dropzone a.dz-remove, +.dropzone-previews a.dz-remove { + border: none; + border-radius: 0; + color: #FFF; + background: #D15B47; + cursor: pointer; +} +.dropzone a.dz-remove:hover, +.dropzone-previews a.dz-remove:hover { + color: #FFF; + background: #B74635; +} +.dropzone .progress, +.dropzone-previews .progress { + margin-bottom: 0; +} +.dropzone .dz-preview.dz-success .progress, +.dropzone-previews .dz-preview.dz-success .progress, +.dropzone .dz-preview.dz-error .progress, +.dropzone-previews .dz-preview.dz-error .progress { + display: none; +} +input.typeahead, +input.tt-query, +input.tt-hint { + min-width: 175px; + font-size: 16px; + line-height: 24px; + border: 1px solid #CCC; + border-radius: 0; + outline: none; +} +input.tt-hint, +.form-group input.tt-hint { + background-color: #FFF !important; + color: #B0B0B0 !important; +} +.tt-dropdown-menu { + text-align: left; + position: absolute; + left: 0 !important; + right: 0 !important; + min-width: 175px; + margin-top: 2px; + padding: 8px 0; + background-color: #FFF; + border: 1px solid #D0D0D0; + border: 1px solid rgba(0, 0, 0, 0.15); + border-radius: 0; + -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); +} +.tt-suggestion { + padding: 3px 12px 4px; + font-size: 16px; + line-height: 24px; +} +.tt-suggestion.tt-cursor { + color: #FFF; + background-color: #4F99C6; + cursor: pointer; +} +.tt-suggestion p { + margin: 0; +} +input.typeahead.scrollable ~ .tt-dropdown-menu { + max-height: 200px; + overflow-y: auto; +} +.btn-group > .btn.moveall:first-child, +.btn-group > .btn.remove:first-child { + margin: 0; +} +.btn-group > .btn.moveall:first-child + .btn.move, +.btn-group > .btn.remove:first-child + .btn.removeall { + margin: 0; +} +.bootstrap-duallistbox-container .info { + font-size: 12px; +} +.bootstrap-duallistbox-container .clear1, +.bootstrap-duallistbox-container .clear2 { + font-size: 12px; +} +.multiselect-container > li > a { + padding: 0; +} +.multiselect-container > li > a > label { + padding: 7px 10px 7px 20px; +} +.cancel-on-png, +.cancel-off-png, +.star-on-png, +.star-off-png, +.star-half-png { + font-size: 2em; +} +.cancel-on-png, +.cancel-off-png, +.star-on-png, +.star-off-png, +.star-half-png { + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + font-family: "FontAwesome"; + font-style: normal; + font-variant: normal; + font-weight: normal; + line-height: 1; + speak: none; + text-transform: none; + color: #777777; +} +.cancel-on-png { + color: #dd5a43; +} +.cancel-on-png:before { + content: "\f057"; +} +.cancel-off-png { + color: #e08374; +} +.cancel-off-png:before { + content: "\f05c"; +} +.star-on-png { + color: #feb902; +} +.star-on-png:before { + content: "\f005"; +} +.star-off-png { + color: #777777; +} +.star-off-png:before { + content: "\f006"; +} +.star-half-png { + color: #feb902; +} +.star-half-png:before { + content: "\f123"; +} +/* custom animated icons */ +.icon-animated-bell { + display: inline-block; + -moz-animation: ringing 2.0s 5 ease 1.0s; + -webkit-animation: ringing 2.0s 5 ease 1.0s; + -o-animation: ringing 2.0s 5 ease 1.0s; + -ms-animation: ringing 2.0s 5 ease 1.0s; + animation: ringing 2.0s 5 ease 1.0s; + -moz-transform-origin: 50% 0%; + -webkit-transform-origin: 50% 0%; + -o-transform-origin: 50% 0%; + -ms-transform-origin: 50% 0%; + transform-origin: 50% 0%; +} +@-moz-keyframes ringing { + 0% { + -moz-transform: rotate(-15deg); + } + 2% { + -moz-transform: rotate(15deg); + } + 4% { + -moz-transform: rotate(-18deg); + } + 6% { + -moz-transform: rotate(18deg); + } + 8% { + -moz-transform: rotate(-22deg); + } + 10% { + -moz-transform: rotate(22deg); + } + 12% { + -moz-transform: rotate(-18deg); + } + 14% { + -moz-transform: rotate(18deg); + } + 16% { + -moz-transform: rotate(-12deg); + } + 18% { + -moz-transform: rotate(12deg); + } + 20% { + -moz-transform: rotate(0deg); + } +} +@-webkit-keyframes ringing { + 0% { + -webkit-transform: rotate(-15deg); + } + 2% { + -webkit-transform: rotate(15deg); + } + 4% { + -webkit-transform: rotate(-18deg); + } + 6% { + -webkit-transform: rotate(18deg); + } + 8% { + -webkit-transform: rotate(-22deg); + } + 10% { + -webkit-transform: rotate(22deg); + } + 12% { + -webkit-transform: rotate(-18deg); + } + 14% { + -webkit-transform: rotate(18deg); + } + 16% { + -webkit-transform: rotate(-12deg); + } + 18% { + -webkit-transform: rotate(12deg); + } + 20% { + -webkit-transform: rotate(0deg); + } +} +@-ms-keyframes ringing { + 0% { + -ms-transform: rotate(-15deg); + } + 2% { + -ms-transform: rotate(15deg); + } + 4% { + -ms-transform: rotate(-18deg); + } + 6% { + -ms-transform: rotate(18deg); + } + 8% { + -ms-transform: rotate(-22deg); + } + 10% { + -ms-transform: rotate(22deg); + } + 12% { + -ms-transform: rotate(-18deg); + } + 14% { + -ms-transform: rotate(18deg); + } + 16% { + -ms-transform: rotate(-12deg); + } + 18% { + -ms-transform: rotate(12deg); + } + 20% { + -ms-transform: rotate(0deg); + } +} +@keyframes ringing { + 0% { + transform: rotate(-15deg); + } + 2% { + transform: rotate(15deg); + } + 4% { + transform: rotate(-18deg); + } + 6% { + transform: rotate(18deg); + } + 8% { + transform: rotate(-22deg); + } + 10% { + transform: rotate(22deg); + } + 12% { + transform: rotate(-18deg); + } + 14% { + transform: rotate(18deg); + } + 16% { + transform: rotate(-12deg); + } + 18% { + transform: rotate(12deg); + } + 20% { + transform: rotate(0deg); + } +} +.icon-animated-vertical { + display: inline-block; + -moz-animation: vertical 2.0s 5 ease 2.0s; + -webkit-animation: vertical 2.0s 5 ease 2.0s; + -o-animation: vertical 2.0s 5 ease 2.0s; + -ms-animation: vertical 2.0s 5 ease 2.0s; + animation: vertical 2.0s 5 ease 2.0s; +} +@-moz-keyframes vertical { + 0% { + -moz-transform: translate(0, -3px); + } + 4% { + -moz-transform: translate(0, 3px); + } + 8% { + -moz-transform: translate(0, -3px); + } + 12% { + -moz-transform: translate(0, 3px); + } + 16% { + -moz-transform: translate(0, -3px); + } + 20% { + -moz-transform: translate(0, 3px); + } + 22% { + -moz-transform: translate(0, 0); + } +} +@-webkit-keyframes vertical { + 0% { + -webkit-transform: translate(0, -3px); + } + 4% { + -webkit-transform: translate(0, 3px); + } + 8% { + -webkit-transform: translate(0, -3px); + } + 12% { + -webkit-transform: translate(0, 3px); + } + 16% { + -webkit-transform: translate(0, -3px); + } + 20% { + -webkit-transform: translate(0, 3px); + } + 22% { + -webkit-transform: translate(0, 0); + } +} +@-ms-keyframes vertical { + 0% { + -ms-transform: translate(0, -3px); + } + 4% { + -ms-transform: translate(0, 3px); + } + 8% { + -ms-transform: translate(0, -3px); + } + 12% { + -ms-transform: translate(0, 3px); + } + 16% { + -ms-transform: translate(0, -3px); + } + 20% { + -ms-transform: translate(0, 3px); + } + 22% { + -ms-transform: translate(0, 0); + } +} +@keyframes vertical { + 0% { + transform: translate(0, -3px); + } + 4% { + transform: translate(0, 3px); + } + 8% { + transform: translate(0, -3px); + } + 12% { + transform: translate(0, 3px); + } + 16% { + transform: translate(0, -3px); + } + 20% { + transform: translate(0, 3px); + } + 22% { + transform: translate(0, 0); + } +} +.icon-animated-hand-pointer { + display: inline-block; + -moz-animation: hand-pointer 2.0s 4 ease 2.0s; + -webkit-animation: hand-pointer 2.0s 4 ease 2.0s; + -o-animation: hand-pointer 2.0s 4 ease 2.0s; + -ms-animation: hand-pointer 2.0s 4 ease 2.0s; + animation: hand-pointer 2.0s 4 ease 2.0s; +} +@-moz-keyframes hand-pointer { + 0% { + -moz-transform: translate(0, 0); + } + 6% { + -moz-transform: translate(5px, 0); + } + 12% { + -moz-transform: translate(0, 0); + } + 18% { + -moz-transform: translate(5px, 0); + } + 24% { + -moz-transform: translate(0, 0); + } + 30% { + -moz-transform: translate(5px, 0); + } + 36% { + -moz-transform: translate(0, 0); + } +} +.icon-animated-wrench { + display: inline-block; + -moz-animation: wrenching 2.5s 4 ease; + -webkit-animation: wrenching 2.5s 4 ease; + -o-animation: wrenching 2.5s 4 ease; + -ms-animation: wrenching 2.5s 4 ease; + animation: wrenching 2.5s 4 ease; + -moz-transform-origin: 90% 35%; + -webkit-transform-origin: 90% 35%; + -o-transform-origin: 90% 35%; + -ms-transform-origin: 90% 35%; + transform-origin: 90% 35%; +} +@-moz-keyframes wrenching { + 0% { + -moz-transform: rotate(-12deg); + } + 8% { + -moz-transform: rotate(12deg); + } + 10% { + -moz-transform: rotate(24deg); + } + 18% { + -moz-transform: rotate(-24deg); + } + 20% { + -moz-transform: rotate(-24deg); + } + 28% { + -moz-transform: rotate(24deg); + } + 30% { + -moz-transform: rotate(24deg); + } + 38% { + -moz-transform: rotate(-24deg); + } + 40% { + -moz-transform: rotate(-24deg); + } + 48% { + -moz-transform: rotate(24deg); + } + 50% { + -moz-transform: rotate(24deg); + } + 58% { + -moz-transform: rotate(-24deg); + } + 60% { + -moz-transform: rotate(-24deg); + } + 68% { + -moz-transform: rotate(24deg); + } + 75% { + -moz-transform: rotate(0deg); + } +} +@-webkit-keyframes wrenching { + 0% { + -webkit-transform: rotate(-12deg); + } + 8% { + -webkit-transform: rotate(12deg); + } + 10% { + -webkit-transform: rotate(24deg); + } + 18% { + -webkit-transform: rotate(-24deg); + } + 20% { + -webkit-transform: rotate(-24deg); + } + 28% { + -webkit-transform: rotate(24deg); + } + 30% { + -webkit-transform: rotate(24deg); + } + 38% { + -webkit-transform: rotate(-24deg); + } + 40% { + -webkit-transform: rotate(-24deg); + } + 48% { + -webkit-transform: rotate(24deg); + } + 50% { + -webkit-transform: rotate(24deg); + } + 58% { + -webkit-transform: rotate(-24deg); + } + 60% { + -webkit-transform: rotate(-24deg); + } + 68% { + -webkit-transform: rotate(24deg); + } + 75% { + -webkit-transform: rotate(0deg); + } +} +@-o-keyframes wrenching { + 0% { + -o-transform: rotate(-12deg); + } + 8% { + -o-transform: rotate(12deg); + } + 10% { + -o-transform: rotate(24deg); + } + 18% { + -o-transform: rotate(-24deg); + } + 20% { + -o-transform: rotate(-24deg); + } + 28% { + -o-transform: rotate(24deg); + } + 30% { + -o-transform: rotate(24deg); + } + 38% { + -o-transform: rotate(-24deg); + } + 40% { + -o-transform: rotate(-24deg); + } + 48% { + -o-transform: rotate(24deg); + } + 50% { + -o-transform: rotate(24deg); + } + 58% { + -o-transform: rotate(-24deg); + } + 60% { + -o-transform: rotate(-24deg); + } + 68% { + -o-transform: rotate(24deg); + } + 75% { + -o-transform: rotate(0deg); + } +} +@-ms-keyframes wrenching { + 0% { + -ms-transform: rotate(-12deg); + } + 8% { + -ms-transform: rotate(12deg); + } + 10% { + -ms-transform: rotate(24deg); + } + 18% { + -ms-transform: rotate(-24deg); + } + 20% { + -ms-transform: rotate(-24deg); + } + 28% { + -ms-transform: rotate(24deg); + } + 30% { + -ms-transform: rotate(24deg); + } + 38% { + -ms-transform: rotate(-24deg); + } + 40% { + -ms-transform: rotate(-24deg); + } + 48% { + -ms-transform: rotate(24deg); + } + 50% { + -ms-transform: rotate(24deg); + } + 58% { + -ms-transform: rotate(-24deg); + } + 60% { + -ms-transform: rotate(-24deg); + } + 68% { + -ms-transform: rotate(24deg); + } + 75% { + -ms-transform: rotate(0deg); + } +} +@keyframes wrenching { + 0% { + transform: rotate(-12deg); + } + 8% { + transform: rotate(12deg); + } + 10% { + transform: rotate(24deg); + } + 18% { + transform: rotate(-24deg); + } + 20% { + transform: rotate(-24deg); + } + 28% { + transform: rotate(24deg); + } + 30% { + transform: rotate(24deg); + } + 38% { + transform: rotate(-24deg); + } + 40% { + transform: rotate(-24deg); + } + 48% { + transform: rotate(24deg); + } + 50% { + transform: rotate(24deg); + } + 58% { + transform: rotate(-24deg); + } + 60% { + transform: rotate(-24deg); + } + 68% { + transform: rotate(24deg); + } + 75% { + transform: rotate(0deg); + } +} +@-moz-keyframes blinking { + 0% { + opacity: 1; + } + 40% { + opacity: 0; + } + 80% { + opacity: 1; + } +} +@-webkit-keyframes blinking { + 0% { + opacity: 1; + } + 40% { + opacity: 0; + } + 80% { + opacity: 1; + } +} +@-ms-keyframes blinking { + 0% { + opacity: 1; + } + 40% { + opacity: 0; + } + 80% { + opacity: 1; + } +} +@keyframes blinking { + 0% { + opacity: 1; + } + 40% { + opacity: 0; + } + 80% { + opacity: 1; + } +} +@-moz-keyframes pulsating { + 0% { + -moz-transform: scale(1); + } + 5% { + -moz-transform: scale(0.75); + } + 10% { + -moz-transform: scale(1); + } + 15% { + -moz-transform: scale(1.25); + } + 20% { + -moz-transform: scale(1); + } + 25% { + -moz-transform: scale(0.75); + } + 30% { + -moz-transform: scale(1); + } + 35% { + -moz-transform: scale(1.25); + } + 40% { + -moz-transform: scale(1); + } +} +@-webkit-keyframes pulsating { + 0% { + -webkit-transform: scale(1); + } + 5% { + -webkit-transform: scale(0.75); + } + 10% { + -webkit-transform: scale(1); + } + 15% { + -webkit-transform: scale(1.25); + } + 20% { + -webkit-transform: scale(1); + } + 25% { + -webkit-transform: scale(0.75); + } + 30% { + -webkit-transform: scale(1); + } + 35% { + -webkit-transform: scale(1.25); + } + 40% { + -webkit-transform: scale(1); + } +} +@-ms-keyframes pulsating { + 0% { + -ms-transform: scale(1); + } + 5% { + -ms-transform: scale(0.75); + } + 10% { + -ms-transform: scale(1); + } + 15% { + -ms-transform: scale(1.25); + } + 20% { + -ms-transform: scale(1); + } + 25% { + -ms-transform: scale(0.75); + } + 30% { + -ms-transform: scale(1); + } + 35% { + -ms-transform: scale(1.25); + } + 40% { + -ms-transform: scale(1); + } +} +@keyframes pulsating { + 0% { + transform: scale(1); + } + 5% { + transform: scale(0.75); + } + 10% { + transform: scale(1); + } + 15% { + transform: scale(1.25); + } + 20% { + transform: scale(1); + } + 25% { + transform: scale(0.75); + } + 30% { + transform: scale(1); + } + 35% { + transform: scale(1.25); + } + 40% { + transform: scale(1); + } +} +.btn-scroll-up { + border-width: 0; + position: fixed; + right: 2px; + z-index: 99; + -webkit-transition-duration: 0.3s; + transition-duration: 0.3s; + opacity: 0; + filter: alpha(opacity=0); + bottom: -24px; + visibility: hidden; +} +.btn-scroll-up.display { + opacity: 0.7; + filter: alpha(opacity=70); + bottom: 2px; + visibility: visible; +} +.btn-scroll-up:hover { + opacity: 1; + filter: alpha(opacity=100); +} +.btn-scroll-up:focus { + outline: none; +} +@media (min-width: 768px) { + .main-container.container > .btn-scroll-up { + right: auto; + margin-left: 714px; + } +} +@media (min-width: 992px) { + .main-container.container > .btn-scroll-up { + right: auto; + margin-left: 934px; + } +} +@media (min-width: 1200px) { + .main-container.container > .btn-scroll-up { + right: auto; + margin-left: 1134px; + } +} +.ace-settings-container { + position: absolute; + right: 0; + top: auto; + z-index: 12; +} +.btn.btn-app.ace-settings-btn { + float: left; + display: block; + text-align: center; + border-radius: 6px 0 0 6px; + opacity: 0.55; + vertical-align: top; + margin: 0; +} +.btn.btn-app.ace-settings-btn:hover, +.btn.btn-app.ace-settings-btn.open { + opacity: 1; +} +.btn.btn-app.ace-settings-btn.btn-xs { + width: 42px; +} +.ace-settings-box { + display: block; + float: left; + max-width: 0; + max-height: 0; + overflow: hidden; + padding: 0; + -moz-transform: translate(0,0); + -webkit-transform: translate(0,0); + -o-transform: translate(0,0); + -ms-transform: translate(0,0); + transform: translate(0,0); + background-color: #FFF; + border: 0 solid #ffb34b; + -webkit-transition: max-width 0.25s linear 0s, max-height 0s linear 0.25s, padding 0s linear 0.25s, border-width 0s linear 0.25s; + -o-transition: max-width 0.25s linear 0s, max-height 0s linear 0.25s, padding 0s linear 0.25s, border-width 0s linear 0.25s; + transition: max-width 0.25s linear 0s, max-height 0s linear 0.25s, padding 0s linear 0.25s, border-width 0s linear 0.25s; +} +.ace-settings-box.open { + max-width: 320px; + max-height: 1000px; + padding: 0 14px; + border-width: 2px; + -webkit-transition-delay: 0s; + -moz-transition-delay: 0s; + -o-transition-delay: 0s; + transition-delay: 0s; +} +.ace-settings-box.open .ace-settings-item { + z-index: auto; + min-width: 140px; +} +.ace-settings-box .ace-settings-item { + margin: 6px 0; + color: #444; + max-height: 24px; + position: relative; + z-index: -1; + white-space: nowrap; +} +.ace-settings-box .ace-settings-item > label.lbl { + font-size: 13px; +} +@media (max-width: 480px) { + .ace-settings-container { + text-align: right; + } + .ace-settings-box { + float: none !important; + text-align: left; + } + .btn.ace-settings-btn { + float: none !important; + display: inline-block; + } +} +@media (max-width: 320px) { + .ace-settings-box > .clearfix > .pull-left, + .ace-settings-box > .clearfix > .pull-right { + float: none !important; + } +} +.grid2, +.grid3, +.grid4 { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + display: block; + margin: 0 1%; + padding: 0 2%; + float: left; + border-left: 1px solid #E3E3E3; +} +.grid2:first-child, +.grid3:first-child, +.grid4:first-child { + border-left: none; +} +.grid2 { + width: 48%; +} +.grid3 { + width: 31.33%; +} +.grid4 { + width: 23%; + padding: 0 1%; +} +.draggable-placeholder { + border: 2px dashed #D9D9D9 !important; + background-color: #F7F7F7 !important; +} +.easyPieChart, +.easy-pie-chart { + position: relative; + text-align: center; +} +.easyPieChart canvas, +.easy-pie-chart canvas { + position: absolute; + top: 0; + left: 0; +} +.knob-container { + direction: ltr; + text-align: left; +} +.tags { + display: inline-block; + padding: 4px 6px; + color: #777777; + vertical-align: middle; + background-color: #FFF; + border: 1px solid #d5d5d5; + width: 206px; +} +.tags:hover { + border-color: #b5b5b5; +} +.tags-hover, +.tags-hover:hover { + border-color: #f59942; + outline: 0; +} +.tags[class*="span"] { + float: none; + margin-left: 0; +} +.tags input[type="text"], +.tags input[type="text"]:focus { + border: none; + display: inline; + outline: 0; + margin: 0; + padding: 0; + line-height: 18px; + -webkit-box-shadow: none; + box-shadow: none; + width: 100%; +} +.tags .tag { + display: inline-block; + position: relative; + font-size: 13px; + font-weight: normal; + vertical-align: baseline; + white-space: nowrap; + background-color: #91b8d0; + color: #FFF; + text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.15); + padding: 4px 22px 5px 9px; + margin-bottom: 3px; + margin-right: 3px; + -webkit-transition: all 0.2s; + -o-transition: all 0.2s; + transition: all 0.2s; + /** + &:nth-child(5n+1) { + background-color:#48A2E0; + } + &:nth-child(5n+2) { + background-color:#34C896; + } + &:nth-child(5n+3) { + background-color:#B57BB3; + } + &:nth-child(5n+4) { + background-color:#CC7DA8; + } + &:nth-child(5n+5) { + background-color:#666; + } +*/ +} +.tags .tag:empty { + display: none; +} +.tags .tag-important { + background-color: #d15b47; +} +.tags .tag-warning { + background-color: #ffb752; +} +.tags .tag-success { + background-color: #87b87f; +} +.tags .tag-info { + background-color: #6fb3e0; +} +.tags .tag-inverse { + background-color: #555555; +} +.tags .tag .close { + font-size: 15px; + line-height: 20px; + opacity: 1; + filter: alpha(opacity=100); + color: #FFF; + text-shadow: none; + float: none; + position: absolute; + right: 0; + top: 0; + bottom: 0; + width: 18px; + text-align: center; +} +.tags .tag .close:hover { + background-color: rgba(0, 0, 0, 0.2); +} +.page-content > .row .col-xs-12, +.page-content > .row .col-sm-12, +.page-content > .row .col-md-12, +.page-content > .row .col-lg-12 { + float: left; + max-width: 100%; +} +.col-xs-reset { + width: auto; + padding-left: 0; + padding-right: 0; + float: none !important; +} +@media (min-width: 768px) { + .col-sm-reset { + width: auto; + padding-left: 0; + padding-right: 0; + float: none !important; + } +} +@media (min-width: 992px) { + .col-md-reset { + width: auto; + padding-left: 0; + padding-right: 0; + float: none !important; + } +} +@media (min-width: 1200px) { + .col-lg-reset { + width: auto; + padding-left: 0; + padding-right: 0; + float: none !important; + } +} +.jqstooltip, +.legendColorBox div { + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} +.legendLabel { + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 22px; + padding-left: 2px; + font-size: 10px; +} +@media only screen and (max-width: 991px) { + body { + overflow-x: hidden; + } +} +.navbar-fixed-top + .main-container { + padding-top: 45px; +} +@media (max-width: 479px) { + .navbar-fixed-top + .main-container { + padding-top: 90px; + } + .navbar-fixed-top.navbar-collapse + .main-container { + padding-top: 45px; + } +} +@media only screen and (max-width: 360px) { + .grid2, + .grid3, + .grid4 { + float: none; + display: block; + width: 96%; + border-left-width: 0; + position: relative; + margin-bottom: 11px; + border-bottom: 1px solid #E3E3E3; + padding-bottom: 4px; + } + .grid2 > [class*="pull-"], + .grid3 > [class*="pull-"], + .grid4 > [class*="pull-"] { + float: none !important; + display: inline-block; + position: absolute; + right: 11px; + top: 0; + margin-top: 0; + } + .grid2:last-child, + .grid3:last-child, + .grid4:last-child { + border-bottom-width: 0; + } +} +@media only screen and (max-width: 480px) { + .hidden-480 { + display: none !important; + } +} +@media only screen and (max-width: 320px) { + .hidden-320 { + display: none !important; + } +} +.no-skin { + /** + .nav-list > li.disabled.active:after { + border-color: #999; + } + .nav-list li.disabled li.active > a:after, + .nav-list li.active.disabled > a:after { + -moz-border-right-colors: #999 !important; + border-right-color: #999 !important; + } + */ +} +.no-skin .navbar .navbar-toggle { + background-color: #75B3D7; +} +.no-skin .navbar .navbar-toggle:focus { + background-color: #75B3D7; + border-color: transparent; +} +.no-skin .navbar .navbar-toggle:hover { + background-color: #61a8d1; + border-color: rgba(255, 255, 255, 0.1); +} +.no-skin .navbar .navbar-toggle.display, +.no-skin .navbar .navbar-toggle[data-toggle=collapse]:not(.collapsed) { + background-color: #4d9dcc; + box-shadow: inset 1px 1px 2px 0 rgba(0, 0, 0, 0.25); + border-color: rgba(255, 255, 255, 0.35); +} +.no-skin .sidebar { + background-color: #f2f2f2; + border-style: solid; + border-color: #cccccc; + border-width: 0 1px 0 0; +} +.no-skin .nav-list .open > a, +.no-skin .nav-list .open > a:hover, +.no-skin .nav-list .open > a:focus { + background-color: #fafafa; +} +.no-skin .nav-list > li { + border-color: #e5e5e5; +} +.no-skin .nav-list > li > a { + background-color: #f8f8f8; + color: #585858; +} +.no-skin .nav-list > li > a:focus { + background-color: #f8f8f8; + color: #1963aa; +} +.no-skin .nav-list > li:hover > a { + background-color: #ffffff; + color: #266cad; +} +.no-skin .nav-list > li.open > a { + background-color: #fafafa; + color: #1963aa; +} +.no-skin .nav-list > li.active > a { + font-weight: bold; + color: #2b7dbc; +} +.no-skin .nav-list > li.active > a, +.no-skin .nav-list > li.active > a:hover, +.no-skin .nav-list > li.active > a:focus { + background-color: #ffffff; +} +.no-skin .nav-list > li .submenu { + background-color: #ffffff; + border-color: #e5e5e5; +} +.no-skin .nav-list > li .submenu > li > a { + border-top-color: #e4e4e4; + background-color: #ffffff; + color: #616161; +} +.no-skin .nav-list > li .submenu > li > a:hover { + color: #4b88b7; + background-color: #f1f5f9; +} +.no-skin .nav-list > li .submenu > li.active > a { + color: #2b7dbc; +} +.no-skin .nav-list > li .submenu > li.active > a > .menu-icon { + color: #c86139; +} +.no-skin .nav-list > li .submenu > li.active.open > a > .menu-icon { + color: inherit; +} +@media only screen and (min-width: 992px) { + .no-skin .nav-list > li .submenu > li.active.hover > a.dropdown-toggle > .menu-icon { + color: inherit; + } +} +.no-skin .nav-list > li .submenu > li.active:not(.open) > a { + background-color: #f5f7fa; +} +.no-skin .nav-list > li .submenu > li.active:not(.open) > a:hover { + background-color: #f1f5f9; +} +.no-skin .nav-list > li > .submenu .open > a, +.no-skin .nav-list > li > .submenu .open > a:hover, +.no-skin .nav-list > li > .submenu .open > a:focus { + border-color: #e4e4e4; +} +.no-skin .nav-list > li > .submenu li > .submenu > li a { + color: #757575; +} +.no-skin .nav-list > li > .submenu li > .submenu > li a:hover { + color: #4b88b7; + background-color: #f1f5f9; +} +.no-skin .nav-list > li > .submenu li.open > a { + color: #4b88b7; +} +.no-skin .nav-list > li > .submenu li > .submenu li.open > a, +.no-skin .nav-list > li > .submenu li > .submenu li.active > a { + color: #4b88b7; +} +.no-skin .nav-list > li > .submenu:before, +.no-skin .nav-list > li > .submenu > li:before { + border-color: #9dbdd6; +} +.no-skin .nav-list > li.active > .submenu:before, +.no-skin .nav-list > li.active > .submenu > li:before { + border-color: #8eb3d0; +} +.no-skin .sidebar-toggle { + background-color: #f3f3f3; + border-color: #e0e0e0; +} +.no-skin .sidebar-toggle > .ace-icon { + border-color: #bbbbbb; + color: #aaaaaa; + background-color: #ffffff; +} +.no-skin .sidebar-shortcuts { + background-color: #fafafa; +} +.no-skin .sidebar-fixed .sidebar-shortcuts { + border-color: #dddddd; +} +.no-skin .sidebar-shortcuts-mini { + background-color: #ffffff; +} +.no-skin .nav-list li > .arrow:before { + border-right-color: #B8B8B8; + -moz-border-right-colors: #B8B8B8; + border-width: 10px 10px 10px 0; + left: -11px; +} +.no-skin .nav-list li > .arrow:after { + border-right-color: #ffffff; + -moz-border-right-colors: #ffffff; + border-width: 10px 10px 10px 0; + left: -10px; +} +.no-skin .nav-list > li.pull_up > .arrow:after { + border-right-color: #ffffff !important; + -moz-border-right-colors: #ffffff !important; + border-width: 10px 10px 10px 0 !important; + left: -10px !important; +} +.no-skin .nav-list > li.pull_up > .arrow:before { + border-width: 10px 10px 10px 0 !important; + left: -11px !important; +} +.no-skin .nav-list li.active > a:after { + border-right-color: #2b7dbc; + -moz-border-right-colors: #2b7dbc; +} +.no-skin .nav-list > li.active:after { + display: block; + content: ""; + position: absolute; + right: -2px; + top: -1px; + bottom: 0; + z-index: 1; + border: 2px solid; + border-width: 0 2px 0 0; + border-color: #2b7dbc; +} +.no-skin .sidebar-scroll .nav-list > li.active:after { + right: 0; +} +@media only screen and (max-width: 991px) { + .no-skin .sidebar.responsive .nav-list > li.active.open > a:after, + .no-skin .sidebar.responsive-max .nav-list > li.active.open > a:after { + display: block; + } + .no-skin .sidebar.responsive .nav-list li li.active > a:after, + .no-skin .sidebar.responsive-max .nav-list li li.active > a:after { + display: none; + } + .no-skin .sidebar.responsive .nav-list > li.active:after, + .no-skin .sidebar.responsive-max .nav-list > li.active:after { + height: 41px; + } +} +.no-skin .sidebar.menu-min .nav-list > li > a > .menu-text { + background-color: #f5f5f5; + -webkit-box-shadow: 2px 1px 2px 0 rgba(0,0,0,0.1); + box-shadow: 2px 1px 2px 0 rgba(0,0,0,0.1); + border-color: #cccccc; +} +.no-skin .sidebar.menu-min .nav-list > li > a.dropdown-toggle > .menu-text { + -webkit-box-shadow: 2px 2px 2px 0 rgba(0,0,0,0.1); + box-shadow: 2px 2px 2px 0 rgba(0,0,0,0.1); +} +.no-skin .sidebar.menu-min .nav-list > li.active > .submenu { + border-left-color: #83b6d1; +} +.no-skin .sidebar.menu-min .nav-list > li > .submenu { + background-color: #ffffff; + border: 1px solid #cccccc; + border-top-color: #e6e6e6; + -webkit-box-shadow: 2px 2px 2px 0 rgba(0,0,0,0.1); + box-shadow: 2px 2px 2px 0 rgba(0,0,0,0.1); +} +.no-skin .sidebar.menu-min .nav-list > li > .arrow:after { + border-right-color: #f5f5f5; + -moz-border-right-colors: #f5f5f5; + border-width: 8px 8px 8px 0; + left: -8px; +} +.no-skin .sidebar.menu-min .nav-list > li > .arrow:before { + border-width: 8px 8px 8px 0; + left: -9px; +} +.no-skin .sidebar.menu-min .nav-list > li.active > .arrow:before { + border-right-color: #5a9ec2; + -moz-border-right-colors: #5a9ec2; +} +.no-skin .sidebar.menu-min .nav-list > li.active > a > .menu-text { + border-left-color: #83b6d1; +} +.no-skin .sidebar.menu-min .sidebar-shortcuts-large { + background-color: #ffffff; + -webkit-box-shadow: 2px 1px 2px 0 rgba(0,0,0,0.1); + box-shadow: 2px 1px 2px 0 rgba(0,0,0,0.1); + border-color: #cccccc; +} +.no-skin .sidebar.menu-min .sidebar-toggle > .ace-icon { + border-color: #b1b1b1; +} +@media (max-width: 991px) { + .no-skin .sidebar.responsive-min .nav-list > li > a > .menu-text { + background-color: #f5f5f5; + -webkit-box-shadow: 2px 1px 2px 0 rgba(0,0,0,0.1); + box-shadow: 2px 1px 2px 0 rgba(0,0,0,0.1); + border-color: #cccccc; + } + .no-skin .sidebar.responsive-min .nav-list > li > a.dropdown-toggle > .menu-text { + -webkit-box-shadow: 2px 2px 2px 0 rgba(0,0,0,0.1); + box-shadow: 2px 2px 2px 0 rgba(0,0,0,0.1); + } + .no-skin .sidebar.responsive-min .nav-list > li.active > .submenu { + border-left-color: #83b6d1; + } + .no-skin .sidebar.responsive-min .nav-list > li > .submenu { + background-color: #ffffff; + border: 1px solid #cccccc; + border-top-color: #e6e6e6; + -webkit-box-shadow: 2px 2px 2px 0 rgba(0,0,0,0.1); + box-shadow: 2px 2px 2px 0 rgba(0,0,0,0.1); + } + .no-skin .sidebar.responsive-min .nav-list > li > .arrow:after { + border-right-color: #f5f5f5; + -moz-border-right-colors: #f5f5f5; + border-width: 8px 8px 8px 0; + left: -8px; + } + .no-skin .sidebar.responsive-min .nav-list > li > .arrow:before { + border-width: 8px 8px 8px 0; + left: -9px; + } + .no-skin .sidebar.responsive-min .nav-list > li.active > .arrow:before { + border-right-color: #5a9ec2; + -moz-border-right-colors: #5a9ec2; + } + .no-skin .sidebar.responsive-min .nav-list > li.active > a > .menu-text { + border-left-color: #83b6d1; + } + .no-skin .sidebar.responsive-min .sidebar-shortcuts-large { + background-color: #ffffff; + -webkit-box-shadow: 2px 1px 2px 0 rgba(0,0,0,0.1); + box-shadow: 2px 1px 2px 0 rgba(0,0,0,0.1); + border-color: #cccccc; + } + .no-skin .sidebar.responsive-min .sidebar-toggle > .ace-icon { + border-color: #b1b1b1; + } +} +@media only screen and (min-width: 992px) { + .no-skin .nav-list li.hover > .submenu { + -webkit-box-shadow: 2px 1px 2px 0 rgba(0,0,0,0.1); + box-shadow: 2px 1px 2px 0 rgba(0,0,0,0.1); + border-color: #cccccc; + } + .no-skin .nav-list li.hover > .submenu > li.active > a { + background-color: #f5f5f5; + } + .no-skin .nav-list li.hover > .submenu > li:hover > a { + background-color: #eef3f7; + color: #2e7db4; + } +} +@media only screen and (min-width: 992px) and (max-width: 991px) { + .no-skin .sidebar.navbar-collapse .nav-list li li.hover.active.open > a { + background-color: #ffffff; + } + .no-skin .sidebar.navbar-collapse .nav-list li li.hover:hover > a { + background-color: #ffffff; + } + .no-skin .sidebar.navbar-collapse .nav-list li li.hover > a:hover, + .no-skin .sidebar.navbar-collapse .nav-list li li.hover.open > a:hover, + .no-skin .sidebar.navbar-collapse .nav-list li li.hover.open.active > a:hover { + background-color: #f1f5f9; + } + .no-skin .sidebar.navbar-collapse .nav-list > li .submenu > li.active.hover > a.dropdown-toggle > .menu-icon { + color: #c86139; + } + .no-skin .sidebar.navbar-collapse .nav-list > li .submenu > li.active.open.hover > a.dropdown-toggle > .menu-icon { + color: inherit; + } +} +@media only screen and (min-width: 992px) { + .no-skin .sidebar.navbar-collapse .nav-list > li.open.hover:not(:hover):not(:focus):not(.active) > a { + color: #585858; + } + .no-skin .sidebar.navbar-collapse .nav-list > li.open.hover:not(:hover):not(:focus):not(.active) > a > .arrow { + color: inherit; + } + .no-skin .sidebar.navbar-collapse .nav-list > li.open.hover:hover > a { + background-color: #ffffff; + } + .no-skin .sidebar.navbar-collapse .nav-list > li > .submenu li.open.hover:not(:hover):not(:focus):not(.active) > a { + color: #616161; + } + .no-skin .sidebar.navbar-collapse .nav-list > li > .submenu li.open.hover:not(:hover):not(:focus):not(.active) > a > .arrow { + color: inherit; + } +} +@media only screen and (min-width: 992px) and (max-width: 991px) { + .no-skin .sidebar.navbar-collapse .nav-list li.hover > .submenu { + border-top-color: #e5e5e5; + background-color: #ffffff; + } + .no-skin .nav-list li.hover > .submenu > li.active:not(.open) > a { + background-color: #f5f7fa; + } + .no-skin .nav-list li.hover > .submenu > li.active:not(.open) > a:hover { + background-color: #f1f5f9; + } +} +@media only screen and (min-width: 992px) { + .no-skin .sidebar.h-sidebar { + background-color: #f8f8f8; + } + .no-skin .sidebar.h-sidebar:before { + background-color: #e4e4e4; + -webkit-box-shadow: 0 -1px 1px 0 rgba(0, 0, 0, 0.05) inset; + box-shadow: 0 -1px 1px 0 rgba(0, 0, 0, 0.05) inset; + } + .no-skin .sidebar.h-sidebar .nav-list > li:hover, + .no-skin .sidebar.h-sidebar .nav-list > li:hover + li { + border-left-color: #cedde5; + } + .no-skin .sidebar.h-sidebar .nav-list > li:last-child:hover { + border-right-color: #cedde5; + } + .no-skin .sidebar.h-sidebar .nav-list > li.active, + .no-skin .sidebar.h-sidebar .nav-list > li.active + li, + .no-skin .sidebar.h-sidebar .nav-list > li:hover + li.active { + border-left-color: #79b0ce; + } + .no-skin .sidebar.h-sidebar .nav-list > li.active:last-child { + border-right-color: #79b0ce; + } + .no-skin .sidebar.h-sidebar .nav-list > li.active:before { + background-color: #2b7dbc; + } + .no-skin .sidebar.h-sidebar .nav-list > li.active > a:after { + border-width: 0 0 2px 0; + border-color: transparent; + border-bottom-color: #FFF; + left: 0; + right: 0; + top: auto; + bottom: -2px; + } + .no-skin .sidebar.h-sidebar .sidebar-shortcuts-large { + background-color: #FFF; + border-color: #cccccc; + -webkit-box-shadow: 2px 1px 2px 0 rgba(0,0,0,0.1); + box-shadow: 2px 1px 2px 0 rgba(0,0,0,0.1); + } + .no-skin .sidebar.h-sidebar .sidebar-shortcuts-large:after { + border-bottom-color: #FFF; + -moz-border-bottom-colors: #FFF; + } + .no-skin .sidebar.h-sidebar .nav-list > li.hover > .submenu { + border-color: #cccccc; + } + .no-skin .sidebar.h-sidebar.menu-min .nav-list > li.hover > .submenu { + border-top-color: #e6e6e6; + } + .no-skin .sidebar.h-sidebar .nav-list > li.hover > .arrow:after { + border-color: transparent; + -moz-border-right-colors: none; + -moz-border-top-colors: none; + -moz-border-left-colors: none; + border-bottom-color: #FFF; + -moz-border-bottom-colors: #FFF; + } + .no-skin .sidebar.h-sidebar .nav-list > li.hover > .arrow:before { + border-color: transparent; + -moz-border-right-colors: none; + -moz-border-top-colors: none; + -moz-border-left-colors: none; + -moz-border-bottom-colors: #B8B8B8; + border-bottom-color: #B8B8B8; + } + .no-skin .sidebar.h-sidebar.menu-min .nav-list > li.hover > .arrow:after { + -moz-border-bottom-colors: #F5F5F5; + border-bottom-color: #F5F5F5; + } + .no-skin .sidebar.h-sidebar.menu-min .nav-list > li.active > a > .menu-text { + border-left-color: #cccccc; + } +} +@media only screen and (max-width: 991px) { + .no-skin .sidebar { + border-width: 0 1px 1px 0; + border-top-color: #d6d6d6; + } + .no-skin .menu-toggler + .sidebar.responsive { + border-top-width: 1px; + } + .no-skin .sidebar.responsive-min { + border-width: 0 1px 0 0; + } + .no-skin .sidebar.navbar-collapse { + border-width: 0; + border-bottom-width: 1px !important; + border-bottom-color: #cccccc; + -webkit-box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1) !important; + box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1) !important; + } + .no-skin .sidebar.navbar-collapse.menu-min .nav-list > li > .submenu { + background-color: #ffffff; + } +} +.no-skin .sidebar-scroll .sidebar-shortcuts { + border-bottom-color: #dddddd; +} +.no-skin .sidebar-scroll .sidebar-toggle { + border-top-color: #dddddd; +} +.no-skin .main-container .menu-toggler { + background-color: #444444; +} +.no-skin .main-container .menu-toggler:before { + border-top-color: #87b87f; + border-bottom-color: #6fb3e0; +} +.no-skin .main-container .menu-toggler:after { + border-top-color: #ffa24d; + border-bottom-color: #d15b47; +} +.no-skin .main-container .menu-toggler > .toggler-text { + border-top-color: #444444; + -moz-border-top-colors: #444444; +} +.no-skin .nav-list > li.disabled:before { + display: none !important; +} +.no-skin .nav-list > li.disabled > a { + background-color: #ebebeb !important; + color: #656565 !important; +} +.no-skin .nav-list li .submenu > li.disabled > a, +.no-skin .nav-list li.disabled .submenu > li > a { + background-color: #f2f2f2 !important; + color: #7a7a7a !important; + cursor: not-allowed !important; +} +.no-skin .nav-list li .submenu > li.disabled > a > .menu-icon, +.no-skin .nav-list li.disabled .submenu > li > a > .menu-icon { + display: none; +} +.nav-list li.highlight li.active > a:after, +.nav-list li li.highlight.active > a:after, +.nav-list li.highlight li.active > a:before, +.nav-list li li.highlight.active > a:before { + display: none; +} +.nav-list > li.highlight.active > a:after, +.nav-list > li.highlight.active > a:before { + display: block; +} +.no-skin .nav-list > li.highlight:hover, +.no-skin .nav-list > li.highlight.active { + border-color: #c8d8e2; +} +.no-skin .nav-list > li.highlight:hover + li, +.no-skin .nav-list > li.highlight.active + li { + border-top-color: #c8d8e2; +} +.no-skin .nav-list > li.highlight:hover > a, +.no-skin .nav-list > li.highlight.active > a { + background-color: #FFF; +} +.no-skin .nav-list > li.highlight.active:after { + display: none; +} +.no-skin .nav-list > li.highlight.active:before { + display: block; + background-color: #4f90c2; +} +.no-skin .nav-list > li.highlight.active > a { + background-color: #f2f6f9 !important; +} +.no-skin .nav-list > li.highlight.active > a:before, +.no-skin .nav-list > li.highlight.active > a:after { + display: block; + content: ""; + position: absolute; + top: -1px; + right: -10px; + bottom: auto; + z-index: 1; + border-style: solid; + border-width: 20px 0 21px 10px; + border-color: transparent; +} +.no-skin .nav-list > li.highlight.active > a:before { + border-left-color: #a0bccd; + -moz-border-left-colors: #a0bccd; + right: -11px; +} +.no-skin .nav-list > li.highlight.active > a:after { + border-left-color: #f2f6f9; + -moz-border-left-colors: #f2f6f9; +} +.no-skin .nav-list li li.highlight.active > a { + background-color: #f2f6f9; +} +.no-skin .nav-list li li.highlight.active.open > a { + background-color: #FFF; +} +.no-skin .nav-list li li.highlight.active.open > a:hover { + background-color: #f1f5f9; +} +@media (min-width: 992px) { + .no-skin .sidebar.h-sidebar .nav-list > li.highlight.active > a:after { + display: block; + content: ""; + position: absolute; + left: 0; + top: auto; + right: auto; + bottom: -2px; + left: 50%; + margin-left: -7px; + border-color: transparent; + -moz-border-right-colors: none; + -moz-border-left-colors: none; + -moz-border-top-colors: none; + border-width: 8px 7px; + border-bottom-color: #FFF; + -moz-border-bottom-colors: #FFF; + } + .no-skin .sidebar.h-sidebar .nav-list > li.highlight.active > a:before { + content: ""; + position: absolute; + display: block; + left: 0; + top: auto; + right: auto; + bottom: -1px; + left: 50%; + margin-left: -7px; + border-width: 8px; + border-color: transparent; + -moz-border-right-colors: none; + -moz-border-left-colors: none; + -moz-border-top-colors: none; + border-bottom-color: #74add7; + -moz-border-bottom-colors: #74add7; + } + .no-skin .sidebar.h-sidebar .nav-list > li.highlight.active:hover > a:after, + .no-skin .sidebar.h-sidebar .nav-list > li.highlight.active.hover-show > a:after, + .no-skin .sidebar.h-sidebar .nav-list > li.highlight.active:hover > a:before, + .no-skin .sidebar.h-sidebar .nav-list > li.highlight.active.hover-show > a:before { + display: none; + } +} +@media (min-width: 992px) { + .sidebar.compact .nav-list li.highlight.active > a:after, + .sidebar.compact .nav-list li.highlight.active > a:before { + display: none; + } + .sidebar.compact.menu-min .nav-list li.highlight.active > a:after, + .sidebar.compact.menu-min .nav-list li.highlight.active > a:before { + display: block; + } +} +@media (min-width: 992px) { + .sidebar.h-sidebar .nav-list li.highlight.active > a:after, + .sidebar.h-sidebar .nav-list li.highlight.active > a:before { + display: block; + border-width: 8px !important; + -moz-border-left-colors: none !important; + -moz-border-right-colors: none !important; + border-left-color: transparent !important; + border-right-color: transparent !important; + } + .sidebar.h-sidebar .nav-list > li.highlight.active:hover > a:after, + .sidebar.h-sidebar .nav-list > li.highlight.active:hover > a:before { + display: none !important; + } +} +.sidebar-scroll .nav-list > li.active.highlight > a:after, +.sidebar-scroll .nav-list > li.active.highlight > a:before { + display: none !important; +} +.onpage-help-backdrop { + position: absolute; + z-index: 99990; + top: 0; + bottom: 0; + left: 0; + right: 0; + background-color: #000; + filter: alpha(opacity=5); + background-color: rgba(0, 0, 0, 0.05); +} +.onpage-help-section { + display: block; + position: absolute; + z-index: 100000; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#4DFFFFFF', endColorstr='#4DFFFFFF', GradientType=0); + background-color: rgba(255, 255, 255, 0.3); + border: 1px dashed #8BBCD3; + border-radius: 4px; + transition: background-color 0.2s, border-color 0.2s; + -webkit-transition: background-color 0.2s, border-color 0.2s; + text-align: center; + vertical-align: middle; + outline: none !important; +} +.onpage-help-section > .ie-hover-fix { + /* ie8-9 fix*/ + display: block; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + background-color: #FFF; + filter: alpha(opacity=1); +} +.onpage-help-section:focus, +.onpage-help-section:active { + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#33C9D8EA', endColorstr='#33C9D8EA', GradientType=0); + background-color: rgba(201, 216, 234, 0.2); + border-color: #77ACC4; +} +.onpage-help-section:hover { + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#66C9D8EA', endColorstr='#66C9D8EA', GradientType=0); + background-color: rgba(201, 216, 234, 0.4); + border-color: #77ACC4; + border-style: solid; +} +.onpage-help-section > .help-icon-1 { + font-size: 18px; + display: inline-block; + position: absolute; + z-index: 1; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + -webkit-transform: translate(-50%, -50%); + opacity: 0; + filter: alpha(opacity=0); + color: #FFF; + text-shadow: 0 0 2px black; + background-color: #85B8DB; + border: 2px solid #FFF; + border-radius: 100%; + box-shadow: 0 0 2px 1px rgba(0, 0, 0, 0.4); + width: 48px; + height: 48px; + line-height: 46px; + transition: opacity 0.2s; + -webkit-transition: opacity 0.2s; +} +.onpage-help-section:focus > .help-icon-1, +.onpage-help-section:active > .help-icon-1 { + opacity: 0.5; +} +.onpage-help-section:hover > .help-icon-1 { + opacity: 1; + filter: alpha(opacity=100); +} +.onpage-help-section.help-section-small > .help-icon-1 { + font-size: 18px; + width: 28px; + height: 28px; + line-height: 26px; + border-radius: 12px; +} +.onpage-help-section.help-section-smaller > .help-icon-1 { + font-size: 14px; + width: 20px; + height: 20px; + line-height: 17px; + border-radius: 8px; +} +.onpage-help-section > .help-icon-2 { + position: absolute; + z-index: 2; + left: -4px; + top: -4px; + width: 18px; + height: 18px; + line-height: 16px; + display: block; + font-size: 16px; + color: orange; + background-color: #FFF; + border: 1px solid orange; + border-radius: 4px; + opacity: 1; + transition: all 0.2s; + -webkit-transition: all 0.2s; +} +.onpage-help-section:hover > .help-icon-2 { + color: #59A34E; + border-color: #59A34E; + transform: scale(1.25); + -webkit-transform: scale(1.25); +} +.onpage-help-modal { + z-index: 100010; +} +.onpage-help-modal + .modal-backdrop { + z-index: 100009; +} +.onpage-help-modal-buttons button { + border-radius: 100%; + border-width: 2px !important; +} +.onpage-help-modal-buttons button:focus { + outline: none !important; +} +.onpage-help-modal-buttons button.disabled { + transform: scale(0.9); + -webkit-transform: scale(0.9); +} +.onpage-help-content { + max-width: 800px; + margin: 0 auto; +} +.code-modal.onpage-help-modal .modal-dialog { + margin-top: 6px; + margin-bottom: 6px; +} +.code-modal.onpage-help-modal .modal-header { + padding-top: 6px; + padding-bottom: 6px; +} +.code-modal.onpage-help-modal .modal-body { + padding: 10px 12px; +} +.onpage-help-modal pre { + border-width: 0; + box-shadow: none; + border-radius: 0; + margin-top: 8px; +} +.onpage-help-modal .modal-title code { + font-size: 13px; +} +.onpage-help-modal .modal-body { + font-size: 14px; +} +@media print { + .navbar { + display: none !important; + /** + background: transparent none !important; + border-bottom: 1px solid #DDD; + + .navbar-brand { + color: @text-color !important; + } + + .ace-nav { + display: none !important; + } + */ + } + .sidebar { + display: none !important; + } + .main-content { + margin-left: 0 !important; + margin-right: 0 !important; + } + .main-content .nav-search { + display: none !important; + } + .main-content .breadcrumbs { + float: right; + border-width: 0 !important; + } + .main-content .breadcrumbs .breadcrumb > li + li:before { + content: "/"; + } + .main-content .breadcrumbs .breadcrumb .home-icon { + display: none; + } + .ace-settings-container { + display: none !important; + } + .footer { + width: 100%; + height: auto; + position: relative; + } + .footer .footer-inner, + .footer .footer-inner .footer-content { + width: 100%; + } + .btn-scroll-up { + display: none !important; + } + .btn, + .btn.btn-app { + background: transparent none !important; + border-width: 1px !important; + border-radius: 0 !important; + color: #555 !important; + } + .label { + border: 1px solid #666 !important; + } + .label[class*=arrowed]:before, + .label[class*=arrowed]:after { + display: none !important; + } +} diff --git a/food-open/food-open-web/src/main/resources/static/assets/css/ace-skins.css b/food-open/food-open-web/src/main/resources/static/assets/css/ace-skins.css new file mode 100644 index 0000000..2ad0e8a --- /dev/null +++ b/food-open/food-open-web/src/main/resources/static/assets/css/ace-skins.css @@ -0,0 +1,3107 @@ +/* skin 1 */ +.skin-1 { + background-color: #4a4f56; +} +.skin-1 .navbar { + background: #2c6aa0; +} +.skin-1 .sidebar { + background-color: #222a2d; + border-right-width: 0; +} +.skin-1 .nav-list > li { + border-color: #3f4e54; +} +.skin-1 .nav-list > li > a { + background-color: #222a2d; + color: #bac2c8; +} +.skin-1 .nav-list > li:hover > a { + background-color: #414b51; + color: #e1eaf1; +} +.skin-1 .nav-list > li.open > a, +.skin-1 .nav-list > li.open:hover > a { + color: #85c0ec; + background-color: #222a2d; +} +.skin-1 .nav-list > li.active > a, +.skin-1 .nav-list > li.active:hover > a { + background-color: #141a1b; + color: #7bb7e5; +} +.skin-1 .nav-list > li:hover:before { + background-color: #629cc9; +} +.skin-1 .nav-list > li.active:before { + display: block; + background-color: #4d96c6; +} +.skin-1 .nav-list li.active > a:after { + border-right-color: #FFF; + -moz-border-right-colors: #FFF; + border-width: 11px 7px; + top: 8px; + right: 0; +} +.skin-1 .nav-list > li.active > .submenu li.active > a:after { + top: 5px; +} +.skin-1 .nav-list > li .submenu { + background-color: #333d3f; +} +.skin-1 .nav-list > li.active .submenu { + background-color: #181e20; +} +.skin-1 .nav-list > li .submenu > li > a { + border-top-style: solid; + border-top-color: #454d4e; + background-color: #333d3f; +} +.skin-1 .nav-list > li .submenu > li > a:hover { + background-color: #2d3638; +} +.skin-1 .nav-list > li.active .submenu > li > a { + border-top-color: #222526; + background-color: #181e20; +} +.skin-1 .nav-list > li.active .submenu > li > a:hover { + background-color: #14191a; +} +.skin-1 .nav-list > li > .submenu { + border-top-color: #505a5b; +} +.skin-1 .nav-list > li.active > .submenu { + border-top-color: #2f3e44; +} +.skin-1 .nav-list > li > .submenu > li > a { + color: #d9dfe6; +} +.skin-1 .nav-list > li > .submenu > li:hover > a { + color: #8ab4de; +} +.skin-1 .nav-list > li > .submenu > li.active > a { + color: #7bb7e5; + background-color: #161b1d; +} +.skin-1 .nav-list > li > .submenu:before, +.skin-1 .nav-list > li > .submenu > li:before { + border-color: #646c70; +} +.skin-1 .nav-list > li.active > .submenu:before, +.skin-1 .nav-list > li.active > .submenu > li:before { + border-color: #3f4e54; +} +.skin-1 .nav-list > li .submenu li > .submenu li > a { + color: #d9dfe6; +} +.skin-1 .nav-list > li .submenu li > .submenu li:hover > a { + color: #8ab4de; +} +.skin-1 .nav-list > li .submenu li.open > a, +.skin-1 .nav-list > li .submenu li > .submenu > li.open > a { + color: #85c0ec; +} +.skin-1 .nav-list > li .submenu li > .submenu li.active > a { + color: #61a8dd; +} +.skin-1 .nav-list > li .submenu li > .submenu li.active:hover > a { + color: #85c0ec; +} +.skin-1 .sidebar .nav-list > li.active.highlight, +.skin-1 .sidebar .nav-list > li.active.highlight + li { + border-color: #506b7f; +} +.skin-1 .sidebar .nav-list > li.active.highlight + li:last-child { + border-bottom-color: #3f4e54; +} +.skin-1 .sidebar .nav-list > li.active.highlight > a:after { + border-right-color: transparent; + -moz-border-right-colors: none; + border-left-color: #141a1b; + -moz-border-left-colors: #141a1b; + border-width: 20px 0 20px 10px; + z-index: 1; + top: 0; + right: -10px; +} +.skin-1 .sidebar .nav-list > li.active.highlight > a:before { + border-left-color: #506b7f; + -moz-border-left-colors: #506b7f; + border-style: solid; + border-color: transparent; + border-width: 20px 0 20px 10px; + content: ""; + position: absolute; + right: -11px; + top: 0; + z-index: 1; +} +.skin-1 .sidebar-shortcuts, +.skin-1 .sidebar-shortcuts-mini { + background-color: #222a2d; + border-color: #3f4e54; +} +.skin-1 .sidebar > .nav-search { + background-color: #222a2d; + border-color: #3f4e54; +} +.skin-1 .sidebar-toggle { + background-color: #181e21; + border-color: #3f4e54; +} +.skin-1 .sidebar-toggle > .ace-icon { + background-color: #222a2d; + color: #aaaaaa; + border-color: #aaaaaa; +} +.skin-1 .breadcrumbs { + border-width: 0; + background-color: #f0f0f0; +} +@media (min-width: 992px) { + .skin-1 .breadcrumbs.breadcrumbs-fixed { + border-bottom-width: 1px; + } +} +@media only screen and (max-width: 991px) { + .skin-1 .sidebar.responsive { + border-width: 0; + -webkit-box-shadow: none; + box-shadow: none; + } + .skin-1 .sidebar.responsive .nav-list li.active > a:after { + display: none; + } + .skin-1 .sidebar.responsive .nav-list > li.active.highlight > a:after { + display: block; + } +} +.skin-1 .sidebar.menu-min .nav-list > li.open > a { + background-color: #222a2d; + color: #bac2c8; +} +.skin-1 .sidebar.menu-min .nav-list > li.active > a:after { + border-width: 9px 6px; + top: 10px; +} +.skin-1 .sidebar.menu-min .nav-list > li.active.highlight > a:after { + border-width: 20px 0 20px 10px; + top: 0; +} +.skin-1 .sidebar.menu-min .nav-list > li.active:hover > a:after { + border-right-color: #242a2b; +} +.skin-1 .sidebar.menu-min .nav-list > li.active > a, +.skin-1 .sidebar.menu-min .nav-list > li.active > a:hover { + background-color: #141a1b; + color: #7bb7e5; +} +.skin-1 .sidebar.menu-min .nav-list > li:hover > a { + color: #e1eaf1; +} +.skin-1 .sidebar.menu-min .nav-list > li > a > .menu-text { + background-color: #414b51; +} +.skin-1 .sidebar.menu-min .nav-list > li.active > a > .menu-text { + background-color: #242a2b; + border: 0px solid #3b4547; + border-width: 1px 1px 0; + border-left-color: #305675; +} +.skin-1 .sidebar.menu-min .nav-list > li.active > a:not(.dropdown-toggle) > .menu-text { + border-width: 1px; + border-top-color: #4a5c63; + border-bottom-color: #4a5c63; + border-right-color: #4a5c63; +} +.skin-1 .sidebar.menu-min .nav-list > li.active:hover > a, +.skin-1 .sidebar.menu-min .nav-list > li.active > a > .menu-text { + color: #7bb7e5; +} +.skin-1 .sidebar.menu-min .nav-list > li.open.active > a { + background-color: #141a1b; +} +.skin-1 .sidebar.menu-min .nav-list > li > a > .menu-text, +.skin-1 .sidebar.menu-min .nav-list > li > .submenu { + border-width: 0; + border-left: 1px solid #181d1f; + -webkit-box-shadow: none; + box-shadow: none; +} +.skin-1 .sidebar.menu-min .nav-list > li > .submenu { + border-top: 1px solid #3f4e54; +} +.skin-1 .sidebar.menu-min .nav-list > li > .submenu:after { + display: none; +} +.skin-1 .sidebar.menu-min .nav-list > li > .submenu { + background-color: #333d3f; + border-top-color: #5a606a; + border-top-width: 1px !important; +} +.skin-1 .sidebar.menu-min .nav-list > li.active > .submenu { + background-color: #181e20; + border-top-color: #3b4547; + border-left-color: #305675; +} +.skin-1 .sidebar.menu-min .nav-list > li > .arrow:after { + border-right-color: #414b51; + -moz-border-right-colors: #414b51; +} +.skin-1 .sidebar.menu-min .nav-list > li > .arrow:before { + border-right-color: #111415; + -moz-border-right-colors: #242a2b; +} +.skin-1 .sidebar.menu-min .nav-list > li.active > .arrow:after { + border-right-color: #242a2b; + -moz-border-right-colors: #242a2b; +} +.skin-1 .sidebar.menu-min .nav-list > li.active > .arrow:before { + border-right-color: #50a0dd; + -moz-border-right-colors: #50a0dd; +} +.skin-1 .sidebar.menu-min .sidebar-shortcuts-large { + background-color: #222a2d; + -webkit-box-shadow: none; + box-shadow: none; + border: 1px solid #4a5c63; + border-width: 0 1px 1px 0; + top: 0; +} +@media (max-width: 991px) { + .skin-1 .sidebar.responsive-min .nav-list > li.open > a { + background-color: #222a2d; + color: #bac2c8; + } + .skin-1 .sidebar.responsive-min .nav-list > li.active > a:after { + border-width: 9px 6px; + top: 10px; + } + .skin-1 .sidebar.responsive-min .nav-list > li.active.highlight > a:after { + border-width: 20px 0 20px 10px; + top: 0; + } + .skin-1 .sidebar.responsive-min .nav-list > li.active:hover > a:after { + border-right-color: #242a2b; + } + .skin-1 .sidebar.responsive-min .nav-list > li.active > a, + .skin-1 .sidebar.responsive-min .nav-list > li.active > a:hover { + background-color: #141a1b; + color: #7bb7e5; + } + .skin-1 .sidebar.responsive-min .nav-list > li:hover > a { + color: #e1eaf1; + } + .skin-1 .sidebar.responsive-min .nav-list > li > a > .menu-text { + background-color: #414b51; + } + .skin-1 .sidebar.responsive-min .nav-list > li.active > a > .menu-text { + background-color: #242a2b; + border: 0px solid #3b4547; + border-width: 1px 1px 0; + border-left-color: #305675; + } + .skin-1 .sidebar.responsive-min .nav-list > li.active > a:not(.dropdown-toggle) > .menu-text { + border-width: 1px; + border-top-color: #4a5c63; + border-bottom-color: #4a5c63; + border-right-color: #4a5c63; + } + .skin-1 .sidebar.responsive-min .nav-list > li.active:hover > a, + .skin-1 .sidebar.responsive-min .nav-list > li.active > a > .menu-text { + color: #7bb7e5; + } + .skin-1 .sidebar.responsive-min .nav-list > li.open.active > a { + background-color: #141a1b; + } + .skin-1 .sidebar.responsive-min .nav-list > li > a > .menu-text, + .skin-1 .sidebar.responsive-min .nav-list > li > .submenu { + border-width: 0; + border-left: 1px solid #181d1f; + -webkit-box-shadow: none; + box-shadow: none; + } + .skin-1 .sidebar.responsive-min .nav-list > li > .submenu { + border-top: 1px solid #3f4e54; + } + .skin-1 .sidebar.responsive-min .nav-list > li > .submenu:after { + display: none; + } + .skin-1 .sidebar.responsive-min .nav-list > li > .submenu { + background-color: #333d3f; + border-top-color: #5a606a; + border-top-width: 1px !important; + } + .skin-1 .sidebar.responsive-min .nav-list > li.active > .submenu { + background-color: #181e20; + border-top-color: #3b4547; + border-left-color: #305675; + } + .skin-1 .sidebar.responsive-min .nav-list > li > .arrow:after { + border-right-color: #414b51; + -moz-border-right-colors: #414b51; + } + .skin-1 .sidebar.responsive-min .nav-list > li > .arrow:before { + border-right-color: #111415; + -moz-border-right-colors: #242a2b; + } + .skin-1 .sidebar.responsive-min .nav-list > li.active > .arrow:after { + border-right-color: #242a2b; + -moz-border-right-colors: #242a2b; + } + .skin-1 .sidebar.responsive-min .nav-list > li.active > .arrow:before { + border-right-color: #50a0dd; + -moz-border-right-colors: #50a0dd; + } + .skin-1 .sidebar.responsive-min .sidebar-shortcuts-large { + background-color: #222a2d; + -webkit-box-shadow: none; + box-shadow: none; + border: 1px solid #4a5c63; + border-width: 0 1px 1px 0; + top: 0; + } + .skin-1 .sidebar.responsive-min .nav-list > li.active > a:after { + display: block; + } + .skin-1 .sidebar.responsive-max .nav-list li.active > a:after { + display: none; + } + .skin-1 .sidebar.responsive-max .nav-list > li.highlight.active > a:after { + display: block; + } +} +@media only screen and (min-width: 992px) { + .skin-1 .nav-list li.hover > .submenu { + padding-left: 0; + padding-bottom: 2px; + padding-right: 0; + border-color: #232828; + } + .skin-1 .nav-list li.hover > .submenu > li > a { + border-top-width: 1px; + margin-bottom: 0; + margin-top: 0; + } + .skin-1 .nav-list li.hover > .submenu > li:first-child > a { + border-top-width: 0; + } + .skin-1 .nav-list > li > .submenu li.hover > .submenu { + padding: 3px 2px; + } + .skin-1 .nav-list > li.active > .submenu li.hover > .submenu { + border-left-color: #475561; + } + .skin-1 .nav-list li.hover.active > .submenu, + .skin-1 .nav-list li.active > .submenu li.hover.active > .submenu { + border-left-color: #305675; + } + .skin-1 .nav-list > li.active > .submenu li.hover > .submenu { + background-color: #171e1f; + } +} +@media only screen and (min-width: 992px) { + .skin-1 .sidebar.navbar-collapse .nav-list > li.open.hover:not(:hover):not(:focus):not(.active) > a { + color: #bac2c8; + } + .skin-1 .sidebar.navbar-collapse .nav-list > li.open.hover:hover > a { + color: #e1eaf1; + background-color: #414b51; + } + .skin-1 .sidebar.navbar-collapse .nav-list > li.active.hover:hover > a { + color: #7bb7e5; + background-color: #141a1b; + } + .skin-1 .sidebar.navbar-collapse .nav-list > li > .submenu li.open.hover:not(:hover):not(:focus):not(.active) > a { + color: #d9dfe6; + } +} +@media only screen and (min-width: 992px) and (max-width: 991px) { + .skin-1 .sidebar.navbar-collapse { + /**.nav-list li li:hover > a { + background-color: @submenu-item-background; + } + .nav-list li li > a:hover, + .nav-list li li.open > a:hover { + background-color: @submenu-item-hover-background; + } + + .nav-list > li.active li:hover > a { + background-color: @submenu-item-background-active; + } + .nav-list > li.active li > a:hover { + background-color: @submenu-item-background-active-hover; + }*/ + } + .skin-1 .sidebar.navbar-collapse .nav-list li.hover > .submenu { + padding-bottom: 0; + } + .skin-1 .sidebar.navbar-collapse .nav-list li.hover > .submenu { + border-top-color: #505a5b; + } + .skin-1 .sidebar.navbar-collapse .nav-list li.hover.active > .submenu { + border-top-color: #2f3e44; + } + .skin-1 .sidebar.navbar-collapse .nav-list li.hover.active > .submenu, + .skin-1 .sidebar.navbar-collapse .nav-list > li > .submenu li.hover > .submenu, + .skin-1 .sidebar.navbar-collapse .nav-list li.active > .submenu li.hover.active > .submenu { + border-left-width: 0; + } + .skin-1 .sidebar.navbar-collapse .nav-list > li > .submenu li.hover > .submenu { + padding: 0; + } + .skin-1 .sidebar.navbar-collapse .nav-list li li.hover > .submenu > li:first-child > a { + border-top-width: 1px; + } +} +.skin-1 .sidebar.navbar-collapse .nav-list > li .submenu > li.hover:hover > a { + background-color: #2d3638; +} +.skin-1 .sidebar.navbar-collapse .nav-list > li.active .submenu > li.hover:hover > a { + background-color: #14191a; +} +@media only screen and (min-width: 992px) { + .skin-1 .sidebar:not(.navbar-collapse) .nav-list > li .submenu > li.hover:hover > a { + background-color: #2d3638; + } + .skin-1 .sidebar:not(.navbar-collapse) .nav-list > li.active .submenu > li.hover:hover > a { + background-color: #14191a; + } +} +.skin-1 .nav-list li > .arrow:after { + border-right-color: #353c3d; + -moz-border-right-colors: #353c3d; +} +.skin-1 .nav-list li > .arrow:before { + border-right-color: #1d2122; + -moz-border-right-colors: #1d2122; +} +.skin-1 .nav-list > li.active > .arrow:after { + border-right-color: #171e1f; + -moz-border-right-colors: #171e1f; +} +.skin-1 .nav-list > li.active > .arrow:before { + border-right-color: #50a0dd; + -moz-border-right-colors: #50a0dd; +} +.skin-1 .nav-list > li.active > .submenu li.hover > .arrow:before { + border-right-color: #4f6e86; + -moz-border-right-colors: #8fb6d5; +} +.skin-1 .nav-list > li.active > .submenu li.hover.active > .arrow:before { + border-right-color: #305675; + -moz-border-right-colors: #2290e9; +} +.skin-1 .nav-list > li.active > .submenu li.hover > .arrow:after { + border-right-color: #171e1f; + -moz-border-right-colors: #171e1f; +} +.skin-1 .nav-list li.pull_up > .arrow:after { + border-right-color: #353c3d !important; + -moz-border-right-colors: #353c3d !important; +} +.skin-1 .nav-list li.pull_up > .arrow:before { + border-right-color: #1d2122 !important; + -moz-border-right-colors: #1d2122 !important; +} +.skin-1 .nav-list li.pull_up.active > .arrow:after { + border-right-color: #171e1f !important; + -moz-border-right-colors: #171e1f !important; +} +.skin-1 .nav-list li.pull_up.active > .arrow:before { + border-right-color: #50a0dd !important; + -moz-border-right-colors: #50a0dd !important; +} +.skin-1 .main-container .menu-toggler { + background-color: #444444; +} +.skin-1 .main-container .menu-toggler:before { + border-top-color: #87b87f; + border-bottom-color: #6fb3e0; +} +.skin-1 .main-container .menu-toggler:after { + border-top-color: #ffa24d; + border-bottom-color: #d15b47; +} +.skin-1 .main-container .menu-toggler > .toggler-text { + border-top-color: #444444; + -moz-border-top-colors: #444444; +} +.skin-1.display { + background-color: #5d82a2; +} +.skin-1.display:before { + border-top-color: #b5d3b0; + border-bottom-color: #aed4ee; +} +.skin-1.display:after { + border-top-color: #ffca9a; + border-bottom-color: #e09284; +} +.skin-1.display > .toggler-text { + border-top-color: #5d82a2; + -moz-border-top-colors: #5d82a2; +} +.skin-1 .navbar .navbar-toggle { + background-color: #4D9DCC; +} +.skin-1 .navbar .navbar-toggle:focus { + background-color: #4D9DCC; + border-color: transparent; +} +.skin-1 .navbar .navbar-toggle:hover { + background-color: #3992c6; + border-color: rgba(255, 255, 255, 0.1); +} +.skin-1 .navbar .navbar-toggle.display, +.skin-1 .navbar .navbar-toggle[data-toggle=collapse]:not(.collapsed) { + background-color: #3384b3; + box-shadow: inset 1px 1px 2px 0 rgba(0, 0, 0, 0.25); + border-color: rgba(255, 255, 255, 0.35); +} +@media only screen and (min-width: 768px) { + .skin-1 .container.main-container:before { + box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1); + } +} +@media only screen and (min-width: 992px) { + .skin-1 .sidebar.h-sidebar:before { + background-color: #38424a; + border-bottom-color: #4a5c63; + } + .skin-1 .sidebar.h-sidebar .nav-list { + border-bottom-width: 0; + } + .skin-1 .sidebar.h-sidebar .nav-list > li.active:before { + display: block; + } + .skin-1 .sidebar.h-sidebar .nav-list > li.hover.active > a:after { + -moz-border-left-colors: none; + -moz-border-right-colors: none; + -moz-border-bottom-colors: #FFF; + border-color: transparent transparent #FFF; + border-width: 8px; + top: auto; + bottom: 0; + right: auto; + left: 50%; + margin-left: -8px; + content: ""; + display: block; + } + .skin-1 .sidebar.h-sidebar .nav-list > li.hover.active:hover > a:after, + .skin-1 .sidebar.h-sidebar .nav-list > li.hover.active.hover-show > a:after { + display: none; + } + .skin-1 .sidebar.h-sidebar + .main-content .breadcrumbs { + border-color: #E8E8E8; + } + .skin-1 .sidebar.h-sidebar .nav-list > li { + border-color: #3f4e54; + } + .skin-1 .sidebar.h-sidebar .nav-list > li:hover, + .skin-1 .sidebar.h-sidebar .nav-list > li:hover + li { + border-left-color: #506575; + } + .skin-1 .sidebar.h-sidebar .nav-list > li:last-child:hover { + border-right-color: #506575; + } + .skin-1 .sidebar.h-sidebar .nav-list > li.active, + .skin-1 .sidebar.h-sidebar .nav-list > li.active + li, + .skin-1 .sidebar.h-sidebar .nav-list > li:hover + li.active { + border-left-color: #55738a; + } + .skin-1 .sidebar.h-sidebar .nav-list > li.active:last-child { + border-right-color: #55738a; + } + .skin-1 .sidebar.h-sidebar .nav-list > li.hover > .submenu { + border-top-color: #232828; + } + .skin-1 .sidebar.h-sidebar .nav-list > li.hover.active > .submenu { + border-top-color: #305675; + border-left-color: #232828; + } + .skin-1 .sidebar.h-sidebar .sidebar-shortcuts-large { + background-color: #222a2d; + border: 1px solid #232828; + border-top-color: #305675; + top: 100%; + } + .skin-1 .sidebar.h-sidebar .nav-list > li > .arrow:after { + border-right-color: transparent; + -moz-border-right-colors: none; + border-bottom-color: #353c3d; + -moz-border-bottom-colors: #353c3d; + } + .skin-1 .sidebar.h-sidebar .nav-list > li > .arrow:before { + -moz-border-right-colors: none; + border-right-color: transparent; + border-bottom-color: #191c1c; + -moz-border-bottom-colors: #222727; + } + .skin-1 .sidebar.h-sidebar .nav-list > li.active > .arrow:before, + .skin-1 .sidebar.h-sidebar .sidebar-shortcuts-large:before { + border-right-color: transparent; + -moz-border-right-colors: none; + border-bottom-color: #50a0dd; + -moz-border-bottom-colors: #216ca6; + } + .skin-1 .sidebar.h-sidebar .nav-list > li.active > .arrow:after, + .skin-1 .sidebar.h-sidebar .sidebar-shortcuts-large:after { + border-right-color: transparent; + -moz-border-right-colors: none; + border-bottom-color: #171e1f; + -moz-border-bottom-colors: #171e1f; + } + .skin-1 .sidebar.h-sidebar .sidebar-shortcuts-large:after { + border-bottom-color: #222a2d; + -moz-border-bottom-colors: #222a2d; + } + .skin-1 .sidebar.h-sidebar .nav-list > li.highlight.active > a:before { + display: none; + } + .skin-1 .sidebar.h-sidebar.menu-min .nav-list > li > a > .menu-text { + border-width: 1px 0 0; + border-top-color: #181d1f; + } + .skin-1 .sidebar.h-sidebar.menu-min .nav-list > li.active > a > .menu-text { + border-top-color: #305675; + } + .skin-1 .sidebar.h-sidebar.menu-min .nav-list > li.active > .submenu { + border-top-color: #3b4547; + } + .skin-1 .sidebar.h-sidebar.menu-min .nav-list > li > .arrow:after { + border-bottom-color: #414b51; + -moz-border-bottom-colors: #414b51; + } + .skin-1 .sidebar.h-sidebar.menu-min .nav-list > li > .arrow:before { + border-bottom-color: #111415; + -moz-border-bottom-colors: #242a2b; + } + .skin-1 .sidebar.h-sidebar.menu-min .nav-list > li.active > .arrow:after { + border-bottom-color: #242a2b; + -moz-border-bottom-colors: #242a2b; + } + .skin-1 .sidebar.h-sidebar.menu-min .nav-list > li.active > .arrow:before { + border-bottom-color: #50a0dd; + -moz-border-bottom-colors: #50a0dd; + } + .skin-1 .h-sidebar.sidebar-fixed + .main-content { + padding-top: 86px; + } + .skin-1 .h-sidebar.sidebar-fixed.no-gap + .main-content { + padding-top: 72px; + } + .skin-1 .h-sidebar.sidebar-fixed.menu-min + .main-content { + padding-top: 61px; + } + .skin-1 .h-sidebar.sidebar-fixed.menu-min.no-gap + .main-content { + padding-top: 47px; + } + .skin-1 .main-content .h-sidebar.sidebar .nav-list { + border-left: 1px solid #4a5c63; + } +} +.skin-1 .sidebar-scroll .sidebar-shortcuts { + border-bottom-color: #4a5c63; +} +.skin-1 .sidebar-scroll .sidebar-toggle { + border-top-color: #4a5c63; +} +.skin-1 .scrollout .scroll-track { + background-color: transparent; +} +.skin-1 .scrollout .scroll-bar { + background-color: #CCC; + background-color: rgba(0, 0, 0, 0.2); +} +@media only screen and (min-width: 768px) and (max-width: 991px) { + .skin-1 .navbar.navbar-collapse { + background-color: transparent; + } + .skin-1 .navbar.navbar-collapse:before, + .skin-1 .navbar.navbar-collapse .navbar-container { + background: #2c6aa0; + } +} +.skin-1 .nav-list > li.disabled:before { + display: none !important; +} +.skin-1 .nav-list > li.disabled > a { + background-color: #333 !important; + color: #AAA !important; +} +.skin-1 .nav-list li .submenu > li.disabled > a, +.skin-1 .nav-list li.disabled .submenu > li > a { + background-color: #444 !important; + color: #A0A0A0 !important; + cursor: not-allowed !important; +} +.skin-1 .nav-list li .submenu > li.disabled > a > .menu-icon, +.skin-1 .nav-list li.disabled .submenu > li > a > .menu-icon { + display: none; +} +.skin-1 .nav-list > li.disabled .submenu > li > a { + border-top-color: #505050; +} +.skin-2 { + background-color: #5c5c5c; +} +.skin-2 .navbar { + background: #c6487e; +} +.skin-2 .sidebar { + background-color: #505050; + border-right-width: 0; +} +.skin-2 .nav-list > li { + border-color: #484848; +} +.skin-2 .nav-list > li:first-child { + border-top-color: #5a5a5a; +} +.skin-2 .nav-list > li:last-child { + border-bottom-color: #626262; +} +.skin-2 .nav-list > li > a { + background-color: #393939; + color: #e6e6e6; +} +.skin-2 .nav-list > li > a > .menu-text, +.skin-2 .nav-list > li > a > .arrow { + color: #e6e6e6; +} +.skin-2 .nav-list > li:hover > a, +.skin-2 .nav-list > li.hover-show > a { + background-color: #bd5289; +} +.skin-2 .nav-list > li:hover > a > .menu-text, +.skin-2 .nav-list > li.hover-show > a > .menu-text { + font-weight: bold; + color: #ffffff; + color: rgba(0, 0, 0, 0.6); +} +.skin-2 .nav-list > li:hover > a > .menu-icon, +.skin-2 .nav-list > li.hover-show > a > .menu-icon, +.skin-2 .nav-list > li:hover > a > .arrow, +.skin-2 .nav-list > li.hover-show > a > .arrow { + color: #ffffff; +} +.skin-2 .nav-list > li.open > a { + background-color: #bd5289; +} +.skin-2 .nav-list > li.open > a > .menu-text { + font-weight: bold; + color: rgba(0, 0, 0, 0.6); +} +.skin-2 .nav-list > li.open > a > .menu-icon, +.skin-2 .nav-list > li.open > a > .arrow { + color: #ffffff; +} +.skin-2 .nav-list > li.active > a { + background-color: #242424; + color: #ffffff; +} +.skin-2 .nav-list > li.active > a > .menu-icon { + color: inherit; +} +.skin-2 .nav-list > li.active > a > .menu-text, +.skin-2 .nav-list > li.active > a > .arrow { + color: #ffffff; +} +.skin-2 .nav-list > li.active:hover > a, +.skin-2 .nav-list > li.active:not(.highlight):hover > a, +.skin-2 .nav-list > li.active.hover-show > a, +.skin-2 .nav-list > li.active:not(.highlight).hover-show > a, +.skin-2 .nav-list > li.active.open > a, +.skin-2 .nav-list > li.active.open:not(.highlight) > a { + background-color: #242424; +} +.skin-2 .nav-list > li.active.highlight > a { + background-color: #bd5289; +} +.skin-2 .nav-list > li.active.highlight > a > .menu-icon { + color: #ffffff; +} +.skin-2 .nav-list li.active > a:after { + border-right-color: #FFF; + -moz-border-right-colors: #FFF; + border-width: 11px 7px; + top: 8px; + right: 0; +} +.skin-2 .nav-list > li.active > .submenu li.active > a:after { + top: 6px; +} +.skin-2 .nav-list > li:before { + top: 0; + height: 39px; +} +.skin-2 .nav-list > li.active:before { + display: block; + background-color: #ce7da7; +} +.skin-2 .nav-list > li.active.highlight:before, +.skin-2 .nav-list > li:before { + background-color: #dea8c4; +} +.skin-2 .nav-list > li > .submenu { + border-top-width: 0; + background-color: #45303b; +} +.skin-2 .nav-list > li > .submenu > li, +.skin-2 .nav-list > li > .submenu > li > .submenu, +.skin-2 .nav-list > li > .submenu > li > .submenu > li, +.skin-2 .nav-list > li > .submenu > li > .submenu > li .submenu, +.skin-2 .nav-list > li > .submenu > li > .submenu > li .submenu li { + background-color: inherit; +} +.skin-2 .nav-list > li .submenu > li > a { + border-top: 1px solid; + border-top-color: #555; + border-top-color: rgba(255, 255, 255, 0.08); + background-color: transparent; +} +.skin-2 .nav-list > li .submenu > li > a:hover { + background-color: rgba(0, 0, 0, 0.1); + color: #FFF; +} +.skin-2 .nav-list > li .submenu > li > a:hover > .menu-icon { + background-color: transparent; +} +.skin-2 .nav-list > li.active .submenu > li > a:hover { + background-color: rgba(0, 0, 0, 0.1); +} +.skin-2 .nav-list > li > .submenu > li > a { + color: #eeeeee; +} +.skin-2 .nav-list > li > .submenu > li:first-child > a { + border-top-width: 0; +} +.skin-2 .nav-list > li > .submenu > li.active > a { + background-color: rgba(0, 0, 0, 0.05); + font-weight: bold; +} +.skin-2 .nav-list > li > .submenu > li.active > a > .menu-icon { + color: inherit; + background-color: transparent; +} +.skin-2 .nav-list li .submenu li > a { + color: #eeeeee; + font-size: 13px; +} +.skin-2 .nav-list > li > .submenu:before, +.skin-2 .nav-list > li > .submenu > li:before { + display: none; +} +.skin-2 .nav-list > li .submenu > li > a { + padding-left: 32px; +} +.skin-2 .nav-list > li .submenu > li > a > .menu-icon { + left: 12px; +} +@media only screen and (min-width: 992px) { + .skin-2 .nav-list > li .submenu > li.hover > a { + padding-left: 26px; + } + .skin-2 .nav-list > li .submenu > li.hover > a > .menu-icon { + left: 6px; + } +} +.skin-2 .nav-list > li > .submenu li > .submenu > li > a { + margin-left: 0; + padding-left: 37px; + padding-top: 8px; + padding-bottom: 10px; + border-top-width: 0; +} +.skin-2 .nav-list > li > .submenu li > .submenu > li > .submenu > li > a { + margin-left: 0; + padding-left: 51px; +} +@media only screen and (min-width: 992px) { + .skin-2 .nav-list > li > .submenu li > .submenu > li.hover > a { + border-top-width: 1px; + padding-bottom: 9px; + } + .skin-2 .nav-list > li > .submenu li > .submenu > li.hover:first-child > a { + border-top-width: 0; + } +} +.skin-2 .nav-list > li > .submenu li:hover > a, +.skin-2 .nav-list > li > .submenu li.hover-show > a, +.skin-2 .nav-list > li > .submenu li.active > a, +.skin-2 .nav-list > li > .submenu li.open > a { + color: #da81af; +} +.skin-2 .nav-list > li > .submenu li > a > .ace-icon { + background-color: transparent; +} +.skin-2 .nav-list > li:hover:not(.active) > a .badge, +.skin-2 .nav-list > li.hover-show:not(.active) > a .badge, +.skin-2 .nav-list > li.open:not(.active) > a .badge, +.skin-2 .nav-list > li.active.highlight .badge, +.skin-2 .nav-list > li:hover:not(.active) > a .label, +.skin-2 .nav-list > li.hover-show:not(.active) > a .label, +.skin-2 .nav-list > li.open:not(.active) > a .label, +.skin-2 .nav-list > li.active.highlight .label { + background-color: rgba(0, 0, 0, 0.5) !important; +} +.skin-2 .nav-list > li:hover:not(.active) > a .badge.badge-transparent, +.skin-2 .nav-list > li.hover-show:not(.active) > a .badge.badge-transparent, +.skin-2 .nav-list > li.open:not(.active) > a .badge.badge-transparent, +.skin-2 .nav-list > li.active.highlight .badge.badge-transparent, +.skin-2 .nav-list > li:hover:not(.active) > a .label.label-transparent, +.skin-2 .nav-list > li.hover-show:not(.active) > a .label.label-transparent, +.skin-2 .nav-list > li.open:not(.active) > a .label.label-transparent, +.skin-2 .nav-list > li.active.highlight .label.label-transparent { + color: rgba(255, 255, 255, 0.8) !important; + background-color: transparent !important; +} +.skin-2 .nav-list > li:hover:not(.active) > a .badge.badge-transparent .ace-icon, +.skin-2 .nav-list > li.hover-show:not(.active) > a .badge.badge-transparent .ace-icon, +.skin-2 .nav-list > li.open:not(.active) > a .badge.badge-transparent .ace-icon, +.skin-2 .nav-list > li.active.highlight .badge.badge-transparent .ace-icon, +.skin-2 .nav-list > li:hover:not(.active) > a .label.label-transparent .ace-icon, +.skin-2 .nav-list > li.hover-show:not(.active) > a .label.label-transparent .ace-icon, +.skin-2 .nav-list > li.open:not(.active) > a .label.label-transparent .ace-icon, +.skin-2 .nav-list > li.active.highlight .label.label-transparent .ace-icon { + color: rgba(255, 255, 255, 0.8) !important; +} +.skin-2 .nav-list li > .arrow:after { + border-right-color: #45303b; + -moz-border-right-colors: #45303b; +} +.skin-2 .nav-list li > .arrow:before { + border-right-color: #191919; + -moz-border-right-colors: #191919; +} +.skin-2 .nav-list > li.pull_up > .arrow:after { + border-right-color: #45303b !important; + -moz-border-right-colors: #45303b !important; +} +.skin-2 .nav-list > li.pull_up > .arrow:before { + border-right-color: #191919 !important; + -moz-border-right-colors: #191919 !important; +} +.skin-2 .nav-list > li.active.highlight > a:after { + border-right-color: transparent; + -moz-border-right-colors: none; + border-left-color: #bd5289; + -moz-border-left-colors: #bd5289; + border-width: 20px 0 20px 10px; + z-index: 1; + top: 0; + right: -10px; + display: block; +} +.skin-2 .nav-list > li:nth-child( 1) > a { + color: #00be67; +} +.skin-2 .nav-list > li:nth-child( 1):hover > a, +.skin-2 .nav-list > li:nth-child( 1).hover-show > a, +.skin-2 .nav-list > li.open:nth-child( 1) > a { + background-color: #18a665; +} +.skin-2 .nav-list > li:nth-child( 1) > .submenu { + background-color: #2a4137; +} +.skin-2 .nav-list > li:nth-child( 1) > .arrow:after, +.skin-2 .nav-list > li:nth-child( 1) li > .arrow:after { + border-right-color: #2a4137; + -moz-border-right-colors: #2a4137; +} +.skin-2 .nav-list > li.pull_up:nth-child( 1) > .arrow:after { + border-right-color: #2a4137 !important; + -moz-border-right-colors: #2a4137 !important; +} +.skin-2 .nav-list > li:nth-child( 1) > .submenu li:hover > a, +.skin-2 .nav-list > li:nth-child( 1) > .submenu li.hover-show > a, +.skin-2 .nav-list > li:nth-child( 1) > .submenu li.active > a, +.skin-2 .nav-list > li:nth-child( 1) > .submenu li.open > a { + color: #1eed8e; +} +.skin-2 .nav-list > li.active:nth-child( 1):before { + background-color: #ce7da7; + background-color: #52bc8c; +} +.skin-2 .nav-list > li.active.highlight:nth-child( 1):before, +.skin-2 .nav-list > li:nth-child( 1):before { + background-color: #8bd3b2; +} +.skin-2 .nav-list > li:nth-child( 2) > a { + color: #5ed02b; +} +.skin-2 .nav-list > li:nth-child( 2):hover > a, +.skin-2 .nav-list > li:nth-child( 2).hover-show > a, +.skin-2 .nav-list > li.open:nth-child( 2) > a { + background-color: #6ab14a; +} +.skin-2 .nav-list > li:nth-child( 2) > .submenu { + background-color: #36432f; +} +.skin-2 .nav-list > li:nth-child( 2) > .arrow:after, +.skin-2 .nav-list > li:nth-child( 2) li > .arrow:after { + border-right-color: #36432f; + -moz-border-right-colors: #36432f; +} +.skin-2 .nav-list > li.pull_up:nth-child( 2) > .arrow:after { + border-right-color: #36432f !important; + -moz-border-right-colors: #36432f !important; +} +.skin-2 .nav-list > li:nth-child( 2) > .submenu li:hover > a, +.skin-2 .nav-list > li:nth-child( 2) > .submenu li.hover-show > a, +.skin-2 .nav-list > li:nth-child( 2) > .submenu li.active > a, +.skin-2 .nav-list > li:nth-child( 2) > .submenu li.open > a { + color: #92d275; +} +.skin-2 .nav-list > li.active:nth-child( 2):before { + background-color: #ce7da7; + background-color: #8fc478; +} +.skin-2 .nav-list > li.active.highlight:nth-child( 2):before, +.skin-2 .nav-list > li:nth-child( 2):before { + background-color: #b4d8a5; +} +.skin-2 .nav-list > li:nth-child( 3) > a { + color: #a7d700; +} +.skin-2 .nav-list > li:nth-child( 3):hover > a, +.skin-2 .nav-list > li:nth-child( 3).hover-show > a, +.skin-2 .nav-list > li.open:nth-child( 3) > a { + background-color: #98bc1b; +} +.skin-2 .nav-list > li:nth-child( 3) > .submenu { + background-color: #3e442a; +} +.skin-2 .nav-list > li:nth-child( 3) > .arrow:after, +.skin-2 .nav-list > li:nth-child( 3) li > .arrow:after { + border-right-color: #3e442a; + -moz-border-right-colors: #3e442a; +} +.skin-2 .nav-list > li.pull_up:nth-child( 3) > .arrow:after { + border-right-color: #3e442a !important; + -moz-border-right-colors: #3e442a !important; +} +.skin-2 .nav-list > li:nth-child( 3) > .submenu li:hover > a, +.skin-2 .nav-list > li:nth-child( 3) > .submenu li.hover-show > a, +.skin-2 .nav-list > li:nth-child( 3) > .submenu li.active > a, +.skin-2 .nav-list > li:nth-child( 3) > .submenu li.open > a { + color: #c5ef35; +} +.skin-2 .nav-list > li.active:nth-child( 3):before { + background-color: #ce7da7; + background-color: #b2cd54; +} +.skin-2 .nav-list > li.active.highlight:nth-child( 3):before, +.skin-2 .nav-list > li:nth-child( 3):before { + background-color: #ccde8d; +} +.skin-2 .nav-list > li:nth-child( 4) > a { + color: #cee100; +} +.skin-2 .nav-list > li:nth-child( 4):hover > a, +.skin-2 .nav-list > li:nth-child( 4).hover-show > a, +.skin-2 .nav-list > li.open:nth-child( 4) > a { + background-color: #b7c51c; +} +.skin-2 .nav-list > li:nth-child( 4) > .submenu { + background-color: #43452a; +} +.skin-2 .nav-list > li:nth-child( 4) > .arrow:after, +.skin-2 .nav-list > li:nth-child( 4) li > .arrow:after { + border-right-color: #43452a; + -moz-border-right-colors: #43452a; +} +.skin-2 .nav-list > li.pull_up:nth-child( 4) > .arrow:after { + border-right-color: #43452a !important; + -moz-border-right-colors: #43452a !important; +} +.skin-2 .nav-list > li:nth-child( 4) > .submenu li:hover > a, +.skin-2 .nav-list > li:nth-child( 4) > .submenu li.hover-show > a, +.skin-2 .nav-list > li:nth-child( 4) > .submenu li.active > a, +.skin-2 .nav-list > li:nth-child( 4) > .submenu li.open > a { + color: #e0ef3e; +} +.skin-2 .nav-list > li.active:nth-child( 4):before { + background-color: #ce7da7; + background-color: #c9d355; +} +.skin-2 .nav-list > li.active.highlight:nth-child( 4):before, +.skin-2 .nav-list > li:nth-child( 4):before { + background-color: #dbe28e; +} +.skin-2 .nav-list > li:nth-child( 5) > a { + color: #f8c600; +} +.skin-2 .nav-list > li:nth-child( 5):hover > a, +.skin-2 .nav-list > li:nth-child( 5).hover-show > a, +.skin-2 .nav-list > li.open:nth-child( 5) > a { + background-color: #d9b41f; +} +.skin-2 .nav-list > li:nth-child( 5) > .submenu { + background-color: #48422a; +} +.skin-2 .nav-list > li:nth-child( 5) > .arrow:after, +.skin-2 .nav-list > li:nth-child( 5) li > .arrow:after { + border-right-color: #48422a; + -moz-border-right-colors: #48422a; +} +.skin-2 .nav-list > li.pull_up:nth-child( 5) > .arrow:after { + border-right-color: #48422a !important; + -moz-border-right-colors: #48422a !important; +} +.skin-2 .nav-list > li:nth-child( 5) > .submenu li:hover > a, +.skin-2 .nav-list > li:nth-child( 5) > .submenu li.hover-show > a, +.skin-2 .nav-list > li:nth-child( 5) > .submenu li.active > a, +.skin-2 .nav-list > li:nth-child( 5) > .submenu li.open > a { + color: #f1d153; +} +.skin-2 .nav-list > li.active:nth-child( 5):before { + background-color: #ce7da7; + background-color: #e3c657; +} +.skin-2 .nav-list > li.active.highlight:nth-child( 5):before, +.skin-2 .nav-list > li:nth-child( 5):before { + background-color: #ecd98f; +} +.skin-2 .nav-list > li:nth-child( 6) > a { + color: #ffab00; +} +.skin-2 .nav-list > li:nth-child( 6):hover > a, +.skin-2 .nav-list > li:nth-child( 6).hover-show > a, +.skin-2 .nav-list > li.open:nth-child( 6) > a { + background-color: #dfa020; +} +.skin-2 .nav-list > li:nth-child( 6) > .submenu { + background-color: #493f2a; +} +.skin-2 .nav-list > li:nth-child( 6) > .arrow:after, +.skin-2 .nav-list > li:nth-child( 6) li > .arrow:after { + border-right-color: #493f2a; + -moz-border-right-colors: #493f2a; +} +.skin-2 .nav-list > li.pull_up:nth-child( 6) > .arrow:after { + border-right-color: #493f2a !important; + -moz-border-right-colors: #493f2a !important; +} +.skin-2 .nav-list > li:nth-child( 6) > .submenu li:hover > a, +.skin-2 .nav-list > li:nth-child( 6) > .submenu li.hover-show > a, +.skin-2 .nav-list > li:nth-child( 6) > .submenu li.active > a, +.skin-2 .nav-list > li:nth-child( 6) > .submenu li.open > a { + color: #f2c05a; +} +.skin-2 .nav-list > li.active:nth-child( 6):before { + background-color: #ce7da7; + background-color: #e7b858; +} +.skin-2 .nav-list > li.active.highlight:nth-child( 6):before, +.skin-2 .nav-list > li:nth-child( 6):before { + background-color: #efd08f; +} +.skin-2 .nav-list > li:nth-child( 7) > a { + color: #ff6e00; +} +.skin-2 .nav-list > li:nth-child( 7):hover > a, +.skin-2 .nav-list > li:nth-child( 7).hover-show > a, +.skin-2 .nav-list > li.open:nth-child( 7) > a { + background-color: #df7220; +} +.skin-2 .nav-list > li:nth-child( 7) > .submenu { + background-color: #49372a; +} +.skin-2 .nav-list > li:nth-child( 7) > .arrow:after, +.skin-2 .nav-list > li:nth-child( 7) li > .arrow:after { + border-right-color: #49372a; + -moz-border-right-colors: #49372a; +} +.skin-2 .nav-list > li.pull_up:nth-child( 7) > .arrow:after { + border-right-color: #49372a !important; + -moz-border-right-colors: #49372a !important; +} +.skin-2 .nav-list > li:nth-child( 7) > .submenu li:hover > a, +.skin-2 .nav-list > li:nth-child( 7) > .submenu li.hover-show > a, +.skin-2 .nav-list > li:nth-child( 7) > .submenu li.active > a, +.skin-2 .nav-list > li:nth-child( 7) > .submenu li.open > a { + color: #f29b5a; +} +.skin-2 .nav-list > li.active:nth-child( 7):before { + background-color: #ce7da7; + background-color: #e79658; +} +.skin-2 .nav-list > li.active.highlight:nth-child( 7):before, +.skin-2 .nav-list > li:nth-child( 7):before { + background-color: #efb98f; +} +.skin-2 .nav-list > li:nth-child( 8) > a { + color: #f21c30; +} +.skin-2 .nav-list > li:nth-child( 8):hover > a, +.skin-2 .nav-list > li:nth-child( 8).hover-show > a, +.skin-2 .nav-list > li.open:nth-child( 8) > a { + background-color: #d43a48; +} +.skin-2 .nav-list > li:nth-child( 8) > .submenu { + background-color: #472e30; +} +.skin-2 .nav-list > li:nth-child( 8) > .arrow:after, +.skin-2 .nav-list > li:nth-child( 8) li > .arrow:after { + border-right-color: #472e30; + -moz-border-right-colors: #472e30; +} +.skin-2 .nav-list > li.pull_up:nth-child( 8) > .arrow:after { + border-right-color: #472e30 !important; + -moz-border-right-colors: #472e30 !important; +} +.skin-2 .nav-list > li:nth-child( 8) > .submenu li:hover > a, +.skin-2 .nav-list > li:nth-child( 8) > .submenu li.hover-show > a, +.skin-2 .nav-list > li:nth-child( 8) > .submenu li.active > a, +.skin-2 .nav-list > li:nth-child( 8) > .submenu li.open > a { + color: #ea717c; +} +.skin-2 .nav-list > li.active:nth-child( 8):before { + background-color: #ce7da7; + background-color: #df6b76; +} +.skin-2 .nav-list > li.active.highlight:nth-child( 8):before, +.skin-2 .nav-list > li:nth-child( 8):before { + background-color: #ea9da4; +} +.skin-2 .nav-list > li:nth-child( 9) > a { + color: #db348a; +} +.skin-2 .nav-list > li:nth-child( 9):hover > a, +.skin-2 .nav-list > li:nth-child( 9).hover-show > a, +.skin-2 .nav-list > li.open:nth-child( 9) > a { + background-color: #bd5289; +} +.skin-2 .nav-list > li:nth-child( 9) > .submenu { + background-color: #45303b; +} +.skin-2 .nav-list > li:nth-child( 9) > .arrow:after, +.skin-2 .nav-list > li:nth-child( 9) li > .arrow:after { + border-right-color: #45303b; + -moz-border-right-colors: #45303b; +} +.skin-2 .nav-list > li.pull_up:nth-child( 9) > .arrow:after { + border-right-color: #45303b !important; + -moz-border-right-colors: #45303b !important; +} +.skin-2 .nav-list > li:nth-child( 9) > .submenu li:hover > a, +.skin-2 .nav-list > li:nth-child( 9) > .submenu li.hover-show > a, +.skin-2 .nav-list > li:nth-child( 9) > .submenu li.active > a, +.skin-2 .nav-list > li:nth-child( 9) > .submenu li.open > a { + color: #da81af; +} +.skin-2 .nav-list > li.active:nth-child( 9):before { + background-color: #ce7da7; +} +.skin-2 .nav-list > li.active.highlight:nth-child( 9):before, +.skin-2 .nav-list > li:nth-child( 9):before { + background-color: #dea8c4; +} +.skin-2 .nav-list > li:nth-child( 10) > a { + color: #c55ee7; +} +.skin-2 .nav-list > li:nth-child( 10):hover > a, +.skin-2 .nav-list > li:nth-child( 10).hover-show > a, +.skin-2 .nav-list > li.open:nth-child( 10) > a { + background-color: #b975d0; +} +.skin-2 .nav-list > li:nth-child( 10) > .submenu { + background-color: #423646; +} +.skin-2 .nav-list > li:nth-child( 10) > .arrow:after, +.skin-2 .nav-list > li:nth-child( 10) li > .arrow:after { + border-right-color: #423646; + -moz-border-right-colors: #423646; +} +.skin-2 .nav-list > li.pull_up:nth-child( 10) > .arrow:after { + border-right-color: #423646 !important; + -moz-border-right-colors: #423646 !important; +} +.skin-2 .nav-list > li:nth-child( 10) > .submenu li:hover > a, +.skin-2 .nav-list > li:nth-child( 10) > .submenu li.hover-show > a, +.skin-2 .nav-list > li:nth-child( 10) > .submenu li.active > a, +.skin-2 .nav-list > li:nth-child( 10) > .submenu li.open > a { + color: #d9a9e9; +} +.skin-2 .nav-list > li.active:nth-child( 10):before { + background-color: #ce7da7; + background-color: #cb98dc; +} +.skin-2 .nav-list > li.active.highlight:nth-child( 10):before, +.skin-2 .nav-list > li:nth-child( 10):before { + background-color: #dcbae7; +} +.skin-2 .nav-list > li:nth-child( 11) > a { + color: #218bee; +} +.skin-2 .nav-list > li:nth-child( 11):hover > a, +.skin-2 .nav-list > li:nth-child( 11).hover-show > a, +.skin-2 .nav-list > li.open:nth-child( 11) > a { + background-color: #3f8ad0; +} +.skin-2 .nav-list > li:nth-child( 11) > .submenu { + background-color: #2e3b47; +} +.skin-2 .nav-list > li:nth-child( 11) > .arrow:after, +.skin-2 .nav-list > li:nth-child( 11) li > .arrow:after { + border-right-color: #2e3b47; + -moz-border-right-colors: #2e3b47; +} +.skin-2 .nav-list > li.pull_up:nth-child( 11) > .arrow:after { + border-right-color: #2e3b47 !important; + -moz-border-right-colors: #2e3b47 !important; +} +.skin-2 .nav-list > li:nth-child( 11) > .submenu li:hover > a, +.skin-2 .nav-list > li:nth-child( 11) > .submenu li.hover-show > a, +.skin-2 .nav-list > li:nth-child( 11) > .submenu li.active > a, +.skin-2 .nav-list > li:nth-child( 11) > .submenu li.open > a { + color: #74b0e7; +} +.skin-2 .nav-list > li.active:nth-child( 11):before { + background-color: #ce7da7; + background-color: #6fa7dc; +} +.skin-2 .nav-list > li.active.highlight:nth-child( 11):before, +.skin-2 .nav-list > li:nth-child( 11):before { + background-color: #9fc4e8; +} +.skin-2 .nav-list > li:nth-child( 12) > a { + color: #2ecee7; +} +.skin-2 .nav-list > li:nth-child( 12):hover > a, +.skin-2 .nav-list > li:nth-child( 12).hover-show > a, +.skin-2 .nav-list > li.open:nth-child( 12) > a { + background-color: #4bb9ca; +} +.skin-2 .nav-list > li:nth-child( 12) > .submenu { + background-color: #304346; +} +.skin-2 .nav-list > li:nth-child( 12) > .arrow:after, +.skin-2 .nav-list > li:nth-child( 12) li > .arrow:after { + border-right-color: #304346; + -moz-border-right-colors: #304346; +} +.skin-2 .nav-list > li.pull_up:nth-child( 12) > .arrow:after { + border-right-color: #304346 !important; + -moz-border-right-colors: #304346 !important; +} +.skin-2 .nav-list > li:nth-child( 12) > .submenu li:hover > a, +.skin-2 .nav-list > li:nth-child( 12) > .submenu li.hover-show > a, +.skin-2 .nav-list > li:nth-child( 12) > .submenu li.active > a, +.skin-2 .nav-list > li:nth-child( 12) > .submenu li.open > a { + color: #7ed6e3; +} +.skin-2 .nav-list > li.active:nth-child( 12):before { + background-color: #ce7da7; + background-color: #78cad7; +} +.skin-2 .nav-list > li.active.highlight:nth-child( 12):before, +.skin-2 .nav-list > li:nth-child( 12):before { + background-color: #a5dce4; +} +@media only screen and (min-width: 992px) { + .skin-2 .sidebar.h-sidebar .nav-list > li.hover:nth-child( 1) > a { + color: #00be67; + } + .skin-2 .sidebar.h-sidebar .nav-list > li.hover:nth-child( 1) > .arrow:after { + border-bottom-color: #2a4137; + -moz-border-bottom-colors: #2a4137; + } + .skin-2 .sidebar.h-sidebar .nav-list > li.hover:nth-child( 2) > a { + color: #5ed02b; + } + .skin-2 .sidebar.h-sidebar .nav-list > li.hover:nth-child( 2) > .arrow:after { + border-bottom-color: #36432f; + -moz-border-bottom-colors: #36432f; + } + .skin-2 .sidebar.h-sidebar .nav-list > li.hover:nth-child( 3) > a { + color: #a7d700; + } + .skin-2 .sidebar.h-sidebar .nav-list > li.hover:nth-child( 3) > .arrow:after { + border-bottom-color: #3e442a; + -moz-border-bottom-colors: #3e442a; + } + .skin-2 .sidebar.h-sidebar .nav-list > li.hover:nth-child( 4) > a { + color: #cee100; + } + .skin-2 .sidebar.h-sidebar .nav-list > li.hover:nth-child( 4) > .arrow:after { + border-bottom-color: #43452a; + -moz-border-bottom-colors: #43452a; + } + .skin-2 .sidebar.h-sidebar .nav-list > li.hover:nth-child( 5) > a { + color: #f8c600; + } + .skin-2 .sidebar.h-sidebar .nav-list > li.hover:nth-child( 5) > .arrow:after { + border-bottom-color: #48422a; + -moz-border-bottom-colors: #48422a; + } + .skin-2 .sidebar.h-sidebar .nav-list > li.hover:nth-child( 6) > a { + color: #ffab00; + } + .skin-2 .sidebar.h-sidebar .nav-list > li.hover:nth-child( 6) > .arrow:after { + border-bottom-color: #493f2a; + -moz-border-bottom-colors: #493f2a; + } + .skin-2 .sidebar.h-sidebar .nav-list > li.hover:nth-child( 7) > a { + color: #ff6e00; + } + .skin-2 .sidebar.h-sidebar .nav-list > li.hover:nth-child( 7) > .arrow:after { + border-bottom-color: #49372a; + -moz-border-bottom-colors: #49372a; + } + .skin-2 .sidebar.h-sidebar .nav-list > li.hover:nth-child( 8) > a { + color: #f21c30; + } + .skin-2 .sidebar.h-sidebar .nav-list > li.hover:nth-child( 8) > .arrow:after { + border-bottom-color: #472e30; + -moz-border-bottom-colors: #472e30; + } + .skin-2 .sidebar.h-sidebar .nav-list > li.hover:nth-child( 9) > a { + color: #db348a; + } + .skin-2 .sidebar.h-sidebar .nav-list > li.hover:nth-child( 9) > .arrow:after { + border-bottom-color: #45303b; + -moz-border-bottom-colors: #45303b; + } + .skin-2 .sidebar.h-sidebar .nav-list > li.hover:nth-child( 10) > a { + color: #c55ee7; + } + .skin-2 .sidebar.h-sidebar .nav-list > li.hover:nth-child( 10) > .arrow:after { + border-bottom-color: #423646; + -moz-border-bottom-colors: #423646; + } + .skin-2 .sidebar.h-sidebar .nav-list > li.hover:nth-child( 11) > a { + color: #218bee; + } + .skin-2 .sidebar.h-sidebar .nav-list > li.hover:nth-child( 11) > .arrow:after { + border-bottom-color: #2e3b47; + -moz-border-bottom-colors: #2e3b47; + } + .skin-2 .sidebar.h-sidebar .nav-list > li.hover:nth-child( 12) > a { + color: #2ecee7; + } + .skin-2 .sidebar.h-sidebar .nav-list > li.hover:nth-child( 12) > .arrow:after { + border-bottom-color: #304346; + -moz-border-bottom-colors: #304346; + } +} +.skin-2 .nav-list > li.highlight.active:nth-child( 1) > a { + background-color: #18a665; +} +.skin-2 .nav-list > li.active.highlight:nth-child( 1) > a:after { + border-left-color: #18a665; + -moz-border-left-colors: #18a665; +} +.skin-2 .nav-list > li.highlight.active:nth-child( 2) > a { + background-color: #6ab14a; +} +.skin-2 .nav-list > li.active.highlight:nth-child( 2) > a:after { + border-left-color: #6ab14a; + -moz-border-left-colors: #6ab14a; +} +.skin-2 .nav-list > li.highlight.active:nth-child( 3) > a { + background-color: #98bc1b; +} +.skin-2 .nav-list > li.active.highlight:nth-child( 3) > a:after { + border-left-color: #98bc1b; + -moz-border-left-colors: #98bc1b; +} +.skin-2 .nav-list > li.highlight.active:nth-child( 4) > a { + background-color: #b7c51c; +} +.skin-2 .nav-list > li.active.highlight:nth-child( 4) > a:after { + border-left-color: #b7c51c; + -moz-border-left-colors: #b7c51c; +} +.skin-2 .nav-list > li.highlight.active:nth-child( 5) > a { + background-color: #d9b41f; +} +.skin-2 .nav-list > li.active.highlight:nth-child( 5) > a:after { + border-left-color: #d9b41f; + -moz-border-left-colors: #d9b41f; +} +.skin-2 .nav-list > li.highlight.active:nth-child( 6) > a { + background-color: #dfa020; +} +.skin-2 .nav-list > li.active.highlight:nth-child( 6) > a:after { + border-left-color: #dfa020; + -moz-border-left-colors: #dfa020; +} +.skin-2 .nav-list > li.highlight.active:nth-child( 7) > a { + background-color: #df7220; +} +.skin-2 .nav-list > li.active.highlight:nth-child( 7) > a:after { + border-left-color: #df7220; + -moz-border-left-colors: #df7220; +} +.skin-2 .nav-list > li.highlight.active:nth-child( 8) > a { + background-color: #d43a48; +} +.skin-2 .nav-list > li.active.highlight:nth-child( 8) > a:after { + border-left-color: #d43a48; + -moz-border-left-colors: #d43a48; +} +.skin-2 .nav-list > li.highlight.active:nth-child( 9) > a { + background-color: #bd5289; +} +.skin-2 .nav-list > li.active.highlight:nth-child( 9) > a:after { + border-left-color: #bd5289; + -moz-border-left-colors: #bd5289; +} +.skin-2 .nav-list > li.highlight.active:nth-child( 10) > a { + background-color: #b975d0; +} +.skin-2 .nav-list > li.active.highlight:nth-child( 10) > a:after { + border-left-color: #b975d0; + -moz-border-left-colors: #b975d0; +} +.skin-2 .nav-list > li.highlight.active:nth-child( 11) > a { + background-color: #3f8ad0; +} +.skin-2 .nav-list > li.active.highlight:nth-child( 11) > a:after { + border-left-color: #3f8ad0; + -moz-border-left-colors: #3f8ad0; +} +.skin-2 .nav-list > li.highlight.active:nth-child( 12) > a { + background-color: #4bb9ca; +} +.skin-2 .nav-list > li.active.highlight:nth-child( 12) > a:after { + border-left-color: #4bb9ca; + -moz-border-left-colors: #4bb9ca; +} +.skin-2 .sidebar-shortcuts .btn { + background-color: #555 !important; + border-radius: 32px; + border-width: 2px; +} +.skin-2 .sidebar-shortcuts .btn:hover { + background-color: #222 !important; +} +.skin-2 .sidebar-shortcuts .btn:focus { + outline: none; +} +.skin-2 .sidebar-shortcuts-mini .btn { + border-radius: 32px; + border-width: 2px; + opacity: 1; + padding: 6px; +} +.skin-2 .sidebar-shortcuts, +.skin-2 .sidebar-shortcuts-mini { + background-color: #393939; +} +.skin-2 .sidebar > .nav-search { + background-color: #393939; +} +.skin-2 .sidebar-toggle { + background-color: #2f2f2f; + border-color: #767676; +} +.skin-2 .sidebar-toggle:before { + border-color: inherit; +} +.skin-2 .sidebar-toggle > .ace-icon { + background-color: #333333; + border-color: #aaaaaa; + color: #aaaaaa; +} +.skin-2 .breadcrumbs { + border-width: 0; + background-color: #e7f2f8; + border-radius: 4px; + margin: 8px 8px 0; +} +@media only screen and (max-width: 991px) { + .skin-2 .breadcrumbs { + margin: 5px 5px 0; + } + .skin-2 .menu-toggler + .sidebar.responsive + .main-content .breadcrumbs { + margin: 0; + border-radius: 0; + } +} +@media (min-width: 992px) { + .skin-2 .breadcrumbs.breadcrumbs-fixed + .page-content { + padding-top: 57px; + } +} +@media (min-width: 992px) and (max-width: 991px) { + .skin-2 .breadcrumbs.breadcrumbs-fixed + .page-content { + padding-top: 54px; + } + .skin-2 .menu-toggler + .sidebar.reponsive + .main-content .breadcrumbs.breadcrumbs-fixed + .page-content { + padding-top: 49px; + } +} +@media (min-width: 992px) and (max-width: 991px) { + .skin-2 .container.main-container .sidebar.compact + .main-content .breadcrumbs-fixed { + width: 734px; + } +} +@media (min-width: 992px) and (max-width: 991px) { + .skin-2 .container.main-container .breadcrumbs-fixed { + width: 734px; + } + .skin-2 .container.main-container .sidebar.menu-min + .main-content .breadcrumbs-fixed { + width: 734px; + } + .skin-2 .container.main-container .sidebar.responsive-min + .main-content .breadcrumbs-fixed { + width: 691px; + } +} +@media (min-width: 992px) { + .skin-2 .container.main-container .sidebar.compact + .main-content .breadcrumbs-fixed { + width: 843px; + } +} +@media (min-width: 992px) { + .skin-2 .container.main-container .breadcrumbs-fixed { + width: 964px; + } + .skin-2 .container.main-container .sidebar + .main-content .breadcrumbs-fixed { + width: 758px; + } + .skin-2 .container.main-container .sidebar.menu-min + .main-content .breadcrumbs-fixed { + width: 905px; + } +} +@media (min-width: 1200px) { + .skin-2 .container.main-container .sidebar.compact + .main-content .breadcrumbs-fixed { + width: 1043px; + } +} +@media (min-width: 1200px) { + .skin-2 .container.main-container .breadcrumbs-fixed { + width: 1148px; + } + .skin-2 .container.main-container .sidebar + .main-content .breadcrumbs-fixed { + width: 958px; + } + .skin-2 .container.main-container .sidebar.menu-min + .main-content .breadcrumbs-fixed { + width: 1105px; + } +} +@media (min-width: 768px) { + .skin-2 .container.main-container .sidebar.h-sidebar + .main-content .breadcrumbs-fixed { + width: auto; + } +} +@media only screen and (max-width: 991px) { + .skin-2 .sidebar { + border-width: 0; + -webkit-box-shadow: none; + box-shadow: none; + } + .skin-2 .nav-list li.active > a:after { + display: none; + } +} +.skin-2 .sidebar.menu-min .nav-list > li.open > a { + color: #e6e6e6; +} +.skin-2 .sidebar.menu-min .nav-list > li.active > a { + color: #ffffff; +} +.skin-2 .sidebar.menu-min .nav-list > li.active > a:after { + border-width: 9px 6px; + top: 10px; +} +.skin-2 .sidebar.menu-min .nav-list > li.active.highlight > a:after { + border-width: 20px 0 20px 10px; + top: 0; +} +.skin-2 .sidebar.menu-min .nav-list > li > a > .menu-text { + background-color: inherit; + font-weight: bold; + color: rgba(0, 0, 0, 0.6); + border-width: 0 0 0 1px; + border-style: solid; + border-color: #333; + border-color: rgba(0, 0, 0, 0.4); + -webkit-box-shadow: none; + box-shadow: none; + margin-left: 1px; +} +.skin-2 .sidebar.menu-min .nav-list > li.active > a > .menu-text { + background-color: inherit; + color: #FFF; +} +.skin-2 .sidebar.menu-min .nav-list > li > .submenu { + border-style: solid; + border-width: 1px 0 0 1px; + border-color: #444; + border-color: rgba(0, 0, 0, 0.3); + -webkit-box-shadow: none; + box-shadow: none; + margin-left: 1px; +} +.skin-2 .sidebar.menu-min .nav-list > li > .submenu:after { + display: none; +} +.skin-2 .sidebar.menu-min .nav-list > li.active > .submenu { + border-top-color: rgba(0, 0, 0, 0.5); +} +.skin-2 .sidebar.menu-min .sidebar-shortcuts-large { + background-color: #393939; + -webkit-box-shadow: none; + box-shadow: none; + border: 1px solid #555555; + border-width: 0 1px 1px 0; + top: 0; + border-color: #666; +} +.skin-2 .sidebar.menu-min .nav-list > li > .arrow:after, +.skin-2 .sidebar.menu-min .nav-list > li.active.highlight > .arrow:after { + border-right-color: #bd5289; + -moz-border-right-colors: #bd5289; +} +.skin-2 .sidebar.menu-min .nav-list > li > .arrow:before, +.skin-2 .sidebar.menu-min .nav-list > li.active.highlight > .arrow:before { + border-right-color: #333; + border-right-color: rgba(0, 0, 0, 0.7); + -moz-border-right-colors: rgba(0, 0, 0, 0.7); +} +.skin-2 .sidebar.menu-min .nav-list > li.active:not(.highlight) > a:not(.dropdown-toggle) > .menu-text { + border-width: 1px; + border-top-color: #555555; + border-bottom-color: #555555; + border-right-color: #555555; +} +.skin-2 .sidebar.menu-min .nav-list > li > a > .menu-text, +.skin-2 .sidebar.menu-min .nav-list > li.active.highlight > a > .menu-text { + border-left-color: #333; + border-left-color: rgba(0, 0, 0, 0.5); +} +.skin-2 .sidebar.menu-min .nav-list > li.pull_up > a > .menu-text, +.skin-2 .sidebar.menu-min .nav-list > li.pull_up.active.highlight > a > .menu-text { + border-left-color: #222; + border-left-color: rgba(0, 0, 0, 0.7); +} +.skin-2 .sidebar.menu-min .nav-list > li.pull_up.active:not(.highlight) > a > .menu-text { + border-left-color: #666; +} +.skin-2 .sidebar.menu-min .nav-list > li:nth-child( 1) > .arrow:after, +.skin-2 .sidebar.menu-min .nav-list > li.active.highlight:nth-child( 1) > .arrow:after { + border-right-color: #18a665; + -moz-border-right-colors: #18a665; +} +.skin-2 .sidebar.menu-min .nav-list > li:nth-child( 2) > .arrow:after, +.skin-2 .sidebar.menu-min .nav-list > li.active.highlight:nth-child( 2) > .arrow:after { + border-right-color: #6ab14a; + -moz-border-right-colors: #6ab14a; +} +.skin-2 .sidebar.menu-min .nav-list > li:nth-child( 3) > .arrow:after, +.skin-2 .sidebar.menu-min .nav-list > li.active.highlight:nth-child( 3) > .arrow:after { + border-right-color: #98bc1b; + -moz-border-right-colors: #98bc1b; +} +.skin-2 .sidebar.menu-min .nav-list > li:nth-child( 4) > .arrow:after, +.skin-2 .sidebar.menu-min .nav-list > li.active.highlight:nth-child( 4) > .arrow:after { + border-right-color: #b7c51c; + -moz-border-right-colors: #b7c51c; +} +.skin-2 .sidebar.menu-min .nav-list > li:nth-child( 5) > .arrow:after, +.skin-2 .sidebar.menu-min .nav-list > li.active.highlight:nth-child( 5) > .arrow:after { + border-right-color: #d9b41f; + -moz-border-right-colors: #d9b41f; +} +.skin-2 .sidebar.menu-min .nav-list > li:nth-child( 6) > .arrow:after, +.skin-2 .sidebar.menu-min .nav-list > li.active.highlight:nth-child( 6) > .arrow:after { + border-right-color: #dfa020; + -moz-border-right-colors: #dfa020; +} +.skin-2 .sidebar.menu-min .nav-list > li:nth-child( 7) > .arrow:after, +.skin-2 .sidebar.menu-min .nav-list > li.active.highlight:nth-child( 7) > .arrow:after { + border-right-color: #df7220; + -moz-border-right-colors: #df7220; +} +.skin-2 .sidebar.menu-min .nav-list > li:nth-child( 8) > .arrow:after, +.skin-2 .sidebar.menu-min .nav-list > li.active.highlight:nth-child( 8) > .arrow:after { + border-right-color: #d43a48; + -moz-border-right-colors: #d43a48; +} +.skin-2 .sidebar.menu-min .nav-list > li:nth-child( 9) > .arrow:after, +.skin-2 .sidebar.menu-min .nav-list > li.active.highlight:nth-child( 9) > .arrow:after { + border-right-color: #bd5289; + -moz-border-right-colors: #bd5289; +} +.skin-2 .sidebar.menu-min .nav-list > li:nth-child( 10) > .arrow:after, +.skin-2 .sidebar.menu-min .nav-list > li.active.highlight:nth-child( 10) > .arrow:after { + border-right-color: #b975d0; + -moz-border-right-colors: #b975d0; +} +.skin-2 .sidebar.menu-min .nav-list > li:nth-child( 11) > .arrow:after, +.skin-2 .sidebar.menu-min .nav-list > li.active.highlight:nth-child( 11) > .arrow:after { + border-right-color: #3f8ad0; + -moz-border-right-colors: #3f8ad0; +} +.skin-2 .sidebar.menu-min .nav-list > li:nth-child( 12) > .arrow:after, +.skin-2 .sidebar.menu-min .nav-list > li.active.highlight:nth-child( 12) > .arrow:after { + border-right-color: #4bb9ca; + -moz-border-right-colors: #4bb9ca; +} +.skin-2 .sidebar.menu-min .nav-list > li.active > a > .menu-text { + border-left-color: #777; +} +.skin-2 .sidebar.menu-min .nav-list > li.active > .arrow:after { + border-right-color: #242424; + -moz-border-right-colors: #242424; +} +.skin-2 .sidebar.menu-min .nav-list > li.active > .arrow:before { + border-right-color: #888; + -moz-border-right-colors: #FFF; +} +@media (max-width: 991px) { + .skin-2 .sidebar.responsive .nav-list > li.active > a:after { + display: none; + } + .skin-2 .sidebar.responsive .nav-list > li.active.highlight > a:after { + display: block; + } +} +@media (max-width: 991px) { + .skin-2 .sidebar.responsive-min .nav-list > li.open > a { + color: #e6e6e6; + } + .skin-2 .sidebar.responsive-min .nav-list > li.active > a { + color: #ffffff; + } + .skin-2 .sidebar.responsive-min .nav-list > li.active > a:after { + border-width: 9px 6px; + top: 10px; + } + .skin-2 .sidebar.responsive-min .nav-list > li.active.highlight > a:after { + border-width: 20px 0 20px 10px; + top: 0; + } + .skin-2 .sidebar.responsive-min .nav-list > li > a > .menu-text { + background-color: inherit; + font-weight: bold; + color: rgba(0, 0, 0, 0.6); + border-width: 0 0 0 1px; + border-style: solid; + border-color: #333; + border-color: rgba(0, 0, 0, 0.4); + -webkit-box-shadow: none; + box-shadow: none; + margin-left: 1px; + } + .skin-2 .sidebar.responsive-min .nav-list > li.active > a > .menu-text { + background-color: inherit; + color: #FFF; + } + .skin-2 .sidebar.responsive-min .nav-list > li > .submenu { + border-style: solid; + border-width: 1px 0 0 1px; + border-color: #444; + border-color: rgba(0, 0, 0, 0.3); + -webkit-box-shadow: none; + box-shadow: none; + margin-left: 1px; + } + .skin-2 .sidebar.responsive-min .nav-list > li > .submenu:after { + display: none; + } + .skin-2 .sidebar.responsive-min .nav-list > li.active > .submenu { + border-top-color: rgba(0, 0, 0, 0.5); + } + .skin-2 .sidebar.responsive-min .sidebar-shortcuts-large { + background-color: #393939; + -webkit-box-shadow: none; + box-shadow: none; + border: 1px solid #555555; + border-width: 0 1px 1px 0; + top: 0; + border-color: #666; + } + .skin-2 .sidebar.responsive-min .nav-list > li > .arrow:after, + .skin-2 .sidebar.responsive-min .nav-list > li.active.highlight > .arrow:after { + border-right-color: #bd5289; + -moz-border-right-colors: #bd5289; + } + .skin-2 .sidebar.responsive-min .nav-list > li > .arrow:before, + .skin-2 .sidebar.responsive-min .nav-list > li.active.highlight > .arrow:before { + border-right-color: #333; + border-right-color: rgba(0, 0, 0, 0.7); + -moz-border-right-colors: rgba(0, 0, 0, 0.7); + } + .skin-2 .sidebar.responsive-min .nav-list > li.active:not(.highlight) > a:not(.dropdown-toggle) > .menu-text { + border-width: 1px; + border-top-color: #555555; + border-bottom-color: #555555; + border-right-color: #555555; + } + .skin-2 .sidebar.responsive-min .nav-list > li > a > .menu-text, + .skin-2 .sidebar.responsive-min .nav-list > li.active.highlight > a > .menu-text { + border-left-color: #333; + border-left-color: rgba(0, 0, 0, 0.5); + } + .skin-2 .sidebar.responsive-min .nav-list > li.pull_up > a > .menu-text, + .skin-2 .sidebar.responsive-min .nav-list > li.pull_up.active.highlight > a > .menu-text { + border-left-color: #222; + border-left-color: rgba(0, 0, 0, 0.7); + } + .skin-2 .sidebar.responsive-min .nav-list > li.pull_up.active:not(.highlight) > a > .menu-text { + border-left-color: #666; + } + .skin-2 .sidebar.responsive-min .nav-list > li:nth-child( 1) > .arrow:after, + .skin-2 .sidebar.responsive-min .nav-list > li.active.highlight:nth-child( 1) > .arrow:after { + border-right-color: #18a665; + -moz-border-right-colors: #18a665; + } + .skin-2 .sidebar.responsive-min .nav-list > li:nth-child( 2) > .arrow:after, + .skin-2 .sidebar.responsive-min .nav-list > li.active.highlight:nth-child( 2) > .arrow:after { + border-right-color: #6ab14a; + -moz-border-right-colors: #6ab14a; + } + .skin-2 .sidebar.responsive-min .nav-list > li:nth-child( 3) > .arrow:after, + .skin-2 .sidebar.responsive-min .nav-list > li.active.highlight:nth-child( 3) > .arrow:after { + border-right-color: #98bc1b; + -moz-border-right-colors: #98bc1b; + } + .skin-2 .sidebar.responsive-min .nav-list > li:nth-child( 4) > .arrow:after, + .skin-2 .sidebar.responsive-min .nav-list > li.active.highlight:nth-child( 4) > .arrow:after { + border-right-color: #b7c51c; + -moz-border-right-colors: #b7c51c; + } + .skin-2 .sidebar.responsive-min .nav-list > li:nth-child( 5) > .arrow:after, + .skin-2 .sidebar.responsive-min .nav-list > li.active.highlight:nth-child( 5) > .arrow:after { + border-right-color: #d9b41f; + -moz-border-right-colors: #d9b41f; + } + .skin-2 .sidebar.responsive-min .nav-list > li:nth-child( 6) > .arrow:after, + .skin-2 .sidebar.responsive-min .nav-list > li.active.highlight:nth-child( 6) > .arrow:after { + border-right-color: #dfa020; + -moz-border-right-colors: #dfa020; + } + .skin-2 .sidebar.responsive-min .nav-list > li:nth-child( 7) > .arrow:after, + .skin-2 .sidebar.responsive-min .nav-list > li.active.highlight:nth-child( 7) > .arrow:after { + border-right-color: #df7220; + -moz-border-right-colors: #df7220; + } + .skin-2 .sidebar.responsive-min .nav-list > li:nth-child( 8) > .arrow:after, + .skin-2 .sidebar.responsive-min .nav-list > li.active.highlight:nth-child( 8) > .arrow:after { + border-right-color: #d43a48; + -moz-border-right-colors: #d43a48; + } + .skin-2 .sidebar.responsive-min .nav-list > li:nth-child( 9) > .arrow:after, + .skin-2 .sidebar.responsive-min .nav-list > li.active.highlight:nth-child( 9) > .arrow:after { + border-right-color: #bd5289; + -moz-border-right-colors: #bd5289; + } + .skin-2 .sidebar.responsive-min .nav-list > li:nth-child( 10) > .arrow:after, + .skin-2 .sidebar.responsive-min .nav-list > li.active.highlight:nth-child( 10) > .arrow:after { + border-right-color: #b975d0; + -moz-border-right-colors: #b975d0; + } + .skin-2 .sidebar.responsive-min .nav-list > li:nth-child( 11) > .arrow:after, + .skin-2 .sidebar.responsive-min .nav-list > li.active.highlight:nth-child( 11) > .arrow:after { + border-right-color: #3f8ad0; + -moz-border-right-colors: #3f8ad0; + } + .skin-2 .sidebar.responsive-min .nav-list > li:nth-child( 12) > .arrow:after, + .skin-2 .sidebar.responsive-min .nav-list > li.active.highlight:nth-child( 12) > .arrow:after { + border-right-color: #4bb9ca; + -moz-border-right-colors: #4bb9ca; + } + .skin-2 .sidebar.responsive-min .nav-list > li.active > a > .menu-text { + border-left-color: #777; + } + .skin-2 .sidebar.responsive-min .nav-list > li.active > .arrow:after { + border-right-color: #242424; + -moz-border-right-colors: #242424; + } + .skin-2 .sidebar.responsive-min .nav-list > li.active > .arrow:before { + border-right-color: #888; + -moz-border-right-colors: #FFF; + } + .skin-2 .sidebar.responsive-min .nav-list > li.active > a:after { + display: block; + } +} +@media only screen and (min-width: 992px) { + .skin-2 .nav-list li.hover > .submenu { + padding-left: 0; + padding-right: 0; + border: 1px solid; + border-color: rgba(0, 0, 0, 0.4); + } + .skin-2 .nav-list li.hover > .submenu > li > a { + margin-bottom: 0; + margin-top: 0; + } + .skin-2 .nav-list li.hover > .submenu > li:first-child > a { + border-top-width: 0; + } + .skin-2 .nav-list li .submenu > li.hover.active > a { + background-color: rgba(0, 0, 0, 0.05); + } + .skin-2 .nav-list > li > .submenu li.hover > .submenu { + padding: 2px; + } + .skin-2 .nav-list > li > .submenu li > .submenu > li.hover > a { + border-top-color: #222; + border-top-color: rgba(255, 255, 255, 0.08); + } + .skin-2 .nav-list > li.active.hover:hover > a.dropdown-toggle:after, + .skin-2 .nav-list > li.active.hover.hover-show > a.dropdown-toggle:after, + .skin-2 .menu-min .nav-list > li.active:hover > a:after, + .skin-2 .menu-min .nav-list > li.active.hover-show > a:after { + display: none; + } +} +@media only screen and (min-width: 992px) { + .skin-2 .sidebar.navbar-collapse .nav-list > li.open.hover:not(:hover):not(:focus):not(.active) > a { + background-color: #393939; + font-weight: normal; + } + .skin-2 .sidebar.navbar-collapse .nav-list > li.open.hover:not(:hover):not(:focus):not(.active) > a > .menu-icon, + .skin-2 .sidebar.navbar-collapse .nav-list > li.open.hover:not(:hover):not(:focus):not(.active) > a > .menu-text, + .skin-2 .sidebar.navbar-collapse .nav-list > li.open.hover:not(:hover):not(:focus):not(.active) > a > .arrow { + color: inherit; + } + .skin-2 .sidebar.navbar-collapse .nav-list > li > .submenu li.open.hover:not(:hover):not(:focus):not(.active) > a { + color: #eeeeee; + } + .skin-2 .sidebar.navbar-collapse .nav-list > li > .submenu > li.open.hover:not(:hover):not(:focus):not(.active) > a > .menu-icon { + display: none; + } +} +@media only screen and (min-width: 992px) { + .skin-2 .sidebar:not(.navbar-collapse) .nav-list > li .submenu > li.hover:hover > a, + .skin-2 .sidebar:not(.navbar-collapse) .nav-list > li .submenu > li.hover.hover-show > a { + background-color: rgba(0, 0, 0, 0.1); + } + .skin-2 .sidebar:not(.navbar-collapse) .nav-list > li.active .submenu > li.hover:hover > a, + .skin-2 .sidebar:not(.navbar-collapse) .nav-list > li.active .submenu > li.hover.hover-show > a { + background-color: rgba(0, 0, 0, 0.1); + } +} +@media only screen and (max-width: 991px) { + .skin-2 .sidebar.navbar-collapse .nav-list > li > .submenu:before, + .skin-2 .sidebar.navbar-collapse .nav-list > li > .submenu > li:before, + .skin-2 .sidebar.navbar-collapse .nav-list > li > .submenu > li > .submenu:before { + display: none; + } + .skin-2 .sidebar.navbar-collapse .nav-list > li:before { + height: 41px !important; + top: 0; + } + .skin-2 .sidebar.navbar-collapse .nav-list > li > .submenu li > .submenu > li > a { + margin-left: 0; + padding-left: 42px; + } + .skin-2 .sidebar.navbar-collapse .nav-list > li > .submenu li > .submenu > li > .submenu > li > a { + margin-left: 0; + padding-left: 58px; + } + .skin-2 .sidebar.navbar-collapse .nav-list > li > a > .menu-text, + .skin-2 .sidebar.navbar-collapse .nav-list > li.active.highlight > a > .menu-text { + border-width: 0; + } +} +@media only screen and (min-width: 992px) and (max-width: 991px) { + .skin-2 .sidebar.navbar-collapse .nav-list > li.hover > .submenu { + padding-bottom: 0; + } + .skin-2 .sidebar.navbar-collapse .nav-list li.hover > .submenu { + border-width: 0; + } + .skin-2 .sidebar.navbar-collapse .nav-list li li.hover:hover > a, + .skin-2 .sidebar.navbar-collapse .nav-list li li.hover.hover-show > a { + background-color: transparent; + } + .skin-2 .sidebar.navbar-collapse .nav-list li li.hover > a:hover { + background-color: rgba(0, 0, 0, 0.1); + } + .skin-2 .sidebar.navbar-collapse .nav-list > li > .submenu > li.active.hover:hover > a, + .skin-2 .sidebar.navbar-collapse .nav-list > li > .submenu > li.active.hover.hover-show > a { + background-color: rgba(0, 0, 0, 0.05); + } + .skin-2 .sidebar.navbar-collapse .nav-list > li > .submenu > li.active.hover > a:hover { + background-color: rgba(0, 0, 0, 0.1); + } + .skin-2 .sidebar.navbar-collapse .nav-list > li > .submenu li.hover > .submenu { + border-left-width: 0t; + padding: 0; + } + .skin-2 .sidebar.navbar-collapse .nav-list > li > .submenu li.hover > .submenu > li > a { + margin-left: 0 !important; + padding-left: 37px !important; + } + .skin-2 .sidebar.navbar-collapse .nav-list > li > .submenu li > .submenu > li > .submenu > li > a { + margin-left: 0 !important; + padding-left: 51px !important; + } + .skin-2 .sidebar.navbar-collapse .nav-list li.hover > .submenu li > a { + padding-left: 32px !important; + } + .skin-2 .sidebar.navbar-collapse .nav-list li.hover > .submenu li > a > .menu-icon { + background-color: transparent; + } + .skin-2 .sidebar.navbar-collapse .nav-list li.hover > .submenu > li.active > a { + background-color: transparent; + font-weight: normal; + } + .skin-2 .sidebar.navbar-collapse .nav-list > li.hover > .submenu > li.active > a { + background-color: rgba(0, 0, 0, 0.05); + font-weight: bold; + } + .skin-2 .sidebar.navbar-collapse .nav-list li.hover > .submenu > li.active > a:hover { + background-color: rgba(0, 0, 0, 0.1); + } + .skin-2 .sidebar.navbar-collapse .nav-list > li > .submenu li > .submenu > li.hover > a { + border-top-width: 0; + } + .skin-2 .sidebar.navbar-collapse .nav-list > li .submenu > li.hover > a > .menu-icon { + left: 12px; + } + .skin-2 .sidebar.navbar-collapse .nav-list > li .submenu > li.hover:hover > a, + .skin-2 .sidebar.navbar-collapse .nav-list > li .submenu > li.hover.hover-show > a { + background-color: rgba(0, 0, 0, 0.1); + } + .skin-2 .sidebar.navbar-collapse .nav-list > li.active .submenu > li.hover:hover > a, + .skin-2 .sidebar.navbar-collapse .nav-list > li.active .submenu > li.hover.hover-show > a { + background-color: rgba(0, 0, 0, 0.1); + } + .skin-2 .sidebar.navbar-collapse.menu-min .nav-list li.hover > .submenu li > a { + padding-left: 32px; + } +} +@media only screen and (max-width: 991px) { + .skin-2 .sidebar.navbar-collapse.menu-min .sidebar-shortcuts-large { + border-width: 0; + } + .skin-2 .sidebar.navbar-collapse.menu-min .nav-list > li > a > .menu-text { + font-weight: normal; + color: #e6e6e6; + margin-left: 0; + } + .skin-2 .sidebar.navbar-collapse.menu-min .nav-list > li:hover > a > .menu-text { + font-weight: bold; + color: rgba(0, 0, 0, 0.6); + } + .skin-2 .sidebar.navbar-collapse.menu-min .nav-list > li.active > a > .menu-text { + font-weight: bold; + color: #ffffff; + } + .skin-2 .sidebar.navbar-collapse.menu-min .nav-list > li > .submenu { + margin-left: 0; + border-top-width: 0; + } + .skin-2 .sidebar.navbar-collapse.menu-min .nav-list > li > .submenu li > a > .menu-icon { + left: 12px; + } +} +@media (min-width: 992px) { + .skin-2 .sidebar.compact .nav-list > li:before { + height: auto; + bottom: 0; + } +} +.skin-2 .main-container .menu-toggler { + background-color: #d685b0; +} +.skin-2 .main-container .menu-toggler:before { + border-top-color: #FFF; + border-bottom-color: #FFF; +} +.skin-2 .main-container .menu-toggler:after { + border-top-color: #FFF; + border-bottom-color: #FFF; +} +.skin-2 .main-container .menu-toggler > .toggler-text { + border-top-color: #d685b0; + -moz-border-top-colors: #d685b0; +} +.skin-2 .navbar .navbar-toggle { + background-color: #DB78A1; +} +.skin-2 .navbar .navbar-toggle:focus { + background-color: #DB78A1; + border-color: transparent; +} +.skin-2 .navbar .navbar-toggle:hover { + background-color: #d76896; + border-color: rgba(255, 255, 255, 0.1); +} +.skin-2 .navbar .navbar-toggle.display, +.skin-2 .navbar .navbar-toggle[data-toggle=collapse]:not(.collapsed) { + background-color: #d2588b; + box-shadow: inset 1px 1px 2px 0 rgba(0, 0, 0, 0.25); + border-color: rgba(255, 255, 255, 0.35); +} +@media only screen and (min-width: 768px) { + .skin-2 .container.main-container:before { + box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1); + } +} +@media only screen and (min-width: 992px) { + .skin-2 .sidebar.h-sidebar { + background-color: #393939; + } + .skin-2 .sidebar.h-sidebar:before { + background-color: #767676; + border-bottom-color: #7b7b7b; + } + .skin-2 .sidebar.h-sidebar .nav-list { + border-bottom-width: 0; + } + .skin-2 .sidebar.h-sidebar .nav-list > li > a > .menu-text { + color: #e6e6e6; + font-weight: normal; + } + .skin-2 .sidebar.h-sidebar .nav-list > li:hover > a > .menu-text, + .skin-2 .sidebar.h-sidebar .nav-list > li.hover-show > a > .menu-text { + color: #ffffff; + font-weight: normal; + } + .skin-2 .sidebar.h-sidebar .nav-list > li.active > a > .menu-text { + font-weight: bold; + color: #ffffff; + } + .skin-2 .sidebar.h-sidebar .nav-list > li:before { + left: 0; + right: 0; + } + .skin-2 .sidebar.h-sidebar .nav-list > li.hover > .submenu { + margin-left: -1px; + border-width: 1px; + border-top-color: rgba(0, 0, 0, 0.4); + } + .skin-2 .sidebar.h-sidebar .nav-list > li .submenu > li.hover > a { + padding-left: 22px; + } + .skin-2 .sidebar.h-sidebar .nav-list > li .submenu > li.hover > a > .menu-icon { + left: 4px; + } + .skin-2 .sidebar.h-sidebar.compact .nav-list > li.active:before { + height: 2px; + bottom: auto; + } + .skin-2 .sidebar.h-sidebar .nav-list > li.highlight.active > a:after { + display: none; + } + .skin-2 .sidebar.h-sidebar .nav-list > li.hover.active > a:after { + display: block; + -moz-border-left-colors: none; + -moz-border-right-colors: none; + -moz-border-bottom-colors: #FFF; + border-color: transparent transparent #FFF; + border-width: 8px; + top: auto; + bottom: 0; + right: auto; + left: 50%; + margin-left: -8px; + } + .skin-2 .sidebar.h-sidebar .nav-list > li.hover.active:hover > a:after, + .skin-2 .sidebar.h-sidebar .nav-list > li.hover.active.hover-show > a:after { + display: none; + } + .skin-2 .sidebar.h-sidebar .sidebar-shortcuts-large { + background-color: #505050; + border-width: 1px 0 0 !important; + border-top: 1px solid #777; + top: 100%; + } + .skin-2 .sidebar.h-sidebar .sidebar-shortcuts-mini { + padding-top: 2px; + } + .skin-2 .sidebar.h-sidebar .sidebar-shortcuts-mini > .btn { + padding: 7px; + } + .skin-2 .sidebar.h-sidebar .nav-list > li.active.highlight > .arrow:after { + border-right-color: transparent; + border-bottom-color: #bd5289; + } + .skin-2 .sidebar.h-sidebar .nav-list > li.active.highlight > .arrow:before { + border-right-color: transparent; + -moz-border-right-colors: none; + border-bottom-color: #191919; + -moz-border-bottom-colors: #191919; + } + .skin-2 .sidebar.h-sidebar .nav-list > li.hover > .arrow:after { + border-right-color: transparent; + -moz-border-right-colors: none; + border-bottom-color: #45303b; + -moz-border-bottom-colors: #45303b; + } + .skin-2 .sidebar.h-sidebar .nav-list > li.hover > .arrow:before { + -moz-border-right-colors: none; + border-right-color: transparent; + border-bottom-color: #191919; + -moz-border-bottom-colors: #191919; + } + .skin-2 .sidebar.h-sidebar .sidebar-shortcuts-large:after { + border-bottom-color: #505050; + } + .skin-2 .sidebar.h-sidebar .sidebar-shortcuts-large:before { + border-bottom-color: #999; + -moz-border-bottom-colors: #999; + } + .skin-2 .sidebar.h-sidebar.menu-min .sidebar-shortcuts-mini { + padding-top: 3px; + } + .skin-2 .sidebar.h-sidebar.menu-min .sidebar-shortcuts-mini > .btn { + padding: 6px; + } + .skin-2 .sidebar.h-sidebar.menu-min .nav-list > li > a > .menu-text { + border-width: 1px 0 0 0; + border-top-color: rgba(0, 0, 0, 0.5); + } + .skin-2 .sidebar.h-sidebar.menu-min .nav-list > li > .arrow:before, + .skin-2 .sidebar.h-sidebar.menu-min .nav-list > li.active.highlight > .arrow:before { + -moz-border-bottom-colors: rgba(0, 0, 0, 0.7); + border-bottom-color: rgba(0, 0, 0, 0.7); + } + .skin-2 .sidebar.h-sidebar.menu-min .nav-list > li:nth-child( 1) > .arrow:after, + .skin-2 .sidebar.h-sidebar.menu-min .nav-list > li.active.highlight:nth-child( 1) > .arrow:after { + border-bottom-color: #18a665; + -moz-border-bottom-colors: #18a665; + } + .skin-2 .sidebar.h-sidebar.menu-min .nav-list > li:nth-child( 2) > .arrow:after, + .skin-2 .sidebar.h-sidebar.menu-min .nav-list > li.active.highlight:nth-child( 2) > .arrow:after { + border-bottom-color: #6ab14a; + -moz-border-bottom-colors: #6ab14a; + } + .skin-2 .sidebar.h-sidebar.menu-min .nav-list > li:nth-child( 3) > .arrow:after, + .skin-2 .sidebar.h-sidebar.menu-min .nav-list > li.active.highlight:nth-child( 3) > .arrow:after { + border-bottom-color: #98bc1b; + -moz-border-bottom-colors: #98bc1b; + } + .skin-2 .sidebar.h-sidebar.menu-min .nav-list > li:nth-child( 4) > .arrow:after, + .skin-2 .sidebar.h-sidebar.menu-min .nav-list > li.active.highlight:nth-child( 4) > .arrow:after { + border-bottom-color: #b7c51c; + -moz-border-bottom-colors: #b7c51c; + } + .skin-2 .sidebar.h-sidebar.menu-min .nav-list > li:nth-child( 5) > .arrow:after, + .skin-2 .sidebar.h-sidebar.menu-min .nav-list > li.active.highlight:nth-child( 5) > .arrow:after { + border-bottom-color: #d9b41f; + -moz-border-bottom-colors: #d9b41f; + } + .skin-2 .sidebar.h-sidebar.menu-min .nav-list > li:nth-child( 6) > .arrow:after, + .skin-2 .sidebar.h-sidebar.menu-min .nav-list > li.active.highlight:nth-child( 6) > .arrow:after { + border-bottom-color: #dfa020; + -moz-border-bottom-colors: #dfa020; + } + .skin-2 .sidebar.h-sidebar.menu-min .nav-list > li:nth-child( 7) > .arrow:after, + .skin-2 .sidebar.h-sidebar.menu-min .nav-list > li.active.highlight:nth-child( 7) > .arrow:after { + border-bottom-color: #df7220; + -moz-border-bottom-colors: #df7220; + } + .skin-2 .sidebar.h-sidebar.menu-min .nav-list > li:nth-child( 8) > .arrow:after, + .skin-2 .sidebar.h-sidebar.menu-min .nav-list > li.active.highlight:nth-child( 8) > .arrow:after { + border-bottom-color: #d43a48; + -moz-border-bottom-colors: #d43a48; + } + .skin-2 .sidebar.h-sidebar.menu-min .nav-list > li:nth-child( 9) > .arrow:after, + .skin-2 .sidebar.h-sidebar.menu-min .nav-list > li.active.highlight:nth-child( 9) > .arrow:after { + border-bottom-color: #bd5289; + -moz-border-bottom-colors: #bd5289; + } + .skin-2 .sidebar.h-sidebar.menu-min .nav-list > li:nth-child( 10) > .arrow:after, + .skin-2 .sidebar.h-sidebar.menu-min .nav-list > li.active.highlight:nth-child( 10) > .arrow:after { + border-bottom-color: #b975d0; + -moz-border-bottom-colors: #b975d0; + } + .skin-2 .sidebar.h-sidebar.menu-min .nav-list > li:nth-child( 11) > .arrow:after, + .skin-2 .sidebar.h-sidebar.menu-min .nav-list > li.active.highlight:nth-child( 11) > .arrow:after { + border-bottom-color: #3f8ad0; + -moz-border-bottom-colors: #3f8ad0; + } + .skin-2 .sidebar.h-sidebar.menu-min .nav-list > li:nth-child( 12) > .arrow:after, + .skin-2 .sidebar.h-sidebar.menu-min .nav-list > li.active.highlight:nth-child( 12) > .arrow:after { + border-bottom-color: #4bb9ca; + -moz-border-bottom-colors: #4bb9ca; + } + .skin-2 .sidebar.h-sidebar.menu-min .nav-list > li.active > .arrow:after { + border-bottom-color: #242424; + -moz-border-bottom-colors: #242424; + } + .skin-2 .sidebar.h-sidebar.menu-min .nav-list > li.active > .arrow:before { + border-bottom-color: #888; + -moz-border-bottom-colors: #FFF; + } + .skin-2 .sidebar.h-sidebar.menu-min .nav-list > li > a > .menu-text, + .skin-2 .sidebar.h-sidebar.menu-min .nav-list > li.active.highlight > a > .menu-text { + border-top-color: #333; + border-top-color: rgba(0, 0, 0, 0.5); + } + .skin-2 .sidebar.h-sidebar.menu-min .nav-list > li.active > a > .menu-text { + border-top-color: #777; + } + .skin-2 .sidebar.h-sidebar + .main-content .breadcrumbs { + border-color: #d5e7f1; + top: 2px; + } + .skin-2 .h-sidebar.sidebar-fixed + .main-content { + padding-top: 86px; + } + .skin-2 .h-sidebar.sidebar-fixed.no-gap + .main-content { + padding-top: 72px; + } + .skin-2 .h-sidebar.sidebar-fixed.menu-min + .main-content { + padding-top: 61px; + } + .skin-2 .h-sidebar.sidebar-fixed.menu-min.no-gap + .main-content { + padding-top: 47px; + } + .skin-2 .main-content .h-sidebar.sidebar .nav-list { + border-left: 1px solid #575757; + } +} +.skin-2 .sidebar-scroll .sidebar-shortcuts { + border-bottom-color: #555555; +} +.skin-2 .sidebar-scroll .sidebar-toggle { + border-top-color: #555555; +} +.skin-2 .scrollout .scroll-track { + background-color: transparent; +} +.skin-2 .scrollout .scroll-bar { + background-color: #CCC; + background-color: rgba(0, 0, 0, 0.2); +} +@media only screen and (min-width: 768px) and (max-width: 991px) { + .skin-2 .navbar.navbar-collapse { + background-color: transparent; + } + .skin-2 .navbar.navbar-collapse:before, + .skin-2 .navbar.navbar-collapse .navbar-container { + background: #c6487e; + } +} +.skin-2 .nav-list > li.disabled:before { + display: none !important; +} +.skin-2 .nav-list > li.disabled > a, +.skin-2 .nav-list > li > a.disabled { + background-color: #555 !important; + color: #CCC !important; +} +.skin-2 .nav-list > li.disabled > a > .menu-text, +.skin-2 .nav-list > li > a.disabled > .menu-text { + color: #CCC !important; +} +.skin-2 .nav-list > li.disabled > a .label, +.skin-2 .nav-list > li > a.disabled .label, +.skin-2 .nav-list > li.disabled > a .badge, +.skin-2 .nav-list > li > a.disabled .badge { + background-color: rgba(0, 0, 0, 0.5) !important; +} +.skin-2 .nav-list > li.active.highlight.disabled > a:after, +.skin-2 .nav-list > li.active.highlight > a.disabled:after { + -moz-border-left-colors: #555 !important; + border-left-color: #555 !important; +} +.skin-2 .nav-list li .submenu > li.disabled > a, +.skin-2 .nav-list li .submenu > li > a.disabled, +.skin-2 .nav-list li.disabled .submenu > li > a, +.skin-2 .nav-list li > a.disabled + .submenu > li > a { + background-color: #666 !important; + color: #DDD !important; + cursor: not-allowed !important; +} +.skin-2 .nav-list li .submenu > li.disabled > a > .menu-icon, +.skin-2 .nav-list li .submenu > li > a.disabled > .menu-icon, +.skin-2 .nav-list li.disabled .submenu > li > a > .menu-icon, +.skin-2 .nav-list li > a.disabled + .submenu > li > a > .menu-icon { + display: none; +} +/* skin 3 */ +.skin-3 { + background-color: #bbbbbb; +} +.skin-3 .main-container:before { + background: #FFF; + background: -moz-linear-gradient(top, #eef5fa 0%, #ffffff 8%) 0 4px; + background: -webkit-gradient(linear, 0 0, 0 100%, from(#eef5fa), color-stop(4%, #ffffff)) 0 4px; + background: -webkit-linear-gradient(top, #eef5fa 0%, #ffffff 8%) 0 4px; + background: -o-linear-gradient(top, #eef5fa 0%, #ffffff 8%) 0 4px; + background: -ms-linear-gradient(top, #eef5fa 0%, #ffffff 8%) 0 4px; + background: linear-gradient(top, #eef5fa 0%, #ffffff 8%) 0 4px; + -moz-background-size: 100% 26px; + -webkit-background-size: 100% 26px; + -o-background-size: 100% 26px; + -ms-background-size: 100% 26px; + background-size: 100% 26px; +} +@media (min-width: 768px) { + .skin-3 .main-container.container:before { + -webkit-box-shadow: 0 0 0 1px rgba(50, 100, 200, 0.1); + box-shadow: 0 0 0 1px rgba(50, 100, 200, 0.1); + } +} +.skin-3 .navbar { + background: #404040; +} +.skin-3 .sidebar { + background-color: #dbdbdb; + border-style: solid; + border-width: 0 1px 0 0; + border-color: #a4c6dd; +} +.skin-3 .nav-list > li { + border-color: #f2f2f2; +} +.skin-3 .nav-list > li > a { + background-color: #e3e3e3; + color: #5a5a5a; +} +.skin-3 .nav-list > li > a > .arrow { + color: inherit; +} +.skin-3 .nav-list > li > a:focus { + background-color: #e8e8e8; + color: #5a5a5a; +} +.skin-3 .nav-list > li:hover { + border-color: #95bad2 !important; +} +.skin-3 .nav-list > li:hover + li { + border-top-color: #95bad2 !important; +} +.skin-3 .nav-list > li.open { + border-color: #95bad2 !important; +} +.skin-3 .nav-list > li.open + li { + border-top-color: #95bad2 !important; +} +.skin-3 .nav-list > li.active { + border-color: #a4c6dd !important; +} +.skin-3 .nav-list > li.active + li { + border-color: #a4c6dd !important; +} +.skin-3 .nav-list > li.active + li:last-child { + border-bottom-color: #f2f2f2 !important; +} +.skin-3 .nav-list > li.active + li:last-child:hover { + border-bottom-color: #95bad2 !important; +} +.skin-3 .nav-list > li:hover > a { + background-color: #ffffff; + color: #337dbb; +} +.skin-3 .nav-list > li.open > a, +.skin-3 .nav-list > li.open:hover > a { + color: #337dbb; + background-color: #f8f8f8; +} +.skin-3 .nav-list > li.open > a > .arrow { + color: inherit; +} +.skin-3 .nav-list > li.active > a, +.skin-3 .nav-list > li.active.highlight > a { + background-color: #f3faff !important; + color: #4d96cb !important; +} +.skin-3 .nav-list > li:hover:before, +.skin-3 .nav-list > li.open:before { + display: block; + background-color: #4f8ab4 !important; +} +.skin-3 .nav-list > li.active:before { + display: block; + background-color: #4D96CB !important; +} +.skin-3 .page-content { + background-color: transparent; +} +.skin-3 .infobox-container .infobox:not(.infobox-dark) { + border-style: solid; + background-color: transparent; +} +.skin-3 .nav-list > li.active:after { + display: none; +} +.skin-3 .nav-list li.active > a:after { + border-right-color: #FFF; + -moz-border-right-colors: #FFF; + border-width: 12px 8px; + top: 7px; + right: -1px; +} +.skin-3 .nav-list li.active > a:before { + display: block; + content: ""; + position: absolute; + background-color: transparent; + border-style: solid; + border-color: transparent; + border-right-color: #91bad6; + -moz-border-right-colors: #91bad6; + right: 0; + border-width: 12px 8px; + top: 7px; +} +.skin-3 .nav-list > li.active > .submenu li.active > a:before, +.skin-3 .nav-list > li.active > .submenu li.active > a:after { + top: 4px; +} +.skin-3 .nav-list li.active.open > a:before { + display: none; +} +.skin-3 .nav-list li.highlight.active.open > a:before { + display: block; +} +.skin-3 .nav-list li.active:not(.open) li.active > a:before { + display: none !important; +} +.skin-3 .nav-list > li.highlight.active > a:after { + border-left-color: #f3faff; + -moz-border-left-colors: #f3faff; +} +.skin-3 .nav-list > li.highlight.active > a:before { + border-left-color: #91bad6; + -moz-border-left-colors: #91bad6; +} +.skin-3 .nav-list li > .arrow:before { + border-right-color: #7fafcf; + -moz-border-right-colors: #7fafcf; +} +.skin-3 .nav-list > li .submenu > li.active:not(.open) > a { + background-color: #f5f7fa; +} +.skin-3 .nav-list > li .submenu > li.active:not(.open) > a:hover { + background-color: #f1f5f9; +} +@media only screen and (max-width: 991px) { + .skin-3 .sidebar.responsive .nav-list > li.active.open > a:after { + display: none; + } +} +@media only screen and (min-width: 992px) { + .skin-3 .nav-list li.hover > .submenu { + border-color: #99bfd9; + } +} +@media only screen and (min-width: 992px) { + .skin-3 .nav-list li.hover.active > a:before { + display: block; + } + .skin-3 .nav-list li.hover .submenu > li.active > a:before { + display: none ; + } +} +.skin-3 .sidebar.menu-min .nav-list > li > a > .menu-text { + background-color: #f1f5f9; + border-color: #A4C6DD; +} +.skin-3 .sidebar.menu-min .nav-list > li.active > a > .menu-text { + background-color: #EDF3F7; +} +.skin-3 .sidebar.menu-min .nav-list > li > .submenu { + border-color: #A4C6DD; + border-top-color: #C9DAE5; +} +.skin-3 .sidebar.menu-min .nav-list > li.active > .arrow:before { + border-right-color: #709FBF; + -moz-border-right-colors: #709FBF; +} +.skin-3 .sidebar.menu-min .nav-list > li > .arrow:after { + border-right-color: #EDF3F7; + -moz-border-right-colors: #EDF3F7; +} +.skin-3 .sidebar.menu-min .nav-list li.active > a:after, +.skin-3 .sidebar.menu-min .nav-list li.active > a:before { + display: none; +} +.skin-3 .sidebar.menu-min .nav-list > li.active > a:after, +.skin-3 .sidebar.menu-min .nav-list > li.active > a:before { + display: block; + border-width: 9px 7px; + top: 10px; +} +.skin-3 .sidebar.menu-min .nav-list > li.active.highlight > a:after, +.skin-3 .sidebar.menu-min .nav-list > li.active.highlight > a:before { + border-width: 20px 0 21px 10px; + top: -1px; +} +.skin-3 .sidebar.menu-min .nav-list > li.active:hover > a:after, +.skin-3 .sidebar.menu-min .nav-list > li.active.hover-show > a:after, +.skin-3 .sidebar.menu-min .nav-list > li.active:hover > a:before, +.skin-3 .sidebar.menu-min .nav-list > li.active.hover-show > a:before { + display: none; +} +.skin-3 .sidebar.menu-min .sidebar-shortcuts-large { + background-color: #F5F5F5; +} +@media only screen and (max-width: 991px) { + .skin-3 .sidebar.menu-min.responsive .nav-list > li.active > a:after, + .skin-3 .sidebar.menu-min.responsive .nav-list > li.active > a:before { + display: none; + } +} +@media only screen and (max-width: 991px) { + .skin-3 .sidebar.responsive { + border-bottom-width: 1px !important; + } + .skin-3 .sidebar.responsive .nav-list > li.active.open > a:after { + display: none; + } + .skin-3 .sidebar.responsive .nav-list > li.active.highlight > a:after, + .skin-3 .sidebar.responsive .nav-list > li.active.highlight > a:before { + display: block; + } + .skin-3 .sidebar.navbar-collapse { + border-bottom-color: #A4C6DD; + } + .skin-3 .nav-list li.active > a:after, + .skin-3 .nav-list li.active > a:before { + display: none; + } + .skin-3 .sidebar.responsive-min .nav-list > li > a > .menu-text { + background-color: #f1f5f9; + border-color: #A4C6DD; + } + .skin-3 .sidebar.responsive-min .nav-list > li.active > a > .menu-text { + background-color: #EDF3F7; + } + .skin-3 .sidebar.responsive-min .nav-list > li > .submenu { + border-color: #A4C6DD; + border-top-color: #C9DAE5; + } + .skin-3 .sidebar.responsive-min .nav-list > li.active > .arrow:before { + border-right-color: #709FBF; + -moz-border-right-colors: #709FBF; + } + .skin-3 .sidebar.responsive-min .nav-list > li > .arrow:after { + border-right-color: #EDF3F7; + -moz-border-right-colors: #EDF3F7; + } + .skin-3 .sidebar.responsive-min .nav-list li.active > a:after, + .skin-3 .sidebar.responsive-min .nav-list li.active > a:before { + display: none; + } + .skin-3 .sidebar.responsive-min .nav-list > li.active > a:after, + .skin-3 .sidebar.responsive-min .nav-list > li.active > a:before { + display: block; + border-width: 9px 7px; + top: 10px; + } + .skin-3 .sidebar.responsive-min .nav-list > li.active.highlight > a:after, + .skin-3 .sidebar.responsive-min .nav-list > li.active.highlight > a:before { + border-width: 20px 0 21px 10px; + top: -1px; + } + .skin-3 .sidebar.responsive-min .nav-list > li.active:hover > a:after, + .skin-3 .sidebar.responsive-min .nav-list > li.active.hover-show > a:after, + .skin-3 .sidebar.responsive-min .nav-list > li.active:hover > a:before, + .skin-3 .sidebar.responsive-min .nav-list > li.active.hover-show > a:before { + display: none; + } + .skin-3 .sidebar.responsive-min .sidebar-shortcuts-large { + background-color: #F5F5F5; + } + .skin-3 .sidebar.responsive-max { + border-width: 0 1px 1px 0; + } + .skin-3 .sidebar.responsive-max .nav-list li.hover.active > a:before { + display: none; + } + .skin-3 .sidebar.responsive-max .nav-list > li.active.open > a:after { + display: none; + } + .skin-3 .sidebar.responsive-max .nav-list > li.active.highlight > a:after, + .skin-3 .sidebar.responsive-max .nav-list > li.active.highlight > a:before { + display: block; + } + .skin-3 .sidebar.navbar-collapse .sidebar-shortcuts-large { + background-color: transparent; + } +} +.skin-3 .sidebar-shortcuts, +.skin-3 .sidebar-shortcuts-mini { + background-color: #dbdbdb; +} +.skin-3 .sidebar-shortcuts-large > .btn:focus { + outline: none; +} +.skin-3 .sidebar > .nav-search { + background-color: #dbdbdb; +} +.skin-3 .sidebar-toggle { + background-color: #d0d0d0; + border-color: #f2f2f2; +} +.skin-3 .sidebar-toggle:before { + border-color: #f2f2f2; +} +.skin-3 .sidebar-toggle > .ace-icon { + background-color: #ffffff; + background-color: #FFF; + border-color: #999; + color: #999; +} +.skin-3 .sidebar-scroll .nav-wrap-up + .sidebar-toggle:after { + display: block; + content: ""; + position: absolute; + top: 0; + bottom: 0; + right: -1px; + border-right: 1px solid #a4c6dd; +} +@media only screen and (max-width: 991px) { + .skin-3 .sidebar.navbar-collapse .nav-list > li:before { + height: 43px !important; + } + .skin-3 .sidebar.navbar-collapse .sidebar-shortcuts { + padding: 0 0 3px !important; + } +} +@media only screen and (min-width: 992px) { + .skin-3 .nav-list > li.active.hover:hover > a.dropdown-toggle:after, + .skin-3 .nav-list > li.active.hover.hover-show > a.dropdown-toggle:after, + .skin-3 .nav-list > li.active.hover:hover > a.dropdown-toggle:before, + .skin-3 .nav-list > li.active.hover.hover-show > a.dropdown-toggle:before { + display: none; + } +} +.skin-3 .main-container .menu-toggler { + background-color: #62A8D1; + color: #FFF; +} +.skin-3 .main-container .menu-toggler:before, +.skin-3 .main-container .menu-toggler:after { + border-color: #FFF; +} +.skin-3 .main-container .menu-toggler > .toggler-text { + border-top-color: #62A8D1; + -moz-border-top-colors: #62A8D1; +} +.skin-3 .main-container .menu-toggler > .toggler-text:after { + color: #FFF; +} +.skin-3 .navbar .navbar-toggle { + border-color: rgba(255, 255, 255, 0.15); + transition: background-color 0.1s ease 0s; + background-color: #648CAE; +} +.skin-3 .navbar .navbar-toggle:focus { + background-color: #648CAE; + border-color: rgba(255, 255, 255, 0.15); +} +.skin-3 .navbar .navbar-toggle:hover { + background-color: #5782a7; + border-color: rgba(255, 255, 255, 0.15); +} +.skin-3 .navbar .navbar-toggle.display, +.skin-3 .navbar .navbar-toggle[data-toggle=collapse]:not(.collapsed) { + background-color: #507899; + border-color: rgba(255, 255, 255, 0.3); +} +.skin-3 .breadcrumbs { + border-width: 0; + background-color: #e7f2f8; + border-radius: 4px; + margin: 8px 8px 0; +} +@media only screen and (max-width: 991px) { + .skin-3 .breadcrumbs { + margin: 5px 5px 0; + } + .skin-3 .menu-toggler + .sidebar.responsive + .main-content .breadcrumbs { + margin: 0; + border-radius: 0; + } +} +@media (min-width: 992px) { + .skin-3 .breadcrumbs.breadcrumbs-fixed + .page-content { + padding-top: 57px; + } +} +@media (min-width: 992px) and (max-width: 991px) { + .skin-3 .breadcrumbs.breadcrumbs-fixed + .page-content { + padding-top: 54px; + } + .skin-3 .menu-toggler + .sidebar.reponsive + .main-content .breadcrumbs.breadcrumbs-fixed + .page-content { + padding-top: 49px; + } +} +@media (min-width: 992px) and (max-width: 991px) { + .skin-3 .container.main-container .sidebar.compact + .main-content .breadcrumbs-fixed { + width: 734px; + } +} +@media (min-width: 992px) and (max-width: 991px) { + .skin-3 .container.main-container .breadcrumbs-fixed { + width: 734px; + } + .skin-3 .container.main-container .sidebar.menu-min + .main-content .breadcrumbs-fixed { + width: 734px; + } + .skin-3 .container.main-container .sidebar.responsive-min + .main-content .breadcrumbs-fixed { + width: 691px; + } +} +@media (min-width: 992px) { + .skin-3 .container.main-container .sidebar.compact + .main-content .breadcrumbs-fixed { + width: 843px; + } +} +@media (min-width: 992px) { + .skin-3 .container.main-container .breadcrumbs-fixed { + width: 964px; + } + .skin-3 .container.main-container .sidebar + .main-content .breadcrumbs-fixed { + width: 758px; + } + .skin-3 .container.main-container .sidebar.menu-min + .main-content .breadcrumbs-fixed { + width: 905px; + } +} +@media (min-width: 1200px) { + .skin-3 .container.main-container .sidebar.compact + .main-content .breadcrumbs-fixed { + width: 1043px; + } +} +@media (min-width: 1200px) { + .skin-3 .container.main-container .breadcrumbs-fixed { + width: 1148px; + } + .skin-3 .container.main-container .sidebar + .main-content .breadcrumbs-fixed { + width: 958px; + } + .skin-3 .container.main-container .sidebar.menu-min + .main-content .breadcrumbs-fixed { + width: 1105px; + } +} +@media only screen and (max-width: 991px) { + .skin-3 .nav-list li.active > a:before, + .skin-3 .nav-list li.active > a:after { + display: none; + } +} +.skin-3 .sidebar-shortcuts-large > .btn { + line-height: 26px; + border-width: 1px; +} +.skin-3 .sidebar-shortcuts-mini { + padding-top: 3px; + padding-bottom: 3px; + padding-left: 1px; +} +.skin-3 .sidebar-shortcuts-mini > .btn { + border-width: 1px; + opacity: 1; + padding: 7px; + margin: 1px 1px 0 0; +} +@media only screen and (min-width: 992px) { + .skin-3 .sidebar.h-sidebar { + background-color: #e3e3e3; + } + .skin-3 .sidebar.h-sidebar:before { + background-color: #CBD0D6; + border-bottom-width: 0; + } + .skin-3 .sidebar.h-sidebar .sidebar-shortcuts-mini > .btn { + padding: 8px; + } + .skin-3 .sidebar.h-sidebar .sidebar-shortcuts-large { + background-color: #FFF; + line-height: 36px; + } + .skin-3 .sidebar.h-sidebar + .main-content .breadcrumbs { + border-color: #d5e7f1; + top: 2px; + } + .skin-3 .sidebar.h-sidebar .nav-list > li.hover > .submenu { + border-color: #A4C6DD; + } + .skin-3 .sidebar.h-sidebar .nav-list > li { + border-color: #f2f2f2; + } + .skin-3 .sidebar.h-sidebar .nav-list > li:hover, + .skin-3 .sidebar.h-sidebar .nav-list > li:hover + li { + border-left-color: #95bad2; + } + .skin-3 .sidebar.h-sidebar .nav-list > li:last-child:hover { + border-right-color: #95bad2; + } + .skin-3 .sidebar.h-sidebar .nav-list > li.active, + .skin-3 .sidebar.h-sidebar .nav-list > li.active + li, + .skin-3 .sidebar.h-sidebar .nav-list > li:hover + li.active { + border-left-color: #a4c6dd; + } + .skin-3 .sidebar.h-sidebar .nav-list > li.active:last-child { + border-right-color: #a4c6dd; + } + .skin-3 .sidebar.h-sidebar .nav-list > li.active > a:after { + left: 0; + top: auto; + right: auto; + bottom: -2px; + left: 50%; + margin-left: -7px; + border-color: transparent; + -moz-border-right-colors: none; + border-width: 8px 7px !important; + border-bottom-color: #FFF; + -moz-border-bottom-colors: #FFF; + } + .skin-3 .sidebar.h-sidebar .nav-list > li.active > a:before { + display: block; + left: 0; + top: auto; + right: auto; + bottom: -1px; + left: 50%; + margin-left: -8px !important; + border-width: 8px !important; + border-color: transparent; + -moz-border-right-colors: none; + border-bottom-color: #74add7; + -moz-border-bottom-colors: #74add7; + } + .skin-3 .sidebar.h-sidebar .nav-list > li.hover > .arrow:before { + -moz-border-right-colors: none; + border-right-color: transparent; + border-bottom-color: #7fafcf; + -moz-border-bottom-colors: #7fafcf; + } + .skin-3 .sidebar.h-sidebar.menu-min .sidebar-shortcuts { + max-width: 52px; + padding-left: 2px; + padding-right: 2px; + } + .skin-3 .sidebar.h-sidebar.menu-min .sidebar-shortcuts-mini > .btn { + padding: 7px; + } + .skin-3 .sidebar.h-sidebar.menu-min .nav-list > li.hover > .submenu { + border-top-color: #C9DAE5; + } + .skin-3 .sidebar.h-sidebar.menu-min .nav-list > li.active > a > .menu-text { + border-left-color: #A4C6DD; + } + .skin-3 .sidebar.h-sidebar.menu-min .nav-list > li > .arrow:after { + -moz-border-bottom-colors: #EDF3F7; + border-bottom-color: #EDF3F7; + } +} +.skin-3 .sidebar-scroll .sidebar-shortcuts { + border-bottom-color: 1px solid #99B6C9; +} +.skin-3 .sidebar-scroll .sidebar-toggle { + border-top-color: #99B6C9; +} +@media only screen and (min-width: 768px) and (max-width: 991px) { + .skin-3 .navbar.navbar-collapse { + background-color: transparent; + } + .skin-3 .navbar.navbar-collapse:before, + .skin-3 .navbar.navbar-collapse .navbar-container { + background: #404040; + } +} +.skin-3 .nav-list > li.disabled:before { + display: none !important; +} diff --git a/food-open/food-open-web/src/main/resources/static/assets/css/ace.css b/food-open/food-open-web/src/main/resources/static/assets/css/ace.css new file mode 100644 index 0000000..3e0ee95 --- /dev/null +++ b/food-open/food-open-web/src/main/resources/static/assets/css/ace.css @@ -0,0 +1,19906 @@ +html { + min-height: 100%; + position: relative; +} +body { + background-color: #e4e6e9; + min-height: 100%; + padding-bottom: 0; + font-family: 'Open Sans'; + font-size: 13px; + color: #393939; + line-height: 1.5; +} +.main-container:before { + display: block; + content: ""; + position: absolute; + z-index: -2; + width: 100%; + max-width: inherit; + bottom: 0; + top: 0; + background-color: #FFF; +} +.main-container.container, +.rtl .main-container.container { + padding-left: 0; + padding-right: 0; +} +.main-container.container:before { + -webkit-box-shadow: 0 0 0 1px rgba(0,0,0,0.1); + box-shadow: 0 0 0 1px rgba(0,0,0,0.1); + width: inherit; +} +@media (max-width: 767px) { + .main-container.container:before { + -webkit-box-shadow: none; + box-shadow: none; + width: 100%; + } +} +.main-content { + margin-left: 0; + min-height: 100%; + padding: 0; +} +.main-content:before, +.main-content:after { + content: " "; + display: table; +} +.main-content:after { + clear: both; +} +.sidebar + .main-content { + margin-left: 190px; +} +.page-content { + background-color: #ffffff; + position: relative; + margin: 0; + padding: 8px 20px 24px; +} +.page-header { + margin: 0 0 12px; + border-bottom: 1px dotted #e2e2e2; + padding-bottom: 16px; + padding-top: 7px; +} +.page-header h1 { + padding: 0; + margin: 0 8px; + font-size: 24px; + font-weight: lighter; + color: #2679b5; +} +.page-header h1 small { + margin: 0 6px; + font-size: 14px; + font-weight: normal; + color: #8089a0; +} +.ajax-loading-overlay { + position: absolute; + z-index: 1999; + left: 0; + right: 0; + top: 0; + bottom: 0; + background-color: rgba(255, 255, 255, 0.5); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#80FFFFFF', endColorstr='#80FFFFFF',GradientType=0 ); +} +.ajax-loading-overlay > .ajax-loading-icon { + position: relative; + left: 8px; + top: 8px; +} +.ajax-loading-overlay.content-loaded { + background-color: rgba(255, 255, 255, 0.4); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#66FFFFFF', endColorstr='#66FFFFFF',GradientType=0 ); +} +.ajax-loading-overlay.almost-loaded { + background-color: rgba(255, 255, 255, 0.3); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4CFFFFFF', endColorstr='#4CFFFFFF',GradientType=0 ); +} +.ajax-loading-overlay.ajax-overlay-body { + position: fixed; + z-index: 2999; +} +.ajax-loading-overlay.ajax-overlay-body > .ajax-loading-icon { + left: 8px; + top: 8px; +} +.ace-icon { + text-align: center; +} +a:focus, +a:active { + text-decoration: none; +} +h1 { + font-size: 32px; + font-weight: normal; + font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; +} +h1.smaller { + font-size: 31px; +} +h1.bigger { + font-size: 33px; +} +h1.block { + margin-bottom: 16px; +} +h2 { + font-size: 26px; + font-weight: normal; + font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; +} +h2.smaller { + font-size: 25px; +} +h2.bigger { + font-size: 27px; +} +h2.block { + margin-bottom: 16px; +} +h3 { + font-size: 22px; + font-weight: normal; + font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; +} +h3.smaller { + font-size: 21px; +} +h3.bigger { + font-size: 23px; +} +h3.block { + margin-bottom: 16px; +} +h4 { + font-size: 18px; + font-weight: normal; + font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; +} +h4.smaller { + font-size: 17px; +} +h4.bigger { + font-size: 19px; +} +h4.block { + margin-bottom: 16px; +} +h5 { + font-size: 15px; + font-weight: normal; + font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; +} +h5.smaller { + font-size: 14px; +} +h5.bigger { + font-size: 16px; +} +h5.block { + margin-bottom: 16px; +} +h6 { + font-size: 13px; + font-weight: normal; + font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; +} +h6.smaller { + font-size: 12px; +} +h6.bigger { + font-size: 14px; +} +h6.block { + margin-bottom: 16px; +} +ul, +ol { + margin-top: 0; + margin-bottom: 10px; + margin-right: 0; + margin-left: 25px; + padding: 0; +} +ul.margin-5, +ol.margin-5 { + margin-left: 5px; +} +ul.margin-10, +ol.margin-10 { + margin-left: 10px; +} +ul.margin-15, +ol.margin-15 { + margin-left: 15px; +} +ul.margin-20, +ol.margin-20 { + margin-left: 20px; +} +li > ul, +li > ol { + margin-left: 18px; +} +.list-unstyled, +.list-inline { + margin-left: 0; +} +.list-unstyled > li > .ace-icon:first-child, +.list-inline > li > .ace-icon:first-child { + width: 18px; + text-align: center; +} +.spaced > li { + margin-top: 9px; + margin-bottom: 9px; +} +.spaced2 > li { + margin-top: 15px; + margin-bottom: 15px; +} +li.divider { + margin-top: 3px; + margin-bottom: 3px; + height: 0; + font-size: 0; +} +.spaced > li.divider { + margin-top: 5px; + margin-bottom: 5px; +} +.spaced2 > li.divider { + margin-top: 8px; + margin-bottom: 8px; +} +li.divider:before { + content: ""; + display: inline-block; +} +blockquote, +blockquote.pull-right, +.blockquote-reverse { + border-color: #e5eaf1; +} +pre.prettyprint { + white-space: pre-wrap; +} +.well { + border-radius: 0; +} +.well h1, +.well h2, +.well h3, +.well h4, +.well h5, +.well h6 { + margin-top: 0; +} +.well h1, +.well h2, +.well h3 { + line-height: 36px; +} +.alert { + font-size: 14px; + border-radius: 0; +} +.alert .close { + font-size: 16px; +} +.alert-block p + p { + margin-top: 10px; +} +.pagination > li > span, +.pager > li > span { + border-width: 1px; + border-radius: 0 !important; +} +.pagination > li > a, +.pager > li > a { + border-width: 1px; + border-color: #d4dfe3; + border-radius: 0 !important; + color: #2283c5; + background-color: #fafafa; + margin: 0 -1px 0 0; + position: relative; + z-index: auto; +} +.pagination > li > a:hover, +.pager > li > a:hover { + color: #1c6ca2; + background-color: #eaeff2; + border-color: #c1d1d7; + z-index: 1; +} +.pagination > li > a:focus, +.pager > li > a:focus { + background-color: #eaeef2; +} +.pagination > li.disabled > a, +.pager > li.disabled > a, +.pagination > li.disabled > a:hover, +.pager > li.disabled > a:hover { + background-color: #f9f9f9; + border-color: #d9d9d9; + z-index: auto; +} +.pagination > li.active > a, +.pagination > li.active > a:hover { + background-color: #6faed9; + border-color: #6faed9; + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + z-index: 2; +} +.list-group { + margin-left: auto; +} +.list-group-item { + border-radius: 0 !important; +} +.lighter { + font-weight: lighter; +} +.bolder { + font-weight: bolder; +} +.inline { + display: inline-block !important; +} +.block { + display: block !important; +} +.center, +.align-center { + text-align: center !important; +} +.align-left { + text-align: left !important; +} +.align-right { + text-align: right !important; +} +.middle { + vertical-align: middle; +} +.align-middle { + vertical-align: middle !important; +} +.align-top { + vertical-align: top !important; +} +.align-bottom { + vertical-align: bottom !important; +} +.position-relative, +.pos-rel { + position: relative; +} +.position-absolute, +.pos-abs { + position: absolute; +} +.no-float { + float: none !important; +} +.line-height-normal { + line-height: normal !important; +} +.line-height-0 { + line-height: 0 !important; +} +.line-height-1 { + line-height: 1 !important; +} +.line-height-125 { + line-height: 1.25 !important; +} +.line-height-150 { + line-height: 1.5 !important; +} +.dark { + color: #333333 !important; +} +.white { + color: #ffffff !important; +} +.red { + color: #dd5a43 !important; +} +.red2 { + color: #e08374 !important; +} +.light-red { + color: #ff7777 !important; +} +.blue { + color: #478fca !important; +} +.light-blue { + color: #93cbf9 !important; +} +.green { + color: #69aa46 !important; +} +.light-green { + color: #b0d877 !important; +} +.orange { + color: #ff892a !important; +} +.orange2 { + color: #feb902 !important; +} +.light-orange { + color: #fcac6f !important; +} +.purple { + color: #a069c3 !important; +} +.pink { + color: #c6699f !important; +} +.pink2 { + color: #d6487e !important; +} +.brown { + color: #a52a2a !important; +} +.grey { + color: #777777 !important; +} +.light-grey { + color: #bbbbbb !important; +} +.bigger-110 { + font-size: 110% !important; +} +.bigger-120 { + font-size: 120% !important; +} +.bigger-130 { + font-size: 130% !important; +} +.bigger-140 { + font-size: 140% !important; +} +.bigger-150 { + font-size: 150% !important; +} +.bigger-160 { + font-size: 160% !important; +} +.bigger-170 { + font-size: 170% !important; +} +.bigger-180 { + font-size: 180% !important; +} +.bigger-190 { + font-size: 190% !important; +} +.bigger-200 { + font-size: 200% !important; +} +.bigger-210 { + font-size: 210% !important; +} +.bigger-220 { + font-size: 220% !important; +} +.bigger-230 { + font-size: 230% !important; +} +.bigger-240 { + font-size: 240% !important; +} +.bigger-250 { + font-size: 250% !important; +} +.bigger-260 { + font-size: 260% !important; +} +.bigger-270 { + font-size: 270% !important; +} +.bigger-280 { + font-size: 280% !important; +} +.bigger-290 { + font-size: 290% !important; +} +.bigger-300 { + font-size: 300% !important; +} +.bigger-115 { + font-size: 115% !important; +} +.bigger-125 { + font-size: 125% !important; +} +.bigger-175 { + font-size: 175% !important; +} +.bigger-225 { + font-size: 225% !important; +} +.bigger-275 { + font-size: 275% !important; +} +.smaller-90 { + font-size: 90% !important; +} +.smaller-80 { + font-size: 80% !important; +} +.smaller-70 { + font-size: 70% !important; +} +.smaller-60 { + font-size: 60% !important; +} +.smaller-50 { + font-size: 50% !important; +} +.smaller-40 { + font-size: 40% !important; +} +.smaller-30 { + font-size: 30% !important; +} +.smaller-20 { + font-size: 20% !important; +} +.smaller-75 { + font-size: 75% !important; +} +.width-20 { + width: 20% !important; +} +.width-25 { + width: 25% !important; +} +.width-30 { + width: 30% !important; +} +.width-35 { + width: 35% !important; +} +.width-40 { + width: 40% !important; +} +.width-45 { + width: 45% !important; +} +.width-50 { + width: 50% !important; +} +.width-55 { + width: 55% !important; +} +.width-60 { + width: 60% !important; +} +.width-65 { + width: 65% !important; +} +.width-70 { + width: 70% !important; +} +.width-75 { + width: 75% !important; +} +.width-80 { + width: 80% !important; +} +.width-85 { + width: 85% !important; +} +.width-90 { + width: 90% !important; +} +.width-95 { + width: 95% !important; +} +.width-100 { + width: 100% !important; +} +.width-75 { + width: 75% !important; +} +.width-25 { + width: 25% !important; +} +.width-auto { + width: auto !important; +} +.height-auto { + height: auto !important; +} +.no-padding { + padding: 0 !important; +} +.no-padding-bottom { + padding-bottom: 0 !important; +} +.no-padding-top { + padding-top: 0 !important; +} +.no-padding-left { + padding-left: 0 !important; +} +.no-padding-right { + padding-right: 0 !important; +} +.no-margin { + margin: 0 !important; +} +.no-margin-bottom { + margin-bottom: 0 !important; +} +.no-margin-top { + margin-top: 0 !important; +} +.no-margin-left { + margin-left: 0 !important; +} +.no-margin-right { + margin-right: 0 !important; +} +.no-border { + border-width: 0; +} +.no-border-bottom { + border-bottom-width: 0; +} +.no-border-top { + border-top-width: 0; +} +.no-border-left { + border-left-width: 0; +} +.no-border-right { + border-right-width: 0; +} +/** +.no-underline { + text-decoration: none !important; +} +.no-hover-underline:hover { + text-decoration: none !important; +} +.no-outline:focus { + outline: none !important; +} + +.no-box-shadow { + .box-shadow(none) !important; +} + +.overflow-auto {overflow: auto !important;} +.overflow-visible {overflow: visible !important;} +*/ +.overflow-hidden { + overflow: hidden !important; +} +.overflow-scroll { + overflow-x: hidden !important; + overflow-y: scroll !important; +} +.no-radius { + border-radius: 0 !important; +} +.no-text-shadow { + text-shadow: none !important; +} +.hr { + display: block; + height: 0; + overflow: hidden; + font-size: 0; + border-width: 1px 0 0 0; + border-top: 1px solid #E3E3E3; + margin: 12px 0; + border-top-color: rgba(0, 0, 0, 0.11); +} +.hr-double { + height: 3px; + border-top: 1px solid #E3E3E3; + border-bottom: 1px solid #E3E3E3; + border-top-color: rgba(0, 0, 0, 0.11); + border-bottom-color: rgba(0, 0, 0, 0.11); +} +.hr.dotted, +.hr-dotted { + border-style: dotted; +} +.hr-32, +.hr32 { + margin: 32px 0; +} +.hr-30, +.hr30 { + margin: 30px 0; +} +.hr-28, +.hr28 { + margin: 28px 0; +} +.hr-26, +.hr26 { + margin: 26px 0; +} +.hr-24, +.hr24 { + margin: 24px 0; +} +.hr-22, +.hr22 { + margin: 22px 0; +} +.hr-20, +.hr20 { + margin: 20px 0; +} +.hr-18, +.hr18 { + margin: 18px 0; +} +.hr-16, +.hr16 { + margin: 16px 0; +} +.hr-14, +.hr14 { + margin: 14px 0; +} +.hr-12, +.hr12 { + margin: 12px 0; +} +.hr-10, +.hr10 { + margin: 10px 0; +} +.hr-8, +.hr8 { + margin: 8px 0; +} +.hr-6, +.hr6 { + margin: 6px 0; +} +.hr-4, +.hr4 { + margin: 4px 0; +} +.hr-2, +.hr2 { + margin: 2px 0; +} +.space { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; +} +[class*="vspace-"] { + display: none; +} +.space-32 { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; + margin: 32px 0 31px; +} +[class*="vspace-32"] { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; + margin: 32px 0 31px 0; +} +.space-30 { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; + margin: 30px 0 29px; +} +[class*="vspace-30"] { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; + margin: 30px 0 29px 0; +} +.space-28 { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; + margin: 28px 0 27px; +} +[class*="vspace-28"] { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; + margin: 28px 0 27px 0; +} +.space-26 { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; + margin: 26px 0 25px; +} +[class*="vspace-26"] { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; + margin: 26px 0 25px 0; +} +.space-24 { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; + margin: 24px 0 23px; +} +[class*="vspace-24"] { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; + margin: 24px 0 23px 0; +} +.space-22 { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; + margin: 22px 0 21px; +} +[class*="vspace-22"] { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; + margin: 22px 0 21px 0; +} +.space-20 { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; + margin: 20px 0 19px; +} +[class*="vspace-20"] { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; + margin: 20px 0 19px 0; +} +.space-18 { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; + margin: 18px 0 17px; +} +[class*="vspace-18"] { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; + margin: 18px 0 17px 0; +} +.space-16 { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; + margin: 16px 0 15px; +} +[class*="vspace-16"] { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; + margin: 16px 0 15px 0; +} +.space-14 { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; + margin: 14px 0 13px; +} +[class*="vspace-14"] { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; + margin: 14px 0 13px 0; +} +.space-12 { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; + margin: 12px 0 11px; +} +[class*="vspace-12"] { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; + margin: 12px 0 11px 0; +} +.space-10 { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; + margin: 10px 0 9px; +} +[class*="vspace-10"] { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; + margin: 10px 0 9px 0; +} +.space-8 { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; + margin: 8px 0 7px; +} +[class*="vspace-8"] { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; + margin: 8px 0 7px 0; +} +.space-6 { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; + margin: 6px 0 5px; +} +[class*="vspace-6"] { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; + margin: 6px 0 5px 0; +} +.space-4 { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; + margin: 4px 0 3px; +} +[class*="vspace-4"] { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; + margin: 4px 0 3px 0; +} +.space-2 { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; + margin: 2px 0 1px; +} +[class*="vspace-2"] { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; + margin: 2px 0 1px 0; +} +.space-0, +[class*="vspace-0"] { + max-height: 1px; + min-height: 1px; + overflow: hidden; + margin: 12px 0; + margin: 0; +} +@media only screen and (max-width: 479px) { + [class*="vspace-"][class*="-xs"] { + display: block; + } +} +@media only screen and (max-width: 767px) { + [class*="vspace-"][class*="-sm"] { + display: block; + } +} +@media only screen and (max-width: 991px) { + [class*="vspace-"][class*="-md"] { + display: block; + } +} +@media only screen and (max-width: 1199px) { + [class*="vspace-"][class*="-lg"] { + display: block; + } +} +.header { + line-height: 28px; + margin-bottom: 16px; + margin-top: 18px; + padding-bottom: 4px; + border-bottom: 1px solid #CCC; +} +.header.blue { + border-bottom-color: #d5e3ef; +} +.header.green { + border-bottom-color: #cce2c1; +} +.header.purple { + border-bottom-color: #e0d1ea; +} +.header.orange { + border-bottom-color: #fdd0ac; +} +.header.orange2 { + border-bottom-color: #fbd36b; +} +.header.red { + border-bottom-color: #f3cdc6; +} +.header.grey { + border-bottom-color: #c3c3c3; +} +.header.pink { + border-bottom-color: #f2e0eb; +} +.header.pink2 { + border-bottom-color: #e69eb9; +} +.header.light-blue { + border-bottom-color: #dceefc; +} +.header.light-red { + border-bottom-color: #fec5c5; +} +.header.light-green { + border-bottom-color: #d2e7b5; +} +.header.brown { + border-bottom-color: #df9393; +} +.header > .ace-icon { + margin-right: 2px; +} +.action-buttons a { + margin: 0 3px; + display: inline-block; + opacity: 0.85; + -webkit-transition: all 0.1s; + -o-transition: all 0.1s; + transition: all 0.1s; +} +.action-buttons a:hover { + text-decoration: none; + opacity: 1; + -moz-transform: scale(1.2); + -webkit-transform: scale(1.2); + -o-transform: scale(1.2); + -ms-transform: scale(1.2); + transform: scale(1.2); +} +.navbar { + margin: 0; + padding-left: 0; + padding-right: 0; + border-width: 0; + border-radius: 0; + -webkit-box-shadow: none; + box-shadow: none; + min-height: 45px; + background: #438eb9; +} +.navbar .navbar-text, +.navbar .navbar-link { + color: #ffffff; +} +.navbar .navbar-brand { + color: #ffffff; + font-size: 24px; + text-shadow: none; + padding-top: 10px; + padding-bottom: 10px; + height: auto; +} +.navbar .navbar-brand:hover, +.navbar .navbar-brand:focus { + color: #ffffff; +} +/** +@media (min-width: @grid-float-breakpoint) { + .navbar > .container .navbar-brand, + .navbar > .container-fluid .navbar-brand { + margin-left: 0; + margin-right: 0; + } +} +*/ +@media only screen and (min-width: 992px) { + .navbar-container { + padding-left: 10px; + padding-right: 10px; + } +} +.navbar-container.container { + padding-left: 0; + padding-right: 0; +} +.ace-nav { + height: 100%; + margin: 0 !important; +} +.ace-nav > li { + line-height: 45px; + height: 45px; + border-left: 1px solid #E1E1E1; + padding: 0; + position: relative; + float: left; +} +.ace-nav > li:first-child { + border-left-width: 0; +} +.ace-nav > li > a { + background-color: #2e6589; + color: #FFF; + display: block; + line-height: inherit; + text-align: center; + height: 100%; + width: auto; + min-width: 50px; + padding: 0 8px; + position: relative; +} +.ace-nav > li > a > .ace-icon { + display: inline-block; + font-size: 16px; + color: #FFF; + text-align: center; + width: 20px; +} +.ace-nav > li > a > .badge { + position: relative; + top: -4px; + left: 2px; + padding-right: 5px; + padding-left: 5px; +} +.ace-nav > li > a:hover, +.ace-nav > li > a:focus, +.ace-nav > li.open > a { + background-color: #2c5976; + color: #FFF; +} +.ace-nav > li.blue > a { + background-color: #2e6589; +} +.ace-nav > li.blue > a:hover, +.ace-nav > li.blue > a:focus, +.ace-nav > li.open.blue > a { + background-color: #2c5976; +} +.ace-nav > li.grey > a { + background-color: #555555; +} +.ace-nav > li.grey > a:hover, +.ace-nav > li.grey > a:focus, +.ace-nav > li.open.grey > a { + background-color: #4b4b4b; +} +.ace-nav > li.purple > a { + background-color: #892e65; +} +.ace-nav > li.purple > a:hover, +.ace-nav > li.purple > a:focus, +.ace-nav > li.open.purple > a { + background-color: #762c59; +} +.ace-nav > li.green > a { + background-color: #2e8965; +} +.ace-nav > li.green > a:hover, +.ace-nav > li.green > a:focus, +.ace-nav > li.open.green > a { + background-color: #2c7659; +} +.ace-nav > li.light-blue > a { + background-color: #62a8d1; +} +.ace-nav > li.light-blue > a:hover, +.ace-nav > li.light-blue > a:focus, +.ace-nav > li.open.light-blue > a { + background-color: #579ec8; +} +.ace-nav > li.light-blue2 > a { + background-color: #42a8e1; +} +.ace-nav > li.light-blue2 > a:hover, +.ace-nav > li.light-blue2 > a:focus, +.ace-nav > li.open.light-blue2 > a { + background-color: #359fd9; +} +.ace-nav > li.red > a { + background-color: #b74635; +} +.ace-nav > li.red > a:hover, +.ace-nav > li.red > a:focus, +.ace-nav > li.open.red > a { + background-color: #a34335; +} +.ace-nav > li.light-green > a { + background-color: #9abc32; +} +.ace-nav > li.light-green > a:hover, +.ace-nav > li.light-green > a:focus, +.ace-nav > li.open.light-green > a { + background-color: #8ba832; +} +.ace-nav > li.light-purple > a { + background-color: #cb6fd7; +} +.ace-nav > li.light-purple > a:hover, +.ace-nav > li.light-purple > a:focus, +.ace-nav > li.open.light-purple > a { + background-color: #c263ce; +} +.ace-nav > li.light-orange > a { + background-color: #f79263; +} +.ace-nav > li.light-orange > a:hover, +.ace-nav > li.light-orange > a:focus, +.ace-nav > li.open.light-orange > a { + background-color: #f28653; +} +.ace-nav > li.light-pink > a { + background-color: #f4dae5; +} +.ace-nav > li.light-pink > a:hover, +.ace-nav > li.light-pink > a:focus, +.ace-nav > li.open.light-pink > a { + background-color: #eeccda; +} +.ace-nav > li.dark > a { + background-color: #404040; +} +.ace-nav > li.dark > a:hover, +.ace-nav > li.dark > a:focus, +.ace-nav > li.open.dark > a { + background-color: #363636; +} +.ace-nav > li.white-opaque > a { + background-color: rgba(255, 255, 255, 0.8); +} +.ace-nav > li.white-opaque > a:hover, +.ace-nav > li.white-opaque > a:focus, +.ace-nav > li.open.white-opaque > a { + background-color: rgba(245, 245, 245, 0.8); +} +.ace-nav > li.dark-opaque > a { + background-color: rgba(0, 0, 0, 0.2); +} +.ace-nav > li.dark-opaque > a:hover, +.ace-nav > li.dark-opaque > a:focus, +.ace-nav > li.open.dark-opaque > a { + background-color: rgba(0, 0, 0, 0.2); +} +.ace-nav > li.transparent > a { + background-color: transparent; +} +.ace-nav > li.transparent > a:hover, +.ace-nav > li.transparent > a:focus, +.ace-nav > li.open.transparent > a { + background-color: rgba(0, 0, 0, 0.1); +} +.ace-nav > li.light-10 > a { + background-color: rgba(255, 255, 255, 0.1); +} +.ace-nav > li.light-10 > a:hover, +.ace-nav > li.light-10 > a:focus, +.ace-nav > li.open.light-10 > a { + background-color: rgba(255, 255, 255, 0.2); +} +.ace-nav > li.dark-10 > a { + background-color: rgba(0, 0, 0, 0.1); +} +.ace-nav > li.dark-10 > a:hover, +.ace-nav > li.dark-10 > a:focus, +.ace-nav > li.open.dark-10 > a { + background-color: rgba(0, 0, 0, 0.2); +} +.ace-nav > li.margin-4 { + margin-left: 4px; +} +.ace-nav > li.margin-3 { + margin-left: 3px; +} +.ace-nav > li.margin-2 { + margin-left: 2px; +} +.ace-nav > li.margin-1 { + margin-left: 1px; +} +.ace-nav > li.no-border { + border-width: 0 !important; +} +.ace-nav > li .dropdown-menu { + z-index: 1031; +} +.ace-nav .nav-user-photo { + margin: -4px 8px 0 0; + border-radius: 100%; + border: 2px solid #FFF; + max-width: 40px; +} +.ace-nav li.dropdown-footer a .ace-icon { + display: inline-block; + width: 1.25em; + text-align: center; +} +@media only screen and (max-height: 540px) { + .ace-nav > li > .dropdown-menu { + position: fixed; + margin-top: auto; + z-index: 1042; + } + .ace-nav > li > .dropdown-menu:before, + .ace-nav > li > .dropdown-menu:after { + display: none; + } + .ace-nav .user-menu > li > a { + padding-top: 6px; + padding-bottom: 6px; + } + .ace-nav > li.open:before { + background-color: #000; + opacity: 0.5; + border-width: 0; + position: fixed; + left: 0; + right: 0; + top: 0; + bottom: 0; + content: ""; + display: block; + height: 2000px; + width: auto; + z-index: 1041; + } +} +@media only screen and (max-width: 767px) { + .ace-nav > li:nth-last-child(4) > .dropdown-menu.dropdown-menu-right { + right: -100px; + } + .ace-nav > li:nth-last-child(4) > .dropdown-menu.dropdown-menu-right:before, + .ace-nav > li:nth-last-child(4) > .dropdown-menu.dropdown-menu-right:after { + right: 120px; + } + .ace-nav > li:nth-last-child(3) > .dropdown-menu.dropdown-menu-right { + right: -80px; + } + .ace-nav > li:nth-last-child(3) > .dropdown-menu.dropdown-menu-right:before, + .ace-nav > li:nth-last-child(3) > .dropdown-menu.dropdown-menu-right:after { + right: 100px; + } + .user-menu.dropdown-close.dropdown-menu-right { + right: 0 !important; + } +} +@media only screen and (min-width: 480px) and (max-width: 767px) { + .navbar.navbar-collapse .ace-nav > li:nth-last-child(2):nth-child(1) > .dropdown-menu.dropdown-menu-right, + .navbar.navbar-collapse .ace-nav > li:nth-last-child(2):nth-child(2) > .dropdown-menu.dropdown-menu-right { + left: auto; + right: -60px; + } + .navbar.navbar-collapse .ace-nav > li:nth-last-child(2):nth-child(1) > .dropdown-menu.dropdown-menu-right:before, + .navbar.navbar-collapse .ace-nav > li:nth-last-child(2):nth-child(2) > .dropdown-menu.dropdown-menu-right:before, + .navbar.navbar-collapse .ace-nav > li:nth-last-child(2):nth-child(1) > .dropdown-menu.dropdown-menu-right:after, + .navbar.navbar-collapse .ace-nav > li:nth-last-child(2):nth-child(2) > .dropdown-menu.dropdown-menu-right:after { + right: 80px; + left: auto; + } +} +@media only screen and (max-width: 480px) { + .ace-nav > li:nth-last-child(4) > .dropdown-menu.dropdown-menu-right { + right: -120px; + } + .ace-nav > li:nth-last-child(4) > .dropdown-menu.dropdown-menu-right:before, + .ace-nav > li:nth-last-child(4) > .dropdown-menu.dropdown-menu-right:after { + right: 140px; + } + .ace-nav > li:nth-last-child(3) > .dropdown-menu.dropdown-menu-right { + right: -90px; + } + .ace-nav > li:nth-last-child(3) > .dropdown-menu.dropdown-menu-right:before, + .ace-nav > li:nth-last-child(3) > .dropdown-menu.dropdown-menu-right:after { + right: 110px; + } + .ace-nav > li:nth-last-child(2) > .dropdown-menu.dropdown-menu-right { + right: -50px; + } + .ace-nav > li:nth-last-child(2) > .dropdown-menu.dropdown-menu-right:before, + .ace-nav > li:nth-last-child(2) > .dropdown-menu.dropdown-menu-right:after { + right: 70px; + } +} +@media only screen and (max-width: 479px) { + .ace-nav > li:nth-last-child(4) > .dropdown-menu.dropdown-menu-right { + left: -10px; + right: auto; + } + .ace-nav > li:nth-last-child(4) > .dropdown-menu.dropdown-menu-right:before, + .ace-nav > li:nth-last-child(4) > .dropdown-menu.dropdown-menu-right:after { + right: auto; + left: 30px; + } + .ace-nav > li:nth-last-child(3) > .dropdown-menu.dropdown-menu-right { + left: -50px; + right: auto; + } + .ace-nav > li:nth-last-child(3) > .dropdown-menu.dropdown-menu-right:before, + .ace-nav > li:nth-last-child(3) > .dropdown-menu.dropdown-menu-right:after { + left: 75px; + right: auto; + } + .ace-nav > li:nth-last-child(2) > .dropdown-menu.dropdown-menu-right { + left: -70px; + right: auto; + } + .ace-nav > li:nth-last-child(2) > .dropdown-menu.dropdown-menu-right:before, + .ace-nav > li:nth-last-child(2) > .dropdown-menu.dropdown-menu-right:after { + left: 90px; + right: auto; + } +} +@media only screen and (max-width: 319px) { + .ace-nav > li:nth-last-child(2) > .dropdown-menu.dropdown-menu-right { + left: -110px; + right: auto; + } + .ace-nav > li:nth-last-child(2) > .dropdown-menu.dropdown-menu-right:before, + .ace-nav > li:nth-last-child(2) > .dropdown-menu.dropdown-menu-right:after { + left: 130px; + right: auto; + } + .ace-nav > li:nth-child(2):nth-last-child(2) > .dropdown-menu.dropdown-menu-right { + left: -85px; + right: auto; + } + .ace-nav > li:nth-child(2):nth-last-child(2) > .dropdown-menu.dropdown-menu-right:before, + .ace-nav > li:nth-child(2):nth-last-child(2) > .dropdown-menu.dropdown-menu-right:after { + left: 105px; + right: auto; + } + .ace-nav > li:nth-child(1):nth-last-child(3) > .dropdown-menu.dropdown-menu-right { + left: -35px; + right: auto; + } + .ace-nav > li:nth-child(1):nth-last-child(3) > .dropdown-menu.dropdown-menu-right:before, + .ace-nav > li:nth-child(1):nth-last-child(3) > .dropdown-menu.dropdown-menu-right:after { + left: 55px; + right: auto; + } + .ace-nav > li:nth-child(1):nth-last-child(2) > .dropdown-menu.dropdown-menu-right { + left: -60px; + right: auto; + } + .ace-nav > li:nth-child(1):nth-last-child(2) > .dropdown-menu.dropdown-menu-right:before, + .ace-nav > li:nth-child(1):nth-last-child(2) > .dropdown-menu.dropdown-menu-right:after { + left: 75px; + right: auto; + } +} +@media only screen and (max-width: 479px) { + .navbar:not(.navbar-collapse) .navbar-header { + float: none !important; + display: block; + } + .navbar:not(.navbar-collapse) .ace-nav { + display: block; + float: none !important; + text-align: center; + background-color: rgba(0, 0, 0, 0.15); + border: 1px solid rgba(0, 0, 0, 0.1); + border-width: 1px 0 0; + letter-spacing: -3px; + } + .navbar:not(.navbar-collapse) .ace-nav > li { + display: inline-block; + float: none !important; + text-align: left; + letter-spacing: normal; + } + .navbar:not(.navbar-collapse) .ace-nav > li:first-child { + border-left: 1px solid rgba(255, 255, 255, 0.4); + } + .navbar:not(.navbar-collapse) .ace-nav > li:last-child { + border-right: 1px solid rgba(255, 255, 255, 0.4); + } +} +@media only screen and (max-width: 319px) { + .ace-nav > li > a { + padding: 0 5px !important; + } +} +.user-menu > li > a { + padding: 4px 12px; +} +.user-menu > li > a > .ace-icon { + margin-right: 6px; + font-size: 120%; +} +.user-info { + max-width: 100px; + display: inline-block; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + text-align: left; + vertical-align: top; + line-height: 15px; + position: relative; + top: 6px; +} +.user-info small { + display: block; +} +@media (min-width: 480px) and (max-width: 540px), (max-width: 360px) { + .navbar:not(.navbar-collapse) .navbar-buttons .user-menu { + padding-top: 42px !important; + } + .navbar:not(.navbar-collapse) .navbar-buttons .nav-user-photo { + margin-right: 0; + } + .navbar:not(.navbar-collapse) .navbar-buttons .user-info { + position: absolute; + margin-top: 40px; + margin-left: 1px; + right: 2px; + z-index: 1032; + color: #777; + font-size: 14px; + width: 156px; + max-width: 156px; + padding-left: 8px; + padding-right: 8px; + height: 32px; + line-height: 26px !important; + display: none; + border-bottom: 1px solid #E5E5E5; + text-align: center; + vertical-align: none; + line-height: normal; + cursor: text; + } + .navbar:not(.navbar-collapse) .navbar-buttons .user-info > small { + display: inline; + opacity: 1; + } + li.open .user-info { + display: inline-block !important; + } +} +@media (max-width: 360px) { + .navbar.navbar-collapse .navbar-buttons .user-menu { + padding-top: 42px !important; + } + .navbar.navbar-collapse .navbar-buttons .nav-user-photo { + margin-right: 0; + } + .navbar.navbar-collapse .navbar-buttons .user-info { + position: absolute; + margin-top: 40px; + margin-left: 1px; + right: 2px; + z-index: 1032; + color: #777; + font-size: 14px; + width: 156px; + max-width: 156px; + padding-left: 8px; + padding-right: 8px; + height: 32px; + line-height: 26px !important; + display: none; + border-bottom: 1px solid #E5E5E5; + text-align: center; + vertical-align: none; + line-height: normal; + cursor: text; + } + .navbar.navbar-collapse .navbar-buttons .user-info > small { + display: inline; + opacity: 1; + } + li.open .user-info { + display: inline-block !important; + right: 2px; + } +} +@media (min-width: 992px) { + .user-min .user-menu { + padding-top: 42px !important; + } + .user-min .nav-user-photo { + margin-right: 0; + } + .user-min .user-info { + position: absolute; + margin-top: 40px; + margin-left: 1px; + right: 2px; + z-index: 1032; + color: #777; + font-size: 14px; + width: 156px; + max-width: 156px; + padding-left: 8px; + padding-right: 8px; + height: 32px; + line-height: 26px !important; + display: none; + border-bottom: 1px solid #E5E5E5; + text-align: center; + vertical-align: none; + line-height: normal; + cursor: text; + } + .user-min .user-info > small { + display: inline; + opacity: 1; + } + .user-min .user-info { + right: -3px; + } + .user-min.open .user-info { + display: inline-block !important; + } +} +@media (max-height: 540px) and (min-width: 480px) and (max-width: 540px), (max-height: 540px) and (max-width: 360px) { + .navbar:not(.navbar-collapse) .navbar-buttons .user-info { + position: fixed; + right: auto; + margin-top: auto; + max-width: none; + } +} +@media (max-height: 540px) and (max-width: 360px) { + .navbar.navbar-collapse .navbar-buttons .user-info { + position: fixed; + right: auto; + margin-top: auto; + max-width: none; + } +} +@media (max-height: 540px) and (min-width: 992px) { + .user-min .user-info { + position: fixed; + right: auto; + margin-top: auto; + max-width: none; + } +} +@media only screen and (max-width: 991px) { + .navbar.navbar-collapse { + max-height: none; + } + .navbar .navbar-header, + .navbar .navbar-collapse { + margin-left: 0 !important; + margin-right: 0 !important; + } + .navbar.navbar-collapse .navbar-header { + float: none !important; + min-height: 45px; + } + .navbar.navbar-collapse .navbar-buttons { + min-height: 0; + padding-left: 0; + padding-right: 0; + border: 1px solid rgba(255, 255, 255, 0.4); + border-width: 1px 0 0; + width: 100%; + } + .navbar.navbar-collapse .navbar-buttons.in { + overflow: visible !important; + } + .navbar.navbar-collapse .navbar-buttons > .ace-nav { + display: block; + float: none !important; + text-align: center; + background-color: transparent !important; + border-width: 0; + letter-spacing: -3px; + } + .navbar.navbar-collapse .navbar-buttons > .ace-nav > li { + display: inline-block; + float: none !important; + text-align: left; + letter-spacing: normal; + } + .navbar.navbar-collapse .navbar-buttons > .ace-nav > li:first-child { + border-left: 1px solid rgba(255, 255, 255, 0.4); + } + .navbar.navbar-collapse .navbar-buttons > .ace-nav > li:last-child { + border-right: 1px solid rgba(255, 255, 255, 0.4); + } +} +.container > .navbar-buttons, +.container-fluid > .navbar-buttons { + padding-right: 0 !important; +} +@media only screen and (max-height: 400px) { + .navbar-fixed-top .navbar-collapse { + max-height: 280px; + } +} +@media only screen and (max-height: 360px) { + .navbar-fixed-top .navbar-collapse { + max-height: 240px; + } +} +@media only screen and (max-height: 320px) { + .navbar-fixed-top .navbar-collapse { + max-height: 200px; + } +} +@media only screen and (max-height: 280px) { + .navbar-fixed-top .navbar-collapse { + max-height: 160px; + } +} +@media only screen and (max-height: 240px) { + .navbar-fixed-top .navbar-collapse { + max-height: 120px; + } +} +.navbar .navbar-nav > li { + border: 1px solid rgba(0, 0, 0, 0.2); + border-width: 0 1px 0 0; +} +.navbar .navbar-nav > li:first-child { + border-width: 0 1px 0 1px; +} +.navbar .navbar-nav > li > a { + padding-top: 12px; + padding-bottom: 11px; + height: 45px; + background-color: transparent; + font-size: 13px; + color: #ffffff; + text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); +} +.navbar .navbar-nav > li > a:hover, +.navbar .navbar-nav > li > a:focus, +.navbar .navbar-nav > li.open > a { + background-color: rgba(0, 0, 0, 0.1) !important; + color: #ffffff !important; +} +.navbar .navbar-nav > li > .dropdown-menu > li > a { + line-height: 2; +} +.navbar-nav .dropdown-menu > li > a > .ace-icon { + display: inline-block; + width: 20px; +} +.navbar-nav > li > .dropdown-menu { + z-index: 1033; +} +@media only screen and (max-width: 991px) { + .navbar.navbar-collapse .navbar-menu { + float: none !important; + clear: both; + } + .navbar.navbar-collapse .navbar-menu .dropdown-menu:after, + .navbar.navbar-collapse .navbar-menu .dropdown-menu:before { + display: none !important; + } + .navbar .navbar-nav { + margin: 0 -6px; + } + .navbar .navbar-nav > li, + .navbar .navbar-nav > li:first-child { + border-width: 1px 0 0; + } + .navbar .navbar-nav .dropdown-menu { + float: none; + position: relative; + background-color: transparent; + box-shadow: none; + border-width: 0; + } + .navbar .navbar-nav .dropdown-menu > li > a { + color: #FFF !important; + } + .navbar .navbar-nav .dropdown-menu > li > a:hover { + background-color: rgba(0, 0, 0, 0.07) !important; + } + .navbar .navbar-nav .dropdown-menu > li > a > .ace-icon { + color: #FFF !important; + } + .navbar .navbar-nav .dropdown-hover > .dropdown-menu { + left: 32px !important; + right: auto !important; + top: auto !important; + width: 80% !important; + width: calc(100% - 32px); + } +} +.navbar-form.form-search { + margin-top: 9px; + margin-bottom: 0; +} +.navbar-form.form-search .form-group { + margin-bottom: 0; +} +.navbar-form.form-search input[type=text] { + width: 100px; +} +.navbar-form input[type=text] { + font-size: 13px; + line-height: 1.4; + padding-top: 4px; + padding-bottom: 4px; + border-width: 0; +} +@media only screen and (max-width: 991px) { + .navbar-form .form-group { + display: inline-block; + width: 50%; + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form.form-search input[type=text] { + width: 100%; + } + .navbar-nav + .navbar-form { + margin-top: 0; + } + .navbar .navbar-collapse, + .navbar .navbar-form { + border-color: rgba(255, 255, 255, 0.4); + } + .navbar .navbar-nav > li:first-child { + border-top-width: 0; + } +} +@media only screen and (max-width: 480px) { + .navbar-form .form-group { + width: 80%; + } +} +.navbar-fixed-top .navbar-collapse, +.navbar-static-top .navbar-collapse, +.navbar-fixed-bottom .navbar-collapse { + padding-left: 12px; + padding-right: 12px; +} +@media only screen and (min-width: 768px) and (max-width: 991px) { + .navbar.navbar-collapse { + background-color: transparent; + } + .navbar.navbar-collapse:before { + background: #438eb9; + content: ""; + display: block; + position: absolute; + min-height: inherit; + left: 0; + right: 0; + top: 0; + z-index: -1; + border-radius: inherit; + } + .navbar.navbar-collapse .navbar-container { + background-color: #438eb9; + } +} +.navbar .navbar-toggle { + border: 1px solid transparent; + width: 40px; + height: 35px; + line-height: 0; + padding: 0 0 1px; + text-align: center; +} +.navbar .navbar-toggle.pull-right { + margin: 5px 6px 4px 0; +} +.navbar .navbar-toggle.pull-left { + margin: 5px 0 4px 6px; +} +.navbar .navbar-toggle:active { + top: 1px; +} +.navbar .navbar-toggle.navbar-toggle-img { + width: auto; + height: auto; + overflow: hidden; + padding: 0; + border-width: 0; +} +.navbar .navbar-toggle.navbar-toggle-img > img { + border-radius: inherit; + max-height: 35px; + border-width: 0; +} +.navbar .navbar-toggle .icon-bar { + background-color: #FFF; + border-radius: 0; + width: 24px; + margin-left: 7px; +} +.sidebar { + width: 190px; + float: left; + position: static; + padding-left: 0; + padding-right: 0; +} +.sidebar:before { + content: ""; + display: block; + width: inherit; + position: absolute; + top: 0; + bottom: 0; + z-index: -1; + background-color: inherit; + border-style: inherit; + border-color: inherit; + border-width: inherit; +} +/**li .@{icon} { + & , .nav-list & { + width: auto; + } +}*/ +.nav-list { + margin: 0; + padding: 0; + list-style: none; +} +.nav-list > li, +.nav-list > li > a, +.nav-list .nav-header { + margin: 0; +} +.nav-list li > a:focus { + outline: none; +} +.nav-list > li { + display: block; + position: relative; + float: none; + padding: 0; + border-style: solid; + border-width: 1px 0 0; +} +.nav-list > li:last-child { + border-bottom-width: 1px; +} +.nav-list > li.active > a { + font-weight: bold; +} +.nav-list > li > a { + display: block; + height: 39px; + line-height: 17px; + padding-left: 7px; + text-shadow: none !important; + font-size: 13px; + text-decoration: none; +} +.nav-list > li > a > .menu-icon { + display: inline-block; + min-width: 30px; + margin-right: 2px; + vertical-align: sub; + text-align: center; + font-size: 18px; + font-weight: normal; +} +.nav-list > li:before { + display: none; + content: ""; + position: absolute; + top: -1px; + left: 0; + z-index: 1; + height: 41px; + width: 3px; + max-width: 3px; + overflow: hidden; + background-color: #629cc9; +} +@media only screen and (min-width: 992px) { + .main-container.container .sidebar:not(.h-sidebar) .nav-list > li:before { + left: -2px; + } +} +.main-container.container .sidebar.sidebar-fixed:not(.h-sidebar) .nav-list > li:before { + left: 0; +} +.nav-list > li:hover:before { + display: block; +} +.nav-list > li a > .arrow { + display: block; + width: 14px !important; + height: 14px; + line-height: 14px; + text-shadow: none; + font-size: 18px; + position: absolute; + right: 10px; + top: 12px; + padding: 0; + text-align: center; +} +.nav-list > li.separator { + height: 3px; + background-color: transparent; + position: static; + margin: 1px 0; + -webkit-box-shadow: none; + box-shadow: none; +} +.nav-list > li.active .submenu { + display: block; +} +.nav-list > li .submenu { + display: none; + list-style: none; + margin: 0; + padding: 0; + line-height: 1.5; + position: relative; +} +.nav-list > li .submenu > li { + margin-left: 0; + position: relative; +} +.nav-list > li .submenu > li > a { + display: block; + position: relative; + padding: 7px 0 9px 37px; + margin: 0; + border-top-width: 1px; + border-top-style: dotted; +} +.nav-list > li .submenu > li > a:hover { + text-decoration: none; +} +.nav-list > li .submenu > li a > .menu-icon { + display: none; + font-size: 12px; + font-weight: normal; + width: 18px; + height: auto; + line-height: 12px; + text-align: center; + position: absolute; + left: 10px; + top: 11px; + z-index: 1; + background-color: inherit; +} +.nav-list > li .submenu > li.active > a > .menu-icon, +.nav-list > li .submenu > li:hover > a > .menu-icon { + display: inline-block; +} +.nav-list > li > .submenu { + border-top: 1px solid; +} +.nav-list > li > .submenu > li:before { + content: ""; + display: block; + width: 7px; + position: absolute; + z-index: 1; + left: 20px; + top: 17px; + border: 1px dotted; + border-width: 1px 0 0; +} +.nav-list > li > .submenu:before { + content: ""; + display: block; + position: absolute; + z-index: 1; + left: 18px; + top: 0; + bottom: 0; + border: 1px dotted; + border-width: 0 0 0 1px; +} +.nav-list li:hover > a > .arrow, +.nav-list li.active > a > .arrow, +.nav-list li.open > a > .arrow { + color: inherit; +} +.nav-list li.open > .submenu { + display: block; +} +no_such_element:-o-prefocus, +.nav-list > li > a > .menu-icon { + vertical-align: middle; +} +.nav-list > li > .submenu li > .submenu { + display: none; +} +.nav-list > li > .submenu li.active > .submenu { + display: block; +} +.nav-list > li > .submenu a > .arrow { + right: 10px; + top: 10px; + font-size: 16px; +} +.nav-list > li > .submenu > li:first-child > a { + border-top-width: 0; +} +.nav-list > li > .submenu li > .submenu > li { + line-height: 18px; +} +.nav-list > li > .submenu li > .submenu > li:before { + display: none; +} +.nav-list > li > .submenu li > .submenu > li > a { + margin-left: 20px; + padding-left: 22px; +} +.nav-list > li > .submenu li > .submenu > li > .submenu > li > a { + margin-left: 20px; + padding-left: 38px; +} +.nav-list > li > .submenu li > .submenu > li a > .menu-icon { + display: inline-block; + width: auto; + position: static; + background-color: transparent; + margin-right: 4px; + color: inherit; +} +.nav-list > li > .submenu li > .submenu > li a .menu-icon, +.nav-list > li > .submenu li > .submenu > li a .arrow { + color: inherit; +} +.nav-list > li > .submenu li.open:not(.hover) > a > .menu-icon { + display: inline-block; +} +.nav-list a .badge, +.nav-list a .label { + position: absolute; + top: 9px; + right: 10px; + opacity: 0.88; + font-size: 12px; + padding-left: 6px; + padding-right: 6px; +} +.nav-list a .badge .ace-icon, +.nav-list a .label .ace-icon { + vertical-align: middle; + margin: 0; +} +.nav-list a.dropdown-toggle .badge, +.nav-list a.dropdown-toggle .label { + right: 26px; +} +.nav-list li:hover > a .badge, +.nav-list li:hover > a .label { + opacity: 1; +} +.nav-list .submenu .submenu a .badge, +.nav-list .submenu .submenu a .label { + top: 6px; +} +.sidebar.sidebar-fixed { + position: fixed; + top: auto; + float: none !important; + z-index: 1027; +} +.sidebar.sidebar-fixed:before { + height: 5000px; + top: auto; + bottom: auto; +} +body.mob-safari .sidebar.sidebar-fixed { + top: 45px; +} +@media (max-width: 479px) { + body.mob-safari .navbar-fixed-top:not(.navbar-collapse) + .main-container .sidebar-fixed { + top: 90px; + } +} +@media (max-width: 991px) { + body.mob-safari .navbar-fixed-top + .main-container .sidebar.responsive { + top: 45px; + } +} +@media (max-width: 479px) { + body.mob-safari .navbar-fixed-top + .main-container .sidebar.responsive { + top: 90px; + } +} +/** +//http://updates.html5rocks.com/2012/09/Stacking-Changes-Coming-to-position-fixed-elements +//webkit & Chrome22+ special case +//webkit is not following the standard specs as of Chrome22+ +@media screen and (-webkit-min-device-pixel-ratio:0) { + //like it happens in Firefox&IE, we expect when we set "z-index:auto" for fixed position .sidebar, + //the child .submenu elements "z-index" is independent + //and for example a "z-index:1031" .submenu appears on top of a fixed .navbar with "z-index:1030" + //and a "z-index:1010" .popover appears on top of ".sidebar" but below ".submenu" + //but webkit defines a new stacking context on "fixed" position elements(.sidebar here) + //and the above doesn't happen, in fact .submenu inside fixed .sidebar with "z-index:auto" will appear below everything + //so we set a good(?) "z-index" for .sidebar, but still it's not as good as standard specs (such as in Firefox) + //and we may need other workarounds! + //and you may change it based on your needs + + //it's possible have standard functionality in Chrome by going to: + //chrome://flags/#fixed-position-creates-stacking-context + //changing "Fixed position elements create stacking contexts" to "Disabled" + //and removing the following rules + //and assignning a higher "@submenu-zindex" + + .sidebar.sidebar-fixed { + z-index: @zindex-sidebar-fixed;//???! + + &::before { + height: 5000px; + top: auto; + bottom: auto; + } + } +} +*/ +@media only screen and (max-width: 991px) { + .responsive.sidebar-fixed { + left: auto; + margin-left: auto; + } + .navbar-fixed-top + .main-container > .responsive { + position: fixed; + left: auto; + margin-left: auto; + } + .navbar-fixed-top + .main-container > .menu-toggler + .responsive { + position: absolute; + left: 190px; + margin-left: -190px; + } + .navbar-fixed-top + .main-container > .menu-toggler + .responsive.sidebar-fixed { + position: fixed; + left: auto; + margin-left: auto; + } +} +@media only screen and (max-width: 991px) { + .sidebar.responsive.sidebar-fixed { + position: fixed; + left: auto; + margin-left: auto; + } + .main-container .menu-toggler.fixed { + position: fixed; + left: auto; + z-index: 1026; + } + .sidebar.sidebar-fixed.responsive-max { + position: fixed; + left: auto; + margin-left: auto; + } +} +.sidebar .sidebar-toggle { + border-style: solid; + border-width: 0 0 1px; + text-align: center; + padding: 3px 0; + position: relative; +} +.sidebar .sidebar-toggle > .ace-icon { + padding: 0 5px; + line-height: 18px; + cursor: pointer; + font-size: 14px; + border-radius: 100%; + border: 1px solid; + position: relative; +} +.sidebar .sidebar-toggle:before { + content: ""; + display: block; + height: 0; + border-top: 1px solid; + border-color: inherit; + position: absolute; + left: 15px; + right: 15px; + top: 13px; +} +.sidebar .sidebar-shortcuts { + text-align: center; + min-height: 40px; + margin-bottom: 0; + overflow: hidden; + position: relative; + border: 0 solid; +} +.sidebar .sidebar-shortcuts:empty { + display: none; +} +.sidebar .sidebar-shortcuts-large { + line-height: 37px; +} +.sidebar .sidebar-shortcuts-large > .btn { + text-align: center; + width: 41px; + line-height: 24px; + padding: 0; + border-width: 4px; +} +.sidebar .sidebar-shortcuts-large > .btn > .ace-icon { + margin: 0; +} +.sidebar .sidebar-shortcuts-mini { + display: none; + font-size: 0; + width: 42px; + padding-top: 2px; + padding-bottom: 2px; +} +.sidebar .sidebar-shortcuts-mini > .btn { + border-width: 0; + font-size: 0; + line-height: 0; + padding: 8px; + margin: 1px; + border-radius: 0; + opacity: 0.85; + filter: alpha(opacity=85); +} +@media screen and (-webkit-min-device-pixel-ratio: 0) { + .sidebar ::safari-only, + .sidebar .sidebar-shortcuts-mini > .btn { + margin: 0; + } +} +.nav-list li.active > a:after { + display: block; + content: ""; + position: absolute; + right: 0; + top: 4px; + border: 8px solid transparent; + border-width: 14px 10px; +} +.nav-list li.open > a:after { + display: none; +} +.nav-list li.active.no-active-child > a:after { + display: block; +} +.nav-list > li li.active > a:after { + top: 2px; + border-width: 14px 8px; +} +.nav-list li.active:not(.open) li.active > a:after { + display: none !important; +} +@media (min-width: 992px) { + .sidebar.compact, + .sidebar.compact.navbar-collapse { + width: 105px; + } + .sidebar.compact .sidebar-shortcuts { + max-height: 40px; + } + .sidebar.compact .nav-list > li:before { + height: auto; + bottom: -1px; + } + .sidebar.compact .nav-list > li > a { + height: auto; + line-height: 16px; + padding: 2px 0 8px; + text-align: center; + } + .sidebar.compact .nav-list > li > a > .menu-icon { + display: block; + margin: 0; + vertical-align: inherit; + line-height: 32px; + height: 32px; + font-size: 20px; + } + .sidebar.compact .nav-list > li > a > .arrow { + display: none; + } + .sidebar.compact .nav-list a .badge, + .sidebar.compact .nav-list a .label { + right: 12px; + } + .sidebar.compact .nav-list > li.active > .submenu, + .sidebar.compact .nav-list > li.open > .submenu { + display: none; + } + .sidebar.compact + .main-content { + margin-left: 105px; + } +} +@media (min-width: 992px) and (max-width: 991px) { + .sidebar.compact + .main-content { + margin-left: 0; + } + .sidebar.navbar-collapse.compact .nav-list > li > a { + text-align: left; + height: 39px; + line-height: 37px; + padding: 0 16px 0 7px; + } + .sidebar.navbar-collapse.compact .nav-list > li > a > .menu-icon { + display: inline-block; + vertical-align: sub; + height: auto; + line-height: inherit; + margin: 0 2px 0 0; + font-size: 18px; + } + .sidebar.navbar-collapse.compact .nav-list > li > a > .menu-text { + display: inline; + } + .sidebar.navbar-collapse.compact .nav-list > li > a > .arrow { + display: inline; + } + .sidebar.navbar-collapse.compact + .main-content { + margin-left: 0; + } +} +@media only screen and (min-width: 992px) { + .nav-list li.hover > .submenu { + position: absolute; + left: 100%; + margin-left: -2px; + top: -10px; + bottom: auto; + z-index: 1026; + width: 190px; + border: 1px solid; + display: none !important; + } + .nav-list li.hover:hover > .submenu, + .nav-list li.hover.hover-show > .submenu { + display: block !important; + } + .nav-list li.hover > .submenu:before, + .nav-list li.hover > .submenu > li:before { + display: none; + } + .nav-list li.hover.active > a:after { + display: block; + } + .nav-list li.hover.active:hover > a.dropdown-toggle:after, + .nav-list li.hover.active.hover-show > a.dropdown-toggle:after { + display: none; + } + .nav-list li.hover .submenu > li.active > a:after { + display: none !important; + } + .nav-list li.hover > .submenu.bottom { + top: auto; + bottom: -10px; + } + .nav-list li.hover > .submenu.bottom:before, + .nav-list li.hover > .submenu.bottom:after { + top: auto; + bottom: 18px; + } + .nav-list li.hover > .submenu { + padding: 0 2px; + } + .nav-list li.hover > .submenu > li > a { + margin-top: 2px; + margin-bottom: 2px; + padding-left: 18px; + border-top-width: 0; + } + .nav-list > li.hover > .submenu > li.active > a { + font-weight: bold; + } + .nav-list > li > .submenu li.hover > .submenu > li > a { + padding-left: 12px !important; + margin-left: auto !important; + } + .nav-list > li > .submenu li.hover > .submenu > li > a > .menu-icon { + margin-right: 2px; + } + .nav-list > li .submenu > li.hover > a { + padding-left: 22px; + } + .nav-list > li .submenu > li.hover > a > .menu-icon { + left: 4px; + } +} +@media (min-width: 992px) and (max-width: 991px) { + .sidebar.navbar-collapse .nav-list li.hover > .submenu { + position: relative; + left: auto; + top: auto; + z-index: auto; + margin: auto; + padding: 0; + width: auto; + -webkit-box-shadow: none; + box-shadow: none; + border-width: 0; + } + .sidebar.navbar-collapse .nav-list li.hover > .submenu > li:before, + .sidebar.navbar-collapse .nav-list li.hover > .submenu:before { + display: block; + } + .sidebar.navbar-collapse .nav-list li.hover > .submenu li > a { + padding-left: 37px; + } + .sidebar.navbar-collapse .nav-list > li.hover > .submenu { + border-top-width: 1px; + } + .sidebar.navbar-collapse .nav-list li.hover > .submenu > li > a > .menu-icon { + background-color: inherit; + margin-right: auto; + width: 18px; + position: absolute; + } + .sidebar.navbar-collapse .nav-list > li .submenu > li.hover > a > .menu-icon { + left: 10px; + } + .sidebar.navbar-collapse .nav-list li.hover > .submenu > li.active > a { + font-weight: normal; + } + .sidebar.navbar-collapse .nav-list li.hover > .submenu > li:hover > a > .menu-icon, + .sidebar.navbar-collapse .nav-list li.hover > .submenu > li.hover-show > a > .menu-icon, + .sidebar.navbar-collapse .nav-list li.hover > .submenu > li.active > a > .menu-icon { + display: inline-block; + } + .sidebar.navbar-collapse .nav-list > li > .submenu li.hover > .submenu { + padding-left: 0; + padding-right: 0; + } + .sidebar.navbar-collapse .nav-list > li > .submenu li.hover > .submenu > li > a { + padding-left: 22px !important; + margin-left: 20px !important; + } + .sidebar.navbar-collapse .nav-list > li > .submenu li.hover > .submenu > li > a > .menu-icon { + display: inline-block; + width: auto; + position: static; + background-color: transparent; + margin-right: 4px; + } + .sidebar.navbar-collapse .nav-list > li > .submenu li > .submenu > li.hover > .submenu > li > a { + margin-left: 20px !important; + padding-left: 38px !important; + } + .sidebar.navbar-collapse .nav-list li.hover > .submenu > li > a { + border-top-width: 1px; + margin-top: 0; + margin-bottom: 0; + } + .sidebar.navbar-collapse .nav-list > li.hover > .submenu > li:first-child > a { + border-top-width: 0; + } + .sidebar.navbar-collapse .nav-list li.hover > .submenu, + .sidebar.navbar-collapse .nav-list li.hover:hover > .submenu, + .sidebar.navbar-collapse .nav-list li.hover.hover-show > .submenu, + .sidebar.navbar-collapse .nav-list li.hover > .arrow { + display: none !important; + } + .sidebar.navbar-collapse .nav-list li.hover.active > .submenu { + display: block !important; + } + .sidebar.navbar-collapse .nav-list li.hover > .submenu.nav-hide { + display: none !important; + } + .sidebar.navbar-collapse .nav-list li.hover > .submenu.nav-show { + display: block !important; + } +} +@media (min-width: 992px) and (max-width: 991px) { + .sidebar.navbar-collapse.compact .nav-list > li.hover.active > a:after { + display: none; + } +} +.nav-list li > .arrow { + display: none; + position: absolute; + top: 8px; + right: 1px; + z-index: 1027; +} +.nav-list li > .arrow:before, +.nav-list li > .arrow:after { + border: 1px solid transparent; + display: block; + height: 0; + width: 0; + position: absolute; + left: -20px; + top: 0; + right: auto; + bottom: auto; + content: ""; + border-width: 10px; +} +.nav-list li > .arrow:before { + z-index: 1; + left: -21px; +} +.nav-list li > .arrow:after { + z-index: 2; +} +.nav-list li:hover > a + .arrow, +.nav-list li.hover-show > a + .arrow { + display: none; +} +@media only screen and (min-width: 992px) { + .nav-list li.hover:hover > a.dropdown-toggle + .arrow, + .nav-list li.hover.hover-show > a.dropdown-toggle + .arrow { + display: block; + } +} +.sidebar.menu-min, +.sidebar.menu-min.compact, +.sidebar.menu-min.navbar-collapse { + width: 43px; +} +.sidebar.menu-min + .main-content { + margin-left: 43px; +} +.sidebar.menu-min .nav-list a .badge, +.sidebar.menu-min .nav-list a .label { + position: relative; + top: -1px; + right: auto; + left: 4px; +} +.sidebar.menu-min .nav-list .submenu .submenu a .badge, +.sidebar.menu-min .nav-list .submenu .submenu a .label { + top: 0; +} +.sidebar.menu-min .nav-list > li > a { + position: relative; + height: 39px; + line-height: 37px; + padding: 0; +} +.sidebar.menu-min .nav-list > li > a > .menu-icon { + font-size: 18px; + height: auto; + line-height: inherit; + display: inline-block; + vertical-align: sub; + margin-right: 0; + width: 44px; +} +.sidebar.menu-min .nav-list > li > a > .menu-text { + display: none; + text-align: left; + position: absolute; + top: -1px; + left: 42px; + z-index: 1025; + width: 176px; + height: 41px; + line-height: 38px; + padding-left: 12px; + border: 1px solid; +} +.sidebar.menu-min .nav-list > li > a.dropdown-toggle > .menu-text { + top: -1px; + border-width: 1px 1px 0; +} +.sidebar.menu-min .nav-list > li > a .arrow { + display: none; +} +.sidebar.menu-min .nav-list > li:hover > a > .menu-text, +.sidebar.menu-min .nav-list > li.hover-show > a > .menu-text { + display: block; +} +.sidebar.menu-min .nav-list > li.active > a:after { + border-width: 10px 6px; + top: 8px; +} +.sidebar.menu-min .nav-list > li.active.open > a:after { + display: block; +} +.sidebar.menu-min .nav-list > li.active.open li.active > a:after { + display: none; +} +.sidebar.menu-min .nav-list > li > .submenu { + position: absolute; + z-index: 1026; + left: 42px; + top: -1px; + margin-top: 40px; + padding-bottom: 2px; + width: 176px; + display: none !important; +} +.sidebar.menu-min .nav-list > li > .submenu:before { + display: none; +} +.sidebar.menu-min .nav-list > li > .submenu:after { + content: ""; + display: block; + height: 1px; + width: 1px; + position: absolute; + right: -1px; + top: -1px; + border-right: 1px solid; + border-right-color: inherit; +} +.sidebar.menu-min .nav-list > li > .submenu li:before { + display: none; +} +.sidebar.menu-min .nav-list > li > .submenu li > a { + margin-left: 0; + padding-left: 22px; +} +.sidebar.menu-min .nav-list > li > .submenu li > a > .menu-icon { + left: 4px; +} +.sidebar.menu-min .nav-list > li.hover > .submenu { + padding-bottom: 0; +} +.sidebar.menu-min .nav-list > li.open > .submenu { + display: none; +} +.sidebar.menu-min .nav-list > li:hover > .submenu, +.sidebar.menu-min .nav-list > li.hover-show > .submenu { + display: block !important; +} +.sidebar.menu-min .nav-list > li > .arrow { + top: 10px; +} +.sidebar.menu-min .nav-list > li > .arrow:after, +.sidebar.menu-min .nav-list > li > .arrow:before { + border-width: 8px; + left: -16px; +} +.sidebar.menu-min .nav-list > li > .arrow:before { + left: -17px; +} +.sidebar.menu-min .nav-list li > .arrow { + right: -1px; +} +.sidebar.menu-min .nav-list > li:hover > .arrow, +.sidebar.menu-min .nav-list > li.hover-show > .arrow { + display: block; +} +.sidebar.menu-min .nav-list > li.pull_up > .arrow { + z-index: 1027; +} +.sidebar.menu-min .nav-list > li.pull_up > .arrow:after, +.sidebar.menu-min .nav-list > li.pull_up > .arrow:before { + border-width: 10px; + left: -20px; +} +.sidebar.menu-min .nav-list > li.pull_up > .arrow:before { + left: -21px; +} +.sidebar.menu-min .sidebar-shortcuts { + position: relative; + overflow: visible; + z-index: 1; +} +.sidebar.menu-min .sidebar-shortcuts-mini { + display: block; +} +.sidebar.menu-min .sidebar-shortcuts-large { + display: none; + position: absolute; + top: 0; + left: 42px; + width: 182px; + padding: 0 2px 3px; + border: 1px solid; + border-top-width: 0; +} +.sidebar.menu-min .sidebar-shortcuts:hover .sidebar-shortcuts-large, +.sidebar.menu-min .sidebar-shortcuts.hover-show .sidebar-shortcuts-large { + display: block; +} +.sidebar.menu-min .sidebar-toggle:before { + left: 5px; + right: 5px; +} +.sidebar.menu-min .sidebar-toggle > .ace-icon { + font-size: 13px; + padding: 0 4px; + line-height: 15px; + border-width: 1px; +} +.sidebar.menu-min .nav-list > li > .submenu li > .submenu > li > a { + margin-left: 2px; + padding-left: 30px; +} +.sidebar.menu-min .nav-list > li > .submenu li > .submenu > li > .submenu > li > a { + margin-left: 2px; + padding-left: 45px; +} +.sidebar.menu-min .nav-list > li > .submenu li.active > a:after { + display: none; +} +.sidebar.menu-min .nav-list li.active.open > .submenu > li.active > a:after { + display: none; +} +.sidebar.menu-min .nav-list > li.active:hover > a:after, +.sidebar.menu-min .nav-list > li.active.hover-show > a:after, +.sidebar.menu-min .nav-list > li.active.open:hover > a:after { + display: none; +} +.sidebar.menu-min .nav-list > li.active:hover:after { + display: none; +} +@media (min-width: 992px) { + .sidebar.menu-min .nav-list li.hover > .submenu { + margin-left: 0; + } + .sidebar.menu-min .nav-list > li > .submenu li.hover > .submenu > li > a, + .sidebar.menu-min .nav-list > li > .submenu li > .submenu > li.hover > .submenu > li > a { + margin-left: 0 !important; + } +} +@media (min-width: 992px) { + .sidebar.menu-min.compact .nav-list > li > a { + height: 39px; + line-height: 37px; + padding: 0 16px 0 7px; + position: relative; + } + .sidebar.menu-min.compact .nav-list > li > a > .menu-icon { + font-size: 18px; + height: auto; + line-height: inherit; + display: inline-block; + vertical-align: sub; + width: auto; + } +} +@media only screen and (min-width: 992px) { + .navbar.h-navbar { + -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.25); + box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.25); + } + .sidebar.h-sidebar { + position: relative; + float: none !important; + width: auto; + margin-top: 17px; + border-width: 0 !important; + box-shadow: none; + } + .sidebar.h-sidebar.menu-min, + .sidebar.h-sidebar.compact { + width: auto; + } + .sidebar.h-sidebar.sidebar-fixed { + position: fixed; + } + .sidebar.h-sidebar.no-gap { + margin-top: auto; + } + .sidebar.h-sidebar.no-gap .nav-list { + padding-top: 3px; + } + .sidebar.h-sidebar:before { + display: block; + position: absolute; + z-index: -1; + left: 0 !important; + right: 0 !important; + top: -17px; + bottom: auto; + height: 17px; + width: auto; + border-width: 0; + border-bottom: 1px solid; + border-bottom-color: inherit; + } + .sidebar.h-sidebar.lower-highlight .nav-list > li:before { + top: 0; + } + .main-content .sidebar.h-sidebar .nav-list > li:before { + top: 0; + } + .sidebar.h-sidebar .nav-list { + border-width: 0; + border-bottom: 2px solid #79b0ce; + } + .sidebar.h-sidebar .nav-list > li { + float: left; + border-width: 0 0 0 1px; + margin-left: 0; + } + .sidebar.h-sidebar .nav-list > li:last-child { + border-right-width: 1px; + } + .sidebar.h-sidebar .nav-list > li:before { + left: -1px; + right: -1px; + bottom: auto; + top: -2px; + max-width: none; + width: auto; + height: 2px; + border-width: 0; + } + .sidebar.h-sidebar .nav-list > li.active:before { + display: block; + } + .sidebar.h-sidebar .nav-list > li.active:after { + display: none; + } + .sidebar.h-sidebar .nav-list > li:first-child { + border-left-width: 0; + margin-left: 0; + } + .sidebar.h-sidebar .sidebar-shortcuts + .nav-list > li:first-child { + border-left-width: 1px; + margin-left: -1px; + } + .sidebar.h-sidebar .nav-list > li > a { + line-height: 22px; + height: auto; + padding: 10px 14px; + } + .sidebar.h-sidebar .nav-list > li > a > .menu-icon { + display: block; + margin: 1px 0 4px; + line-height: inherit; + width: auto; + } + .sidebar.h-sidebar .nav-list > li > a > .arrow { + display: none; + } + .sidebar.h-sidebar .nav-list > li.hover.pull_right { + float: none !important; + } + .sidebar.h-sidebar .nav-list > li.hover > .submenu { + top: 100%; + left: 1px; + margin-top: auto; + margin-left: -2px; + width: 190px; + z-index: 1026; + } + .sidebar.h-sidebar .nav-list > li.hover.pull_right > .submenu { + left: auto; + right: 1px; + } + .sidebar.h-sidebar .nav-list > li.hover > .arrow { + right: auto; + top: auto; + left: 24px; + bottom: 7px; + } + .sidebar.h-sidebar .nav-list > li.hover.pull_right > .arrow { + left: auto; + right: 24px; + } + .sidebar.h-sidebar .nav-list > li.hover > .arrow:before, + .sidebar.h-sidebar .nav-list > li.hover > .arrow:after { + border-width: 0 8px 8px !important; + } + .sidebar.h-sidebar .nav-list > li.hover > .arrow:after { + border-color: transparent; + border-left-color: transparent !important; + border-right-color: transparent !important; + -moz-border-right-colors: none !important; + -moz-border-left-colors: none !important; + -moz-border-top-colors: none; + -moz-border-bottom-colors: none; + left: -10px !important; + right: auto !important; + } + .sidebar.h-sidebar .nav-list > li.hover > .arrow:before { + border-color: transparent; + border-left-color: transparent !important; + border-right-color: transparent !important; + -moz-border-right-colors: none !important; + -moz-border-left-colors: none !important; + -moz-border-top-colors: none; + -moz-border-bottom-colors: none; + right: auto !important; + left: -10px !important; + top: -1px !important; + } + .sidebar.h-sidebar .nav-list > li.hover:hover > a ~ .arrow, + .sidebar.h-sidebar .nav-list > li.hover.hover-show > a ~ .arrow { + display: none; + } + .sidebar.h-sidebar .nav-list > li.hover:hover > a.dropdown-toggle ~ .arrow, + .sidebar.h-sidebar .nav-list > li.hover.hover-show > a.dropdown-toggle ~ .arrow { + display: block; + } + .sidebar.h-sidebar .nav-list > li.hover-flip > .submenu { + left: auto; + right: 1px; + margin-left: auto; + margin-right: -2px; + } + .sidebar.h-sidebar .nav-list > li.hover-flip > .arrow { + left: auto; + right: 24px; + } + .sidebar.h-sidebar .nav-list li li.hover-flip > .submenu { + left: auto; + right: 100%; + margin-left: auto; + margin-right: -2px; + } + .sidebar.h-sidebar .nav-list li li.hover-flip > .arrow { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1); + -moz-transform: scale(-1, 1); + -webkit-transform: scale(-1, 1); + -o-transform: scale(-1, 1); + -ms-transform: scale(-1, 1); + transform: scale(-1, 1); + left: 0; + right: auto; + } + .sidebar.h-sidebar .sidebar-shortcuts-large:before, + .sidebar.h-sidebar .sidebar-shortcuts-large:after { + display: block; + content: ""; + position: absolute; + left: 50%; + margin-left: -8px; + border: 1px solid transparent; + border-width: 0 8px 8px; + } + .sidebar.h-sidebar .sidebar-shortcuts-large:after { + border-right-color: transparent; + -moz-border-right-colors: none; + top: -8px; + } + .sidebar.h-sidebar .sidebar-shortcuts-large:before { + -moz-border-bottom-colors: #CCC; + border-bottom-color: #CCC; + top: -9px; + } + .sidebar.h-sidebar .sidebar-toggle { + position: absolute; + top: 12px; + right: 6px; + background-color: transparent; + border-width: 0; + } + .sidebar.h-sidebar .sidebar-shortcuts { + float: left; + display: block; + overflow: visible; + position: relative; + margin: 0; + padding: 12px 8px 9px; + max-height: none !important; + background-color: transparent; + } + .sidebar.h-sidebar .sidebar-shortcuts:hover .sidebar-shortcuts-large, + .sidebar.h-sidebar .sidebar-shortcuts.hover-show .sidebar-shortcuts-large { + display: block; + } + .sidebar.h-sidebar .sidebar-shortcuts-large { + display: none; + width: 52px; + height: auto; + position: absolute; + z-index: 1025; + top: 100%; + margin-top: -5px; + left: 10px; + padding: 3px 2px; + border: 1px solid; + } + .sidebar.h-sidebar .sidebar-shortcuts-mini { + width: auto; + max-width: 52px; + display: block; + background-color: transparent; + padding-top: 3px; + padding-bottom: 5px; + } + .sidebar.h-sidebar .sidebar-shortcuts-mini > .btn { + padding: 9px; + } + .sidebar.h-sidebar .nav-list a .badge, + .sidebar.h-sidebar .nav-list a .label { + position: absolute; + top: 11px; + right: auto !important; + left: 50%; + margin-left: 10px; + } + .sidebar.h-sidebar + .main-content { + margin-left: 0; + } + .sidebar.h-sidebar + .main-content .breadcrumbs { + margin: 6px 9px; + border: 1px solid; + border-color: #E5E5E5; + } + .h-sidebar.sidebar-fixed { + top: auto; + width: 100%; + left: 0; + right: 0; + } + .h-sidebar.sidebar-fixed:before { + z-index: auto; + } + .h-sidebar.sidebar-fixed, + .h-sidebar.sidebar-fixed .nav-list { + border-right-width: 0; + border-left-width: 0; + } + .h-sidebar.sidebar-fixed .sidebar-shortcuts { + border-width: 0; + } + .h-sidebar.sidebar-fixed + .main-content { + padding-top: 88px; + } + .h-sidebar.sidebar-fixed.no-gap + .main-content { + padding-top: 74px; + } + .h-sidebar.sidebar-fixed.menu-min + .main-content { + padding-top: 63px; + } + .h-sidebar.sidebar-fixed.menu-min.no-gap + .main-content { + padding-top: 49px; + } +} +@media only screen and (min-width: 992px) and (max-width: 991px) { + .sidebar.h-sidebar + .main-content .breadcrumbs { + margin: 0; + border-width: 0 0 1px; + } +} +.main-container.container .h-sidebar.sidebar-fixed { + left: 0; + right: 0; + width: auto; +} +@media (min-width: 768px) { + .main-container.container .h-sidebar.sidebar-fixed { + left: auto !important; + right: auto !important; + width: 744px; + } +} +@media (min-width: 992px) { + .main-container.container .h-sidebar.sidebar-fixed { + width: 964px; + } +} +@media (min-width: 1200px) { + .main-container.container .h-sidebar.sidebar-fixed { + width: 1164px; + } +} +/** + @media (min-width: @screen-sm-min) and (max-width: @grid-float-breakpoint-max) { + .main-container.container .sidebar.sidebar-fixed + { + left: auto;// !important; + right: auto;// !important; + width: @container-sm;// !important; + } + } + + + @media (max-width: @grid-float-breakpoint-max) { + .main-container.container .sidebar.sidebar-fixed { + .sidebar-shortcuts { + max-height: none; + border-bottom-width: 0; + } + } + } + */ +@media (min-width: 992px) { + .sidebar.h-sidebar.menu-min .nav.nav-list > li > a, + .sidebar.h-sidebar.menu-min.compact .nav.nav-list > li > a { + padding: 9px 12px; + } + .sidebar.h-sidebar.menu-min .nav-list > li > a > .menu-text { + left: -1px; + top: 100%; + width: 190px; + } + .sidebar.h-sidebar.menu-min .nav-list > li > a > .menu-icon { + margin: 2px 0; + } + .sidebar.h-sidebar.menu-min .nav-list > li.hover > .submenu { + top: 100%; + margin-top: 41px; + } + .sidebar.h-sidebar.menu-min .nav-list > li.hover:hover > a ~ .arrow, + .sidebar.h-sidebar.menu-min .nav-list > li.hover.hover-show > a ~ .arrow { + display: block; + } + .sidebar.h-sidebar.menu-min .sidebar-toggle { + top: 6px; + } + .sidebar.h-sidebar.menu-min .sidebar-shortcuts { + padding: 0; + } + .sidebar.h-sidebar.menu-min .sidebar-shortcuts-mini { + padding-bottom: 4px; + padding-top: 4px; + } + .sidebar.h-sidebar.menu-min .sidebar-shortcuts-mini > .btn { + padding: 8px; + } + .sidebar.h-sidebar.menu-min .sidebar-shortcuts-large { + left: 1px; + margin-top: 4px; + } + .sidebar.h-sidebar.compact .nav-list > li > a > .menu-icon { + font-size: 18px; + height: auto; + } + .sidebar.h-sidebar.compact.menu-min .nav-list > li > a { + height: auto; + line-height: 22px; + } +} +/** +@media only screen and (max-width: @grid-float-breakpoint-max) { + .menu-toggler + .sidebar.h-sidebar { + margin-top: (@breadcrumb-height - 1) !important; + } + .sidebar.h-sidebar.responsive-min , .sidebar.h-sidebar.navbar-collapse { + margin-top: auto !important; + } +} +*/ +.main-container .menu-toggler { + display: none; +} +@media only screen and (max-width: 991px) { + .sidebar.responsive:before { + display: none; + } + .sidebar.responsive { + -webkit-box-shadow: 2px 1px 2px 0 rgba(0,0,0,0.15); + box-shadow: 2px 1px 2px 0 rgba(0,0,0,0.15); + z-index: 1027; + overflow: hidden; + max-height: 0; + -moz-transform: translateX(-200px); + -webkit-transform: translateX(-200px); + -o-transform: translateX(-200px); + -ms-transform: translateX(-200px); + transform: translateX(-200px); + -webkit-transition: -webkit-transform 0.2s linear 0s, max-height 0s linear 0.2s; + -moz-transition: -moz-transform 0.2s linear 0s, max-height 0s linear 0.2s; + -o-transition: -o-transform 0.2s linear 0s, max-height 0s linear 0.2s; + transition: transform 0.2s linear 0s, max-height 0s linear 0.2s; + position: relative; + bottom: auto; + left: 190px; + margin-left: -190px; + } +} +@media (min-width: 992px) and (max-width: 991px) { + .sidebar.responsive.compact { + -moz-transform: translateX(-115px); + -webkit-transform: translateX(-115px); + -o-transform: translateX(-115px); + -ms-transform: translateX(-115px); + transform: translateX(-115px); + } + .sidebar.responsive.compact.push_away.display + .main-content { + -moz-transform: translateX(105px); + -webkit-transform: translateX(105px); + -o-transform: translateX(105px); + -ms-transform: translateX(105px); + transform: translateX(105px); + } + .navbar.navbar-fixed-top + .main-container .sidebar.responsive.compact.push_away.display ~ .footer .footer-inner { + -moz-transform: translateX(105px); + -webkit-transform: translateX(105px); + -o-transform: translateX(105px); + -ms-transform: translateX(105px); + transform: translateX(105px); + } +} +@media only screen and (max-width: 991px) { + .sidebar.responsive.menu-min { + -moz-transform: translateX(-53px); + -webkit-transform: translateX(-53px); + -o-transform: translateX(-53px); + -ms-transform: translateX(-53px); + transform: translateX(-53px); + } + .sidebar.responsive.display { + -moz-transform: none !important; + -webkit-transform: none !important; + -o-transform: none !important; + -ms-transform: none !important; + transform: none !important; + overflow: visible; + max-height: 2000px; + -webkit-transition-delay: 0s; + -moz-transition-delay: 0s; + -o-transition-delay: 0s; + transition-delay: 0s; + } + .sidebar.responsive.push_away { + -webkit-box-shadow: none !important; + box-shadow: none !important; + } + .sidebar.responsive.push_away:before { + display: block !important; + } + .sidebar.responsive.push_away + .main-content { + -webkit-transition: -webkit-transform 0.2s linear 0s; + -moz-transition: -moz-transform 0.2s linear 0s; + -o-transition: -o-transform 0.2s linear 0s; + transition: transform 0.2s linear 0s; + } + .sidebar.responsive.push_away.display + .main-content { + -moz-transform: translateX(190px); + -webkit-transform: translateX(190px); + -o-transform: translateX(190px); + -ms-transform: translateX(190px); + transform: translateX(190px); + } + .sidebar.responsive.push_away.display.menu-min + .main-content { + -moz-transform: translateX(43px); + -webkit-transform: translateX(43px); + -o-transform: translateX(43px); + -ms-transform: translateX(43px); + transform: translateX(43px); + } + .navbar.navbar-fixed-top + .main-container .sidebar.responsive.push_away:before { + height: 5000px; + } + .navbar.navbar-fixed-top + .main-container .sidebar.responsive.push_away ~ .footer .footer-inner { + -webkit-transition: -webkit-transform 0.2s linear 0s; + -moz-transition: -moz-transform 0.2s linear 0s; + -o-transition: -o-transform 0.2s linear 0s; + transition: transform 0.2s linear 0s; + } + .navbar.navbar-fixed-top + .main-container .sidebar.responsive.push_away.display ~ .footer .footer-inner { + -moz-transform: translateX(190px); + -webkit-transform: translateX(190px); + -o-transform: translateX(190px); + -ms-transform: translateX(190px); + transform: translateX(190px); + } + .navbar.navbar-fixed-top + .main-container .sidebar.responsive.push_away.display.menu-min ~ .footer .footer-inner { + -moz-transform: translateX(43px); + -webkit-transform: translateX(43px); + -o-transform: translateX(43px); + -ms-transform: translateX(43px); + transform: translateX(43px); + } + .sidebar.responsive + .main-content { + margin-left: 0 !important; + margin-right: 0 !important; + } +} +@media only screen and (min-width: 768px) and (max-width: 991px) { + .main-container.container .sidebar.responsive { + -webkit-transition: none; + -moz-transition: none; + -o-transition: none; + transition: none; + display: none; + } + .main-container.container .sidebar.responsive:before { + display: none !important; + } + .main-container.container .sidebar.responsive.display { + display: block; + } + .main-container.container .sidebar.responsive.push_away + .main-content, + .main-container.container .sidebar.responsive.push_away ~ .footer .footer-inner { + -webkit-transition: none !important; + -moz-transition: none !important; + -o-transition: none !important; + transition: none !important; + -moz-transform: none !important; + -webkit-transform: none !important; + -o-transform: none !important; + -ms-transform: none !important; + transform: none !important; + } +} +@media only screen and (max-width: 991px) { + .responsive.sidebar-fixed { + position: fixed; + } + .main-container .menu-toggler.fixed { + position: fixed; + left: auto; + z-index: 1026; + -moz-backface-visibility: hidden; + } +} +@media only screen and (max-width: 991px) { + .menu-toggler + .sidebar.responsive { + margin-top: 40px; + } + .main-container .menu-toggler { + display: block; + position: absolute; + z-index: 1026; + width: 52px; + height: 32px; + margin-right: 2px; + line-height: normal; + padding-left: 33px; + padding-top: 7px; + padding-bottom: 1px; + font-size: 13px; + font-weight: bold; + text-transform: uppercase; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + } + .main-container .menu-toggler:hover { + text-decoration: none; + } + .main-container .menu-toggler:focus { + outline: none; + } + .main-container .menu-toggler:before { + border-top: 1px solid #87b87f; + border-bottom: 1px solid #6fb3e0; + height: 2px; + width: 24px; + content: ""; + position: absolute; + z-index: 1; + top: 13px; + left: 4px; + -webkit-transition: all 0.1s ease; + -o-transition: all 0.1s ease; + transition: all 0.1s ease; + -o-transition: none; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + } + .main-container .menu-toggler:after { + border-top: 1px solid #ffa24d; + border-bottom: 1px solid #d15b47; + content: ""; + height: 2px; + width: 24px; + position: absolute; + top: 19px; + left: 4px; + -webkit-transition: all 0.1s ease; + -o-transition: all 0.1s ease; + transition: all 0.1s ease; + -o-transition: none; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + } + .main-container .menu-toggler.display:before { + height: 4px; + top: 8px; + border-width: 2px; + } + .main-container .menu-toggler.display:after { + height: 4px; + top: 20px; + border-width: 2px; + } + .main-container .menu-toggler > .toggler-text { + display: block; + position: absolute; + bottom: -9px; + left: 0; + border: 1px solid transparent; + border-width: 9px 42px 0; + border-top-color: #444444; + -moz-border-top-colors: #444444; + } + .main-container .menu-toggler > .toggler-text:after { + display: block; + content: "MENU"; + color: #ffffff; + position: absolute; + left: -8px; + top: -41px; + } + .menu-toggler + .responsive.sidebar-scroll .nav-wrap { + overflow: hidden; + } +} +@media only screen and (max-width: 320px) { + .main-container .menu-toggler { + width: 0; + } + .main-container .menu-toggler > .toggler-text { + border-width: 7px 16px; + bottom: -14px; + } + .main-container .menu-toggler > .toggler-text:after { + font-size: 9px; + font-weight: normal; + color: #FFF; + position: absolute; + left: -13px; + top: -42px; + } + .main-container .menu-toggler:before, + .main-container .menu-toggler:after { + margin-top: 8px; + } + .main-container .menu-toggler.display:before, + .main-container .menu-toggler.display:after { + height: 2px; + border-width: 1px; + } + .main-container .menu-toggler.display:before { + top: 13px; + } + .main-container .menu-toggler.display:after { + top: 19px; + } +} +.sidebar-toggle.sidebar-expand { + display: none; +} +@media (max-width: 991px) { + .menu-toggler.invisible { + position: fixed; + z-index: -999; + visibility: hidden; + opacity: 0; + width: 1px; + height: 1px; + } + .sidebar.responsive-min, + .sidebar.responsive-min.compact, + .sidebar.responsive-min.navbar-collapse { + width: 43px; + } + .sidebar.responsive-min + .main-content { + margin-left: 43px; + } + .sidebar.responsive-min .nav-list a .badge, + .sidebar.responsive-min .nav-list a .label { + position: relative; + top: -1px; + right: auto; + left: 4px; + } + .sidebar.responsive-min .nav-list .submenu .submenu a .badge, + .sidebar.responsive-min .nav-list .submenu .submenu a .label { + top: 0; + } + .sidebar.responsive-min .nav-list > li > a { + position: relative; + height: 39px; + line-height: 37px; + padding: 0; + } + .sidebar.responsive-min .nav-list > li > a > .menu-icon { + font-size: 18px; + height: auto; + line-height: inherit; + display: inline-block; + vertical-align: sub; + margin-right: 0; + width: 44px; + } + .sidebar.responsive-min .nav-list > li > a > .menu-text { + display: none; + text-align: left; + position: absolute; + top: -1px; + left: 42px; + z-index: 1025; + width: 176px; + height: 41px; + line-height: 38px; + padding-left: 12px; + border: 1px solid; + } + .sidebar.responsive-min .nav-list > li > a.dropdown-toggle > .menu-text { + top: -1px; + border-width: 1px 1px 0; + } + .sidebar.responsive-min .nav-list > li > a .arrow { + display: none; + } + .sidebar.responsive-min .nav-list > li:hover > a > .menu-text, + .sidebar.responsive-min .nav-list > li.hover-show > a > .menu-text { + display: block; + } + .sidebar.responsive-min .nav-list > li.active > a:after { + border-width: 10px 6px; + top: 8px; + } + .sidebar.responsive-min .nav-list > li.active.open > a:after { + display: block; + } + .sidebar.responsive-min .nav-list > li.active.open li.active > a:after { + display: none; + } + .sidebar.responsive-min .nav-list > li > .submenu { + position: absolute; + z-index: 1026; + left: 42px; + top: -1px; + margin-top: 40px; + padding-bottom: 2px; + width: 176px; + display: none !important; + } + .sidebar.responsive-min .nav-list > li > .submenu:before { + display: none; + } + .sidebar.responsive-min .nav-list > li > .submenu:after { + content: ""; + display: block; + height: 1px; + width: 1px; + position: absolute; + right: -1px; + top: -1px; + border-right: 1px solid; + border-right-color: inherit; + } + .sidebar.responsive-min .nav-list > li > .submenu li:before { + display: none; + } + .sidebar.responsive-min .nav-list > li > .submenu li > a { + margin-left: 0; + padding-left: 22px; + } + .sidebar.responsive-min .nav-list > li > .submenu li > a > .menu-icon { + left: 4px; + } + .sidebar.responsive-min .nav-list > li.hover > .submenu { + padding-bottom: 0; + } + .sidebar.responsive-min .nav-list > li.open > .submenu { + display: none; + } + .sidebar.responsive-min .nav-list > li:hover > .submenu, + .sidebar.responsive-min .nav-list > li.hover-show > .submenu { + display: block !important; + } + .sidebar.responsive-min .nav-list > li > .arrow { + top: 10px; + } + .sidebar.responsive-min .nav-list > li > .arrow:after, + .sidebar.responsive-min .nav-list > li > .arrow:before { + border-width: 8px; + left: -16px; + } + .sidebar.responsive-min .nav-list > li > .arrow:before { + left: -17px; + } + .sidebar.responsive-min .nav-list li > .arrow { + right: -1px; + } + .sidebar.responsive-min .nav-list > li:hover > .arrow, + .sidebar.responsive-min .nav-list > li.hover-show > .arrow { + display: block; + } + .sidebar.responsive-min .nav-list > li.pull_up > .arrow { + z-index: 1027; + } + .sidebar.responsive-min .nav-list > li.pull_up > .arrow:after, + .sidebar.responsive-min .nav-list > li.pull_up > .arrow:before { + border-width: 10px; + left: -20px; + } + .sidebar.responsive-min .nav-list > li.pull_up > .arrow:before { + left: -21px; + } + .sidebar.responsive-min .sidebar-shortcuts { + position: relative; + overflow: visible; + z-index: 1; + } + .sidebar.responsive-min .sidebar-shortcuts-mini { + display: block; + } + .sidebar.responsive-min .sidebar-shortcuts-large { + display: none; + position: absolute; + top: 0; + left: 42px; + width: 182px; + padding: 0 2px 3px; + border: 1px solid; + border-top-width: 0; + } + .sidebar.responsive-min .sidebar-shortcuts:hover .sidebar-shortcuts-large, + .sidebar.responsive-min .sidebar-shortcuts.hover-show .sidebar-shortcuts-large { + display: block; + } + .sidebar.responsive-min .sidebar-toggle:before { + left: 5px; + right: 5px; + } + .sidebar.responsive-min .sidebar-toggle > .ace-icon { + font-size: 13px; + padding: 0 4px; + line-height: 15px; + border-width: 1px; + } + .sidebar.responsive-min .nav-list > li > .submenu li > .submenu > li > a { + margin-left: 2px; + padding-left: 30px; + } + .sidebar.responsive-min .nav-list > li > .submenu li > .submenu > li > .submenu > li > a { + margin-left: 2px; + padding-left: 45px; + } + .sidebar.responsive-min .nav-list > li > .submenu li.active > a:after { + display: none; + } + .sidebar.responsive-min .nav-list li.active.open > .submenu > li.active > a:after { + display: none; + } + .sidebar.responsive-min .nav-list > li.active:hover > a:after, + .sidebar.responsive-min .nav-list > li.active.hover-show > a:after, + .sidebar.responsive-min .nav-list > li.active.open:hover > a:after { + display: none; + } + .sidebar.responsive-min .nav-list > li.active:hover:after { + display: none; + } + .sidebar.responsive-min:before { + display: block; + } + .sidebar.responsive-min .sidebar-toggle.sidebar-collapse { + display: none; + } + .sidebar.responsive-min .sidebar-toggle.sidebar-expand { + display: block; + } + .sidebar.responsive-min + .main-content { + margin-left: 43px !important; + } + .rtl .sidebar.responsive-min + .main-content { + margin-left: auto !important; + margin-right: 43px !important; + } + .sidebar.responsive-min + .main-content .breadcrumb { + margin-left: 12px; + } + .sidebar.responsive-max { + display: block; + position: relative; + left: 190px; + margin-left: -190px; + z-index: 1027; + -webkit-box-shadow: 2px 1px 2px 0 rgba(0,0,0,0.15); + box-shadow: 2px 1px 2px 0 rgba(0,0,0,0.15); + } + .sidebar.responsive-max:before { + display: none; + } + .sidebar.responsive-max .sidebar-toggle.sidebar-collapse { + display: none; + } + .sidebar.responsive-max .sidebar-toggle.sidebar-expand { + display: block; + z-index: 1; + } + .sidebar.responsive-max + .main-content { + margin-left: 43px !important; + } + .sidebar.responsive-max + .main-content .breadcrumb { + margin-left: 12px; + } +} +@media only screen and (min-width: 992px) { + .sidebar.navbar-collapse { + max-height: none; + } +} +@media only screen and (max-width: 991px) { + .sidebar.navbar-collapse { + position: relative; + float: none !important; + margin-top: auto !important; + z-index: 1; + width: 100% !important; + max-height: 340px; + margin-left: 0; + margin-right: 0; + } + .sidebar.navbar-collapse:before { + display: none; + } + .sidebar.navbar-collapse .nav-list > li:last-child { + border-bottom-width: 0; + } + .sidebar.navbar-collapse .nav-list > li > a { + padding-top: 10px !important; + padding-bottom: 10px !important; + line-height: 20px; + height: 41px; + } + .sidebar.navbar-collapse .nav-list > li:before { + height: 43px; + } + .sidebar.navbar-collapse .nav-list > li.active:after { + display: none; + } + .sidebar.navbar-collapse li > .arrow { + display: none !important; + } + .sidebar.navbar-collapse .nav-list li > .submenu { + border-left-width: 0; + } + .sidebar.navbar-collapse .sidebar-toggle { + display: none; + } + .sidebar.navbar-collapse .sidebar-shortcuts { + padding: 3px 0 6px; + max-height: none; + border-bottom-width: 0; + } + .sidebar.navbar-collapse + .main-content { + margin-left: 0 !important; + margin-right: 0 !important; + } + .sidebar.navbar-collapse + .main-content .breadcrumb { + margin-left: 12px; + } + .sidebar.navbar-collapse .nav-wrap + .ace-scroll { + display: none; + } + .sidebar.navbar-collapse.menu-min .nav-list > li > .submenu { + position: relative; + left: auto; + top: auto; + width: auto; + z-index: auto; + margin-top: auto; + padding-top: 0; + padding-bottom: 0; + border-width: 1px 0 0 0 !important; + -webkit-box-shadow: none !important; + box-shadow: none !important; + } + .sidebar.navbar-collapse.menu-min .nav-list > li > .submenu:before { + display: block; + } + .sidebar.navbar-collapse.menu-min .nav-list > li > .submenu > li:before { + display: block; + } + .sidebar.navbar-collapse.menu-min .nav-list > li > .submenu li > a > .menu-icon { + left: 10px; + } + .sidebar.navbar-collapse.menu-min .nav-list > li > .submenu:after { + display: none; + } + .sidebar.navbar-collapse.menu-min .nav-list > li > .submenu li > a { + padding: 7px 0 9px 37px; + } + .sidebar.navbar-collapse.menu-min .nav-list > li > .submenu li > .submenu > li > a { + margin-left: 20px; + padding-left: 22px; + } + .sidebar.navbar-collapse.menu-min .nav-list > li > .submenu li > .submenu > li > .submenu > li > a { + margin-left: 20px; + padding-left: 38px; + } + .sidebar.navbar-collapse.menu-min .nav-list > li > a:hover:before { + width: 3px; + } + .sidebar.navbar-collapse.menu-min .nav-list > li > a { + text-align: left; + padding-left: 7px; + } + .sidebar.navbar-collapse.menu-min .nav-list > li > a > .menu-icon { + display: inline-block; + width: auto; + margin-right: 2px; + } + .sidebar.navbar-collapse.menu-min .nav-list > li > a > .menu-text { + position: relative; + display: inline; + line-height: normal; + padding-left: 0; + height: auto; + top: auto; + left: auto; + z-index: auto; + width: auto; + border-width: 0 !important; + background-color: transparent !important; + -webkit-box-shadow: none !important; + box-shadow: none !important; + } + .sidebar.navbar-collapse.menu-min .nav-list a > .arrow { + display: block; + } + .sidebar.navbar-collapse.menu-min .nav-list > li:hover > .submenu { + display: none !important; + } + .sidebar.navbar-collapse.menu-min .nav-list > li.active > .submenu { + display: block !important; + } + .sidebar.navbar-collapse.menu-min .nav-list > li > .submenu.nav-show { + display: block !important; + } + .sidebar.navbar-collapse.menu-min .nav-list > li > .submenu.nav-hide { + display: none !important; + } + .sidebar.navbar-collapse.menu-min .sidebar-shortcuts-large { + display: block; + position: static; + -webkit-box-shadow: none !important; + box-shadow: none !important; + border-width: 0 !important; + background-color: transparent !important; + width: auto; + padding: 0; + } + .sidebar.navbar-collapse.menu-min .sidebar-shortcuts-mini { + display: none; + } + .sidebar.navbar-collapse .nav-list a .badge, + .sidebar.navbar-collapse .nav-list a .label { + position: relative; + top: -1px; + right: auto; + left: 4px; + } + .sidebar.navbar-collapse .nav-list > li.active:after, + .sidebar.navbar-collapse .nav-list li.active > a:before, + .sidebar.navbar-collapse .nav-list li.active > a:after { + display: none !important; + } + .sidebar.navbar-collapse .nav-list > li.highlight.active > a:before, + .sidebar.navbar-collapse .nav-list > li.highlight.active > a:after { + display: none !important; + } +} +@media (max-width: 991px) and (max-height: 400px) { + .sidebar.navbar-collapse { + max-height: 300px; + } +} +@media (max-width: 991px) and (max-height: 350px) { + .sidebar.navbar-collapse { + max-height: 250px; + } +} +@media (max-width: 991px) and (max-height: 300px) { + .sidebar.navbar-collapse { + max-height: 200px; + } +} +@media (max-width: 991px) and (max-height: 250px) { + .sidebar.navbar-collapse { + max-height: 150px; + } +} +@media (min-width: 992px) and (max-width: 991px) { + .sidebar.navbar-collapse .nav-list > li > .submenu li.hover > .submenu > li > a, + .sidebar.navbar-collapse .nav-list > li > .submenu li > .submenu > li.hover > .submenu > li > a { + margin-left: 20px !important; + } +} +@media (max-width: 991px) { + .navbar-fixed-top + .main-container .sidebar.navbar-collapse { + position: fixed; + z-index: 1027; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .navbar-fixed-top + .main-container.container .sidebar.navbar-collapse { + width: 744px !important; + } +} +.main-content-inner { + float: left; + width: 100%; +} +.main-content .sidebar:before { + top: 150px; +} +@media only screen and (min-width: 992px) { + body.mob-safari .sidebar.h-sidebar + .main-content .sidebar.sidebar-fixed:not(.h-sidebar) { + top: 131px; + } + body.mob-safari .sidebar.h-sidebar.no-gap + .main-content .sidebar.sidebar-fixed:not(.h-sidebar) { + top: 114px; + } + body.mob-safari .sidebar.h-sidebar.menu-min + .main-content .sidebar.sidebar-fixed:not(.h-sidebar) { + top: 106px; + } + body.mob-safari .sidebar.h-sidebar.menu-min.no-gap + .main-content .sidebar.sidebar-fixed:not(.h-sidebar) { + top: 89px; + } +} +@media only screen and (min-width: 992px) { + .h-navbar.navbar-fixed-top + .main-container .sidebar:not(.h-sidebar):before { + top: 150px; + } + .h-navbar.navbar-fixed-top + .main-container .sidebar:not(.h-sidebar) .nav-list { + padding-top: 3px; + } + .h-navbar.navbar-fixed-top + .main-container .sidebar:not(.h-sidebar) .sidebar-shortcuts ~ .nav-list, + .h-navbar.navbar-fixed-top + .main-container .sidebar:not(.h-sidebar) .sidebar-shortcuts ~ .nav-wrap-up .nav-list { + padding-top: 0; + } + .h-navbar.navbar-fixed-top + .main-container .sidebar:not(.h-sidebar) .sidebar-shortcuts { + padding-top: 3px; + min-height: 43px; + } + .h-navbar.navbar-fixed-top + .main-container .sidebar:not(.h-sidebar).menu-min .sidebar-shortcuts-large { + line-height: 40px; + } + .h-navbar.navbar-fixed-top + .main-container .main-content .sidebar:not(.h-sidebar) .nav-list { + padding-top: 0; + } + .h-navbar.navbar-fixed-top + .main-container .main-content .sidebar.sidebar-fixed { + z-index: 1026; + } + .main-content .h-sidebar { + padding-top: 1px; + margin-top: 0; + } + .main-content .h-sidebar:before { + display: none; + } + .main-content .h-sidebar + .page-content { + margin-left: auto; + } + .main-content .h-sidebar.sidebar-fixed { + left: 190px; + } + .main-content .h-sidebar.sidebar-fixed + .page-content { + margin-top: 74px; + } + .main-content .h-sidebar.sidebar-fixed.menu-min + .page-content { + margin-top: 49px; + } + .main-content .h-sidebar.menu-min .nav-list > li > a { + padding: 8px 12px 7px; + } + .sidebar.compact + .main-content .h-sidebar.sidebar-fixed { + left: 105px; + } + .sidebar.menu-min + .main-content .h-sidebar.sidebar-fixed { + left: 43px; + } + .navbar.navbar-fixed-top + .main-container .main-content .h-sidebar.sidebar-fixed { + padding-top: 3px; + } +} +.container.main-container .sidebar + .main-content .h-sidebar.sidebar-fixed { + left: auto; + right: auto; +} +@media (min-width: 992px) { + .container.main-container .sidebar.compact + .main-content .h-sidebar.sidebar-fixed { + width: 639px; + } +} +@media (min-width: 992px) { + .container.main-container .main-content .h-sidebar.sidebar-fixed { + width: 744px; + } + .container.main-container .sidebar + .main-content .h-sidebar.sidebar-fixed { + width: 554px; + } + .container.main-container .sidebar.menu-min + .main-content .h-sidebar.sidebar-fixed { + width: 701px; + } +} +@media (min-width: 992px) { + .container.main-container .sidebar.compact + .main-content .h-sidebar.sidebar-fixed { + width: 859px; + } +} +@media (min-width: 992px) { + .container.main-container .main-content .h-sidebar.sidebar-fixed { + width: 964px; + } + .container.main-container .sidebar + .main-content .h-sidebar.sidebar-fixed { + width: 774px; + } + .container.main-container .sidebar.menu-min + .main-content .h-sidebar.sidebar-fixed { + width: 921px; + } +} +@media (min-width: 1200px) { + .container.main-container .sidebar.compact + .main-content .h-sidebar.sidebar-fixed { + width: 1059px; + } +} +@media (min-width: 1200px) { + .container.main-container .main-content .h-sidebar.sidebar-fixed { + width: 1164px; + } + .container.main-container .sidebar + .main-content .h-sidebar.sidebar-fixed { + width: 974px; + } + .container.main-container .sidebar.menu-min + .main-content .h-sidebar.sidebar-fixed { + width: 1121px; + } +} +@media only screen and (max-width: 991px) { + .main-container .main-content .sidebar.sidebar-fixed { + z-index: 1026; + } + .navbar-fixed-top + .main-container .main-content .sidebar { + position: fixed; + z-index: 1026; + } +} +.sidebar-scroll .sidebar-shortcuts { + min-height: 41px; + border-bottom: 1px solid; +} +.sidebar-scroll .sidebar-toggle { + border-top: 1px solid; +} +.sidebar-scroll .nav-list > li:first-child { + border-top-width: 0; +} +.sidebar-scroll .nav-list > li:last-child { + border-bottom-width: 0; +} +.sidebar-scroll .nav-wrap .sidebar-shortcuts { + min-height: 40px; + border-bottom-width: 0; +} +.sidebar-scroll .nav-wrap .sidebar-shortcuts + .nav-list > li:first-child, +.sidebar-scroll .nav-wrap .sidebar-shortcuts + .nav-wrap-up .nav-list > li:first-child { + border-top-width: 1px; +} +.sidebar-scroll .nav-wrap-t .sidebar-toggle { + border-top-width: 0; +} +.sidebar-scroll .nav-wrap-t .nav-list > li:last-child { + border-bottom-width: 1px; +} +.sidebar .nav-wrap + .ace-scroll { + position: absolute; + right: 0; + top: 0; + z-index: 1; +} +.sidebar .nav-wrap + .scrollout { + right: -8px; +} +.sidebar .submenu.sub-scroll { + overflow-y: scroll; + overflow-x: hidden; + -webkit-overflow-scrolling: touch; +} +.ace-scroll { + overflow: hidden; +} +.scroll-content { + position: static; + overflow: hidden; +} +.scroll-disabled.ace-scroll, +.scroll-disabled.ace-scroll .scroll-content { + overflow: visible; +} +.scroll-track { + position: absolute; + top: auto; + bottom: auto; + right: 0; + height: auto; + background-color: #E7E7E7; + z-index: 99; + width: 0; + opacity: 0; +} +.scroll-bar { + position: absolute; + top: 0; + left: 0; + width: inherit; + background-color: #ACE; + background: #bbd4e5; +} +.scroll-track.scroll-hz { + top: auto; + left: auto; + right: auto; + bottom: 0; + height: 8px; + width: auto; +} +.scroll-hz .scroll-bar { + height: inherit; + width: auto; +} +.scroll-track.scroll-active { + -webkit-transition: width 0.25s ease 0.75s, opacity 0.25s ease 0.75s; + -o-transition: width 0.25s ease 0.75s, opacity 0.25s ease 0.75s; + transition: width 0.25s ease 0.75s, opacity 0.25s ease 0.75s; +} +.ace-scroll:hover .scroll-active, +.scroll-active.scroll-track:hover, +.scroll-active.scroll-track.scroll-hover, +.scroll-active.scroll-track.active, +.scroll-active.scroll-track:active { + width: 8px; + opacity: 1; + -webkit-transition-duration: 0.15s; + transition-duration: 0.15s; + -webkit-transition-delay: 0s; + transition-delay: 0s; +} +.scroll-track.active > .scroll-bar { + transition-property: none !important; + transition-duration: 0s !important; +} +.scroll-track.scroll-margin { + margin-left: -1px; +} +.scroll-track.scroll-left { + right: auto; + left: 0; +} +.scroll-track.scroll-left.scroll-margin { + margin-left: 1px; +} +.scroll-track.scroll-top { + bottom: auto; + top: 0; +} +.scroll-track.scroll-top.scroll-margin { + top: 1px; +} +.scroll-dark .scroll-bar { + background-color: transparent; + background-color: rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#40000000', endColorstr='#40000000',GradientType=0 ); +} +.scroll-track.scroll-dark { + background-color: transparent; + background-color: rgba(0, 0, 0, 0.15); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#26000000', endColorstr='#26000000',GradientType=0 ); +} +.scroll-light .scroll-bar { + background-color: transparent; + background-color: rgba(0, 0, 0, 0.14); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#24000000', endColorstr='#24000000',GradientType=0 ); +} +.scroll-track.scroll-light { + background-color: transparent; + background-color: rgba(0, 0, 0, 0.07); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#12000000', endColorstr='#12000000',GradientType=0 ); +} +.scroll-white .scroll-bar { + background-color: transparent; + background-color: rgba(255, 255, 255, 0.33); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#55FFFFFF', endColorstr='#55FFFFFF',GradientType=0 ); +} +.scroll-track.scroll-white { + background-color: transparent; + background-color: rgba(255, 255, 255, 0.2); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#33FFFFFF', endColorstr='#33FFFFFF',GradientType=0 ); +} +.no-track.scroll-track { + background-color: transparent; + filter: progid:DXImageTransform.Microsoft.gradient( enabled=false ); +} +.scroll-track.scroll-visible { + opacity: 1; + width: 8px; +} +.scroll-hz.scroll-visible { + height: 8px; + width: auto; +} +.scroll-thin.scroll-track:hover, +.scroll-thin.scroll-track.scroll-hover, +.scroll-thin.scroll-track:active, +.scroll-thin.scroll-track.active, +.scroll-thin.scroll-track.scroll-visible { + width: 6px; +} +.ace-scroll:hover .scroll-thin.scroll-track { + width: 6px; +} +.scroll-thin.scroll-hz:hover, +.scroll-thin.scroll-hz.scroll-hover, +.scroll-thin.scroll-hz:active, +.scroll-thin.scroll-hz.active, +.scroll-thin.scroll-hz.scroll-visible { + width: auto; + height: 6px; +} +.ace-scroll:hover .scroll-thin.scroll-hz { + width: auto; + height: 6px; +} +.scroll-chrome.scroll-active .scroll-bar { + background-color: transparent; + width: 11px; +} +.scroll-chrome.scroll-active .scroll-bar:before { + display: block; + content: ""; + position: absolute; + top: 1px; + bottom: 3px; + left: 1px; + right: 1px; + background-color: #D9D9D9; + border: 1px solid #BBB; + border-radius: 1px; +} +.scroll-chrome.scroll-active .scroll-track { + width: 12px; + background-color: #F2F2F2; + border: 1px solid; + border-width: 1px 0 1px 1px; + border-color: #E6E6E6 transparent #E6E6E6 #DBDBDB; +} +.scroll-chrome.scroll-active .scroll-track:hover .scroll-bar:before { + background-color: #C0C0C0; + border-color: #A6A6A6; +} +.scroll-chrome.scroll-active .scroll-track.active .scroll-bar:before { + background-color: #A9A9A9; + border-color: #8B8B8B; +} +.scroll-active.scroll-track.idle-hide { + opacity: 0; + filter: alpha(opacity=0); + width: 8px; +} +.scroll-active.scroll-track.idle-hide.not-idle { + width: 8px; + opacity: 1; + filter: alpha(opacity=100); +} +.scroll-active.scroll-thin.scroll-track.idle-hide { + width: 6px; +} +.scroll-active.scroll-chrome .scroll-track.idle-hide { + width: 12px; +} +.nav-wrap + .scroll-active .scroll-track { + width: 8px; +} +.nav-scroll.scroll-active .scroll-track { + width: 8px; + right: 0; +} +.nav-wrap:hover + .scroll-active .scroll-track, +.nav-scroll.scroll-active:hover .scroll-track { + width: 8px; + opacity: 1; + -webkit-transition-duration: 0.15s; + transition-duration: 0.15s; + -webkit-transition-delay: 0s; + transition-delay: 0s; +} +.nav-scroll.scroll-active:hover .scroll-track { + width: 8px; +} +.nav-scroll.ace-scroll, +.nav-scroll.ace-scroll .scroll-content { + overflow: hidden; +} +.nav-scroll.ace-scroll.scroll-disabled, +.nav-scroll.ace-scroll.scroll-disabled .scroll-content { + overflow: visible; +} +.scroll-track.scroll-detached { + position: absolute; + z-index: 1029; + bottom: auto; + right: auto; +} +.modal-content { + border-radius: 0; + -webkit-box-shadow: none; + box-shadow: none; +} +.modal-footer { + padding-top: 12px; + padding-bottom: 14px; + border-top-color: #e4e9ee; + -webkit-box-shadow: none; + box-shadow: none; + background-color: #eff3f8; +} +.modal-header .close { + font-size: 32px; +} +.modal.aside-dark .modal-content { + background-color: rgba(0, 0, 0, 0.85); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#D8000000', endColorstr='#D8000000',GradientType=0 ); +} +.modal.aside { + z-index: 999; + position: absolute; +} +.navbar-fixed-top ~ .modal.aside-vc { + z-index: 1025; +} +.modal.aside-fixed.aside-hz, +.navbar-fixed-top ~ .modal.aside-hz, +.navbar-fixed-bottom ~ .modal.aside-hz { + position: fixed; + z-index: 1039; +} +.modal.aside-fixed.aside-vc { + position: fixed; +} +.modal.aside.in { + z-index: 1040; + position: fixed; +} +.aside.aside-contained { + position: fixed; +} +.modal.aside-vc { + margin: auto; + width: 0; + left: auto; + right: auto; + top: 0; + bottom: 0; + display: block !important; + overflow: visible; +} +.modal.in.aside-vc { + width: 100%; +} +.modal.aside-vc .modal-dialog { + margin: inherit; + overflow: inherit; + width: 250px; + max-width: 66%; + height: inherit; + position: inherit; + right: inherit; + top: inherit; + bottom: inherit; + left: inherit; + opacity: 1; + transition: transform 0.3s ease-out 0s; + -webkit-transition: -webkit-transform 0.3s ease-out 0s; +} +@media only screen and (max-width: 319px) { + .modal.aside-vc .modal-dialog { + max-width: none; + width: 200px; + } + .aside-contained.aside-vc .modal-dialog { + width: 180px; + } +} +@media only screen and (max-width: 240px) { + .modal.aside-vc .modal-dialog { + max-width: none; + width: 160px; + } + .aside-contained.aside-vc .modal-dialog { + width: 140px; + } +} +.modal.aside-vc .modal-content { + height: 100%; + overflow: hidden; +} +.modal.in.aside-vc .modal-dialog { + transform: none; + -webkit-transform: none; + height: auto; +} +.modal.aside-vc .aside-trigger { + position: absolute; + top: 155px; + right: auto; + left: auto; + bottom: auto; + margin-top: -1px; + width: 37px; + outline: none; +} +.modal.aside-vc .aside-trigger.ace-settings-btn { + width: 42px; +} +.modal.in.aside-vc .aside-trigger { + z-index: -1; +} +.aside.modal.in .modal-backdrop.in + .modal-dialog .aside-trigger { + z-index: auto; +} +@media only screen and (max-height: 240px) { + .modal.aside-vc .aside-trigger { + top: 130px; + } +} +.modal.aside-vc.navbar-offset .modal-dialog { + top: 45px; +} +.modal.aside-vc.navbar-offset .modal-dialog .aside-trigger { + top: 110px; +} +@media (max-width: 479px) { + .navbar:not(.navbar-collapse) ~ .modal.aside-vc.navbar-offset .modal-dialog { + top: 90px; + } +} +.modal.aside-right { + right: 0; +} +.modal.aside-right .modal-content { + border-width: 0 0 0 1px; + box-shadow: -2px 1px 2px 0 rgba(0, 0, 0, 0.15); +} +.modal.aside-right .aside-trigger { + right: 100%; +} +.modal.aside-right .modal-dialog { + transform: translateX(100%); + -webkit-transform: translateX(100%); +} +.modal.aside-left { + left: 0; +} +.modal.aside-left .modal-content { + border-width: 0 1px 0 0; + box-shadow: 2px -1px 2px 0 rgba(0, 0, 0, 0.15); +} +.modal.aside-left .aside-trigger { + left: 100%; +} +.modal.aside-right .aside-trigger.btn.ace-settings-btn { + border-radius: 6px 0 0 6px; +} +.modal.aside-left .aside-trigger.btn.ace-settings-btn { + border-radius: 0 6px 6px 0; +} +.modal.aside-left .modal-dialog { + transform: translateX(-100%); + -webkit-transform: translateX(-100%); +} +.modal.aside-hz { + margin: auto; + height: 0; + left: 0; + right: 0; + top: auto; + bottom: auto; + display: block !important; + overflow: visible; +} +.modal.in.aside-hz { + height: 100%; +} +.modal.aside-hz .modal-dialog { + margin: inherit; + height: auto; + overflow: inherit; + max-height: 50%; + width: inherit; + position: inherit; + right: inherit; + top: inherit; + bottom: inherit; + left: inherit; + opacity: 1; + transition: transform 0.3s ease-out 0s; + -webkit-transition: -webkit-transform 0.3s ease-out 0s; +} +@media only screen and (max-height: 320px) { + .modal.aside-hz .modal-dialog { + max-height: 66%; + } +} +.modal.aside-hz .modal-content { + width: 100%; + overflow: hidden; +} +.modal.in.aside-hz .modal-dialog { + transform: none; + -webkit-transform: none; + height: auto; +} +.modal.aside-hz .aside-trigger { + position: absolute; + top: auto; + right: auto; + bottom: auto; + margin-top: -1px; + z-index: auto; + outline: none; + margin-left: -15px; + left: 50%; +} +.modal.aside-hz .aside-trigger.ace-settings-btn { + margin-left: -20px; +} +.modal.in.aside-hz .aside-trigger { + z-index: -1; +} +.modal.aside-top { + top: 0; +} +.modal.aside-top .modal-dialog { + transform: translateY(-100%); + -webkit-transform: translateY(-100%); +} +.modal.aside-top .modal-content { + border-width: 0; + box-shadow: 1px 2px 2px 0 rgba(0, 0, 0, 0.15); +} +.modal.aside-bottom { + bottom: 0; +} +.modal.aside-bottom .modal-dialog { + transform: translateY(100%); + -webkit-transform: translateY(100%); +} +.modal.aside-bottom .modal-content { + border-width: 0; + box-shadow: -1px 2px 2px 0 rgba(0, 0, 0, 0.15); +} +.modal.aside-bottom .aside-trigger { + bottom: 100%; + margin-top: auto; + margin-bottom: -1px; +} +.modal.aside-top .aside-trigger.ace-settings-btn { + border-radius: 0 0 6px 6px !important; +} +.modal.aside-bottom .aside-trigger.ace-settings-btn { + border-radius: 6px 6px 0 0 !important; +} +.aside.aside-hidden .modal-content { + display: none; +} +@media only screen and (min-width: 768px) { + .container.main-container ~ .modal.aside-vc .modal-dialog { + transition: none; + -webkit-transition: none; + } + .container.main-container ~ .modal.aside-vc:not(.in) .modal-content { + display: none; + } +} +.aside-vc.in.no-backdrop { + width: auto; +} +.aside-hz.in.no-backdrop { + height: auto; +} +.modal.aside .modal-backdrop { + position: fixed; + bottom: 0; + height: auto !important; +} +.modal.aside-hz .aside-trigger.align-left { + left: 15px; + margin-left: auto; + text-align: center; +} +.modal.aside-hz .aside-trigger.align-right { + text-align: center; + left: auto; + margin-left: auto; + right: 15px; +} +.modal.transition-off .modal-dialog { + transition: none; + -webkit-transition: none; +} +.breadcrumbs { + position: relative; + z-index: auto; + border-bottom: 1px solid #e5e5e5; + background-color: #f5f5f5; + min-height: 41px; + line-height: 40px; + padding: 0 12px 0 0; +} +.breadcrumb { + background-color: transparent; + display: inline-block; + line-height: 20px; + margin: 6px 22px 0 12px; + padding: 0; + font-size: 13px; + color: #333; + border-radius: 0; +} +.breadcrumb > li, +.breadcrumb > li.active { + color: #555555; + padding: 0 3px 0 3px; +} +.breadcrumb > li > a { + display: inline-block; + color: #4c8fbd; +} +.breadcrumb > li + li:before { + font-family: FontAwesome; + font-size: 14px; + content: "\f105"; + color: #b2b6bf; + padding: 0; + margin: 0 8px 0 0; + position: relative; + top: 1px; +} +.breadcrumb .home-icon { + font-size: 20px; + margin-left: 2px; + margin-right: 2px; + vertical-align: top; +} +@media only screen and (max-width: 480px) { + .breadcrumb > li > a { + padding: 0 1px; + } +} +@media only screen and (max-width: 991px) { + .menu-toggler + .sidebar.responsive + .main-content .breadcrumb { + margin-left: 90px; + } +} +@media only screen and (max-width: 320px) { + .breadcrumb { + margin-left: 8px; + } + .menu-toggler + .sidebar.responsive + .main-content .breadcrumb { + margin-left: 36px; + } +} +@media (min-width: 992px) { + .breadcrumbs-fixed { + position: fixed; + right: 0; + left: 0; + top: auto; + z-index: 1024; + } + .breadcrumbs-fixed + .page-content { + padding-top: 49px; + } + .sidebar + .main-content .breadcrumbs-fixed { + left: 190px; + } + body.mob-safari { + /** + //not needed because breadcrumbs is not fixed at this point + media (max-width: @screen-topbar-down) { + .navbar-fixed-top:not(.navbar-collapse) + .main-container .breadcrumbs-fixed { + top: (@navbar-min-height * 2); + } + }*/ + } + body.mob-safari .breadcrumbs-fixed { + top: 45px; + } +} +@media (min-width: 992px) { + .sidebar.compact + .main-content .breadcrumbs-fixed { + left: 105px; + } +} +@media (min-width: 992px) { + .sidebar.menu-min + .main-content .breadcrumbs-fixed { + left: 43px; + } +} +@media (min-width: 992px) and (max-width: 991px) { + .breadcrumbs-fixed, + .sidebar.menu-min + .main-content .breadcrumbs-fixed { + left: 0; + } + .sidebar.responsive-min + .main-content .breadcrumbs-fixed, + .sidebar.responsive-max + .main-content .breadcrumbs-fixed { + left: 43px; + } +} +@media (min-width: 992px) { + .container.main-container .breadcrumbs-fixed { + left: auto; + right: auto; + width: 744px; + } + .container.main-container .sidebar + .main-content .breadcrumbs-fixed { + left: auto; + right: auto; + width: 554px; + } + .container.main-container .sidebar.compact + .main-content .breadcrumbs-fixed { + width: 639px; + } + .container.main-container .sidebar.menu-min + .main-content .breadcrumbs-fixed { + left: auto; + right: auto; + width: 701px; + } +} +@media (min-width: 992px) { + .container.main-container .sidebar.compact + .main-content .breadcrumbs-fixed { + width: 859px; + } +} +@media (min-width: 992px) { + .container.main-container .breadcrumbs-fixed { + width: 964px; + } + .container.main-container .sidebar + .main-content .breadcrumbs-fixed { + width: 774px; + } + .container.main-container .sidebar.menu-min + .main-content .breadcrumbs-fixed { + width: 921px; + } +} +@media (min-width: 1200px) { + .container.main-container .sidebar.compact + .main-content .breadcrumbs-fixed { + width: 1059px; + } +} +@media (min-width: 1200px) { + .container.main-container .breadcrumbs-fixed { + width: 1164px; + } + .container.main-container .sidebar + .main-content .breadcrumbs-fixed { + width: 974px; + } + .container.main-container .sidebar.menu-min + .main-content .breadcrumbs-fixed { + width: 1121px; + } +} +@media (min-width: 992px) and (max-width: 991px) { + .container.main-container .sidebar.compact + .main-content .breadcrumbs-fixed { + width: 744px; + } +} +@media (min-width: 992px) and (max-width: 991px) { + .container.main-container .breadcrumbs-fixed, + .container.main-container .sidebar.menu-min + .main-content .breadcrumbs-fixed { + width: 744px; + } + .container.main-container .sidebar.responsive-min + .main-content .breadcrumbs-fixed, + .container.main-container .sidebar.responsive-max + .main-content .breadcrumbs-fixed { + left: auto; + right: auto; + width: 701px; + } +} +/** +@media (max-width: @grid-float-breakpoint-max) { + .breadcrumbs-fixed { + position: relative; + left: auto !important; + right: auto !important; + top: auto !important; + width: auto !important; + + + .page-content { + padding-top: @page-content-padding-top; + } + } +} +*/ +@media (min-width: 992px) { + .h-sidebar + .main-content .breadcrumbs.breadcrumbs-fixed { + position: relative; + top: auto; + left: auto; + z-index: auto; + width: auto; + } + .h-sidebar + .main-content .page-content { + padding-top: 12px; + } +} +.nav-search { + position: absolute; + right: 22px; + line-height: 24px; +} +.breadcrumbs .nav-search { + top: 6px; +} +.nav-search .form-search { + margin-bottom: 0; +} +.nav-search .nav-search-input { + border: 1px solid #6fb3e0; + width: 152px; + height: 28px !important; + padding-top: 2px; + padding-bottom: 2px; + border-radius: 4px !important; + font-size: 13px; + line-height: 1.3; + color: #666666 !important; + z-index: 11; + -webkit-transition: width ease .15s; + -o-transition: width ease .15s; + transition: width ease .15s; +} +.nav-search .nav-search-input + .dropdown-menu { + min-width: 0; + left: 0; + right: 0; +} +.nav-search .nav-search-input:focus, +.nav-search .nav-search-input:hover { + border-color: #6fb3e0; +} +.nav-search .nav-search-icon { + color: #6fb3e0 !important; + font-size: 14px !important; + line-height: 24px !important; + background-color: transparent; +} +.nav-search.minimized .nav-search-input { + width: 0; + opacity: 0; + filter: alpha(opacity=0); + max-width: 0; +} +.nav-search.minimized:hover .nav-search-input, +.nav-search.minimized .nav-search-btn:active + .nav-search-input, +.nav-search.minimized .nav-search-input:focus, +.nav-search.minimized .nav-search-input:hover, +.nav-search.minimized .nav-search-input:active { + opacity: 1; + filter: alpha(opacity=100); + width: 152px; + max-width: 152px; +} +.nav-search.minimized .nav-search-icon { + border: 1px solid; + border-radius: 100%; + background-color: #FFF; + padding: 0 5px !important; +} +.nav-search.minimized:hover .nav-search-icon, +.nav-search.minimized .nav-search-input:focus ~ .nav-search-icon, +.nav-search.minimized .nav-search-input:hover ~ .nav-search-icon, +.nav-search.minimized .nav-search-input:active ~ .nav-search-icon { + border: none; + border-radius: 0; + padding: 0 3px !important; +} +.nav-search-icon { + border: none; + border-radius: 0; + padding: 0 3px !important; +} +.sidebar > .nav-search { + position: static; + background-color: #FAFAFA; + border-bottom: 1px solid #DDD; + text-align: center; + height: 35px; + padding-top: 6px; +} +.sidebar > .nav-search .nav-search-input { + width: 162px !important; + border-radius: 0 !important; + max-width: 162px !important; + opacity: 1 !important; + filter: alpha(opacity=100) !important; +} +.sidebar > .nav-search .nav-search-input + .dropdown-menu { + text-align: left; +} +.sidebar.menu-min .nav-search .form-search { + position: absolute; + left: 5px; + z-index: 14; +} +.sidebar.menu-min .nav-search .nav-search-input { + width: 0 !important; + max-width: 0 !important; + opacity: 0 !important; + filter: alpha(opacity=0) !important; +} +.sidebar.menu-min .nav-search .nav-search-input:hover, +.sidebar.menu-min .nav-search .nav-search-input:focus, +.sidebar.menu-min .nav-search .nav-search-input:active { + width: 162px !important; + max-width: 162px !important; + opacity: 1 !important; + filter: alpha(opacity=100) !important; +} +.sidebar.menu-min .nav-search .nav-search-input:hover ~ #nav-search-icon, +.sidebar.menu-min .nav-search .nav-search-input:focus ~ #nav-search-icon, +.sidebar.menu-min .nav-search .nav-search-input:active ~ #nav-search-icon { + border: none; + border-radius: 0; + padding: 0 3px !important; +} +.sidebar.menu-min .nav-search:hover .nav-search-input { + width: 162px !important; + max-width: 162px !important; + opacity: 1 !important; + filter: alpha(opacity=100) !important; +} +.sidebar.menu-min .nav-search:hover .nav-search-input ~ .nav-search-icon { + border: none; + border-radius: 0; + padding: 0 3px !important; +} +.sidebar.menu-min .nav-search .nav-search-icon { + /* inside minimized sidebar */ + border: 1px solid; + border-radius: 32px; + background-color: #FFF; + padding: 0 5px !important; +} +@media (max-width: 991px) { + .sidebar.responsive-min .nav-search .form-search { + position: absolute; + left: 5px; + z-index: 14; + } + .sidebar.responsive-min .nav-search .nav-search-input { + width: 0 !important; + max-width: 0 !important; + opacity: 0 !important; + filter: alpha(opacity=0) !important; + } + .sidebar.responsive-min .nav-search .nav-search-input:hover, + .sidebar.responsive-min .nav-search .nav-search-input:focus, + .sidebar.responsive-min .nav-search .nav-search-input:active { + width: 162px !important; + max-width: 162px !important; + opacity: 1 !important; + filter: alpha(opacity=100) !important; + } + .sidebar.responsive-min .nav-search .nav-search-input:hover ~ #nav-search-icon, + .sidebar.responsive-min .nav-search .nav-search-input:focus ~ #nav-search-icon, + .sidebar.responsive-min .nav-search .nav-search-input:active ~ #nav-search-icon { + border: none; + border-radius: 0; + padding: 0 3px !important; + } + .sidebar.responsive-min .nav-search:hover .nav-search-input { + width: 162px !important; + max-width: 162px !important; + opacity: 1 !important; + filter: alpha(opacity=100) !important; + } + .sidebar.responsive-min .nav-search:hover .nav-search-input ~ .nav-search-icon { + border: none; + border-radius: 0; + padding: 0 3px !important; + } + .sidebar.responsive-min .nav-search .nav-search-icon { + /* inside minimized sidebar */ + border: 1px solid; + border-radius: 32px; + background-color: #FFF; + padding: 0 5px !important; + } +} +@media only screen and (max-width: 991px) { + .nav-search { + right: 10px; + } + .nav-search .nav-search-input { + width: 105px; + } + .nav-search:hover .nav-search-input, + .nav-search .nav-search-btn:active + .nav-search-input, + .nav-search .nav-search-input:focus, + .nav-search .nav-search-input:hover, + .nav-search .nav-search-input:active { + width: 145px; + } +} +@media only screen and (max-width: 767px) { + .nav-search .nav-search-input { + width: 0; + opacity: 0; + filter: alpha(opacity=0); + max-width: 0; + } + .nav-search:hover .nav-search-input, + .nav-search .nav-search-btn:active + .nav-search-input, + .nav-search .nav-search-input:focus, + .nav-search .nav-search-input:hover, + .nav-search .nav-search-input:active { + opacity: 1; + filter: alpha(opacity=100); + width: 152px; + max-width: 152px; + } + .nav-search .nav-search-icon { + border: 1px solid; + border-radius: 100%; + background-color: #FFF; + padding: 0 5px !important; + } + .nav-search:hover .nav-search-icon, + .nav-search .nav-search-input:focus ~ .nav-search-icon, + .nav-search .nav-search-input:hover ~ .nav-search-icon, + .nav-search .nav-search-input:active ~ .nav-search-icon { + border: none; + border-radius: 0; + padding: 0 3px !important; + } +} +.footer { + padding-top: 75px; + height: 0; + width: 0; +} +.footer .footer-inner { + text-align: center; + position: absolute; + z-index: auto; + left: 0; + right: 0; + bottom: 0; +} +.sidebar ~ .footer .footer-inner { + left: 190px; +} +@media (min-width: 992px) { + .sidebar.compact ~ .footer .footer-inner { + left: 105px; + } +} +.sidebar.menu-min ~ .footer .footer-inner { + left: 43px; +} +@media (min-width: 992px) { + .sidebar.h-sidebar ~ .footer .footer-inner { + left: 0; + } +} +@media (max-width: 991px) { + .footer .footer-inner, + .sidebar ~ .footer .footer-inner, + .sidebar.compact ~ .footer .footer-inner, + .sidebar.menu-min ~ .footer .footer-inner { + left: 0; + } + .sidebar.responsive-min ~ .footer .footer-inner { + left: 43px; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .container.main-container .footer .footer-inner { + left: auto !important; + right: auto !important; + margin-left: auto; + width: 744px; + } +} +@media (min-width: 992px) { + .container.main-container .footer .footer-inner { + left: auto !important; + right: auto !important; + width: 964px; + } +} +@media (min-width: 1200px) { + .container.main-container .footer .footer-inner { + width: 1164px; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .container.main-container .sidebar ~ .footer .footer-inner { + left: auto !important; + right: auto !important; + margin-left: auto; + width: 744px; + } +} +@media (min-width: 992px) { + .container.main-container .sidebar ~ .footer .footer-inner { + left: auto !important; + right: auto !important; + margin-left: 190px; + width: 774px; + } +} +@media (min-width: 1200px) { + .container.main-container .sidebar ~ .footer .footer-inner { + margin-left: 190px; + width: 974px; + } +} +@media (min-width: 992px) { + .container.main-container .sidebar.compact ~ .footer .footer-inner { + margin-left: 105px; + width: 859px; + } +} +@media (min-width: 1200px) { + .container.main-container .sidebar.compact ~ .footer .footer-inner { + margin-left: 105px; + width: 1059px; + } +} +@media (min-width: 992px) { + .container.main-container .sidebar.menu-min ~ .footer .footer-inner { + margin-left: 43px; + width: 921px; + } +} +@media (min-width: 1200px) { + .container.main-container .sidebar.menu-min ~ .footer .footer-inner { + margin-left: 43px; + width: 1121px; + } +} +@media (min-width: 992px) { + .container.main-container .sidebar.h-sidebar ~ .footer .footer-inner { + margin-left: 0; + width: 964px; + } +} +@media (min-width: 992px) { + .container.main-container .sidebar.h-sidebar ~ .footer .footer-inner { + margin-left: 0; + width: 964px; + } +} +@media (min-width: 1200px) { + .container.main-container .sidebar.h-sidebar ~ .footer .footer-inner { + margin-left: 0; + width: 1164px; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .container.main-container .sidebar.responsive-min ~ .footer .footer-inner { + margin-left: 43px; + width: 701px; + } +} +.footer .footer-inner .footer-content { + position: absolute; + left: 12px; + right: 12px; + bottom: 4px; + padding: 8px; + line-height: 36px; + border-top: 3px double #E5E5E5; +} +.footer.footer-fixed .footer-inner { + position: fixed; + z-index: 999; + bottom: 0; +} +.footer.footer-fixed .footer-inner .footer-content { + left: 2px; + right: 2px; + bottom: 2px; + border: 1px solid #DDD; + background-color: #F2F2F2; +} +.footer.footer-fixed + .btn-scroll-up { + z-index: 999; +} +.btn { + display: inline-block; + color: #FFF !important; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-image: none !important; + border: 5px solid #FFF; + border-radius: 0; + box-shadow: none !important; + -webkit-transition: background-color 0.15s, border-color 0.15s, opacity 0.15s; + -o-transition: background-color 0.15s, border-color 0.15s, opacity 0.15s; + transition: background-color 0.15s, border-color 0.15s, opacity 0.15s; + cursor: pointer; + vertical-align: middle; + margin: 0; + position: relative; + /** + &:hover, &:focus, &.focus, .open > &.dropdown-toggle { + color: #FFF; + box-shadow: none; + } + */ +} +.btn.active, +.open > .btn.active.dropdown-toggle { + box-shadow: none; +} +.btn-lg, +.btn-group-lg > .btn { + border-width: 5px; + line-height: 1.4; + padding: 5px 16px 6px; +} +.btn-xlg, +.btn-group-xlg > .btn { + border-width: 5px; + line-height: 1.35; + padding: 7px 16px; + font-size: 18px; +} +.btn-sm, +.btn-group-sm > .btn { + border-width: 4px; + font-size: 13px; + padding: 4px 9px; + line-height: 1.38; +} +.btn-xs, +.btn-group-xs > .btn { + padding-top: 3px; + padding-bottom: 3px; + border-width: 3px; +} +.btn-mini, +.btn-group-mini > .btn { + padding: 1px 5px; + border-width: 3px; + font-size: 12px; + line-height: 1.5; +} +.btn-minier, +.btn-group-minier > .btn { + padding: 0 4px; + line-height: 18px; + border-width: 2px; + font-size: 12px; +} +button.btn:active { + top: 1px; +} +.btn, +.btn-default, +.btn:focus, +.btn-default:focus { + background-color: #abbac3 !important; + border-color: #abbac3; +} +.btn:hover, +.btn-default:hover, +.btn:active, +.btn-default:active, +.open > .btn.dropdown-toggle, +.open > .btn-default.dropdown-toggle { + background-color: #8b9aa3 !important; + border-color: #abbac3; +} +.btn.no-border:hover, +.btn-default.no-border:hover, +.btn.no-border:active, +.btn-default.no-border:active { + border-color: #8b9aa3; +} +.btn.no-hover:hover, +.btn-default.no-hover:hover, +.btn.no-hover:active, +.btn-default.no-hover:active { + background-color: #abbac3 !important; +} +.btn.active, +.btn-default.active { + background-color: #9baab3 !important; + border-color: #8799a4; +} +.btn.no-border.active, +.btn-default.no-border.active { + background-color: #92a3ac !important; + border-color: #92a3ac; +} +.btn.disabled, +.btn-default.disabled, +.btn[disabled], +.btn-default[disabled], +fieldset[disabled] .btn, +fieldset[disabled] .btn-default, +.btn.disabled:hover, +.btn-default.disabled:hover, +.btn[disabled]:hover, +.btn-default[disabled]:hover, +fieldset[disabled] .btn:hover, +fieldset[disabled] .btn-default:hover, +.btn.disabled:focus, +.btn-default.disabled:focus, +.btn[disabled]:focus, +.btn-default[disabled]:focus, +fieldset[disabled] .btn:focus, +fieldset[disabled] .btn-default:focus, +.btn.disabled:active, +.btn-default.disabled:active, +.btn[disabled]:active, +.btn-default[disabled]:active, +fieldset[disabled] .btn:active, +fieldset[disabled] .btn-default:active, +.btn.disabled.active, +.btn-default.disabled.active, +.btn[disabled].active, +.btn-default[disabled].active, +fieldset[disabled] .btn.active, +fieldset[disabled] .btn-default.active { + background-color: #abbac3 !important; + border-color: #abbac3; +} +.btn-primary, +.btn-primary:focus { + background-color: #428bca !important; + border-color: #428bca; +} +.btn-primary:hover, +.btn-primary:active, +.open > .btn-primary.dropdown-toggle { + background-color: #1b6aaa !important; + border-color: #428bca; +} +.btn-primary.no-border:hover, +.btn-primary.no-border:active { + border-color: #1b6aaa; +} +.btn-primary.no-hover:hover, +.btn-primary.no-hover:active { + background-color: #428bca !important; +} +.btn-primary.active { + background-color: #2f7bba !important; + border-color: #27689d; +} +.btn-primary.no-border.active { + background-color: #2b72ae !important; + border-color: #2b72ae; +} +.btn-primary.disabled, +.btn-primary[disabled], +fieldset[disabled] .btn-primary, +.btn-primary.disabled:hover, +.btn-primary[disabled]:hover, +fieldset[disabled] .btn-primary:hover, +.btn-primary.disabled:focus, +.btn-primary[disabled]:focus, +fieldset[disabled] .btn-primary:focus, +.btn-primary.disabled:active, +.btn-primary[disabled]:active, +fieldset[disabled] .btn-primary:active, +.btn-primary.disabled.active, +.btn-primary[disabled].active, +fieldset[disabled] .btn-primary.active { + background-color: #428bca !important; + border-color: #428bca; +} +.btn-info, +.btn-info:focus { + background-color: #6fb3e0 !important; + border-color: #6fb3e0; +} +.btn-info:hover, +.btn-info:active, +.open > .btn-info.dropdown-toggle { + background-color: #4f99c6 !important; + border-color: #6fb3e0; +} +.btn-info.no-border:hover, +.btn-info.no-border:active { + border-color: #4f99c6; +} +.btn-info.no-hover:hover, +.btn-info.no-hover:active { + background-color: #6fb3e0 !important; +} +.btn-info.active { + background-color: #5fa6d3 !important; + border-color: #4396cb; +} +.btn-info.no-border.active { + background-color: #539fd0 !important; + border-color: #539fd0; +} +.btn-info.disabled, +.btn-info[disabled], +fieldset[disabled] .btn-info, +.btn-info.disabled:hover, +.btn-info[disabled]:hover, +fieldset[disabled] .btn-info:hover, +.btn-info.disabled:focus, +.btn-info[disabled]:focus, +fieldset[disabled] .btn-info:focus, +.btn-info.disabled:active, +.btn-info[disabled]:active, +fieldset[disabled] .btn-info:active, +.btn-info.disabled.active, +.btn-info[disabled].active, +fieldset[disabled] .btn-info.active { + background-color: #6fb3e0 !important; + border-color: #6fb3e0; +} +.btn-info2, +.btn-info2:focus { + background-color: #95c6e5 !important; + border-color: #95c6e5; +} +.btn-info2:hover, +.btn-info2:active, +.open > .btn-info2.dropdown-toggle { + background-color: #67a6ce !important; + border-color: #95c6e5; +} +.btn-info2.no-border:hover, +.btn-info2.no-border:active { + border-color: #67a6ce; +} +.btn-info2.no-hover:hover, +.btn-info2.no-hover:active { + background-color: #95c6e5 !important; +} +.btn-info2.active { + background-color: #7eb6da !important; + border-color: #62a6d1; +} +.btn-info2.no-border.active { + background-color: #72afd6 !important; + border-color: #72afd6; +} +.btn-info2.disabled, +.btn-info2[disabled], +fieldset[disabled] .btn-info2, +.btn-info2.disabled:hover, +.btn-info2[disabled]:hover, +fieldset[disabled] .btn-info2:hover, +.btn-info2.disabled:focus, +.btn-info2[disabled]:focus, +fieldset[disabled] .btn-info2:focus, +.btn-info2.disabled:active, +.btn-info2[disabled]:active, +fieldset[disabled] .btn-info2:active, +.btn-info2.disabled.active, +.btn-info2[disabled].active, +fieldset[disabled] .btn-info2.active { + background-color: #95c6e5 !important; + border-color: #95c6e5; +} +.btn-success, +.btn-success:focus { + background-color: #87b87f !important; + border-color: #87b87f; +} +.btn-success:hover, +.btn-success:active, +.open > .btn-success.dropdown-toggle { + background-color: #629b58 !important; + border-color: #87b87f; +} +.btn-success.no-border:hover, +.btn-success.no-border:active { + border-color: #629b58; +} +.btn-success.no-hover:hover, +.btn-success.no-hover:active { + background-color: #87b87f !important; +} +.btn-success.active { + background-color: #75aa6c !important; + border-color: #629959; +} +.btn-success.no-border.active { + background-color: #6ba462 !important; + border-color: #6ba462; +} +.btn-success.disabled, +.btn-success[disabled], +fieldset[disabled] .btn-success, +.btn-success.disabled:hover, +.btn-success[disabled]:hover, +fieldset[disabled] .btn-success:hover, +.btn-success.disabled:focus, +.btn-success[disabled]:focus, +fieldset[disabled] .btn-success:focus, +.btn-success.disabled:active, +.btn-success[disabled]:active, +fieldset[disabled] .btn-success:active, +.btn-success.disabled.active, +.btn-success[disabled].active, +fieldset[disabled] .btn-success.active { + background-color: #87b87f !important; + border-color: #87b87f; +} +.btn-warning, +.btn-warning:focus { + background-color: #ffb752 !important; + border-color: #ffb752; +} +.btn-warning:hover, +.btn-warning:active, +.open > .btn-warning.dropdown-toggle { + background-color: #e59729 !important; + border-color: #ffb752; +} +.btn-warning.no-border:hover, +.btn-warning.no-border:active { + border-color: #e59729; +} +.btn-warning.no-hover:hover, +.btn-warning.no-hover:active { + background-color: #ffb752 !important; +} +.btn-warning.active { + background-color: #f2a73e !important; + border-color: #f0981c; +} +.btn-warning.no-border.active { + background-color: #f1a02f !important; + border-color: #f1a02f; +} +.btn-warning.disabled, +.btn-warning[disabled], +fieldset[disabled] .btn-warning, +.btn-warning.disabled:hover, +.btn-warning[disabled]:hover, +fieldset[disabled] .btn-warning:hover, +.btn-warning.disabled:focus, +.btn-warning[disabled]:focus, +fieldset[disabled] .btn-warning:focus, +.btn-warning.disabled:active, +.btn-warning[disabled]:active, +fieldset[disabled] .btn-warning:active, +.btn-warning.disabled.active, +.btn-warning[disabled].active, +fieldset[disabled] .btn-warning.active { + background-color: #ffb752 !important; + border-color: #ffb752; +} +.btn-danger, +.btn-danger:focus { + background-color: #d15b47 !important; + border-color: #d15b47; +} +.btn-danger:hover, +.btn-danger:active, +.open > .btn-danger.dropdown-toggle { + background-color: #b74635 !important; + border-color: #d15b47; +} +.btn-danger.no-border:hover, +.btn-danger.no-border:active { + border-color: #b74635; +} +.btn-danger.no-hover:hover, +.btn-danger.no-hover:active { + background-color: #d15b47 !important; +} +.btn-danger.active { + background-color: #c4513e !important; + border-color: #aa4434; +} +.btn-danger.no-border.active { + background-color: #ba4b39 !important; + border-color: #ba4b39; +} +.btn-danger.disabled, +.btn-danger[disabled], +fieldset[disabled] .btn-danger, +.btn-danger.disabled:hover, +.btn-danger[disabled]:hover, +fieldset[disabled] .btn-danger:hover, +.btn-danger.disabled:focus, +.btn-danger[disabled]:focus, +fieldset[disabled] .btn-danger:focus, +.btn-danger.disabled:active, +.btn-danger[disabled]:active, +fieldset[disabled] .btn-danger:active, +.btn-danger.disabled.active, +.btn-danger[disabled].active, +fieldset[disabled] .btn-danger.active { + background-color: #d15b47 !important; + border-color: #d15b47; +} +.btn-inverse, +.btn-inverse:focus { + background-color: #555555 !important; + border-color: #555555; +} +.btn-inverse:hover, +.btn-inverse:active, +.open > .btn-inverse.dropdown-toggle { + background-color: #303030 !important; + border-color: #555555; +} +.btn-inverse.no-border:hover, +.btn-inverse.no-border:active { + border-color: #303030; +} +.btn-inverse.no-hover:hover, +.btn-inverse.no-hover:active { + background-color: #555555 !important; +} +.btn-inverse.active { + background-color: #434343 !important; + border-color: #313131; +} +.btn-inverse.no-border.active { + background-color: #3b3b3b !important; + border-color: #3b3b3b; +} +.btn-inverse.disabled, +.btn-inverse[disabled], +fieldset[disabled] .btn-inverse, +.btn-inverse.disabled:hover, +.btn-inverse[disabled]:hover, +fieldset[disabled] .btn-inverse:hover, +.btn-inverse.disabled:focus, +.btn-inverse[disabled]:focus, +fieldset[disabled] .btn-inverse:focus, +.btn-inverse.disabled:active, +.btn-inverse[disabled]:active, +fieldset[disabled] .btn-inverse:active, +.btn-inverse.disabled.active, +.btn-inverse[disabled].active, +fieldset[disabled] .btn-inverse.active { + background-color: #555555 !important; + border-color: #555555; +} +.btn-pink, +.btn-pink:focus { + background-color: #d6487e !important; + border-color: #d6487e; +} +.btn-pink:hover, +.btn-pink:active, +.open > .btn-pink.dropdown-toggle { + background-color: #b73766 !important; + border-color: #d6487e; +} +.btn-pink.no-border:hover, +.btn-pink.no-border:active { + border-color: #b73766; +} +.btn-pink.no-hover:hover, +.btn-pink.no-hover:active { + background-color: #d6487e !important; +} +.btn-pink.active { + background-color: #c74072 !important; + border-color: #af3462; +} +.btn-pink.no-border.active { + background-color: #be386a !important; + border-color: #be386a; +} +.btn-pink.disabled, +.btn-pink[disabled], +fieldset[disabled] .btn-pink, +.btn-pink.disabled:hover, +.btn-pink[disabled]:hover, +fieldset[disabled] .btn-pink:hover, +.btn-pink.disabled:focus, +.btn-pink[disabled]:focus, +fieldset[disabled] .btn-pink:focus, +.btn-pink.disabled:active, +.btn-pink[disabled]:active, +fieldset[disabled] .btn-pink:active, +.btn-pink.disabled.active, +.btn-pink[disabled].active, +fieldset[disabled] .btn-pink.active { + background-color: #d6487e !important; + border-color: #d6487e; +} +.btn-purple, +.btn-purple:focus { + background-color: #9585bf !important; + border-color: #9585bf; +} +.btn-purple:hover, +.btn-purple:active, +.open > .btn-purple.dropdown-toggle { + background-color: #7461aa !important; + border-color: #9585bf; +} +.btn-purple.no-border:hover, +.btn-purple.no-border:active { + border-color: #7461aa; +} +.btn-purple.no-hover:hover, +.btn-purple.no-hover:active { + background-color: #9585bf !important; +} +.btn-purple.active { + background-color: #8573b5 !important; + border-color: #705ca8; +} +.btn-purple.no-border.active { + background-color: #7c69af !important; + border-color: #7c69af; +} +.btn-purple.disabled, +.btn-purple[disabled], +fieldset[disabled] .btn-purple, +.btn-purple.disabled:hover, +.btn-purple[disabled]:hover, +fieldset[disabled] .btn-purple:hover, +.btn-purple.disabled:focus, +.btn-purple[disabled]:focus, +fieldset[disabled] .btn-purple:focus, +.btn-purple.disabled:active, +.btn-purple[disabled]:active, +fieldset[disabled] .btn-purple:active, +.btn-purple.disabled.active, +.btn-purple[disabled].active, +fieldset[disabled] .btn-purple.active { + background-color: #9585bf !important; + border-color: #9585bf; +} +.btn-grey, +.btn-grey:focus { + background-color: #a0a0a0 !important; + border-color: #a0a0a0; +} +.btn-grey:hover, +.btn-grey:active, +.open > .btn-grey.dropdown-toggle { + background-color: #888888 !important; + border-color: #a0a0a0; +} +.btn-grey.no-border:hover, +.btn-grey.no-border:active { + border-color: #888888; +} +.btn-grey.no-hover:hover, +.btn-grey.no-hover:active { + background-color: #a0a0a0 !important; +} +.btn-grey.active { + background-color: #949494 !important; + border-color: #828282; +} +.btn-grey.no-border.active { + background-color: #8c8c8c !important; + border-color: #8c8c8c; +} +.btn-grey.disabled, +.btn-grey[disabled], +fieldset[disabled] .btn-grey, +.btn-grey.disabled:hover, +.btn-grey[disabled]:hover, +fieldset[disabled] .btn-grey:hover, +.btn-grey.disabled:focus, +.btn-grey[disabled]:focus, +fieldset[disabled] .btn-grey:focus, +.btn-grey.disabled:active, +.btn-grey[disabled]:active, +fieldset[disabled] .btn-grey:active, +.btn-grey.disabled.active, +.btn-grey[disabled].active, +fieldset[disabled] .btn-grey.active { + background-color: #a0a0a0 !important; + border-color: #a0a0a0; +} +.btn-yellow { + color: #996633 !important; + text-shadow: 0 -1px 0 rgba(255, 255, 255, 0.4) !important; +} +.btn-yellow, +.btn-yellow:focus { + background-color: #fee188 !important; + border-color: #fee188; +} +.btn-yellow:hover, +.btn-yellow:active, +.open > .btn-yellow.dropdown-toggle { + background-color: #f7d05b !important; + border-color: #fee188; +} +.btn-yellow.no-border:hover, +.btn-yellow.no-border:active { + border-color: #f7d05b; +} +.btn-yellow.no-hover:hover, +.btn-yellow.no-hover:active { + background-color: #fee188 !important; +} +.btn-yellow.active { + background-color: #fbd972 !important; + border-color: #f9cf4f; +} +.btn-yellow.no-border.active { + background-color: #fad463 !important; + border-color: #fad463; +} +.btn-yellow.disabled, +.btn-yellow[disabled], +fieldset[disabled] .btn-yellow, +.btn-yellow.disabled:hover, +.btn-yellow[disabled]:hover, +fieldset[disabled] .btn-yellow:hover, +.btn-yellow.disabled:focus, +.btn-yellow[disabled]:focus, +fieldset[disabled] .btn-yellow:focus, +.btn-yellow.disabled:active, +.btn-yellow[disabled]:active, +fieldset[disabled] .btn-yellow:active, +.btn-yellow.disabled.active, +.btn-yellow[disabled].active, +fieldset[disabled] .btn-yellow.active { + background-color: #fee188 !important; + border-color: #fee188; +} +.btn-yellow:hover, +.btn-yellow:focus, +.btn-yellow.focus, +.open > .btn-yellow.dropdown-toggle, +.btn-yellow.active, +.open > .btn-yellow.active.dropdown-toggle { + color: #996633; +} +.btn-light { + color: #888888 !important; + text-shadow: 0 -1px 0 rgba(250, 250, 250, 0.25) !important; +} +.btn-light, +.btn-light:focus { + background-color: #e7e7e7 !important; + border-color: #e7e7e7; +} +.btn-light:hover, +.btn-light:active, +.open > .btn-light.dropdown-toggle { + background-color: #d9d9d9 !important; + border-color: #e7e7e7; +} +.btn-light.no-border:hover, +.btn-light.no-border:active { + border-color: #d9d9d9; +} +.btn-light.no-hover:hover, +.btn-light.no-hover:active { + background-color: #e7e7e7 !important; +} +.btn-light.active { + background-color: #e0e0e0 !important; + border-color: #cecece; +} +.btn-light.no-border.active { + background-color: #d8d8d8 !important; + border-color: #d8d8d8; +} +.btn-light.disabled, +.btn-light[disabled], +fieldset[disabled] .btn-light, +.btn-light.disabled:hover, +.btn-light[disabled]:hover, +fieldset[disabled] .btn-light:hover, +.btn-light.disabled:focus, +.btn-light[disabled]:focus, +fieldset[disabled] .btn-light:focus, +.btn-light.disabled:active, +.btn-light[disabled]:active, +fieldset[disabled] .btn-light:active, +.btn-light.disabled.active, +.btn-light[disabled].active, +fieldset[disabled] .btn-light.active { + background-color: #e7e7e7 !important; + border-color: #e7e7e7; +} +.btn-light:hover, +.btn-light:focus, +.btn-light.focus, +.open > .btn-light.dropdown-toggle, +.btn-light.active, +.open > .btn-light.active.dropdown-toggle { + color: #888888; +} +.btn-light.btn-xs:after, +.btn-light.btn-mini:after { + left: -2px; + right: -2px; + top: -2px; + bottom: -2px; +} +.btn-light.btn-sm:after { + left: -4px; + right: -4px; + top: -4px; + bottom: -4px; +} +.btn-light .btn-lg:after { + left: -6px; + right: -6px; + top: -6px; + bottom: -6px; +} +.btn.btn-white { + text-shadow: none !important; + background-color: #FFF !important; +} +.btn.btn-white.no-hover:hover, +.btn.btn-white.no-hover:active { + background-color: #FFF !important; +} +.btn.btn-white:focus, +.btn.btn-white.active { + box-shadow: inset 1px 1px 2px 0 rgba(0, 0, 0, 0.1) !important; +} +.btn.btn-white:focus.btn-bold, +.btn.btn-white.active.btn-bold { + box-shadow: inset 1px 1px 3px 0 rgba(0, 0, 0, 0.15) !important; +} +.btn.btn-white.active:after { + display: none; +} +.btn.btn-white { + border-color: #cccccc; + color: #444444 !important; + /** + //&:hover, &:focus, &.focus, .open > &.dropdown-toggle { + //color: saturate(darken(@txt-color , 5%) , 5%) !important; + //} + //&.no-border:hover , &.no-border:active { + //border-color: @border-color; + //} + */ +} +.btn.btn-white:hover, +.btn.btn-white:focus, +.btn.btn-white.active, +.btn.btn-white:active, +.open > .btn.btn-white.dropdown-toggle, +.open > .btn.btn-white.active.dropdown-toggle { + background-color: #ebebeb !important; + border-color: #cccccc; + color: #3a3434 !important; +} +.btn.btn-white:hover.no-border, +.btn.btn-white:focus.no-border, +.btn.btn-white.active.no-border, +.btn.btn-white:active.no-border, +.open > .btn.btn-white.dropdown-toggle.no-border, +.open > .btn.btn-white.active.dropdown-toggle.no-border { + border-color: #cccccc; +} +.btn.btn-white.disabled, +.btn.btn-white[disabled], +fieldset[disabled] .btn.btn-white, +.btn.btn-white.disabled:hover, +.btn.btn-white[disabled]:hover, +fieldset[disabled] .btn.btn-white:hover, +.btn.btn-white.disabled:focus, +.btn.btn-white[disabled]:focus, +fieldset[disabled] .btn.btn-white:focus, +.btn.btn-white.disabled:active, +.btn.btn-white[disabled]:active, +fieldset[disabled] .btn.btn-white:active, +.btn.btn-white.disabled.active, +.btn.btn-white[disabled].active, +fieldset[disabled] .btn.btn-white.active { + border-color: #cccccc; +} +.btn-white.btn-default { + border-color: #abbac3; + color: #80909a !important; + /** + //&:hover, &:focus, &.focus, .open > &.dropdown-toggle { + //color: saturate(darken(@txt-color , 5%) , 5%) !important; + //} + //&.no-border:hover , &.no-border:active { + //border-color: @border-color; + //} + */ +} +.btn-white.btn-default:hover, +.btn-white.btn-default:focus, +.btn-white.btn-default.active, +.btn-white.btn-default:active, +.open > .btn-white.btn-default.dropdown-toggle, +.open > .btn-white.btn-default.active.dropdown-toggle { + background-color: #eff2f4 !important; + border-color: #abbac3; + color: #6b8595 !important; +} +.btn-white.btn-default:hover.no-border, +.btn-white.btn-default:focus.no-border, +.btn-white.btn-default.active.no-border, +.btn-white.btn-default:active.no-border, +.open > .btn-white.btn-default.dropdown-toggle.no-border, +.open > .btn-white.btn-default.active.dropdown-toggle.no-border { + border-color: #abbac3; +} +.btn-white.btn-default.disabled, +.btn-white.btn-default[disabled], +fieldset[disabled] .btn-white.btn-default, +.btn-white.btn-default.disabled:hover, +.btn-white.btn-default[disabled]:hover, +fieldset[disabled] .btn-white.btn-default:hover, +.btn-white.btn-default.disabled:focus, +.btn-white.btn-default[disabled]:focus, +fieldset[disabled] .btn-white.btn-default:focus, +.btn-white.btn-default.disabled:active, +.btn-white.btn-default[disabled]:active, +fieldset[disabled] .btn-white.btn-default:active, +.btn-white.btn-default.disabled.active, +.btn-white.btn-default[disabled].active, +fieldset[disabled] .btn-white.btn-default.active { + border-color: #abbac3; +} +.btn-white.btn-primary { + border-color: #8aafce; + color: #6688a6 !important; + /** + //&:hover, &:focus, &.focus, .open > &.dropdown-toggle { + //color: saturate(darken(@txt-color , 5%) , 5%) !important; + //} + //&.no-border:hover , &.no-border:active { + //border-color: @border-color; + //} + */ +} +.btn-white.btn-primary:hover, +.btn-white.btn-primary:focus, +.btn-white.btn-primary.active, +.btn-white.btn-primary:active, +.open > .btn-white.btn-primary.dropdown-toggle, +.open > .btn-white.btn-primary.active.dropdown-toggle { + background-color: #eaf2f8 !important; + border-color: #8aafce; + color: #537c9f !important; +} +.btn-white.btn-primary:hover.no-border, +.btn-white.btn-primary:focus.no-border, +.btn-white.btn-primary.active.no-border, +.btn-white.btn-primary:active.no-border, +.open > .btn-white.btn-primary.dropdown-toggle.no-border, +.open > .btn-white.btn-primary.active.dropdown-toggle.no-border { + border-color: #8aafce; +} +.btn-white.btn-primary.disabled, +.btn-white.btn-primary[disabled], +fieldset[disabled] .btn-white.btn-primary, +.btn-white.btn-primary.disabled:hover, +.btn-white.btn-primary[disabled]:hover, +fieldset[disabled] .btn-white.btn-primary:hover, +.btn-white.btn-primary.disabled:focus, +.btn-white.btn-primary[disabled]:focus, +fieldset[disabled] .btn-white.btn-primary:focus, +.btn-white.btn-primary.disabled:active, +.btn-white.btn-primary[disabled]:active, +fieldset[disabled] .btn-white.btn-primary:active, +.btn-white.btn-primary.disabled.active, +.btn-white.btn-primary[disabled].active, +fieldset[disabled] .btn-white.btn-primary.active { + border-color: #8aafce; +} +.btn-white.btn-success { + border-color: #a7c9a1; + color: #81a87b !important; + /** + //&:hover, &:focus, &.focus, .open > &.dropdown-toggle { + //color: saturate(darken(@txt-color , 5%) , 5%) !important; + //} + //&.no-border:hover , &.no-border:active { + //border-color: @border-color; + //} + */ +} +.btn-white.btn-success:hover, +.btn-white.btn-success:focus, +.btn-white.btn-success.active, +.btn-white.btn-success:active, +.open > .btn-white.btn-success.dropdown-toggle, +.open > .btn-white.btn-success.active.dropdown-toggle { + background-color: #edf4eb !important; + border-color: #a7c9a1; + color: #6ea465 !important; +} +.btn-white.btn-success:hover.no-border, +.btn-white.btn-success:focus.no-border, +.btn-white.btn-success.active.no-border, +.btn-white.btn-success:active.no-border, +.open > .btn-white.btn-success.dropdown-toggle.no-border, +.open > .btn-white.btn-success.active.dropdown-toggle.no-border { + border-color: #a7c9a1; +} +.btn-white.btn-success.disabled, +.btn-white.btn-success[disabled], +fieldset[disabled] .btn-white.btn-success, +.btn-white.btn-success.disabled:hover, +.btn-white.btn-success[disabled]:hover, +fieldset[disabled] .btn-white.btn-success:hover, +.btn-white.btn-success.disabled:focus, +.btn-white.btn-success[disabled]:focus, +fieldset[disabled] .btn-white.btn-success:focus, +.btn-white.btn-success.disabled:active, +.btn-white.btn-success[disabled]:active, +fieldset[disabled] .btn-white.btn-success:active, +.btn-white.btn-success.disabled.active, +.btn-white.btn-success[disabled].active, +fieldset[disabled] .btn-white.btn-success.active { + border-color: #a7c9a1; +} +.btn-white.btn-danger { + border-color: #d7a59d; + color: #b7837a !important; + /** + //&:hover, &:focus, &.focus, .open > &.dropdown-toggle { + //color: saturate(darken(@txt-color , 5%) , 5%) !important; + //} + //&.no-border:hover , &.no-border:active { + //border-color: @border-color; + //} + */ +} +.btn-white.btn-danger:hover, +.btn-white.btn-danger:focus, +.btn-white.btn-danger.active, +.btn-white.btn-danger:active, +.open > .btn-white.btn-danger.dropdown-toggle, +.open > .btn-white.btn-danger.active.dropdown-toggle { + background-color: #fbf4f3 !important; + border-color: #d7a59d; + color: #b46f64 !important; +} +.btn-white.btn-danger:hover.no-border, +.btn-white.btn-danger:focus.no-border, +.btn-white.btn-danger.active.no-border, +.btn-white.btn-danger:active.no-border, +.open > .btn-white.btn-danger.dropdown-toggle.no-border, +.open > .btn-white.btn-danger.active.dropdown-toggle.no-border { + border-color: #d7a59d; +} +.btn-white.btn-danger.disabled, +.btn-white.btn-danger[disabled], +fieldset[disabled] .btn-white.btn-danger, +.btn-white.btn-danger.disabled:hover, +.btn-white.btn-danger[disabled]:hover, +fieldset[disabled] .btn-white.btn-danger:hover, +.btn-white.btn-danger.disabled:focus, +.btn-white.btn-danger[disabled]:focus, +fieldset[disabled] .btn-white.btn-danger:focus, +.btn-white.btn-danger.disabled:active, +.btn-white.btn-danger[disabled]:active, +fieldset[disabled] .btn-white.btn-danger:active, +.btn-white.btn-danger.disabled.active, +.btn-white.btn-danger[disabled].active, +fieldset[disabled] .btn-white.btn-danger.active { + border-color: #d7a59d; +} +.btn-white.btn-warning { + border-color: #e7b979; + color: #daa458 !important; + /** + //&:hover, &:focus, &.focus, .open > &.dropdown-toggle { + //color: saturate(darken(@txt-color , 5%) , 5%) !important; + //} + //&.no-border:hover , &.no-border:active { + //border-color: @border-color; + //} + */ +} +.btn-white.btn-warning:hover, +.btn-white.btn-warning:focus, +.btn-white.btn-warning.active, +.btn-white.btn-warning:active, +.open > .btn-white.btn-warning.dropdown-toggle, +.open > .btn-white.btn-warning.active.dropdown-toggle { + background-color: #fef7ec !important; + border-color: #e7b979; + color: #db9a3d !important; +} +.btn-white.btn-warning:hover.no-border, +.btn-white.btn-warning:focus.no-border, +.btn-white.btn-warning.active.no-border, +.btn-white.btn-warning:active.no-border, +.open > .btn-white.btn-warning.dropdown-toggle.no-border, +.open > .btn-white.btn-warning.active.dropdown-toggle.no-border { + border-color: #e7b979; +} +.btn-white.btn-warning.disabled, +.btn-white.btn-warning[disabled], +fieldset[disabled] .btn-white.btn-warning, +.btn-white.btn-warning.disabled:hover, +.btn-white.btn-warning[disabled]:hover, +fieldset[disabled] .btn-white.btn-warning:hover, +.btn-white.btn-warning.disabled:focus, +.btn-white.btn-warning[disabled]:focus, +fieldset[disabled] .btn-white.btn-warning:focus, +.btn-white.btn-warning.disabled:active, +.btn-white.btn-warning[disabled]:active, +fieldset[disabled] .btn-white.btn-warning:active, +.btn-white.btn-warning.disabled.active, +.btn-white.btn-warning[disabled].active, +fieldset[disabled] .btn-white.btn-warning.active { + border-color: #e7b979; +} +.btn-white.btn-info { + border-color: #8fbcd9; + color: #70a0c1 !important; + /** + //&:hover, &:focus, &.focus, .open > &.dropdown-toggle { + //color: saturate(darken(@txt-color , 5%) , 5%) !important; + //} + //&.no-border:hover , &.no-border:active { + //border-color: @border-color; + //} + */ +} +.btn-white.btn-info:hover, +.btn-white.btn-info:focus, +.btn-white.btn-info.active, +.btn-white.btn-info:active, +.open > .btn-white.btn-info.dropdown-toggle, +.open > .btn-white.btn-info.active.dropdown-toggle { + background-color: #eef5fa !important; + border-color: #8fbcd9; + color: #5896bf !important; +} +.btn-white.btn-info:hover.no-border, +.btn-white.btn-info:focus.no-border, +.btn-white.btn-info.active.no-border, +.btn-white.btn-info:active.no-border, +.open > .btn-white.btn-info.dropdown-toggle.no-border, +.open > .btn-white.btn-info.active.dropdown-toggle.no-border { + border-color: #8fbcd9; +} +.btn-white.btn-info.disabled, +.btn-white.btn-info[disabled], +fieldset[disabled] .btn-white.btn-info, +.btn-white.btn-info.disabled:hover, +.btn-white.btn-info[disabled]:hover, +fieldset[disabled] .btn-white.btn-info:hover, +.btn-white.btn-info.disabled:focus, +.btn-white.btn-info[disabled]:focus, +fieldset[disabled] .btn-white.btn-info:focus, +.btn-white.btn-info.disabled:active, +.btn-white.btn-info[disabled]:active, +fieldset[disabled] .btn-white.btn-info:active, +.btn-white.btn-info.disabled.active, +.btn-white.btn-info[disabled].active, +fieldset[disabled] .btn-white.btn-info.active { + border-color: #8fbcd9; +} +.btn-white.btn-inverse { + border-color: #959595; + color: #555555 !important; + /** + //&:hover, &:focus, &.focus, .open > &.dropdown-toggle { + //color: saturate(darken(@txt-color , 5%) , 5%) !important; + //} + //&.no-border:hover , &.no-border:active { + //border-color: @border-color; + //} + */ +} +.btn-white.btn-inverse:hover, +.btn-white.btn-inverse:focus, +.btn-white.btn-inverse.active, +.btn-white.btn-inverse:active, +.open > .btn-white.btn-inverse.dropdown-toggle, +.open > .btn-white.btn-inverse.active.dropdown-toggle { + background-color: #e4e4e4 !important; + border-color: #959595; + color: #4c4545 !important; +} +.btn-white.btn-inverse:hover.no-border, +.btn-white.btn-inverse:focus.no-border, +.btn-white.btn-inverse.active.no-border, +.btn-white.btn-inverse:active.no-border, +.open > .btn-white.btn-inverse.dropdown-toggle.no-border, +.open > .btn-white.btn-inverse.active.dropdown-toggle.no-border { + border-color: #959595; +} +.btn-white.btn-inverse.disabled, +.btn-white.btn-inverse[disabled], +fieldset[disabled] .btn-white.btn-inverse, +.btn-white.btn-inverse.disabled:hover, +.btn-white.btn-inverse[disabled]:hover, +fieldset[disabled] .btn-white.btn-inverse:hover, +.btn-white.btn-inverse.disabled:focus, +.btn-white.btn-inverse[disabled]:focus, +fieldset[disabled] .btn-white.btn-inverse:focus, +.btn-white.btn-inverse.disabled:active, +.btn-white.btn-inverse[disabled]:active, +fieldset[disabled] .btn-white.btn-inverse:active, +.btn-white.btn-inverse.disabled.active, +.btn-white.btn-inverse[disabled].active, +fieldset[disabled] .btn-white.btn-inverse.active { + border-color: #959595; +} +.btn-white.btn-pink { + border-color: #d299ae; + color: #af6f87 !important; + /** + //&:hover, &:focus, &.focus, .open > &.dropdown-toggle { + //color: saturate(darken(@txt-color , 5%) , 5%) !important; + //} + //&.no-border:hover , &.no-border:active { + //border-color: @border-color; + //} + */ +} +.btn-white.btn-pink:hover, +.btn-white.btn-pink:focus, +.btn-white.btn-pink.active, +.btn-white.btn-pink:active, +.open > .btn-white.btn-pink.dropdown-toggle, +.open > .btn-white.btn-pink.active.dropdown-toggle { + background-color: #fbeff4 !important; + border-color: #d299ae; + color: #ac5978 !important; +} +.btn-white.btn-pink:hover.no-border, +.btn-white.btn-pink:focus.no-border, +.btn-white.btn-pink.active.no-border, +.btn-white.btn-pink:active.no-border, +.open > .btn-white.btn-pink.dropdown-toggle.no-border, +.open > .btn-white.btn-pink.active.dropdown-toggle.no-border { + border-color: #d299ae; +} +.btn-white.btn-pink.disabled, +.btn-white.btn-pink[disabled], +fieldset[disabled] .btn-white.btn-pink, +.btn-white.btn-pink.disabled:hover, +.btn-white.btn-pink[disabled]:hover, +fieldset[disabled] .btn-white.btn-pink:hover, +.btn-white.btn-pink.disabled:focus, +.btn-white.btn-pink[disabled]:focus, +fieldset[disabled] .btn-white.btn-pink:focus, +.btn-white.btn-pink.disabled:active, +.btn-white.btn-pink[disabled]:active, +fieldset[disabled] .btn-white.btn-pink:active, +.btn-white.btn-pink.disabled.active, +.btn-white.btn-pink[disabled].active, +fieldset[disabled] .btn-white.btn-pink.active { + border-color: #d299ae; +} +.btn-white.btn-purple { + border-color: #b7b1c6; + color: #7d6fa2 !important; + /** + //&:hover, &:focus, &.focus, .open > &.dropdown-toggle { + //color: saturate(darken(@txt-color , 5%) , 5%) !important; + //} + //&.no-border:hover , &.no-border:active { + //border-color: @border-color; + //} + */ +} +.btn-white.btn-purple:hover, +.btn-white.btn-purple:focus, +.btn-white.btn-purple.active, +.btn-white.btn-purple:active, +.open > .btn-white.btn-purple.dropdown-toggle, +.open > .btn-white.btn-purple.active.dropdown-toggle { + background-color: #efedf5 !important; + border-color: #b7b1c6; + color: #6d5b9c !important; +} +.btn-white.btn-purple:hover.no-border, +.btn-white.btn-purple:focus.no-border, +.btn-white.btn-purple.active.no-border, +.btn-white.btn-purple:active.no-border, +.open > .btn-white.btn-purple.dropdown-toggle.no-border, +.open > .btn-white.btn-purple.active.dropdown-toggle.no-border { + border-color: #b7b1c6; +} +.btn-white.btn-purple.disabled, +.btn-white.btn-purple[disabled], +fieldset[disabled] .btn-white.btn-purple, +.btn-white.btn-purple.disabled:hover, +.btn-white.btn-purple[disabled]:hover, +fieldset[disabled] .btn-white.btn-purple:hover, +.btn-white.btn-purple.disabled:focus, +.btn-white.btn-purple[disabled]:focus, +fieldset[disabled] .btn-white.btn-purple:focus, +.btn-white.btn-purple.disabled:active, +.btn-white.btn-purple[disabled]:active, +fieldset[disabled] .btn-white.btn-purple:active, +.btn-white.btn-purple.disabled.active, +.btn-white.btn-purple[disabled].active, +fieldset[disabled] .btn-white.btn-purple.active { + border-color: #b7b1c6; +} +.btn-white.btn-yellow { + border-color: #ecd181; + color: #d3a61a !important; + /** + //&:hover, &:focus, &.focus, .open > &.dropdown-toggle { + //color: saturate(darken(@txt-color , 5%) , 5%) !important; + //} + //&.no-border:hover , &.no-border:active { + //border-color: @border-color; + //} + */ +} +.btn-white.btn-yellow:hover, +.btn-white.btn-yellow:focus, +.btn-white.btn-yellow.active, +.btn-white.btn-yellow:active, +.open > .btn-white.btn-yellow.dropdown-toggle, +.open > .btn-white.btn-yellow.active.dropdown-toggle { + background-color: #fdf7e4 !important; + border-color: #ecd181; + color: #c29712 !important; +} +.btn-white.btn-yellow:hover.no-border, +.btn-white.btn-yellow:focus.no-border, +.btn-white.btn-yellow.active.no-border, +.btn-white.btn-yellow:active.no-border, +.open > .btn-white.btn-yellow.dropdown-toggle.no-border, +.open > .btn-white.btn-yellow.active.dropdown-toggle.no-border { + border-color: #ecd181; +} +.btn-white.btn-yellow.disabled, +.btn-white.btn-yellow[disabled], +fieldset[disabled] .btn-white.btn-yellow, +.btn-white.btn-yellow.disabled:hover, +.btn-white.btn-yellow[disabled]:hover, +fieldset[disabled] .btn-white.btn-yellow:hover, +.btn-white.btn-yellow.disabled:focus, +.btn-white.btn-yellow[disabled]:focus, +fieldset[disabled] .btn-white.btn-yellow:focus, +.btn-white.btn-yellow.disabled:active, +.btn-white.btn-yellow[disabled]:active, +fieldset[disabled] .btn-white.btn-yellow:active, +.btn-white.btn-yellow.disabled.active, +.btn-white.btn-yellow[disabled].active, +fieldset[disabled] .btn-white.btn-yellow.active { + border-color: #ecd181; +} +.btn-white.btn-grey { + border-color: #c6c6c6; + color: #8c8c8c !important; + /** + //&:hover, &:focus, &.focus, .open > &.dropdown-toggle { + //color: saturate(darken(@txt-color , 5%) , 5%) !important; + //} + //&.no-border:hover , &.no-border:active { + //border-color: @border-color; + //} + */ +} +.btn-white.btn-grey:hover, +.btn-white.btn-grey:focus, +.btn-white.btn-grey.active, +.btn-white.btn-grey:active, +.open > .btn-white.btn-grey.dropdown-toggle, +.open > .btn-white.btn-grey.active.dropdown-toggle { + background-color: #ededed !important; + border-color: #c6c6c6; + color: #857979 !important; +} +.btn-white.btn-grey:hover.no-border, +.btn-white.btn-grey:focus.no-border, +.btn-white.btn-grey.active.no-border, +.btn-white.btn-grey:active.no-border, +.open > .btn-white.btn-grey.dropdown-toggle.no-border, +.open > .btn-white.btn-grey.active.dropdown-toggle.no-border { + border-color: #c6c6c6; +} +.btn-white.btn-grey.disabled, +.btn-white.btn-grey[disabled], +fieldset[disabled] .btn-white.btn-grey, +.btn-white.btn-grey.disabled:hover, +.btn-white.btn-grey[disabled]:hover, +fieldset[disabled] .btn-white.btn-grey:hover, +.btn-white.btn-grey.disabled:focus, +.btn-white.btn-grey[disabled]:focus, +fieldset[disabled] .btn-white.btn-grey:focus, +.btn-white.btn-grey.disabled:active, +.btn-white.btn-grey[disabled]:active, +fieldset[disabled] .btn-white.btn-grey:active, +.btn-white.btn-grey.disabled.active, +.btn-white.btn-grey[disabled].active, +fieldset[disabled] .btn-white.btn-grey.active { + border-color: #c6c6c6; +} +.btn.disabled.active, +.btn[disabled].active, +.btn.disabled:focus, +.btn[disabled]:focus, +.btn.disabled:active, +.btn[disabled]:active { + outline: none; +} +.btn.disabled:active, +.btn[disabled]:active { + top: 0; + left: 0; +} +.btn.active:after { + display: inline-block; + content: ""; + position: absolute; + border-bottom: 1px solid #efe5b5; + left: -4px; + right: -4px; + bottom: -4px; +} +.btn.active.btn-sm:after { + left: -3px; + right: -3px; + bottom: -3px; +} +.btn.active.btn-lg:after { + left: -5px; + right: -5px; + bottom: -5px; +} +.btn.active.btn-xs:after, +.btn.active.btn-mini:after, +.btn.active.btn-minier:after { + left: -1px; + right: -1px; + bottom: -2px; +} +.btn.active.btn-minier:after { + bottom: -1px; +} +.btn.active.btn-yellow:after { + border-bottom-color: #c96338; +} +.btn.active.btn-light { + color: #515151; +} +.btn.active.btn-light:after { + border-bottom-color: #B5B5B5; +} +.btn > .ace-icon { + margin-right: 4px; +} +.btn > .ace-icon.icon-on-right { + margin-right: 0; + margin-left: 4px; +} +.btn > .icon-only.ace-icon { + margin: 0 !important; + text-align: center; + padding: 0; +} +.btn-lg > .ace-icon { + margin-right: 6px; +} +.btn-lg > .ace-icon.icon-on-right { + margin-right: 0; + margin-left: 6px; +} +.btn-sm > .ace-icon { + margin-right: 3px; +} +.btn-sm > .ace-icon.icon-on-right { + margin-right: 0; + margin-left: 3px; +} +.btn-xs > .ace-icon, +.btn-mini > .ace-icon, +.btn-minier > .ace-icon { + margin-right: 2px; +} +.btn-xs > .ace-icon.icon-on-right, +.btn-mini > .ace-icon.icon-on-right, +.btn-minier > .ace-icon.icon-on-right { + margin-right: 0; + margin-left: 2px; +} +.btn.btn-link { + border-width: 0 !important; + background: transparent none !important; + color: #0088cc !important; + text-shadow: none !important; + padding: 4px 12px !important; + line-height: 20px !important; +} +.btn.btn-link:hover { + background: none !important; + text-shadow: none !important; +} +.btn.btn-link.active { + background: none !important; + text-decoration: underline; + color: #009ceb !important; +} +.btn.btn-link.active:after { + display: none; +} +.btn.btn-link.disabled, +.btn.btn-link[disabled] { + background: transparent none !important; + opacity: 0.65; + filter: alpha(opacity=65); + text-decoration: none !important; +} +.btn.btn-no-border { + border-width: 0 !important; +} +.btn-group:first-child { + margin-left: 0; +} +.btn-group > .btn, +.btn-group > .btn + .btn { + margin: 0 1px 0 0; +} +.btn-group > .btn:first-child { + margin: 0 1px 0 0; +} +.btn-group > .btn > .caret { + margin-top: 15px; + margin-left: 1px; + border-width: 5px; + border-top-color: #FFF; +} +.btn-group > .btn.btn-sm > .caret { + margin-top: 10px; + border-width: 4px; +} +.btn-group > .btn.btn-lg > .caret { + margin-top: 18px; + border-width: 6px; +} +.btn-group > .btn.btn-xs > .caret, +.btn-group > .btn.btn-mini > .caret { + margin-top: 9px; + border-width: 4px; +} +.btn-group > .btn.btn-minier > .caret { + margin-top: 7px; + border-width: 3px; +} +.btn-group > .btn + .btn.dropdown-toggle { + padding-right: 3px; + padding-left: 3px; +} +.btn-group > .btn + .btn-lg.dropdown-toggle { + padding-right: 4px; + padding-left: 4px; +} +.btn-group .dropdown-toggle { + border-radius: 0; +} +.btn-group > .btn, +.btn-group + .btn { + margin: 0 1px 0 0; + border-width: 3px; + /* the border under an active button in button groups */ +} +.btn-group > .btn.active:after, +.btn-group + .btn.active:after { + left: -2px; + right: -2px; + bottom: -2px; + border-bottom-width: 1px; +} +.btn-group > .btn-lg, +.btn-group + .btn-lg { + border-width: 4px; + /* the border under an active button in button groups */ +} +.btn-group > .btn-lg.active:after, +.btn-group + .btn-lg.active:after { + left: -3px; + right: -3px; + bottom: -3px; + border-bottom-width: 1px; +} +.btn-group > .btn-sm, +.btn-group + .btn-sm { + border-width: 2px; + /* the border under an active button in button groups */ +} +.btn-group > .btn-sm.active:after, +.btn-group + .btn-sm.active:after { + left: -1px; + right: -1px; + bottom: -1px; + border-bottom-width: 1px; +} +.btn-group > .btn-xs, +.btn-group + .btn-xs, +.btn-group > .btn-mini, +.btn-group + .btn-mini { + border-width: 1px; + /* the border under an active button in button groups */ +} +.btn-group > .btn-xs.active:after, +.btn-group + .btn-xs.active:after, +.btn-group > .btn-mini.active:after, +.btn-group + .btn-mini.active:after { + left: 0px; + right: 0px; + bottom: 0px; + border-bottom-width: 1px; +} +.btn-group > .btn-minier, +.btn-group + .btn-minier { + border-width: 1px; + /* the border under an active button in button groups */ +} +.btn-group > .btn-minier.active:after, +.btn-group + .btn-minier.active:after { + left: 0px; + right: 0px; + bottom: 0px; + border-bottom-width: 1px; +} +.btn-group-vertical > .btn:last-child:not(:first-child) { + border-radius: 0; +} +.btn-group-vertical > .btn, +.btn-group-vertical > .btn + .btn { + margin: 1px 0 0; +} +.btn-group-vertical > .btn:first-child { + margin-top: 0; +} +.btn-group.btn-overlap > .btn { + margin-right: -1px; +} +.btn-group.btn-corner > .btn:first-child { + border-bottom-left-radius: 8px; + border-top-left-radius: 8px; +} +.btn-group.btn-corner > .btn:last-child { + border-bottom-right-radius: 8px; + border-top-right-radius: 8px; +} +.btn-group.btn-corner > .btn.btn-sm:first-child { + border-bottom-left-radius: 6px; + border-top-left-radius: 6px; +} +.btn-group.btn-corner > .btn.btn-sm:last-child { + border-bottom-right-radius: 6px; + border-top-right-radius: 6px; +} +.btn-group.btn-corner > .btn.btn-xs:first-child, +.btn-group.btn-corner > .btn.btn-mini:first-child { + border-bottom-left-radius: 4px; + border-top-left-radius: 4px; +} +.btn-group.btn-corner > .btn.btn-xs:last-child, +.btn-group.btn-corner > .btn.btn-mini:last-child { + border-bottom-right-radius: 4px; + border-top-right-radius: 4px; +} +.btn.btn-white { + border-width: 1px; +} +.btn.btn-bold { + border-bottom-width: 2px; +} +.btn.btn-round { + border-bottom-width: 2px; + border-radius: 4px !important; +} +.btn.btn-app { + display: inline-block; + width: 100px; + font-size: 18px; + font-weight: normal; + color: #FFF; + text-align: center; + text-shadow: 0 -1px -1px rgba(0, 0, 0, 0.2) !important; + border: none; + border-radius: 12px; + padding: 12px 0 8px; + margin: 2px; + line-height: 1.7; + position: relative; +} +.btn-app, +.btn-app.btn-default, +.btn-app.no-hover:hover, +.btn-app.btn-default.no-hover:hover, +.btn-app.disabled:hover, +.btn-app.btn-default.disabled:hover { + background: #b4c2cc !important; + background-image: -webkit-linear-gradient(top, #bcc9d5 0%, #abbac3 100%) !important; + background-image: -o-linear-gradient(top, #bcc9d5 0%, #abbac3 100%) !important; + background-image: linear-gradient(to bottom, #bcc9d5 0%, #abbac3 100%) !important; + background-repeat: repeat-x !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffbcc9d5', endColorstr='#ffabbac3', GradientType=0) !important; +} +.btn-app:hover, +.btn-app.btn-default:hover { + background: #9baebc !important; + background-image: -webkit-linear-gradient(top, #a3b5c5 0%, #93a6b2 100%) !important; + background-image: -o-linear-gradient(top, #a3b5c5 0%, #93a6b2 100%) !important; + background-image: linear-gradient(to bottom, #a3b5c5 0%, #93a6b2 100%) !important; + background-repeat: repeat-x !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffa3b5c5', endColorstr='#ff93a6b2', GradientType=0) !important; +} +.btn-app.btn-primary, +.btn-app.btn-primary.no-hover:hover, +.btn-app.btn-primary.disabled:hover { + background: #2a8bcb !important; + background-image: -webkit-linear-gradient(top, #3b98d6 0%, #197ec1 100%) !important; + background-image: -o-linear-gradient(top, #3b98d6 0%, #197ec1 100%) !important; + background-image: linear-gradient(to bottom, #3b98d6 0%, #197ec1 100%) !important; + background-repeat: repeat-x !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3b98d6', endColorstr='#ff197ec1', GradientType=0) !important; +} +.btn-app.btn-primary:hover { + background: #1d6fa6 !important; + background-image: -webkit-linear-gradient(top, #267eb8 0%, #136194 100%) !important; + background-image: -o-linear-gradient(top, #267eb8 0%, #136194 100%) !important; + background-image: linear-gradient(to bottom, #267eb8 0%, #136194 100%) !important; + background-repeat: repeat-x !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff267eb8', endColorstr='#ff136194', GradientType=0) !important; +} +.btn-app.btn-info, +.btn-app.btn-info.no-hover:hover, +.btn-app.btn-info.disabled:hover { + background: #68adde !important; + background-image: -webkit-linear-gradient(top, #75b5e6 0%, #5ba4d5 100%) !important; + background-image: -o-linear-gradient(top, #75b5e6 0%, #5ba4d5 100%) !important; + background-image: linear-gradient(to bottom, #75b5e6 0%, #5ba4d5 100%) !important; + background-repeat: repeat-x !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff75b5e6', endColorstr='#ff5ba4d5', GradientType=0) !important; +} +.btn-app.btn-info:hover { + background: #3f96d4 !important; + background-image: -webkit-linear-gradient(top, #4a9ede 0%, #348dc9 100%) !important; + background-image: -o-linear-gradient(top, #4a9ede 0%, #348dc9 100%) !important; + background-image: linear-gradient(to bottom, #4a9ede 0%, #348dc9 100%) !important; + background-repeat: repeat-x !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff4a9ede', endColorstr='#ff348dc9', GradientType=0) !important; +} +.btn-app.btn-success, +.btn-app.btn-success.no-hover:hover, +.btn-app.btn-success.disabled:hover { + background: #85b558 !important; + background-image: -webkit-linear-gradient(top, #8ebf60 0%, #7daa50 100%) !important; + background-image: -o-linear-gradient(top, #8ebf60 0%, #7daa50 100%) !important; + background-image: linear-gradient(to bottom, #8ebf60 0%, #7daa50 100%) !important; + background-repeat: repeat-x !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff8ebf60', endColorstr='#ff7daa50', GradientType=0) !important; +} +.btn-app.btn-success:hover { + background: #6c9842 !important; + background-image: -webkit-linear-gradient(top, #74a844 0%, #648740 100%) !important; + background-image: -o-linear-gradient(top, #74a844 0%, #648740 100%) !important; + background-image: linear-gradient(to bottom, #74a844 0%, #648740 100%) !important; + background-repeat: repeat-x !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff74a844', endColorstr='#ff648740', GradientType=0) !important; +} +.btn-app.btn-danger, +.btn-app.btn-danger.no-hover:hover, +.btn-app.btn-danger.disabled:hover { + background: #d3413b !important; + background-image: -webkit-linear-gradient(top, #d55b52 0%, #d12723 100%) !important; + background-image: -o-linear-gradient(top, #d55b52 0%, #d12723 100%) !important; + background-image: linear-gradient(to bottom, #d55b52 0%, #d12723 100%) !important; + background-repeat: repeat-x !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd55b52', endColorstr='#ffd12723', GradientType=0) !important; +} +.btn-app.btn-danger:hover { + background: #b52c26 !important; + background-image: -webkit-linear-gradient(top, #c43a30 0%, #a51f1c 100%) !important; + background-image: -o-linear-gradient(top, #c43a30 0%, #a51f1c 100%) !important; + background-image: linear-gradient(to bottom, #c43a30 0%, #a51f1c 100%) !important; + background-repeat: repeat-x !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffc43a30', endColorstr='#ffa51f1c', GradientType=0) !important; +} +.btn-app.btn-warning, +.btn-app.btn-warning.no-hover:hover, +.btn-app.btn-warning.disabled:hover { + background: #ffb44b !important; + background-image: -webkit-linear-gradient(top, #ffbf66 0%, #ffa830 100%) !important; + background-image: -o-linear-gradient(top, #ffbf66 0%, #ffa830 100%) !important; + background-image: linear-gradient(to bottom, #ffbf66 0%, #ffa830 100%) !important; + background-repeat: repeat-x !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffbf66', endColorstr='#ffffa830', GradientType=0) !important; +} +.btn-app.btn-warning:hover { + background: #fe9e19 !important; + background-image: -webkit-linear-gradient(top, #ffaa33 0%, #fc9200 100%) !important; + background-image: -o-linear-gradient(top, #ffaa33 0%, #fc9200 100%) !important; + background-image: linear-gradient(to bottom, #ffaa33 0%, #fc9200 100%) !important; + background-repeat: repeat-x !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffaa33', endColorstr='#fffc9200', GradientType=0) !important; +} +.btn-app.btn-purple, +.btn-app.btn-purple.no-hover:hover, +.btn-app.btn-purple.disabled:hover { + background: #9889c1 !important; + background-image: -webkit-linear-gradient(top, #a696ce 0%, #8a7cb4 100%) !important; + background-image: -o-linear-gradient(top, #a696ce 0%, #8a7cb4 100%) !important; + background-image: linear-gradient(to bottom, #a696ce 0%, #8a7cb4 100%) !important; + background-repeat: repeat-x !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffa696ce', endColorstr='#ff8a7cb4', GradientType=0) !important; +} +.btn-app.btn-purple:hover { + background: #7b68af !important; + background-image: -webkit-linear-gradient(top, #8973be 0%, #6d5ca1 100%) !important; + background-image: -o-linear-gradient(top, #8973be 0%, #6d5ca1 100%) !important; + background-image: linear-gradient(to bottom, #8973be 0%, #6d5ca1 100%) !important; + background-repeat: repeat-x !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff8973be', endColorstr='#ff6d5ca1', GradientType=0) !important; +} +.btn-app.btn-pink, +.btn-app.btn-pink.no-hover:hover, +.btn-app.btn-pink.disabled:hover { + background: #d54c7e !important; + background-image: -webkit-linear-gradient(top, #db5e8c 0%, #ce3970 100%) !important; + background-image: -o-linear-gradient(top, #db5e8c 0%, #ce3970 100%) !important; + background-image: linear-gradient(to bottom, #db5e8c 0%, #ce3970 100%) !important; + background-repeat: repeat-x !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdb5e8c', endColorstr='#ffce3970', GradientType=0) !important; +} +.btn-app.btn-pink:hover { + background: #be2f64 !important; + background-image: -webkit-linear-gradient(top, #d2346e 0%, #aa2a59 100%) !important; + background-image: -o-linear-gradient(top, #d2346e 0%, #aa2a59 100%) !important; + background-image: linear-gradient(to bottom, #d2346e 0%, #aa2a59 100%) !important; + background-repeat: repeat-x !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd2346e', endColorstr='#ffaa2a59', GradientType=0) !important; +} +.btn-app.btn-inverse, +.btn-app.btn-inverse.no-hover:hover, +.btn-app.btn-inverse.disabled:hover { + background: #444444 !important; + background-image: -webkit-linear-gradient(top, #555555 0%, #333333 100%) !important; + background-image: -o-linear-gradient(top, #555555 0%, #333333 100%) !important; + background-image: linear-gradient(to bottom, #555555 0%, #333333 100%) !important; + background-repeat: repeat-x !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff555555', endColorstr='#ff333333', GradientType=0) !important; +} +.btn-app.btn-inverse:hover { + background: #2b2b2b !important; + background-image: -webkit-linear-gradient(top, #3b3b3b 0%, #1a1a1a 100%) !important; + background-image: -o-linear-gradient(top, #3b3b3b 0%, #1a1a1a 100%) !important; + background-image: linear-gradient(to bottom, #3b3b3b 0%, #1a1a1a 100%) !important; + background-repeat: repeat-x !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3b3b3b', endColorstr='#ff1a1a1a', GradientType=0) !important; +} +.btn-app.btn-grey, +.btn-app.btn-grey.no-hover:hover, +.btn-app.btn-grey.disabled:hover { + background: #797979 !important; + background-image: -webkit-linear-gradient(top, #898989 0%, #696969 100%) !important; + background-image: -o-linear-gradient(top, #898989 0%, #696969 100%) !important; + background-image: linear-gradient(to bottom, #898989 0%, #696969 100%) !important; + background-repeat: repeat-x !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff898989', endColorstr='#ff696969', GradientType=0) !important; +} +.btn-app.btn-grey:hover { + background: #6c6c6c !important; + background-image: -webkit-linear-gradient(top, #7c7c7c 0%, #5c5c5c 100%) !important; + background-image: -o-linear-gradient(top, #7c7c7c 0%, #5c5c5c 100%) !important; + background-image: linear-gradient(to bottom, #7c7c7c 0%, #5c5c5c 100%) !important; + background-repeat: repeat-x !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff7c7c7c', endColorstr='#ff5c5c5c', GradientType=0) !important; +} +.btn.btn-app.btn-light { + color: #5a5a5a !important; + text-shadow: 0 1px 1px #EEE !important; +} +.btn.btn-app.btn-light, +.btn.btn-app.btn-light.no-hover:hover, +.btn.btn-app.btn-light.disabled:hover { + background: #ededed !important; + background-image: -webkit-linear-gradient(top, #f4f4f4 0%, #e6e6e6 100%) !important; + background-image: -o-linear-gradient(top, #f4f4f4 0%, #e6e6e6 100%) !important; + background-image: linear-gradient(to bottom, #f4f4f4 0%, #e6e6e6 100%) !important; + background-repeat: repeat-x !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff4f4f4', endColorstr='#ffe6e6e6', GradientType=0) !important; +} +.btn.btn-app.btn-light:hover { + background: #e0e0e0 !important; + background-image: -webkit-linear-gradient(top, #e7e7e7 0%, #d9d9d9 100%) !important; + background-image: -o-linear-gradient(top, #e7e7e7 0%, #d9d9d9 100%) !important; + background-image: linear-gradient(to bottom, #e7e7e7 0%, #d9d9d9 100%) !important; + background-repeat: repeat-x !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe7e7e7', endColorstr='#ffd9d9d9', GradientType=0) !important; +} +.btn.btn-app.btn-yellow { + color: #996633 !important; + text-shadow: 0 -1px 0 rgba(255, 255, 255, 0.4) !important; +} +.btn.btn-app.btn-yellow, +.btn.btn-app.btn-yellow.no-hover:hover, +.btn.btn-app.btn-yellow.disabled:hover { + background: #fee088 !important; + background-image: -webkit-linear-gradient(top, #ffe8a5 0%, #fcd76a 100%) !important; + background-image: -o-linear-gradient(top, #ffe8a5 0%, #fcd76a 100%) !important; + background-image: linear-gradient(to bottom, #ffe8a5 0%, #fcd76a 100%) !important; + background-repeat: repeat-x !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffe8a5', endColorstr='#fffcd76a', GradientType=0) !important; +} +.btn.btn-app.btn-yellow:hover { + background: #fdd96e !important; + background-image: -webkit-linear-gradient(top, #ffe18b 0%, #fbd051 100%) !important; + background-image: -o-linear-gradient(top, #ffe18b 0%, #fbd051 100%) !important; + background-image: linear-gradient(to bottom, #ffe18b 0%, #fbd051 100%) !important; + background-repeat: repeat-x !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffe18b', endColorstr='#fffbd051', GradientType=0) !important; +} +.btn.btn-app > .ace-icon { + opacity: 0.88; +} +.btn.btn-app:hover > .ace-icon { + opacity: 1; +} +.btn.btn-app.btn-sm { + width: 80px; + font-size: 16px; + border-radius: 10px; + line-height: 1.5; +} +.btn.btn-app.btn-xs { + width: 64px; + font-size: 15px; + border-radius: 8px; + padding-bottom: 7px; + padding-top: 8px; + line-height: 1.45; +} +.btn.btn-app > .ace-icon { + display: block; + font-size: 42px; + margin: 0 0 4px; + line-height: 36px; + min-width: 0; + padding: 0; +} +.btn.btn-app.btn-sm > .ace-icon { + display: block; + font-size: 32px; + line-height: 30px; + margin: 0 0 3px; +} +.btn.btn-app.btn-xs > .ace-icon { + display: block; + font-size: 24px; + line-height: 24px; + margin: 0; +} +.btn.btn-app.no-radius { + border-radius: 0; +} +.btn.btn-app.radius-4 { + border-radius: 4px; +} +.btn.btn-app > .badge, +.btn.btn-app > .label { + position: absolute !important; + top: -2px; + right: -2px; + padding: 1px 3px; + text-align: center; + font-size: 12px; + color: #FFF; +} +.btn.btn-app > .badge.badge-left, +.btn.btn-app > .label.badge-left, +.btn.btn-app > .badge.label-left, +.btn.btn-app > .label.label-left { + right: auto; + left: -2px; +} +.btn.btn-app > .badge-yellow, +.btn.btn-app > .label-yellow { + color: #996633; +} +.btn.btn-app > .badge-light, +.btn.btn-app > .label-light { + color: #888888; +} +.btn.btn-app > .label { + padding: 1px 6px 3px; + font-size: 13px; +} +.btn.btn-app.radius-4 > .badge, +.btn.btn-app.no-radius > .badge { + border-radius: 3px; +} +.btn.btn-app.radius-4 > .badge.no-radius, +.btn.btn-app.no-radius > .badge.no-radius { + border-radius: 0; +} +.btn.btn-app.active { + color: #ffffff; +} +.btn.btn-app.active:after { + display: none; +} +.btn.btn-app.active.btn-yellow { + color: #996633; + border-color: #fee188; +} +.btn.btn-app.active.btn-light { + color: #515151; +} +.btn-group > .btn-app:first-child:not(:last-child):not(.dropdown-toggle) { + margin-right: 24px; +} +.btn-group > .btn-app + .btn-app.dropdown-toggle { + position: absolute; + width: auto; + height: 100%; + padding-left: 6px; + padding-right: 6px; + margin-left: -23px; + border-bottom-left-radius: 0; + border-top-left-radius: 0; + right: 0; +} +.btn.btn-app.btn-light, +.btn.btn-app.btn-yellow { + -webkit-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08) inset !important; + box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08) inset !important; +} +.label { + border-radius: 0; + text-shadow: none; + font-weight: normal; + color: #ffffff; + display: inline-block; + background-color: #abbac3; +} +.label[class*="col-"][class*="arrow"] { + min-height: 0; +} +@media screen and (-webkit-min-device-pixel-ratio: 0) { + ::safari-only, + .label:empty { + display: inline-block; + } + ::safari-only, + .badge:empty { + display: inline-block; + } +} +.badge { + text-shadow: none; + font-size: 12px; + padding-top: 1px; + padding-bottom: 3px; + font-weight: normal; + line-height: 15px; + background-color: #abbac3; +} +.badge.no-radius { + border-radius: 0; +} +.badge.radius-1 { + border-radius: 1px; +} +.badge.radius-2 { + border-radius: 2px; +} +.badge.radius-3 { + border-radius: 3px; +} +.badge.radius-4 { + border-radius: 4px; +} +.badge.radius-5 { + border-radius: 5px; +} +.badge.radius-6 { + border-radius: 6px; +} +.label.label-transparent, +.label-transparent, +.badge.badge-transparent, +.badge-transparent { + background-color: transparent; +} +.label-grey, +.label.label-grey, +.badge.badge-grey, +.badge-grey { + background-color: #a0a0a0; +} +.label-info, +.label.label-info, +.badge.badge-info, +.badge-info { + background-color: #3a87ad; +} +.label-primary, +.label.label-primary, +.badge.badge-primary, +.badge-primary { + background-color: #428bca; +} +.label-success, +.label.label-success, +.badge.badge-success, +.badge-success { + background-color: #82af6f; +} +.label-danger, +.label.label-danger, +.badge.badge-danger, +.badge-danger { + background-color: #d15b47; +} +.label-important, +.label.label-important, +.badge.badge-important, +.badge-important { + background-color: #d15b47; +} +.label-inverse, +.label.label-inverse, +.badge.badge-inverse, +.badge-inverse { + background-color: #333333; +} +.label-warning, +.label.label-warning, +.badge.badge-warning, +.badge-warning { + background-color: #f89406; +} +.label-pink, +.label.label-pink, +.badge.badge-pink, +.badge-pink { + background-color: #d6487e; +} +.label-purple, +.label.label-purple, +.badge.badge-purple, +.badge-purple { + background-color: #9585bf; +} +.label-yellow, +.label.label-yellow, +.badge.badge-yellow, +.badge-yellow { + background-color: #fee188; +} +.label-light, +.label.label-light, +.badge.badge-light, +.badge-light { + background-color: #e7e7e7; +} +.badge-yellow, +.label-yellow { + color: #996633; + border-color: #fee188; +} +.badge-light, +.label-light { + color: #888888; +} +.label.arrowed, +.label.arrowed-in { + position: relative; + z-index: 1; +} +.label.arrowed:before, +.label.arrowed-in:before { + display: inline-block; + content: ""; + position: absolute; + top: 0; + z-index: -1; + border: 1px solid transparent; + border-right-color: #abbac3; + -moz-border-right-colors: #abbac3; +} +.label.arrowed-in:before { + border-color: #abbac3; + border-left-color: transparent; + -moz-border-left-colors: none; +} +.label.arrowed-right, +.label.arrowed-in-right { + position: relative; + z-index: 1; +} +.label.arrowed-right:after, +.label.arrowed-in-right:after { + display: inline-block; + content: ""; + position: absolute; + top: 0; + z-index: -1; + border: 1px solid transparent; + border-left-color: #abbac3; + -moz-border-left-colors: #abbac3; +} +.label.arrowed-in-right:after { + border-color: #abbac3; + border-right-color: transparent; + -moz-border-right-colors: none; +} +.label-info.arrowed:before { + border-right-color: #3a87ad; + -moz-border-right-colors: #3a87ad; +} +.label-info.arrowed-in:before { + border-color: #3a87ad #3a87ad #3a87ad transparent; + -moz-border-right-colors: #3a87ad; +} +.label-info.arrowed-right:after { + border-left-color: #3a87ad; + -moz-border-left-colors: #3a87ad; +} +.label-info.arrowed-in-right:after { + border-color: #3a87ad transparent #3a87ad #3a87ad; + -moz-border-left-colors: #3a87ad; +} +.label-primary.arrowed:before { + border-right-color: #428bca; + -moz-border-right-colors: #428bca; +} +.label-primary.arrowed-in:before { + border-color: #428bca #428bca #428bca transparent; + -moz-border-right-colors: #428bca; +} +.label-primary.arrowed-right:after { + border-left-color: #428bca; + -moz-border-left-colors: #428bca; +} +.label-primary.arrowed-in-right:after { + border-color: #428bca transparent #428bca #428bca; + -moz-border-left-colors: #428bca; +} +.label-success.arrowed:before { + border-right-color: #82af6f; + -moz-border-right-colors: #82af6f; +} +.label-success.arrowed-in:before { + border-color: #82af6f #82af6f #82af6f transparent; + -moz-border-right-colors: #82af6f; +} +.label-success.arrowed-right:after { + border-left-color: #82af6f; + -moz-border-left-colors: #82af6f; +} +.label-success.arrowed-in-right:after { + border-color: #82af6f transparent #82af6f #82af6f; + -moz-border-left-colors: #82af6f; +} +.label-warning.arrowed:before { + border-right-color: #f89406; + -moz-border-right-colors: #f89406; +} +.label-warning.arrowed-in:before { + border-color: #f89406 #f89406 #f89406 transparent; + -moz-border-right-colors: #f89406; +} +.label-warning.arrowed-right:after { + border-left-color: #f89406; + -moz-border-left-colors: #f89406; +} +.label-warning.arrowed-in-right:after { + border-color: #f89406 transparent #f89406 #f89406; + -moz-border-left-colors: #f89406; +} +.label-important.arrowed:before { + border-right-color: #d15b47; + -moz-border-right-colors: #d15b47; +} +.label-important.arrowed-in:before { + border-color: #d15b47 #d15b47 #d15b47 transparent; + -moz-border-right-colors: #d15b47; +} +.label-important.arrowed-right:after { + border-left-color: #d15b47; + -moz-border-left-colors: #d15b47; +} +.label-important.arrowed-in-right:after { + border-color: #d15b47 transparent #d15b47 #d15b47; + -moz-border-left-colors: #d15b47; +} +.label-danger.arrowed:before { + border-right-color: #d15b47; + -moz-border-right-colors: #d15b47; +} +.label-danger.arrowed-in:before { + border-color: #d15b47 #d15b47 #d15b47 transparent; + -moz-border-right-colors: #d15b47; +} +.label-danger.arrowed-right:after { + border-left-color: #d15b47; + -moz-border-left-colors: #d15b47; +} +.label-danger.arrowed-in-right:after { + border-color: #d15b47 transparent #d15b47 #d15b47; + -moz-border-left-colors: #d15b47; +} +.label-inverse.arrowed:before { + border-right-color: #333333; + -moz-border-right-colors: #333333; +} +.label-inverse.arrowed-in:before { + border-color: #333333 #333333 #333333 transparent; + -moz-border-right-colors: #333333; +} +.label-inverse.arrowed-right:after { + border-left-color: #333333; + -moz-border-left-colors: #333333; +} +.label-inverse.arrowed-in-right:after { + border-color: #333333 transparent #333333 #333333; + -moz-border-left-colors: #333333; +} +.label-pink.arrowed:before { + border-right-color: #d6487e; + -moz-border-right-colors: #d6487e; +} +.label-pink.arrowed-in:before { + border-color: #d6487e #d6487e #d6487e transparent; + -moz-border-right-colors: #d6487e; +} +.label-pink.arrowed-right:after { + border-left-color: #d6487e; + -moz-border-left-colors: #d6487e; +} +.label-pink.arrowed-in-right:after { + border-color: #d6487e transparent #d6487e #d6487e; + -moz-border-left-colors: #d6487e; +} +.label-purple.arrowed:before { + border-right-color: #9585bf; + -moz-border-right-colors: #9585bf; +} +.label-purple.arrowed-in:before { + border-color: #9585bf #9585bf #9585bf transparent; + -moz-border-right-colors: #9585bf; +} +.label-purple.arrowed-right:after { + border-left-color: #9585bf; + -moz-border-left-colors: #9585bf; +} +.label-purple.arrowed-in-right:after { + border-color: #9585bf transparent #9585bf #9585bf; + -moz-border-left-colors: #9585bf; +} +.label-yellow.arrowed:before { + border-right-color: #fee188; + -moz-border-right-colors: #fee188; +} +.label-yellow.arrowed-in:before { + border-color: #fee188 #fee188 #fee188 transparent; + -moz-border-right-colors: #fee188; +} +.label-yellow.arrowed-right:after { + border-left-color: #fee188; + -moz-border-left-colors: #fee188; +} +.label-yellow.arrowed-in-right:after { + border-color: #fee188 transparent #fee188 #fee188; + -moz-border-left-colors: #fee188; +} +.label-light.arrowed:before { + border-right-color: #e7e7e7; + -moz-border-right-colors: #e7e7e7; +} +.label-light.arrowed-in:before { + border-color: #e7e7e7 #e7e7e7 #e7e7e7 transparent; + -moz-border-right-colors: #e7e7e7; +} +.label-light.arrowed-right:after { + border-left-color: #e7e7e7; + -moz-border-left-colors: #e7e7e7; +} +.label-light.arrowed-in-right:after { + border-color: #e7e7e7 transparent #e7e7e7 #e7e7e7; + -moz-border-left-colors: #e7e7e7; +} +.label-grey.arrowed:before { + border-right-color: #a0a0a0; + -moz-border-right-colors: #a0a0a0; +} +.label-grey.arrowed-in:before { + border-color: #a0a0a0 #a0a0a0 #a0a0a0 transparent; + -moz-border-right-colors: #a0a0a0; +} +.label-grey.arrowed-right:after { + border-left-color: #a0a0a0; + -moz-border-left-colors: #a0a0a0; +} +.label-grey.arrowed-in-right:after { + border-color: #a0a0a0 transparent #a0a0a0 #a0a0a0; + -moz-border-left-colors: #a0a0a0; +} +.label { + font-size: 12px; + line-height: 1.15; + height: 20px; +} +.label.arrowed { + margin-left: 5px; +} +.label.arrowed:before { + left: -10px; + border-width: 10px 5px; +} +.label.arrowed-in { + margin-left: 5px; +} +.label.arrowed-in:before { + left: -5px; + border-width: 10px 5px; +} +.label.arrowed-right { + margin-right: 5px; +} +.label.arrowed-right:after { + right: -10px; + border-width: 10px 5px; +} +.label.arrowed-in-right { + margin-right: 5px; +} +.label.arrowed-in-right:after { + right: -5px; + border-width: 10px 5px; +} +.label-lg { + padding: 0.3em 0.6em 0.4em; + font-size: 13px; + line-height: 1.1; + height: 24px; +} +.label-lg.arrowed { + margin-left: 6px; +} +.label-lg.arrowed:before { + left: -12px; + border-width: 12px 6px; +} +.label-lg.arrowed-in { + margin-left: 6px; +} +.label-lg.arrowed-in:before { + left: -6px; + border-width: 12px 6px; +} +.label-lg.arrowed-right { + margin-right: 6px; +} +.label-lg.arrowed-right:after { + right: -12px; + border-width: 12px 6px; +} +.label-lg.arrowed-in-right { + margin-right: 6px; +} +.label-lg.arrowed-in-right:after { + right: -6px; + border-width: 12px 6px; +} +.label-xlg { + padding: 0.3em 0.7em 0.4em; + font-size: 14px; + line-height: 1.3; + height: 28px; +} +.label-xlg.arrowed { + margin-left: 7px; +} +.label-xlg.arrowed:before { + left: -14px; + border-width: 14px 7px; +} +.label-xlg.arrowed-in { + margin-left: 7px; +} +.label-xlg.arrowed-in:before { + left: -7px; + border-width: 14px 7px; +} +.label-xlg.arrowed-right { + margin-right: 7px; +} +.label-xlg.arrowed-right:after { + right: -14px; + border-width: 14px 7px; +} +.label-xlg.arrowed-in-right { + margin-right: 7px; +} +.label-xlg.arrowed-in-right:after { + right: -7px; + border-width: 14px 7px; +} +.label-sm { + padding: 0.2em 0.4em 0.3em; + font-size: 11px; + line-height: 1; + height: 18px; +} +.label-sm.arrowed { + margin-left: 4px; +} +.label-sm.arrowed:before { + left: -8px; + border-width: 9px 4px; +} +.label-sm.arrowed-in { + margin-left: 4px; +} +.label-sm.arrowed-in:before { + left: -4px; + border-width: 9px 4px; +} +.label-sm.arrowed-right { + margin-right: 4px; +} +.label-sm.arrowed-right:after { + right: -8px; + border-width: 9px 4px; +} +.label-sm.arrowed-in-right { + margin-right: 4px; +} +.label-sm.arrowed-in-right:after { + right: -4px; + border-width: 9px 4px; +} +.label > span, +.label > .ace-icon { + line-height: 1; + vertical-align: bottom; +} +.label.label-white { + color: #879da9; + border: 1px solid #abbac3; + background-color: #f2f5f6; + border-right-width: 1px; + border-left-width: 2px; +} +.label-white.label-success { + color: #7b9e6c; + border-color: #9fbf92; + background-color: #edf3ea; +} +.label-white.label-warning { + color: #d9993e; + border-color: #e4ae62; + background-color: #fef6eb; +} +.label-white.label-primary { + color: #6688a6; + border-color: #8aafce; + background-color: #eaf2f8; +} +.label-white.label-danger { + color: #bd7f75; + border-color: #d28679; + background-color: #fcf4f2; +} +.label-white.label-info { + color: #4e7a8f; + border-color: #7aa1b4; + background-color: #eaf3f7; +} +.label-white.label-inverse { + color: #404040; + border-color: #737373; + background-color: #ededed; +} +.label-white.label-pink { + color: #af6f87; + border-color: #d299ae; + background-color: #fbeff4; +} +.label-white.label-purple { + color: #7d6fa2; + border-color: #b7b1c6; + background-color: #efedf5; +} +.label-white.label-yellow { + color: #cfa114; + border-color: #ecd181; + background-color: #fdf7e4; +} +.label-white.label-grey { + color: #878787; + border-color: #cecece; + background-color: #ededed; +} +@media screen and (-webkit-min-device-pixel-ratio: 1.08) and (-webkit-max-device-pixel-ratio: 1.15), screen and (min--moz-device-pixel-ratio: 1.08) and (max--moz-device-pixel-ratio: 1.15) { + .label:not(.label-lg):not(.label-xlg):not(.label-sm).arrowed:before { + border-width: 10.5px 6px; + left: -11px; + } + .label:not(.label-lg):not(.label-xlg):not(.label-sm).arrowed-right:after { + border-width: 10.5px 6px; + right: -11px; + } + .label:not(.label-lg):not(.label-xlg):not(.label-sm).arrowed-in:before { + border-width: 10.5px 5px 10px; + left: -6px; + } + .label:not(.label-lg):not(.label-xlg):not(.label-sm).arrowed-in-right:after { + border-width: 10.5px 5px 10px; + right: -6px; + } +} +@media screen and (-webkit-min-device-pixel-ratio: 1.3) and (-webkit-max-device-pixel-ratio: 1.4), screen and (min--moz-device-pixel-ratio: 1.3) and (max--moz-device-pixel-ratio: 1.4) { + .label:not(.label-lg):not(.label-xlg):not(.label-sm).arrowed:before { + border-width: 10px 6px 10px; + left: -12px; + } + .label:not(.label-lg):not(.label-xlg):not(.label-sm).arrowed-right:after { + border-width: 10px 6px 10px; + right: -12px; + } + .label:not(.label-lg):not(.label-xlg):not(.label-sm).arrowed-in:before { + border-width: 10px 5px 10px; + left: -6px; + } + .label:not(.label-lg):not(.label-xlg):not(.label-sm).arrowed-in-right:after { + border-width: 10px 5px 10px; + right: -6px; + } +} +@media screen and (-webkit-min-device-pixel-ratio: 1.5) and (-webkit-max-device-pixel-ratio: 1.6), screen and (min--moz-device-pixel-ratio: 1.5) and (max--moz-device-pixel-ratio: 1.6) { + .label:not(.label-lg):not(.label-xlg):not(.label-sm).arrowed:before { + border-width: 10px 6px; + left: -12px; + } + .label:not(.label-lg):not(.label-xlg):not(.label-sm).arrowed-right:after { + border-width: 10px 6px; + right: -12px; + } +} +@media screen and (-webkit-min-device-pixel-ratio: 1.7) and (-webkit-max-device-pixel-ratio: 1.8), screen and (min--moz-device-pixel-ratio: 1.7) and (max--moz-device-pixel-ratio: 1.8) { + .label:not(.label-lg):not(.label-xlg):not(.label-sm).arrowed:before { + border-width: 10px 6px; + left: -11.5px; + } + .label:not(.label-lg):not(.label-xlg):not(.label-sm).arrowed-right:after { + border-width: 10px 6px; + right: -11.5px; + } + .label:not(.label-lg):not(.label-xlg):not(.label-sm).arrowed-in:before { + border-width: 10px 5px; + left: -6px; + } + .label:not(.label-lg):not(.label-xlg):not(.label-sm).arrowed-in-right:after { + border-width: 10px 5px; + right: -6px; + } +} +@media screen and (-webkit-min-device-pixel-ratio: 0.8) and (-webkit-max-device-pixel-ratio: 0.9), screen and (min--moz-device-pixel-ratio: 0.8) and (max--moz-device-pixel-ratio: 0.9) { + .label:not(.label-lg):not(.label-xlg):not(.label-sm).arrowed:before { + border-width: 11px 6px; + left: -11.5px; + } + .label:not(.label-lg):not(.label-xlg):not(.label-sm).arrowed-right:after { + border-width: 11px 6px; + right: -11.5px; + } + .label:not(.label-lg):not(.label-xlg):not(.label-sm).arrowed-in:before { + border-width: 11px 5px; + left: -6px; + } + .label:not(.label-lg):not(.label-xlg):not(.label-sm).arrowed-in-right:after { + border-width: 11px 5px; + right: -6px; + } +} +@media screen and (-webkit-min-device-pixel-ratio: 1.08) and (-webkit-max-device-pixel-ratio: 1.15), screen and (min--moz-device-pixel-ratio: 1.08) and (max--moz-device-pixel-ratio: 1.15) { + .label-lg.arrowed:before { + left: -11px; + } + .label-lg.arrowed-right:after { + right: -11px; + } +} +@media screen and (-webkit-min-device-pixel-ratio: 1.7) and (-webkit-max-device-pixel-ratio: 1.8), screen and (min--moz-device-pixel-ratio: 1.7) and (max--moz-device-pixel-ratio: 1.8) { + .label-lg.arrowed:before { + left: -11.5px; + } + .label-lg.arrowed-right:after { + right: -11.5px; + } + .label-lg.arrowed-in:before { + border-width: 12.5px 6px 12px; + left: -6px; + } + .label-lg.arrowed-in-right:after { + border-width: 12.5px 6px 12px; + right: -6px; + } +} +@media screen and (-webkit-min-device-pixel-ratio: 1.08) and (-webkit-max-device-pixel-ratio: 1.15), screen and (min--moz-device-pixel-ratio: 1.08) and (max--moz-device-pixel-ratio: 1.15) { + .label-xlg.arrowed:before { + left: -13px; + } + .label-xlg.arrowed-right:after { + right: -13px; + } + .label-xlg.arrowed-in:before { + border-width: 14px 7px 14.5px; + } + .label-xlg.arrowed-in-right:after { + border-width: 14px 7px 14.5px; + } +} +@media screen and (-webkit-min-device-pixel-ratio: 1.2) and (-webkit-max-device-pixel-ratio: 1.3), screen and (min--moz-device-pixel-ratio: 1.2) and (max--moz-device-pixel-ratio: 1.3) { + .label-xlg.arrowed:before { + border-width: 14.5px 7px; + left: -13.5px; + } + .label-xlg.arrowed-right:after { + border-width: 14.5px 7px; + right: -13.5px; + } + .label-xlg.arrowed-in:before { + border-width: 14.5px 7px 14.5px; + } + .label-xlg.arrowed-in-right:after { + border-width: 14.5px 7px 14.5px; + } +} +@media screen and (-webkit-min-device-pixel-ratio: 1.3) and (-webkit-max-device-pixel-ratio: 1.4), screen and (-webkit-min-device-pixel-ratio: 1.5) and (-webkit-max-device-pixel-ratio: 1.6), screen and (min--moz-device-pixel-ratio: 1.3) and (max--moz-device-pixel-ratio: 1.4), screen and (min--moz-device-pixel-ratio: 1.5) and (max--moz-device-pixel-ratio: 1.6) { + .label-xlg.arrowed:before { + border-width: 14.5px 7.5px; + left: -14.5px; + } + .label-xlg.arrowed-right:after { + border-width: 14.5px 7.5px; + right: -14.5px; + } + .label-xlg.arrowed-in:before { + border-width: 14.5px 7px; + } + .label-xlg.arrowed-in-right:after { + border-width: 14.5px 7px; + } +} +@media screen and (-webkit-min-device-pixel-ratio: 1.08) and (-webkit-max-device-pixel-ratio: 1.15), screen and (min--moz-device-pixel-ratio: 1.08) and (max--moz-device-pixel-ratio: 1.15) { + .label-sm.arrowed:before { + border-width: 9px 5px; + left: -9px; + } + .label-sm.arrowed-right:after { + border-width: 9px 5px; + right: -9px; + } + .label-sm.arrowed-in:before { + border-width: 10px 4px; + } + .label-sm.arrowed-in-right:after { + border-width: 10px 4px; + } +} +@media screen and (-webkit-min-device-pixel-ratio: 1.2) and (-webkit-max-device-pixel-ratio: 1.3), screen and (min--moz-device-pixel-ratio: 1.2) and (max--moz-device-pixel-ratio: 1.3) { + .label-sm.arrowed:before { + border-width: 9.5px 5px; + left: -10px; + } + .label-sm.arrowed-right:after { + border-width: 9.5px 5px; + right: -10px; + } + .label-sm.arrowed-in:before { + border-width: 9.5px 4px; + } + .label-sm.arrowed-in-right:after { + border-width: 9.5px 4px; + } +} +.icon-white, +.nav-pills > .active > a > .ace-icon, +.nav-list > .active > a > .ace-icon, +.navbar-inverse .nav > .active > a > .ace-icon, +.dropdown-menu > li > a:hover > .ace-icon, +.dropdown-menu > li > a:focus > .ace-icon, +.dropdown-menu > .active > a > .ace-icon, +.dropdown-submenu:hover > a > .ace-icon, +.dropdown-submenu:focus > a > .ace-icon { + background-image: none; +} +.dropdown-menu { + border-radius: 0 !important; + -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); +} +.dropdown-menu > li > a { + font-size: 13px; + padding-left: 11px; + padding-right: 11px; + padding-bottom: 4px; + margin-bottom: 1px; + margin-top: 1px; +} +.dropdown-menu.dropdown-only-icon { + min-width: 50px; +} +.dropdown-menu.dropdown-only-icon > li { + margin: 0 4px; +} +.dropdown-menu.dropdown-only-icon > li > a .ace-icon { + width: 18px; + display: inline-block; + text-align: center; +} +.dropdown-menu.dropdown-only-icon > li > a .icon-2x { + width: 36px; +} +.dropdown-menu > li:hover > a, +.dropdown-menu > li > a:focus, +.dropdown-menu > li > a:active, +.dropdown-menu > li.active > a, +.dropdown-menu > li.active:hover > a { + background: #4f99c6; + color: #ffffff; +} +.dropdown-default > li:hover > a, +.dropdown-default > li > a:focus, +.dropdown-default > li > a:active, +.dropdown-default > li.active > a, +.dropdown-default > li.active:hover > a { + background: #abbac3; + color: #ffffff; +} +.dropdown-info > li:hover > a, +.dropdown-info > li > a:focus, +.dropdown-info > li > a:active, +.dropdown-info > li.active > a, +.dropdown-info > li.active:hover > a { + background: #6fb3e0; + color: #ffffff; +} +.dropdown-primary > li:hover > a, +.dropdown-primary > li > a:focus, +.dropdown-primary > li > a:active, +.dropdown-primary > li.active > a, +.dropdown-primary > li.active:hover > a { + background: #428bca; + color: #ffffff; +} +.dropdown-success > li:hover > a, +.dropdown-success > li > a:focus, +.dropdown-success > li > a:active, +.dropdown-success > li.active > a, +.dropdown-success > li.active:hover > a { + background: #87b87f; + color: #ffffff; +} +.dropdown-warning > li:hover > a, +.dropdown-warning > li > a:focus, +.dropdown-warning > li > a:active, +.dropdown-warning > li.active > a, +.dropdown-warning > li.active:hover > a { + background: #ffa24d; + color: #ffffff; +} +.dropdown-danger > li:hover > a, +.dropdown-danger > li > a:focus, +.dropdown-danger > li > a:active, +.dropdown-danger > li.active > a, +.dropdown-danger > li.active:hover > a { + background: #d15b47; + color: #ffffff; +} +.dropdown-inverse > li:hover > a, +.dropdown-inverse > li > a:focus, +.dropdown-inverse > li > a:active, +.dropdown-inverse > li.active > a, +.dropdown-inverse > li.active:hover > a { + background: #555555; + color: #ffffff; +} +.dropdown-purple > li:hover > a, +.dropdown-purple > li > a:focus, +.dropdown-purple > li > a:active, +.dropdown-purple > li.active > a, +.dropdown-purple > li.active:hover > a { + background: #9585bf; + color: #ffffff; +} +.dropdown-pink > li:hover > a, +.dropdown-pink > li > a:focus, +.dropdown-pink > li > a:active, +.dropdown-pink > li.active > a, +.dropdown-pink > li.active:hover > a { + background: #d6487e; + color: #ffffff; +} +.dropdown-grey > li:hover > a, +.dropdown-grey > li > a:focus, +.dropdown-grey > li > a:active, +.dropdown-grey > li.active > a, +.dropdown-grey > li.active:hover > a { + background: #a0a0a0; + color: #ffffff; +} +.dropdown-light > li:hover > a, +.dropdown-light > li > a:focus, +.dropdown-light > li > a:active, +.dropdown-light > li.active > a, +.dropdown-light > li.active:hover > a { + background: #e7e7e7; + color: #333333; +} +.dropdown-lighter > li:hover > a, +.dropdown-lighter > li > a:focus, +.dropdown-lighter > li > a:active, +.dropdown-lighter > li.active > a, +.dropdown-lighter > li.active:hover > a { + background: #efefef; + color: #444444; +} +.dropdown-lightest > li:hover > a, +.dropdown-lightest > li > a:focus, +.dropdown-lightest > li > a:active, +.dropdown-lightest > li.active > a, +.dropdown-lightest > li.active:hover > a { + background: #f3f3f3; + color: #444444; +} +.dropdown-yellow > li:hover > a, +.dropdown-yellow > li > a:focus, +.dropdown-yellow > li > a:active, +.dropdown-yellow > li.active > a, +.dropdown-yellow > li.active:hover > a { + background: #fee188; + color: #444444; +} +.dropdown-yellow2 > li:hover > a, +.dropdown-yellow2 > li > a:focus, +.dropdown-yellow2 > li > a:active, +.dropdown-yellow2 > li.active > a, +.dropdown-yellow2 > li.active:hover > a { + background: #f9e8b3; + color: #444444; +} +.dropdown-light-blue > li:hover > a, +.dropdown-light-blue > li > a:focus, +.dropdown-light-blue > li > a:active, +.dropdown-light-blue > li.active > a, +.dropdown-light-blue > li.active:hover > a { + background: #ecf3f9; + color: #445566; +} +.dropdown-menu.dropdown-close { + top: 92%; + left: -5px; +} +.dropdown-menu.dropdown-close.dropdown-menu-right { + left: auto; + right: -5px; +} +.dropdown-menu.dropdown-closer { + top: 80%; + left: -10px; +} +.dropdown-menu.dropdown-closer.dropdown-menu-right { + right: -10px; + left: auto; +} +.dropup > .dropdown-menu, +.navbar-fixed-bottom .dropdown > .dropdown-menu { + top: auto !important; + bottom: 100%; +} +.dropup > .dropdown-menu.dropdown-close, +.navbar-fixed-bottom .dropdown > .dropdown-menu.dropdown-close { + bottom: 92%; +} +.dropup > .dropdown-menu.dropdown-closer, +.navbar-fixed-bottom .dropdown > .dropdown-menu.dropdown-closer { + bottom: 80%; +} +.dropdown-submenu > .dropdown-menu { + border-radius: 0; +} +.dropdown-submenu > a:after { + margin-right: -5px; +} +.dropdown-50 { + min-width: 50px; +} +.dropdown-75 { + min-width: 75px; +} +.dropdown-100 { + min-width: 100px; +} +.dropdown-125 { + min-width: 125px; +} +.dropdown-150 { + min-width: 150px; +} +.dropdown-hover { + position: relative; +} +.dropdown-hover:before { + display: block; + content: ""; + position: absolute; + top: -2px; + bottom: -2px; + left: -2px; + right: -2px; + background-color: transparent; +} +.dropdown-hover:hover > .dropdown-menu { + display: block; +} +.dropdown-menu > .dropdown-hover > .dropdown-menu { + top: -5px; + left: 99%; + right: auto; +} +.dropdown-menu > .dropdown-hover > .dropdown-menu.dropdown-menu-right { + left: auto; + right: 99%; +} +.dropup .dropdown-menu > .dropdown-hover > .dropdown-menu, +.dropdown-menu > .dropdown-hover.dropup > .dropdown-menu { + top: auto; + bottom: -5px; +} +.dropdown-menu.dropdown-caret:before { + border-bottom: 7px solid rgba(0, 0, 0, 0.2); + -moz-border-bottom-colors: rgba(0, 0, 0, 0.2); + border-left: 7px solid transparent; + border-right: 7px solid transparent; + content: ""; + display: inline-block; + left: 9px; + position: absolute; + top: -7px; +} +.dropdown-menu.dropdown-caret:after { + border-bottom: 6px solid #FFF; + -moz-border-bottom-colors: #FFF; + border-left: 6px solid transparent; + border-right: 6px solid transparent; + content: ""; + display: inline-block; + left: 10px; + position: absolute; + top: -6px; +} +.dropdown-menu.dropdown-menu-right.dropdown-caret:before, +.dropdown-menu.dropdown-caret-right.dropdown-caret:before { + left: auto; + right: 9px; +} +.dropdown-menu.dropdown-menu-right.dropdown-caret:after, +.dropdown-menu.dropdown-caret-right.dropdown-caret:after { + left: auto; + right: 10px; +} +.dropup > .dropdown-menu.dropdown-caret:before, +.navbar-fixed-bottom .dropdown > .dropdown-menu.dropdown-caret:before { + border-bottom-width: 0; + border-top: 7px solid rgba(0, 0, 0, 0.2); + -moz-border-top-colors: rgba(0, 0, 0, 0.2); + bottom: -7px; + top: auto; +} +.dropup > .dropdown-menu.dropdown-caret:after, +.navbar-fixed-bottom .dropdown > .dropdown-menu.dropdown-caret:after { + border-bottom-width: 0; + border-top: 6px solid #FFF; + -moz-border-top-colors: #FFF; + bottom: -6px; + top: auto; +} +.dropdown-colorpicker > .dropdown-menu { + padding: 4px; + min-width: 130px; + max-width: 130px; + top: 80%; + left: -7px; +} +.dropdown-colorpicker > .dropdown-menu.dropdown-menu-right { + right: -7px; + left: auto; +} +.dropdown-colorpicker > .dropdown-menu > li { + display: block; + float: left; + width: 20px; + height: 20px; + margin: 2px; +} +.dropdown-colorpicker > .dropdown-menu > li > .colorpick-btn { + display: block; + width: 20px; + height: 20px; + margin: 0; + padding: 0; + border-radius: 0; + position: relative; + -webkit-transition: all ease 0.1s; + -o-transition: all ease 0.1s; + transition: all ease 0.1s; +} +.dropdown-colorpicker > .dropdown-menu > li > .colorpick-btn:hover { + text-decoration: none; + opacity: 0.8; + filter: alpha(opacity=80); + -webkit-transform: scale(1.08, 1.08); + -ms-transform: scale(1.08, 1.08); + -o-transform: scale(1.08, 1.08); + transform: scale(1.08, 1.08); +} +.dropdown-colorpicker > .dropdown-menu > li > .colorpick-btn.selected:after { + content: "\f00c"; + display: inline-block; + font-family: FontAwesome; + font-size: 11px; + color: #FFF; + position: absolute; + left: 0; + right: 0; + text-align: center; + line-height: 20px; +} +.btn-colorpicker { + display: inline-block; + width: 20px; + height: 20px; + background-color: #DDD; + vertical-align: middle; + border-radius: 0; +} +.dropdown-navbar { + padding: 0; + width: 240px; + -webkit-box-shadow: 0 2px 4px rgba(30, 30, 100, 0.25); + box-shadow: 0 2px 4px rgba(30, 30, 100, 0.25); + border-color: #bcd4e5; +} +.dropdown-navbar > li { + padding: 0 8px; + background-color: #FFF; +} +.dropdown-navbar > li.dropdown-header { + text-shadow: none; + padding-top: 0; + padding-bottom: 0; + line-height: 34px; + font-size: 13px; + font-weight: bold; + text-transform: none; + border-bottom: 1px solid; +} +.dropdown-navbar > li > .ace-icon, +.dropdown-navbar > li > a > .ace-icon { + margin-right: 5px !important; + color: #555; + font-size: 14px; +} +.dropdown-navbar > li > a { + padding: 10px 2px; + margin: 0; + border-top: 1px solid; + font-size: 12px; + line-height: 16px; + color: #555 !important; + background-color: transparent !important; + white-space: normal; +} +.dropdown-navbar > li > a .progress { + margin-bottom: 0; + margin-top: 4px; +} +.dropdown-navbar > li > a .badge { + line-height: 16px; + padding-right: 4px; + padding-left: 4px; + font-size: 12px; +} +.dropdown-navbar > li:first-child > a, +.dropdown-navbar > li.dropdown-header + li > a { + border-top-width: 0; +} +.dropdown-navbar > li.dropdown-footer > a { + color: #4F99C6 !important; + text-align: center; + font-size: 13px; +} +.dropdown-navbar > li.dropdown-footer > a:hover { + background-color: #FFF; + text-decoration: underline; +} +.dropdown-navbar > li.dropdown-footer > a:hover > .ace-icon { + text-decoration: none; +} +.dropdown-navbar > li:hover { + background-color: #f4f9fc; +} +.dropdown-navbar > li.dropdown-header { + background-color: #ecf2f7; + color: #8090a0; + border-bottom-color: #bcd4e5; +} +.dropdown-navbar > li.dropdown-header > .ace-icon { + color: #8090a0; +} +.dropdown-navbar > li > a { + border-top-color: #e4ecf3; +} +.dropdown-navbar.navbar-pink { + border-color: #e5bcd4; +} +.dropdown-navbar.navbar-pink > li:hover { + background-color: #fcf4f9; +} +.dropdown-navbar.navbar-pink > li.dropdown-header { + background-color: #f7ecf2; + color: #b471a0; + border-bottom-color: #e5bcd4; +} +.dropdown-navbar.navbar-pink > li.dropdown-header > .ace-icon { + color: #c06090; +} +.dropdown-navbar.navbar-pink > li > a { + border-top-color: #f3e4ec; +} +.dropdown-navbar.navbar-grey { + border-color: #e5e5e5; +} +.dropdown-navbar.navbar-grey > li:hover { + background-color: #f8f8f8; +} +.dropdown-navbar.navbar-grey > li.dropdown-header { + background-color: #f2f2f2; + color: #3a87ad; + border-bottom-color: #e5e5e5; +} +.dropdown-navbar.navbar-grey > li.dropdown-header > .ace-icon { + color: #3a87ad; +} +.dropdown-navbar.navbar-grey > li > a { + border-top-color: #eeeeee; +} +.dropdown-navbar.navbar-green { + border-color: #b4d5ac; +} +.dropdown-navbar.navbar-green > li:hover { + background-color: #f4f9ef; +} +.dropdown-navbar.navbar-green > li.dropdown-header { + background-color: #ebf7e4; + color: #88aa66; + border-bottom-color: #b4d5ac; +} +.dropdown-navbar.navbar-green > li.dropdown-header > .ace-icon { + color: #90c060; +} +.dropdown-navbar.navbar-green > li > a { + border-top-color: #ecf3e4; +} +.dropdown-navbar [class*="btn"].ace-icon { + display: inline-block; + margin: 0 5px 0 0; + width: 24px; + text-align: center; + padding-left: 0; + padding-right: 0; +} +.dropdown-navbar .msg-photo { + max-width: 42px; + float: left; + margin-top: 2px; +} +.dropdown-navbar .msg-body { + display: block; + line-height: 20px; + white-space: normal; + vertical-align: middle; + margin-left: 50px; +} +.dropdown-navbar .msg-title { + display: inline-block; + line-height: 14px; +} +.dropdown-navbar .msg-time { + display: block; + font-size: 11px; + color: #777; +} +.dropdown-navbar .msg-time > .ace-icon { + font-size: 14px; + color: #555; +} +.dropdown-navbar > .dropdown-content { + padding: 0; +} +.dropdown-navbar > .dropdown-content .dropdown-navbar { + list-style: none; + margin: 0; + padding: 0 !important; + -webkit-box-shadow: none; + box-shadow: none; + width: auto; + display: block; + float: none; + border-width: 0; + position: static; + z-index: auto; +} +.dropdown-navbar .nav-tabs { + border-width: 0; + box-shadow: none; + background-color: #F9F9F9 !important; + top: auto; + width: 100%; +} +.dropdown-navbar .nav-tabs > li { + display: table-cell; + width: 1%; + float: none !important; +} +.dropdown-navbar .nav-tabs > li > a { + margin: 0 0 0 1px !important; + text-align: center; + box-shadow: none !important; + background-color: #F9F9F9 !important; + border-width: 0 !important; + border-bottom: 2px solid #BECAD1 !important; +} +.dropdown-navbar .nav-tabs > li > a:before { + display: block; + content: ""; + position: absolute; + left: -1px; + top: 3px; + bottom: 3px; + width: 1px; + background-color: #BECAD1; +} +.dropdown-navbar .nav-tabs > li:first-child > a { + margin-left: 0 !important; +} +.dropdown-navbar .nav-tabs > li:first-child > a:before { + display: none; +} +.dropdown-navbar .nav-tabs > li.active > a { + border-bottom: 2px solid #79B0CE !important; + color: #5085AF !important; + background-color: #ECF2F7 !important; +} +.dropdown-navbar .tab-content { + padding: 0 !important; + border-color: #FFF !important; +} +.dropdown-navbar .tab-content .dropdown-menu { + display: block; + position: static; + margin: 0 !important; + padding-top: 2px; + border-color: #FFF !important; + box-shadow: none !important; + width: 100%; +} +.dropdown-navbar.navbar-pink .nav-tabs > li.active > a { + border-bottom: 2px solid #E5BCD4 !important; + color: #C06090 !important; + background-color: #F7ECF2 !important; +} +.dropdown-navbar.navbar-pink .nav-tabs > li:not(.active) > a:hover { + color: #BA7396; +} +.dropdown-navbar.navbar-pink .nav-tabs > li > a:before { + background-color: #CEBBCB; +} +.dropdown-navbar.navbar-pink .nav-tabs > li > a { + border-bottom-color: #CEBBCD !important; +} +.form-line { + margin-bottom: 24px; + padding-bottom: 12px; + border-bottom: 1px solid #EEE; +} +.form-actions { + display: block; + background-color: #F5F5F5; + border-top: 1px solid #E5E5E5; + margin-bottom: 20px; + margin-top: 20px; + padding: 19px 20px 20px; +} +.help-button { + display: inline-block; + height: 22px; + width: 22px; + line-height: 22px; + text-align: center; + padding: 0; + background-color: #65bcda; + color: #FFF; + font-size: 12px; + font-weight: bold; + cursor: default; + margin-left: 4px; + border-radius: 100%; + border-color: #FFF; + border: 2px solid #FFF; + -webkit-box-shadow: 0px 1px 0px 1px rgba(0, 0, 0, 0.2); + box-shadow: 0px 1px 0px 1px rgba(0, 0, 0, 0.2); +} +.help-button:hover { + background-color: #65bcda; + text-shadow: none; +} +label { + font-weight: normal; + font-size: 14px; +} +.form-group > label[class*="col-"] { + margin-bottom: 4px; +} +td > label, +th > label { + margin-bottom: 0; + line-height: inherit; + vertical-align: middle; +} +label.inline { + margin-bottom: 3px; +} +textarea, +input[type="text"], +input[type="password"], +input[type="datetime"], +input[type="datetime-local"], +input[type="date"], +input[type="month"], +input[type="time"], +input[type="week"], +input[type="number"], +input[type="email"], +input[type="url"], +input[type="search"], +input[type="tel"], +input[type="color"] { + border-radius: 0 !important; + color: #858585; + background-color: #ffffff; + border: 1px solid #d5d5d5; + padding: 5px 4px 6px; + font-size: 14px; + font-family: inherit; + -webkit-box-shadow: none !important; + box-shadow: none !important; + -webkit-transition-duration: 0.1s; + transition-duration: 0.1s; +} +textarea:hover, +input[type="text"]:hover, +input[type="password"]:hover, +input[type="datetime"]:hover, +input[type="datetime-local"]:hover, +input[type="date"]:hover, +input[type="month"]:hover, +input[type="time"]:hover, +input[type="week"]:hover, +input[type="number"]:hover, +input[type="email"]:hover, +input[type="url"]:hover, +input[type="search"]:hover, +input[type="tel"]:hover, +input[type="color"]:hover { + border-color: #b5b5b5; +} +textarea:focus, +input[type="text"]:focus, +input[type="password"]:focus, +input[type="datetime"]:focus, +input[type="datetime-local"]:focus, +input[type="date"]:focus, +input[type="month"]:focus, +input[type="time"]:focus, +input[type="week"]:focus, +input[type="number"]:focus, +input[type="email"]:focus, +input[type="url"]:focus, +input[type="search"]:focus, +input[type="tel"]:focus, +input[type="color"]:focus { + -webkit-box-shadow: none; + box-shadow: none; + color: #696969; + border-color: #f59942; + background-color: #ffffff; + outline: none; +} +input::-webkit-input-placeholder, +.form-control::-webkit-input-placeholder { + color: #c0c0c0; +} +input:-moz-placeholder, +.form-control:-moz-placeholder { + color: #c0c0c0; + opacity: 1; +} +input::-moz-placeholder, +.form-control::-moz-placeholder { + color: #c0c0c0; + opacity: 1; +} +input:-ms-input-placeholder, +.form-control:-ms-input-placeholder { + color: #c0c0c0; +} +.form-control, +select { + border-radius: 0; + -webkit-box-shadow: none !important; + box-shadow: none !important; + color: #858585; + background-color: #ffffff; + border: 1px solid #d5d5d5; +} +.form-control:focus, +select:focus { + color: #696969; + border-color: #f59942; + background-color: #ffffff; + outline: none; +} +textarea.form-control { + padding: 5px 9px; +} +select { + padding: 3px 4px; + height: 30px; +} +select.form-control { + padding: 4px 6px; +} +select[multiple], +select.form-control[multiple] { + height: auto; +} +select.input-sm { + border-radius: 0; + padding: 2px 3px; +} +select.input-lg { + border-radius: 0; + padding: 6px 8px; +} +input.block { + display: block; + margin-bottom: 9px; +} +textarea.autosize-transition { + -webkit-transition-duration: "height 0.2s"; + transition-duration: "height 0.2s"; +} +.limiterBox { + border: 1px solid #222; + border-top: none; + background-color: #333; + padding: 3px 6px; + font-size: 13px; + color: #FFF; + margin-top: 6px; +} +.limiterBox:after { + display: none; +} +.limiterBox:before { + display: block; + content: ""; + position: absolute; + width: 0; + height: 0; + top: -8px; + left: 50%; + margin-left: -5px; + border-color: transparent; + border-style: solid; + border-bottom-color: #333; + -moz-border-bottom-colors: #333; + border-width: 0 8px 8px; +} +select option, +select.form-control option { + padding: 3px 4px 5px; +} +select option:active, +select.form-control option:active, +select option:hover, +select.form-control option:hover, +select option:focus, +select.form-control option:focus { + background-color: #eeeeee; + color: #444; +} +select option.no-option, +select.form-control option.no-option { + padding: 1px 0; +} +input[disabled] { + color: #848484 !important; + background-color: #eeeeee !important; +} +input[disabled]:hover { + border-color: #d5d5d5 !important; +} +input[readonly] { + color: #939192; + background: #f5f5f5 !important; + cursor: default; +} +input[readonly]:hover { + border-color: #c3c3c3; +} +input[readonly]:focus { + -webkit-box-shadow: none; + box-shadow: none; + border-color: #aaaaaa; + background-color: #f9f9f9; +} +.help-inline { + font-size: 13px !important; +} +.input-icon { + position: relative; +} +span.input-icon { + display: inline-block; +} +.input-icon > input { + padding-left: 24px; + padding-right: 6px; +} +.input-icon.input-icon-right > input { + padding-left: 6px; + padding-right: 24px; +} +.input-icon > .ace-icon { + padding: 0 3px; + z-index: 2; + position: absolute; + top: 1px; + bottom: 1px; + left: 3px; + line-height: 30px; + display: inline-block; + color: #909090; + font-size: 16px; +} +.input-icon.input-icon-right > .ace-icon { + left: auto; + right: 3px; +} +.input-icon > input:focus + .ace-icon { + color: #579; +} +.input-icon ~ .help-inline { + padding-left: 8px; +} +.form-search .radio [type=radio] + label, +.form-inline .radio [type=radio] + label, +.form-search .checkbox [type=checkbox] + label, +.form-inline .checkbox [type=checkbox] + label { + float: left; + margin-left: -20px; +} +.form-search .form-search .radio [type=radio] + label, +.form-search .form-inline .radio [type=radio] + label, +.form-search .form-search .checkbox [type=checkbox] + label, +.form-search .form-inline .checkbox [type=checkbox] + label, +.form-inline .form-search .radio [type=radio] + label, +.form-inline .form-inline .radio [type=radio] + label, +.form-inline .form-search .checkbox [type=checkbox] + label, +.form-inline .form-inline .checkbox [type=checkbox] + label { + margin-left: 0; + margin-right: 3px; +} +.form-search .input-append .search-query:focus, +.form-search .input-prepend .search-query:focus { + -webkit-box-shadow: none; + box-shadow: none; +} +.input-append input, +.input-prepend input, +.input-append select, +.input-prepend select, +.input-append .uneditable-input, +.input-prepend .uneditable-input { + border-radius: 0; +} +.input-mini { + width: 60px; + max-width: 100%; +} +.input-small { + width: 90px; + max-width: 100%; +} +.input-medium, +.input-md { + width: 150px; + max-width: 100%; +} +.input-large { + width: 210px; + max-width: 100%; +} +.input-xlarge { + width: 270px; + max-width: 100%; +} +.input-xxlarge { + width: 530px; + max-width: 100%; +} +input.input-lg { + font-size: 18px; +} +input[type=checkbox].ace, +input[type=radio].ace { + opacity: 0; + position: absolute; + z-index: 1; + width: 18px; + height: 18px; + cursor: pointer; +} +label input[type=checkbox].ace, +label input[type=radio].ace { + z-index: -100 !important; + width: 1px !important; + height: 1px !important; + clip: rect(1px, 1px, 1px, 1px); + position: absolute; +} +input[type=checkbox].ace:checked, +input[type=radio].ace:checked, +input[type=checkbox].ace:focus, +input[type=radio].ace:focus { + outline: none !important; +} +input[type=checkbox].ace + .lbl, +input[type=radio].ace + .lbl { + position: relative; + display: inline-block; + margin: 0; + line-height: 20px; + min-height: 18px; + min-width: 18px; + font-weight: normal; + cursor: pointer; +} +input[type=checkbox].ace + .lbl::before, +input[type=radio].ace + .lbl::before { + cursor: pointer; + font-family: fontAwesome; + font-weight: normal; + font-size: 12px; + color: #32a3ce; + content: "\a0"; + background-color: #FAFAFA; + border: 1px solid #c8c8c8; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); + /*, inset 0px -15px 10px -12px rgba(0,0,0,0.05);*/ + border-radius: 0; + display: inline-block; + text-align: center; + height: 16px; + line-height: 14px; + min-width: 16px; + margin-right: 1px; + position: relative; + top: -1px; +} +input[type=checkbox].ace:checked + .lbl::before, +input[type=radio].ace:checked + .lbl::before { + display: inline-block; + content: '\f00c'; + background-color: #F5F8FC; + border-color: #adb8c0; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), inset 0px -15px 10px -12px rgba(0, 0, 0, 0.05), inset 15px 10px -12px rgba(255, 255, 255, 0.1); +} +input[type=checkbox].ace:hover + .lbl::before, +input[type=radio].ace:hover + .lbl::before, +input[type=checkbox].ace + .lbl:hover::before, +input[type=radio].ace + .lbl:hover::before { + border-color: #ff893c; +} +input[type=checkbox].ace:active + .lbl::before, +input[type=radio].ace:active + .lbl::before, +input[type=checkbox].ace:checked:active + .lbl::before, +input[type=radio].ace:checked:active + .lbl::before { + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), inset 0px 1px 3px rgba(0, 0, 0, 0.1); +} +input[type=checkbox].ace.ace-checkbox-2 + .lbl::before, +input[type=radio].ace.ace-checkbox-2 + .lbl::before { + box-shadow: none; +} +input[type=checkbox].ace.ace-checkbox-2:checked + .lbl::before, +input[type=radio].ace.ace-checkbox-2:checked + .lbl::before { + background-color: #f9a021; + border-color: #f9a021; + color: #FFF; +} +input[type=checkbox].ace:disabled + .lbl::before, +input[type=radio].ace:disabled + .lbl::before, +input[type=checkbox].ace[disabled] + .lbl::before, +input[type=radio].ace[disabled] + .lbl::before, +input[type=checkbox].ace.disabled + .lbl::before, +input[type=radio].ace.disabled + .lbl::before { + background-color: #DDD !important; + border-color: #CCC !important; + box-shadow: none !important; + color: #BBB; +} +.checkbox label input[type=checkbox].ace + .lbl, +.radio label input[type=radio].ace + .lbl { + margin-left: -10px; +} +/** +input[type=radio].ace @{lbl}::before { + border-radius:100%; + font-size: 34px; + font-family: Helvetica, Arial, "Sans-Serif";//looks better but incosistent + line-height: 13px; +} +*/ +input[type=radio].ace + .lbl::before { + border-radius: 100%; + font-size: 10px; + font-family: FontAwesome; + text-shadow: 0 0 1px #32a3ce; + line-height: 15px; + height: 17px; + min-width: 17px; +} +input[type=radio].ace:checked + .lbl::before { + content: "\f111"; +} +input[type=checkbox].ace.input-lg + .lbl::before { + border-radius: 4px; + font-size: 16px; + height: 24px; + line-height: 21px; + min-width: 24px; + top: auto; +} +input[type=radio].ace.input-lg + .lbl::before { + font-size: 14px; + height: 24px; + line-height: 22px; + min-width: 24px; + top: auto; +} +/* CSS3 on/off switches */ +input[type=checkbox].ace.ace-switch { + width: 55px; + height: 25px; +} +input[type=checkbox].ace.ace-switch + .lbl { + margin: 0 4px; + min-height: 24px; +} +input[type=checkbox].ace.ace-switch + .lbl::before { + font-family: 'Open Sans'; + content: "ON\a0\a0\a0\a0\a0\a0\a0\a0\a0OFF"; + color: #999; + text-shadow: 0 0 0 #999; + font-weight: normal; + font-size: 11px; + line-height: 17px; + height: 20px; + overflow: hidden; + border-radius: 12px; + background-color: #F5F5F5; + -webkit-box-shadow: inset 0 1px 1px 0 rgba(0, 0, 0, 0.15); + box-shadow: inset 0 1px 1px 0 rgba(0, 0, 0, 0.15); + border: 1px solid #CCC; + text-align: left; + float: left; + padding: 0; + width: 52px; + text-indent: -21px; + margin-right: 0; + -webkit-transition: text-indent .3s ease; + -o-transition: text-indent .3s ease; + transition: text-indent .3s ease; + top: auto; +} +input[type=checkbox].ace.ace-switch + .lbl::after { + font-family: 'Open Sans'; + content: 'III'; + font-size: 12px; + font-weight: normal; + letter-spacing: 0; + color: #AAA; + text-shadow: none; + background-color: #FFF; + border-radius: 100%; + width: 22px; + height: 22px; + line-height: 22px; + text-align: center; + position: absolute; + top: -2px; + left: -3px; + -webkit-box-shadow: 0px 1px 1px 1px rgba(0,0,0,.3); + box-shadow: 0px 1px 1px 1px rgba(0,0,0,.3); + -webkit-transition: left .3s ease; + -o-transition: left .3s ease; + transition: left .3s ease; +} +input[type=checkbox].ace.ace-switch:checked + .lbl::before { + text-indent: 8px; + color: #FFF; + text-shadow: 0 0 0 #FFF; + background-color: #8ab2c9; + border-color: #6a8ca8; +} +input[type=checkbox].ace.ace-switch:checked + .lbl::after { + left: 34px; + background-color: #FFF; + color: #98A0A5; +} +input[type=checkbox].ace.ace-switch.ace-switch-2 + .lbl::before { + content: "YES\a0\a0\a0\a0\a0\a0\a0\a0\a0NO"; +} +input[type=checkbox].ace.ace-switch.ace-switch-3 + .lbl::after { + font-family: FontAwesome; + font-size: 13px; + line-height: 22px; + content: "\f00d"; + top: -1px; + text-shadow: none; + padding: 0; + text-align: center; + color: #BBB; + letter-spacing: 0; +} +input[type=checkbox].ace.ace-switch.ace-switch-3:checked + .lbl::after { + content: "\f00c"; + color: #8AB2C9; + text-shadow: none; +} +input[type=checkbox].ace.ace-switch.ace-switch-4, +input[type=checkbox].ace.ace-switch.ace-switch-5 { + width: 60px; +} +input[type=checkbox].ace.ace-switch.ace-switch-4 + .lbl::before, +input[type=checkbox].ace.ace-switch.ace-switch-5 + .lbl::before { + content: "ON\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0OFF"; + font-size: 12px; + line-height: 21px; + height: 24px; + overflow: hidden; + border-radius: 12px; + background-color: #8b9aa3; + border: 1px solid #8b9aa3; + color: #FFF; + width: 56px; + text-indent: -25px; + text-shadow: 0 0 0 #FFF; + display: inline-block; + position: relative; + box-shadow: none; + -webkit-transition: all .3s ease; + -o-transition: all .3s ease; + transition: all .3s ease; +} +input[type=checkbox].ace.ace-switch.ace-switch-4 + .lbl::after, +input[type=checkbox].ace.ace-switch.ace-switch-5 + .lbl::after { + content: 'III'; + font-size: 11px; + position: absolute; + top: 2px; + left: 2px; + letter-spacing: 0; + width: 20px; + height: 20px; + line-height: 19px; + text-shadow: none !important; + color: #939393; + background-color: #FFF; + -webkit-transition: all .3s ease; + -o-transition: all .3s ease; + transition: all .3s ease; +} +input[type=checkbox].ace.ace-switch.ace-switch-4:checked + .lbl::before, +input[type=checkbox].ace.ace-switch.ace-switch-5:checked + .lbl::before { + text-indent: 9px; + background-color: #468fcc; + border-color: #468FCC; +} +input[type=checkbox].ace.ace-switch.ace-switch-4:checked + .lbl::after, +input[type=checkbox].ace.ace-switch.ace-switch-5:checked + .lbl::after { + left: 34px; + background-color: #FFF; + color: #848484; +} +input[type=checkbox].ace.ace-switch.ace-switch-5 + .lbl::before { + content: "YES\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0NO"; +} +input[type=checkbox].ace.ace-switch.ace-switch-5:checked + .lbl::before { + text-indent: 8px; +} +input[type=checkbox].ace.ace-switch.ace-switch-6 + .lbl { + position: relative; +} +input[type=checkbox].ace.ace-switch.ace-switch-6 + .lbl::before { + font-family: FontAwesome; + content: "\f00d"; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + box-shadow: none; + border-width: 0; + font-weight: lighter; + font-size: 16px; + border-radius: 12px; + display: inline-block; + background-color: #888; + color: #F2F2F2; + width: 52px; + height: 22px; + line-height: 21px; + text-indent: 32px; + -webkit-transition: background 0.1s ease; + -o-transition: background 0.1s ease; + transition: background 0.1s ease; +} +input[type=checkbox].ace.ace-switch.ace-switch-6 + .lbl::after { + content: ''; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + position: absolute; + top: 2px; + left: 3px; + border-radius: 12px; + box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + width: 18px; + height: 18px; + text-align: center; + background-color: #F2F2F2; + border: 4px solid #F2F2F2; + -webkit-transition: left 0.2s ease; + -o-transition: left 0.2s ease; + transition: left 0.2s ease; +} +input[type=checkbox].ace.ace-switch.ace-switch-6:checked + .lbl::before { + content: "\f00c"; + text-indent: 6px; + color: #FFF; + border-color: #b7d3e5; + background-color: #ff893c; +} +input[type=checkbox].ace.ace-switch.ace-switch-6:checked + .lbl::after { + left: 32px; + background-color: #FFF; + border: 4px solid #FFF; + text-shadow: 0 -1px 0 rgba(0, 200, 0, 0.25); +} +input[type=checkbox].ace.ace-switch.ace-switch-7 { + width: 75px; +} +input[type=checkbox].ace.ace-switch.ace-switch-7 + .lbl { + position: relative; +} +input[type=checkbox].ace.ace-switch.ace-switch-7 + .lbl::before { + content: "OFF\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0ON"; + font-weight: bolder; + font-size: 13px; + line-height: 20px; + background-color: #FFF; + border: 2px solid #AAA; + border-radius: 0; + box-shadow: none; + color: #AAA; + width: 74px; + height: 26px; + line-height: 22px; + overflow: hidden; + text-indent: 5px; + display: inline-block; + position: relative; + -webkit-transition: all 0.2s ease; + -o-transition: all 0.2s ease; + transition: all 0.2s ease; +} +input[type=checkbox].ace.ace-switch.ace-switch-7 + .lbl::after { + content: '\f00d'; + font-family: FontAwesome; + font-size: 16px; + position: absolute; + top: 3px; + left: 39px; + width: 32px; + height: 20px; + line-height: 18px; + text-align: center; + padding: 0; + text-indent: 0; + background-color: #AAA; + color: #FFF; + border-radius: 0; + box-shadow: none; + -webkit-transition: all 0.2s ease-in-out; + -o-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; +} +input[type=checkbox].ace.ace-switch.ace-switch-7:checked + .lbl::before { + color: #468fcc; + background-color: #FFF; + text-indent: -28px; + border-color: #6fb3e0; +} +input[type=checkbox].ace.ace-switch.ace-switch-7:checked + .lbl::after { + left: 3px; + content: '\f00c'; + background-color: #468fcc; + color: #FFF; +} +input[type=checkbox].ace.ace-switch + .lbl[data-lbl]::before { + content: attr(data-lbl); +} +input[type=checkbox].ace.ace-switch.btn-empty + .lbl::after { + content: ""; +} +input[type=checkbox].ace.ace-switch.btn-rotate + .lbl::after { + content: "\2261"; + line-height: 20px; + font-size: 17px; +} +input[type=checkbox].ace.ace-switch-4.btn-rotate + .lbl::after, +input[type=checkbox].ace.ace-switch-5.btn-rotate + .lbl::after { + line-height: 17px; +} +input[type=checkbox].ace.ace-switch.btn-flat + .lbl::before, +input[type=checkbox].ace.ace-switch.btn-flat + .lbl::after { + border-radius: 0 !important; +} +input[type=checkbox].ace.ace-switch.ace-switch-4 + .lbl::before, +input[type=checkbox].ace.ace-switch.ace-switch-5 + .lbl::before { + text-indent: -24px; +} +input[type=checkbox].ace.ace-switch.ace-switch-4:checked + .lbl::before, +input[type=checkbox].ace.ace-switch.ace-switch-5:checked + .lbl::before { + text-indent: 7px; +} +input.ace + .lbl.padding-16::before { + margin-right: 16px; +} +input.ace + .lbl.padding-14::before { + margin-right: 14px; +} +input.ace + .lbl.padding-12::before { + margin-right: 12px; +} +input.ace + .lbl.padding-10::before { + margin-right: 10px; +} +input.ace + .lbl.padding-8::before { + margin-right: 8px; +} +input.ace + .lbl.padding-6::before { + margin-right: 6px; +} +input.ace + .lbl.padding-4::before { + margin-right: 4px; +} +input.ace + .lbl.padding-2::before { + margin-right: 2px; +} +input.ace + .lbl.padding-0::before { + margin-right: 0px; +} +.ace-file-input { + display: block; + font-size: inherit; + position: relative; + height: 30px; +} +.ace-file-input input[type=file] { + position: absolute; + z-index: -999; + width: 1px; + height: 1px; + overflow: hidden; + opacity: 0; + filter: alpha(opacity=0); +} +.ace-file-input input[type=file]:focus { + outline: none; +} +.ace-file-input .ace-file-container { + display: block; + position: absolute; + top: 0; + left: 0; + right: 0; + height: 30px; + background-color: #ffffff; + border: 1px solid #d5d5d5; + cursor: pointer; + -webkit-box-shadow: none; + box-shadow: none; + -webkit-transition: all 0.15s; + -o-transition: all 0.15s; + transition: all 0.15s; +} +.ace-file-input .ace-file-container:hover { + -webkit-box-shadow: none; + box-shadow: none; + border-color: #f59942; +} +.ace-file-input .ace-file-container:before { + display: inline-block; + content: attr(data-title); + position: absolute; + right: 0; + top: 0; + bottom: 0; + line-height: 24px; + text-align: center; + padding: 0 8px; + background-color: #6fb3e0; + color: #FFF; + font-size: 11px; + font-weight: bold; + border: 2px solid #FFF; + border-left-width: 4px; + -webkit-transition: all 0.3s; + -o-transition: all 0.3s; + transition: all 0.3s; +} +.ace-file-input .ace-file-container .ace-file-name { + display: inline-block; + height: 28px; + max-width: 80%; + white-space: nowrap; + overflow: hidden; + line-height: 28px; + color: #888888; + font-size: 13px; + vertical-align: top; + position: static; + padding-left: 30px; +} +.ace-file-input .ace-file-container .ace-file-name:after { + display: inline-block; + content: attr(data-title); +} +.ace-file-input .ace-file-container.selected { + right: 16px; +} +.ace-file-input .ace-file-container.selected .ace-file-name { + color: #666666; +} +.ace-file-input .ace-file-container .ace-icon { + display: inline-block; + position: absolute; + left: 0; + top: 0; + bottom: 0; + line-height: 24px; + width: 26px; + text-align: center; + font-family: FontAwesome; + font-size: 13px; + border: 2px solid #FFF; + color: #FFF; + -webkit-transition: all 0.1s; + -o-transition: all 0.1s; + transition: all 0.1s; + background-color: #d1d1d1; +} +.ace-file-input .ace-file-container.selected .ace-file-name .ace-icon { + background-color: #efad62; +} +.ace-file-input .ace-file-container.selected .ace-file-name .file-image { + background-color: #bd7a9d; +} +.ace-file-input .ace-file-container.selected .ace-file-name .file-video { + background-color: #87b87f; +} +.ace-file-input .ace-file-container.selected .ace-file-name .file-audio { + background-color: #8b7ac9; +} +.ace-file-input .ace-file-container.selected .ace-file-name .file-archive { + background-color: #efad62; +} +.ace-file-input .ace-file-container.hide-placeholder:before { + display: none; +} +.ace-file-input a:hover { + text-decoration: none; +} +.ace-file-input .remove { + position: absolute; + right: -8px; + top: 6px; + display: none; + width: 17px; + text-align: center; + height: 17px; + line-height: 15px; + font-size: 11px; + font-weight: normal; + background-color: #fb7142; + border-radius: 100%; + color: #FFF; + text-decoration: none; +} +.ace-file-input .ace-file-container.selected + .remove { + display: inline-block; +} +@media screen and (-webkit-min-device-pixel-ratio: 0) { + .ace-file-input input[type=file] { + position: absolute; + width: 0; + height: 0; + } +} +.ace-file-input input[type=file].disabled + .ace-file-container, +.ace-file-input input[type=file][disabled] + .ace-file-container, +.ace-file-input input[type=file][readonly] + .ace-file-container { + cursor: not-allowed; + background-color: #EEE; +} +.ace-file-input input[type=file].disabled + .ace-file-container:hover, +.ace-file-input input[type=file][disabled] + .ace-file-container:hover, +.ace-file-input input[type=file][readonly] + .ace-file-container:hover { + -webkit-box-shadow: none; + box-shadow: none; + border-color: #E3E3E3; +} +.ace-file-input input[type=file].disabled + .ace-file-container:before, +.ace-file-input input[type=file][disabled] + .ace-file-container:before, +.ace-file-input input[type=file][readonly] + .ace-file-container:before { + border-color: #EEE; + background-color: #A1AAAF; +} +.ace-file-input input[type=file][readonly] + .ace-file-container { + cursor: default; +} +.ace-file-input .ace-file-overlay { + position: absolute; + top: -2px; + bottom: -2px; + left: -2px; + right: -10px; + z-index: 99; + background-color: rgba(0, 0, 0, 0.5); +} +.ace-file-input .ace-file-overlay > .overlay-content { + display: inline-block; + position: relative; + top: 10%; + left: 0; + right: 0; + text-align: center; +} +.ace-file-multiple { + height: auto; +} +.ace-file-multiple .ace-file-container { + position: relative; + height: auto; + border: 1px dashed #aaaaaa; + border-radius: 4px; + text-align: center; +} +.ace-file-multiple .ace-file-container:before { + display: inline-block; + content: attr(data-title); + position: relative; + right: 0; + left: 0; + margin: 12px; + line-height: 22px; + background-color: #FFF; + color: #CCC; + font-size: 18px; + font-weight: bold; + border-width: 0; +} +.ace-file-multiple .ace-file-container.selected .ace-file-name .ace-icon { + display: inline-block; + position: absolute; + left: 0; + top: 0; + bottom: 0; + line-height: 24px; + width: 26px; + text-align: center; + font-family: FontAwesome; + font-size: 13px; + border: 2px solid #FFF; + color: #FFF; + -webkit-transition: all 0.1s; + -o-transition: all 0.1s; + transition: all 0.1s; +} +.ace-file-multiple .ace-file-container .ace-file-name { + position: relative; + display: block; + padding: 0; + height: auto; + width: auto; + max-width: 100%; + margin: 0 4px; + border-bottom: 1px solid #DDD; + text-align: left; +} +.ace-file-multiple .ace-file-container .ace-file-name:first-child { + margin-top: 1px; +} +.ace-file-multiple .ace-file-container .ace-file-name:last-child { + border-bottom-width: 0; + margin-bottom: 1px; +} +.ace-file-multiple .ace-file-container .ace-file-name img { + padding: 2px; + border: 1px solid #D7D7D7; + background-color: #FFF; + background-repeat: no-repeat; + background-position: center; + margin: 4px 8px 4px 1px; +} +.ace-file-multiple .ace-file-container .ace-file-name:after { + display: none; +} +.ace-file-multiple .ace-file-container.selected .ace-file-name:after { + display: inline-block; + white-space: pre; +} +.ace-file-multiple .ace-file-container .ace-file-name img + .ace-icon, +.ace-file-multiple .ace-file-container.selected .ace-file-name img + .ace-icon { + display: none; +} +.ace-file-multiple .remove { + right: -11px; + top: -11px; + border: 3px solid #BBB; + border-radius: 32px; + background-color: #FFF; + color: red; + width: 23px; + height: 23px; + line-height: 15px; +} +.ace-file-multiple .ace-file-container.selected + .remove:hover { + border-color: #f4c0b1; +} +.ace-file-multiple .ace-file-overlay { + position: absolute; + top: -12px; + bottom: -6px; + left: -12px; + right: -12px; +} +.ace-file-multiple .ace-file-overlay > .overlay-content { + top: 20%; +} +.ace-file-multiple .ace-file-container .ace-file-name .ace-icon { + position: relative; + display: block; + text-align: center; + height: auto; + line-height: 64px; + width: auto; + font-size: 64px; + color: #D5D5D5; + margin: 4px 0; + background-color: transparent; +} +.ace-file-multiple .ace-file-container.selected:after { + display: none; +} +.ace-file-multiple .ace-file-container.selected .ace-file-name .ace-icon { + position: relative; + margin-right: 4px; + margin-left: 2px; + line-height: 24px; +} +.ace-file-multiple .ace-file-container .ace-file-name.large { + text-align: center; + border-bottom: 1px solid #222; + margin: 0 1px 3px; +} +.ace-file-multiple .ace-file-container .ace-file-name.large:last-child { + margin: 0 1px; +} +.ace-file-multiple .ace-file-container .ace-file-name.large:after { + position: absolute; + top: auto; + bottom: 0; + left: 0; + right: 0; + padding: 0 4px; + background-color: #555; + color: #FFF; + opacity: 0.8; + filter: alpha(opacity=80); +} +.ace-file-multiple .ace-file-container .ace-file-name.large img { + border-width: 0; + margin: 0 !important; + padding: 0; +} +.ace-file-multiple input[type=file].disabled + .ace-file-container:hover, +.ace-file-multiple input[type=file][disabled] + .ace-file-container:hover, +.ace-file-multiple input[type=file][readonly] + .ace-file-container:hover { + border-color: #AAA; +} +.ace-file-multiple input[type=file].disabled + .ace-file-container:before, +.ace-file-multiple input[type=file][disabled] + .ace-file-container:before, +.ace-file-multiple input[type=file][readonly] + .ace-file-container:before { + background-color: transparent; +} +.ace-file-multiple input[type=file].disabled + .ace-file-container .ace-icon, +.ace-file-multiple input[type=file][disabled] + .ace-file-container .ace-icon, +.ace-file-multiple input[type=file][readonly] + .ace-file-container .ace-icon { + border-color: #EEE; +} +.input-group .input-group-addon { + border-radius: 0 !important; +} +.form-group.has-success .input-group .input-group-addon { + border-color: #9cc573; +} +.form-group.has-error .input-group .input-group-addon { + border-color: #f2a696; +} +.form-group.has-warning .input-group .input-group-addon { + border-color: #e3c94c; +} +.form-group.has-info .input-group .input-group-addon { + border-color: #72aec2; +} +.input-group > .btn { + line-height: 20px; + padding: 0 6px; + border-radius: 0 !important; +} +.input-group > .btn.btn-sm { + line-height: 22px; +} +.input-group > .btn + .btn { + margin-left: 1px; +} +.input-group > .btn-group > .btn { + line-height: 23px; +} +.input-group > .btn-group > .btn.btn-sm { + line-height: 26px; +} +.input-group > .btn > .caret, +.input-group > .btn-group > .btn > .caret, +.input-group > .btn.btn-sm > .caret, +.input-group > .btn-group > .btn.btn-sm > .caret { + margin-top: 10px; +} +.input-group.input-group-compact { + width: 1px; +} +.form-group select, +.form-group textarea, +.form-group input[type="text"], +.form-group input[type="password"], +.form-group input[type="datetime"], +.form-group input[type="datetime-local"], +.form-group input[type="date"], +.form-group input[type="month"], +.form-group input[type="time"], +.form-group input[type="week"], +.form-group input[type="number"], +.form-group input[type="email"], +.form-group input[type="url"], +.form-group input[type="search"], +.form-group input[type="tel"], +.form-group input[type="color"] { + background: #FFF; +} +.form-group.has-success input, +.form-group.has-success select, +.form-group.has-success textarea { + border-color: #9cc573; + color: #8bad4c; + -webkit-box-shadow: none; + box-shadow: none; +} +.form-group.has-success input:focus, +.form-group.has-success select:focus, +.form-group.has-success textarea:focus { + -webkit-box-shadow: 0px 0px 0px 2px rgba(130, 188, 58, 0.3); + box-shadow: 0px 0px 0px 2px rgba(130, 188, 58, 0.3); + color: #6f8a3c; + border-color: #779c52; + background-color: #f4f9f0; +} +.form-group.has-success input:focus + .ace-icon, +.form-group.has-success select:focus + .ace-icon, +.form-group.has-success textarea:focus + .ace-icon { + color: #8bad4c; +} +.form-group.has-success .ace-icon { + color: #8bad4c; +} +.form-group.has-success .btn .ace-icon { + color: inherit; +} +.form-group.has-success .control-label, +.form-group.has-success .help-block, +.form-group.has-success .help-inline { + color: #7ba065; +} +.form-group.has-info input, +.form-group.has-info select, +.form-group.has-info textarea { + border-color: #72aec2; + color: #4b89aa; + -webkit-box-shadow: none; + box-shadow: none; +} +.form-group.has-info input:focus, +.form-group.has-info select:focus, +.form-group.has-info textarea:focus { + -webkit-box-shadow: 0px 0px 0px 2px rgba(58, 120, 188, 0.3); + box-shadow: 0px 0px 0px 2px rgba(58, 120, 188, 0.3); + color: #3b6c87; + border-color: #488ea5; + background-color: #f1f7f9; +} +.form-group.has-info input:focus + .ace-icon, +.form-group.has-info select:focus + .ace-icon, +.form-group.has-info textarea:focus + .ace-icon { + color: #4b89aa; +} +.form-group.has-info .ace-icon { + color: #4b89aa; +} +.form-group.has-info .btn .ace-icon { + color: inherit; +} +.form-group.has-info .control-label, +.form-group.has-info .help-block, +.form-group.has-info .help-inline { + color: #657ba0; +} +.form-group.has-error input, +.form-group.has-error select, +.form-group.has-error textarea { + border-color: #f2a696; + color: #d68273; + -webkit-box-shadow: none; + box-shadow: none; +} +.form-group.has-error input:focus, +.form-group.has-error select:focus, +.form-group.has-error textarea:focus { + -webkit-box-shadow: 0px 0px 0px 2px rgba(219, 137, 120, 0.3); + box-shadow: 0px 0px 0px 2px rgba(219, 137, 120, 0.3); + color: #ca5f4c; + border-color: #d77b68; + background-color: #fef9f8; +} +.form-group.has-error input:focus + .ace-icon, +.form-group.has-error select:focus + .ace-icon, +.form-group.has-error textarea:focus + .ace-icon { + color: #d68273; +} +.form-group.has-error .ace-icon { + color: #d68273; +} +.form-group.has-error .btn .ace-icon { + color: inherit; +} +.form-group.has-error .control-label, +.form-group.has-error .help-block, +.form-group.has-error .help-inline { + color: #d16e6c; +} +.form-group.has-warning input, +.form-group.has-warning select, +.form-group.has-warning textarea { + border-color: #e3c94c; + color: #d3bd50; + -webkit-box-shadow: none; + box-shadow: none; +} +.form-group.has-warning input:focus, +.form-group.has-warning select:focus, +.form-group.has-warning textarea:focus { + -webkit-box-shadow: 0px 0px 0px 2px rgba(216, 188, 65, 0.3); + box-shadow: 0px 0px 0px 2px rgba(216, 188, 65, 0.3); + color: #c0a830; + border-color: #d5b630; + background-color: #fdfbf3; +} +.form-group.has-warning input:focus + .ace-icon, +.form-group.has-warning select:focus + .ace-icon, +.form-group.has-warning textarea:focus + .ace-icon { + color: #d3bd50; +} +.form-group.has-warning .ace-icon { + color: #d3bd50; +} +.form-group.has-warning .btn .ace-icon { + color: inherit; +} +.form-group.has-warning .control-label, +.form-group.has-warning .help-block, +.form-group.has-warning .help-inline { + color: #d19d59; +} +.form-group input[disabled], +.form-group input:disabled { + color: #848484 !important; + background-color: #eeeeee !important; +} +@media only screen and (max-width: 767px) { + .help-inline, + .input-icon + .help-inline { + padding-left: 0; + display: block !important; + } +} +.tab-content { + border: 1px solid #c5d0dc; + padding: 16px 12px; + position: relative; +} +.tab-content.no-padding { + padding: 0; +} +.tab-content.no-border { + border: none; + padding: 12px; +} +.tab-content.padding-32 { + padding: 32px 24px; +} +.tab-content.no-border.padding-32 { + padding: 32px; +} +.tab-content.padding-30 { + padding: 30px 23px; +} +.tab-content.no-border.padding-30 { + padding: 30px; +} +.tab-content.padding-28 { + padding: 28px 21px; +} +.tab-content.no-border.padding-28 { + padding: 28px; +} +.tab-content.padding-26 { + padding: 26px 20px; +} +.tab-content.no-border.padding-26 { + padding: 26px; +} +.tab-content.padding-24 { + padding: 24px 18px; +} +.tab-content.no-border.padding-24 { + padding: 24px; +} +.tab-content.padding-22 { + padding: 22px 17px; +} +.tab-content.no-border.padding-22 { + padding: 22px; +} +.tab-content.padding-20 { + padding: 20px 15px; +} +.tab-content.no-border.padding-20 { + padding: 20px; +} +.tab-content.padding-18 { + padding: 18px 14px; +} +.tab-content.no-border.padding-18 { + padding: 18px; +} +.tab-content.padding-16 { + padding: 16px 12px; +} +.tab-content.no-border.padding-16 { + padding: 16px; +} +.tab-content.padding-14 { + padding: 14px 11px; +} +.tab-content.no-border.padding-14 { + padding: 14px; +} +.tab-content.padding-12 { + padding: 12px 9px; +} +.tab-content.no-border.padding-12 { + padding: 12px; +} +.tab-content.padding-10 { + padding: 10px 8px; +} +.tab-content.no-border.padding-10 { + padding: 10px; +} +.tab-content.padding-8 { + padding: 8px 6px; +} +.tab-content.no-border.padding-8 { + padding: 8px; +} +.tab-content.padding-6 { + padding: 6px 5px; +} +.tab-content.no-border.padding-6 { + padding: 6px; +} +.tab-content.padding-4 { + padding: 4px 3px; +} +.tab-content.no-border.padding-4 { + padding: 4px; +} +.tab-content.padding-2 { + padding: 2px 2px; +} +.tab-content.no-border.padding-2 { + padding: 2px; +} +.tab-content.padding-0 { + padding: 0px 0px; +} +.tab-content.no-border.padding-0 { + padding: 0px; +} +.nav.nav-tabs.padding-32 { + padding-left: 32px; +} +.tabs-right > .nav.nav-tabs.padding-32, +.tabs-left > .nav.nav-tabs.padding-32 { + padding-left: 0; + padding-top: 32px; +} +.nav.nav-tabs.padding-30 { + padding-left: 30px; +} +.tabs-right > .nav.nav-tabs.padding-30, +.tabs-left > .nav.nav-tabs.padding-30 { + padding-left: 0; + padding-top: 30px; +} +.nav.nav-tabs.padding-28 { + padding-left: 28px; +} +.tabs-right > .nav.nav-tabs.padding-28, +.tabs-left > .nav.nav-tabs.padding-28 { + padding-left: 0; + padding-top: 28px; +} +.nav.nav-tabs.padding-26 { + padding-left: 26px; +} +.tabs-right > .nav.nav-tabs.padding-26, +.tabs-left > .nav.nav-tabs.padding-26 { + padding-left: 0; + padding-top: 26px; +} +.nav.nav-tabs.padding-24 { + padding-left: 24px; +} +.tabs-right > .nav.nav-tabs.padding-24, +.tabs-left > .nav.nav-tabs.padding-24 { + padding-left: 0; + padding-top: 24px; +} +.nav.nav-tabs.padding-22 { + padding-left: 22px; +} +.tabs-right > .nav.nav-tabs.padding-22, +.tabs-left > .nav.nav-tabs.padding-22 { + padding-left: 0; + padding-top: 22px; +} +.nav.nav-tabs.padding-20 { + padding-left: 20px; +} +.tabs-right > .nav.nav-tabs.padding-20, +.tabs-left > .nav.nav-tabs.padding-20 { + padding-left: 0; + padding-top: 20px; +} +.nav.nav-tabs.padding-18 { + padding-left: 18px; +} +.tabs-right > .nav.nav-tabs.padding-18, +.tabs-left > .nav.nav-tabs.padding-18 { + padding-left: 0; + padding-top: 18px; +} +.nav.nav-tabs.padding-16 { + padding-left: 16px; +} +.tabs-right > .nav.nav-tabs.padding-16, +.tabs-left > .nav.nav-tabs.padding-16 { + padding-left: 0; + padding-top: 16px; +} +.nav.nav-tabs.padding-14 { + padding-left: 14px; +} +.tabs-right > .nav.nav-tabs.padding-14, +.tabs-left > .nav.nav-tabs.padding-14 { + padding-left: 0; + padding-top: 14px; +} +.nav.nav-tabs.padding-12 { + padding-left: 12px; +} +.tabs-right > .nav.nav-tabs.padding-12, +.tabs-left > .nav.nav-tabs.padding-12 { + padding-left: 0; + padding-top: 12px; +} +.nav.nav-tabs.padding-10 { + padding-left: 10px; +} +.tabs-right > .nav.nav-tabs.padding-10, +.tabs-left > .nav.nav-tabs.padding-10 { + padding-left: 0; + padding-top: 10px; +} +.nav.nav-tabs.padding-8 { + padding-left: 8px; +} +.tabs-right > .nav.nav-tabs.padding-8, +.tabs-left > .nav.nav-tabs.padding-8 { + padding-left: 0; + padding-top: 8px; +} +.nav.nav-tabs.padding-6 { + padding-left: 6px; +} +.tabs-right > .nav.nav-tabs.padding-6, +.tabs-left > .nav.nav-tabs.padding-6 { + padding-left: 0; + padding-top: 6px; +} +.nav.nav-tabs.padding-4 { + padding-left: 4px; +} +.tabs-right > .nav.nav-tabs.padding-4, +.tabs-left > .nav.nav-tabs.padding-4 { + padding-left: 0; + padding-top: 4px; +} +.nav.nav-tabs.padding-2 { + padding-left: 2px; +} +.tabs-right > .nav.nav-tabs.padding-2, +.tabs-left > .nav.nav-tabs.padding-2 { + padding-left: 0; + padding-top: 2px; +} +.nav-tabs { + border-color: #C5D0DC; + margin-bottom: 0 !important; + margin-left: 0; + position: relative; + top: 1px; +} +.nav-tabs > li > a { + padding: 7px 12px 8px; +} +.nav-tabs > li > a, +.nav-tabs > li > a:focus { + border-radius: 0 !important; + border-color: #c5d0dc; + background-color: #F9F9F9; + color: #999; + margin-right: -1px; + line-height: 18px; + position: relative; +} +.nav-tabs > li > a:hover { + background-color: #FFF; + color: #4c8fbd; + border-color: #c5d0dc; +} +.nav-tabs > li > a:active, +.nav-tabs > li > a:focus { + outline: none !important; +} +.nav-tabs > li:first-child > a { + margin-left: 0; +} +.nav-tabs > li.active > a, +.nav-tabs > li.active > a:hover, +.nav-tabs > li.active > a:focus { + color: #576373; + border-color: #c5d0dc; + border-top: 2px solid #4c8fbd; + border-bottom-color: transparent; + background-color: #FFF; + z-index: 1; + line-height: 18px; + margin-top: -1px; + box-shadow: 0 -2px 3px 0 rgba(0, 0, 0, 0.15); +} +.tabs-below > .nav-tabs { + /* tabs below */ + top: auto; + margin-bottom: 0; + margin-top: -1px; + border-color: #c5d0dc; + border-bottom-width: 0; +} +.tabs-below > .nav-tabs > li > a, +.tabs-below > .nav-tabs > li > a:hover, +.tabs-below > .nav-tabs > li > a:focus { + border-color: #c5d0dc; +} +.tabs-below > .nav-tabs > li.active > a, +.tabs-below > .nav-tabs > li.active > a:hover, +.tabs-below > .nav-tabs > li.active > a:focus { + border-color: #c5d0dc; + border-top-width: 1px; + border-bottom: 2px solid #4c8fbd; + border-top-color: transparent; + margin-top: 0; + box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.15); +} +.tabs-left > .nav-tabs > li > a, +.tabs-right > .nav-tabs > li > a { + min-width: 60px; +} +.tabs-left > .nav-tabs { + top: auto; + margin-bottom: 0; + border-color: #c5d0dc; + float: left; +} +.tabs-left > .nav-tabs > li { + float: none !important; +} +.tabs-left > .nav-tabs > li > a, +.tabs-left > .nav-tabs > li > a:focus, +.tabs-left > .nav-tabs > li > a:hover { + border-color: #c5d0dc; + margin: 0 -1px 0 0; +} +.tabs-left > .nav-tabs > li.active > a, +.tabs-left > .nav-tabs > li.active > a:focus, +.tabs-left > .nav-tabs > li.active > a:hover { + border-color: #c5d0dc; + border-top-width: 1px; + border-left: 2px solid #4c8fbd; + border-right-color: transparent; + margin: 0 -1px 0 -1px; + -webkit-box-shadow: -2px 0 3px 0 rgba(0,0,0,0.15) !important; + box-shadow: -2px 0 3px 0 rgba(0,0,0,0.15) !important; +} +.tabs-right > .nav-tabs { + top: auto; + margin-bottom: 0; + border-color: #c5d0dc; + float: right; +} +.tabs-right > .nav-tabs > li { + float: none !important; +} +.tabs-right > .nav-tabs > li > a, +.tabs-right > .nav-tabs > li > a:focus, +.tabs-right > .nav-tabs > li > a:hover { + border-color: #c5d0dc; + margin: 0 -1px; +} +.tabs-right > .nav-tabs > li.active > a, +.tabs-right > .nav-tabs > li.active > a:focus, +.tabs-right > .nav-tabs > li.active > a:hover { + border-color: #c5d0dc; + border-top-width: 1px; + border-right: 2px solid #4c8fbd; + border-left-color: transparent; + margin: 0 -2px 0 -1px; + -webkit-box-shadow: 2px 0 3px 0 rgba(0,0,0,0.15); + box-shadow: 2px 0 3px 0 rgba(0,0,0,0.15); +} +.nav-tabs > li > a > .badge { + padding: 1px 5px; + line-height: 15px; + opacity: 0.75; +} +.nav-tabs > li > a > .ace-icon { + opacity: 0.75; +} +.nav-tabs > li.active > a > .badge, +.nav-tabs > li.active > a > .ace-icon { + opacity: 1; +} +.nav-tabs li .ace-icon { + width: 1.25em; + display: inline-block; + text-align: center; +} +.nav-tabs > li.open .dropdown-toggle { + background-color: #4F99C6; + border-color: #4F99C6; + color: #FFF; +} +.nav-tabs > li.open .dropdown-toggle > .ace-icon { + color: #FFF !important; +} +.tabs-left .tab-content, +.tabs-right .tab-content { + overflow: auto; +} +.nav-pills .open .dropdown-toggle, +.nav > li.dropdown.open.active > a:hover, +.nav > li.dropdown.open.active > a:focus { + background-color: #4F99C6; + border-color: #4F99C6; + color: #FFFFFF; +} +.nav-pills .open .dropdown-toggle > .ace-icon, +.nav > li.dropdown.open.active > a:hover > .ace-icon, +.nav > li.dropdown.open.active > a:focus > .ace-icon { + color: #FFF !important; +} +/* bigger tab buttons */ +.nav-tabs > li:not(.active):not(.open) > a:not(:hover) > .ace-icon:first-child.disabled { + color: #909090 !important; +} +/* bigger tab buttons */ +.nav-tabs.tab-size-bigger > li > a { + padding-left: 14px; + padding-right: 14px; +} +.nav-tabs.tab-size-bigger > li > a > .ace-icon:first-child { + display: block; + margin-bottom: 6px; + width: auto; +} +.nav-tabs.tab-space-1 > li > a { + margin-right: 1px; +} +.nav-tabs.tab-space-2 > li > a { + margin-right: 2px; +} +.nav-tabs.tab-space-3 > li > a { + margin-right: 3px; +} +.nav-tabs.tab-space-4 > li > a { + margin-right: 4px; +} +.nav-tabs[class*="tab-color-"] > li > a, +.nav-tabs[class*="tab-color-"] > li > a:focus, +.nav-tabs[class*="tab-color-"] > li > a:hover { + color: #FFF; + border-color: transparent; + margin-right: 3px; +} +.nav-tabs[class*="tab-color-"] > li > a > .badge { + border-radius: 2px; +} +.nav-tabs[class*="tab-color-"] > li:not(.active) > a:hover { + opacity: 0.85; + border-color: rgba(0, 0, 0, 0.15); + border-bottom-color: transparent; +} +.nav-tabs[class*="tab-color-"] > li:not(.active) > a > .ace-icon:first-child { + color: #FFF !important; +} +.nav-tabs[class*="tab-color-"] > li:not(.active) > a > .badge { + color: rgba(0, 0, 0, 0.4) !important; + background-color: #FFF !important; + border-radius: 2px; +} +.nav-tabs.tab-color-blue > li > a, +.nav-tabs.tab-color-blue > li > a:focus { + background-color: #7db4d8; +} +.nav-tabs[class*="tab-color-"] > li.active > a, +.nav-tabs[class*="tab-color-"] > li.active > a:focus, +.nav-tabs[class*="tab-color-"] > li.active > a:hover { + background-color: #FFF; + color: #4f80a0; + -webkit-box-shadow: none !important; + box-shadow: none !important; +} +.nav-tabs.tab-color-blue > li.active > a, +.nav-tabs.tab-color-blue > li.active > a:focus, +.nav-tabs.tab-color-blue > li.active > a:hover { + color: #4c718a; + border-color: #7db4d8 #7db4d8 transparent; +} +.tabs-below .nav-tabs.tab-color-blue > li.active > a { + border-color: transparent #7db4d8 #7db4d8; +} +.nav-tabs.tab-color-blue { + border-bottom-color: #C5D0DC; +} +/* background for tab links */ +.nav-tabs.background-blue { + padding-top: 6px; + background-color: #EFF3F8; + border: 1px solid #C5D0DC; +} +.tabs-below .nav-tabs.background-blue { + padding-top: 0; + padding-bottom: 6px; +} +.tabs-below .nav-tabs.tab-color-blue { + border-top: none; + border-bottom-color: #C5D0DC; +} +.accordion-style1.panel-group .panel { + border-radius: 0; + border-color: #cdd8e3; + background-color: #FFF; + box-shadow: none; +} +.accordion-style1.panel-group .panel:last-child { + border-bottom-width: 1px; +} +.accordion-style1.panel-group .panel .collapse { + background-color: #FFF; +} +.accordion-style1.panel-group .panel + .panel { + margin-top: 2px; +} +.accordion-style1.panel-group .panel-heading + .panel-collapse .panel-body { + border-top-color: #cdd8e3 !important; +} +.accordion-style1.panel-group .panel-heading { + padding: 0; +} +.accordion-style1.panel-group .panel-heading .accordion-toggle { + color: #4c8fbd; + background-color: #eef4f9; + position: relative; + font-weight: bold; + font-size: 13px; + line-height: 1; + padding: 10px; + display: block; +} +.accordion-style1.panel-group .panel-heading .accordion-toggle.collapsed { + color: #478fca; + font-weight: normal; + background-color: #F9F9F9; +} +.accordion-style1.panel-group .panel-heading .accordion-toggle:hover { + color: #6ea6cc; + background-color: #f1f8fd; + text-decoration: none; +} +.accordion-style1.panel-group .panel-heading .accordion-toggle:focus, +.accordion-style1.panel-group .panel-heading .accordion-toggle:active { + outline: none; + text-decoration: none; +} +.accordion-style1.panel-group .panel-heading .accordion-toggle > .ace-icon:first-child { + width: 16px; +} +.accordion-style1.panel-group .panel-heading .accordion-toggle:hover > .ace-icon:first-child { + text-decoration: none; +} +.accordion-style1.panel-group .panel-body, +.accordion-style1.panel-group .collapse.in > .panel-body { + border-top: 1px solid #cdd8e3; +} +.accordion-style1.panel-group.no-padding { + padding: 0; +} +.accordion-style2.panel-group .panel { + border-width: 0; +} +.accordion-style2.panel-group .panel:last-child { + border-bottom-width: 0; +} +.accordion-style2.panel-group .panel + .panel { + margin-top: 4px; +} +.accordion-style2.panel-group .panel .panel-body { + border-top: none; +} +.accordion-style2.panel-group .panel-heading .accordion-toggle { + background-color: #EDF3F7; + border: 2px solid #6EAED1; + border-width: 0 0 0 2px; +} +.accordion-style2.panel-group .panel-heading .accordion-toggle:hover { + text-decoration: none; +} +.accordion-style2.panel-group .panel-heading .accordion-toggle.collapsed { + background-color: #F3F3F3; + color: #606060; + border-width: 0 0 0 1px; + border-color: #D9D9D9; +} +.accordion-style2.panel-group .panel-heading .accordion-toggle.collapsed:hover { + background-color: #F6F6F6; + color: #438EB9; + text-decoration: none; +} +.accordion-style2.panel-group .panel-body, +.accordion-style2.panel-group .collapse.in > .panel-body { + border-top: none; +} +.accordion-style2.panel-group .accordion-style2.panel-group .panel { + border-bottom: 1px dotted #D9D9D9; +} +.accordion-style2.panel-group .accordion-style2.panel-group .panel:last-child { + border-bottom: none; +} +.accordion-style2.panel-group .accordion-style2.panel-group .panel .panel-heading, +.accordion-style2.panel-group .accordion-style2.panel-group .panel .panel-heading .accordion-toggle { + background-color: transparent; + border-width: 0; + font-size: 13px; + padding-top: 6px; + padding-bottom: 8px; +} +.accordion-style2.panel-group .accordion-style2.panel-group .panel .panel-heading { + padding-top: 0; + padding-bottom: 0; +} +/* tables */ +th, +td, +.table-bordered { + border-radius: 0 !important; +} +.table > thead > tr { + color: #707070; + font-weight: normal; + background: #F2F2F2; + background-image: -webkit-linear-gradient(top, #f8f8f8 0%, #ececec 100%); + background-image: -o-linear-gradient(top, #f8f8f8 0%, #ececec 100%); + background-image: linear-gradient(to bottom, #f8f8f8 0%, #ececec 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff8f8f8', endColorstr='#ffececec', GradientType=0); +} +.table > thead > tr > th { + border-color: #dddddd; + font-weight: bold; +} +.table > thead > tr > th .ace-icon:first-child { + margin-right: 2px; +} +.table > thead > tr > th:first-child { + border-left-color: #F1F1F1; +} +.table > thead > tr > th:last-child { + border-right-color: #F1F1F1; +} +.table.table-bordered > thead > tr > th { + /* border-color: @table-border-color; */ + vertical-align: middle; +} +.table.table-bordered > thead > tr > th:first-child { + border-left-color: #dddddd; +} +th.center, +td.center { + text-align: center; +} +th .lbl, +td .lbl { + margin-bottom: 0; +} +th .lbl:only-child, +td .lbl:only-child { + vertical-align: top; +} +.table-header { + background-color: #307ecc; + color: #FFF; + font-size: 14px; + line-height: 38px; + padding-left: 12px; + margin-bottom: 1px; +} +.table-header .close { + margin-right: 8px; + margin-top: 0; + opacity: 0.45; + filter: alpha(opacity=45); +} +.table-header .close:hover { + opacity: 0.75; + filter: alpha(opacity=75); +} +.widget-box { + padding: 0; + -webkit-box-shadow: none; + box-shadow: none; + margin: 3px 0; + border: 1px solid #CCC; +} +@media only screen and (max-width: 767px) { + .widget-box { + margin-top: 7px; + margin-bottom: 7px; + } +} +.widget-header { + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + position: relative; + min-height: 38px; + background: #f7f7f7; + background-image: -webkit-linear-gradient(top, #ffffff 0%, #eeeeee 100%); + background-image: -o-linear-gradient(top, #ffffff 0%, #eeeeee 100%); + background-image: linear-gradient(to bottom, #ffffff 0%, #eeeeee 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffeeeeee', GradientType=0); + color: #669fc7; + border-bottom: 1px solid #DDD; + padding-left: 12px; +} +.widget-header:before, +.widget-header:after { + content: ""; + display: table; + line-height: 0; +} +.widget-header:after { + clear: right; +} +.widget-box.collapsed > .widget-header { + border-bottom-width: 0; +} +.collapsed.fullscreen > .widget-header { + border-bottom-width: 1px; +} +.collapsed > .widget-body { + display: none; +} +.widget-header-flat { + background: #F7F7F7; + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); +} +.widget-header-large { + min-height: 49px; + padding-left: 18px; +} +.widget-header-small { + min-height: 31px; + padding-left: 10px; +} +.widget-header > .widget-title { + line-height: 36px; + padding: 0; + margin: 0; + display: inline; +} +.widget-header > .widget-title > .ace-icon { + margin-right: 5px; + font-weight: normal; + display: inline-block; +} +.widget-header-large > .widget-title { + line-height: 48px; +} +.widget-header-small > .widget-title { + line-height: 30px; +} +.widget-toolbar { + display: inline-block; + padding: 0 10px; + line-height: 37px; + float: right; + position: relative; +} +.widget-header-large > .widget-toolbar { + line-height: 48px; +} +.widget-header-small > .widget-toolbar { + line-height: 29px; +} +.widget-toolbar.no-padding { + padding: 0; +} +.widget-toolbar.padding-5 { + padding: 0 5px; +} +.widget-toolbar:before { + display: inline-block; + content: ""; + position: absolute; + top: 3px; + bottom: 3px; + left: -1px; + border: 1px solid #D9D9D9; + border-width: 0 1px 0 0; +} +.widget-header-large > .widget-toolbar:before { + top: 6px; + bottom: 6px; +} +[class*="widget-color-"] > .widget-header > .widget-toolbar:before { + border-color: #EEE; +} +.widget-color-orange > .widget-header > .widget-toolbar:before { + border-color: #FEA; +} +.widget-color-dark > .widget-header > .widget-toolbar:before { + border-color: #222; + box-shadow: -1px 0 0 rgba(255, 255, 255, 0.2), inset 1px 0 0 rgba(255, 255, 255, 0.1); +} +.widget-toolbar.no-border:before { + display: none; +} +.widget-toolbar label { + display: inline-block; + vertical-align: middle; + margin-bottom: 0; +} +.widget-toolbar > a, +.widget-toolbar > .widget-menu > a { + font-size: 14px; + margin: 0 1px; + display: inline-block; + padding: 0; + line-height: 24px; +} +.widget-toolbar > a:hover, +.widget-toolbar > .widget-menu > a:hover { + text-decoration: none; +} +.widget-header-large > .widget-toolbar > a, +.widget-header-large > .widget-toolbar > .widget-menu > a { + font-size: 15px; + margin: 0 1px; +} +.widget-toolbar > .btn { + line-height: 27px; + margin-top: -2px; +} +.widget-toolbar > .btn.smaller { + line-height: 26px; +} +.widget-toolbar > .btn.bigger { + line-height: 28px; +} +.widget-toolbar > .btn-sm { + line-height: 24px; +} +.widget-toolbar > .btn-sm.smaller { + line-height: 23px; +} +.widget-toolbar > .btn-sm.bigger { + line-height: 25px; +} +.widget-toolbar > .btn-xs { + line-height: 22px; +} +.widget-toolbar > .btn-xs.smaller { + line-height: 21px; +} +.widget-toolbar > .btn-xs.bigger { + line-height: 23px; +} +.widget-toolbar > .btn-minier { + line-height: 18px; +} +.widget-toolbar > .btn-minier.smaller { + line-height: 17px; +} +.widget-toolbar > .btn-minier.bigger { + line-height: 19px; +} +.widget-toolbar > .btn-lg { + line-height: 36px; +} +.widget-toolbar > .btn-lg.smaller { + line-height: 34px; +} +.widget-toolbar > .btn-lg.bigger { + line-height: 38px; +} +.widget-toolbar-dark { + background: #444; +} +.widget-toolbar-light { + background: rgba(255, 255, 255, 0.85); +} +.widget-toolbar > .widget-menu { + display: inline-block; + position: relative; +} +.widget-toolbar > a[data-action], +.widget-toolbar > .widget-menu > a[data-action] { + -webkit-transition: transform 0.1s; + -o-transition: transform 0.1s; + transition: transform 0.1s; +} +.widget-toolbar > a[data-action] > .ace-icon, +.widget-toolbar > .widget-menu > a[data-action] > .ace-icon { + margin-right: 0; +} +.widget-toolbar > a[data-action]:focus, +.widget-toolbar > .widget-menu > a[data-action]:focus { + text-decoration: none; + outline: none; +} +.widget-toolbar > a[data-action]:hover, +.widget-toolbar > .widget-menu > a[data-action]:hover { + -moz-transform: scale(1.2); + -webkit-transform: scale(1.2); + -o-transform: scale(1.2); + -ms-transform: scale(1.2); + transform: scale(1.2); +} +.widget-body { + background-color: #FFF; +} +.widget-main { + padding: 12px; +} +.widget-main.padding-32 { + padding: 32px; +} +.widget-main.padding-30 { + padding: 30px; +} +.widget-main.padding-28 { + padding: 28px; +} +.widget-main.padding-26 { + padding: 26px; +} +.widget-main.padding-24 { + padding: 24px; +} +.widget-main.padding-22 { + padding: 22px; +} +.widget-main.padding-20 { + padding: 20px; +} +.widget-main.padding-18 { + padding: 18px; +} +.widget-main.padding-16 { + padding: 16px; +} +.widget-main.padding-14 { + padding: 14px; +} +.widget-main.padding-12 { + padding: 12px; +} +.widget-main.padding-10 { + padding: 10px; +} +.widget-main.padding-8 { + padding: 8px; +} +.widget-main.padding-6 { + padding: 6px; +} +.widget-main.padding-4 { + padding: 4px; +} +.widget-main.padding-2 { + padding: 2px; +} +.widget-main.padding-0 { + padding: 0px; +} +.widget-main.no-padding { + padding: 0; +} +.widget-toolbar .progress { + vertical-align: middle; + display: inline-block; + margin: 0; +} +.widget-toolbar > .dropdown, +.widget-toolbar > .dropup { + display: inline-block; +} +.widget-box > .widget-header > .widget-toolbar > [data-action="settings"], +.widget-color-dark > .widget-header > .widget-toolbar > [data-action="settings"], +.widget-box > .widget-header > .widget-toolbar > .widget-menu > [data-action="settings"], +.widget-color-dark > .widget-header > .widget-toolbar > .widget-menu > [data-action="settings"] { + color: #99CADB; +} +.widget-box > .widget-header > .widget-toolbar > [data-action="reload"], +.widget-color-dark > .widget-header > .widget-toolbar > [data-action="reload"], +.widget-box > .widget-header > .widget-toolbar > .widget-menu > [data-action="reload"], +.widget-color-dark > .widget-header > .widget-toolbar > .widget-menu > [data-action="reload"] { + color: #ACD392; +} +.widget-box > .widget-header > .widget-toolbar > [data-action="collapse"], +.widget-color-dark > .widget-header > .widget-toolbar > [data-action="collapse"], +.widget-box > .widget-header > .widget-toolbar > .widget-menu > [data-action="collapse"], +.widget-color-dark > .widget-header > .widget-toolbar > .widget-menu > [data-action="collapse"] { + color: #AAA; +} +.widget-box > .widget-header > .widget-toolbar > [data-action="close"], +.widget-color-dark > .widget-header > .widget-toolbar > [data-action="close"], +.widget-box > .widget-header > .widget-toolbar > .widget-menu > [data-action="close"], +.widget-color-dark > .widget-header > .widget-toolbar > .widget-menu > [data-action="close"] { + color: #E09E96; +} +.widget-box[class*="widget-color-"] > .widget-header { + color: #FFF; + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); +} +.widget-color-blue { + border-color: #307ecc; +} +.widget-color-blue > .widget-header { + background: #307ecc; + border-color: #307ecc; +} +.widget-color-blue2 { + border-color: #5090c1; +} +.widget-color-blue2 > .widget-header { + background: #5090c1; + border-color: #5090c1; +} +.widget-color-blue3 { + border-color: #6379aa; +} +.widget-color-blue3 > .widget-header { + background: #6379aa; + border-color: #6379aa; +} +.widget-color-green { + border-color: #82af6f; +} +.widget-color-green > .widget-header { + background: #82af6f; + border-color: #82af6f; +} +.widget-color-green2 { + border-color: #2e8965; +} +.widget-color-green2 > .widget-header { + background: #2e8965; + border-color: #2e8965; +} +.widget-color-green3 { + border-color: #4ebc30; +} +.widget-color-green3 > .widget-header { + background: #4ebc30; + border-color: #4ebc30; +} +.widget-color-red { + border-color: #e2755f; +} +.widget-color-red > .widget-header { + background: #e2755f; + border-color: #e2755f; +} +.widget-color-red2 { + border-color: #e04141; +} +.widget-color-red2 > .widget-header { + background: #e04141; + border-color: #e04141; +} +.widget-color-red3 { + border-color: #d15b47; +} +.widget-color-red3 > .widget-header { + background: #d15b47; + border-color: #d15b47; +} +.widget-color-purple { + border-color: #7e6eb0; +} +.widget-color-purple > .widget-header { + background: #7e6eb0; + border-color: #7e6eb0; +} +.widget-color-pink { + border-color: #ce6f9e; +} +.widget-color-pink > .widget-header { + background: #ce6f9e; + border-color: #ce6f9e; +} +.widget-color-orange { + border-color: #e8b10d; +} +.widget-color-orange > .widget-header { + color: #855d10 !important; + border-color: #e8b10d; + background: #ffc657; +} +.widget-color-dark { + border-color: #5a5a5a; +} +.widget-color-dark > .widget-header { + border-color: #666666; + background: #404040; +} +.widget-color-grey { + border-color: #9e9e9e; +} +.widget-color-grey > .widget-header { + border-color: #aaaaaa; + background: #848484; +} +.widget-box.transparent { + border-width: 0; +} +.widget-box.transparent > .widget-header { + background: none; + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + border-width: 0; + border-bottom: 1px solid #DCE8F1; + color: #4383B4; + padding-left: 3px; +} +.widget-box.transparent > .widget-header-large { + padding-left: 5px; +} +.widget-box.transparent > .widget-header-small { + padding-left: 1px; +} +.widget-box.transparent > .widget-body { + border-width: 0; + background-color: transparent; +} +[class*="widget-color-"] > .widget-header > .widget-toolbar > [data-action], +[class*="widget-color-"] > .widget-header > .widget-toolbar > .widget-menu > [data-action] { + text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.2); +} +[class*="widget-color-"] > .widget-header > .widget-toolbar > [data-action="settings"], +[class*="widget-color-"] > .widget-header > .widget-toolbar > .widget-menu > [data-action="settings"] { + color: #D3E4ED; +} +[class*="widget-color-"] > .widget-header > .widget-toolbar > [data-action="reload"], +[class*="widget-color-"] > .widget-header > .widget-toolbar > .widget-menu > [data-action="reload"] { + color: #DEEAD3; +} +[class*="widget-color-"] > .widget-header > .widget-toolbar > [data-action="collapse"], +[class*="widget-color-"] > .widget-header > .widget-toolbar > .widget-menu > [data-action="collapse"] { + color: #E2E2E2; +} +[class*="widget-color-"] > .widget-header > .widget-toolbar > [data-action="close"], +[class*="widget-color-"] > .widget-header > .widget-toolbar > .widget-menu > [data-action="close"] { + color: #FFD9D5; +} +.widget-color-orange > .widget-header > .widget-toolbar > [data-action], +.widget-color-orange > .widget-header > .widget-toolbar > .widget-menu > [data-action] { + text-shadow: none; +} +.widget-color-orange > .widget-header > .widget-toolbar > [data-action="settings"], +.widget-color-orange > .widget-header > .widget-toolbar > .widget-menu > [data-action="settings"] { + color: #559AAB; +} +.widget-color-orange > .widget-header > .widget-toolbar > [data-action="reload"], +.widget-color-orange > .widget-header > .widget-toolbar > .widget-menu > [data-action="reload"] { + color: #7CA362; +} +.widget-color-orange > .widget-header > .widget-toolbar > [data-action="collapse"], +.widget-color-orange > .widget-header > .widget-toolbar > .widget-menu > [data-action="collapse"] { + color: #777; +} +.widget-color-orange > .widget-header > .widget-toolbar > [data-action="close"], +.widget-color-orange > .widget-header > .widget-toolbar > .widget-menu > [data-action="close"] { + color: #A05656; +} +.widget-box.light-border[class*="widget-color-"]:not(.fullscreen) { + border-width: 0; +} +.widget-box.light-border[class*="widget-color-"]:not(.fullscreen) > .widget-header { + border: 1px solid; + border-color: inherit; +} +.widget-box.light-border[class*="widget-color-"]:not(.fullscreen) > .widget-body { + border: 1px solid; + border-color: #D6D6D6; + border-width: 0 1px 1px; +} +.widget-box.no-border { + border-width: 0; +} +.widget-box.fullscreen { + position: fixed; + margin: 0; + top: 0; + bottom: 0; + left: 0; + right: 0; + background-color: #FFF; + border-width: 3px; + z-index: 1040 !important; +} +.widget-box.fullscreen:not([class*="widget-color-"]) { + border-color: #AAA; +} +.widget-body .table { + border-top: 1px solid #E5E5E5; +} +.widget-body .table thead:first-child tr { + background: #FFF; +} +[class*="widget-color-"] > .widget-body .table thead:first-child tr { + background: #f2f2f2; + background-image: -webkit-linear-gradient(top, #f8f8f8 0%, #ececec 100%); + background-image: -o-linear-gradient(top, #f8f8f8 0%, #ececec 100%); + background-image: linear-gradient(to bottom, #f8f8f8 0%, #ececec 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff8f8f8', endColorstr='#ffececec', GradientType=0); +} +.widget-body .table.table-bordered thead:first-child > tr { + border-top-width: 0; +} +.widget-main.no-padding .table { + margin-bottom: 0; + border-width: 0; +} +.widget-main.no-padding .table-bordered th:first-child, +.widget-main.no-padding .table-bordered td:first-child { + border-left-width: 0; +} +.transparent > .widget-body .widget-main .table-bordered > thead > tr > th:last-child, +.widget-main.no-padding .table-bordered > thead > tr > th:last-child, +.transparent > .widget-body .widget-main .table-bordered > tbody > tr > td:last-child, +.widget-main.no-padding .table-bordered > tbody > tr > td:last-child, +.transparent > .widget-body .widget-main .table-bordered > tfoot > tr > td:last-child, +.widget-main.no-padding .table-bordered > tfoot > tr > td:last-child { + border-right-width: 0 !important; +} +.transparent > .widget-body .widget-main .table-bordered > tbody > tr:last-child > td, +.widget-main.no-padding .table-bordered > tbody > tr:last-child > td { + border-bottom-width: 0 !important; +} +.table-bordered > thead.thin-border-bottom > tr > th, +.table-bordered > thead.thin-border-bottom > tr > td { + border-bottom-width: 1px; +} +.widget-body .alert:last-child { + margin-bottom: 0; +} +.widget-main .tab-content { + border-width: 0; +} +.widget-toolbar > .nav-tabs { + border-bottom-width: 0; + margin-bottom: 0; + top: auto; + margin-top: 3px !important; +} +.widget-toolbar > .nav-tabs > li { + margin-bottom: auto; +} +.widget-toolbar > .nav-tabs > li > a { + box-shadow: none; + position: relative; + top: 1px; + margin-top: 1px; +} +.widget-toolbar > .nav-tabs > li:not(.active) > a { + border-color: transparent; + background-color: transparent; +} +.widget-toolbar > .nav-tabs > li:not(.active) > a:hover { + background-color: transparent; +} +.widget-toolbar > .nav-tabs > li.active > a { + background-color: #FFF; + border-bottom-color: transparent; + box-shadow: none; + margin-top: auto; +} +.widget-header-small > .widget-toolbar > .nav-tabs > li > a { + line-height: 16px; + padding-top: 6px; + padding-bottom: 6px; +} +.widget-header-small > .widget-toolbar > .nav-tabs > li.active > a { + border-top-width: 2px; +} +.widget-header-large > .widget-toolbar > .nav-tabs > li > a { + line-height: 22px; + padding-top: 9px; + padding-bottom: 9px; + margin-top: 4px; +} +.widget-header-large > .widget-toolbar > .nav-tabs > li.active > a { + margin-top: 3px; +} +[class*="widget-color-"] > .widget-header > .widget-toolbar > .nav-tabs > li > a { + border-color: transparent; + background-color: transparent; + color: #FFF; + margin-right: 1px; +} +[class*="widget-color-"] > .widget-header > .widget-toolbar > .nav-tabs > li > a:hover { + background-color: #FFF; + color: #555; + border-top-color: #FFF; +} +[class*="widget-color-"] > .widget-header > .widget-toolbar > .nav-tabs > li.active > a { + background-color: #FFF; + color: #555; + border-top-width: 1px; + margin-top: 0; +} +.widget-toolbar > .nav-tabs .widget-color-orange > .widget-header > li > a { + color: #855D10; +} +.transparent > .widget-header > .widget-toolbar > .nav-tabs > li > a { + color: #555; + background-color: transparent; + border-right: 1px solid transparent; + border-left: 1px solid transparent; +} +.transparent > .widget-header > .widget-toolbar > .nav-tabs > li.active > a { + border-top-color: #4C8FBD; + border-right: 1px solid #C5D0DC; + border-left: 1px solid #C5D0DC; + background-color: #FFF; + box-shadow: none; +} +.widget-toolbox { + background-color: #EEE; +} +.widget-toolbox:first-child { + padding: 2px; + border-bottom: 1px solid #CCC; +} +.widget-toolbox:last-child { + padding: 2px; + border-top: 1px solid #CCC; +} +.transparent > .widget-body > .widget-toolbox:last-child { + border: none; + border-top: 1px solid #CCC; +} +.widget-toolbox > .btn-toolbar { + margin: 0 !important; + padding: 0; +} +.widget-toolbox.center { + text-align: center; +} +.widget-toolbox.toolbox-vertical { + border-bottom-width: 0; + border-right: 1px solid #D9D9D9; + display: table-cell; + padding: 6px 4px; + vertical-align: top; + width: 1px; +} +.widget-toolbox.toolbox-vertical + .widget-main { + display: table-cell; + vertical-align: top; +} +.widget-toolbox.padding-16 { + padding: 16px; +} +.widget-toolbox.padding-14 { + padding: 14px; +} +.widget-toolbox.padding-12 { + padding: 12px; +} +.widget-toolbox.padding-10 { + padding: 10px; +} +.widget-toolbox.padding-8 { + padding: 8px; +} +.widget-toolbox.padding-6 { + padding: 6px; +} +.widget-toolbox.padding-4 { + padding: 4px; +} +.widget-toolbox.padding-2 { + padding: 2px; +} +.widget-toolbox.padding-0 { + padding: 0px; +} +.widget-box-overlay { + position: absolute; + top: -1px; + bottom: -1px; + right: -1px; + left: -1px; + z-index: 999; + text-align: center; + min-height: 100%; + background-color: rgba(0, 0, 0, 0.3); +} +.widget-box-overlay > .loading-icon { + position: relative; + top: 20%; + left: 0; + right: 0; + text-align: center; +} +.widget-box.collapsed .widget-box-overlay > .loading-icon { + top: 10%; +} +.widget-box-overlay > .loading-icon.icon-spin { + -moz-animation-duration: 1.2s; + -webkit-animation-duration: 1.2s; + -o-animation-duration: 1.2s; + -ms-animation-duration: 1.2s; + animation-duration: 1.2s; +} +.widget-main > form { + margin-bottom: 0; +} +.widget-main > form .input-append, +.widget-main > form .input-prepend { + margin-bottom: 0; +} +.widget-main.no-padding > form > fieldset, +.widget-main.padding-0 > form > fieldset { + padding: 16px; +} +.widget-main.no-padding > form > fieldset + .form-actions, +.widget-main.padding-0 > form > fieldset + .form-actions { + padding: 10px 0 12px; +} +.widget-main.no-padding > form > .form-actions, +.widget-main.padding-0 > form > .form-actions { + margin: 0; + padding: 10px 12px 12px; +} +.widget-placeholder { + border: 2px dashed #D9D9D9; +} +.tooltip.in { + opacity: 1; + filter: alpha(opacity=100); +} +.tooltip-inner { + background-color: #333333; + color: #FFF; + font-size: 12px; + text-shadow: 1px 1px 0 rgba(42, 45, 50, 0.5); + border-radius: 0; + padding: 5px 9px; +} +.tooltip.top .tooltip-arrow { + border-bottom-width: 0; + border-top-color: #333333; + -moz-border-top-colors: #333333; +} +.tooltip.right .tooltip-arrow { + border-left-width: 0; + border-right-color: #333333; + -moz-border-right-colors: #333333; +} +.tooltip.left .tooltip-arrow { + border-right-width: 0; + border-left-color: #333333; + -moz-border-left-colors: #333333; +} +.tooltip.bottom .tooltip-arrow { + border-top-width: 0; + border-bottom-color: #333333; + -moz-border-bottom-colors: #333333; +} +.tooltip-error + .tooltip > .tooltip-inner, +.tooltip.tooltip-error > .tooltip-inner { + background-color: #c94d32; + text-shadow: 1px 1px 0 rgba(100,60,20,0.3); +} +.tooltip-error + .tooltip.top .tooltip-arrow, +.tooltip.tooltip-error.top .tooltip-arrow { + border-top-color: #c94d32; + -moz-border-top-colors: #c94d32; +} +.tooltip-error + .tooltip.right .tooltip-arrow, +.tooltip.tooltip-error.right .tooltip-arrow { + border-right-color: #c94d32; + -moz-border-right-colors: #c94d32; +} +.tooltip-error + .tooltip.left .tooltip-arrow, +.tooltip.tooltip-error.left .tooltip-arrow { + border-left-color: #c94d32; + -moz-border-left-colors: #c94d32; +} +.tooltip-error + .tooltip.bottom .tooltip-arrow, +.tooltip.tooltip-error.bottom .tooltip-arrow { + border-bottom-color: #c94d32; + -moz-border-bottom-colors: #c94d32; +} +.tooltip-success + .tooltip > .tooltip-inner, +.tooltip.tooltip-success > .tooltip-inner { + background-color: #629b58; + text-shadow: 1px 1px 0 rgba(60,100,20,0.3); +} +.tooltip-success + .tooltip.top .tooltip-arrow, +.tooltip.tooltip-success.top .tooltip-arrow { + border-top-color: #629b58; + -moz-border-top-colors: #629b58; +} +.tooltip-success + .tooltip.right .tooltip-arrow, +.tooltip.tooltip-success.right .tooltip-arrow { + border-right-color: #629b58; + -moz-border-right-colors: #629b58; +} +.tooltip-success + .tooltip.left .tooltip-arrow, +.tooltip.tooltip-success.left .tooltip-arrow { + border-left-color: #629b58; + -moz-border-left-colors: #629b58; +} +.tooltip-success + .tooltip.bottom .tooltip-arrow, +.tooltip.tooltip-success.bottom .tooltip-arrow { + border-bottom-color: #629b58; + -moz-border-bottom-colors: #629b58; +} +.tooltip-warning + .tooltip > .tooltip-inner, +.tooltip.tooltip-warning > .tooltip-inner { + background-color: #ed9421; + text-shadow: 1px 1px 0 rgba(100,90,10,0.3); +} +.tooltip-warning + .tooltip.top .tooltip-arrow, +.tooltip.tooltip-warning.top .tooltip-arrow { + border-top-color: #ed9421; + -moz-border-top-colors: #ed9421; +} +.tooltip-warning + .tooltip.right .tooltip-arrow, +.tooltip.tooltip-warning.right .tooltip-arrow { + border-right-color: #ed9421; + -moz-border-right-colors: #ed9421; +} +.tooltip-warning + .tooltip.left .tooltip-arrow, +.tooltip.tooltip-warning.left .tooltip-arrow { + border-left-color: #ed9421; + -moz-border-left-colors: #ed9421; +} +.tooltip-warning + .tooltip.bottom .tooltip-arrow, +.tooltip.tooltip-warning.bottom .tooltip-arrow { + border-bottom-color: #ed9421; + -moz-border-bottom-colors: #ed9421; +} +.tooltip-info + .tooltip > .tooltip-inner, +.tooltip.tooltip-info > .tooltip-inner { + background-color: #4b89aa; + text-shadow: 1px 1px 0 rgba(40,50,100,0.3); +} +.tooltip-info + .tooltip.top .tooltip-arrow, +.tooltip.tooltip-info.top .tooltip-arrow { + border-top-color: #4b89aa; + -moz-border-top-colors: #4b89aa; +} +.tooltip-info + .tooltip.right .tooltip-arrow, +.tooltip.tooltip-info.right .tooltip-arrow { + border-right-color: #4b89aa; + -moz-border-right-colors: #4b89aa; +} +.tooltip-info + .tooltip.left .tooltip-arrow, +.tooltip.tooltip-info.left .tooltip-arrow { + border-left-color: #4b89aa; + -moz-border-left-colors: #4b89aa; +} +.tooltip-info + .tooltip.bottom .tooltip-arrow, +.tooltip.tooltip-info.bottom .tooltip-arrow { + border-bottom-color: #4b89aa; + -moz-border-bottom-colors: #4b89aa; +} +/* popover */ +.popover { + border-radius: 0; + padding: 0; + border-color: #ccc; + border-width: 1px; + -webkit-box-shadow: 0 0 4px 2px rgba(0,0,0,0.2); + box-shadow: 0 0 4px 2px rgba(0,0,0,0.2); + color: #4D6883; +} +.popover-title { + border-radius: 0; + background-color: #eff3f8; + color: #555; + border-bottom: 1px solid #dde6f0; + text-shadow: 1px 1px 1px rgba(220, 220, 220, 0.2); +} +.popover.bottom > .arrow:after { + top: 1px; + margin-left: -10px; + border-bottom-color: #eff3f8; + -moz-border-bottom-colors: #eff3f8; + border-top-width: 0; +} +.popover.left > .arrow:after { + -moz-border-left-colors: #FFF; +} +.popover.right > .arrow:after { + -moz-border-right-colors: #FFF; +} +.popover.top > .arrow:after { + -moz-border-top-colors: #FFF; +} +.popover-error + .popover, +.popover.popover-error { + border-color: #f7f0ef; +} +.popover-error + .popover .popover-title, +.popover.popover-error .popover-title { + background-color: #f7f0ef; + border-bottom-color: #efe0de; + color: #b75445; + text-shadow: none; +} +.popover-error + .popover.top .arrow:after, +.popover.popover-error.top .arrow:after { + border-top-color: #f7f0ef; + -moz-border-top-colors: #f7f0ef; +} +.popover-error + .popover.bottom .arrow:after, +.popover.popover-error.bottom .arrow:after { + border-bottom-color: #f7f0ef; + -moz-border-bottom-colors: #f7f0ef; +} +.popover-error + .popover.right .arrow:after, +.popover.popover-error.right .arrow:after { + border-right-color: #f7f0ef; + -moz-border-right-colors: #f7f0ef; +} +.popover-error + .popover.left .arrow:after, +.popover.popover-error.left .arrow:after { + border-left-color: #f7f0ef; + -moz-border-left-colors: #f7f0ef; +} +.popover-warning + .popover, +.popover.popover-warning { + border-color: #f4eee3; +} +.popover-warning + .popover .popover-title, +.popover.popover-warning .popover-title { + background-color: #f4eee3; + border-bottom-color: #ede3d1; + color: #d67e31; + text-shadow: none; +} +.popover-warning + .popover.top .arrow:after, +.popover.popover-warning.top .arrow:after { + border-top-color: #f4eee3; + -moz-border-top-colors: #f4eee3; +} +.popover-warning + .popover.bottom .arrow:after, +.popover.popover-warning.bottom .arrow:after { + border-bottom-color: #f4eee3; + -moz-border-bottom-colors: #f4eee3; +} +.popover-warning + .popover.right .arrow:after, +.popover.popover-warning.right .arrow:after { + border-right-color: #f4eee3; + -moz-border-right-colors: #f4eee3; +} +.popover-warning + .popover.left .arrow:after, +.popover.popover-warning.left .arrow:after { + border-left-color: #f4eee3; + -moz-border-left-colors: #f4eee3; +} +.popover-success + .popover, +.popover.popover-success { + border-color: #e8f2e3; +} +.popover-success + .popover .popover-title, +.popover.popover-success .popover-title { + background-color: #e8f2e3; + border-bottom-color: #daead2; + color: #629b58; + text-shadow: none; +} +.popover-success + .popover.top .arrow:after, +.popover.popover-success.top .arrow:after { + border-top-color: #e8f2e3; + -moz-border-top-colors: #e8f2e3; +} +.popover-success + .popover.bottom .arrow:after, +.popover.popover-success.bottom .arrow:after { + border-bottom-color: #e8f2e3; + -moz-border-bottom-colors: #e8f2e3; +} +.popover-success + .popover.right .arrow:after, +.popover.popover-success.right .arrow:after { + border-right-color: #e8f2e3; + -moz-border-right-colors: #e8f2e3; +} +.popover-success + .popover.left .arrow:after, +.popover.popover-success.left .arrow:after { + border-left-color: #e8f2e3; + -moz-border-left-colors: #e8f2e3; +} +.popover-info + .popover, +.popover.popover-info { + border-color: #e5edf8; +} +.popover-info + .popover .popover-title, +.popover.popover-info .popover-title { + background-color: #e5edf8; + border-bottom-color: #d1dff3; + color: #3f79b6; + text-shadow: none; +} +.popover-info + .popover.top .arrow:after, +.popover.popover-info.top .arrow:after { + border-top-color: #e5edf8; + -moz-border-top-colors: #e5edf8; +} +.popover-info + .popover.bottom .arrow:after, +.popover.popover-info.bottom .arrow:after { + border-bottom-color: #e5edf8; + -moz-border-bottom-colors: #e5edf8; +} +.popover-info + .popover.right .arrow:after, +.popover.popover-info.right .arrow:after { + border-right-color: #e5edf8; + -moz-border-right-colors: #e5edf8; +} +.popover-info + .popover.left .arrow:after, +.popover.popover-info.left .arrow:after { + border-left-color: #e5edf8; + -moz-border-left-colors: #e5edf8; +} +.popover-notitle + .popover .popover-title, +.popover.popover-notitle .popover-title { + display: none; +} +.popover-notitle + .popover.top .arrow:after, +.popover.popover-notitle.top .arrow:after { + border-top-color: #FFF; + -moz-border-top-colors: #FFF; +} +.popover-notitle + .popover.bottom .arrow:after, +.popover.popover-notitle.bottom .arrow:after { + border-bottom-color: #FFF; + -moz-border-bottom-colors: #FFF; +} +.popover-notitle + .popover.left .arrow:after, +.popover.popover-notitle.left .arrow:after { + border-left-color: #FFF; + -moz-border-left-colors: #FFF; +} +.popover-notitle + .popover.right .arrow:after, +.popover.popover-notitle.right .arrow:after { + border-right-color: #FFF; + -moz-border-right-colors: #FFF; +} +.progress { + border-radius: 0; + -webkit-box-shadow: none; + box-shadow: none; + background: #e9e9e9; + height: 18px; +} +.progress .progress-bar { + -webkit-box-shadow: none; + box-shadow: none; + line-height: 18px; +} +.progress[data-percent]:after { + display: inline-block; + content: attr(data-percent); + color: #FFF; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + line-height: 16px; + text-align: center; + font-size: 12px; +} +.progress.progress-yellow[data-percent]:after { + color: #996633; +} +.progress.progress-small { + height: 12px; +} +.progress.progress-small .progress-bar { + line-height: 10px; + font-size: 11px; +} +.progress.progress-small[data-percent]:after { + line-height: 10px; + font-size: 11px; +} +.progress.progress-mini { + height: 9px; +} +.progress.progress-mini .progress-bar { + line-height: 8px; + font-size: 11px; +} +.progress.progress-mini[data-percent]:after { + line-height: 8px; + font-size: 11px; +} +.progress-bar { + background-color: #2a91d8; +} +.progress-striped .progress-bar { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-bar-danger { + background-color: #ca5952; +} +.progress-striped .progress-bar-danger { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-bar-success { + background-color: #59a84b; +} +.progress-striped .progress-bar-success { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-bar-warning { + background-color: #f2bb46; +} +.progress-striped .progress-bar-warning { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-bar-pink { + background-color: #d6487e; +} +.progress-striped .progress-bar-pink { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-bar-purple { + background-color: #9585bf; +} +.progress-striped .progress-bar-purple { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-bar-yellow { + background-color: #ffd259; +} +.progress-striped .progress-bar-yellow { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-bar-inverse { + background-color: #404040; +} +.progress-striped .progress-bar-inverse { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-bar-grey { + background-color: #8a8a8a; +} +.progress-striped .progress-bar-grey { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +/** +.progress { + position: relative; +} +.progress:before { + display: inline-block; + content: ""; + + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + + background: radial-gradient(9px 9px 0deg, circle cover, aqua 0%, rgba(0, 0, 255, 0) 100%, blue 95%); +} +*/ +.infobox-container { + text-align: center; + font-size: 0; +} +.infobox { + display: inline-block; + width: 210px; + height: 66px; + color: #555; + background-color: #FFF; + box-shadow: none; + border-radius: 0; + margin: -1px 0 0 -1px; + padding: 8px 3px 6px 9px; + border: 1px dotted; + border-color: #D8D8D8 !important; + vertical-align: middle; + text-align: left; + position: relative; +} +.infobox > .infobox-icon { + display: inline-block; + vertical-align: top; + width: 44px; +} +.infobox > .infobox-icon > .ace-icon { + display: inline-block; + height: 42px; + margin: 0; + padding: 1px 1px 0 2px; + background-color: transparent; + border-width: 0; + text-align: center; + position: relative; + border-radius: 100%; + -webkit-box-shadow: 1px 1px 0 rgba(0,0,0,0.2); + box-shadow: 1px 1px 0 rgba(0,0,0,0.2); +} +.infobox > .infobox-icon > .ace-icon:before { + font-size: 24px; + display: block; + padding: 6px 0 7px; + width: 40px; + text-align: center; + border-radius: 100%; + color: #FFF; + color: rgba(255, 255, 255, 0.9); + background-color: transparent; + background-color: rgba(255, 255, 255, 0.2); + text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.14); +} +.infobox .infobox-content { + color: #555; + max-width: 140px; +} +.infobox .infobox-content:first-child { + font-weight: bold; +} +.infobox > .infobox-data { + display: inline-block; + border-width: 0; + border-top-width: 0; + font-size: 13px; + text-align: left; + line-height: 21px; + min-width: 130px; + padding-left: 8px; + position: relative; + top: 0; +} +.infobox > .infobox-data > .infobox-data-number { + display: block; + font-size: 22px; + margin: 2px 0 4px; + position: relative; + text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.15); +} +.infobox > .infobox-data > .infobox-text { + display: block; + font-size: 16px; + margin: 2px 0 4px; + position: relative; + text-shadow: none; +} +.infobox.no-border { + border-width: 0 !important; +} +@media only screen and (max-width: 479px) { + .infobox { + min-width: 95%; + margin-top: 2px; + margin-bottom: 2px; + } +} +.infobox-purple { + color: #6f3cc4; + border-color: #6f3cc4; +} +.infobox-purple > .infobox-icon > .ace-icon { + background-color: #6f3cc4; +} +.infobox-purple.infobox-dark { + background-color: #6f3cc4; + border-color: #6f3cc4; +} +.infobox-purple2 { + color: #5f47b0; + border-color: #5f47b0; +} +.infobox-purple2 > .infobox-icon > .ace-icon { + background-color: #5f47b0; +} +.infobox-purple2.infobox-dark { + background-color: #5f47b0; + border-color: #5f47b0; +} +.infobox-pink { + color: #cb6fd7; + border-color: #cb6fd7; +} +.infobox-pink > .infobox-icon > .ace-icon { + background-color: #cb6fd7; +} +.infobox-pink.infobox-dark { + background-color: #cb6fd7; + border-color: #cb6fd7; +} +.infobox-blue { + color: #6fb3e0; + border-color: #6fb3e0; +} +.infobox-blue > .infobox-icon > .ace-icon { + background-color: #6fb3e0; +} +.infobox-blue.infobox-dark { + background-color: #6fb3e0; + border-color: #6fb3e0; +} +.infobox-blue2 { + color: #3983c2; + border-color: #3983c2; +} +.infobox-blue2 > .infobox-icon > .ace-icon { + background-color: #3983c2; +} +.infobox-blue2.infobox-dark { + background-color: #3983c2; + border-color: #3983c2; +} +.infobox-blue3 { + color: #1144eb; + border-color: #1144eb; +} +.infobox-blue3 > .infobox-icon > .ace-icon { + background-color: #1144eb; +} +.infobox-blue3.infobox-dark { + background-color: #1144eb; + border-color: #1144eb; +} +.infobox-red { + color: #d53f40; + border-color: #d53f40; +} +.infobox-red > .infobox-icon > .ace-icon { + background-color: #d53f40; +} +.infobox-red.infobox-dark { + background-color: #d53f40; + border-color: #d53f40; +} +.infobox-brown { + color: #c67a3e; + border-color: #c67a3e; +} +.infobox-brown > .infobox-icon > .ace-icon { + background-color: #c67a3e; +} +.infobox-brown.infobox-dark { + background-color: #c67a3e; + border-color: #c67a3e; +} +.infobox-wood { + color: #7b3f25; + border-color: #7b3f25; +} +.infobox-wood > .infobox-icon > .ace-icon { + background-color: #7b3f25; +} +.infobox-wood.infobox-dark { + background-color: #7b3f25; + border-color: #7b3f25; +} +.infobox-light-brown { + color: #cebea5; + border-color: #cebea5; +} +.infobox-light-brown > .infobox-icon > .ace-icon { + background-color: #cebea5; +} +.infobox-light-brown.infobox-dark { + background-color: #cebea5; + border-color: #cebea5; +} +.infobox-orange { + color: #e8b110; + border-color: #e8b110; +} +.infobox-orange > .infobox-icon > .ace-icon { + background-color: #e8b110; +} +.infobox-orange.infobox-dark { + background-color: #e8b110; + border-color: #e8b110; +} +.infobox-orange2 { + color: #f79263; + border-color: #f79263; +} +.infobox-orange2 > .infobox-icon > .ace-icon { + background-color: #f79263; +} +.infobox-orange2.infobox-dark { + background-color: #f79263; + border-color: #f79263; +} +.infobox-green { + color: #9abc32; + border-color: #9abc32; +} +.infobox-green > .infobox-icon > .ace-icon { + background-color: #9abc32; +} +.infobox-green.infobox-dark { + background-color: #9abc32; + border-color: #9abc32; +} +.infobox-green2 { + color: #0490a6; + border-color: #0490a6; +} +.infobox-green2 > .infobox-icon > .ace-icon { + background-color: #0490a6; +} +.infobox-green2.infobox-dark { + background-color: #0490a6; + border-color: #0490a6; +} +.infobox-grey { + color: #999999; + border-color: #999999; +} +.infobox-grey > .infobox-icon > .ace-icon { + background-color: #999999; +} +.infobox-grey.infobox-dark { + background-color: #999999; + border-color: #999999; +} +.infobox-black { + color: #393939; + border-color: #393939; +} +.infobox-black > .infobox-icon > .ace-icon { + background-color: #393939; +} +.infobox-black.infobox-dark { + background-color: #393939; + border-color: #393939; +} +.infobox-dark { + margin: 1px 1px 0 0; + border-color: transparent !important; + border-width: 0; + color: #FFF; + padding: 4px; +} +.infobox-dark > .infobox-icon > .ace-icon, +.infobox-dark > .infobox-icon > .ace-icon:before { + background-color: transparent; + box-shadow: none !important; + text-shadow: none; + border-radius: 0; + font-size: 30px; +} +.infobox-dark > .infobox-icon > .ace-icon:before { + opacity: 1; + filter: alpha(opacity=100); +} +.infobox-dark .infobox-content { + color: #FFF; +} +.infobox > .infobox-progress { + padding-top: 0; + display: inline-block; + vertical-align: top; + width: 44px; +} +.infobox > .infobox-chart { + padding-top: 0; + display: inline-block; + vertical-align: text-bottom; + width: 44px; + text-align: center; +} +.infobox > .infobox-chart > .sparkline { + font-size: 24px; +} +.infobox > .infobox-chart canvas { + vertical-align: middle !important; +} +.infobox > .stat { + display: inline-block; + position: absolute; + right: 20px; + top: 11px; + text-shadow: none; + color: #ABBAC3; + font-size: 13px; + font-weight: bold; + padding-right: 18px; + padding-top: 3px; +} +.infobox > .stat:before { + display: inline-block; + content: ""; + width: 8px; + height: 11px; + background-color: #ABBAC3; + position: absolute; + right: 4px; + top: 7px; +} +.infobox > .stat:after { + display: inline-block; + content: ""; + position: absolute; + right: 1px; + top: -8px; + border: 12px solid transparent; + border-width: 8px 7px; + border-bottom-color: #ABBAC3; +} +.infobox > .stat.stat-success { + color: #77C646; +} +.infobox > .stat.stat-success:before { + background-color: #77C646; +} +.infobox > .stat.stat-success:after { + border-bottom-color: #77C646; +} +.infobox > .stat.stat-important { + /*pointing down*/ + color: #E4564F; +} +.infobox > .stat.stat-important:before { + background-color: #E4564F; + top: 3px; +} +.infobox > .stat.stat-important:after { + border-top-color: #E4564F; + border-bottom-color: transparent; + bottom: -6px; + top: auto; +} +.infobox.infobox-dark > .stat { + color: #FFF; +} +.infobox.infobox-dark > .stat:before { + background-color: #E1E5E8; +} +.infobox.infobox-dark > .stat:after { + border-bottom-color: #E1E5E8; +} +.infobox.infobox-dark > .stat.stat-success { + color: #FFF; +} +.infobox.infobox-dark > .stat.stat-success:before { + background-color: #D0E29E; +} +.infobox.infobox-dark > .stat.stat-success:after { + border-bottom-color: #D0E29E; +} +.infobox.infobox-dark > .stat.stat-important { + color: #FFF; +} +.infobox.infobox-dark > .stat.stat-important:before { + background-color: #FF8482; + top: 3px; +} +.infobox.infobox-dark > .stat.stat-important:after { + border-top-color: #FF8482; + border-bottom-color: transparent; + bottom: -6px; + top: auto; +} +.infobox > .badge { + position: absolute; + right: 20px; + top: 11px; + border-radius: 0; + text-shadow: none; + color: #FFF; + font-size: 11px; + font-weight: bold; + line-height: 15px; + height: 16px; + padding: 0 1px; +} +.infobox.infobox-dark > .badge { + color: #FFF; + background-color: rgba(255, 255, 255, 0.2) !important; + border: 1px solid #F1F1F1; + top: 2px; + right: 2px; +} +.infobox.infobox-dark > .badge.badge-success > .ace-icon { + color: #C6E9A1; +} +.infobox.infobox-dark > .badge.badge-important > .ace-icon { + color: #ECB792; +} +.infobox.infobox-dark > .badge.badge-warning > .ace-icon { + color: #ECB792; +} +.infobox-small { + width: 135px; + height: 52px; + text-align: left; + padding-bottom: 5px; +} +.infobox-small > .infobox-icon, +.infobox-small > .infobox-chart, +.infobox-small > .infobox-progress { + display: inline-block; + width: 40px; + max-width: 40px; + height: 42px; + line-height: 38px; + vertical-align: middle; +} +.infobox-small > .infobox-data { + display: inline-block; + text-align: left; + vertical-align: middle; + max-width: 72px; + min-width: 0; +} +.infobox-small > .infobox-chart > .sparkline { + font-size: 14px; + margin-left: 2px; +} +.percentage { + font-size: 14px; + font-weight: bold; + display: inline-block; + vertical-align: top; +} +.infobox-small .percentage { + font-size: 13px; + font-weight: normal; + margin-top: 2px; + margin-left: 2px; +} +.pricing-box:not(:first-child) { + padding-left: 7px; +} +.pricing-box:not(:last-child) { + padding-right: 7px; +} +.pricing-box .price { + font-size: 22px; + line-height: 20px; + height: 28px; + text-align: center; + color: #555; +} +.pricing-box .price small { + font-size: 22px; +} +.pricing-box .btn { + font-size: 16px; +} +.pricing-box .widget-header { + /* the title */ + text-align: center; + padding-left: 0; +} +@media only screen and (max-width: 480px) { + .pricing-box { + margin: 0; + margin-bottom: 16px; + padding-left: 0 !important; + padding-right: 0 !important; + margin-left: -1px; + } + .pricing-box:nth-child(odd) { + padding-left: 12px !important; + } + .pricing-box:nth-child(even) { + padding-right: 12px !important; + } +} +@media only screen and (max-width: 479px) { + .pricing-box { + margin: 0; + margin-bottom: 16px; + width: 100%; + padding-left: 12px !important; + padding-right: 12px !important; + } +} +.pricing-table-header { + padding-top: 0; + margin-top: 0; + text-align: left; +} +.pricing-table-header > li { + padding: 7px 0 7px 11px; + font-size: 13px; +} +.pricing-table { + margin-top: 0; +} +.pricing-table > li { + text-align: center; + padding: 7px 0; + font-size: 13px; +} +.list-striped > li:nth-child(odd) { + background-color: #FFF; +} +.list-striped > li:nth-child(even) { + background-color: #F2F3EB; +} +.list-striped.pricing-table-header > li:nth-child(even) { + background-color: #EEE; +} +.pricing-box-small { + box-shadow: none; + margin-left: -2px; + background-color: #FFF; + position: relative; + z-index: 10; +} +.pricing-box-small .price { + line-height: 20px; + height: 28px; + text-align: center; +} +.pricing-box-small .price .label:before, +.pricing-box-small .price .label:after { + margin-top: -2px; + opacity: 0.9; + filter: alpha(opacity=90); +} +.pricing-box-small:hover { + box-shadow: 0 0 4px 2px rgba(0, 0, 0, 0.15); + z-index: 11; + -webkit-transform: scale(1.04); + -ms-transform: scale(1.04); + -o-transform: scale(1.04); + transform: scale(1.04); +} +.pricing-box-small:hover .price > .label { + -webkit-transform: scale(0.96); + -ms-transform: scale(0.96); + -o-transform: scale(0.96); + transform: scale(0.96); +} +.pricing-span { + margin: 0; + width: 19%; + max-width: 150px !important; + min-width: 110px !important; + float: left !important; +} +.pricing-span-header { + padding-right: 0; +} +@media only screen and (min-width: 480px) { + .pricing-span-body { + padding-left: 0; + padding-right: 0; + } +} +@media only screen and (max-width: 480px) { + .pricing-span-header, + .pricing-span-body { + width: 100%; + padding-right: 12px; + } +} +.login-container { + width: 375px; + margin: 0 auto; +} +.login-layout { + background-color: #1D2024; +} +.login-layout .main-container:before { + display: none; +} +.login-layout .main-content { + margin-left: 0 !important; + margin-right: 0 !important; + min-height: 100%; + padding-left: 15px; + padding-right: 15px; +} +.login-layout label { + margin-bottom: 11px; +} +.login-layout .widget-box { + visibility: hidden; + position: fixed; + z-index: -5; + border-bottom: none; + box-shadow: none; + padding: 6px; + background-color: #394557; + -moz-transform: scale(0,1) translate(-150px); + -webkit-transform: scale(0,1) translate(-150px); + -o-transform: scale(0,1) translate(-150px); + -ms-transform: scale(0,1) translate(-150px); + transform: scale(0,1) translate(-150px); +} +.login-layout .widget-box.visible { + visibility: visible; + position: relative; + z-index: auto; + -moz-transform: scale(1,1) translate(0); + -webkit-transform: scale(1,1) translate(0); + -o-transform: scale(1,1) translate(0); + -ms-transform: scale(1,1) translate(0); + transform: scale(1,1) translate(0); + transition: transform .3s ease; + -moz-transition: -moz-transform 0.3s ease; + -webkit-transition: -webkit-transform 0.3s ease; + -o-transition: -o-transform 0.2s ease; +} +.login-layout .widget-box .widget-main { + padding: 16px 36px 36px; + background: #F7F7F7; +} +.login-layout .widget-box .widget-main form { + margin: 0; +} +.login-layout .widget-box .widget-body .toolbar > div > a { + font-size: 15px; + font-weight: 400; + text-shadow: 1px 0px 1px rgba(0, 0, 0, 0.25); +} +.login-box .forgot-password-link { + color: #FE9; +} +.login-box .user-signup-link { + color: #CF7; +} +.login-box .toolbar { + background: #5090C1; + border-top: 2px solid #597597; +} +.login-box .toolbar > div { + width: 50%; + display: inline-block; + padding: 9px 0 11px; +} +.login-box .toolbar > div:first-child { + float: left; + text-align: left; +} +.login-box .toolbar > div:first-child > a { + margin-left: 11px; +} +.login-box .toolbar > div:first-child + div { + float: right; + text-align: right; +} +.login-box .toolbar > div:first-child + div > a { + margin-right: 11px; +} +.forgot-box .toolbar { + background: #C16050; + border-top: 2px solid #976559; + padding: 9px 18px; +} +.signup-box .toolbar { + background: #76B774; + border-top: 2px solid #759759; + padding: 9px 18px; +} +.forgot-box .back-to-login-link, +.signup-box .back-to-login-link { + color: #FE9; + font-size: 14px; + font-weight: bold; + text-shadow: 1px 0px 1px rgba(0, 0, 0, 0.25); +} +/* social login */ +.login-layout .login-box .widget-main { + padding-bottom: 16px; +} +.social-or-login { + margin-top: 4px; + text-align: center; + position: relative; + z-index: 1; +} +.social-or-login :first-child { + display: inline-block; + background: #F7F7F7; + padding: 0 8px; + color: #5090C1; + font-size: 13px; +} +.social-or-login:before { + content: ""; + display: block; + position: absolute; + z-index: -1; + top: 50%; + left: 0; + right: 0; + border-top: 1px dotted #A6C4DB; +} +.social-login a { + border-radius: 100%; + width: 42px; + height: 42px; + line-height: 46px; + padding: 0; + margin: 0 1px; + border-width: 0; +} +.social-login a > .ace-icon { + font-size: 24px; + margin: 0; +} +@media only screen and (max-width: 540px) { + .login-layout .widget-box .widget-main { + padding: 16px; + } + .login-container { + width: 98%; + } + .login-layout .widget-box { + padding: 0; + } + .login-layout .main-content { + padding-left: 6px; + padding-right: 6px; + } + .login-box .toolbar > div { + width: auto; + } +} +.light-login { + background: #dfe0e2 url('images/pattern.jpg') repeat; +} +.light-login .widget-box { + padding: 1px 1px 0; + -webkit-box-shadow: 0 0 2px 1px rgba(0, 0, 0, 0.12); + box-shadow: 0 0 2px 1px rgba(0, 0, 0, 0.12); + border-bottom: 1px solid rgba(50, 50, 50, 0.33); +} +.light-login .widget-box .toolbar { + border-top-width: 1px; +} +.light-login .widget-box.login-box { + background-color: #BCC6CF; + background-color: rgba(100, 110, 120, 0.4); +} +.light-login .widget-box.signup-box { + background-color: #C1CEC4; + background-color: rgba(110, 120, 100, 0.4); +} +.light-login .widget-box.forgot-box { + background-color: #D2C5C5; + background-color: rgba(120, 110, 100, 0.4); +} +.blur-login { + background: #394557 url('images/meteorshower2.jpg') repeat; +} +.invoice-info { + line-height: 24px !important; + color: #444; + vertical-align: bottom; + margin-left: 9px; + margin-right: 9px; +} +.invoice-info-label { + display: inline-block; + max-width: 100px; + text-align: right; + font-size: 14px; +} +.invoice-box .label-large[class*="arrowed"] { + margin-left: 11px !important; + max-width: 95%; +} +.error-container { + margin: 20px; + padding: 0; + background: #FFF; +} +@media only screen and (max-width: 767px) { + .error-container { + margin: 12px; + } +} +@media only screen and (max-width: 479px) { + .error-container { + margin: 6px; + } +} +.ace-thumbnails { + list-style: none; + margin: 0; + padding: 0; +} +.ace-thumbnails > li { + float: left; + display: block; + position: relative; + overflow: hidden; + margin: 2px; + border: 2px solid #333; +} +.ace-thumbnails > li > :first-child { + display: block; + position: relative; +} +.ace-thumbnails > li > :first-child:focus { + outline: none; +} +.ace-thumbnails > li .tags { + display: inline-block; + position: absolute; + bottom: 0; + right: 0; + overflow: visible; + direction: rtl; + padding: 0; + margin: 0; + height: auto; + width: auto; + background-color: transparent; + border-width: 0; + vertical-align: inherit; +} +.ace-thumbnails > li .tags > .label-holder { + opacity: 0.92; + filter: alpha(opacity=92); + display: table; + margin: 1px 0 0 0; + direction: ltr; + text-align: left; +} +.ace-thumbnails > li .tags > .label-holder:hover { + opacity: 1; + filter: alpha(opacity=100); +} +.ace-thumbnails > li > .tools { + position: absolute; + top: 0; + bottom: 0; + left: -30px; + width: 24px; + background-color: rgba(0, 0, 0, 0.55); + text-align: center; + vertical-align: middle; + -webkit-transition: all 0.2s ease; + -o-transition: all 0.2s ease; + transition: all 0.2s ease; +} +.ace-thumbnails > li > .tools.tools-right { + left: auto; + right: -30px; +} +.ace-thumbnails > li > .tools.tools-bottom { + width: auto; + height: 28px; + left: 0; + right: 0; + top: auto; + bottom: -30px; +} +.ace-thumbnails > li > .tools.tools-top { + width: auto; + height: 28px; + left: 0; + right: 0; + top: -30px; + bottom: auto; +} +.ace-thumbnails > li:hover > .tools { + left: 0; + right: 0; +} +.ace-thumbnails > li:hover > .tools.tools-bottom { + top: auto; + bottom: 0; +} +.ace-thumbnails > li:hover > .tools.tools-top { + bottom: auto; + top: 0; +} +.ace-thumbnails > li:hover > .tools.tools-right { + left: auto; + right: 0; +} +.ace-thumbnails > li > .in.tools { + left: 0; + right: 0; +} +.ace-thumbnails > li > .in.tools.tools-bottom { + top: auto; + bottom: 0; +} +.ace-thumbnails > li > .in.tools.tools-top { + bottom: auto; + top: 0; +} +.ace-thumbnails > li > .in.tools.tools-right { + left: auto; + right: 0; +} +.ace-thumbnails > li > .tools > a, +.ace-thumbnails > li > :first-child .inner a { + display: inline-block; + color: #FFF; + font-size: 18px; + font-weight: normal; + padding: 0 4px; +} +.ace-thumbnails > li > .tools > a:hover, +.ace-thumbnails > li > :first-child .inner a:hover { + text-decoration: none; + color: #C9E2EA; +} +.ace-thumbnails > li .tools.tools-bottom > a, +.ace-thumbnails > li .tools.tools-top > a { + display: inline-block; +} +.ace-thumbnails > li > :first-child > .text { + position: absolute; + right: 0; + left: 0; + bottom: 0; + top: 0; + text-align: center; + color: #FFF; + background-color: rgba(0, 0, 0, 0.55); + opacity: 0; + filter: alpha(opacity=0); + -webkit-transition: all 0.2s ease; + -o-transition: all 0.2s ease; + transition: all 0.2s ease; +} +.ace-thumbnails > li > :first-child > .text:before { + /* makes the inner text become vertically centered*/ + content: ''; + display: inline-block; + height: 100%; + vertical-align: middle; + margin-right: 0; + /* Adjusts for spacing */ +} +.ace-thumbnails > li > :first-child > .text > .inner { + padding: 4px 0; + margin: 0; + display: inline-block; + vertical-align: middle; + max-width: 90%; +} +.ace-thumbnails > li:hover > :first-child > .text { + opacity: 1; + filter: alpha(opacity=100); +} +@media only screen and (max-width: 480px) { + .ace-thumbnails { + text-align: center; + } + .ace-thumbnails > li { + float: none; + display: inline-block; + } +} +.dialogs { + padding: 9px; + position: relative; +} +.itemdiv { + padding-right: 3px; + min-height: 66px; + position: relative; +} +.itemdiv > .user { + display: inline-block; + width: 42px; + position: absolute; + left: 0; +} +.itemdiv > .user > img, +.itemdiv > .user > .img { + border-radius: 100%; + border: 2px solid #5293C4; + max-width: 40px; + position: relative; +} +.itemdiv > .user > .img { + padding: 2px; +} +.itemdiv > .body { + width: auto; + margin-left: 50px; + margin-right: 12px; + position: relative; +} +.itemdiv > .body > .time { + display: block; + font-size: 11px; + font-weight: bold; + color: #666; + position: absolute; + right: 9px; + top: 0; +} +.itemdiv > .body > .time .ace-icon { + font-size: 14px; + font-weight: normal; +} +.itemdiv > .body > .name { + display: block; + color: #999; +} +.itemdiv > .body > .name > b { + color: #777; +} +.itemdiv > .body > .text { + display: block; + position: relative; + margin-top: 2px; + padding-bottom: 19px; + padding-left: 7px; + font-size: 13px; +} +.itemdiv > .body > .text:after { + display: block; + content: ""; + height: 1px; + font-size: 0; + overflow: hidden; + position: absolute; + left: 16px; + right: -12px; + margin-top: 9px; + border-top: 1px solid #E4ECF3; +} +.itemdiv > .body > .text > .ace-icon:first-child { + color: #DCE3ED; + margin-right: 4px; +} +.itemdiv:last-child > .body > .text { + border-bottom-width: 0; +} +.itemdiv:last-child > .body > .text:after { + display: none; +} +.itemdiv.dialogdiv { + padding-bottom: 14px; +} +.itemdiv.dialogdiv:before { + position: absolute; + display: block; + content: ""; + top: 0; + bottom: 0; + left: 19px; + width: 3px; + max-width: 3px; + background-color: #E1E6ED; + border: 1px solid #D7DBDD; + border-width: 0 1px; +} +.itemdiv.dialogdiv:last-child { + padding-bottom: 0; +} +.itemdiv.dialogdiv:last-child:before { + display: none; +} +.itemdiv.dialogdiv > .user > img { + border-color: #C9D6E5; +} +.itemdiv.dialogdiv > .body { + border: 1px solid #DDE4ED; + padding: 5px 8px 8px; + border-left-width: 2px; + margin-right: 1px; +} +.itemdiv.dialogdiv > .body:before { + content: ""; + display: block; + position: absolute; + left: -7px; + top: 11px; + width: 8px; + height: 8px; + border: 2px solid #DDE4ED; + border-width: 2px 0 0 2px; + background-color: #FFF; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + -webkit-transform: rotate(-45deg); + -ms-transform: rotate(-45deg); + -o-transform: rotate(-45deg); + transform: rotate(-45deg); +} +.itemdiv.dialogdiv > .body > .time { + position: static; + float: right; +} +.itemdiv.dialogdiv > .body > .text { + padding-left: 0; + padding-bottom: 0; +} +.itemdiv.dialogdiv > .body > .text:after { + display: none; +} +.itemdiv.dialogdiv .tooltip-inner { + word-break: break-all; +} +.itemdiv.memberdiv { + width: 175px; + padding: 2px; + margin: 3px 0; + float: left; + border-bottom: 1px solid #E8E8E8; +} +@media (min-width: 992px) { + .itemdiv.memberdiv { + max-width: 50%; + } +} +@media (max-width: 991px) { + .itemdiv.memberdiv { + min-width: 33.333%; + } +} +.itemdiv.memberdiv > .user > img { + border-color: #DCE3ED; +} +.itemdiv.memberdiv > .body > .time { + position: static; +} +.itemdiv.memberdiv > .body > .name { + line-height: 18px; + height: 18px; + margin-bottom: 0; +} +.itemdiv.memberdiv > .body > .name > a { + display: inline-block; + max-width: 100px; + max-height: 18px; + overflow: hidden; + text-overflow: ellipsis; + word-break: break-all; +} +.itemdiv .tools { + position: absolute; + right: 5px; + bottom: 10px; + display: none; +} +.itemdiv .tools .btn { + border-radius: 36px; + margin: 1px 0; +} +.itemdiv .body .tools { + bottom: 4px; +} +.itemdiv.commentdiv .tools { + right: 9px; +} +.itemdiv:hover .tools { + display: inline-block; +} +.item-list { + margin: 0; + padding: 0; + list-style: none; +} +.item-list > li { + padding: 9px; + background-color: #FFF; + margin-top: -1px; + position: relative; +} +.item-list > li.selected { + color: #8090A0; + background-color: #F4F9FC; +} +.item-list > li.selected label, +.item-list > li.selected .lbl { + text-decoration: line-through; + color: #8090A0; +} +.item-list > li > .checkbox { + display: inline-block; +} +.item-list > li > label.inline { + display: inline-block; +} +.item-list > li label { + font-size: 13px; +} +.item-list > li .percentage { + font-size: 11px; + font-weight: bold; + color: #777; +} +.item-list > li.ui-sortable-helper { + cursor: move; +} +li[class*="item-"] { + border: 1px solid #DDD; + border-left-width: 3px; +} +li.item-orange { + border-left-color: #e8b110; +} +li.item-orange2 { + border-left-color: #f79263; +} +li.item-red { + border-left-color: #d53f40; +} +li.item-red2 { + border-left-color: #d15b47; +} +li.item-green { + border-left-color: #9abc32; +} +li.item-green2 { + border-left-color: #0490a6; +} +li.item-blue { + border-left-color: #4f99c6; +} +li.item-blue2 { + border-left-color: #3983c2; +} +li.item-blue3 { + border-left-color: #1144eb; +} +li.item-pink { + border-left-color: #cb6fd7; +} +li.item-purple { + border-left-color: #6f3cc4; +} +li.item-black { + border-left-color: #505050; +} +li.item-grey { + border-left-color: #a0a0a0; +} +li.item-brown { + border-left-color: #a52a2a; +} +li.item-default { + border-left-color: #abbac3; +} +.ui-sortable-placeholder, +.ui-sortable-helper, +.ui-sortable-placeholder > a, +.ui-sortable-helper > a { + cursor: move !important; +} +@media only screen and (max-width: 480px) { + .itemdiv.memberdiv { + float: none; + width: auto; + } +} +.profile-user-info { + display: table; + width: 98%; + width: calc(100% - 24px); + margin: 0 auto; +} +.profile-info-row { + display: table-row; +} +.profile-info-name { + text-align: right; + padding: 6px 10px 6px 4px; + font-weight: normal; + color: #667E99; + background-color: transparent; + border-top: 1px dotted #D5E4F1; + display: table-cell; + width: 110px; + vertical-align: middle; +} +.profile-info-value { + display: table-cell; + padding: 6px 4px 6px 6px; + border-top: 1px dotted #D5E4F1; +} +.profile-info-value > span + span:before { + /* for a list of values (such as location city & country) put a comma between them */ + display: inline; + content: ","; + margin-left: 1px; + margin-right: 3px; + color: #666; + border-bottom: 1px solid #FFF; +} +.profile-info-value > span + span.editable-container:before { + display: none; +} +.profile-info-row:first-child .profile-info-name { + border-top: none; +} +.profile-info-row:first-child .profile-info-value { + border-top: none; +} +.profile-user-info-striped { + border: 1px solid #DCEBF7; +} +.profile-user-info-striped .profile-info-name { + color: #336199; + background-color: #EDF3F4; + border-top: 1px solid #F7FBFF; +} +.profile-user-info-striped .profile-info-value { + border-top: 1px dotted #DCEBF7; + padding-left: 12px; +} +.profile-picture { + border: 1px solid #CCC; + background-color: #FFF; + padding: 4px; + display: inline-block; + max-width: 100%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.15); +} +.profile-activity { + padding: 10px 4px; + border-bottom: 1px dotted #D0D8E0; + position: relative; + border-left: 1px dotted #FFF; + border-right: 1px dotted #FFF; +} +.profile-activity:first-child { + border-top: 1px dotted transparent; +} +.profile-activity:first-child:hover { + border-top-color: #D0D8E0; +} +.profile-activity:hover { + background-color: #F4F9FD; + border-left: 1px dotted #D0D8E0; + border-right: 1px dotted #D0D8E0; +} +.profile-activity img { + border: 2px solid #C9D6E5; + border-radius: 100%; + max-width: 40px; + margin-right: 10px; + margin-left: 0px; + box-shadow: none; +} +.profile-activity .thumbicon { + background-color: #74ABD7; + display: inline-block; + border-radius: 100%; + width: 38px; + height: 38px; + color: #FFF; + font-size: 18px; + text-align: center; + line-height: 38px; + margin-right: 10px; + margin-left: 0px; + text-shadow: none !important; +} +.profile-activity .time { + display: block; + margin-top: 4px; + color: #777; +} +.profile-activity a.user { + font-weight: bold; + color: #9585BF; +} +.profile-activity .tools { + position: absolute; + right: 12px; + bottom: 8px; + display: none; +} +.profile-activity:hover .tools { + display: block; +} +.user-profile .ace-thumbnails li { + border: 1px solid #CCC; + padding: 3px; + margin: 6px; +} +.user-profile .ace-thumbnails li .tools { + left: 3px; + right: 3px; +} +.user-profile .ace-thumbnails li:hover .tools { + bottom: 3px; +} +.user-profile .user-title-label:hover { + text-decoration: none; +} +.user-profile .user-title-label + .dropdown-menu { + margin-left: -12px; +} +.profile-contact-links { + padding: 4px 2px 5px; + border: 1px solid #E0E2E5; + background-color: #F8FAFC; +} +.btn-link:hover .ace-icon { + text-decoration: none !important; +} +.profile-social-links > a { + text-decoration: none; + margin: 0 1px; +} +.profile-social-links > a:hover > .ace-icon { + text-decoration: none; +} +.profile-skills .progress { + height: 26px; + margin-bottom: 2px; + background-color: transparent; +} +.profile-skills .progress .progress-bar { + line-height: 26px; + font-size: 13px; + font-weight: bold; + font-family: "Open Sans"; + padding: 0 8px; +} +.profile-users .user { + display: block; + position: static; + text-align: center; + width: auto; +} +.profile-users .user img { + padding: 2px; + border-radius: 100%; + border: 1px solid #AAA; + max-width: none; + width: 64px; + -webkit-transition: all 0.1s; + -o-transition: all 0.1s; + transition: all 0.1s; +} +.profile-users .user img:hover { + -webkit-box-shadow: 0 0 1px 1px rgba(0,0,0,0.33); + box-shadow: 0 0 1px 1px rgba(0,0,0,0.33); +} +.profile-users .memberdiv { + background-color: #FFF; + width: 100px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + border: none; + text-align: center; + margin: 0 8px 24px; +} +.profile-users .memberdiv .name a:hover .ace-icon { + text-decoration: none; +} +.profile-users .memberdiv .body { + display: inline-block; + margin: 8px 0 0 0; +} +.profile-users .memberdiv .popover { + visibility: hidden; + min-width: 0; + max-height: 0; + max-width: 0; + margin-left: 0; + margin-right: 0; + top: -5%; + left: auto; + right: auto; + opacity: 0; + display: none; + position: absolute; + -webkit-transition: opacity 0.2s linear 0s, visibility 0s linear 0.2s, max-height 0s linear 0.2s, max-width 0s linear 0.2s, min-width 0s linear 0.2s; + -o-transition: opacity 0.2s linear 0s, visibility 0s linear 0.2s, max-height 0s linear 0.2s, max-width 0s linear 0.2s, min-width 0s linear 0.2s; + transition: opacity 0.2s linear 0s, visibility 0s linear 0.2s, max-height 0s linear 0.2s, max-width 0s linear 0.2s, min-width 0s linear 0.2s; +} +.profile-users .memberdiv .popover.right { + left: 100%; + right: auto; + display: block; +} +.profile-users .memberdiv .popover.left { + left: auto; + right: 100%; + display: block; +} +.profile-users .memberdiv > :first-child:hover .popover { + visibility: visible; + opacity: 1; + z-index: 1060; + max-height: 250px; + max-width: 250px; + min-width: 150px; + -webkit-transition-delay: 0s; + -moz-transition-delay: 0s; + -o-transition-delay: 0s; + transition-delay: 0s; +} +.profile-users .memberdiv .tools { + position: static; + display: block; + width: 100%; + margin-top: 2px; +} +.profile-users .memberdiv .tools > a { + margin: 0 2px; +} +.profile-users .memberdiv .tools > a:hover { + text-decoration: none; +} +.user-status { + display: inline-block; + width: 11px; + height: 11px; + background-color: #FFF; + border: 3px solid #AAA; + border-radius: 100%; + vertical-align: middle; + margin-right: 1px; +} +.user-status.status-online { + border-color: #8AC16C; +} +.user-status.status-busy { + border-color: #E07F69; +} +.user-status.status-idle { + border-color: #FFB752; +} +.tab-content.profile-edit-tab-content { + border: 1px solid #DDD; + padding: 8px 32px 32px; + -webkit-box-shadow: 1px 1px 0 0 rgba(0, 0, 0, 0.2); + box-shadow: 1px 1px 0 0 rgba(0, 0, 0, 0.2); + background-color: #FFF; +} +@media only screen and (max-width: 480px) { + .profile-info-name { + width: 80px; + } + .profile-user-info-striped .profile-info-name { + float: none; + width: auto; + text-align: left; + padding: 6px 4px 6px 10px; + display: block; + } + .profile-user-info-striped .profile-info-value { + margin-left: 10px; + display: block; + } +} +@media only screen and (max-width: 480px) { + .user-profile .memberdiv { + width: 50%; + margin-left: 0; + margin-right: 0; + } +} +.inbox-tabs.nav-tabs > li > a { + background-color: #FAFAFA; +} +.inbox-tabs.nav-tabs > li.active:not(.open) > a, +.inbox-tabs.nav-tabs > li.active:not(.open) > a:hover, +.inbox-tabs.nav-tabs > li.active:not(.open) > a:focus { + background-color: #F1F5FA; + box-shadow: 0 -2px 3px 0 rgba(0, 0, 0, 0.1); + color: #48768E; +} +.inbox-tabs.nav-tabs > li > a.btn-new-mail { + background-color: transparent; + border: none !important; + padding: 0 !important; +} +.inbox-tabs.nav-tabs > li > a.btn-new-mail > .btn { + border-width: 0 !important; + border-radius: 3px !important; + padding: 0 6px !important; + position: relative; + transition: none !important; +} +.inbox-tabs.nav-tabs > li.active > a.btn-new-mail { + box-shadow: none !important; +} +.inbox-tabs.nav-tabs > li.active > a.btn-new-mail > .btn:before { + content: ""; + display: block; + position: absolute; + top: 100%; + left: 50%; + margin-left: -6px; + border-width: 6px 8px; + border-style: solid; + border-color: transparent; + border-top-color: inherit; +} +.inbox-tabs.nav-tabs.tab-size-bigger > li > a { + padding: 5px 15px 7px; + font-size: 14px; +} +.inbox-tabs.nav-tabs.tab-size-bigger > li > a > .ace-icon:first-child { + margin-bottom: 5px; +} +.inbox-tabs.nav-tabs.tab-size-bigger > li > a.btn-new-mail > .btn { + padding: 10px !important; + border-radius: 7px !important; +} +.inbox-tabs.nav-tabs.tab-size-bigger > li.active > a.btn-new-mail { + margin-top: 0 !important; + top: 1px; +} +.inbox-tabs.nav-tabs.tab-size-bigger > li.active > a.btn-new-mail > .btn:before { + left: 50%; + margin-left: -8px; + border-width: 8px 10px; +} +@media only screen and (max-width: 479px) { + .inbox-tabs > .li-new-mail { + display: block; + text-align: right; + margin-bottom: 8px !important; + float: none !important; + } + .inbox-tabs > .li-new-mail > .btn-new-mail { + display: inline-block; + width: auto; + } +} +.message-container { + position: relative; +} +.message-list { + position: relative; +} +.message-item { + border: 1px solid #EAEDF1; + border-bottom-width: 0; + padding: 12px 12px 14px; + line-height: 18px; + position: relative; + background-color: #FFF; +} +.message-item:first-child { + border-top-width: 0; +} +.message-item:hover { + border-color: #E2EAF2; + background-color: #F2F6F9; +} +.message-item:hover + .message-item { + border-top-color: #E2EAF2; +} +.message-item:hover + .message-item.selected { + border-top-color: #FFF; +} +.message-item.selected { + background-color: #EFF4F7; + border-color: #FFF #E2EAF2; +} +.message-item.selected + .message-item { + border-top-color: #FFF; +} +.message-item.selected + .message-item:hover + .message-item { + border-top-color: #FFF; +} +.message-navbar input.ace + .lbl::before, +.message-item input.ace + .lbl::before { + top: auto; +} +.message-item .sender { + margin: 0 6px 0 4px; + vertical-align: middle; + color: #467287; + display: inline-block; + width: 110px; + height: 18px; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + cursor: pointer; +} +.message-item.message-unread .sender { + color: #6A9CBA; + font-weight: bold; +} +.message-item .summary { + vertical-align: middle; + display: inline-block; + position: relative; + margin-left: 30px; + max-width: 250px; + max-width: calc(100% - 300px); + min-width: 200px; + white-space: nowrap; +} +.message-item .summary .text { + color: #555; + vertical-align: middle; + display: inline-block; + width: auto; + max-width: 100%; + height: 18px; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + cursor: pointer; +} +.message-item .summary .text:hover { + text-decoration: underline; +} +.message-item .summary .message-flags { + display: block; + position: absolute; + right: 100%; + margin-right: 4px; + height: 18px; + white-space: nowrap; +} +.message-item.message-unread .summary .text { + color: #609FC4; + font-weight: bold; +} +.message-item .time { + float: right; + width: 60px; + height: 18px; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + color: #666; +} +.message-item.message-unread .time { + font-weight: bold; + color: #609FC4; +} +.message-item.message-unread .message-content .time { + font-weight: normal; +} +.message-item .attachment { + color: #999; + font-size: 18px; + vertical-align: middle; + float: right; + margin: 0 12px; + position: relative; +} +.message-item.message-unread .attachment { + color: #4F99C6; +} +.message-content .time { + font-weight: normal; +} +.message-star { + vertical-align: middle; + margin: 2px 4px 0 6px; + font-size: 15px; + cursor: pointer; +} +.message-star:hover { + color: #feb902 !important; + text-decoration: none; +} +.mail-tag:empty { + display: inline-block; + width: 8px; + height: 11px; + padding: 0; + line-height: normal; + vertical-align: middle; + margin: 0 1px 0 0; +} +.badge.mail-tag { + border-radius: 2px; +} +.dropdown-menu > li > a > .mail-tag { + vertical-align: inherit; +} +@media only screen and (max-width: 991px) { + .message-item .summary { + min-width: 0; + } + .message-item .sender { + width: 100px; + } +} +@media only screen and (max-width: 550px) { + .message-item .summary { + margin: 8px 0 0 32px; + max-width: 95%; + min-width: 0; + display: block; + } + .message-item .sender { + width: auto; + max-width: 150px; + } + .message-item .summary .text { + max-width: 95%; + } +} +.btn-message, +.btn-message:hover, +.btn-message:focus, +.btn-message:active, +.open .btn-message.dropdown-toggle { + background-color: #FFF !important; + border: 1px solid #94B9CE !important; + color: #7CA3BA !important; + text-shadow: none !important; +} +.message-content { + padding: 16px 12px; + border: 1px solid #E9E9E9; + -webkit-box-shadow: 0 0 1px 1px rgba(0,0,0,0.02); + box-shadow: 0 0 1px 1px rgba(0,0,0,0.02); + background-color: rgba(255, 255, 255, 0.8); + border-top-width: 0; +} +.message-item .message-content { + margin-top: 16px; + border-top-width: 1px; +} +.message-body { + padding: 0 9px; + color: #6A7177; +} +.message-navbar { + line-height: 24px; + padding: 10px 12px; + border: 1px solid #D6E1EA; + border-color: #D6E1EA transparent; + background-color: #F1F5FA; + text-align: center; + position: relative; +} +.message-navbar .dropdown-toggle, +.message-content .dropdown-toggle { + color: #777; +} +.message-navbar .dropdown-toggle:hover, +.message-content .dropdown-toggle:hover, +.message-navbar .dropdown-toggle:focus, +.message-content .dropdown-toggle:focus { + text-decoration: none; + color: #2283C5; +} +.message-bar { + display: inline-block; + min-height: 28px; +} +@media only screen and (max-width: 480px) { + .message-bar { + display: block; + min-height: 60px; + } +} +.message-footer { + background-color: #F1F1F1; + padding: 12px 16px; + border: 1px solid #E6E6E6; + border-width: 1px 0; + border-top: 1px solid #E4E9EE; +} +.message-footer .pagination { + margin: 0; +} +.message-footer .pagination > li { + margin: 0; + padding: 0; +} +.message-footer .pagination > li > a, +.message-footer .pagination > li > span { + color: #777; + padding: 3px 6px; + margin-left: 1px; + margin-right: 1px; + background-color: transparent; + border: 1px solid transparent; +} +.message-footer .pagination > li.disabled > span { + color: #BBBBBB; + cursor: default; + background-color: transparent; + border-color: transparent; +} +.message-footer .pagination > li > a:hover { + border-color: #91bad6; + color: #2283C5; + text-decoration: none; + background-color: #FFF; +} +.message-footer input[type=text] { + font-size: 12px; + width: 34px; + height: 24px; + line-height: 20px; + margin-bottom: 0; + padding: 3px; + vertical-align: middle; + text-align: center; +} +.message-footer-style2 .pagination > li > a, +.message-footer-style2 .pagination > li > span { + border: 1px solid #B5B5B5; + border-radius: 100% !important; + width: 26px; + height: 26px; + line-height: 26px; + display: inline-block; + text-align: center; + padding: 0; +} +.message-footer-style2 .pagination > li > span, +.message-footer-style2 .pagination > li.disabled > span { + border-color: #CCC; +} +.message-footer-style2 .pagination > li > a:hover { + border-color: #84AFC9; + background-color: #F7F7F7; +} +.message-item.message-inline-open { + background-color: #F2F6F9; + border: 1px solid #DDD; + border-bottom-color: #CCC; +} +.message-item.message-inline-open:first-child { + border-top-color: #EEE; +} +.message-item.message-inline-open:last-child { + border-bottom-color: #DDD; +} +.message-item.message-inline-open + .message-item { + border-bottom-color: transparent; +} +.message-loading-overlay { + position: absolute; + z-index: 14; + top: 0; + bottom: 0; + right: 0; + left: 0; + background-color: rgba(255, 255, 255, 0.5); + text-align: center; +} +.message-loading-overlay > .ace-icon { + position: absolute; + top: 15%; + left: 0; + right: 0; + text-align: center; +} +.message-content .sender { + color: #6A9CBA; + font-weight: bold; + width: auto; + text-overflow: inherit; + vertical-align: middle; + margin: 0; +} +.message-content .time { + width: auto; + text-overflow: inherit; + white-space: normal; + float: none; + vertical-align: middle; +} +ul.attachment-list { + margin: 6px 0 4px 8px; +} +ul.attachment-list > li { + margin-bottom: 3px; +} +.message-attachment { + padding-left: 10px; + padding-right: 10px; +} +.attached-file { + color: #777; + width: 200px; + display: inline-block; +} +.attached-file > .ace-icon { + display: inline-block; + width: 16px; + margin-right: 2px; + vertical-align: middle; +} +.attached-file:hover { + text-decoration: none; + color: #438EB9; +} +.attached-file:hover .attached-name { + color: #2283C5; +} +.attached-file .attached-name { + display: inline-block; + max-width: 175px; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + vertical-align: middle; +} +.messagebar-item-left, +.messagebar-item-right { + position: absolute; + bottom: 14px; + left: 12px; + text-align: left; +} +.messagebar-item-right { + right: 12px; + left: auto; +} +.message-navbar .nav-search { + right: auto; + left: 5px; + top: auto; + bottom: 11px; +} +.message-navbar .messagebar-item-left ~ .nav-search { + left: 60px; +} +.message-form { + border: 1px solid #ddd; + border-top: none; + padding-top: 22px; +} +@media only screen and (max-width: 480px) { + .message-form { + padding-left: 16px; + padding-right: 16px; + } +} +.message-form .form-actions { + margin-bottom: 0; +} +.message-form .wysiwyg-editor { + overflow: auto; + min-height: 150px; + max-height: 250px; + height: auto; +} +.btn-send-message { + position: relative; + top: 6px; + vertical-align: middle; +} +.btn-back-message-list { + color: #777; +} +.btn-back-message-list:hover { + color: #478FCA; + text-decoration: none; +} +.message-condensed .message-item { + padding-top: 8px; + padding-bottom: 9px; +} +.message-condensed .message-navbar, +.message-condensed .message-footer { + padding-top: 7px; + padding-bottom: 7px; +} +.message-condensed .messagebar-item-left, +.message-condensed .messagebar-item-right { + bottom: 9px; +} +.message-condensed .message-navbar .nav-search { + bottom: 7px; +} +@media only screen and (max-width: 480px) { + .message-condensed .message-bar { + min-height: 42px; + } +} +.inbox-folders .btn-block { + margin-top: 0; +} +@media only screen and (max-width: 767px) { + .inbox-folders.inbox-folders-responsive .btn-block { + width: 24%; + } +} +@media only screen and (max-width: 600px) { + .inbox-folders.inbox-folders-responsive .btn-block { + width: 48%; + } +} +@media only screen and (max-width: 320px) { + .inbox-folders.inbox-folders-responsive .btn-block { + width: 99%; + } +} +.inbox-folders .btn-lighter, +.inbox-folders .btn-lighter.active { + background-color: #F4F4F4 !important; + text-shadow: none !important; + color: #7C8395 !important; + border: 1px solid #FFF !important; + padding: 5px 11px; +} +.inbox-folders .btn-lighter.active { + background-color: #EDF2F8 !important; + color: #53617C !important; +} +.inbox-folders .btn-lighter:hover { + background-color: #EFEFEF !important; + color: #6092C4 !important; +} +.inbox-folders .btn > .ace-icon:first-child { + display: inline-block; + width: 14px; + text-align: left; +} +.inbox-folders .btn-lighter + .btn-lighter { + border-top-width: 0 !important; +} +.inbox-folders .btn.active:before { + display: block; + content: ""; + position: absolute; + top: 1px; + bottom: 1px; + left: -1px; + border-left: 3px solid #4F99C6; +} +.inbox-folders .btn.active:after { + display: none; +} +.inbox-folders .btn .counter { + border-radius: 3px; + position: absolute; + right: 8px; + top: 8px; + padding-left: 6px; + padding-right: 6px; + opacity: 0.75; + filter: alpha(opacity=75); +} +.inbox-folders .btn:hover .badge { + opacity: 1; + filter: alpha(opacity=100); +} +.timeline-container { + position: relative; + padding-top: 4px; + margin-bottom: 32px; +} +.timeline-container:last-child { + margin-bottom: 0; +} +.timeline-container:before { + /* the vertical line running through icons */ + content: ""; + display: block; + position: absolute; + left: 28px; + top: 0; + bottom: 0; + border: 1px solid #E2E3E7; + background-color: #E7EAEF; + width: 4px; + border-width: 0 1px; +} +.timeline-container:first-child:before { + border-top-width: 1px; +} +.timeline-container:last-child:before { + border-bottom-width: 1px; +} +.timeline-item { + position: relative; + margin-bottom: 8px; +} +.timeline-item .widget-box { + background-color: #F2F6F9; + color: #595C66; +} +.timeline-item .transparent.widget-box { + border-left: 3px solid #DAE1E5; +} +.timeline-item .transparent .widget-header { + background-color: #ECF1F4; + border-bottom-width: 0; +} +.timeline-item .transparent .widget-header > .widget-title { + margin-left: 8px; +} +.timeline-item:nth-child(even) .widget-box { + background-color: #F3F3F3; + color: #616161; +} +.timeline-item:nth-child(even) .widget-box.transparent { + border-left-color: #DBDBDB !important; +} +.timeline-item:nth-child(even) .widget-box.transparent .widget-header { + background-color: #EEE !important; +} +.timeline-item .widget-box { + margin: 0; + position: relative; + max-width: none; + margin-left: 60px; +} +.timeline-item .widget-main { + margin: 0; + position: relative; + max-width: none; + border-bottom-width: 0; +} +.timeline-item .widget-body { + background-color: transparent; +} +.timeline-item .widget-toolbox { + padding: 4px 8px 0 !important; + background-color: transparent !important; + border-width: 0 !important; + margin: 0 0px !important; +} +.timeline-info { + float: left; + width: 60px; + text-align: center; + position: relative; +} +.timeline-info img { + border-radius: 100%; + max-width: 42px; +} +.timeline-info .label, +.timeline-info .badge { + font-size: 12px; +} +.timeline-container:not(.timeline-style2) .timeline-indicator { + opacity: 1; + border-radius: 100%; + display: inline-block; + font-size: 16px; + height: 36px; + line-height: 30px; + width: 36px; + text-align: center; + text-shadow: none !important; + padding: 0; + cursor: default; + border: 3px solid #FFF !important; +} +.timeline-label { + display: block; + clear: both; + margin: 0 0 18px; + margin-left: 34px; +} +.timeline-item img { + border: 1px solid #AAA; + padding: 2px; + background-color: #FFF; +} +.timeline-style2:before { + display: none; +} +.timeline-style2 .timeline-item { + padding-bottom: 22px; + margin-bottom: 0; +} +.timeline-style2 .timeline-item:last-child { + padding-bottom: 0; +} +.timeline-style2 .timeline-item:before { + content: ""; + display: block; + position: absolute; + left: 90px; + top: 5px; + bottom: -5px; + border-width: 0; + background-color: #DDD; + width: 2px; + max-width: 2px; +} +.timeline-style2 .timeline-item:last-child:before { + display: none; +} +.timeline-style2 .timeline-item:first-child:before { + display: block; +} +.timeline-style2 .timeline-item .transparent .widget-header { + background-color: transparent !important; +} +.timeline-style2 .timeline-item .transparent.widget-box { + background-color: transparent !important; + border-left: none !important; +} +.timeline-style2 .timeline-info { + width: 100px; +} +.timeline-style2 .timeline-indicator { + font-size: 0; + height: 12px; + line-height: 12px; + width: 12px; + border-width: 1px !important; + background-color: #FFFFFF !important; + position: absolute; + left: 85px; + top: 3px; + opacity: 1; + border-radius: 100%; + display: inline-block; + padding: 0; +} +.timeline-style2 .timeline-date { + display: inline-block; + width: 72px; + text-align: right; + margin-right: 25px; + color: #777; +} +.timeline-style2 .timeline-item .widget-box { + margin-left: 112px; +} +.timeline-style2 .timeline-label { + width: 75px; + text-align: center; + margin-left: 0; + margin-bottom: 10px; + text-align: right; + color: #666; + font-size: 14px; +} +.timeline-time { + text-align: center; + position: static; +} +.dataTables_length select { + width: 70px; + height: 25px; + padding: 2px 3px; +} +.dataTables_length label { + font-weight: normal; +} +.dataTables_filter { + text-align: right; +} +.dataTables_filter input[type=text], +.dataTables_filter input[type=search] { + width: 125px; + height: 18px; + line-height: 18px; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + padding: 4px 6px; +} +.dataTables_filter label { + font-weight: normal; +} +.dataTables_info { + font-size: 14px; +} +.dataTables_paginate { + text-align: right; +} +.dataTables_paginate .pagination { + margin: 0 12px; +} +.dataTables_wrapper label { + display: inline-block; + font-size: 13px; +} +.dataTables_wrapper input[type=text], +.dataTables_wrapper input[type=search], +.dataTables_wrapper select { + margin-bottom: 0 !important; + margin: 0 4px; +} +.dataTables_wrapper .row { + margin: 0 !important; +} +.dataTables_wrapper .row:first-child { + padding-top: 12px; + padding-bottom: 12px; + background-color: #EFF3F8; +} +.dataTables_wrapper .row:first-child + .dataTable { + border-top: 1px solid #dddddd; + border-bottom: 1px solid #dddddd; +} +.dataTables_wrapper .row:last-child { + border-bottom: 1px solid #e0e0e0; + padding-top: 12px; + padding-bottom: 12px; + background-color: #EFF3F8; +} +.dataTables_wrapper .dataTables_scroll + .row { + border-top: 1px solid #e0e0e0; +} +.dataTable { + margin-bottom: 0; +} +.dataTable > thead > tr > th[class*=sort] { + cursor: pointer; +} +.dataTable > thead > tr > th[class*=sort]:after { + float: right; + display: inline; + content: "\f0dc"; + font-family: FontAwesome; + font-size: 13px; + font-weight: normal; + color: #555; +} +.dataTable > thead > tr > th[class*=sort]:hover { + color: #547ea8; +} +.dataTable > thead > tr > th[class*=sorting_] { + color: #307ecc; +} +.dataTable > thead > tr > th.sorting_desc, +.dataTable > thead > tr > th.sorting_asc { + background-image: -webkit-linear-gradient(top, #eff3f8 0%, #e3e7ed 100%); + background-image: -o-linear-gradient(top, #eff3f8 0%, #e3e7ed 100%); + background-image: linear-gradient(to bottom, #eff3f8 0%, #e3e7ed 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffeff3f8', endColorstr='#ffe3e7ed', GradientType=0); +} +.dataTable > thead > tr > th.sorting_desc:after { + content: "\f0dd"; + top: -6px; + color: #307ecc; +} +.dataTable > thead > tr > th.sorting_asc:after { + content: "\f0de"; + top: 4px; + color: #307ecc; +} +.dataTable > thead > tr > th.sorting_disabled { + cursor: inherit; +} +.dataTable > thead > tr > th.sorting_disabled:after { + display: none; +} +.dataTables_scrollHead + .dataTables_scrollBody > .dataTable > thead > tr > th:after { + display: none; +} +.dataTables_scrollHeadInner { + width: auto !important; +} +.dataTables_scrollHeadInner > .dataTable > thead > tr > th { + border-bottom-width: 0 !important; +} +.dataTables_borderWrap .dataTables_scrollBody, +.dataTables_borderWrap .dataTables_scrollHead { + border: 1px solid #dddddd !important; + border-width: 0 1px !important; +} +.dataTables_borderWrap .dataTables_scrollBody .table-bordered, +.dataTables_borderWrap .dataTables_scrollHead .table-bordered { + border-left-width: 0; + border-right-width: 0; +} +.dataTables_borderWrap .dataTables_scrollBody .table-bordered > thead > tr > th:first-child, +.dataTables_borderWrap .dataTables_scrollHead .table-bordered > thead > tr > th:first-child, +.dataTables_borderWrap .dataTables_scrollBody .table-bordered > tbody > tr > td:first-child, +.dataTables_borderWrap .dataTables_scrollHead .table-bordered > tbody > tr > td:first-child { + border-left-width: 0; +} +.dataTables_borderWrap .dataTables_scrollBody .table-bordered > thead > tr > th:last-child, +.dataTables_borderWrap .dataTables_scrollHead .table-bordered > thead > tr > th:last-child, +.dataTables_borderWrap .dataTables_scrollBody .table-bordered > tbody > tr > td:last-child, +.dataTables_borderWrap .dataTables_scrollHead .table-bordered > tbody > tr > td:last-child { + border-right-width: 0; +} +table.dataTable { + clear: both; + max-width: none !important; +} +table.dataTable th:active { + outline: none; +} +div.dataTables_scrollHead table { + margin-bottom: 0 !important; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; +} +div.dataTables_scrollHead table thead tr:last-child th:first-child, +div.dataTables_scrollHead table thead tr:last-child td:first-child { + border-bottom-left-radius: 0 !important; + border-bottom-right-radius: 0 !important; +} +div.dataTables_scrollBody table { + border-top: none; + margin-top: 0 !important; + margin-bottom: 0 !important; +} +div.dataTables_scrollBody tbody tr:first-child th, +div.dataTables_scrollBody tbody tr:first-child td { + border-top: none; +} +div.dataTables_scrollFoot table { + margin-top: 0 !important; + border-top: none; +} +.DTTT_Print .main-content { + margin-left: 0 !important; + margin-right: 0 !important; +} +.DTTT_Print .navbar-fixed-top + .main-container { + padding-top: 0; +} +.tableTools-container { + margin-bottom: 8px; +} +.tableTools-alert.gritter-item-wrapper { + padding: 12px 11px 8px; + z-index: 1999; +} +ul.ColVis_collection { + z-index: 2002; +} +ul.ColVis_collection > li > a { + padding: 0; +} +ul.ColVis_collection > li > a:focus { + outline: none; +} +ul.ColVis_collection > li.ColVis_Special { + border-top: 1px solid #DDD; +} +ul.ColVis_collection > li.ColVis_Special > a { + padding: 6px 11px 7px; + text-align: center; +} +ul.ColVis_collection label { + margin: auto; + padding: 6px 11px 7px; + display: block; + cursor: pointer; +} +div.ColVis_catcher { + position: absolute; + z-index: 1101; +} +div.ColVis_collectionBackground { + position: fixed; + top: 0; + left: 0; + height: 100%; + width: 100%; + background-color: black; + z-index: 1100; +} +.fc-toolbar h2 { + font-size: 22px; + color: #65A0CE; +} +.fc-unthemed th, +.fc-unthemed td, +.fc-unthemed hr, +.fc-unthemed thead, +.fc-unthemed tbody, +.fc-unthemed .fc-row, +.fc-unthemed .fc-popover { + border-color: #BCD4E5; +} +.fc-unthemed .fc-today { + background: #FFC; +} +.fc-event { + border-width: 0; + color: #ffffff; + padding: 1px 1px 2px 2px; + border-radius: 0; +} +.fc-event:not([class*="label-"]) { + background-color: #abbac3; +} +.fc-event.label-yellow { + color: #996633; +} +.fc-event.label-light { + color: #888888; +} +.label-yellow .fc-event { + color: #996633; +} +.label-light .fc-event { + color: #888; +} +[class*="label-"] > .fc-event, +[class*="label-"] > .fc-event > .fc-event-skin.fc-event-head { + background-color: inherit; +} +.fc-event.ui-draggable-dragging { + cursor: move; +} +.fc-event.fc-event-vert, +.fc-event-vert > .fc-event { + padding: 0 0 1px; +} +.fc-day-number { + color: #2E6589; + opacity: 1; + filter: alpha(opacity=100); +} +.fc-widget-header, +.fc .fc-axis { + background: #ECF2F7; + color: #8090A0; +} +.fc-event-hori, +.fc-event-vert { + border-radius: 0 !important; + border-color: transparent; +} +.fc-event-vert .fc-event-content { + padding-left: 1px; + padding-right: 1px; +} +.fc-event-vert .fc-event-time { + padding: 0; +} +.fc-state-default { + border: none; +} +.fc-state-default, +.fc-state-default .fc-button-inner { + border: none; + background-color: #abbac3; + color: #FFF; + background-image: none; + box-shadow: none; + text-shadow: none; + border-radius: 0 !important; + margin-left: 2px; +} +.fc-state-default .fc-button-effect { + display: none; +} +.fc-state-disabled, +.fc-state-disabled .fc-button-inner { + opacity: 0.75; + filter: alpha(opacity=75); + color: #DDD; +} +.fc-state-active, +.fc-state-active .fc-button-inner { + border-color: #4F99C6; + background-color: #6FB3E0; +} +.fc-state-hover, +.fc-state-hover .fc-button-inner { + background-color: #8B9AA3; +} +.fc .fc-button-group > * { + margin: 0 1px 0 0; +} +.external-event { + margin: 6px 0; + padding: 0; + cursor: default; + display: block; + font-size: 13px; + line-height: 28px; + color: #ffffff; +} +.external-event:not([class*="label-"]) { + background-color: #abbac3; +} +.external-event:hover { + opacity: 1; + filter: alpha(opacity=100); +} +.external-event.ui-draggable-dragging { + cursor: move; +} +.external-event.label-yellow { + color: #996633; +} +.external-event.label-light { + color: #888888; +} +.external-event > .ace-icon:first-child { + display: inline-block; + height: 32px; + width: 32px; + text-align: center; + line-height: 30px; + margin-right: 5px; + font-size: 15px; + border-right: 1px solid #FFF; +} +/** +.widget-main { + .fc { + position:relative; + top:-40px; + + > .fc-header { + position:relative; + z-index:10; + } + + .fc-header-space { + padding-left:2px; + } + } + + .fc-header-title > h2 { + font-size: floor(@base-font-size * 1.4); + line-height: 36px; + } + + .fc-content { + top:-14px; + z-index:11; + } + + .fc-button-content { + height:37px; + line-height:36px; + } + +} +*/ +@media only screen and (max-width: 480px) { + .fc-header td { + display: block; + width: auto; + text-align: left; + } +} +.chosen-container + .help-inline { + vertical-align: middle; +} +/** +.chosen-select { + display: inline !important; //for validation plugin to work it must be displayed + visibility: hidden; + opacity: 0; + position: absolute; + z-index: -1; + width: 0; + height: 0; + border-width: 0; +} +*/ +.chosen-container, +[class*="chosen-container"] { + vertical-align: middle; +} +.chosen-container > .chosen-single, +[class*="chosen-container"] > .chosen-single { + line-height: 28px; + height: 32px; + box-shadow: none; + background: #FAFAFA; +} +.chosen-choices { + box-shadow: none !important; +} +.chosen-container-single .chosen-single abbr { + background: none; +} +.chosen-container-single .chosen-single abbr:after { + content: "\f00d"; + display: inline-block; + color: #888; + font-family: FontAwesome; + font-size: 13px; + position: absolute; + right: 0; + top: -7px; +} +.chosen-container-single .chosen-single abbr:hover:after { + color: #464646; +} +.chosen-container-single.chosen-disabled .chosen-single abbr:hover:after { + color: #464646; +} +.chosen-single div b { + background: none !important; +} +.chosen-single div b:before { + content: "\f0d7"; + display: inline-block; + color: #888; + font-family: FontAwesome; + font-size: 12px; + position: relative; + top: -1px; + left: 1px; +} +.chosen-container-active.chosen-with-drop .chosen-single div b:before { + content: "\f0d8"; +} +.chosen-container-single .chosen-search { + position: relative; +} +.chosen-container-single .chosen-search input[type="text"] { + background: none; + border-radius: 0; + line-height: 28px; + height: 28px; +} +.chosen-container-single .chosen-search:after { + content: "\f002"; + display: inline-block; + color: #888; + font-family: FontAwesome; + font-size: 14px; + position: absolute; + top: 8px; + right: 12px; +} +.chosen-container-multi .chosen-choices li.search-field input[type="text"] { + height: 25px; +} +.chosen-container-multi .chosen-choices li.search-choice { + line-height: 16px; + padding-bottom: 4px; +} +.chosen-container-multi .chosen-choices li.search-choice .search-choice-close { + background: none; +} +.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:before { + content: "\f00d"; + display: inline-block; + color: #888; + font-family: FontAwesome; + font-size: 13px; + position: absolute; + right: 2px; + top: -1px; +} +.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover { + text-decoration: none; +} +.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover:before { + color: #464646; +} +.chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close:before { + color: #464646; +} +.chosen-container .chosen-results-scroll-down span, +.chosen-container .chosen-results-scroll-up span { + background: none; +} +.chosen-container .chosen-results-scroll-down span:before, +.chosen-container .chosen-results-scroll-up span:before { + content: "\f0d7"; + display: inline-block; + color: #888; + font-family: FontAwesome; + font-size: 12px; + position: relative; + top: -1px; + left: 1px; +} +.chosen-container .chosen-results-scroll-up span:before { + content: "\f0d8"; +} +.chosen-container-active .chosen-single-with-drop div b:before { + content: "\f0d8"; +} +.chosen-rtl .chosen-search input[type="text"] { + background: none; +} +.chosen-rtl .chosen-search:after { + content: ""; + display: none; +} +.chosen-rtl .chosen-search:before { + content: "\f002"; + display: inline-block; + color: #888; + font-family: FontAwesome; + font-size: 14px; + position: absolute; + top: 9px; + left: 12px; +} +/** chosen - etc */ +.chosen-container-single .chosen-single { + border-radius: 0; +} +.chosen-container .chosen-results li.highlighted { + background: #316AC5; + color: #FFF; +} +.chosen-container-single .chosen-drop { + border-radius: 0; + border-bottom: 3px solid #4492C9; + border-color: #4492C9; +} +.chosen-single.chosen-single-with-drop, +.chosen-container-active .chosen-single { + border-color: #4492C9; +} +.form-group.has-error .chosen-single { + border-color: #f2a696 !important; +} +.form-group.has-info .chosen-single { + border-color: #72aec2 !important; +} +.form-group.has-warning .chosen-single { + border-color: #e3c94c !important; +} +.form-group.has-success .chosen-single { + border-color: #9cc573 !important; +} +.chosen-container-active.chosen-with-drop .chosen-single { + border-color: #4492C9; +} +.chosen-container .chosen-drop { + display: none; +} +.chosen-container.chosen-with-drop .chosen-drop { + left: auto; + right: auto; + display: block; +} +@media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-resolution: 144dpi) { + .chosen-rtl .chosen-search input[type="text"], + .chosen-container-single .chosen-single abbr, + .chosen-container-single .chosen-single div b, + .chosen-container-single .chosen-search input[type="text"], + .chosen-container-multi .chosen-choices li.search-choice .search-choice-close, + .chosen-container .chosen-results-scroll-down span, + .chosen-container .chosen-results-scroll-up span { + background-image: none !important; + background-repeat: no-repeat !important; + background-size: auto !important; + } +} +.tag-input-style + .chosen-container-multi .chosen-choices li.search-choice { + background-image: none; + background-color: #91b8d0; + color: #FFFFFF; + display: inline-block; + font-size: 13px; + font-weight: normal; + margin-bottom: 3px; + margin-right: 3px; + padding: 6px 22px 7px 9px; + position: relative; + text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.15); + transition: all 0.2s ease 0s; + vertical-align: baseline; + white-space: nowrap; + border: none; + -webkit-box-shadow: none; + box-shadow: none; + border-radius: 0; +} +.tag-input-style + .chosen-container-multi .chosen-choices li.search-choice .search-choice-close { + position: absolute; + top: 0; + bottom: 0; + right: 0; + width: 18px; + height: auto; + line-height: 25px; + text-align: center; +} +.tag-input-style + .chosen-container-multi .chosen-choices li.search-choice .search-choice-close:before { + color: #FFF; + position: static; + font-size: 11px; +} +.tag-input-style + .chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover { + background-color: rgba(0, 0, 0, 0.2); +} +.tag-input-style + .chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover:before { + color: #FFF; +} +.tag-input-style + .chosen-container-multi.chosen-rtl .chosen-choices li.search-choice { + padding: 6px 9px 7px 22px; + margin-left: 0; + margin-right: 3px !important; +} +.tag-input-style + .chosen-container-multi.chosen-rtl .chosen-choices li.search-choice .search-choice-close { + right: auto; + left: 0; +} +.select2-container .select2-choice { + border-radius: 0; + height: 32px; + line-height: 28px; +} +.select2-container.select2-drop-above .select2-choice { + border-radius: 0; +} +.select2-container[class*="input-"] { + max-width: none; +} +.select2-container.input-mini { + min-width: 100px; +} +.select2-container .select2-choice abbr, +.select2-search-choice-close { + background: none; +} +.select2-container .select2-choice abbr:before, +.select2-search-choice-close:before { + font-family: FontAwesome; + font-size: 12px; + display: inline; + content: "\f00d"; + color: #888; + position: relative; + top: -1px; +} +.select2-container .select2-choice abbr:hover:before, +.select2-search-choice-close:hover:before { + color: #555; +} +.select2-container .select2-choice abbr:before { + top: -7px; +} +.select2-search-choice-close:hover { + text-decoration: none !important; +} +.select2-drop { + border-radius: 0; + border: 1px solid #4492C9; + border-width: 0 1px 3px; +} +.select2-drop.select2-drop-above { + border-radius: 0; +} +.select2-container .select2-choice { + background: #FAFAFA none; +} +.select2-container-active .select2-choice, +.select2-container-active .select2-choices, +.select2-dropdown-open.select2-drop-above .select2-choice, +.select2-dropdown-open.select2-drop-above .select2-choices, +.select2-container-multi.select2-container-active .select2-choices { + border-color: #4492C9; +} +.select2-results .select2-highlighted { + background: #316AC5; +} +.select2-container .select2-choice .select2-arrow { + border-radius: 0; + background: transparent none; + border: none; +} +.select2-container .select2-choice .select2-arrow b { + background: none; +} +.select2-container .select2-choice .select2-arrow b:before { + font-family: FontAwesome; + font-size: 12px; + display: inline; + content: "\f0d7"; + color: #888; + position: relative; + left: 5px; +} +.select2-dropdown-open .select2-choice .select2-arrow b:before { + content: "\f0d8"; +} +.select2-search .select2-input { + background: #fff none; + margin-top: 4px; +} +.select2-search:after { + font-family: FontAwesome; + font-size: 14px; + display: inline; + content: "\f002"; + color: #777; + position: relative; + top: 0; + left: -20px; + z-index: 0; +} +.select2-dropdown-open.select2-drop-above .select2-choice, +.select2-dropdown-open.select2-drop-above .select2-choices { + background-image: none; + background-color: #F6F6F6; +} +.select2-container-multi .select2-choices .select2-search-field input { + border: none !important; + -webkit-box-shadow: none !important; + box-shadow: none !important; + background: none !important; + font-size: 14px; +} +.select2-container-multi .select2-choices .select2-search-choice { + line-height: 16px; + padding-bottom: 4px; +} +.select2-container-active .select2-choice, +.select2-container-active .select2-choices, +.select2-container-multi.select2-container-active .select2-choices, +.select2-dropdown-open.select2-drop-above .select2-choice, +.select2-dropdown-open.select2-drop-above .select2-choices { + -webkit-box-shadow: none; + box-shadow: none; +} +.select2-search input.select2-active { + background-color: #FFF; + position: relative; + z-index: 1; +} +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 144dpi) { + .select2-search input, + .select2-search-choice-close, + .select2-container .select2-choice abbr, + .select2-container .select2-choice div b { + background-image: none !important; + background-size: auto !important; + } + .select2-search input { + background-position: auto !important; + } +} +.select2-container-active.select2-dropdown-open .select2-choice { + background-image: -webkit-linear-gradient(top, #eeeeee 0%, #ffffff 100%); + background-image: -o-linear-gradient(top, #eeeeee 0%, #ffffff 100%); + background-image: linear-gradient(to bottom, #eeeeee 0%, #ffffff 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffeeeeee', endColorstr='#ffffffff', GradientType=0); +} +.select2-container-active.select2-drop-above .select2-choice { + background-image: -webkit-linear-gradient(top, #ffffff 0%, #eeeeee 100%); + background-image: -o-linear-gradient(top, #ffffff 0%, #eeeeee 100%); + background-image: linear-gradient(to bottom, #ffffff 0%, #eeeeee 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffeeeeee', GradientType=0); +} +.form-group.has-error .select2-choice, +.form-group.has-error .select2-choices { + border-color: #f2a696 !important; +} +.form-group.has-info .select2-choice, +.form-group.has-info .select2-choices { + border-color: #72aec2 !important; +} +.form-group.has-warning .select2-choice, +.form-group.has-warning .select2-choices { + border-color: #e3c94c !important; +} +.form-group.has-success .select2-choice, +.form-group.has-success .select2-choices { + border-color: #9cc573 !important; +} +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 144dpi) { + .select2-search input, + .select2-search-choice-close, + .select2-container .select2-choice abbr, + .select2-container .select2-choice .select2-arrow b { + background-image: none !important; + background-repeat: no-repeat !important; + background-size: auto !important; + } + .select2-search input { + background-position: auto !important; + } +} +.select2-container-multi.tag-input-style .select2-choices .select2-search-choice { + background-image: none; + background-color: #91b8d0; + color: #FFFFFF; + display: inline-block; + font-size: 13px; + font-weight: normal; + margin-bottom: 3px; + margin-right: 0; + padding: 6px 22px 7px 9px; + position: relative; + text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.15); + transition: all 0.2s ease 0s; + vertical-align: baseline; + white-space: nowrap; + border: none; + -webkit-box-shadow: none; + box-shadow: none; + border-radius: 0; +} +.select2-container-multi.tag-input-style .select2-choices .select2-search-choice .select2-search-choice-close { + position: absolute; + top: 0; + bottom: 0; + right: 0; + left: auto; + width: 18px; + height: auto; + line-height: 25px; + text-align: center; +} +.select2-container-multi.tag-input-style .select2-choices .select2-search-choice .select2-search-choice-close:before { + color: #FFF; + position: static; + font-size: 11px; +} +.select2-container-multi.tag-input-style .select2-choices .select2-search-choice .select2-search-choice-close:hover { + background-color: rgba(0, 0, 0, 0.2); +} +.select2-container-multi.tag-input-style .select2-choices .select2-search-choice .select2-search-choice-close:hover:before { + color: #FFF; +} +#colorbox:focus, +#colorbox:active { + outline: none; +} +#cboxTopLeft, +#cboxTopCenter, +#cboxTopRight, +#cboxMiddleLeft, +#cboxMiddleRight, +#cboxBottomLeft, +#cboxBottomCenter, +#cboxBottomRight { + background: none !important; + opacity: 0; +} +#cboxContent { + border: 12px solid #000; + background-color: #FFF; + padding: 7px; +} +#cboxOverlay { + background: rgba(0, 0, 0, 0.95); + background: #000; +} +#cboxCurrent { + left: 64px; + margin-bottom: 4px; + font-size: 14px; +} +#cboxTitle { + margin-bottom: 4px; + font-size: 14px; + color: #777; +} +#cboxNext, +#cboxPrevious, +#cboxClose { + background: none; + text-indent: 0; + width: 26px; + height: 26px; + line-height: 22px; + padding: 0 4px; + text-align: center; + border: 2px solid #999; + border-radius: 16px; + color: #666; + font-size: 12px; + margin-left: 5px; + margin-bottom: 5px; +} +#cboxNext:hover, +#cboxPrevious:hover { + color: #333; + border-color: #666; +} +#cboxContent { + overflow: visible; +} +#cboxClose { + background-color: #000; + border: 2px solid #FFF; + border-radius: 32px; + color: #FFF; + font-size: 21px; + height: 28px; + width: 28px; + padding-bottom: 2px; + margin-left: 0; + right: -14px; + top: -14px; +} +#cboxLoadingOverlay { + background: none !important; +} +#cboxLoadingGraphic { + background: #FFF none !important; + text-align: center; +} +#cboxLoadingGraphic > .ace-icon { + display: inline-block; + background-color: #FFF; + border-radius: 8px; + width: 32px; + height: 32px; + position: relative; + top: 48%; + text-align: center; + vertical-align: middle; + font-size: 24px; + color: #FE7E3E; +} +.ace-spinner { + display: inline-block; +} +.ace-spinner .spinbox-buttons.btn-group-vertical { + min-width: 18px; +} +.ace-spinner .spinbox-buttons.btn-group-vertical > .btn { + font-size: 10px; + padding: 0; + width: 22px; + height: 16px; + line-height: 8px; + margin-left: 0; +} +.ace-spinner .spinbox-buttons.btn-group-vertical > .btn:first-child { + margin-top: 0; +} +.ace-spinner .spinbox-buttons.btn-group-vertical > .btn > .ace-icon { + margin: 0; + padding: 0; +} +.ace-spinner .spinbox-buttons.btn-group-vertical > .btn + .btn { + margin-top: 2px; +} +.ace-spinner .spinbox-buttons.btn-group-vertical > .btn-xs { + height: 14px; + line-height: 7px; +} +.ace-spinner .spinbox-buttons.btn-group-vertical > .btn-lg { + height: 22px; + line-height: 10px; + width: 22px; +} +.ace-spinner .spinbox-buttons > button.btn.spinbox-up:active { + top: -1px; +} +.ace-spinner:not(.touch-spinner) .spinbox-buttons > .btn > .ace-icon { + margin-top: -1px; +} +.ace-spinner.touch-spinner .spinbox-buttons { + margin: 0; + font-size: 0; +} +.ace-spinner.touch-spinner .spinbox-buttons .btn-sm { + width: 32px; +} +.ace-spinner.touch-spinner .spinbox-buttons .btn-xs { + width: 24px; +} +.ace-spinner.touch-spinner .spinbox-buttons .btn-lg { + width: 40px; +} +.ace-spinner.touch-spinner .spinbox-buttons > .btn { + margin: 0 1px !important; +} +.ace-spinner.touch-spinner .spinbox-buttons > .btn-xs { + padding-top: 3px; + padding-bottom: 3px; +} +.ace-spinner.touch-spinner .spinbox-buttons > .btn > .ace-icon { + vertical-align: middle; + display: inline-block; +} +.steps { + list-style: none; + display: table; + width: 100%; + padding: 0; + margin: 0; + position: relative; +} +.steps li { + display: table-cell; + text-align: center; + width: 1%; +} +.steps li .step { + border: 5px solid #ced1d6; + color: #546474; + font-size: 15px; + border-radius: 100%; + background-color: #FFF; + position: relative; + z-index: 2; + display: inline-block; + width: 40px; + height: 40px; + line-height: 30px; + text-align: center; +} +.steps li:before { + display: block; + content: ""; + width: 100%; + height: 1px; + font-size: 0; + overflow: hidden; + border-top: 4px solid #CED1D6; + position: relative; + top: 21px; + z-index: 1; +} +.steps li.last-child:before { + max-width: 50%; + width: 50%; +} +.steps li:last-child:before { + max-width: 50%; + width: 50%; +} +.steps li:first-child:before { + max-width: 51%; + left: 50%; +} +.steps li.active:before, +.steps li.complete:before, +.steps li.active .step, +.steps li.complete .step { + border-color: #5293c4; +} +.steps li.complete .step { + cursor: default; + color: #FFF; + -webkit-transition: transform ease 0.1s; + -o-transition: transform ease 0.1s; + transition: transform ease 0.1s; +} +.steps li.complete .step:before { + display: block; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + line-height: 30px; + text-align: center; + border-radius: 100%; + content: "\f00c"; + background-color: #FFF; + z-index: 3; + font-family: FontAwesome; + font-size: 17px; + color: #87ba21; +} +.steps li.complete:hover .step { + -moz-transform: scale(1.1); + -webkit-transform: scale(1.1); + -o-transform: scale(1.1); + -ms-transform: scale(1.1); + transform: scale(1.1); + border-color: #80afd4; +} +.steps li.complete:hover:before { + border-color: #80afd4; +} +.steps li .title { + display: block; + margin-top: 4px; + max-width: 100%; + color: #949ea7; + font-size: 14px; + z-index: 104; + text-align: center; + table-layout: fixed; + word-wrap: break-word; +} +.steps li.complete .title, +.steps li.active .title { + color: #2b3d53; +} +.step-content { + position: relative; +} +.step-content .step-pane { + display: none; + min-height: 200px; + padding: 4px 8px 12px; +} +.step-content .step-pane.active { + display: block; +} +.wizard-actions { + text-align: right; +} +@media only screen and (max-width: 767px) { + .steps li .step { + width: 30px; + height: 30px; + line-height: 24px; + border-width: 3px; + } + .steps li:before, + .steps li:after { + border-width: 3px; + } + .steps li.complete .step:before { + line-height: 24px; + font-size: 13px; + } + .steps li:before { + top: 16px; + } + .step-content .step-pane { + padding: 4px 4px 6px; + min-height: 150px; + } +} +.tree { + margin: auto; + padding: 0 0 0 9px; + overflow-x: hidden; + overflow-y: auto; + position: relative; +} +.tree:before { + display: inline-block; + content: ""; + position: absolute; + top: -20px; + bottom: 16px; + left: 0; + z-index: 1; + border: 1px dotted #67b2dd; + border-width: 0 0 0 1px; +} +.tree .tree-branch-name, +.tree .tree-item-name { + cursor: pointer; +} +.tree .tree-branch { + width: auto; + min-height: 20px; + cursor: pointer; +} +.tree .tree-branch .tree-branch-header { + position: relative; + height: 20px; + line-height: 20px; +} +.tree .tree-branch .tree-branch-header:hover { + background-color: #F0F7FC; +} +.tree .tree-branch .tree-branch-header .tree-branch-name, +.tree .tree-item .tree-item-name { + display: inline; + z-index: 2; +} +.tree .tree-branch .tree-branch-header > .tree-branch-name > .ace-icon:first-child, +.tree .tree-item > .tree-item-name > .ace-icon:first-child { + display: inline-block; + position: relative; + z-index: 2; + top: -1px; +} +.tree .tree-branch > .tree-branch-header > .tree-branch-name > .tree-label { + margin-left: 2px; +} +.tree .tree-branch > .tree-branch-header > .tree-branch-name > .ace-icon:first-child { + margin: -2px 0 0 -2px; +} +.tree .tree-branch:last-child:after { + display: inline-block; + content: ""; + position: absolute; + z-index: 1; + top: 15px; + bottom: 0; + left: -15px; + border-left: 1px solid #FFF; +} +.tree .tree-branch .tree-branch-children { + margin: 0 0 0 23px; + padding: 0; + position: relative; +} +.tree .tree-branch .tree-branch-children:before { + display: inline-block; + content: ""; + position: absolute; + z-index: 1; + top: -14px; + bottom: 16px; + left: -14px; + border: 1px dotted #67b2dd; + border-width: 0 0 0 1px; +} +.tree .tree-item { + position: relative; + height: 20px; + line-height: 20px; + cursor: pointer; +} +.tree .tree-item:hover { + background-color: #F0F7FC; +} +.tree .tree-item > .tree-item-name > .ace-icon:first-child { + margin-right: 3px; +} +.tree .tree-item > .tree-item-name > .tree-label > .ace-icon:first-child { + margin-left: 3px; + margin-right: 3px; +} +.tree .tree-item > .ace-icon:first-child { + margin-top: -1px; +} +.tree .tree-branch, +.tree .tree-item { + position: relative; + list-style: none; +} +.tree .tree-branch:before, +.tree .tree-item:before { + display: inline-block; + content: ""; + position: absolute; + top: 14px; + left: -13px; + width: 18px; + height: 0; + border-top: 1px dotted #67b2dd; + z-index: 1; +} +.tree .tree-selected { + background-color: rgba(98, 168, 209, 0.1); + color: #6398B0; +} +.tree .tree-selected:hover { + background-color: rgba(98, 168, 209, 0.1); +} +.tree .tree-item, +.tree .tree-branch { + border: 1px solid #FFF; +} +.tree .tree-branch .tree-branch-header { + border-radius: 0; +} +.tree .tree-item, +.tree .tree-branch .tree-branch-header { + margin: 0; + padding: 5px; + color: #4D6878; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} +.tree .tree-item > .tree-item-name > .ace-icon:first-child { + color: #F9E8CE; + width: 13px; + height: 13px; + line-height: 13px; + font-size: 11px; + text-align: center; + border-radius: 3px; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + background-color: #FAFAFA; + border: 1px solid #CCC; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); +} +.tree .tree-selected > .tree-item-name > .ace-icon:first-child { + background-color: #F9A021; + border-color: #F9A021; + color: #FFF; +} +.tree .tree-plus.ace-icon:first-child, +.tree .tree-minus.ace-icon:first-child { + display: inline-block; + font-style: normal; + border: 1px solid #DDD; + vertical-align: middle; + height: 11px; + width: 11px; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + text-align: center; + border: 1px solid #8BAEBF; + line-height: 10px; + background-color: #FFF; + position: relative; + z-index: 2; +} +.tree .tree-plus.ace-icon:first-child:before, +.tree .tree-minus.ace-icon:first-child:before { + content: ""; + display: block; + width: 7px; + height: 0; + border-top: 1px solid #4D6878; + position: absolute; + top: 5px; + left: 2px; +} +.tree .tree-plus.ace-icon:first-child:after { + content: ""; + display: block; + height: 7px; + width: 0; + border-left: 1px solid #4D6878; + position: absolute; + top: 2px; + left: 5px; +} +.tree .tree-unselectable .tree-item > .tree-item-name > .tree-label > .ace-icon:first-child { + color: #5084A0; + width: 13px; + height: 13px; + line-height: 13px; + font-size: 10px; + text-align: center; + border-radius: 0; + background-color: transparent; + border: none; + box-shadow: none; +} +.tree .ace-icon[class*="-down"] { + transform: rotate(-45deg); +} +.tree .ace-icon[class*="-download"] { + transform: none; +} +.tree .fa-spin { + height: auto; +} +.tree .tree-loading { + margin-left: 36px; +} +.tree img { + display: inline; + veritcal-align: middle; +} +.gritter-item-wrapper { + background-image: none !important; + box-shadow: 0 2px 10px rgba(50, 50, 50, 0.5); + background: rgba(50, 50, 50, 0.92); +} +.gritter-item-wrapper.gritter-info { + background: rgba(49, 81, 133, 0.92); +} +.gritter-item-wrapper.gritter-error { + background: rgba(153, 40, 18, 0.92); +} +.gritter-item-wrapper.gritter-success { + background: rgba(89, 131, 75, 0.92); +} +.gritter-item-wrapper.gritter-warning { + background: rgba(190, 112, 31, 0.92); +} +.gritter-item-wrapper.gritter-light { + background: rgba(245, 245, 245, 0.95); + border: 1px solid #BBB; +} +.gritter-item-wrapper.gritter-light.gritter-info { + background: rgba(232, 242, 255, 0.95); +} +.gritter-item-wrapper.gritter-light.gritter-info .gritter-item { + color: #4A577D; +} +.gritter-item-wrapper.gritter-light.gritter-error { + background: rgba(255, 235, 235, 0.95); +} +.gritter-item-wrapper.gritter-light.gritter-error .gritter-item { + color: #894A38; +} +.gritter-item-wrapper.gritter-light.gritter-success { + background: rgba(239, 250, 227, 0.95); +} +.gritter-item-wrapper.gritter-light.gritter-success .gritter-item { + color: #416131; +} +.gritter-item-wrapper.gritter-light.gritter-warning { + background: rgba(252, 248, 227, 0.95); +} +.gritter-item-wrapper.gritter-light.gritter-warning .gritter-item { + color: #946446; +} +.gritter-item p { + line-height: 1.8; +} +.gritter-top, +.gritter-bottom, +.gritter-item { + background-image: none; +} +.gritter-close { + left: auto; + right: 3px; + background-image: none; + width: 18px; + height: 18px; + line-height: 17px; + text-align: center; + border: 2px solid transparent; + border-radius: 16px; + color: #E17B67; +} +.gritter-close:before { + font-family: FontAwesome; + font-size: 16px; + content: "\f00d"; +} +.gritter-info .gritter-close { + color: #FFA500; +} +.gritter-error .gritter-close, +.gritter-success .gritter-close, +.gritter-warning .gritter-close { + color: #FFEA07; +} +.gritter-close:hover { + color: #FFF !important; +} +.gritter-title { + text-shadow: none; +} +.gritter-light .gritter-item, +.gritter-light .gritter-bottom, +.gritter-light .gritter-top, +.gritter-light .gritter-close { + background-image: none; + color: #444; +} +.gritter-light .gritter-title { + text-shadow: none; +} +.gritter-light .gritter-close:hover { + color: #8A3104 !important; +} +.gritter-center { + position: fixed; + left: 33%; + right: 33%; + top: 33%; +} +@media only screen and (max-width: 767px) { + .gritter-center { + left: 16%; + right: 16%; + top: 30%; + } +} +@media only screen and (max-width: 480px) { + .gritter-center { + left: 30px; + right: 30px; + } +} +@media only screen and (max-width: 320px) { + .gritter-center { + left: 10px; + right: 10px; + } +} +.wysiwyg-editor { + max-height: 250px; + height: 250px; + background-color: #F7F8FA; + border-collapse: separate; + border: 1px solid #BBC0CA; + padding: 4px; + box-sizing: content-box; + overflow-y: scroll; + overflow-x: hidden; + outline: none; +} +.wysiwyg-editor:focus { + background-color: #FFF; +} +.wysiwyg-toolbar { + line-height: 33px; + margin: 0 !important; + position: relative; +} +.wysiwyg-toolbar .dropdown-menu { + text-align: left; +} +.wysiwyg-toolbar .btn-group { + float: none !important; + font-size: 0; +} +.wysiwyg-toolbar .btn-group > .btn { + float: none; + padding-left: 0; + padding-right: 0; + text-align: center; + margin-left: 1px; + /** + &.active:after { + border-color: transparent; + border-style: solid; + border-top-color: inherit; + border-width: 6px 14px; + bottom: -13px; + left: 0; + right: 0; + } + */ +} +.wysiwyg-toolbar .btn-group > .btn > .ace-icon:first-child { + font-size: 14px; + width: 25px; + max-width: 25px; + display: inline-block; + border-width: 1px !important; +} +.wysiwyg-toolbar .btn-group > .btn.dropdown-toggle > .ace-icon:last-child { + margin-right: 4px; +} +.wysiwyg-style1 .btn-group > .btn, +.wysiwyg-style2 .btn-group > .btn, +.wysiwyg-style1 .btn-group > .inline > .btn, +.wysiwyg-style2 .btn-group > .inline > .btn { + margin: 0 !important; + background: #FFF !important; + border-width: 0 !important; + color: #ADB3BE !important; + text-shadow: none !important; +} +.wysiwyg-style1 .btn-group > .btn.active, +.wysiwyg-style2 .btn-group > .btn.active, +.wysiwyg-style1 .btn-group > .inline > .btn.active, +.wysiwyg-style2 .btn-group > .inline > .btn.active { + color: #5B80CE !important; +} +.wysiwyg-style1 .btn-group > .btn.active:after, +.wysiwyg-style2 .btn-group > .btn.active:after, +.wysiwyg-style1 .btn-group > .inline > .btn.active:after, +.wysiwyg-style2 .btn-group > .inline > .btn.active:after { + display: none; +} +.wysiwyg-style1 .btn-group, +.wysiwyg-style2 .btn-group { + position: relative; +} +.wysiwyg-style1 .btn-group:after, +.wysiwyg-style2 .btn-group:after { + display: block; + content: ""; + position: absolute; + left: -2px; + top: 6px; + bottom: 6px; + width: 0; + max-width: 0; + border-left: 1px solid #E1E6EA; +} +.wysiwyg-style1 .btn-group:first-child:after, +.wysiwyg-style2 .btn-group:first-child:after { + display: none; +} +.wysiwyg-style2 { + background-color: #E5E5E5; +} +.wysiwyg-style2 + .wysiwyg-editor { + border-color: #DDD; + background-color: #FFF; + border-top: none; +} +.wysiwyg-style2 .btn-group > .btn, +.wysiwyg-style2 .btn-group > .inline > .btn { + margin: 0 1px 0 0 !important; + background: #FFF !important; + border: none !important; + color: #8D939E !important; + text-shadow: none !important; +} +.wysiwyg-style2 .btn-group > .btn.active, +.wysiwyg-style2 .btn-group > .inline > .btn.active { + color: #FFF !important; + background: #6AAEDF !important; +} +.wysiwyg-style2 .btn-group:after { + display: none; +} +.wysiwyg-toolbar .btn-colorpicker { + width: 24px; + height: 24px; + position: relative; + background: #87B87F; + /* Old browsers */ + background: -moz-linear-gradient(top, #cf3e73 10%, #ffffff 20%, #2283c5 30%, #ffffff 40%, #87b87f 50%, #ffffff 60%, #ffb752 70%, #ffffff 80%, #d15b47 90%, #ffffff 100%); + /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(10%, #cf3e73), color-stop(20%, #ffffff), color-stop(30%, #2283c5), color-stop(40%, #ffffff), color-stop(50%, #87b87f), color-stop(60%, #ffffff), color-stop(70%, #ffb752), color-stop(80%, #ffffff), color-stop(90%, #d15b47), color-stop(100%, #ffffff)); + /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #cf3e73 10%, #ffffff 20%, #2283c5 30%, #ffffff 40%, #87b87f 50%, #ffffff 60%, #ffb752 70%, #ffffff 80%, #d15b47 90%, #ffffff 100%); + /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #cf3e73 10%, #ffffff 20%, #2283c5 30%, #ffffff 40%, #87b87f 50%, #ffffff 60%, #ffb752 70%, #ffffff 80%, #d15b47 90%, #ffffff 100%); + /* Opera11.10+ */ + background: -ms-linear-gradient(top, #cf3e73 10%, #ffffff 20%, #2283c5 30%, #ffffff 40%, #87b87f 50%, #ffffff 60%, #ffb752 70%, #ffffff 80%, #d15b47 90%, #ffffff 100%); + /* IE10+ */ + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#CF3E73', endColorstr='#FFB752', GradientType=0); + /* IE6-9 */ + background: linear-gradient(top, #cf3e73 10%, #ffffff 20%, #2283c5 30%, #ffffff 40%, #87b87f 50%, #ffffff 60%, #ffb752 70%, #ffffff 80%, #d15b47 90%, #ffffff 100%); + /* W3C */ +} +.wysiwyg-toolbar .dropdown-colorpicker > .dropdown-menu { + top: auto; +} +.wysiwyg-toolbar input[type=file] { + position: fixed; + z-index: -10; + opacity: 0; + max-width: 0; + max-height: 0; + display: block; +} +.wysiwyg-toolbar .wysiwyg-choose-file { + display: inline-block; + width: auto; + margin: 4px auto 0; + padding-left: 5px; + padding-right: 5px; +} +.wysiwyg-toolbar .dropdown-menu input[type=text] { + margin-left: 8px; + margin-bottom: 0; +} +.wysiwyg-toolbar .dropdown-menu input[type=text].form-control { + min-width: 150px; +} +.wysiwyg-toolbar .dropdown-menu .btn { + margin-right: 8px; + margin-left: 8px; +} +.wysiwyg-style1 .btn-colorpicker { + width: 20px; + height: 20px; + margin-left: 4px; +} +@media screen and (-webkit-min-device-pixel-ratio: 0) { + /* for adding image resize functionality in chrome and safari */ + .wysiwyg-editor img { + display: inline !important; + } + .wysiwyg-editor .ui-wrapper { + border: 1px dotted #D00; + overflow: visible !important; + /* because it's image only, so it's ok */ + display: inline-block !important; + vertical-align: middle; + } + .wysiwyg-editor .ui-wrapper:after { + content: ""; + display: block; + position: absolute; + right: -3px; + bottom: -3px; + width: 7px; + height: 7px; + border: 1px solid #D00; + background-color: #FFF; + z-index: 1; + } +} +/* inside widget */ +.widget-header .wysiwyg-toolbar { + background-color: transparent; +} +.widget-header .wysiwyg-toolbar .btn-group > .btn, +.widget-header .wysiwyg-toolbar .btn-group > .inline > .btn { + border-color: transparent; + background: rgba(255, 255, 255, 0.25) !important; + color: #FFF !important; + min-width: 32px; + border-width: 1px !important; + border-radius: 4px !important; + padding: 2px 1px 4px; +} +.widget-header .wysiwyg-toolbar .btn-group > .btn.active, +.widget-header .wysiwyg-toolbar .btn-group > .inline > .btn.active { + background: rgba(0, 0, 0, 0.25) !important; +} +.widget-body .wysiwyg-editor { + border-width: 0; +} +.wysiwyg-speech-input { + width: 20px !important; + color: transparent !important; + background: transparent none !important; + border-width: 0 !important; + -moz-transform: scale(2.0, 2.0); + -webkit-transform: scale(2.0, 2.0); + -o-transform: scale(2.0, 2.0); + -ms-transform: scale(2.0, 2.0); + transform: scale(2.0, 2.0); + -webkit-box-shadow: none !important; + box-shadow: none !important; + position: absolute; + right: 0; + top: -10px; + cursor: pointer; +} +.wysiwyg-speech-input:focus { + -webkit-box-shadow: none !important; + box-shadow: none !important; +} +.widget-body .md-header { + margin-top: -30px; + margin-left: 9px; +} +.widget-body .md-header .btn { + border-color: transparent; + background: rgba(255, 255, 255, 0.25) !important; + color: #FFF !important; + text-align: center; + min-width: 32px; + border-width: 1px !important; + border-radius: 4px !important; + padding: 2px 4px 4px; +} +.widget-body .md-header .btn > .ace-icon { + font-size: 14px; + width: 25px; + max-width: 25px; + display: inline-block; +} +.widget-body .md-header .btn-inverse { + background: rgba(0, 0, 0, 0.25) !important; + padding-right: 5px; + margin-left: 4px; +} +.md-fullscreen-controls { + display: none; +} +.widget-body .md-preview { + padding: 8px; + min-height: 200px; +} +.widget-body .md-input { + border: none !important; + box-shadow: none !important; + display: block; + margin-bottom: 0; + background-color: rgba(48, 126, 204, 0.07); + padding: 8px; + width: 100%; +} +.widget-body .md-input:focus { + background-color: #FFF; + box-shadow: none !important; +} +.editable-container .popover-title { + color: #438EB9; +} +.editable-click { + border-bottom: 1px dashed #BBB; + cursor: pointer; + font-weight: normal; +} +img.editable-click { + border: 1px dotted #BBB; +} +.editable-click:hover { + border-color: #0088CC; + color: #0088CC; +} +img.editable-click:hover { + opacity: 0.75; + filter: alpha(opacity=75); +} +.editable-buttons, +.editable-input { + display: inline-block; +} +.editable-buttons { + margin-left: 1px; +} +.editable-buttons .btn { + padding: 0; + width: 28px; + line-height: 24px; + border-width: 3px; + font-size: 12px; + margin: 0 1px 0 0; +} +.editable-buttons .btn > .ace-icon { + margin: 0; +} +.editable-clear-x { + cursor: pointer; + color: #888; + background: none; +} +.editable-clear-x:hover { + color: #D15B47; +} +.editable-clear-x:before { + display: inline-block; + content: "\f057"; + font-family: FontAwesome; + font-size: 15px; + position: absolute; + margin-top: -9px; + width: 16px; + height: 30px; + line-height: 30px; + text-align: center; +} +.editable-input .ace-spinner { + margin-right: 8px; +} +.editable-input .ace-spinner .spinner-input { + width: 100%; +} +.editable-inline .editable-slider { + margin-top: 10px; + margin-right: 4px; +} +.editable-popup .editable-slider { + display: block; + margin-bottom: 16px; + margin-top: 4px; +} +.editable-slider input[type=text] { + display: none; +} +.editable-slider input[type=range] { + outline: none !important; +} +.editable-input .ace-file-input { + display: block; +} +.editable-image .ace-file-multiple .ace-file-container.selected { + border-color: transparent; +} +.editable-image + .editable-buttons, +.editable-wysiwyg + .editable-buttons { + display: block; + text-align: center; + margin-top: 8px; +} +.editable-wysiwyg { + width: 95%; +} +.editable-wysiwyg .wysiwyg-editor { + height: auto; + overflow-y: hidden; +} +.editableform .input-append.dropdown-menu { + display: none; +} +.editableform .open .input-append.dropdown-menu { + display: block; +} +.editable-container .editableform { + margin-bottom: 10px; +} +.editable-inline .editableform { + margin-bottom: 0; +} +.editableform .control-group { + display: block; +} +.editableform-loading { + background: none; +} +.editableform-loading .ace-icon, +.editableform-loading .progress { + position: relative; + top: 35%; +} +.input-group.date .input-group-addon { + cursor: pointer; +} +.datepicker td, +.daterangepicker td, +.datepicker th, +.daterangepicker th { + border-radius: 0 !important; + font-size: 13px; +} +.datepicker td.active, +.daterangepicker td.active, +.datepicker td.active:hover, +.daterangepicker td.active:hover { + background: #2283c5 !important; +} +.datepicker td.active.disabled, +.daterangepicker td.active.disabled, +.datepicker td.active.disabled:hover, +.daterangepicker td.active.disabled:hover { + background: #8b9aa3 !important; +} +.datepicker td, +.datepicker th { + min-width: 32px; +} +.datepicker-dropdown.datepicker-orient-bottom:after, +.datepicker-dropdown.datepicker-orient-bottom:before { + top: auto; +} +.daterangepicker .calendar-date { + border-radius: 0; +} +.datepicker-months .month, +.datepicker-years .year { + border-radius: 0 !important; +} +.datepicker-months .month.active, +.datepicker-years .year.active, +.datepicker-months .month.active:hover, +.datepicker-years .year.active:hover, +.datepicker-months .month.active:focus, +.datepicker-years .year.active:focus, +.datepicker-months .month.active:active, +.datepicker-years .year.active:active { + background-image: none !important; + background-color: #2283c5 !important; +} +.bootstrap-timepicker-widget table td input { + width: 32px; +} +.well .datepicker table tr td.day:hover { + background-color: #7d8893; + color: #FFF; +} +.bootstrap-timepicker-widget table td a:hover { + border-radius: 0; +} +.daterangepicker.opensleft:before, +.daterangepicker.opensright:before { + -moz-border-bottom-colors: rgba(0, 0, 0, 0.2); +} +.daterangepicker.opensleft:after, +.daterangepicker.opensright:after { + -moz-border-bottom-colors: #fff; +} +.datepicker-dropdown:before { + -moz-border-bottom-colors: rgba(0, 0, 0, 0.2); +} +.datepicker-dropdown:after { + -moz-border-bottom-colors: #fff; +} +.datepicker-dropdown.datepicker-orient-bottom:before { + -moz-border-top-colors: #999; +} +.datepicker-dropdown.datepicker-orient-bottom:after { + -moz-border-top-colors: #FFF; +} +.bootstrap-timepicker-widget.dropdown-menu:before { + -moz-border-bottom-colors: rgba(0, 0, 0, 0.2); +} +.bootstrap-timepicker-widget.dropdown-menu:after { + -moz-border-bottom-colors: #FFF; +} +.bootstrap-timepicker-widget.timepicker-orient-bottom:before { + -moz-border-top-colors: #999; +} +.bootstrap-timepicker-widget.timepicker-orient-bottom:after { + -moz-border-top-colors: #FFF; +} +.bootstrap-datetimepicker-widget [class=btn] { + border-width: 0 !important; + background-color: transparent !important; + color: #7399b8 !important; + text-shadow: none !important; +} +.bootstrap-datetimepicker-widget [class=btn]:hover { + color: #1B6AAA !important; +} +.bootstrap-datetimepicker-widget .btn.btn-primary { + border-width: 3px !important; +} +.bootstrap-datetimepicker-widget .picker-switch { + margin-bottom: 2px; +} +.bootstrap-datetimepicker-widget .picker-switch .btn { + width: 90% !important; + background-color: #EEE !important; + color: #478fca !important; + font-size: 16px; +} +.bootstrap-datetimepicker-widget .picker-switch .btn:hover { + background-color: #e3edf5 !important; +} +.bootstrap-datetimepicker-widget td span { + border-radius: 0; +} +.bootstrap-datetimepicker-widget .timepicker-hour, +.bootstrap-datetimepicker-widget .timepicker-minute, +.bootstrap-datetimepicker-widget .timepicker-second { + color: #555 !important; +} +.ui-slider { + background-color: #D5D5D5; +} +.ui-slider-horizontal { + height: 9px; +} +.ui-slider-vertical { + width: 9px; +} +.ui-slider .ui-slider-handle { + border-radius: 0; + width: 1.45em; + height: 1.45em; + background-color: #F8F8F8; + border: 1px solid; +} +.ui-slider .ui-slider-handle:before, +.ui-slider .ui-slider-handle:after { + display: block; + content: ""; + position: absolute; + top: 4px; + left: 5px; + width: 4px; + height: 8px; + border: 1px solid; + border-width: 0 1px; + border-color: inherit; +} +.ui-slider .ui-slider-handle:after { + left: 8px; + border-width: 0 1px 0 0; +} +.ui-slider .ui-slider-handle:hover { + background-color: #FFF; +} +.ui-slider .ui-slider-handle:hover, +.ui-slider .ui-slider-handle:focus, +.ui-slider .ui-slider-handle:active { + outline: none; + -webkit-box-shadow: 1px 1px 1px 0px rgba(0,0,0,.3); + box-shadow: 1px 1px 1px 0px rgba(0,0,0,.3); +} +.ui-slider-horizontal .ui-slider-handle { + margin-left: -0.725em; + top: -0.4em; +} +.ui-slider-vertical .ui-slider-handle { + left: -0.35em; + margin-bottom: -0.65em; +} +.ui-slider-small.ui-slider-horizontal { + height: 5px; +} +.ui-slider-small.ui-slider-vertical { + width: 5px; +} +.ui-slider-small .ui-slider-handle { + border-radius: 100%; + width: 17px; + height: 17px; + margin-bottom: -0.45em; + left: -0.35em; +} +.ui-slider-small .ui-slider-handle:before, +.ui-slider-small .ui-slider-handle:after { + height: 7px; + left: 5px; + width: 3px; +} +.ui-slider-small .ui-slider-handle:after { + left: 7px; +} +.ui-slider-simple .ui-slider-handle:after, +.ui-slider-simple .ui-slider-handle:before { + display: none; +} +/* colors */ +.ui-slider-range { + background-color: #4aa4ce; +} +.ui-slider-handle { + outline: none !important; + border-color: #4aa4ce !important; +} +.ui-state-disabled.ui-slider { + background-color: #E5E5E5; +} +.ui-state-disabled .ui-slider-range { + background-color: #8daebe; +} +.ui-state-disabled .ui-slider-handle { + -webkit-box-shadow: none !important; + box-shadow: none !important; + border-color: #8daebe !important; +} +.ui-slider-green .ui-slider-range { + background-color: #8bbc67; +} +.ui-slider-green .ui-slider-handle { + border-color: #8bbc67 !important; +} +.ui-slider-green.ui-state-disabled .ui-slider-range { + background-color: #aab0a6; +} +.ui-slider-green.ui-state-disabled .ui-slider-handle { + border-color: #aab0a6 !important; +} +.ui-slider-red .ui-slider-range { + background-color: #d36e6e; +} +.ui-slider-red .ui-slider-handle { + border-color: #d36e6e !important; +} +.ui-slider-red.ui-state-disabled .ui-slider-range { + background-color: #c8acac; +} +.ui-slider-red.ui-state-disabled .ui-slider-handle { + border-color: #c8acac !important; +} +.ui-slider-purple .ui-slider-range { + background-color: #ac68ba; +} +.ui-slider-purple .ui-slider-handle { + border-color: #ac68ba !important; +} +.ui-slider-purple.ui-state-disabled .ui-slider-range { + background-color: #ada7ae; +} +.ui-slider-purple.ui-state-disabled .ui-slider-handle { + border-color: #ada7ae !important; +} +.ui-slider-orange .ui-slider-range { + background-color: #efad62; +} +.ui-slider-orange .ui-slider-handle { + border-color: #efad62 !important; +} +.ui-slider-orange.ui-state-disabled .ui-slider-range { + background-color: #e0c4a4; +} +.ui-slider-orange.ui-state-disabled .ui-slider-handle { + border-color: #e0c4a4 !important; +} +.ui-slider-dark .ui-slider-range { + background-color: #606060; +} +.ui-slider-dark .ui-slider-handle { + border-color: #606060 !important; +} +.ui-slider-dark.ui-state-disabled .ui-slider-range { + background-color: #7a7a7a; +} +.ui-slider-dark.ui-state-disabled .ui-slider-handle { + border-color: #7a7a7a !important; +} +.ui-slider-pink .ui-slider-range { + background-color: #d6487e; +} +.ui-slider-pink .ui-slider-handle { + border-color: #d6487e !important; +} +.ui-slider-pink.ui-state-disabled .ui-slider-range { + background-color: #c38ea2; +} +.ui-slider-pink.ui-state-disabled .ui-slider-handle { + border-color: #c38ea2 !important; +} +.ui-datepicker { + background-color: #FFF; + border: 1px solid rgba(0, 0, 0, 0.2); + -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); +} +.ui-datepicker .ui-datepicker-prev, +.ui-datepicker .ui-datepicker-next { + height: 26px; + min-width: 32px; + max-width: 32px; + text-align: center; + cursor: pointer; + color: transparent; + line-height: 26px; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} +.ui-datepicker .ui-datepicker-prev .ui-icon, +.ui-datepicker .ui-datepicker-next .ui-icon { + color: transparent; + visibility: hidden; +} +.ui-datepicker .ui-datepicker-prev:hover, +.ui-datepicker .ui-datepicker-next:hover { + background-color: #EEE; + text-decoration: none; +} +.ui-datepicker .ui-datepicker-prev:before, +.ui-datepicker .ui-datepicker-next:before { + display: inline; + font-family: FontAwesome; + font-size: 14px; + content: "\f060"; + color: #393939; +} +.ui-datepicker .ui-datepicker-prev-hover, +.ui-datepicker .ui-datepicker-next-hover { + top: 2px; +} +.ui-datepicker .ui-datepicker-next:before { + content: "\f061"; +} +.ui-datepicker .ui-datepicker-prev-hover { + left: 2px; +} +.ui-datepicker .ui-datepicker-next-hover { + right: 2px; +} +.ui-datepicker td { + padding: 0; +} +.ui-datepicker td > a, +.ui-datepicker td > span { + display: inline-block; + height: 22px; + min-width: 24px; + max-width: 24px; + text-align: center; + color: #393939; + font-size: 13px; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} +.ui-datepicker td > a:hover { + background-color: #EEE; +} +.ui-datepicker td > a.ui-state-highlight { + background-color: #D5E5EF; +} +.ui-datepicker td > a.ui-state-active { + background-color: #2283c5; + color: #FFF; +} +.ui-datepicker td > a.ui-priority-secondary { + color: #888; +} +.ui-datepicker td > span { + color: #999; +} +.ui-datepicker td .ui-datepicker-title select { + height: 24px; + line-height: 24px; + padding: 2px 3px; +} +.ui-datepicker td .ui-datepicker-buttonpane { + background-color: #DDD; + height: 1px; +} +/* dialog */ +.ui-widget-overlay { + background: rgba(0, 0, 0, 0.25); + opacity: 1 !important; + filter: alpha(opacity=100) !important; + z-index: 1039 !important; +} +.ui-dialog, +.ui-jqdialog { + z-index: 1040 !important; + background-color: #FFF; + padding: 0; + border: 1px solid #DDD; + -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); +} +.ui-dialog .ui-dialog-titlebar, +.ui-jqdialog .ui-dialog-titlebar, +.ui-dialog .ui-jqdialog-titlebar, +.ui-jqdialog .ui-jqdialog-titlebar { + background-color: #F1F1F1; + font-size: 16px; + color: #669fc7; + padding: 0; +} +.ui-dialog .ui-dialog-title, +.ui-jqdialog .ui-dialog-title, +.ui-dialog .ui-jqdialog-title, +.ui-jqdialog .ui-jqdialog-title { + float: none !important; + width: auto; +} +.ui-dialog .widget-header, +.ui-jqdialog .widget-header { + margin: 0; + border-width: 0 0 1px 0; +} +.ui-dialog .ui-dialog-buttonpane, +.ui-jqdialog .ui-dialog-buttonpane, +.ui-dialog .ui-jqdialog-buttonpane, +.ui-jqdialog .ui-jqdialog-buttonpane { + background-color: #eff3f8; + border-top: 1px solid #e4e9ee; +} +.ui-dialog .ui-dialog-buttonpane button, +.ui-jqdialog .ui-dialog-buttonpane button, +.ui-dialog .ui-jqdialog-buttonpane button, +.ui-jqdialog .ui-jqdialog-buttonpane button { + font-size: 14px; +} +.ui-dialog .ui-dialog-titlebar-close, +.ui-jqdialog .ui-dialog-titlebar-close, +.ui-dialog .ui-jqdialog-titlebar-close, +.ui-jqdialog .ui-jqdialog-titlebar-close { + border: none; + background: transparent; + opacity: 0.4; + color: #d15b47; + padding: 0; + top: 50%; + right: 8px !important; + text-align: center; +} +.ui-dialog .ui-dialog-titlebar-close:before, +.ui-jqdialog .ui-dialog-titlebar-close:before, +.ui-dialog .ui-jqdialog-titlebar-close:before, +.ui-jqdialog .ui-jqdialog-titlebar-close:before { + content: "\f00d"; + display: inline; + font-family: FontAwesome; + font-size: 16px; +} +.ui-dialog .ui-dialog-titlebar-close:hover, +.ui-jqdialog .ui-dialog-titlebar-close:hover, +.ui-dialog .ui-jqdialog-titlebar-close:hover, +.ui-jqdialog .ui-jqdialog-titlebar-close:hover { + opacity: 1; + text-decoration: none; + padding: 0; +} +.ui-dialog .ui-dialog-titlebar-close .ui-button-text, +.ui-jqdialog .ui-dialog-titlebar-close .ui-button-text, +.ui-dialog .ui-jqdialog-titlebar-close .ui-button-text, +.ui-jqdialog .ui-jqdialog-titlebar-close .ui-button-text { + text-indent: 0; + visibility: hidden; +} +.ui-dialog .widget-header .ui-dialog-titlebar-close, +.ui-jqdialog .widget-header .ui-dialog-titlebar-close, +.ui-dialog .widget-header .ui-jqdialog-titlebar-close, +.ui-jqdialog .widget-header .ui-jqdialog-titlebar-close { + right: 10px !important; +} +/* accordion */ +.ui-accordion .ui-accordion-header { + color: #478fca; + font-weight: normal; + background-color: #F9F9F9; + border: 1px solid #cdd8e3; + padding: 8px 8px 9px 24px; +} +.ui-accordion .ui-accordion-header:hover { + color: #6ea6cc; + background-color: #f1f8fd; +} +.ui-accordion .ui-accordion-header.ui-state-active { + color: #4c8fbd; + background-color: #eef4f9; + position: relative; + font-weight: bold; +} +.ui-accordion .ui-accordion-header .ui-accordion-header-icon { + text-indent: 0; + margin-top: 0; + position: absolute; + left: 10px; + top: 7px; +} +.ui-accordion .ui-accordion-header .ui-accordion-header-icon:before { + display: inline; + font-family: FontAwesome; + font-size: 15px; + content: "\f0da"; +} +.ui-accordion .ui-accordion-header.ui-state-active .ui-accordion-header-icon:before { + content: "\f0d7"; + font-weight: normal; +} +.ui-accordion .ui-accordion-content { + border: 1px solid #cdd8e3; + border-top-width: 0; + padding: 11px 16px; +} +/* tabs */ +.ui-tabs .ui-tabs-nav { + padding: 0; + border-bottom: 1px solid #C5D0DC; +} +.ui-tabs .ui-tabs-nav li.ui-state-default > a { + background-color: #F9F9F9; + border: 1px solid #C5D0DC; + border-bottom-width: 0; + color: #999; + line-height: 16px; + margin-right: -1px; + z-index: 11; + padding: 8px 12px; + position: relative; + top: 2px; +} +.ui-tabs .ui-tabs-nav li > a:focus { + outline: none; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active > a { + background-color: #FFF; + border: 1px solid; + border-color: #4C8FBD #C5D0DC transparent; + border-top-width: 2px; + -webkit-box-shadow: 0 -2px 3px 0 rgba(0, 0, 0, 0.15); + box-shadow: 0 -2px 3px 0 rgba(0, 0, 0, 0.15); + color: #576373; + position: relative; + top: 1px; +} +.ui-tabs .ui-tabs-panel { + border: 1px solid #C5D0DC; + border-top-width: 0; + margin: 0; + left: auto; + right: auto; + top: auto; + bottom: auto; +} +/* menu */ +.ui-menu { + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + width: 150px; + -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); + background-color: #FFF; + border: 1px solid rgba(0, 0, 0, 0.2); + padding: 3px; +} +.ui-menu .ui-state-focus, +.ui-menu .ui-state-active { + margin: auto; +} +.ui-menu .ui-menu-item { + padding: 5px 10px 6px; + color: #444; + cursor: pointer; + display: block; + -webkit-box-sizing: inherit; + -moz-box-sizing: inherit; + box-sizing: inherit; +} +.ui-menu .ui-menu-item .ui-menu-icon { + float: right; + position: relative; + left: auto; + right: 4px; + bottom: auto; + text-indent: 0; +} +.ui-menu .ui-menu-item .ui-menu-icon:before { + content: "\f105"; + font-family: FontAwesome; + font-size: 14px; + display: inline; +} +.ui-menu .ui-menu-item:hover, +.ui-menu .ui-state-focus, +.ui-menu .ui-state-active, +.ui-menu .ui-menu-item:hover > .ui-menu-icon, +.ui-menu .ui-state-focus > .ui-menu-icon, +.ui-menu .ui-state-active > .ui-menu-icon { + text-decoration: none; + background-color: #4f99c6; + color: #FFF; + margin: auto; + font-weight: normal; +} +.ui-menu .ui-menu-item:hover .ui-menu-icon, +.ui-menu .ui-state-focus .ui-menu-icon, +.ui-menu .ui-state-active .ui-menu-icon, +.ui-menu .ui-menu-item:hover > .ui-menu-icon .ui-menu-icon, +.ui-menu .ui-state-focus > .ui-menu-icon .ui-menu-icon, +.ui-menu .ui-state-active > .ui-menu-icon .ui-menu-icon { + color: #FFF; +} +.ui-menu .ui-state-disabled, +.ui-menu .ui-state-disabled .ui-menu-icon { + color: #999; + cursor: default; +} +.ui-menu .ui-state-disabled:hover, +.ui-menu .ui-state-disabled.ui-state-focus, +.ui-menu .ui-state-disabled.ui-state-active, +.ui-menu .ui-state-disabled:hover .ui-menu-icon, +.ui-menu .ui-state-disabled.ui-state-focus .ui-menu-icon, +.ui-menu .ui-state-disabled.ui-state-active .ui-menu-icon { + background-color: #FFF; + color: #999; +} +/* auto complete */ +.ui-autocomplete { + background-color: #FFF; + border: 1px solid rgba(0, 0, 0, 0.2); + -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); +} +.ui-autocomplete-category { + padding: 6px; + position: relative; + background-color: #eef4f9; + color: #478fca; + font-weight: bolder; + border: 1px solid #DAE6ED; + border-width: 1px 0; +} +.ui-spinner-button { + border-width: 0 !important; + font-size: 10px; + height: 16px; + line-height: 16px; + width: 18px; + color: #FFFFFF !important; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25) !important; + display: inline-block; + position: absolute; + text-align: center; + padding: 0; +} +.ui-spinner-button > .ace-icon { + width: 18px; + display: inline-block; +} +.ui-spinner-up { + top: 0; + right: 5px; +} +.ui-spinner-down { + bottom: 3px; + right: 5px; +} +.ui-spinner-input { + margin-top: 0; + padding: 5px; + max-width: 100px; + font-size: 14px; +} +.ui-tooltip { + background-color: #444; + color: #FFF; +} +.ui-progressbar { + background-color: #f5f5f5; + height: 22px; +} +.ui-progressbar .ui-progressbar-value { + margin: 0; +} +.ui-progressbar .ui-progressbar-value[class="progress-bar"] { + background-color: #2a91d8; +} +.ui-selectmenu-button { + border: 1px solid #aaa; +} +.ui-selectmenu-button[aria-expanded=true] { + border-color: #4492C9; +} +.ui-selectmenu-button span.ui-icon { + text-indent: 0; + margin-top: -10px; +} +.ui-selectmenu-button .ui-icon:before { + content: "\f0d7"; + display: inline-block; + color: #888; + font-family: FontAwesome; + font-size: 14px; +} +.ui-jqgrid .ui-jqgrid-view, +.ui-jqgrid .ui-paging-info, +.ui-jqgrid .ui-pg-table, +.ui-jqgrid .ui-pg-selbox { + font-size: 13px; +} +.ui-jqgrid .ui-jqgrid-title { + float: left; + margin: 8px; +} +.ui-jqgrid .ui-jqgrid-title-rtl { + float: right; + margin: 8px; +} +.ui-jqgrid-view > .ui-jqgrid-titlebar { + height: 40px; + line-height: 24px; + color: #FFF; + background: #307ecc; + padding: 0; + font-size: 15px; +} +.ui-jqgrid tr.jqgrow.ui-row-rtl td:last-child { + border-right: none; + border-left: 1px solid #E1E1E1; +} +.ui-jqgrid .ui-jqgrid-hdiv { + background-color: #eff3f8; + border: 1px solid #D3D3D3; + border-width: 1px 0 0 1px; + line-height: 15px; + font-weight: bold; + color: #777; + text-shadow: none; +} +.ui-jqgrid .ui-jqgrid-htable thead { + background-color: #eff3f8; +} +.ui-jqgrid .ui-jqgrid-htable th span.ui-jqgrid-resize { + height: 45px !important; +} +.ui-jqgrid .ui-jqgrid-htable th div { + padding-top: 12px; + padding-bottom: 12px; +} +.ui-jqgrid-hdiv .ui-jqgrid-htable { + border-top: none; +} +.ui-jqgrid-hdiv .ui-jqgrid-htable { + border-top: 1px solid #E1E1E1; +} +.ui-jqgrid-titlebar { + position: relative; + top: 1px; + z-index: 1; +} +.ui-jqgrid tr.jqgrow, +.ui-jqgrid tr.ui-row-ltr, +.ui-jqgrid tr.ui-row-rtl { + border: none; +} +.ui-jqgrid tr.ui-row-ltr td, +.ui-jqgrid tr.ui-row-rtl td { + border-bottom: 1px solid #E1E1E1; + padding: 6px 4px; + border-color: #E1E1E1; +} +.ui-jqgrid tr.ui-state-highlight.ui-row-ltr td { + border-right-color: #C7D3A9; +} +.ui-jqgrid tr.ui-state-highlight.ui-row-rtl td { + border-left-color: #C7D3A9; +} +.ui-jqgrid-btable .ui-widget-content.ui-priority-secondary { + background-image: none; + background-color: #F9F9F9; + opacity: 1; +} +.ui-jqgrid-btable .ui-widget-content.ui-state-hover { + background-image: none; + background-color: #EFF4F7; + opacity: 1; +} +.ui-jqgrid-btable .ui-widget-content.ui-state-highlight { + background-color: #E4EFC9; +} +.ui-jqgrid .ui-jqgrid-pager { + line-height: 15px; + height: 55px; + padding-top: 3px !important; + padding-bottom: 5px !important; + background-color: #eff3f8 !important; + border-bottom: 1px solid #E1E1E1 !important; + border-top: 1px solid #E1E1E1 !important; +} +.ui-jqgrid .ui-pg-input { + font-size: inherit; + width: 24px; + height: 20px; + line-height: 16px; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + text-align: center; + padding-top: 1px; + padding-bottom: 1px; +} +.ui-jqgrid .ui-pg-selbox { + display: block; + height: 24px; + width: 60px; + margin: 0; + padding: 1px; + line-height: normal; +} +.ui-jqgrid .ui-jqgrid-htable th div { + overflow: visible; +} +.ui-jqgrid .ui-pager-control { + height: 50px; + position: relative; + padding-left: 9px; + padding-right: 9px; +} +.ui-jqgrid .ui-jqgrid-toppager { + height: auto !important; + background-color: #eff3f8; + border-bottom: 1px solid #E1E1E1 !important; +} +.ui-jqgrid .jqgrow .editable { + max-width: 90%; + max-width: calc(92%) !important; +} +.ui-pg-table .navtable .ui-corner-all { + border-radius: 0; +} +.ui-jqgrid .ui-pg-button:hover { + padding: 1px; +} +.ui-jqgrid .ui-pg-button .ui-separator { + margin-left: 4px; + margin-right: 4px; + border-color: #C9D4DB; +} +.ui-jqgrid .ui-jqgrid-btable { + border-left: 1px solid #E1E1E1; +} +.ui-jqgrid .ui-jqgrid-bdiv { + border-top: 1px solid #E1E1E1; +} +.ui-jqgrid .loading { + position: absolute; + top: 45%; + left: 45%; + width: auto; + height: auto; + z-index: 101; + padding: 6px; + margin: 5px; + text-align: center; + font-weight: bold; + font-size: 12px; + background-color: #FFF; + border: 2px solid #8EB8D1; + color: #E2B018; +} +.ui-jqgrid .ui-search-toolbar { + border-top: 1px solid #E1E1E1; +} +.ui-jqgrid .ui-jqgrid-labels { + border-bottom: none; + background: #F2F2F2; + background-image: -webkit-linear-gradient(top, #f8f8f8 0%, #ececec 100%); + background-image: -o-linear-gradient(top, #f8f8f8 0%, #ececec 100%); + background-image: linear-gradient(to bottom, #f8f8f8 0%, #ececec 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff8f8f8', endColorstr='#ffececec', GradientType=0); + padding: 0 !important; + border-left: 1px solid #E1E1E1 !important; +} +.ui-jqgrid .ui-jqgrid-labels th { + border-right: 1px solid #E1E1E1 !important; + text-align: left !important; +} +/* checkbox container */ +.ui-jqgrid-labels th[id*="_cb"]:first-child > div { + padding-top: 0; + text-align: center !important; +} +.ui-jqgrid-sortable { + padding-left: 4px; + font-size: 13px; + color: #777; + font-weight: bold; +} +.ui-jqgrid-sortable:hover { + color: #547ea8; +} +th[aria-selected=true] { + background-image: -webkit-linear-gradient(top, #eff3f8 0%, #e3e7ed 100%); + background-image: -o-linear-gradient(top, #eff3f8 0%, #e3e7ed 100%); + background-image: linear-gradient(to bottom, #eff3f8 0%, #e3e7ed 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffeff3f8', endColorstr='#ffe3e7ed', GradientType=0); +} +th[aria-selected=true] .ui-jqgrid-sortable { + color: #307ecc; +} +.ui-jqgrid .ui-icon { + text-indent: 0; + color: #307ecc; + float: none; + right: 2px; +} +.rtl .ui-jqgrid .ui-icon { + right: auto; + left: 2px; +} +.ui-jqgrid .ui-icon.ui-state-disabled { + color: #BBB; +} +.ui-jqgrid .ui-icon.ui-state-disabled:hover { + padding: 0; +} +.ui-grid-ico-sort:before { + display: inline; + content: "\f0d7"; + font-family: FontAwesome; + font-size: 12px; +} +.ui-icon-asc:before { + content: "\f0d8"; +} +.ui-pg-table > tbody > tr > .ui-pg-button > .ui-icon { + display: inline-block; + padding: 0; + width: 24px; + height: 24px; + line-height: 22px; + text-align: center; + position: static; + float: none; + margin: 0 2px !important; + color: #808080; + border: 1px solid #CCC; + background-color: #FFF; + border-radius: 100%; +} +.ui-pg-table > tbody > tr > .ui-pg-button > .ui-icon:hover { + color: #699AB5; + border-color: #699AB5; +} +.ui-pg-table > tbody > tr > .ui-pg-button > .ui-icon:before { + width: 20px; + text-align: center; + display: inline-block; +} +.ui-pg-table > tbody > tr > .ui-pg-button.ui-state-disabled .ui-icon { + color: #B0B0B0; + background-color: #F7F7F7; + border-color: #DDD; + -moz-transform: scale(0.9); + -webkit-transform: scale(0.9); + -o-transform: scale(0.9); + -ms-transform: scale(0.9); + transform: scale(0.9); +} +.ui-jqgrid-btable input, +.ui-jqgrid-btable textarea, +.ui-jqgrid-btable select { + padding: 2px; + width: auto; + max-width: 100%; + margin-bottom: 0; +} +.ui-jqgrid-btable select { + padding: 1px; + height: 25px; + line-height: 25px; +} +.ui-pg-div .ui-icon { + display: inline-block; + width: 18px; + float: none; + position: static; + text-align: center; + opacity: 0.85; + -webkit-transition: all 0.12s; + -o-transition: all 0.12s; + transition: all 0.12s; + margin: 0 1px; + vertical-align: middle; + cursor: pointer; + font-size: 17px; +} +.ui-pg-div .ui-icon:hover { + -moz-transform: scale(1.2); + -webkit-transform: scale(1.2); + -o-transform: scale(1.2); + -ms-transform: scale(1.2); + transform: scale(1.2); + opacity: 1; + position: static; + margin: 0 1px; +} +.ui-pg-div .ui-icon:before { + font-family: FontAwesome; + display: inline; +} +.ui-jqgrid .ui-icon-pencil { + color: #478FCA; +} +.ui-jqgrid .ui-icon-pencil:before { + content: "\f040"; +} +.ui-jqgrid .ui-icon-trash { + color: #DD5A43; +} +.ui-jqgrid .ui-icon-trash:before { + content: "\f014"; +} +.ui-jqgrid .ui-icon-disk { + color: #69AA46; +} +.ui-jqgrid .ui-icon-disk:before { + content: "\f00c"; +} +.ui-jqgrid .ui-icon-cancel { + color: #DD5A43; +} +.ui-jqgrid .ui-icon-cancel:before { + content: "\f00d"; +} +.ui-jqdialog-content, +.ui-jqdialog .ui-jqdialog-content { + font-size: 13px; + padding: 4px 0 0; +} +.ui-jqdialog-content .formdata, +.ui-jqdialog .ui-jqdialog-content .formdata { + font-size: 13px; + padding: 6px 12px; +} +.ui-jqdialog-content .form-view-data, +.ui-jqdialog .ui-jqdialog-content .form-view-data { + vertical-align: middle; + font-size: 13px; +} +.ui-jqdialog-content[id*="alertcnt_"], +.ui-jqdialog .ui-jqdialog-content[id*="alertcnt_"] { + padding: 8px 11px; +} +.ui-jqdialog-content .CaptionTD { + font-size: 12px; + text-align: right; + color: #666; +} +.ui-jqdialog-content .FormData { + border-bottom: 1px dotted #E8E8E8; +} +.ui-jqdialog-content .FormData:last-child { + border-bottom: none; +} +.ui-jqdialog-content .FormData > td { + padding-top: 6px; + padding-bottom: 6px; +} +.ui-jqdialog-content input.FormElement { + width: auto; +} +.ui-jqdialog-content select.FormElement { + padding: 1px; + height: 25px; + line-height: 25px; + width: auto; +} +.ui-jqdialog-content td.EditButton { + padding: 8px; +} +.EditTable { + background-color: #eff3f8; + border-top: 1px solid #D6E1EA !important; + padding: 8px; +} +.EditTable tr:first-child { + display: none; +} +.EditTable .navButton .fm-button { + float: none !important; + width: auto !important; + margin: 1px 1px 2px !important; + background-color: transparent; + border-radius: 100%; +} +.EditTable .navButton .fm-button:hover { + background-color: transparent; +} +.EditTable .navButton .fm-button:focus { + outline: none; +} +.EditTable .navButton .fm-button .ace-icon { + display: inline-block; + color: #999; + border: 1px solid #AAA; + width: 26px; + height: 26px; + line-height: 26px; + text-align: center; + border-radius: 100%; + background-color: #FFF; +} +.EditTable .navButton .fm-button:hover .ace-icon { + color: #699AB5; + border-color: #699AB5; +} +.EditTable .navButton .fm-button.ui-state-disabled .ace-icon, +.EditTable .navButton .fm-button.ui-state-disabled:hover .ace-icon { + color: #BBB; + border-color: #CCC; + -moz-transform: scale(0.88); + -webkit-transform: scale(0.88); + -o-transform: scale(0.88); + -ms-transform: scale(0.88); + transform: scale(0.88); +} +.FormGrid .EditTable { + background-color: #FFF; + border-top: none !important; + padding: 0; +} +.FormGrid .EditTable tr:first-child { + display: none; +} +.ui-jqgrid .ui-jqgrid-view input, +.ui-jqgrid .ui-jqgrid-view select, +.ui-jqgrid .ui-jqgrid-view textarea, +.ui-jqgrid .ui-jqgrid-view button { + font-size: 13px; +} +.ui-jqdialog-content .searchFilter select { + padding: 1px; + height: 26px; + line-height: 26px; + width: auto; + max-width: 95%; + margin-bottom: 0; +} +.ui-jqdialog-content .searchFilter .input-elm { + margin-bottom: 0; + height: 18px; + line-height: 18px; + width: 95% !important; + padding-left: 1px; + padding-right: 1px; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} +.ui-jqdialog-content .searchFilter table { + margin-left: 4px; +} +.ui-jqdialog-content .searchFilter tr td { + padding: 5px 0; +} +.ui-jqdialog-content .searchFilter .add-group, +.ui-jqdialog-content .searchFilter .add-rule, +.ui-jqdialog-content .searchFilter .delete-group { + margin-left: 4px !important; + font-size: 15px !important; +} +.ui-jqdialog-content .searchFilter .delete-rule { + border: none; + background-color: #FFF; + color: #D15B47; + font-size: 20px; + width: 22px; + line-height: 10px; + padding: 0; + text-shadow: none !important; + display: inline-block; + -webkit-transition: all 0.1s; + -o-transition: all 0.1s; + transition: all 0.1s; + opacity: 0.85; +} +.ui-jqdialog-content .searchFilter .delete-rule:hover { + -moz-transform: scale(1.1); + -webkit-transform: scale(1.1); + -o-transform: scale(1.1); + -ms-transform: scale(1.1); + transform: scale(1.1); + color: #B74635; + opacity: 1; +} +.ui-jqdialog-content .searchFilter .queryresult { + margin-bottom: 11px; +} +.ui-jqdialog-content .searchFilter .queryresult td.query { + padding: 6px 11px; + border: 1px solid #E1E1E1; + background-color: #EEEEEE; +} +.ui-jqdialog-content .searchFilter .queryresult td.query:empty { + display: none; +} +.ui-state-error { + background-color: #f2dede; + border: 1px solid #ebccd1; + color: #a94442; + margin: 4px 4px 8px; + padding: 6px 10px; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); + font-size: 13px; +} +.ui-jqdialog .ui-widget-header { + background-image: -webkit-linear-gradient(top, #ffffff 0%, #eeeeee 100%); + background-image: -o-linear-gradient(top, #ffffff 0%, #eeeeee 100%); + background-image: linear-gradient(to bottom, #ffffff 0%, #eeeeee 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffeeeeee', GradientType=0); + border-image: none; + border-bottom: 1px solid solid; + color: #669FC7; + min-height: 38px; + position: relative; +} +.ui-jqdialog .ui-widget-header .ui-jqdialog-title { + line-height: 38px; + margin: 0; + padding: 0; + padding-left: 12px; + text-align: left; +} +.widget-header .ui-jqdialog-title { + padding-left: 0 !important; + padding-right: 0 !important; +} +.ui-jqdialog .ui-widget-header .widget-header { + border-bottom: none; +} +.ui-jqdialog .ui-jqdialog-titlebar { + border-bottom: 1px solid #DDD !important; +} +.fm-button { + margin: 0 4px; +} +.fm-button:not(.btn) { + background-color: #abbac3; + border-radius: 0 ; + box-shadow: none; + color: #FFFFFF ; + cursor: pointer; + display: inline-block; + font-size: 13px; + line-height: 28px; + padding: 0 12px 1px; + margin: 0 8px; + position: relative; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + -webkit-transition: all 0.15s; + -o-transition: all 0.15s; + transition: all 0.15s; + vertical-align: middle; +} +.fm-button.ui-state-default:hover { + background-color: #8b9aa3; +} +.ui-jqgrid .ui-jqgrid-htable .ui-search-toolbar th { + height: 30px; + padding-top: 2px; + white-space: normal; +} +.ui-jqgrid .ui-jqgrid-htable .ui-search-toolbar th div { + padding-top: 0; + padding-bottom: 0; + height: 30px; + line-height: 26px; +} +.ui-jqgrid .ui-jqgrid-titlebar-close { + top: 10%; + height: auto; + padding: 0; + margin: 2px 8px 0 0; + text-align: center; + border-radius: 4px; +} +.ui-jqgrid .ui-jqgrid-titlebar-close:hover { + background-color: rgba(255, 255, 255, 0.2); +} +.ui-jqgrid .ui-jqgrid-titlebar-close .ui-icon:before { + display: inline-block; + font-family: FontAwesome; + content: "\f077"; + color: #FFF; +} +.ui-jqgrid .ui-jqgrid-titlebar-close .ui-icon-circle-triangle-s:before { + content: "\f078"; +} +.ui-jqgrid .tree-wrap-ltr { + margin: 0 4px; + float: none; + display: inline; +} +.ui-jqgrid .tree-wrap-rtl { + margin: 2px 4px 0; +} +.ui-jqgrid .ui-subgrid { + border-bottom: 1px solid #E1E1E1; + background-color: #F6FAFF; +} +.ui-jqgrid .ui-subgrid .ui-jqgrid-btable { + background-color: #FFF; +} +.ui-jqgrid .ui-subgrid .ui-jqgrid .ui-jqgrid-hdiv { + background-color: transparent; + margin-top: 4px; +} +.ui-jqgrid .ui-subgrid .ui-jqgrid .ui-jqgrid-hdiv .ui-jqgrid-htable .ui-jqgrid-labels { + border-bottom: 1px solid #E1E1E1; + background: #F1F1F1; +} +.ui-jqgrid .ui-subgrid .ui-jqgrid .ui-jqgrid-hdiv .ui-jqgrid-htable th[aria-selected="true"] { + background: #E5E9EF; +} +.ui-jqgrid .ui-subgrid .ui-jqgrid .ui-jqgrid-hdiv .ui-jqgrid-htable th .ui-jqgrid-sortable { + font-size: 12px; +} +.ui-jqgrid .ui-subgrid .ui-jqgrid .ui-jqgrid-hdiv .ui-jqgrid-htable th div { + padding-top: 8px; + padding-bottom: 8px; +} +.ui-jqgrid .ui-subgrid .ui-jqgrid .ui-jqgrid-hdiv .ui-jqgrid-htable th span.ui-jqgrid-resize { + height: 36px !important; +} +.ui-jqgrid .ui-subgrid .ui-jqgrid .ui-jqgrid-bdiv { + height: auto !important; + max-height: 150px; + margin-bottom: 4px; + border-top-width: 0; + border-bottom: 1px solid #E1E1E1; +} +.ui-jqgrid .ui-sgcollapsed > a:hover { + text-decoration: none; +} +@media only screen and (max-width: 767px) { + .ui-jqgrid .ui-jqgrid-pager { + height: 90px; + } + .ui-jqgrid .ui-jqgrid-pager > .ui-pager-control { + height: 85px; + padding-top: 9px; + } + .ui-jqgrid .ui-jqgrid-pager > .ui-pager-control > .ui-pg-table > tbody > tr > td { + vertical-align: top; + } + .ui-jqgrid .ui-jqgrid-pager > .ui-pager-control > .ui-pg-table > tbody > tr > td#grid-pager_center { + width: 0 !important; + position: static; + } + .ui-jqgrid .ui-jqgrid-pager > .ui-pager-control > .ui-pg-table > tbody > tr > td#grid-pager_center > .ui-pg-table { + margin: 36px auto 0; + position: absolute; + right: 0; + left: 0; + text-align: center; + } +} +@media only screen and (max-width: 767px) and (-webkit-min-device-pixel-ratio: 0) { + .ui-jqgrid .ui-jqgrid-pager > .ui-pager-control > .ui-pg-table > tbody > tr > td#grid-pager_center > .ui-pg-table { + width: 300px; + } +} +.dd { + position: relative; + display: block; + margin: 0; + padding: 0; + max-width: 600px; + list-style: none; + line-height: 20px; +} +.dd-list { + display: block; + position: relative; + margin: 0; + padding: 0; + list-style: none; +} +.dd-list .dd-list { + padding-left: 30px; +} +.dd-collapsed .dd-list { + display: none; +} +.dd-item, +.dd-empty, +.dd-placeholder { + display: block; + position: relative; + margin: 0; + padding: 0; + min-height: 20px; + line-height: 20px; +} +.dd-handle, +.dd2-content { + display: block; + min-height: 38px; + margin: 5px 0; + padding: 8px 12px; + background: #F8FAFF; + border: 1px solid #DAE2EA; + color: #7C9EB2; + text-decoration: none; + font-weight: bold; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.dd-handle:hover, +.dd2-content:hover { + color: #438EB9; + background: #F4F6F7; + border-color: #DCE2E8; +} +.dd-handle[class*="btn-"], +.dd2-content[class*="btn-"] { + color: #FFF; + border: none; + padding: 9px 12px; +} +.dd-handle[class*="btn-"]:hover, +.dd2-content[class*="btn-"]:hover { + opacity: 0.85; + color: #FFF; +} +.dd2-handle + .dd2-content, +.dd2-handle + .dd2-content[class*="btn-"] { + padding-left: 44px; +} +.dd-handle[class*="btn-"]:hover, +.dd2-content[class*="btn-"] .dd2-handle[class*="btn-"]:hover + .dd2-content[class*="btn-"] { + color: #FFF; +} +.dd-item > button:hover ~ .dd-handle, +.dd-item > button:hover ~ .dd2-content { + color: #438EB9; + background: #F4F6F7; + border-color: #DCE2E8; +} +.dd-item > button:hover ~ .dd-handle[class*="btn-"], +.dd-item > button:hover ~ .dd2-content[class*="btn-"] { + opacity: 0.85; + color: #FFF; +} +.dd2-handle:hover ~ .dd2-content { + color: #438EB9; + background: #F4F6F7; + border-color: #DCE2E8; +} +.dd2-handle:hover ~ .dd2-content[class*="btn-"] { + opacity: 0.85; + color: #FFF; +} +.dd2-item.dd-item > button { + margin-left: 34px; +} +.dd-item > button { + display: block; + position: relative; + z-index: 1; + cursor: pointer; + float: left; + width: 25px; + height: 20px; + margin: 5px 1px 5px 5px; + padding: 0; + text-indent: 100%; + white-space: nowrap; + overflow: hidden; + border: 0; + background: transparent; + font-size: 12px; + line-height: 1; + text-align: center; + font-weight: bold; + top: 4px; + left: 1px; + color: #707070; +} +.dd-item > button:before { + font-family: FontAwesome; + content: '\f067'; + display: block; + position: absolute; + width: 100%; + text-align: center; + text-indent: 0; + font-weight: normal; + font-size: 14px; +} +.dd-item > button[data-action="collapse"]:before { + content: '\f068'; +} +.dd-item > button:hover { + color: #707070; +} +.dd-item.dd-colored > button, +.dd-item.dd-colored > button:hover { + color: #EEE; +} +.dd-placeholder, +.dd-empty { + margin: 5px 0; + padding: 0; + min-height: 30px; + background: #F0F9FF; + border: 2px dashed #BED2DB; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.dd-empty { + border-color: #AAA; + border-style: solid; + background-color: #e5e5e5; +} +.dd-dragel { + position: absolute; + pointer-events: none; + z-index: 999; + opacity: 0.8; +} +.dd-dragel > li > .dd-handle { + color: #4B92BE; + background: #F1F5FA; + border-color: #D6E1EA; + border-left: 2px solid #777; + position: relative; +} +.dd-dragel > li > .dd-handle[class*="btn-"] { + color: #FFF; +} +.dd-dragel > .dd-item > .dd-handle { + margin-top: 0; +} +.dd-list > li[class*="item-"] { + border-width: 0; + padding: 0; +} +.dd-list > li[class*="item-"] > .dd-handle { + border-left: 2px solid; + border-left-color: inherit; +} +.dd-list > li > .dd-handle .sticker { + position: absolute; + right: 0; + top: 0; +} +.dd2-handle, +.dd-dragel > li > .dd2-handle { + left: 0; + top: 0; + width: 36px; + margin: 0; + border-width: 1px 1px 0 0; + text-align: center; + padding: 0 !important; + line-height: 38px; + height: 38px; + background: #EBEDF2; + border: 1px solid #DEE4EA; + cursor: pointer; + overflow: hidden; + position: absolute; + z-index: 1; +} +.dd2-handle:hover, +.dd-dragel > li > .dd2-handle { + background: #E3E8ED; +} +.dd2-content[class*="btn-"] { + text-shadow: none !important; +} +.dd2-handle[class*="btn-"] { + text-shadow: none !important; + background: rgba(0, 0, 0, 0.1) !important; + border-right: 1px solid #EEE; +} +.dd2-handle[class*="btn-"]:hover { + background: rgba(0, 0, 0, 0.08) !important; +} +.dd-dragel .dd2-handle[class*="btn-"] { + border-color: transparent; + border-right-color: #EEE; +} +.dd2-handle.btn-yellow { + text-shadow: none !important; + background: rgba(0, 0, 0, 0.05) !important; + border-right: 1px solid #FFF; +} +.dd2-handle.btn-yellow:hover { + background: rgba(0, 0, 0, 0.08) !important; +} +.dd-dragel .dd2-handle.btn-yellow { + border-color: transparent; + border-right-color: #FFF; +} +.dd-item > .dd2-handle .drag-icon { + display: none; +} +.dd-dragel > .dd-item > .dd2-handle .drag-icon { + display: inline; +} +.dd-dragel > .dd-item > .dd2-handle .normal-icon { + display: none; +} +.dropzone { + border-radius: 0; + border: 1px solid rgba(0, 0, 0, 0.06); +} +.dropzone .dz-default.dz-message { + background-image: none; + font-size: 24px; + text-align: center; + line-height: 32px; + left: 0; + width: 100%; + margin-left: auto; +} +.dropzone .dz-default.dz-message span { + display: inline; + color: #555; +} +.dropzone .dz-default.dz-message span .upload-icon { + opacity: 0.7; + filter: alpha(opacity=70); + margin-top: 8px; + cursor: pointer; +} +.dropzone .dz-default.dz-message span .upload-icon:hover { + opacity: 1; + filter: alpha(opacity=100); +} +.dropzone .dz-preview .dz-error-mark, +.dropzone-previews .dz-preview .dz-error-mark, +.dropzone .dz-preview .dz-success-mark, +.dropzone-previews .dz-preview .dz-success-mark { + background-image: none; + background-color: rgba(255, 255, 255, 0.8); + border-radius: 100%; + text-align: center; + line-height: 35px; +} +.dropzone .dz-preview .dz-error-mark:before, +.dropzone-previews .dz-preview .dz-error-mark:before { + font-family: FontAwesome; + font-size: 30px; + color: #DB6262; + content: "\f00d"; +} +.dropzone .dz-preview .dz-success-mark:before, +.dropzone-previews .dz-preview .dz-success-mark:before { + font-family: FontAwesome; + font-size: 30px; + color: #6DA552; + content: "\f00c"; +} +.dropzone a.dz-remove, +.dropzone-previews a.dz-remove { + border: none; + border-radius: 0; + color: #FFF; + background: #D15B47; + cursor: pointer; +} +.dropzone a.dz-remove:hover, +.dropzone-previews a.dz-remove:hover { + color: #FFF; + background: #B74635; +} +.dropzone .progress, +.dropzone-previews .progress { + margin-bottom: 0; +} +.dropzone .dz-preview.dz-success .progress, +.dropzone-previews .dz-preview.dz-success .progress, +.dropzone .dz-preview.dz-error .progress, +.dropzone-previews .dz-preview.dz-error .progress { + display: none; +} +input.typeahead, +input.tt-query, +input.tt-hint { + min-width: 175px; + font-size: 16px; + line-height: 24px; + border: 1px solid #CCC; + border-radius: 0; + outline: none; +} +input.tt-hint, +.form-group input.tt-hint { + background-color: #FFF !important; + color: #B0B0B0 !important; +} +.tt-dropdown-menu { + text-align: left; + position: absolute; + left: 0 !important; + right: 0 !important; + min-width: 175px; + margin-top: 2px; + padding: 8px 0; + background-color: #FFF; + border: 1px solid #D0D0D0; + border: 1px solid rgba(0, 0, 0, 0.15); + border-radius: 0; + -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); +} +.tt-suggestion { + padding: 3px 12px 4px; + font-size: 16px; + line-height: 24px; +} +.tt-suggestion.tt-cursor { + color: #FFF; + background-color: #4F99C6; + cursor: pointer; +} +.tt-suggestion p { + margin: 0; +} +input.typeahead.scrollable ~ .tt-dropdown-menu { + max-height: 200px; + overflow-y: auto; +} +.btn-group > .btn.moveall:first-child, +.btn-group > .btn.remove:first-child { + margin: 0; +} +.btn-group > .btn.moveall:first-child + .btn.move, +.btn-group > .btn.remove:first-child + .btn.removeall { + margin: 0; +} +.bootstrap-duallistbox-container .info { + font-size: 12px; +} +.bootstrap-duallistbox-container .clear1, +.bootstrap-duallistbox-container .clear2 { + font-size: 12px; +} +.multiselect-container > li > a { + padding: 0; +} +.multiselect-container > li > a > label { + padding: 7px 10px 7px 20px; +} +.cancel-on-png, +.cancel-off-png, +.star-on-png, +.star-off-png, +.star-half-png { + font-size: 2em; +} +.cancel-on-png, +.cancel-off-png, +.star-on-png, +.star-off-png, +.star-half-png { + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + font-family: "FontAwesome"; + font-style: normal; + font-variant: normal; + font-weight: normal; + line-height: 1; + speak: none; + text-transform: none; + color: #777777; +} +.cancel-on-png { + color: #dd5a43; +} +.cancel-on-png:before { + content: "\f057"; +} +.cancel-off-png { + color: #e08374; +} +.cancel-off-png:before { + content: "\f05c"; +} +.star-on-png { + color: #feb902; +} +.star-on-png:before { + content: "\f005"; +} +.star-off-png { + color: #777777; +} +.star-off-png:before { + content: "\f006"; +} +.star-half-png { + color: #feb902; +} +.star-half-png:before { + content: "\f123"; +} +/* custom animated icons */ +.icon-animated-bell { + display: inline-block; + -moz-animation: ringing 2.0s 5 ease 1.0s; + -webkit-animation: ringing 2.0s 5 ease 1.0s; + -o-animation: ringing 2.0s 5 ease 1.0s; + -ms-animation: ringing 2.0s 5 ease 1.0s; + animation: ringing 2.0s 5 ease 1.0s; + -moz-transform-origin: 50% 0%; + -webkit-transform-origin: 50% 0%; + -o-transform-origin: 50% 0%; + -ms-transform-origin: 50% 0%; + transform-origin: 50% 0%; +} +@-moz-keyframes ringing { + 0% { + -moz-transform: rotate(-15deg); + } + 2% { + -moz-transform: rotate(15deg); + } + 4% { + -moz-transform: rotate(-18deg); + } + 6% { + -moz-transform: rotate(18deg); + } + 8% { + -moz-transform: rotate(-22deg); + } + 10% { + -moz-transform: rotate(22deg); + } + 12% { + -moz-transform: rotate(-18deg); + } + 14% { + -moz-transform: rotate(18deg); + } + 16% { + -moz-transform: rotate(-12deg); + } + 18% { + -moz-transform: rotate(12deg); + } + 20% { + -moz-transform: rotate(0deg); + } +} +@-webkit-keyframes ringing { + 0% { + -webkit-transform: rotate(-15deg); + } + 2% { + -webkit-transform: rotate(15deg); + } + 4% { + -webkit-transform: rotate(-18deg); + } + 6% { + -webkit-transform: rotate(18deg); + } + 8% { + -webkit-transform: rotate(-22deg); + } + 10% { + -webkit-transform: rotate(22deg); + } + 12% { + -webkit-transform: rotate(-18deg); + } + 14% { + -webkit-transform: rotate(18deg); + } + 16% { + -webkit-transform: rotate(-12deg); + } + 18% { + -webkit-transform: rotate(12deg); + } + 20% { + -webkit-transform: rotate(0deg); + } +} +@-ms-keyframes ringing { + 0% { + -ms-transform: rotate(-15deg); + } + 2% { + -ms-transform: rotate(15deg); + } + 4% { + -ms-transform: rotate(-18deg); + } + 6% { + -ms-transform: rotate(18deg); + } + 8% { + -ms-transform: rotate(-22deg); + } + 10% { + -ms-transform: rotate(22deg); + } + 12% { + -ms-transform: rotate(-18deg); + } + 14% { + -ms-transform: rotate(18deg); + } + 16% { + -ms-transform: rotate(-12deg); + } + 18% { + -ms-transform: rotate(12deg); + } + 20% { + -ms-transform: rotate(0deg); + } +} +@keyframes ringing { + 0% { + transform: rotate(-15deg); + } + 2% { + transform: rotate(15deg); + } + 4% { + transform: rotate(-18deg); + } + 6% { + transform: rotate(18deg); + } + 8% { + transform: rotate(-22deg); + } + 10% { + transform: rotate(22deg); + } + 12% { + transform: rotate(-18deg); + } + 14% { + transform: rotate(18deg); + } + 16% { + transform: rotate(-12deg); + } + 18% { + transform: rotate(12deg); + } + 20% { + transform: rotate(0deg); + } +} +.icon-animated-vertical { + display: inline-block; + -moz-animation: vertical 2.0s 5 ease 2.0s; + -webkit-animation: vertical 2.0s 5 ease 2.0s; + -o-animation: vertical 2.0s 5 ease 2.0s; + -ms-animation: vertical 2.0s 5 ease 2.0s; + animation: vertical 2.0s 5 ease 2.0s; +} +@-moz-keyframes vertical { + 0% { + -moz-transform: translate(0, -3px); + } + 4% { + -moz-transform: translate(0, 3px); + } + 8% { + -moz-transform: translate(0, -3px); + } + 12% { + -moz-transform: translate(0, 3px); + } + 16% { + -moz-transform: translate(0, -3px); + } + 20% { + -moz-transform: translate(0, 3px); + } + 22% { + -moz-transform: translate(0, 0); + } +} +@-webkit-keyframes vertical { + 0% { + -webkit-transform: translate(0, -3px); + } + 4% { + -webkit-transform: translate(0, 3px); + } + 8% { + -webkit-transform: translate(0, -3px); + } + 12% { + -webkit-transform: translate(0, 3px); + } + 16% { + -webkit-transform: translate(0, -3px); + } + 20% { + -webkit-transform: translate(0, 3px); + } + 22% { + -webkit-transform: translate(0, 0); + } +} +@-ms-keyframes vertical { + 0% { + -ms-transform: translate(0, -3px); + } + 4% { + -ms-transform: translate(0, 3px); + } + 8% { + -ms-transform: translate(0, -3px); + } + 12% { + -ms-transform: translate(0, 3px); + } + 16% { + -ms-transform: translate(0, -3px); + } + 20% { + -ms-transform: translate(0, 3px); + } + 22% { + -ms-transform: translate(0, 0); + } +} +@keyframes vertical { + 0% { + transform: translate(0, -3px); + } + 4% { + transform: translate(0, 3px); + } + 8% { + transform: translate(0, -3px); + } + 12% { + transform: translate(0, 3px); + } + 16% { + transform: translate(0, -3px); + } + 20% { + transform: translate(0, 3px); + } + 22% { + transform: translate(0, 0); + } +} +.icon-animated-hand-pointer { + display: inline-block; + -moz-animation: hand-pointer 2.0s 4 ease 2.0s; + -webkit-animation: hand-pointer 2.0s 4 ease 2.0s; + -o-animation: hand-pointer 2.0s 4 ease 2.0s; + -ms-animation: hand-pointer 2.0s 4 ease 2.0s; + animation: hand-pointer 2.0s 4 ease 2.0s; +} +@-moz-keyframes hand-pointer { + 0% { + -moz-transform: translate(0, 0); + } + 6% { + -moz-transform: translate(5px, 0); + } + 12% { + -moz-transform: translate(0, 0); + } + 18% { + -moz-transform: translate(5px, 0); + } + 24% { + -moz-transform: translate(0, 0); + } + 30% { + -moz-transform: translate(5px, 0); + } + 36% { + -moz-transform: translate(0, 0); + } +} +.icon-animated-wrench { + display: inline-block; + -moz-animation: wrenching 2.5s 4 ease; + -webkit-animation: wrenching 2.5s 4 ease; + -o-animation: wrenching 2.5s 4 ease; + -ms-animation: wrenching 2.5s 4 ease; + animation: wrenching 2.5s 4 ease; + -moz-transform-origin: 90% 35%; + -webkit-transform-origin: 90% 35%; + -o-transform-origin: 90% 35%; + -ms-transform-origin: 90% 35%; + transform-origin: 90% 35%; +} +@-moz-keyframes wrenching { + 0% { + -moz-transform: rotate(-12deg); + } + 8% { + -moz-transform: rotate(12deg); + } + 10% { + -moz-transform: rotate(24deg); + } + 18% { + -moz-transform: rotate(-24deg); + } + 20% { + -moz-transform: rotate(-24deg); + } + 28% { + -moz-transform: rotate(24deg); + } + 30% { + -moz-transform: rotate(24deg); + } + 38% { + -moz-transform: rotate(-24deg); + } + 40% { + -moz-transform: rotate(-24deg); + } + 48% { + -moz-transform: rotate(24deg); + } + 50% { + -moz-transform: rotate(24deg); + } + 58% { + -moz-transform: rotate(-24deg); + } + 60% { + -moz-transform: rotate(-24deg); + } + 68% { + -moz-transform: rotate(24deg); + } + 75% { + -moz-transform: rotate(0deg); + } +} +@-webkit-keyframes wrenching { + 0% { + -webkit-transform: rotate(-12deg); + } + 8% { + -webkit-transform: rotate(12deg); + } + 10% { + -webkit-transform: rotate(24deg); + } + 18% { + -webkit-transform: rotate(-24deg); + } + 20% { + -webkit-transform: rotate(-24deg); + } + 28% { + -webkit-transform: rotate(24deg); + } + 30% { + -webkit-transform: rotate(24deg); + } + 38% { + -webkit-transform: rotate(-24deg); + } + 40% { + -webkit-transform: rotate(-24deg); + } + 48% { + -webkit-transform: rotate(24deg); + } + 50% { + -webkit-transform: rotate(24deg); + } + 58% { + -webkit-transform: rotate(-24deg); + } + 60% { + -webkit-transform: rotate(-24deg); + } + 68% { + -webkit-transform: rotate(24deg); + } + 75% { + -webkit-transform: rotate(0deg); + } +} +@-o-keyframes wrenching { + 0% { + -o-transform: rotate(-12deg); + } + 8% { + -o-transform: rotate(12deg); + } + 10% { + -o-transform: rotate(24deg); + } + 18% { + -o-transform: rotate(-24deg); + } + 20% { + -o-transform: rotate(-24deg); + } + 28% { + -o-transform: rotate(24deg); + } + 30% { + -o-transform: rotate(24deg); + } + 38% { + -o-transform: rotate(-24deg); + } + 40% { + -o-transform: rotate(-24deg); + } + 48% { + -o-transform: rotate(24deg); + } + 50% { + -o-transform: rotate(24deg); + } + 58% { + -o-transform: rotate(-24deg); + } + 60% { + -o-transform: rotate(-24deg); + } + 68% { + -o-transform: rotate(24deg); + } + 75% { + -o-transform: rotate(0deg); + } +} +@-ms-keyframes wrenching { + 0% { + -ms-transform: rotate(-12deg); + } + 8% { + -ms-transform: rotate(12deg); + } + 10% { + -ms-transform: rotate(24deg); + } + 18% { + -ms-transform: rotate(-24deg); + } + 20% { + -ms-transform: rotate(-24deg); + } + 28% { + -ms-transform: rotate(24deg); + } + 30% { + -ms-transform: rotate(24deg); + } + 38% { + -ms-transform: rotate(-24deg); + } + 40% { + -ms-transform: rotate(-24deg); + } + 48% { + -ms-transform: rotate(24deg); + } + 50% { + -ms-transform: rotate(24deg); + } + 58% { + -ms-transform: rotate(-24deg); + } + 60% { + -ms-transform: rotate(-24deg); + } + 68% { + -ms-transform: rotate(24deg); + } + 75% { + -ms-transform: rotate(0deg); + } +} +@keyframes wrenching { + 0% { + transform: rotate(-12deg); + } + 8% { + transform: rotate(12deg); + } + 10% { + transform: rotate(24deg); + } + 18% { + transform: rotate(-24deg); + } + 20% { + transform: rotate(-24deg); + } + 28% { + transform: rotate(24deg); + } + 30% { + transform: rotate(24deg); + } + 38% { + transform: rotate(-24deg); + } + 40% { + transform: rotate(-24deg); + } + 48% { + transform: rotate(24deg); + } + 50% { + transform: rotate(24deg); + } + 58% { + transform: rotate(-24deg); + } + 60% { + transform: rotate(-24deg); + } + 68% { + transform: rotate(24deg); + } + 75% { + transform: rotate(0deg); + } +} +@-moz-keyframes blinking { + 0% { + opacity: 1; + } + 40% { + opacity: 0; + } + 80% { + opacity: 1; + } +} +@-webkit-keyframes blinking { + 0% { + opacity: 1; + } + 40% { + opacity: 0; + } + 80% { + opacity: 1; + } +} +@-ms-keyframes blinking { + 0% { + opacity: 1; + } + 40% { + opacity: 0; + } + 80% { + opacity: 1; + } +} +@keyframes blinking { + 0% { + opacity: 1; + } + 40% { + opacity: 0; + } + 80% { + opacity: 1; + } +} +@-moz-keyframes pulsating { + 0% { + -moz-transform: scale(1); + } + 5% { + -moz-transform: scale(0.75); + } + 10% { + -moz-transform: scale(1); + } + 15% { + -moz-transform: scale(1.25); + } + 20% { + -moz-transform: scale(1); + } + 25% { + -moz-transform: scale(0.75); + } + 30% { + -moz-transform: scale(1); + } + 35% { + -moz-transform: scale(1.25); + } + 40% { + -moz-transform: scale(1); + } +} +@-webkit-keyframes pulsating { + 0% { + -webkit-transform: scale(1); + } + 5% { + -webkit-transform: scale(0.75); + } + 10% { + -webkit-transform: scale(1); + } + 15% { + -webkit-transform: scale(1.25); + } + 20% { + -webkit-transform: scale(1); + } + 25% { + -webkit-transform: scale(0.75); + } + 30% { + -webkit-transform: scale(1); + } + 35% { + -webkit-transform: scale(1.25); + } + 40% { + -webkit-transform: scale(1); + } +} +@-ms-keyframes pulsating { + 0% { + -ms-transform: scale(1); + } + 5% { + -ms-transform: scale(0.75); + } + 10% { + -ms-transform: scale(1); + } + 15% { + -ms-transform: scale(1.25); + } + 20% { + -ms-transform: scale(1); + } + 25% { + -ms-transform: scale(0.75); + } + 30% { + -ms-transform: scale(1); + } + 35% { + -ms-transform: scale(1.25); + } + 40% { + -ms-transform: scale(1); + } +} +@keyframes pulsating { + 0% { + transform: scale(1); + } + 5% { + transform: scale(0.75); + } + 10% { + transform: scale(1); + } + 15% { + transform: scale(1.25); + } + 20% { + transform: scale(1); + } + 25% { + transform: scale(0.75); + } + 30% { + transform: scale(1); + } + 35% { + transform: scale(1.25); + } + 40% { + transform: scale(1); + } +} +.btn-scroll-up { + border-width: 0; + position: fixed; + right: 2px; + z-index: 99; + -webkit-transition-duration: 0.3s; + transition-duration: 0.3s; + opacity: 0; + filter: alpha(opacity=0); + bottom: -24px; + visibility: hidden; +} +.btn-scroll-up.display { + opacity: 0.7; + filter: alpha(opacity=70); + bottom: 2px; + visibility: visible; +} +.btn-scroll-up:hover { + opacity: 1; + filter: alpha(opacity=100); +} +.btn-scroll-up:focus { + outline: none; +} +@media (min-width: 768px) { + .main-container.container > .btn-scroll-up { + right: auto; + margin-left: 714px; + } +} +@media (min-width: 992px) { + .main-container.container > .btn-scroll-up { + right: auto; + margin-left: 934px; + } +} +@media (min-width: 1200px) { + .main-container.container > .btn-scroll-up { + right: auto; + margin-left: 1134px; + } +} +.ace-settings-container { + position: absolute; + right: 0; + top: auto; + z-index: 12; +} +.btn.btn-app.ace-settings-btn { + float: left; + display: block; + text-align: center; + border-radius: 6px 0 0 6px; + opacity: 0.55; + vertical-align: top; + margin: 0; +} +.btn.btn-app.ace-settings-btn:hover, +.btn.btn-app.ace-settings-btn.open { + opacity: 1; +} +.btn.btn-app.ace-settings-btn.btn-xs { + width: 42px; +} +.ace-settings-box { + display: block; + float: left; + max-width: 0; + max-height: 0; + overflow: hidden; + padding: 0; + -moz-transform: translate(0,0); + -webkit-transform: translate(0,0); + -o-transform: translate(0,0); + -ms-transform: translate(0,0); + transform: translate(0,0); + background-color: #FFF; + border: 0 solid #ffb34b; + -webkit-transition: max-width 0.25s linear 0s, max-height 0s linear 0.25s, padding 0s linear 0.25s, border-width 0s linear 0.25s; + -o-transition: max-width 0.25s linear 0s, max-height 0s linear 0.25s, padding 0s linear 0.25s, border-width 0s linear 0.25s; + transition: max-width 0.25s linear 0s, max-height 0s linear 0.25s, padding 0s linear 0.25s, border-width 0s linear 0.25s; +} +.ace-settings-box.open { + max-width: 320px; + max-height: 1000px; + padding: 0 14px; + border-width: 2px; + -webkit-transition-delay: 0s; + -moz-transition-delay: 0s; + -o-transition-delay: 0s; + transition-delay: 0s; +} +.ace-settings-box.open .ace-settings-item { + z-index: auto; + min-width: 140px; +} +.ace-settings-box .ace-settings-item { + margin: 6px 0; + color: #444; + max-height: 24px; + position: relative; + z-index: -1; + white-space: nowrap; +} +.ace-settings-box .ace-settings-item > label.lbl { + font-size: 13px; +} +@media (max-width: 480px) { + .ace-settings-container { + text-align: right; + } + .ace-settings-box { + float: none !important; + text-align: left; + } + .btn.ace-settings-btn { + float: none !important; + display: inline-block; + } +} +@media (max-width: 320px) { + .ace-settings-box > .clearfix > .pull-left, + .ace-settings-box > .clearfix > .pull-right { + float: none !important; + } +} +.grid2, +.grid3, +.grid4 { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + display: block; + margin: 0 1%; + padding: 0 2%; + float: left; + border-left: 1px solid #E3E3E3; +} +.grid2:first-child, +.grid3:first-child, +.grid4:first-child { + border-left: none; +} +.grid2 { + width: 48%; +} +.grid3 { + width: 31.33%; +} +.grid4 { + width: 23%; + padding: 0 1%; +} +.draggable-placeholder { + border: 2px dashed #D9D9D9 !important; + background-color: #F7F7F7 !important; +} +.easyPieChart, +.easy-pie-chart { + position: relative; + text-align: center; +} +.easyPieChart canvas, +.easy-pie-chart canvas { + position: absolute; + top: 0; + left: 0; +} +.knob-container { + direction: ltr; + text-align: left; +} +.tags { + display: inline-block; + padding: 4px 6px; + color: #777777; + vertical-align: middle; + background-color: #FFF; + border: 1px solid #d5d5d5; + width: 206px; +} +.tags:hover { + border-color: #b5b5b5; +} +.tags-hover, +.tags-hover:hover { + border-color: #f59942; + outline: 0; +} +.tags[class*="span"] { + float: none; + margin-left: 0; +} +.tags input[type="text"], +.tags input[type="text"]:focus { + border: none; + display: inline; + outline: 0; + margin: 0; + padding: 0; + line-height: 18px; + -webkit-box-shadow: none; + box-shadow: none; + width: 100%; +} +.tags .tag { + display: inline-block; + position: relative; + font-size: 13px; + font-weight: normal; + vertical-align: baseline; + white-space: nowrap; + background-color: #91b8d0; + color: #FFF; + text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.15); + padding: 4px 22px 5px 9px; + margin-bottom: 3px; + margin-right: 3px; + -webkit-transition: all 0.2s; + -o-transition: all 0.2s; + transition: all 0.2s; + /** + &:nth-child(5n+1) { + background-color:#48A2E0; + } + &:nth-child(5n+2) { + background-color:#34C896; + } + &:nth-child(5n+3) { + background-color:#B57BB3; + } + &:nth-child(5n+4) { + background-color:#CC7DA8; + } + &:nth-child(5n+5) { + background-color:#666; + } +*/ +} +.tags .tag:empty { + display: none; +} +.tags .tag-important { + background-color: #d15b47; +} +.tags .tag-warning { + background-color: #ffb752; +} +.tags .tag-success { + background-color: #87b87f; +} +.tags .tag-info { + background-color: #6fb3e0; +} +.tags .tag-inverse { + background-color: #555555; +} +.tags .tag .close { + font-size: 15px; + line-height: 20px; + opacity: 1; + filter: alpha(opacity=100); + color: #FFF; + text-shadow: none; + float: none; + position: absolute; + right: 0; + top: 0; + bottom: 0; + width: 18px; + text-align: center; +} +.tags .tag .close:hover { + background-color: rgba(0, 0, 0, 0.2); +} +.page-content > .row .col-xs-12, +.page-content > .row .col-sm-12, +.page-content > .row .col-md-12, +.page-content > .row .col-lg-12 { + float: left; + max-width: 100%; +} +.col-xs-reset { + width: auto; + padding-left: 0; + padding-right: 0; + float: none !important; +} +@media (min-width: 768px) { + .col-sm-reset { + width: auto; + padding-left: 0; + padding-right: 0; + float: none !important; + } +} +@media (min-width: 992px) { + .col-md-reset { + width: auto; + padding-left: 0; + padding-right: 0; + float: none !important; + } +} +@media (min-width: 1200px) { + .col-lg-reset { + width: auto; + padding-left: 0; + padding-right: 0; + float: none !important; + } +} +.jqstooltip, +.legendColorBox div { + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} +.legendLabel { + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 22px; + padding-left: 2px; + font-size: 10px; +} +@media only screen and (max-width: 991px) { + body { + overflow-x: hidden; + } +} +.navbar-fixed-top + .main-container { + padding-top: 45px; +} +@media (max-width: 479px) { + .navbar-fixed-top + .main-container { + padding-top: 90px; + } + .navbar-fixed-top.navbar-collapse + .main-container { + padding-top: 45px; + } +} +@media only screen and (max-width: 360px) { + .grid2, + .grid3, + .grid4 { + float: none; + display: block; + width: 96%; + border-left-width: 0; + position: relative; + margin-bottom: 11px; + border-bottom: 1px solid #E3E3E3; + padding-bottom: 4px; + } + .grid2 > [class*="pull-"], + .grid3 > [class*="pull-"], + .grid4 > [class*="pull-"] { + float: none !important; + display: inline-block; + position: absolute; + right: 11px; + top: 0; + margin-top: 0; + } + .grid2:last-child, + .grid3:last-child, + .grid4:last-child { + border-bottom-width: 0; + } +} +@media only screen and (max-width: 480px) { + .hidden-480 { + display: none !important; + } +} +@media only screen and (max-width: 320px) { + .hidden-320 { + display: none !important; + } +} +.no-skin { + /** + .nav-list > li.disabled.active:after { + border-color: #999; + } + .nav-list li.disabled li.active > a:after, + .nav-list li.active.disabled > a:after { + -moz-border-right-colors: #999 !important; + border-right-color: #999 !important; + } + */ +} +.no-skin .navbar .navbar-toggle { + background-color: #75B3D7; +} +.no-skin .navbar .navbar-toggle:focus { + background-color: #75B3D7; + border-color: transparent; +} +.no-skin .navbar .navbar-toggle:hover { + background-color: #61a8d1; + border-color: rgba(255, 255, 255, 0.1); +} +.no-skin .navbar .navbar-toggle.display, +.no-skin .navbar .navbar-toggle[data-toggle=collapse]:not(.collapsed) { + background-color: #4d9dcc; + box-shadow: inset 1px 1px 2px 0 rgba(0, 0, 0, 0.25); + border-color: rgba(255, 255, 255, 0.35); +} +.no-skin .sidebar { + background-color: #f2f2f2; + border-style: solid; + border-color: #cccccc; + border-width: 0 1px 0 0; +} +.no-skin .nav-list .open > a, +.no-skin .nav-list .open > a:hover, +.no-skin .nav-list .open > a:focus { + background-color: #fafafa; +} +.no-skin .nav-list > li { + border-color: #e5e5e5; +} +.no-skin .nav-list > li > a { + background-color: #f8f8f8; + color: #585858; +} +.no-skin .nav-list > li > a:focus { + background-color: #f8f8f8; + color: #1963aa; +} +.no-skin .nav-list > li:hover > a { + background-color: #ffffff; + color: #266cad; +} +.no-skin .nav-list > li.open > a { + background-color: #fafafa; + color: #1963aa; +} +.no-skin .nav-list > li.active > a { + font-weight: bold; + color: #2b7dbc; +} +.no-skin .nav-list > li.active > a, +.no-skin .nav-list > li.active > a:hover, +.no-skin .nav-list > li.active > a:focus { + background-color: #ffffff; +} +.no-skin .nav-list > li .submenu { + background-color: #ffffff; + border-color: #e5e5e5; +} +.no-skin .nav-list > li .submenu > li > a { + border-top-color: #e4e4e4; + background-color: #ffffff; + color: #616161; +} +.no-skin .nav-list > li .submenu > li > a:hover { + color: #4b88b7; + background-color: #f1f5f9; +} +.no-skin .nav-list > li .submenu > li.active > a { + color: #2b7dbc; +} +.no-skin .nav-list > li .submenu > li.active > a > .menu-icon { + color: #c86139; +} +.no-skin .nav-list > li .submenu > li.active.open > a > .menu-icon { + color: inherit; +} +@media only screen and (min-width: 992px) { + .no-skin .nav-list > li .submenu > li.active.hover > a.dropdown-toggle > .menu-icon { + color: inherit; + } +} +.no-skin .nav-list > li .submenu > li.active:not(.open) > a { + background-color: #f5f7fa; +} +.no-skin .nav-list > li .submenu > li.active:not(.open) > a:hover { + background-color: #f1f5f9; +} +.no-skin .nav-list > li > .submenu .open > a, +.no-skin .nav-list > li > .submenu .open > a:hover, +.no-skin .nav-list > li > .submenu .open > a:focus { + border-color: #e4e4e4; +} +.no-skin .nav-list > li > .submenu li > .submenu > li a { + color: #757575; +} +.no-skin .nav-list > li > .submenu li > .submenu > li a:hover { + color: #4b88b7; + background-color: #f1f5f9; +} +.no-skin .nav-list > li > .submenu li.open > a { + color: #4b88b7; +} +.no-skin .nav-list > li > .submenu li > .submenu li.open > a, +.no-skin .nav-list > li > .submenu li > .submenu li.active > a { + color: #4b88b7; +} +.no-skin .nav-list > li > .submenu:before, +.no-skin .nav-list > li > .submenu > li:before { + border-color: #9dbdd6; +} +.no-skin .nav-list > li.active > .submenu:before, +.no-skin .nav-list > li.active > .submenu > li:before { + border-color: #8eb3d0; +} +.no-skin .sidebar-toggle { + background-color: #f3f3f3; + border-color: #e0e0e0; +} +.no-skin .sidebar-toggle > .ace-icon { + border-color: #bbbbbb; + color: #aaaaaa; + background-color: #ffffff; +} +.no-skin .sidebar-shortcuts { + background-color: #fafafa; +} +.no-skin .sidebar-fixed .sidebar-shortcuts { + border-color: #dddddd; +} +.no-skin .sidebar-shortcuts-mini { + background-color: #ffffff; +} +.no-skin .nav-list li > .arrow:before { + border-right-color: #B8B8B8; + -moz-border-right-colors: #B8B8B8; + border-width: 10px 10px 10px 0; + left: -11px; +} +.no-skin .nav-list li > .arrow:after { + border-right-color: #ffffff; + -moz-border-right-colors: #ffffff; + border-width: 10px 10px 10px 0; + left: -10px; +} +.no-skin .nav-list > li.pull_up > .arrow:after { + border-right-color: #ffffff !important; + -moz-border-right-colors: #ffffff !important; + border-width: 10px 10px 10px 0 !important; + left: -10px !important; +} +.no-skin .nav-list > li.pull_up > .arrow:before { + border-width: 10px 10px 10px 0 !important; + left: -11px !important; +} +.no-skin .nav-list li.active > a:after { + border-right-color: #2b7dbc; + -moz-border-right-colors: #2b7dbc; +} +.no-skin .nav-list > li.active:after { + display: block; + content: ""; + position: absolute; + right: -2px; + top: -1px; + bottom: 0; + z-index: 1; + border: 2px solid; + border-width: 0 2px 0 0; + border-color: #2b7dbc; +} +.no-skin .sidebar-scroll .nav-list > li.active:after { + right: 0; +} +@media only screen and (max-width: 991px) { + .no-skin .sidebar.responsive .nav-list > li.active.open > a:after, + .no-skin .sidebar.responsive-max .nav-list > li.active.open > a:after { + display: block; + } + .no-skin .sidebar.responsive .nav-list li li.active > a:after, + .no-skin .sidebar.responsive-max .nav-list li li.active > a:after { + display: none; + } + .no-skin .sidebar.responsive .nav-list > li.active:after, + .no-skin .sidebar.responsive-max .nav-list > li.active:after { + height: 41px; + } +} +.no-skin .sidebar.menu-min .nav-list > li > a > .menu-text { + background-color: #f5f5f5; + -webkit-box-shadow: 2px 1px 2px 0 rgba(0,0,0,0.1); + box-shadow: 2px 1px 2px 0 rgba(0,0,0,0.1); + border-color: #cccccc; +} +.no-skin .sidebar.menu-min .nav-list > li > a.dropdown-toggle > .menu-text { + -webkit-box-shadow: 2px 2px 2px 0 rgba(0,0,0,0.1); + box-shadow: 2px 2px 2px 0 rgba(0,0,0,0.1); +} +.no-skin .sidebar.menu-min .nav-list > li.active > .submenu { + border-left-color: #83b6d1; +} +.no-skin .sidebar.menu-min .nav-list > li > .submenu { + background-color: #ffffff; + border: 1px solid #cccccc; + border-top-color: #e6e6e6; + -webkit-box-shadow: 2px 2px 2px 0 rgba(0,0,0,0.1); + box-shadow: 2px 2px 2px 0 rgba(0,0,0,0.1); +} +.no-skin .sidebar.menu-min .nav-list > li > .arrow:after { + border-right-color: #f5f5f5; + -moz-border-right-colors: #f5f5f5; + border-width: 8px 8px 8px 0; + left: -8px; +} +.no-skin .sidebar.menu-min .nav-list > li > .arrow:before { + border-width: 8px 8px 8px 0; + left: -9px; +} +.no-skin .sidebar.menu-min .nav-list > li.active > .arrow:before { + border-right-color: #5a9ec2; + -moz-border-right-colors: #5a9ec2; +} +.no-skin .sidebar.menu-min .nav-list > li.active > a > .menu-text { + border-left-color: #83b6d1; +} +.no-skin .sidebar.menu-min .sidebar-shortcuts-large { + background-color: #ffffff; + -webkit-box-shadow: 2px 1px 2px 0 rgba(0,0,0,0.1); + box-shadow: 2px 1px 2px 0 rgba(0,0,0,0.1); + border-color: #cccccc; +} +.no-skin .sidebar.menu-min .sidebar-toggle > .ace-icon { + border-color: #b1b1b1; +} +@media (max-width: 991px) { + .no-skin .sidebar.responsive-min .nav-list > li > a > .menu-text { + background-color: #f5f5f5; + -webkit-box-shadow: 2px 1px 2px 0 rgba(0,0,0,0.1); + box-shadow: 2px 1px 2px 0 rgba(0,0,0,0.1); + border-color: #cccccc; + } + .no-skin .sidebar.responsive-min .nav-list > li > a.dropdown-toggle > .menu-text { + -webkit-box-shadow: 2px 2px 2px 0 rgba(0,0,0,0.1); + box-shadow: 2px 2px 2px 0 rgba(0,0,0,0.1); + } + .no-skin .sidebar.responsive-min .nav-list > li.active > .submenu { + border-left-color: #83b6d1; + } + .no-skin .sidebar.responsive-min .nav-list > li > .submenu { + background-color: #ffffff; + border: 1px solid #cccccc; + border-top-color: #e6e6e6; + -webkit-box-shadow: 2px 2px 2px 0 rgba(0,0,0,0.1); + box-shadow: 2px 2px 2px 0 rgba(0,0,0,0.1); + } + .no-skin .sidebar.responsive-min .nav-list > li > .arrow:after { + border-right-color: #f5f5f5; + -moz-border-right-colors: #f5f5f5; + border-width: 8px 8px 8px 0; + left: -8px; + } + .no-skin .sidebar.responsive-min .nav-list > li > .arrow:before { + border-width: 8px 8px 8px 0; + left: -9px; + } + .no-skin .sidebar.responsive-min .nav-list > li.active > .arrow:before { + border-right-color: #5a9ec2; + -moz-border-right-colors: #5a9ec2; + } + .no-skin .sidebar.responsive-min .nav-list > li.active > a > .menu-text { + border-left-color: #83b6d1; + } + .no-skin .sidebar.responsive-min .sidebar-shortcuts-large { + background-color: #ffffff; + -webkit-box-shadow: 2px 1px 2px 0 rgba(0,0,0,0.1); + box-shadow: 2px 1px 2px 0 rgba(0,0,0,0.1); + border-color: #cccccc; + } + .no-skin .sidebar.responsive-min .sidebar-toggle > .ace-icon { + border-color: #b1b1b1; + } +} +@media only screen and (min-width: 992px) { + .no-skin .nav-list li.hover > .submenu { + -webkit-box-shadow: 2px 1px 2px 0 rgba(0,0,0,0.1); + box-shadow: 2px 1px 2px 0 rgba(0,0,0,0.1); + border-color: #cccccc; + } + .no-skin .nav-list li.hover > .submenu > li.active > a { + background-color: #f5f5f5; + } + .no-skin .nav-list li.hover > .submenu > li:hover > a { + background-color: #eef3f7; + color: #2e7db4; + } +} +@media only screen and (min-width: 992px) and (max-width: 991px) { + .no-skin .sidebar.navbar-collapse .nav-list li li.hover.active.open > a { + background-color: #ffffff; + } + .no-skin .sidebar.navbar-collapse .nav-list li li.hover:hover > a { + background-color: #ffffff; + } + .no-skin .sidebar.navbar-collapse .nav-list li li.hover > a:hover, + .no-skin .sidebar.navbar-collapse .nav-list li li.hover.open > a:hover, + .no-skin .sidebar.navbar-collapse .nav-list li li.hover.open.active > a:hover { + background-color: #f1f5f9; + } + .no-skin .sidebar.navbar-collapse .nav-list > li .submenu > li.active.hover > a.dropdown-toggle > .menu-icon { + color: #c86139; + } + .no-skin .sidebar.navbar-collapse .nav-list > li .submenu > li.active.open.hover > a.dropdown-toggle > .menu-icon { + color: inherit; + } +} +@media only screen and (min-width: 992px) { + .no-skin .sidebar.navbar-collapse .nav-list > li.open.hover:not(:hover):not(:focus):not(.active) > a { + color: #585858; + } + .no-skin .sidebar.navbar-collapse .nav-list > li.open.hover:not(:hover):not(:focus):not(.active) > a > .arrow { + color: inherit; + } + .no-skin .sidebar.navbar-collapse .nav-list > li.open.hover:hover > a { + background-color: #ffffff; + } + .no-skin .sidebar.navbar-collapse .nav-list > li > .submenu li.open.hover:not(:hover):not(:focus):not(.active) > a { + color: #616161; + } + .no-skin .sidebar.navbar-collapse .nav-list > li > .submenu li.open.hover:not(:hover):not(:focus):not(.active) > a > .arrow { + color: inherit; + } +} +@media only screen and (min-width: 992px) and (max-width: 991px) { + .no-skin .sidebar.navbar-collapse .nav-list li.hover > .submenu { + border-top-color: #e5e5e5; + background-color: #ffffff; + } + .no-skin .nav-list li.hover > .submenu > li.active:not(.open) > a { + background-color: #f5f7fa; + } + .no-skin .nav-list li.hover > .submenu > li.active:not(.open) > a:hover { + background-color: #f1f5f9; + } +} +@media only screen and (min-width: 992px) { + .no-skin .sidebar.h-sidebar { + background-color: #f8f8f8; + } + .no-skin .sidebar.h-sidebar:before { + background-color: #e4e4e4; + -webkit-box-shadow: 0 -1px 1px 0 rgba(0, 0, 0, 0.05) inset; + box-shadow: 0 -1px 1px 0 rgba(0, 0, 0, 0.05) inset; + } + .no-skin .sidebar.h-sidebar .nav-list > li:hover, + .no-skin .sidebar.h-sidebar .nav-list > li:hover + li { + border-left-color: #cedde5; + } + .no-skin .sidebar.h-sidebar .nav-list > li:last-child:hover { + border-right-color: #cedde5; + } + .no-skin .sidebar.h-sidebar .nav-list > li.active, + .no-skin .sidebar.h-sidebar .nav-list > li.active + li, + .no-skin .sidebar.h-sidebar .nav-list > li:hover + li.active { + border-left-color: #79b0ce; + } + .no-skin .sidebar.h-sidebar .nav-list > li.active:last-child { + border-right-color: #79b0ce; + } + .no-skin .sidebar.h-sidebar .nav-list > li.active:before { + background-color: #2b7dbc; + } + .no-skin .sidebar.h-sidebar .nav-list > li.active > a:after { + border-width: 0 0 2px 0; + border-color: transparent; + border-bottom-color: #FFF; + left: 0; + right: 0; + top: auto; + bottom: -2px; + } + .no-skin .sidebar.h-sidebar .sidebar-shortcuts-large { + background-color: #FFF; + border-color: #cccccc; + -webkit-box-shadow: 2px 1px 2px 0 rgba(0,0,0,0.1); + box-shadow: 2px 1px 2px 0 rgba(0,0,0,0.1); + } + .no-skin .sidebar.h-sidebar .sidebar-shortcuts-large:after { + border-bottom-color: #FFF; + -moz-border-bottom-colors: #FFF; + } + .no-skin .sidebar.h-sidebar .nav-list > li.hover > .submenu { + border-color: #cccccc; + } + .no-skin .sidebar.h-sidebar.menu-min .nav-list > li.hover > .submenu { + border-top-color: #e6e6e6; + } + .no-skin .sidebar.h-sidebar .nav-list > li.hover > .arrow:after { + border-color: transparent; + -moz-border-right-colors: none; + -moz-border-top-colors: none; + -moz-border-left-colors: none; + border-bottom-color: #FFF; + -moz-border-bottom-colors: #FFF; + } + .no-skin .sidebar.h-sidebar .nav-list > li.hover > .arrow:before { + border-color: transparent; + -moz-border-right-colors: none; + -moz-border-top-colors: none; + -moz-border-left-colors: none; + -moz-border-bottom-colors: #B8B8B8; + border-bottom-color: #B8B8B8; + } + .no-skin .sidebar.h-sidebar.menu-min .nav-list > li.hover > .arrow:after { + -moz-border-bottom-colors: #F5F5F5; + border-bottom-color: #F5F5F5; + } + .no-skin .sidebar.h-sidebar.menu-min .nav-list > li.active > a > .menu-text { + border-left-color: #cccccc; + } +} +@media only screen and (max-width: 991px) { + .no-skin .sidebar { + border-width: 0 1px 1px 0; + border-top-color: #d6d6d6; + } + .no-skin .menu-toggler + .sidebar.responsive { + border-top-width: 1px; + } + .no-skin .sidebar.responsive-min { + border-width: 0 1px 0 0; + } + .no-skin .sidebar.navbar-collapse { + border-width: 0; + border-bottom-width: 1px !important; + border-bottom-color: #cccccc; + -webkit-box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1) !important; + box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1) !important; + } + .no-skin .sidebar.navbar-collapse.menu-min .nav-list > li > .submenu { + background-color: #ffffff; + } +} +.no-skin .sidebar-scroll .sidebar-shortcuts { + border-bottom-color: #dddddd; +} +.no-skin .sidebar-scroll .sidebar-toggle { + border-top-color: #dddddd; +} +.no-skin .main-container .menu-toggler { + background-color: #444444; +} +.no-skin .main-container .menu-toggler:before { + border-top-color: #87b87f; + border-bottom-color: #6fb3e0; +} +.no-skin .main-container .menu-toggler:after { + border-top-color: #ffa24d; + border-bottom-color: #d15b47; +} +.no-skin .main-container .menu-toggler > .toggler-text { + border-top-color: #444444; + -moz-border-top-colors: #444444; +} +.no-skin .nav-list > li.disabled:before { + display: none !important; +} +.no-skin .nav-list > li.disabled > a { + background-color: #ebebeb !important; + color: #656565 !important; +} +.no-skin .nav-list li .submenu > li.disabled > a, +.no-skin .nav-list li.disabled .submenu > li > a { + background-color: #f2f2f2 !important; + color: #7a7a7a !important; + cursor: not-allowed !important; +} +.no-skin .nav-list li .submenu > li.disabled > a > .menu-icon, +.no-skin .nav-list li.disabled .submenu > li > a > .menu-icon { + display: none; +} +.nav-list li.highlight li.active > a:after, +.nav-list li li.highlight.active > a:after, +.nav-list li.highlight li.active > a:before, +.nav-list li li.highlight.active > a:before { + display: none; +} +.nav-list > li.highlight.active > a:after, +.nav-list > li.highlight.active > a:before { + display: block; +} +.no-skin .nav-list > li.highlight:hover, +.no-skin .nav-list > li.highlight.active { + border-color: #c8d8e2; +} +.no-skin .nav-list > li.highlight:hover + li, +.no-skin .nav-list > li.highlight.active + li { + border-top-color: #c8d8e2; +} +.no-skin .nav-list > li.highlight:hover > a, +.no-skin .nav-list > li.highlight.active > a { + background-color: #FFF; +} +.no-skin .nav-list > li.highlight.active:after { + display: none; +} +.no-skin .nav-list > li.highlight.active:before { + display: block; + background-color: #4f90c2; +} +.no-skin .nav-list > li.highlight.active > a { + background-color: #f2f6f9 !important; +} +.no-skin .nav-list > li.highlight.active > a:before, +.no-skin .nav-list > li.highlight.active > a:after { + display: block; + content: ""; + position: absolute; + top: -1px; + right: -10px; + bottom: auto; + z-index: 1; + border-style: solid; + border-width: 20px 0 21px 10px; + border-color: transparent; +} +.no-skin .nav-list > li.highlight.active > a:before { + border-left-color: #a0bccd; + -moz-border-left-colors: #a0bccd; + right: -11px; +} +.no-skin .nav-list > li.highlight.active > a:after { + border-left-color: #f2f6f9; + -moz-border-left-colors: #f2f6f9; +} +.no-skin .nav-list li li.highlight.active > a { + background-color: #f2f6f9; +} +.no-skin .nav-list li li.highlight.active.open > a { + background-color: #FFF; +} +.no-skin .nav-list li li.highlight.active.open > a:hover { + background-color: #f1f5f9; +} +@media (min-width: 992px) { + .no-skin .sidebar.h-sidebar .nav-list > li.highlight.active > a:after { + display: block; + content: ""; + position: absolute; + left: 0; + top: auto; + right: auto; + bottom: -2px; + left: 50%; + margin-left: -7px; + border-color: transparent; + -moz-border-right-colors: none; + -moz-border-left-colors: none; + -moz-border-top-colors: none; + border-width: 8px 7px; + border-bottom-color: #FFF; + -moz-border-bottom-colors: #FFF; + } + .no-skin .sidebar.h-sidebar .nav-list > li.highlight.active > a:before { + content: ""; + position: absolute; + display: block; + left: 0; + top: auto; + right: auto; + bottom: -1px; + left: 50%; + margin-left: -7px; + border-width: 8px; + border-color: transparent; + -moz-border-right-colors: none; + -moz-border-left-colors: none; + -moz-border-top-colors: none; + border-bottom-color: #74add7; + -moz-border-bottom-colors: #74add7; + } + .no-skin .sidebar.h-sidebar .nav-list > li.highlight.active:hover > a:after, + .no-skin .sidebar.h-sidebar .nav-list > li.highlight.active.hover-show > a:after, + .no-skin .sidebar.h-sidebar .nav-list > li.highlight.active:hover > a:before, + .no-skin .sidebar.h-sidebar .nav-list > li.highlight.active.hover-show > a:before { + display: none; + } +} +@media (min-width: 992px) { + .sidebar.compact .nav-list li.highlight.active > a:after, + .sidebar.compact .nav-list li.highlight.active > a:before { + display: none; + } + .sidebar.compact.menu-min .nav-list li.highlight.active > a:after, + .sidebar.compact.menu-min .nav-list li.highlight.active > a:before { + display: block; + } +} +@media (min-width: 992px) { + .sidebar.h-sidebar .nav-list li.highlight.active > a:after, + .sidebar.h-sidebar .nav-list li.highlight.active > a:before { + display: block; + border-width: 8px !important; + -moz-border-left-colors: none !important; + -moz-border-right-colors: none !important; + border-left-color: transparent !important; + border-right-color: transparent !important; + } + .sidebar.h-sidebar .nav-list > li.highlight.active:hover > a:after, + .sidebar.h-sidebar .nav-list > li.highlight.active:hover > a:before { + display: none !important; + } +} +.sidebar-scroll .nav-list > li.active.highlight > a:after, +.sidebar-scroll .nav-list > li.active.highlight > a:before { + display: none !important; +} +.onpage-help-backdrop { + position: absolute; + z-index: 99990; + top: 0; + bottom: 0; + left: 0; + right: 0; + background-color: #000; + filter: alpha(opacity=5); + background-color: rgba(0, 0, 0, 0.05); +} +.onpage-help-section { + display: block; + position: absolute; + z-index: 100000; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#4DFFFFFF', endColorstr='#4DFFFFFF', GradientType=0); + background-color: rgba(255, 255, 255, 0.3); + border: 1px dashed #8BBCD3; + border-radius: 4px; + transition: background-color 0.2s, border-color 0.2s; + -webkit-transition: background-color 0.2s, border-color 0.2s; + text-align: center; + vertical-align: middle; + outline: none !important; +} +.onpage-help-section > .ie-hover-fix { + /* ie8-9 fix*/ + display: block; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + background-color: #FFF; + filter: alpha(opacity=1); +} +.onpage-help-section:focus, +.onpage-help-section:active { + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#33C9D8EA', endColorstr='#33C9D8EA', GradientType=0); + background-color: rgba(201, 216, 234, 0.2); + border-color: #77ACC4; +} +.onpage-help-section:hover { + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#66C9D8EA', endColorstr='#66C9D8EA', GradientType=0); + background-color: rgba(201, 216, 234, 0.4); + border-color: #77ACC4; + border-style: solid; +} +.onpage-help-section > .help-icon-1 { + font-size: 18px; + display: inline-block; + position: absolute; + z-index: 1; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + -webkit-transform: translate(-50%, -50%); + opacity: 0; + filter: alpha(opacity=0); + color: #FFF; + text-shadow: 0 0 2px black; + background-color: #85B8DB; + border: 2px solid #FFF; + border-radius: 100%; + box-shadow: 0 0 2px 1px rgba(0, 0, 0, 0.4); + width: 48px; + height: 48px; + line-height: 46px; + transition: opacity 0.2s; + -webkit-transition: opacity 0.2s; +} +.onpage-help-section:focus > .help-icon-1, +.onpage-help-section:active > .help-icon-1 { + opacity: 0.5; +} +.onpage-help-section:hover > .help-icon-1 { + opacity: 1; + filter: alpha(opacity=100); +} +.onpage-help-section.help-section-small > .help-icon-1 { + font-size: 18px; + width: 28px; + height: 28px; + line-height: 26px; + border-radius: 12px; +} +.onpage-help-section.help-section-smaller > .help-icon-1 { + font-size: 14px; + width: 20px; + height: 20px; + line-height: 17px; + border-radius: 8px; +} +.onpage-help-section > .help-icon-2 { + position: absolute; + z-index: 2; + left: -4px; + top: -4px; + width: 18px; + height: 18px; + line-height: 16px; + display: block; + font-size: 16px; + color: orange; + background-color: #FFF; + border: 1px solid orange; + border-radius: 4px; + opacity: 1; + transition: all 0.2s; + -webkit-transition: all 0.2s; +} +.onpage-help-section:hover > .help-icon-2 { + color: #59A34E; + border-color: #59A34E; + transform: scale(1.25); + -webkit-transform: scale(1.25); +} +.onpage-help-modal { + z-index: 100010; +} +.onpage-help-modal + .modal-backdrop { + z-index: 100009; +} +.onpage-help-modal-buttons button { + border-radius: 100%; + border-width: 2px !important; +} +.onpage-help-modal-buttons button:focus { + outline: none !important; +} +.onpage-help-modal-buttons button.disabled { + transform: scale(0.9); + -webkit-transform: scale(0.9); +} +.onpage-help-content { + max-width: 800px; + margin: 0 auto; +} +.code-modal.onpage-help-modal .modal-dialog { + margin-top: 6px; + margin-bottom: 6px; +} +.code-modal.onpage-help-modal .modal-header { + padding-top: 6px; + padding-bottom: 6px; +} +.code-modal.onpage-help-modal .modal-body { + padding: 10px 12px; +} +.onpage-help-modal pre { + border-width: 0; + box-shadow: none; + border-radius: 0; + margin-top: 8px; +} +.onpage-help-modal .modal-title code { + font-size: 13px; +} +.onpage-help-modal .modal-body { + font-size: 14px; +} +@media print { + .navbar { + display: none !important; + /** + background: transparent none !important; + border-bottom: 1px solid #DDD; + + .navbar-brand { + color: @text-color !important; + } + + .ace-nav { + display: none !important; + } + */ + } + .sidebar { + display: none !important; + } + .main-content { + margin-left: 0 !important; + margin-right: 0 !important; + } + .main-content .nav-search { + display: none !important; + } + .main-content .breadcrumbs { + float: right; + border-width: 0 !important; + } + .main-content .breadcrumbs .breadcrumb > li + li:before { + content: "/"; + } + .main-content .breadcrumbs .breadcrumb .home-icon { + display: none; + } + .ace-settings-container { + display: none !important; + } + .footer { + width: 100%; + height: auto; + position: relative; + } + .footer .footer-inner, + .footer .footer-inner .footer-content { + width: 100%; + } + .btn-scroll-up { + display: none !important; + } + .btn, + .btn.btn-app { + background: transparent none !important; + border-width: 1px !important; + border-radius: 0 !important; + color: #555 !important; + } + .label { + border: 1px solid #666 !important; + } + .label[class*=arrowed]:before, + .label[class*=arrowed]:after { + display: none !important; + } +} diff --git a/food-open/food-open-web/src/main/resources/static/assets/css/bootstrap.css b/food-open/food-open-web/src/main/resources/static/assets/css/bootstrap.css new file mode 100644 index 0000000..8e45463 --- /dev/null +++ b/food-open/food-open-web/src/main/resources/static/assets/css/bootstrap.css @@ -0,0 +1,6286 @@ +/*! normalize.css v3.0.2 | MIT License | git.io/normalize */ +html { + font-family: sans-serif; + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100%; +} +body { + margin: 0; +} +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +menu, +nav, +section, +summary { + display: block; +} +audio, +canvas, +progress, +video { + display: inline-block; + vertical-align: baseline; +} +audio:not([controls]) { + display: none; + height: 0; +} +[hidden], +template { + display: none; +} +a { + background-color: transparent; +} +a:active, +a:hover { + outline: 0; +} +abbr[title] { + border-bottom: 1px dotted; +} +b, +strong { + font-weight: bold; +} +dfn { + font-style: italic; +} +h1 { + font-size: 2em; + margin: 0.67em 0; +} +mark { + background: #ff0; + color: #000; +} +small { + font-size: 80%; +} +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} +sup { + top: -0.5em; +} +sub { + bottom: -0.25em; +} +img { + border: 0; +} +svg:not(:root) { + overflow: hidden; +} +figure { + margin: 1em 40px; +} +hr { + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 0; +} +pre { + overflow: auto; +} +code, +kbd, +pre, +samp { + font-family: monospace, monospace; + font-size: 1em; +} +button, +input, +optgroup, +select, +textarea { + color: inherit; + font: inherit; + margin: 0; +} +button { + overflow: visible; +} +button, +select { + text-transform: none; +} +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + cursor: pointer; +} +button[disabled], +html input[disabled] { + cursor: default; +} +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} +input { + line-height: normal; +} +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; + padding: 0; +} +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + height: auto; +} +input[type="search"] { + -webkit-appearance: textfield; + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; + box-sizing: content-box; +} +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} +legend { + border: 0; + padding: 0; +} +textarea { + overflow: auto; +} +optgroup { + font-weight: bold; +} +table { + border-collapse: collapse; + border-spacing: 0; +} +td, +th { + padding: 0; +} +/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ +@media print { + *, + *:before, + *:after { + background: transparent !important; + color: #000 !important; + box-shadow: none !important; + text-shadow: none !important; + } + a, + a:visited { + text-decoration: underline; + } + a[href]:after { + content: " (" attr(href) ")"; + } + abbr[title]:after { + content: " (" attr(title) ")"; + } + a[href^="#"]:after, + a[href^="javascript:"]:after { + content: ""; + } + pre, + blockquote { + border: 1px solid #999; + page-break-inside: avoid; + } + thead { + display: table-header-group; + } + tr, + img { + page-break-inside: avoid; + } + img { + max-width: 100% !important; + } + p, + h2, + h3 { + orphans: 3; + widows: 3; + } + h2, + h3 { + page-break-after: avoid; + } + select { + background: #fff !important; + } + .navbar { + display: none; + } + .btn > .caret, + .dropup > .btn > .caret { + border-top-color: #000 !important; + } + .label { + border: 1px solid #000; + } + .table { + border-collapse: collapse !important; + } + .table td, + .table th { + background-color: #fff !important; + } + .table-bordered th, + .table-bordered td { + border: 1px solid #ddd !important; + } +} +@font-face { + font-family: 'Glyphicons Halflings'; + src: url('../fonts/glyphicons-halflings-regular.eot'); + src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg'); +} +.glyphicon { + position: relative; + top: 1px; + display: inline-block; + font-family: 'Glyphicons Halflings'; + font-style: normal; + font-weight: normal; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +.glyphicon-asterisk:before { + content: "\2a"; +} +.glyphicon-plus:before { + content: "\2b"; +} +.glyphicon-euro:before, +.glyphicon-eur:before { + content: "\20ac"; +} +.glyphicon-minus:before { + content: "\2212"; +} +.glyphicon-cloud:before { + content: "\2601"; +} +.glyphicon-envelope:before { + content: "\2709"; +} +.glyphicon-pencil:before { + content: "\270f"; +} +.glyphicon-glass:before { + content: "\e001"; +} +.glyphicon-music:before { + content: "\e002"; +} +.glyphicon-search:before { + content: "\e003"; +} +.glyphicon-heart:before { + content: "\e005"; +} +.glyphicon-star:before { + content: "\e006"; +} +.glyphicon-star-empty:before { + content: "\e007"; +} +.glyphicon-user:before { + content: "\e008"; +} +.glyphicon-film:before { + content: "\e009"; +} +.glyphicon-th-large:before { + content: "\e010"; +} +.glyphicon-th:before { + content: "\e011"; +} +.glyphicon-th-list:before { + content: "\e012"; +} +.glyphicon-ok:before { + content: "\e013"; +} +.glyphicon-remove:before { + content: "\e014"; +} +.glyphicon-zoom-in:before { + content: "\e015"; +} +.glyphicon-zoom-out:before { + content: "\e016"; +} +.glyphicon-off:before { + content: "\e017"; +} +.glyphicon-signal:before { + content: "\e018"; +} +.glyphicon-cog:before { + content: "\e019"; +} +.glyphicon-trash:before { + content: "\e020"; +} +.glyphicon-home:before { + content: "\e021"; +} +.glyphicon-file:before { + content: "\e022"; +} +.glyphicon-time:before { + content: "\e023"; +} +.glyphicon-road:before { + content: "\e024"; +} +.glyphicon-download-alt:before { + content: "\e025"; +} +.glyphicon-download:before { + content: "\e026"; +} +.glyphicon-upload:before { + content: "\e027"; +} +.glyphicon-inbox:before { + content: "\e028"; +} +.glyphicon-play-circle:before { + content: "\e029"; +} +.glyphicon-repeat:before { + content: "\e030"; +} +.glyphicon-refresh:before { + content: "\e031"; +} +.glyphicon-list-alt:before { + content: "\e032"; +} +.glyphicon-lock:before { + content: "\e033"; +} +.glyphicon-flag:before { + content: "\e034"; +} +.glyphicon-headphones:before { + content: "\e035"; +} +.glyphicon-volume-off:before { + content: "\e036"; +} +.glyphicon-volume-down:before { + content: "\e037"; +} +.glyphicon-volume-up:before { + content: "\e038"; +} +.glyphicon-qrcode:before { + content: "\e039"; +} +.glyphicon-barcode:before { + content: "\e040"; +} +.glyphicon-tag:before { + content: "\e041"; +} +.glyphicon-tags:before { + content: "\e042"; +} +.glyphicon-book:before { + content: "\e043"; +} +.glyphicon-bookmark:before { + content: "\e044"; +} +.glyphicon-print:before { + content: "\e045"; +} +.glyphicon-camera:before { + content: "\e046"; +} +.glyphicon-font:before { + content: "\e047"; +} +.glyphicon-bold:before { + content: "\e048"; +} +.glyphicon-italic:before { + content: "\e049"; +} +.glyphicon-text-height:before { + content: "\e050"; +} +.glyphicon-text-width:before { + content: "\e051"; +} +.glyphicon-align-left:before { + content: "\e052"; +} +.glyphicon-align-center:before { + content: "\e053"; +} +.glyphicon-align-right:before { + content: "\e054"; +} +.glyphicon-align-justify:before { + content: "\e055"; +} +.glyphicon-list:before { + content: "\e056"; +} +.glyphicon-indent-left:before { + content: "\e057"; +} +.glyphicon-indent-right:before { + content: "\e058"; +} +.glyphicon-facetime-video:before { + content: "\e059"; +} +.glyphicon-picture:before { + content: "\e060"; +} +.glyphicon-map-marker:before { + content: "\e062"; +} +.glyphicon-adjust:before { + content: "\e063"; +} +.glyphicon-tint:before { + content: "\e064"; +} +.glyphicon-edit:before { + content: "\e065"; +} +.glyphicon-share:before { + content: "\e066"; +} +.glyphicon-check:before { + content: "\e067"; +} +.glyphicon-move:before { + content: "\e068"; +} +.glyphicon-step-backward:before { + content: "\e069"; +} +.glyphicon-fast-backward:before { + content: "\e070"; +} +.glyphicon-backward:before { + content: "\e071"; +} +.glyphicon-play:before { + content: "\e072"; +} +.glyphicon-pause:before { + content: "\e073"; +} +.glyphicon-stop:before { + content: "\e074"; +} +.glyphicon-forward:before { + content: "\e075"; +} +.glyphicon-fast-forward:before { + content: "\e076"; +} +.glyphicon-step-forward:before { + content: "\e077"; +} +.glyphicon-eject:before { + content: "\e078"; +} +.glyphicon-chevron-left:before { + content: "\e079"; +} +.glyphicon-chevron-right:before { + content: "\e080"; +} +.glyphicon-plus-sign:before { + content: "\e081"; +} +.glyphicon-minus-sign:before { + content: "\e082"; +} +.glyphicon-remove-sign:before { + content: "\e083"; +} +.glyphicon-ok-sign:before { + content: "\e084"; +} +.glyphicon-question-sign:before { + content: "\e085"; +} +.glyphicon-info-sign:before { + content: "\e086"; +} +.glyphicon-screenshot:before { + content: "\e087"; +} +.glyphicon-remove-circle:before { + content: "\e088"; +} +.glyphicon-ok-circle:before { + content: "\e089"; +} +.glyphicon-ban-circle:before { + content: "\e090"; +} +.glyphicon-arrow-left:before { + content: "\e091"; +} +.glyphicon-arrow-right:before { + content: "\e092"; +} +.glyphicon-arrow-up:before { + content: "\e093"; +} +.glyphicon-arrow-down:before { + content: "\e094"; +} +.glyphicon-share-alt:before { + content: "\e095"; +} +.glyphicon-resize-full:before { + content: "\e096"; +} +.glyphicon-resize-small:before { + content: "\e097"; +} +.glyphicon-exclamation-sign:before { + content: "\e101"; +} +.glyphicon-gift:before { + content: "\e102"; +} +.glyphicon-leaf:before { + content: "\e103"; +} +.glyphicon-fire:before { + content: "\e104"; +} +.glyphicon-eye-open:before { + content: "\e105"; +} +.glyphicon-eye-close:before { + content: "\e106"; +} +.glyphicon-warning-sign:before { + content: "\e107"; +} +.glyphicon-plane:before { + content: "\e108"; +} +.glyphicon-calendar:before { + content: "\e109"; +} +.glyphicon-random:before { + content: "\e110"; +} +.glyphicon-comment:before { + content: "\e111"; +} +.glyphicon-magnet:before { + content: "\e112"; +} +.glyphicon-chevron-up:before { + content: "\e113"; +} +.glyphicon-chevron-down:before { + content: "\e114"; +} +.glyphicon-retweet:before { + content: "\e115"; +} +.glyphicon-shopping-cart:before { + content: "\e116"; +} +.glyphicon-folder-close:before { + content: "\e117"; +} +.glyphicon-folder-open:before { + content: "\e118"; +} +.glyphicon-resize-vertical:before { + content: "\e119"; +} +.glyphicon-resize-horizontal:before { + content: "\e120"; +} +.glyphicon-hdd:before { + content: "\e121"; +} +.glyphicon-bullhorn:before { + content: "\e122"; +} +.glyphicon-bell:before { + content: "\e123"; +} +.glyphicon-certificate:before { + content: "\e124"; +} +.glyphicon-thumbs-up:before { + content: "\e125"; +} +.glyphicon-thumbs-down:before { + content: "\e126"; +} +.glyphicon-hand-right:before { + content: "\e127"; +} +.glyphicon-hand-left:before { + content: "\e128"; +} +.glyphicon-hand-up:before { + content: "\e129"; +} +.glyphicon-hand-down:before { + content: "\e130"; +} +.glyphicon-circle-arrow-right:before { + content: "\e131"; +} +.glyphicon-circle-arrow-left:before { + content: "\e132"; +} +.glyphicon-circle-arrow-up:before { + content: "\e133"; +} +.glyphicon-circle-arrow-down:before { + content: "\e134"; +} +.glyphicon-globe:before { + content: "\e135"; +} +.glyphicon-wrench:before { + content: "\e136"; +} +.glyphicon-tasks:before { + content: "\e137"; +} +.glyphicon-filter:before { + content: "\e138"; +} +.glyphicon-briefcase:before { + content: "\e139"; +} +.glyphicon-fullscreen:before { + content: "\e140"; +} +.glyphicon-dashboard:before { + content: "\e141"; +} +.glyphicon-paperclip:before { + content: "\e142"; +} +.glyphicon-heart-empty:before { + content: "\e143"; +} +.glyphicon-link:before { + content: "\e144"; +} +.glyphicon-phone:before { + content: "\e145"; +} +.glyphicon-pushpin:before { + content: "\e146"; +} +.glyphicon-usd:before { + content: "\e148"; +} +.glyphicon-gbp:before { + content: "\e149"; +} +.glyphicon-sort:before { + content: "\e150"; +} +.glyphicon-sort-by-alphabet:before { + content: "\e151"; +} +.glyphicon-sort-by-alphabet-alt:before { + content: "\e152"; +} +.glyphicon-sort-by-order:before { + content: "\e153"; +} +.glyphicon-sort-by-order-alt:before { + content: "\e154"; +} +.glyphicon-sort-by-attributes:before { + content: "\e155"; +} +.glyphicon-sort-by-attributes-alt:before { + content: "\e156"; +} +.glyphicon-unchecked:before { + content: "\e157"; +} +.glyphicon-expand:before { + content: "\e158"; +} +.glyphicon-collapse-down:before { + content: "\e159"; +} +.glyphicon-collapse-up:before { + content: "\e160"; +} +.glyphicon-log-in:before { + content: "\e161"; +} +.glyphicon-flash:before { + content: "\e162"; +} +.glyphicon-log-out:before { + content: "\e163"; +} +.glyphicon-new-window:before { + content: "\e164"; +} +.glyphicon-record:before { + content: "\e165"; +} +.glyphicon-save:before { + content: "\e166"; +} +.glyphicon-open:before { + content: "\e167"; +} +.glyphicon-saved:before { + content: "\e168"; +} +.glyphicon-import:before { + content: "\e169"; +} +.glyphicon-export:before { + content: "\e170"; +} +.glyphicon-send:before { + content: "\e171"; +} +.glyphicon-floppy-disk:before { + content: "\e172"; +} +.glyphicon-floppy-saved:before { + content: "\e173"; +} +.glyphicon-floppy-remove:before { + content: "\e174"; +} +.glyphicon-floppy-save:before { + content: "\e175"; +} +.glyphicon-floppy-open:before { + content: "\e176"; +} +.glyphicon-credit-card:before { + content: "\e177"; +} +.glyphicon-transfer:before { + content: "\e178"; +} +.glyphicon-cutlery:before { + content: "\e179"; +} +.glyphicon-header:before { + content: "\e180"; +} +.glyphicon-compressed:before { + content: "\e181"; +} +.glyphicon-earphone:before { + content: "\e182"; +} +.glyphicon-phone-alt:before { + content: "\e183"; +} +.glyphicon-tower:before { + content: "\e184"; +} +.glyphicon-stats:before { + content: "\e185"; +} +.glyphicon-sd-video:before { + content: "\e186"; +} +.glyphicon-hd-video:before { + content: "\e187"; +} +.glyphicon-subtitles:before { + content: "\e188"; +} +.glyphicon-sound-stereo:before { + content: "\e189"; +} +.glyphicon-sound-dolby:before { + content: "\e190"; +} +.glyphicon-sound-5-1:before { + content: "\e191"; +} +.glyphicon-sound-6-1:before { + content: "\e192"; +} +.glyphicon-sound-7-1:before { + content: "\e193"; +} +.glyphicon-copyright-mark:before { + content: "\e194"; +} +.glyphicon-registration-mark:before { + content: "\e195"; +} +.glyphicon-cloud-download:before { + content: "\e197"; +} +.glyphicon-cloud-upload:before { + content: "\e198"; +} +.glyphicon-tree-conifer:before { + content: "\e199"; +} +.glyphicon-tree-deciduous:before { + content: "\e200"; +} +* { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +*:before, +*:after { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +html { + font-size: 10px; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); +} +body { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 1.42857143; + color: #333333; + background-color: #ffffff; +} +input, +button, +select, +textarea { + font-family: inherit; + font-size: inherit; + line-height: inherit; +} +a { + color: #337ab7; + text-decoration: none; +} +a:hover, +a:focus { + color: #23527c; + text-decoration: underline; +} +a:focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +figure { + margin: 0; +} +img { + vertical-align: middle; +} +.img-responsive, +.thumbnail > img, +.thumbnail a > img, +.carousel-inner > .item > img, +.carousel-inner > .item > a > img { + display: block; + max-width: 100%; + height: auto; +} +.img-rounded { + border-radius: 6px; +} +.img-thumbnail { + padding: 4px; + line-height: 1.42857143; + background-color: #ffffff; + border: 1px solid #dddddd; + border-radius: 4px; + -webkit-transition: all 0.2s ease-in-out; + -o-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; + display: inline-block; + max-width: 100%; + height: auto; +} +.img-circle { + border-radius: 50%; +} +hr { + margin-top: 20px; + margin-bottom: 20px; + border: 0; + border-top: 1px solid #eeeeee; +} +.sr-only { + position: absolute; + width: 1px; + height: 1px; + margin: -1px; + padding: 0; + overflow: hidden; + clip: rect(0, 0, 0, 0); + border: 0; +} +.sr-only-focusable:active, +.sr-only-focusable:focus { + position: static; + width: auto; + height: auto; + margin: 0; + overflow: visible; + clip: auto; +} +h1, +h2, +h3, +h4, +h5, +h6, +.h1, +.h2, +.h3, +.h4, +.h5, +.h6 { + font-family: inherit; + font-weight: 500; + line-height: 1.1; + color: inherit; +} +h1 small, +h2 small, +h3 small, +h4 small, +h5 small, +h6 small, +.h1 small, +.h2 small, +.h3 small, +.h4 small, +.h5 small, +.h6 small, +h1 .small, +h2 .small, +h3 .small, +h4 .small, +h5 .small, +h6 .small, +.h1 .small, +.h2 .small, +.h3 .small, +.h4 .small, +.h5 .small, +.h6 .small { + font-weight: normal; + line-height: 1; + color: #777777; +} +h1, +.h1, +h2, +.h2, +h3, +.h3 { + margin-top: 20px; + margin-bottom: 10px; +} +h1 small, +.h1 small, +h2 small, +.h2 small, +h3 small, +.h3 small, +h1 .small, +.h1 .small, +h2 .small, +.h2 .small, +h3 .small, +.h3 .small { + font-size: 65%; +} +h4, +.h4, +h5, +.h5, +h6, +.h6 { + margin-top: 10px; + margin-bottom: 10px; +} +h4 small, +.h4 small, +h5 small, +.h5 small, +h6 small, +.h6 small, +h4 .small, +.h4 .small, +h5 .small, +.h5 .small, +h6 .small, +.h6 .small { + font-size: 75%; +} +h1, +.h1 { + font-size: 36px; +} +h2, +.h2 { + font-size: 30px; +} +h3, +.h3 { + font-size: 24px; +} +h4, +.h4 { + font-size: 18px; +} +h5, +.h5 { + font-size: 14px; +} +h6, +.h6 { + font-size: 12px; +} +p { + margin: 0 0 10px; +} +.lead { + margin-bottom: 20px; + font-size: 16px; + font-weight: 300; + line-height: 1.4; +} +@media (min-width: 768px) { + .lead { + font-size: 21px; + } +} +small, +.small { + font-size: 85%; +} +mark, +.mark { + background-color: #fcf8e3; + padding: .2em; +} +.text-left { + text-align: left; +} +.text-right { + text-align: right; +} +.text-center { + text-align: center; +} +.text-justify { + text-align: justify; +} +.text-nowrap { + white-space: nowrap; +} +.text-lowercase { + text-transform: lowercase; +} +.text-uppercase { + text-transform: uppercase; +} +.text-capitalize { + text-transform: capitalize; +} +.text-muted { + color: #777777; +} +.text-primary { + color: #337ab7; +} +a.text-primary:hover { + color: #286090; +} +.text-success { + color: #3c763d; +} +a.text-success:hover { + color: #2b542c; +} +.text-info { + color: #31708f; +} +a.text-info:hover { + color: #245269; +} +.text-warning { + color: #8a6d3b; +} +a.text-warning:hover { + color: #66512c; +} +.text-danger { + color: #a94442; +} +a.text-danger:hover { + color: #843534; +} +.bg-primary { + color: #fff; + background-color: #337ab7; +} +a.bg-primary:hover { + background-color: #286090; +} +.bg-success { + background-color: #dff0d8; +} +a.bg-success:hover { + background-color: #c1e2b3; +} +.bg-info { + background-color: #d9edf7; +} +a.bg-info:hover { + background-color: #afd9ee; +} +.bg-warning { + background-color: #fcf8e3; +} +a.bg-warning:hover { + background-color: #f7ecb5; +} +.bg-danger { + background-color: #f2dede; +} +a.bg-danger:hover { + background-color: #e4b9b9; +} +.page-header { + padding-bottom: 9px; + margin: 40px 0 20px; + border-bottom: 1px solid #eeeeee; +} +ul, +ol { + margin-top: 0; + margin-bottom: 10px; +} +ul ul, +ol ul, +ul ol, +ol ol { + margin-bottom: 0; +} +.list-unstyled { + padding-left: 0; + list-style: none; +} +.list-inline { + padding-left: 0; + list-style: none; + margin-left: -5px; +} +.list-inline > li { + display: inline-block; + padding-left: 5px; + padding-right: 5px; +} +dl { + margin-top: 0; + margin-bottom: 20px; +} +dt, +dd { + line-height: 1.42857143; +} +dt { + font-weight: bold; +} +dd { + margin-left: 0; +} +@media (min-width: 992px) { + .dl-horizontal dt { + float: left; + width: 160px; + clear: left; + text-align: right; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + .dl-horizontal dd { + margin-left: 180px; + } +} +abbr[title], +abbr[data-original-title] { + cursor: help; + border-bottom: 1px dotted #777777; +} +.initialism { + font-size: 90%; + text-transform: uppercase; +} +blockquote { + padding: 10px 20px; + margin: 0 0 20px; + font-size: 17.5px; + border-left: 5px solid #eeeeee; +} +blockquote p:last-child, +blockquote ul:last-child, +blockquote ol:last-child { + margin-bottom: 0; +} +blockquote footer, +blockquote small, +blockquote .small { + display: block; + font-size: 80%; + line-height: 1.42857143; + color: #777777; +} +blockquote footer:before, +blockquote small:before, +blockquote .small:before { + content: '\2014 \00A0'; +} +.blockquote-reverse, +blockquote.pull-right { + padding-right: 15px; + padding-left: 0; + border-right: 5px solid #eeeeee; + border-left: 0; + text-align: right; +} +.blockquote-reverse footer:before, +blockquote.pull-right footer:before, +.blockquote-reverse small:before, +blockquote.pull-right small:before, +.blockquote-reverse .small:before, +blockquote.pull-right .small:before { + content: ''; +} +.blockquote-reverse footer:after, +blockquote.pull-right footer:after, +.blockquote-reverse small:after, +blockquote.pull-right small:after, +.blockquote-reverse .small:after, +blockquote.pull-right .small:after { + content: '\00A0 \2014'; +} +address { + margin-bottom: 20px; + font-style: normal; + line-height: 1.42857143; +} +code, +kbd, +pre, +samp { + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; +} +code { + padding: 2px 4px; + font-size: 90%; + color: #c7254e; + background-color: #f9f2f4; + border-radius: 4px; +} +kbd { + padding: 2px 4px; + font-size: 90%; + color: #ffffff; + background-color: #333333; + border-radius: 3px; + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25); +} +kbd kbd { + padding: 0; + font-size: 100%; + font-weight: bold; + box-shadow: none; +} +pre { + display: block; + padding: 9.5px; + margin: 0 0 10px; + font-size: 13px; + line-height: 1.42857143; + word-break: break-all; + word-wrap: break-word; + color: #333333; + background-color: #f5f5f5; + border: 1px solid #cccccc; + border-radius: 4px; +} +pre code { + padding: 0; + font-size: inherit; + color: inherit; + white-space: pre-wrap; + background-color: transparent; + border-radius: 0; +} +.pre-scrollable { + max-height: 340px; + overflow-y: scroll; +} +.container { + margin-right: auto; + margin-left: auto; + padding-left: 12px; + padding-right: 12px; +} +@media (min-width: 768px) { + .container { + width: 744px; + } +} +@media (min-width: 992px) { + .container { + width: 964px; + } +} +@media (min-width: 1200px) { + .container { + width: 1164px; + } +} +.container-fluid { + margin-right: auto; + margin-left: auto; + padding-left: 12px; + padding-right: 12px; +} +.row { + margin-left: -12px; + margin-right: -12px; +} +.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 { + position: relative; + min-height: 1px; + padding-left: 12px; + padding-right: 12px; +} +.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 { + float: left; +} +.col-xs-12 { + width: 100%; +} +.col-xs-11 { + width: 91.666%; +} +.col-xs-10 { + width: 83.333%; +} +.col-xs-9 { + width: 75%; +} +.col-xs-8 { + width: 66.666%; +} +.col-xs-7 { + width: 58.333%; +} +.col-xs-6 { + width: 50%; +} +.col-xs-5 { + width: 41.666%; +} +.col-xs-4 { + width: 33.333%; +} +.col-xs-3 { + width: 25%; +} +.col-xs-2 { + width: 16.666%; +} +.col-xs-1 { + width: 8.333%; +} +.col-xs-pull-12 { + right: 100%; +} +.col-xs-pull-11 { + right: 91.666%; +} +.col-xs-pull-10 { + right: 83.333%; +} +.col-xs-pull-9 { + right: 75%; +} +.col-xs-pull-8 { + right: 66.666%; +} +.col-xs-pull-7 { + right: 58.333%; +} +.col-xs-pull-6 { + right: 50%; +} +.col-xs-pull-5 { + right: 41.666%; +} +.col-xs-pull-4 { + right: 33.333%; +} +.col-xs-pull-3 { + right: 25%; +} +.col-xs-pull-2 { + right: 16.666%; +} +.col-xs-pull-1 { + right: 8.333%; +} +.col-xs-pull-0 { + right: auto; +} +.col-xs-push-12 { + left: 100%; +} +.col-xs-push-11 { + left: 91.666%; +} +.col-xs-push-10 { + left: 83.333%; +} +.col-xs-push-9 { + left: 75%; +} +.col-xs-push-8 { + left: 66.666%; +} +.col-xs-push-7 { + left: 58.333%; +} +.col-xs-push-6 { + left: 50%; +} +.col-xs-push-5 { + left: 41.666%; +} +.col-xs-push-4 { + left: 33.333%; +} +.col-xs-push-3 { + left: 25%; +} +.col-xs-push-2 { + left: 16.666%; +} +.col-xs-push-1 { + left: 8.333%; +} +.col-xs-push-0 { + left: auto; +} +.col-xs-offset-12 { + margin-left: 100%; +} +.col-xs-offset-11 { + margin-left: 91.666%; +} +.col-xs-offset-10 { + margin-left: 83.333%; +} +.col-xs-offset-9 { + margin-left: 75%; +} +.col-xs-offset-8 { + margin-left: 66.666%; +} +.col-xs-offset-7 { + margin-left: 58.333%; +} +.col-xs-offset-6 { + margin-left: 50%; +} +.col-xs-offset-5 { + margin-left: 41.666%; +} +.col-xs-offset-4 { + margin-left: 33.333%; +} +.col-xs-offset-3 { + margin-left: 25%; +} +.col-xs-offset-2 { + margin-left: 16.666%; +} +.col-xs-offset-1 { + margin-left: 8.333%; +} +.col-xs-offset-0 { + margin-left: 0%; +} +@media (min-width: 768px) { + .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 { + float: left; + } + .col-sm-12 { + width: 100%; + } + .col-sm-11 { + width: 91.666%; + } + .col-sm-10 { + width: 83.333%; + } + .col-sm-9 { + width: 75%; + } + .col-sm-8 { + width: 66.666%; + } + .col-sm-7 { + width: 58.333%; + } + .col-sm-6 { + width: 50%; + } + .col-sm-5 { + width: 41.666%; + } + .col-sm-4 { + width: 33.333%; + } + .col-sm-3 { + width: 25%; + } + .col-sm-2 { + width: 16.666%; + } + .col-sm-1 { + width: 8.333%; + } + .col-sm-pull-12 { + right: 100%; + } + .col-sm-pull-11 { + right: 91.666%; + } + .col-sm-pull-10 { + right: 83.333%; + } + .col-sm-pull-9 { + right: 75%; + } + .col-sm-pull-8 { + right: 66.666%; + } + .col-sm-pull-7 { + right: 58.333%; + } + .col-sm-pull-6 { + right: 50%; + } + .col-sm-pull-5 { + right: 41.666%; + } + .col-sm-pull-4 { + right: 33.333%; + } + .col-sm-pull-3 { + right: 25%; + } + .col-sm-pull-2 { + right: 16.666%; + } + .col-sm-pull-1 { + right: 8.333%; + } + .col-sm-pull-0 { + right: auto; + } + .col-sm-push-12 { + left: 100%; + } + .col-sm-push-11 { + left: 91.666%; + } + .col-sm-push-10 { + left: 83.333%; + } + .col-sm-push-9 { + left: 75%; + } + .col-sm-push-8 { + left: 66.666%; + } + .col-sm-push-7 { + left: 58.333%; + } + .col-sm-push-6 { + left: 50%; + } + .col-sm-push-5 { + left: 41.666%; + } + .col-sm-push-4 { + left: 33.333%; + } + .col-sm-push-3 { + left: 25%; + } + .col-sm-push-2 { + left: 16.666%; + } + .col-sm-push-1 { + left: 8.333%; + } + .col-sm-push-0 { + left: auto; + } + .col-sm-offset-12 { + margin-left: 100%; + } + .col-sm-offset-11 { + margin-left: 91.666%; + } + .col-sm-offset-10 { + margin-left: 83.333%; + } + .col-sm-offset-9 { + margin-left: 75%; + } + .col-sm-offset-8 { + margin-left: 66.666%; + } + .col-sm-offset-7 { + margin-left: 58.333%; + } + .col-sm-offset-6 { + margin-left: 50%; + } + .col-sm-offset-5 { + margin-left: 41.666%; + } + .col-sm-offset-4 { + margin-left: 33.333%; + } + .col-sm-offset-3 { + margin-left: 25%; + } + .col-sm-offset-2 { + margin-left: 16.666%; + } + .col-sm-offset-1 { + margin-left: 8.333%; + } + .col-sm-offset-0 { + margin-left: 0%; + } +} +@media (min-width: 992px) { + .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 { + float: left; + } + .col-md-12 { + width: 100%; + } + .col-md-11 { + width: 91.666%; + } + .col-md-10 { + width: 83.333%; + } + .col-md-9 { + width: 75%; + } + .col-md-8 { + width: 66.666%; + } + .col-md-7 { + width: 58.333%; + } + .col-md-6 { + width: 50%; + } + .col-md-5 { + width: 41.666%; + } + .col-md-4 { + width: 33.333%; + } + .col-md-3 { + width: 25%; + } + .col-md-2 { + width: 16.666%; + } + .col-md-1 { + width: 8.333%; + } + .col-md-pull-12 { + right: 100%; + } + .col-md-pull-11 { + right: 91.666%; + } + .col-md-pull-10 { + right: 83.333%; + } + .col-md-pull-9 { + right: 75%; + } + .col-md-pull-8 { + right: 66.666%; + } + .col-md-pull-7 { + right: 58.333%; + } + .col-md-pull-6 { + right: 50%; + } + .col-md-pull-5 { + right: 41.666%; + } + .col-md-pull-4 { + right: 33.333%; + } + .col-md-pull-3 { + right: 25%; + } + .col-md-pull-2 { + right: 16.666%; + } + .col-md-pull-1 { + right: 8.333%; + } + .col-md-pull-0 { + right: auto; + } + .col-md-push-12 { + left: 100%; + } + .col-md-push-11 { + left: 91.666%; + } + .col-md-push-10 { + left: 83.333%; + } + .col-md-push-9 { + left: 75%; + } + .col-md-push-8 { + left: 66.666%; + } + .col-md-push-7 { + left: 58.333%; + } + .col-md-push-6 { + left: 50%; + } + .col-md-push-5 { + left: 41.666%; + } + .col-md-push-4 { + left: 33.333%; + } + .col-md-push-3 { + left: 25%; + } + .col-md-push-2 { + left: 16.666%; + } + .col-md-push-1 { + left: 8.333%; + } + .col-md-push-0 { + left: auto; + } + .col-md-offset-12 { + margin-left: 100%; + } + .col-md-offset-11 { + margin-left: 91.666%; + } + .col-md-offset-10 { + margin-left: 83.333%; + } + .col-md-offset-9 { + margin-left: 75%; + } + .col-md-offset-8 { + margin-left: 66.666%; + } + .col-md-offset-7 { + margin-left: 58.333%; + } + .col-md-offset-6 { + margin-left: 50%; + } + .col-md-offset-5 { + margin-left: 41.666%; + } + .col-md-offset-4 { + margin-left: 33.333%; + } + .col-md-offset-3 { + margin-left: 25%; + } + .col-md-offset-2 { + margin-left: 16.666%; + } + .col-md-offset-1 { + margin-left: 8.333%; + } + .col-md-offset-0 { + margin-left: 0%; + } +} +@media (min-width: 1200px) { + .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 { + float: left; + } + .col-lg-12 { + width: 100%; + } + .col-lg-11 { + width: 91.666%; + } + .col-lg-10 { + width: 83.333%; + } + .col-lg-9 { + width: 75%; + } + .col-lg-8 { + width: 66.666%; + } + .col-lg-7 { + width: 58.333%; + } + .col-lg-6 { + width: 50%; + } + .col-lg-5 { + width: 41.666%; + } + .col-lg-4 { + width: 33.333%; + } + .col-lg-3 { + width: 25%; + } + .col-lg-2 { + width: 16.666%; + } + .col-lg-1 { + width: 8.333%; + } + .col-lg-pull-12 { + right: 100%; + } + .col-lg-pull-11 { + right: 91.666%; + } + .col-lg-pull-10 { + right: 83.333%; + } + .col-lg-pull-9 { + right: 75%; + } + .col-lg-pull-8 { + right: 66.666%; + } + .col-lg-pull-7 { + right: 58.333%; + } + .col-lg-pull-6 { + right: 50%; + } + .col-lg-pull-5 { + right: 41.666%; + } + .col-lg-pull-4 { + right: 33.333%; + } + .col-lg-pull-3 { + right: 25%; + } + .col-lg-pull-2 { + right: 16.666%; + } + .col-lg-pull-1 { + right: 8.333%; + } + .col-lg-pull-0 { + right: auto; + } + .col-lg-push-12 { + left: 100%; + } + .col-lg-push-11 { + left: 91.666%; + } + .col-lg-push-10 { + left: 83.333%; + } + .col-lg-push-9 { + left: 75%; + } + .col-lg-push-8 { + left: 66.666%; + } + .col-lg-push-7 { + left: 58.333%; + } + .col-lg-push-6 { + left: 50%; + } + .col-lg-push-5 { + left: 41.666%; + } + .col-lg-push-4 { + left: 33.333%; + } + .col-lg-push-3 { + left: 25%; + } + .col-lg-push-2 { + left: 16.666%; + } + .col-lg-push-1 { + left: 8.333%; + } + .col-lg-push-0 { + left: auto; + } + .col-lg-offset-12 { + margin-left: 100%; + } + .col-lg-offset-11 { + margin-left: 91.666%; + } + .col-lg-offset-10 { + margin-left: 83.333%; + } + .col-lg-offset-9 { + margin-left: 75%; + } + .col-lg-offset-8 { + margin-left: 66.666%; + } + .col-lg-offset-7 { + margin-left: 58.333%; + } + .col-lg-offset-6 { + margin-left: 50%; + } + .col-lg-offset-5 { + margin-left: 41.666%; + } + .col-lg-offset-4 { + margin-left: 33.333%; + } + .col-lg-offset-3 { + margin-left: 25%; + } + .col-lg-offset-2 { + margin-left: 16.666%; + } + .col-lg-offset-1 { + margin-left: 8.333%; + } + .col-lg-offset-0 { + margin-left: 0%; + } +} +table { + background-color: transparent; +} +caption { + padding-top: 8px; + padding-bottom: 8px; + color: #777777; + text-align: left; +} +th { + text-align: left; +} +.table { + width: 100%; + max-width: 100%; + margin-bottom: 20px; +} +.table > thead > tr > th, +.table > tbody > tr > th, +.table > tfoot > tr > th, +.table > thead > tr > td, +.table > tbody > tr > td, +.table > tfoot > tr > td { + padding: 8px; + line-height: 1.42857143; + vertical-align: top; + border-top: 1px solid #dddddd; +} +.table > thead > tr > th { + vertical-align: bottom; + border-bottom: 2px solid #dddddd; +} +.table > caption + thead > tr:first-child > th, +.table > colgroup + thead > tr:first-child > th, +.table > thead:first-child > tr:first-child > th, +.table > caption + thead > tr:first-child > td, +.table > colgroup + thead > tr:first-child > td, +.table > thead:first-child > tr:first-child > td { + border-top: 0; +} +.table > tbody + tbody { + border-top: 2px solid #dddddd; +} +.table .table { + background-color: #ffffff; +} +.table-condensed > thead > tr > th, +.table-condensed > tbody > tr > th, +.table-condensed > tfoot > tr > th, +.table-condensed > thead > tr > td, +.table-condensed > tbody > tr > td, +.table-condensed > tfoot > tr > td { + padding: 5px; +} +.table-bordered { + border: 1px solid #dddddd; +} +.table-bordered > thead > tr > th, +.table-bordered > tbody > tr > th, +.table-bordered > tfoot > tr > th, +.table-bordered > thead > tr > td, +.table-bordered > tbody > tr > td, +.table-bordered > tfoot > tr > td { + border: 1px solid #dddddd; +} +.table-bordered > thead > tr > th, +.table-bordered > thead > tr > td { + border-bottom-width: 2px; +} +.table-striped > tbody > tr:nth-child(odd) { + background-color: #f9f9f9; +} +.table-hover > tbody > tr:hover { + background-color: #f5f5f5; +} +table col[class*="col-"] { + position: static; + float: none; + display: table-column; +} +table td[class*="col-"], +table th[class*="col-"] { + position: static; + float: none; + display: table-cell; +} +.table > thead > tr > td.active, +.table > tbody > tr > td.active, +.table > tfoot > tr > td.active, +.table > thead > tr > th.active, +.table > tbody > tr > th.active, +.table > tfoot > tr > th.active, +.table > thead > tr.active > td, +.table > tbody > tr.active > td, +.table > tfoot > tr.active > td, +.table > thead > tr.active > th, +.table > tbody > tr.active > th, +.table > tfoot > tr.active > th { + background-color: #f5f5f5; +} +.table-hover > tbody > tr > td.active:hover, +.table-hover > tbody > tr > th.active:hover, +.table-hover > tbody > tr.active:hover > td, +.table-hover > tbody > tr:hover > .active, +.table-hover > tbody > tr.active:hover > th { + background-color: #e8e8e8; +} +.table > thead > tr > td.success, +.table > tbody > tr > td.success, +.table > tfoot > tr > td.success, +.table > thead > tr > th.success, +.table > tbody > tr > th.success, +.table > tfoot > tr > th.success, +.table > thead > tr.success > td, +.table > tbody > tr.success > td, +.table > tfoot > tr.success > td, +.table > thead > tr.success > th, +.table > tbody > tr.success > th, +.table > tfoot > tr.success > th { + background-color: #dff0d8; +} +.table-hover > tbody > tr > td.success:hover, +.table-hover > tbody > tr > th.success:hover, +.table-hover > tbody > tr.success:hover > td, +.table-hover > tbody > tr:hover > .success, +.table-hover > tbody > tr.success:hover > th { + background-color: #d0e9c6; +} +.table > thead > tr > td.info, +.table > tbody > tr > td.info, +.table > tfoot > tr > td.info, +.table > thead > tr > th.info, +.table > tbody > tr > th.info, +.table > tfoot > tr > th.info, +.table > thead > tr.info > td, +.table > tbody > tr.info > td, +.table > tfoot > tr.info > td, +.table > thead > tr.info > th, +.table > tbody > tr.info > th, +.table > tfoot > tr.info > th { + background-color: #d9edf7; +} +.table-hover > tbody > tr > td.info:hover, +.table-hover > tbody > tr > th.info:hover, +.table-hover > tbody > tr.info:hover > td, +.table-hover > tbody > tr:hover > .info, +.table-hover > tbody > tr.info:hover > th { + background-color: #c4e3f3; +} +.table > thead > tr > td.warning, +.table > tbody > tr > td.warning, +.table > tfoot > tr > td.warning, +.table > thead > tr > th.warning, +.table > tbody > tr > th.warning, +.table > tfoot > tr > th.warning, +.table > thead > tr.warning > td, +.table > tbody > tr.warning > td, +.table > tfoot > tr.warning > td, +.table > thead > tr.warning > th, +.table > tbody > tr.warning > th, +.table > tfoot > tr.warning > th { + background-color: #fcf8e3; +} +.table-hover > tbody > tr > td.warning:hover, +.table-hover > tbody > tr > th.warning:hover, +.table-hover > tbody > tr.warning:hover > td, +.table-hover > tbody > tr:hover > .warning, +.table-hover > tbody > tr.warning:hover > th { + background-color: #faf2cc; +} +.table > thead > tr > td.danger, +.table > tbody > tr > td.danger, +.table > tfoot > tr > td.danger, +.table > thead > tr > th.danger, +.table > tbody > tr > th.danger, +.table > tfoot > tr > th.danger, +.table > thead > tr.danger > td, +.table > tbody > tr.danger > td, +.table > tfoot > tr.danger > td, +.table > thead > tr.danger > th, +.table > tbody > tr.danger > th, +.table > tfoot > tr.danger > th { + background-color: #f2dede; +} +.table-hover > tbody > tr > td.danger:hover, +.table-hover > tbody > tr > th.danger:hover, +.table-hover > tbody > tr.danger:hover > td, +.table-hover > tbody > tr:hover > .danger, +.table-hover > tbody > tr.danger:hover > th { + background-color: #ebcccc; +} +.table-responsive { + overflow-x: auto; + min-height: 0.01%; +} +@media screen and (max-width: 767px) { + .table-responsive { + width: 100%; + margin-bottom: 15px; + overflow-y: hidden; + -ms-overflow-style: -ms-autohiding-scrollbar; + border: 1px solid #dddddd; + } + .table-responsive > .table { + margin-bottom: 0; + } + .table-responsive > .table > thead > tr > th, + .table-responsive > .table > tbody > tr > th, + .table-responsive > .table > tfoot > tr > th, + .table-responsive > .table > thead > tr > td, + .table-responsive > .table > tbody > tr > td, + .table-responsive > .table > tfoot > tr > td { + white-space: nowrap; + } + .table-responsive > .table-bordered { + border: 0; + } + .table-responsive > .table-bordered > thead > tr > th:first-child, + .table-responsive > .table-bordered > tbody > tr > th:first-child, + .table-responsive > .table-bordered > tfoot > tr > th:first-child, + .table-responsive > .table-bordered > thead > tr > td:first-child, + .table-responsive > .table-bordered > tbody > tr > td:first-child, + .table-responsive > .table-bordered > tfoot > tr > td:first-child { + border-left: 0; + } + .table-responsive > .table-bordered > thead > tr > th:last-child, + .table-responsive > .table-bordered > tbody > tr > th:last-child, + .table-responsive > .table-bordered > tfoot > tr > th:last-child, + .table-responsive > .table-bordered > thead > tr > td:last-child, + .table-responsive > .table-bordered > tbody > tr > td:last-child, + .table-responsive > .table-bordered > tfoot > tr > td:last-child { + border-right: 0; + } + .table-responsive > .table-bordered > tbody > tr:last-child > th, + .table-responsive > .table-bordered > tfoot > tr:last-child > th, + .table-responsive > .table-bordered > tbody > tr:last-child > td, + .table-responsive > .table-bordered > tfoot > tr:last-child > td { + border-bottom: 0; + } +} +fieldset { + padding: 0; + margin: 0; + border: 0; + min-width: 0; +} +legend { + display: block; + width: 100%; + padding: 0; + margin-bottom: 20px; + font-size: 21px; + line-height: inherit; + color: #333333; + border: 0; + border-bottom: 1px solid #e5e5e5; +} +label { + display: inline-block; + margin-bottom: 5px; + font-weight: bold; +} +input[type="search"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +input[type="radio"], +input[type="checkbox"] { + margin: 4px 0 0; + margin-top: 1px \9; + line-height: normal; +} +input[type="file"] { + display: block; +} +input[type="range"] { + display: block; + width: 100%; +} +select[multiple], +select[size] { + height: auto; +} +input[type="file"]:focus, +input[type="radio"]:focus, +input[type="checkbox"]:focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +output { + display: block; + padding-top: 7px; + font-size: 14px; + line-height: 1.42857143; + color: #555555; +} +.form-control { + display: block; + width: 100%; + height: 34px; + padding: 6px 12px; + font-size: 14px; + line-height: 1.42857143; + color: #555555; + background-color: #ffffff; + background-image: none; + border: 1px solid #cccccc; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; + -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; + transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; +} +.form-control:focus { + border-color: #66afe9; + outline: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); + box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); +} +.form-control::-moz-placeholder { + color: #999999; + opacity: 1; +} +.form-control:-ms-input-placeholder { + color: #999999; +} +.form-control::-webkit-input-placeholder { + color: #999999; +} +.form-control[disabled], +.form-control[readonly], +fieldset[disabled] .form-control { + cursor: not-allowed; + background-color: #eeeeee; + opacity: 1; +} +textarea.form-control { + height: auto; +} +input[type="search"] { + -webkit-appearance: none; +} +@media screen and (-webkit-min-device-pixel-ratio: 0) { + input[type="date"], + input[type="time"], + input[type="datetime-local"], + input[type="month"] { + line-height: 34px; + } + input[type="date"].input-sm, + input[type="time"].input-sm, + input[type="datetime-local"].input-sm, + input[type="month"].input-sm { + line-height: 30px; + } + input[type="date"].input-lg, + input[type="time"].input-lg, + input[type="datetime-local"].input-lg, + input[type="month"].input-lg { + line-height: 46px; + } +} +.form-group { + margin-bottom: 15px; +} +.radio, +.checkbox { + position: relative; + display: block; + margin-top: 10px; + margin-bottom: 10px; +} +.radio label, +.checkbox label { + min-height: 20px; + padding-left: 20px; + margin-bottom: 0; + font-weight: normal; + cursor: pointer; +} +.radio input[type="radio"], +.radio-inline input[type="radio"], +.checkbox input[type="checkbox"], +.checkbox-inline input[type="checkbox"] { + position: absolute; + margin-left: -20px; + margin-top: 4px \9; +} +.radio + .radio, +.checkbox + .checkbox { + margin-top: -5px; +} +.radio-inline, +.checkbox-inline { + display: inline-block; + padding-left: 20px; + margin-bottom: 0; + vertical-align: middle; + font-weight: normal; + cursor: pointer; +} +.radio-inline + .radio-inline, +.checkbox-inline + .checkbox-inline { + margin-top: 0; + margin-left: 10px; +} +input[type="radio"][disabled], +input[type="checkbox"][disabled], +input[type="radio"].disabled, +input[type="checkbox"].disabled, +fieldset[disabled] input[type="radio"], +fieldset[disabled] input[type="checkbox"] { + cursor: not-allowed; +} +.radio-inline.disabled, +.checkbox-inline.disabled, +fieldset[disabled] .radio-inline, +fieldset[disabled] .checkbox-inline { + cursor: not-allowed; +} +.radio.disabled label, +.checkbox.disabled label, +fieldset[disabled] .radio label, +fieldset[disabled] .checkbox label { + cursor: not-allowed; +} +.form-control-static { + padding-top: 7px; + padding-bottom: 7px; + margin-bottom: 0; +} +.form-control-static.input-lg, +.form-control-static.input-sm { + padding-left: 0; + padding-right: 0; +} +.input-sm, +.form-group-sm .form-control { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +select.input-sm, +select.form-group-sm .form-control { + height: 30px; + line-height: 30px; +} +textarea.input-sm, +textarea.form-group-sm .form-control, +select[multiple].input-sm, +select[multiple].form-group-sm .form-control { + height: auto; +} +.input-lg, +.form-group-lg .form-control { + height: 46px; + padding: 10px 16px; + font-size: 18px; + line-height: 1.33; + border-radius: 6px; +} +select.input-lg, +select.form-group-lg .form-control { + height: 46px; + line-height: 46px; +} +textarea.input-lg, +textarea.form-group-lg .form-control, +select[multiple].input-lg, +select[multiple].form-group-lg .form-control { + height: auto; +} +.has-feedback { + position: relative; +} +.has-feedback .form-control { + padding-right: 42.5px; +} +.form-control-feedback { + position: absolute; + top: 0; + right: 0; + z-index: 2; + display: block; + width: 34px; + height: 34px; + line-height: 34px; + text-align: center; + pointer-events: none; +} +.input-lg + .form-control-feedback { + width: 46px; + height: 46px; + line-height: 46px; +} +.input-sm + .form-control-feedback { + width: 30px; + height: 30px; + line-height: 30px; +} +.has-success .help-block, +.has-success .control-label, +.has-success .radio, +.has-success .checkbox, +.has-success .radio-inline, +.has-success .checkbox-inline, +.has-success.radio label, +.has-success.checkbox label, +.has-success.radio-inline label, +.has-success.checkbox-inline label { + color: #3c763d; +} +.has-success .form-control { + border-color: #3c763d; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} +.has-success .form-control:focus { + border-color: #2b542c; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168; +} +.has-success .input-group-addon { + color: #3c763d; + border-color: #3c763d; + background-color: #dff0d8; +} +.has-success .form-control-feedback { + color: #3c763d; +} +.has-warning .help-block, +.has-warning .control-label, +.has-warning .radio, +.has-warning .checkbox, +.has-warning .radio-inline, +.has-warning .checkbox-inline, +.has-warning.radio label, +.has-warning.checkbox label, +.has-warning.radio-inline label, +.has-warning.checkbox-inline label { + color: #8a6d3b; +} +.has-warning .form-control { + border-color: #8a6d3b; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} +.has-warning .form-control:focus { + border-color: #66512c; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b; +} +.has-warning .input-group-addon { + color: #8a6d3b; + border-color: #8a6d3b; + background-color: #fcf8e3; +} +.has-warning .form-control-feedback { + color: #8a6d3b; +} +.has-error .help-block, +.has-error .control-label, +.has-error .radio, +.has-error .checkbox, +.has-error .radio-inline, +.has-error .checkbox-inline, +.has-error.radio label, +.has-error.checkbox label, +.has-error.radio-inline label, +.has-error.checkbox-inline label { + color: #a94442; +} +.has-error .form-control { + border-color: #a94442; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} +.has-error .form-control:focus { + border-color: #843534; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483; +} +.has-error .input-group-addon { + color: #a94442; + border-color: #a94442; + background-color: #f2dede; +} +.has-error .form-control-feedback { + color: #a94442; +} +.has-feedback label ~ .form-control-feedback { + top: 25px; +} +.has-feedback label.sr-only ~ .form-control-feedback { + top: 0; +} +.help-block { + display: block; + margin-top: 5px; + margin-bottom: 10px; + color: #737373; +} +@media (min-width: 768px) { + .form-inline .form-group { + display: inline-block; + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .form-control { + display: inline-block; + width: auto; + vertical-align: middle; + } + .form-inline .form-control-static { + display: inline-block; + } + .form-inline .input-group { + display: inline-table; + vertical-align: middle; + } + .form-inline .input-group .input-group-addon, + .form-inline .input-group .input-group-btn, + .form-inline .input-group .form-control { + width: auto; + } + .form-inline .input-group > .form-control { + width: 100%; + } + .form-inline .control-label { + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .radio, + .form-inline .checkbox { + display: inline-block; + margin-top: 0; + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .radio label, + .form-inline .checkbox label { + padding-left: 0; + } + .form-inline .radio input[type="radio"], + .form-inline .checkbox input[type="checkbox"] { + position: relative; + margin-left: 0; + } + .form-inline .has-feedback .form-control-feedback { + top: 0; + } +} +.form-horizontal .radio, +.form-horizontal .checkbox, +.form-horizontal .radio-inline, +.form-horizontal .checkbox-inline { + margin-top: 0; + margin-bottom: 0; + padding-top: 7px; +} +.form-horizontal .radio, +.form-horizontal .checkbox { + min-height: 27px; +} +.form-horizontal .form-group { + margin-left: -12px; + margin-right: -12px; +} +@media (min-width: 768px) { + .form-horizontal .control-label { + text-align: right; + margin-bottom: 0; + padding-top: 7px; + } +} +.form-horizontal .has-feedback .form-control-feedback { + right: 12px; +} +@media (min-width: 768px) { + .form-horizontal .form-group-lg .control-label { + padding-top: 14.3px; + } +} +@media (min-width: 768px) { + .form-horizontal .form-group-sm .control-label { + padding-top: 6px; + } +} +.btn { + display: inline-block; + margin-bottom: 0; + font-weight: normal; + text-align: center; + vertical-align: middle; + touch-action: manipulation; + cursor: pointer; + background-image: none; + border: 1px solid transparent; + white-space: nowrap; + padding: 6px 12px; + font-size: 14px; + line-height: 1.42857143; + border-radius: 4px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.btn:focus, +.btn:active:focus, +.btn.active:focus, +.btn.focus, +.btn:active.focus, +.btn.active.focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +.btn:hover, +.btn:focus, +.btn.focus { + color: #333333; + text-decoration: none; +} +.btn:active, +.btn.active { + outline: 0; + background-image: none; + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); +} +.btn.disabled, +.btn[disabled], +fieldset[disabled] .btn { + cursor: not-allowed; + pointer-events: none; + opacity: 0.65; + filter: alpha(opacity=65); + -webkit-box-shadow: none; + box-shadow: none; +} +.btn-default { + color: #333333; + background-color: #ffffff; + border-color: #cccccc; +} +.btn-default:hover, +.btn-default:focus, +.btn-default.focus, +.btn-default:active, +.btn-default.active, +.open > .dropdown-toggle.btn-default { + color: #333333; + background-color: #e6e6e6; + border-color: #adadad; +} +.btn-default:active, +.btn-default.active, +.open > .dropdown-toggle.btn-default { + background-image: none; +} +.btn-default.disabled, +.btn-default[disabled], +fieldset[disabled] .btn-default, +.btn-default.disabled:hover, +.btn-default[disabled]:hover, +fieldset[disabled] .btn-default:hover, +.btn-default.disabled:focus, +.btn-default[disabled]:focus, +fieldset[disabled] .btn-default:focus, +.btn-default.disabled.focus, +.btn-default[disabled].focus, +fieldset[disabled] .btn-default.focus, +.btn-default.disabled:active, +.btn-default[disabled]:active, +fieldset[disabled] .btn-default:active, +.btn-default.disabled.active, +.btn-default[disabled].active, +fieldset[disabled] .btn-default.active { + background-color: #ffffff; + border-color: #cccccc; +} +.btn-default .badge { + color: #ffffff; + background-color: #333333; +} +.btn-primary { + color: #ffffff; + background-color: #337ab7; + border-color: #2e6da4; +} +.btn-primary:hover, +.btn-primary:focus, +.btn-primary.focus, +.btn-primary:active, +.btn-primary.active, +.open > .dropdown-toggle.btn-primary { + color: #ffffff; + background-color: #286090; + border-color: #204d74; +} +.btn-primary:active, +.btn-primary.active, +.open > .dropdown-toggle.btn-primary { + background-image: none; +} +.btn-primary.disabled, +.btn-primary[disabled], +fieldset[disabled] .btn-primary, +.btn-primary.disabled:hover, +.btn-primary[disabled]:hover, +fieldset[disabled] .btn-primary:hover, +.btn-primary.disabled:focus, +.btn-primary[disabled]:focus, +fieldset[disabled] .btn-primary:focus, +.btn-primary.disabled.focus, +.btn-primary[disabled].focus, +fieldset[disabled] .btn-primary.focus, +.btn-primary.disabled:active, +.btn-primary[disabled]:active, +fieldset[disabled] .btn-primary:active, +.btn-primary.disabled.active, +.btn-primary[disabled].active, +fieldset[disabled] .btn-primary.active { + background-color: #337ab7; + border-color: #2e6da4; +} +.btn-primary .badge { + color: #337ab7; + background-color: #ffffff; +} +.btn-success { + color: #ffffff; + background-color: #5cb85c; + border-color: #4cae4c; +} +.btn-success:hover, +.btn-success:focus, +.btn-success.focus, +.btn-success:active, +.btn-success.active, +.open > .dropdown-toggle.btn-success { + color: #ffffff; + background-color: #449d44; + border-color: #398439; +} +.btn-success:active, +.btn-success.active, +.open > .dropdown-toggle.btn-success { + background-image: none; +} +.btn-success.disabled, +.btn-success[disabled], +fieldset[disabled] .btn-success, +.btn-success.disabled:hover, +.btn-success[disabled]:hover, +fieldset[disabled] .btn-success:hover, +.btn-success.disabled:focus, +.btn-success[disabled]:focus, +fieldset[disabled] .btn-success:focus, +.btn-success.disabled.focus, +.btn-success[disabled].focus, +fieldset[disabled] .btn-success.focus, +.btn-success.disabled:active, +.btn-success[disabled]:active, +fieldset[disabled] .btn-success:active, +.btn-success.disabled.active, +.btn-success[disabled].active, +fieldset[disabled] .btn-success.active { + background-color: #5cb85c; + border-color: #4cae4c; +} +.btn-success .badge { + color: #5cb85c; + background-color: #ffffff; +} +.btn-info { + color: #ffffff; + background-color: #5bc0de; + border-color: #46b8da; +} +.btn-info:hover, +.btn-info:focus, +.btn-info.focus, +.btn-info:active, +.btn-info.active, +.open > .dropdown-toggle.btn-info { + color: #ffffff; + background-color: #31b0d5; + border-color: #269abc; +} +.btn-info:active, +.btn-info.active, +.open > .dropdown-toggle.btn-info { + background-image: none; +} +.btn-info.disabled, +.btn-info[disabled], +fieldset[disabled] .btn-info, +.btn-info.disabled:hover, +.btn-info[disabled]:hover, +fieldset[disabled] .btn-info:hover, +.btn-info.disabled:focus, +.btn-info[disabled]:focus, +fieldset[disabled] .btn-info:focus, +.btn-info.disabled.focus, +.btn-info[disabled].focus, +fieldset[disabled] .btn-info.focus, +.btn-info.disabled:active, +.btn-info[disabled]:active, +fieldset[disabled] .btn-info:active, +.btn-info.disabled.active, +.btn-info[disabled].active, +fieldset[disabled] .btn-info.active { + background-color: #5bc0de; + border-color: #46b8da; +} +.btn-info .badge { + color: #5bc0de; + background-color: #ffffff; +} +.btn-warning { + color: #ffffff; + background-color: #f0ad4e; + border-color: #eea236; +} +.btn-warning:hover, +.btn-warning:focus, +.btn-warning.focus, +.btn-warning:active, +.btn-warning.active, +.open > .dropdown-toggle.btn-warning { + color: #ffffff; + background-color: #ec971f; + border-color: #d58512; +} +.btn-warning:active, +.btn-warning.active, +.open > .dropdown-toggle.btn-warning { + background-image: none; +} +.btn-warning.disabled, +.btn-warning[disabled], +fieldset[disabled] .btn-warning, +.btn-warning.disabled:hover, +.btn-warning[disabled]:hover, +fieldset[disabled] .btn-warning:hover, +.btn-warning.disabled:focus, +.btn-warning[disabled]:focus, +fieldset[disabled] .btn-warning:focus, +.btn-warning.disabled.focus, +.btn-warning[disabled].focus, +fieldset[disabled] .btn-warning.focus, +.btn-warning.disabled:active, +.btn-warning[disabled]:active, +fieldset[disabled] .btn-warning:active, +.btn-warning.disabled.active, +.btn-warning[disabled].active, +fieldset[disabled] .btn-warning.active { + background-color: #f0ad4e; + border-color: #eea236; +} +.btn-warning .badge { + color: #f0ad4e; + background-color: #ffffff; +} +.btn-danger { + color: #ffffff; + background-color: #d9534f; + border-color: #d43f3a; +} +.btn-danger:hover, +.btn-danger:focus, +.btn-danger.focus, +.btn-danger:active, +.btn-danger.active, +.open > .dropdown-toggle.btn-danger { + color: #ffffff; + background-color: #c9302c; + border-color: #ac2925; +} +.btn-danger:active, +.btn-danger.active, +.open > .dropdown-toggle.btn-danger { + background-image: none; +} +.btn-danger.disabled, +.btn-danger[disabled], +fieldset[disabled] .btn-danger, +.btn-danger.disabled:hover, +.btn-danger[disabled]:hover, +fieldset[disabled] .btn-danger:hover, +.btn-danger.disabled:focus, +.btn-danger[disabled]:focus, +fieldset[disabled] .btn-danger:focus, +.btn-danger.disabled.focus, +.btn-danger[disabled].focus, +fieldset[disabled] .btn-danger.focus, +.btn-danger.disabled:active, +.btn-danger[disabled]:active, +fieldset[disabled] .btn-danger:active, +.btn-danger.disabled.active, +.btn-danger[disabled].active, +fieldset[disabled] .btn-danger.active { + background-color: #d9534f; + border-color: #d43f3a; +} +.btn-danger .badge { + color: #d9534f; + background-color: #ffffff; +} +.btn-link { + color: #337ab7; + font-weight: normal; + border-radius: 0; +} +.btn-link, +.btn-link:active, +.btn-link.active, +.btn-link[disabled], +fieldset[disabled] .btn-link { + background-color: transparent; + -webkit-box-shadow: none; + box-shadow: none; +} +.btn-link, +.btn-link:hover, +.btn-link:focus, +.btn-link:active { + border-color: transparent; +} +.btn-link:hover, +.btn-link:focus { + color: #23527c; + text-decoration: underline; + background-color: transparent; +} +.btn-link[disabled]:hover, +fieldset[disabled] .btn-link:hover, +.btn-link[disabled]:focus, +fieldset[disabled] .btn-link:focus { + color: #777777; + text-decoration: none; +} +.btn-lg, +.btn-group-lg > .btn { + padding: 10px 16px; + font-size: 18px; + line-height: 1.33; + border-radius: 6px; +} +.btn-sm, +.btn-group-sm > .btn { + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.btn-xs, +.btn-group-xs > .btn { + padding: 1px 5px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.btn-block { + display: block; + width: 100%; +} +.btn-block + .btn-block { + margin-top: 5px; +} +input[type="submit"].btn-block, +input[type="reset"].btn-block, +input[type="button"].btn-block { + width: 100%; +} +.fade { + opacity: 0; + -webkit-transition: opacity 0.15s linear; + -o-transition: opacity 0.15s linear; + transition: opacity 0.15s linear; +} +.fade.in { + opacity: 1; +} +.collapse { + display: none; + visibility: hidden; +} +.collapse.in { + display: block; + visibility: visible; +} +tr.collapse.in { + display: table-row; +} +tbody.collapse.in { + display: table-row-group; +} +.collapsing { + position: relative; + height: 0; + overflow: hidden; + -webkit-transition-property: height, visibility; + transition-property: height, visibility; + -webkit-transition-duration: 0.35s; + transition-duration: 0.35s; + -webkit-transition-timing-function: ease; + transition-timing-function: ease; +} +.caret { + display: inline-block; + width: 0; + height: 0; + margin-left: 2px; + vertical-align: middle; + border-top: 4px solid; + border-right: 4px solid transparent; + border-left: 4px solid transparent; +} +.dropdown { + position: relative; +} +.dropdown-toggle:focus { + outline: 0; +} +.dropdown-menu { + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + display: none; + float: left; + min-width: 160px; + padding: 5px 0; + margin: 2px 0 0; + list-style: none; + font-size: 14px; + text-align: left; + background-color: #ffffff; + border: 1px solid #cccccc; + border: 1px solid rgba(0, 0, 0, 0.15); + border-radius: 4px; + -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); + box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); + background-clip: padding-box; +} +.dropdown-menu.pull-right { + right: 0; + left: auto; +} +.dropdown-menu .divider { + height: 1px; + margin: 9px 0; + overflow: hidden; + background-color: #e5e5e5; +} +.dropdown-menu > li > a { + display: block; + padding: 3px 20px; + clear: both; + font-weight: normal; + line-height: 1.42857143; + color: #333333; + white-space: nowrap; +} +.dropdown-menu > li > a:hover, +.dropdown-menu > li > a:focus { + text-decoration: none; + color: #262626; + background-color: #f5f5f5; +} +.dropdown-menu > .active > a, +.dropdown-menu > .active > a:hover, +.dropdown-menu > .active > a:focus { + color: #ffffff; + text-decoration: none; + outline: 0; + background-color: #337ab7; +} +.dropdown-menu > .disabled > a, +.dropdown-menu > .disabled > a:hover, +.dropdown-menu > .disabled > a:focus { + color: #777777; +} +.dropdown-menu > .disabled > a:hover, +.dropdown-menu > .disabled > a:focus { + text-decoration: none; + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); + cursor: not-allowed; +} +.open > .dropdown-menu { + display: block; +} +.open > a { + outline: 0; +} +.dropdown-menu-right { + left: auto; + right: 0; +} +.dropdown-menu-left { + left: 0; + right: auto; +} +.dropdown-header { + display: block; + padding: 3px 20px; + font-size: 12px; + line-height: 1.42857143; + color: #777777; + white-space: nowrap; +} +.dropdown-backdrop { + position: fixed; + left: 0; + right: 0; + bottom: 0; + top: 0; + z-index: 990; +} +.pull-right > .dropdown-menu { + right: 0; + left: auto; +} +.dropup .caret, +.navbar-fixed-bottom .dropdown .caret { + border-top: 0; + border-bottom: 4px solid; + content: ""; +} +.dropup .dropdown-menu, +.navbar-fixed-bottom .dropdown .dropdown-menu { + top: auto; + bottom: 100%; + margin-bottom: 1px; +} +@media (min-width: 992px) { + .navbar-right .dropdown-menu { + left: auto; + right: 0; + } + .navbar-right .dropdown-menu-left { + left: 0; + right: auto; + } +} +.btn-group, +.btn-group-vertical { + position: relative; + display: inline-block; + vertical-align: middle; +} +.btn-group > .btn, +.btn-group-vertical > .btn { + position: relative; + float: left; +} +.btn-group > .btn:hover, +.btn-group-vertical > .btn:hover, +.btn-group > .btn:focus, +.btn-group-vertical > .btn:focus, +.btn-group > .btn:active, +.btn-group-vertical > .btn:active, +.btn-group > .btn.active, +.btn-group-vertical > .btn.active { + z-index: 2; +} +.btn-group .btn + .btn, +.btn-group .btn + .btn-group, +.btn-group .btn-group + .btn, +.btn-group .btn-group + .btn-group { + margin-left: -1px; +} +.btn-toolbar { + margin-left: -5px; +} +.btn-toolbar .btn-group, +.btn-toolbar .input-group { + float: left; +} +.btn-toolbar > .btn, +.btn-toolbar > .btn-group, +.btn-toolbar > .input-group { + margin-left: 5px; +} +.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { + border-radius: 0; +} +.btn-group > .btn:first-child { + margin-left: 0; +} +.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) { + border-bottom-right-radius: 0; + border-top-right-radius: 0; +} +.btn-group > .btn:last-child:not(:first-child), +.btn-group > .dropdown-toggle:not(:first-child) { + border-bottom-left-radius: 0; + border-top-left-radius: 0; +} +.btn-group > .btn-group { + float: left; +} +.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} +.btn-group > .btn-group:first-child > .btn:last-child, +.btn-group > .btn-group:first-child > .dropdown-toggle { + border-bottom-right-radius: 0; + border-top-right-radius: 0; +} +.btn-group > .btn-group:last-child > .btn:first-child { + border-bottom-left-radius: 0; + border-top-left-radius: 0; +} +.btn-group .dropdown-toggle:active, +.btn-group.open .dropdown-toggle { + outline: 0; +} +.btn-group > .btn + .dropdown-toggle { + padding-left: 8px; + padding-right: 8px; +} +.btn-group > .btn-lg + .dropdown-toggle { + padding-left: 12px; + padding-right: 12px; +} +.btn-group.open .dropdown-toggle { + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); +} +.btn-group.open .dropdown-toggle.btn-link { + -webkit-box-shadow: none; + box-shadow: none; +} +.btn .caret { + margin-left: 0; +} +.btn-lg .caret { + border-width: 5px 5px 0; + border-bottom-width: 0; +} +.dropup .btn-lg .caret { + border-width: 0 5px 5px; +} +.btn-group-vertical > .btn, +.btn-group-vertical > .btn-group, +.btn-group-vertical > .btn-group > .btn { + display: block; + float: none; + width: 100%; + max-width: 100%; +} +.btn-group-vertical > .btn-group > .btn { + float: none; +} +.btn-group-vertical > .btn + .btn, +.btn-group-vertical > .btn + .btn-group, +.btn-group-vertical > .btn-group + .btn, +.btn-group-vertical > .btn-group + .btn-group { + margin-top: -1px; + margin-left: 0; +} +.btn-group-vertical > .btn:not(:first-child):not(:last-child) { + border-radius: 0; +} +.btn-group-vertical > .btn:first-child:not(:last-child) { + border-top-right-radius: 4px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group-vertical > .btn:last-child:not(:first-child) { + border-bottom-left-radius: 4px; + border-top-right-radius: 0; + border-top-left-radius: 0; +} +.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} +.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child, +.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle { + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child { + border-top-right-radius: 0; + border-top-left-radius: 0; +} +.btn-group-justified { + display: table; + width: 100%; + table-layout: fixed; + border-collapse: separate; +} +.btn-group-justified > .btn, +.btn-group-justified > .btn-group { + float: none; + display: table-cell; + width: 1%; +} +.btn-group-justified > .btn-group .btn { + width: 100%; +} +.btn-group-justified > .btn-group .dropdown-menu { + left: auto; +} +[data-toggle="buttons"] > .btn input[type="radio"], +[data-toggle="buttons"] > .btn-group > .btn input[type="radio"], +[data-toggle="buttons"] > .btn input[type="checkbox"], +[data-toggle="buttons"] > .btn-group > .btn input[type="checkbox"] { + position: absolute; + clip: rect(0, 0, 0, 0); + pointer-events: none; +} +.input-group { + position: relative; + display: table; + border-collapse: separate; +} +.input-group[class*="col-"] { + float: none; + padding-left: 0; + padding-right: 0; +} +.input-group .form-control { + position: relative; + z-index: 2; + float: left; + width: 100%; + margin-bottom: 0; +} +.input-group-lg > .form-control, +.input-group-lg > .input-group-addon, +.input-group-lg > .input-group-btn > .btn { + height: 46px; + padding: 10px 16px; + font-size: 18px; + line-height: 1.33; + border-radius: 6px; +} +select.input-group-lg > .form-control, +select.input-group-lg > .input-group-addon, +select.input-group-lg > .input-group-btn > .btn { + height: 46px; + line-height: 46px; +} +textarea.input-group-lg > .form-control, +textarea.input-group-lg > .input-group-addon, +textarea.input-group-lg > .input-group-btn > .btn, +select[multiple].input-group-lg > .form-control, +select[multiple].input-group-lg > .input-group-addon, +select[multiple].input-group-lg > .input-group-btn > .btn { + height: auto; +} +.input-group-sm > .form-control, +.input-group-sm > .input-group-addon, +.input-group-sm > .input-group-btn > .btn { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +select.input-group-sm > .form-control, +select.input-group-sm > .input-group-addon, +select.input-group-sm > .input-group-btn > .btn { + height: 30px; + line-height: 30px; +} +textarea.input-group-sm > .form-control, +textarea.input-group-sm > .input-group-addon, +textarea.input-group-sm > .input-group-btn > .btn, +select[multiple].input-group-sm > .form-control, +select[multiple].input-group-sm > .input-group-addon, +select[multiple].input-group-sm > .input-group-btn > .btn { + height: auto; +} +.input-group-addon, +.input-group-btn, +.input-group .form-control { + display: table-cell; +} +.input-group-addon:not(:first-child):not(:last-child), +.input-group-btn:not(:first-child):not(:last-child), +.input-group .form-control:not(:first-child):not(:last-child) { + border-radius: 0; +} +.input-group-addon, +.input-group-btn { + width: 1%; + white-space: nowrap; + vertical-align: middle; +} +.input-group-addon { + padding: 6px 12px; + font-size: 14px; + font-weight: normal; + line-height: 1; + color: #555555; + text-align: center; + background-color: #eeeeee; + border: 1px solid #cccccc; + border-radius: 4px; +} +.input-group-addon.input-sm { + padding: 5px 10px; + font-size: 12px; + border-radius: 3px; +} +.input-group-addon.input-lg { + padding: 10px 16px; + font-size: 18px; + border-radius: 6px; +} +.input-group-addon input[type="radio"], +.input-group-addon input[type="checkbox"] { + margin-top: 0; +} +.input-group .form-control:first-child, +.input-group-addon:first-child, +.input-group-btn:first-child > .btn, +.input-group-btn:first-child > .btn-group > .btn, +.input-group-btn:first-child > .dropdown-toggle, +.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle), +.input-group-btn:last-child > .btn-group:not(:last-child) > .btn { + border-bottom-right-radius: 0; + border-top-right-radius: 0; +} +.input-group-addon:first-child { + border-right: 0; +} +.input-group .form-control:last-child, +.input-group-addon:last-child, +.input-group-btn:last-child > .btn, +.input-group-btn:last-child > .btn-group > .btn, +.input-group-btn:last-child > .dropdown-toggle, +.input-group-btn:first-child > .btn:not(:first-child), +.input-group-btn:first-child > .btn-group:not(:first-child) > .btn { + border-bottom-left-radius: 0; + border-top-left-radius: 0; +} +.input-group-addon:last-child { + border-left: 0; +} +.input-group-btn { + position: relative; + font-size: 0; + white-space: nowrap; +} +.input-group-btn > .btn { + position: relative; +} +.input-group-btn > .btn + .btn { + margin-left: -1px; +} +.input-group-btn > .btn:hover, +.input-group-btn > .btn:focus, +.input-group-btn > .btn:active { + z-index: 2; +} +.input-group-btn:first-child > .btn, +.input-group-btn:first-child > .btn-group { + margin-right: -1px; +} +.input-group-btn:last-child > .btn, +.input-group-btn:last-child > .btn-group { + margin-left: -1px; +} +.nav { + margin-bottom: 0; + padding-left: 0; + list-style: none; +} +.nav > li { + position: relative; + display: block; +} +.nav > li > a { + position: relative; + display: block; + padding: 10px 15px; +} +.nav > li > a:hover, +.nav > li > a:focus { + text-decoration: none; + background-color: #eeeeee; +} +.nav > li.disabled > a { + color: #777777; +} +.nav > li.disabled > a:hover, +.nav > li.disabled > a:focus { + color: #777777; + text-decoration: none; + background-color: transparent; + cursor: not-allowed; +} +.nav .open > a, +.nav .open > a:hover, +.nav .open > a:focus { + background-color: #eeeeee; + border-color: #337ab7; +} +.nav .nav-divider { + height: 1px; + margin: 9px 0; + overflow: hidden; + background-color: #e5e5e5; +} +.nav > li > a > img { + max-width: none; +} +.nav-tabs { + border-bottom: 1px solid #dddddd; +} +.nav-tabs > li { + float: left; + margin-bottom: -1px; +} +.nav-tabs > li > a { + margin-right: 2px; + line-height: 1.42857143; + border: 1px solid transparent; + border-radius: 4px 4px 0 0; +} +.nav-tabs > li > a:hover { + border-color: #eeeeee #eeeeee #dddddd; +} +.nav-tabs > li.active > a, +.nav-tabs > li.active > a:hover, +.nav-tabs > li.active > a:focus { + color: #555555; + background-color: #ffffff; + border: 1px solid #dddddd; + border-bottom-color: transparent; + cursor: default; +} +.nav-tabs.nav-justified { + width: 100%; + border-bottom: 0; +} +.nav-tabs.nav-justified > li { + float: none; +} +.nav-tabs.nav-justified > li > a { + text-align: center; + margin-bottom: 5px; +} +.nav-tabs.nav-justified > .dropdown .dropdown-menu { + top: auto; + left: auto; +} +@media (min-width: 768px) { + .nav-tabs.nav-justified > li { + display: table-cell; + width: 1%; + } + .nav-tabs.nav-justified > li > a { + margin-bottom: 0; + } +} +.nav-tabs.nav-justified > li > a { + margin-right: 0; + border-radius: 4px; +} +.nav-tabs.nav-justified > .active > a, +.nav-tabs.nav-justified > .active > a:hover, +.nav-tabs.nav-justified > .active > a:focus { + border: 1px solid #dddddd; +} +@media (min-width: 768px) { + .nav-tabs.nav-justified > li > a { + border-bottom: 1px solid #dddddd; + border-radius: 4px 4px 0 0; + } + .nav-tabs.nav-justified > .active > a, + .nav-tabs.nav-justified > .active > a:hover, + .nav-tabs.nav-justified > .active > a:focus { + border-bottom-color: #ffffff; + } +} +.nav-pills > li { + float: left; +} +.nav-pills > li > a { + border-radius: 4px; +} +.nav-pills > li + li { + margin-left: 2px; +} +.nav-pills > li.active > a, +.nav-pills > li.active > a:hover, +.nav-pills > li.active > a:focus { + color: #ffffff; + background-color: #337ab7; +} +.nav-stacked > li { + float: none; +} +.nav-stacked > li + li { + margin-top: 2px; + margin-left: 0; +} +.nav-justified { + width: 100%; +} +.nav-justified > li { + float: none; +} +.nav-justified > li > a { + text-align: center; + margin-bottom: 5px; +} +.nav-justified > .dropdown .dropdown-menu { + top: auto; + left: auto; +} +@media (min-width: 768px) { + .nav-justified > li { + display: table-cell; + width: 1%; + } + .nav-justified > li > a { + margin-bottom: 0; + } +} +.nav-tabs-justified { + border-bottom: 0; +} +.nav-tabs-justified > li > a { + margin-right: 0; + border-radius: 4px; +} +.nav-tabs-justified > .active > a, +.nav-tabs-justified > .active > a:hover, +.nav-tabs-justified > .active > a:focus { + border: 1px solid #dddddd; +} +@media (min-width: 768px) { + .nav-tabs-justified > li > a { + border-bottom: 1px solid #dddddd; + border-radius: 4px 4px 0 0; + } + .nav-tabs-justified > .active > a, + .nav-tabs-justified > .active > a:hover, + .nav-tabs-justified > .active > a:focus { + border-bottom-color: #ffffff; + } +} +.tab-content > .tab-pane { + display: none; + visibility: hidden; +} +.tab-content > .active { + display: block; + visibility: visible; +} +.nav-tabs .dropdown-menu { + margin-top: -1px; + border-top-right-radius: 0; + border-top-left-radius: 0; +} +.navbar { + position: relative; + min-height: 50px; + margin-bottom: 20px; + border: 1px solid transparent; +} +@media (min-width: 992px) { + .navbar { + border-radius: 4px; + } +} +@media (min-width: 992px) { + .navbar-header { + float: left; + } +} +.navbar-collapse { + overflow-x: visible; + padding-right: 12px; + padding-left: 12px; + border-top: 1px solid transparent; + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); + -webkit-overflow-scrolling: touch; +} +.navbar-collapse.in { + overflow-y: auto; +} +@media (min-width: 992px) { + .navbar-collapse { + width: auto; + border-top: 0; + box-shadow: none; + } + .navbar-collapse.collapse { + display: block !important; + visibility: visible !important; + height: auto !important; + padding-bottom: 0; + overflow: visible !important; + } + .navbar-collapse.in { + overflow-y: visible; + } + .navbar-fixed-top .navbar-collapse, + .navbar-static-top .navbar-collapse, + .navbar-fixed-bottom .navbar-collapse { + padding-left: 0; + padding-right: 0; + } +} +.navbar-fixed-top .navbar-collapse, +.navbar-fixed-bottom .navbar-collapse { + max-height: 340px; +} +@media (max-device-width: 480px) and (orientation: landscape) { + .navbar-fixed-top .navbar-collapse, + .navbar-fixed-bottom .navbar-collapse { + max-height: 200px; + } +} +.container > .navbar-header, +.container-fluid > .navbar-header, +.container > .navbar-collapse, +.container-fluid > .navbar-collapse { + margin-right: -12px; + margin-left: -12px; +} +@media (min-width: 992px) { + .container > .navbar-header, + .container-fluid > .navbar-header, + .container > .navbar-collapse, + .container-fluid > .navbar-collapse { + margin-right: 0; + margin-left: 0; + } +} +.navbar-static-top { + z-index: 1000; + border-width: 0 0 1px; +} +@media (min-width: 992px) { + .navbar-static-top { + border-radius: 0; + } +} +.navbar-fixed-top, +.navbar-fixed-bottom { + position: fixed; + right: 0; + left: 0; + z-index: 1030; +} +@media (min-width: 992px) { + .navbar-fixed-top, + .navbar-fixed-bottom { + border-radius: 0; + } +} +.navbar-fixed-top { + top: 0; + border-width: 0 0 1px; +} +.navbar-fixed-bottom { + bottom: 0; + margin-bottom: 0; + border-width: 1px 0 0; +} +.navbar-brand { + float: left; + padding: 15px 12px; + font-size: 18px; + line-height: 20px; + height: 50px; +} +.navbar-brand:hover, +.navbar-brand:focus { + text-decoration: none; +} +.navbar-brand > img { + display: block; +} +@media (min-width: 992px) { + .navbar > .container .navbar-brand, + .navbar > .container-fluid .navbar-brand { + margin-left: -12px; + } +} +.navbar-toggle { + position: relative; + float: right; + margin-right: 12px; + padding: 9px 10px; + margin-top: 8px; + margin-bottom: 8px; + background-color: transparent; + background-image: none; + border: 1px solid transparent; + border-radius: 4px; +} +.navbar-toggle:focus { + outline: 0; +} +.navbar-toggle .icon-bar { + display: block; + width: 22px; + height: 2px; + border-radius: 1px; +} +.navbar-toggle .icon-bar + .icon-bar { + margin-top: 4px; +} +@media (min-width: 992px) { + .navbar-toggle { + display: none; + } +} +.navbar-nav { + margin: 7.5px -12px; +} +.navbar-nav > li > a { + padding-top: 10px; + padding-bottom: 10px; + line-height: 20px; +} +@media (max-width: 991px) { + .navbar-nav .open .dropdown-menu { + position: static; + float: none; + width: auto; + margin-top: 0; + background-color: transparent; + border: 0; + box-shadow: none; + } + .navbar-nav .open .dropdown-menu > li > a, + .navbar-nav .open .dropdown-menu .dropdown-header { + padding: 5px 15px 5px 25px; + } + .navbar-nav .open .dropdown-menu > li > a { + line-height: 20px; + } + .navbar-nav .open .dropdown-menu > li > a:hover, + .navbar-nav .open .dropdown-menu > li > a:focus { + background-image: none; + } +} +@media (min-width: 992px) { + .navbar-nav { + float: left; + margin: 0; + } + .navbar-nav > li { + float: left; + } + .navbar-nav > li > a { + padding-top: 15px; + padding-bottom: 15px; + } +} +.navbar-form { + margin-left: -12px; + margin-right: -12px; + padding: 10px 12px; + border-top: 1px solid transparent; + border-bottom: 1px solid transparent; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + margin-top: 8px; + margin-bottom: 8px; +} +@media (min-width: 768px) { + .navbar-form .form-group { + display: inline-block; + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form .form-control { + display: inline-block; + width: auto; + vertical-align: middle; + } + .navbar-form .form-control-static { + display: inline-block; + } + .navbar-form .input-group { + display: inline-table; + vertical-align: middle; + } + .navbar-form .input-group .input-group-addon, + .navbar-form .input-group .input-group-btn, + .navbar-form .input-group .form-control { + width: auto; + } + .navbar-form .input-group > .form-control { + width: 100%; + } + .navbar-form .control-label { + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form .radio, + .navbar-form .checkbox { + display: inline-block; + margin-top: 0; + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form .radio label, + .navbar-form .checkbox label { + padding-left: 0; + } + .navbar-form .radio input[type="radio"], + .navbar-form .checkbox input[type="checkbox"] { + position: relative; + margin-left: 0; + } + .navbar-form .has-feedback .form-control-feedback { + top: 0; + } +} +@media (max-width: 991px) { + .navbar-form .form-group { + margin-bottom: 5px; + } + .navbar-form .form-group:last-child { + margin-bottom: 0; + } +} +@media (min-width: 992px) { + .navbar-form { + width: auto; + border: 0; + margin-left: 0; + margin-right: 0; + padding-top: 0; + padding-bottom: 0; + -webkit-box-shadow: none; + box-shadow: none; + } +} +.navbar-nav > li > .dropdown-menu { + margin-top: 0; + border-top-right-radius: 0; + border-top-left-radius: 0; +} +.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu { + border-top-right-radius: 4px; + border-top-left-radius: 4px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.navbar-btn { + margin-top: 8px; + margin-bottom: 8px; +} +.navbar-btn.btn-sm { + margin-top: 10px; + margin-bottom: 10px; +} +.navbar-btn.btn-xs { + margin-top: 14px; + margin-bottom: 14px; +} +.navbar-text { + margin-top: 15px; + margin-bottom: 15px; +} +@media (min-width: 992px) { + .navbar-text { + float: left; + margin-left: 12px; + margin-right: 12px; + } +} +@media (min-width: 992px) { + .navbar-left { + float: left !important; + } + .navbar-right { + float: right !important; + margin-right: -12px; + } + .navbar-right ~ .navbar-right { + margin-right: 0; + } +} +.navbar-default { + background-color: #f8f8f8; + border-color: #e7e7e7; +} +.navbar-default .navbar-brand { + color: #777777; +} +.navbar-default .navbar-brand:hover, +.navbar-default .navbar-brand:focus { + color: #5e5e5e; + background-color: transparent; +} +.navbar-default .navbar-text { + color: #777777; +} +.navbar-default .navbar-nav > li > a { + color: #777777; +} +.navbar-default .navbar-nav > li > a:hover, +.navbar-default .navbar-nav > li > a:focus { + color: #333333; + background-color: transparent; +} +.navbar-default .navbar-nav > .active > a, +.navbar-default .navbar-nav > .active > a:hover, +.navbar-default .navbar-nav > .active > a:focus { + color: #555555; + background-color: #e7e7e7; +} +.navbar-default .navbar-nav > .disabled > a, +.navbar-default .navbar-nav > .disabled > a:hover, +.navbar-default .navbar-nav > .disabled > a:focus { + color: #cccccc; + background-color: transparent; +} +.navbar-default .navbar-toggle { + border-color: #dddddd; +} +.navbar-default .navbar-toggle:hover, +.navbar-default .navbar-toggle:focus { + background-color: #dddddd; +} +.navbar-default .navbar-toggle .icon-bar { + background-color: #888888; +} +.navbar-default .navbar-collapse, +.navbar-default .navbar-form { + border-color: #e7e7e7; +} +.navbar-default .navbar-nav > .open > a, +.navbar-default .navbar-nav > .open > a:hover, +.navbar-default .navbar-nav > .open > a:focus { + background-color: #e7e7e7; + color: #555555; +} +@media (max-width: 991px) { + .navbar-default .navbar-nav .open .dropdown-menu > li > a { + color: #777777; + } + .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover, + .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus { + color: #333333; + background-color: transparent; + } + .navbar-default .navbar-nav .open .dropdown-menu > .active > a, + .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover, + .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus { + color: #555555; + background-color: #e7e7e7; + } + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a, + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover, + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus { + color: #cccccc; + background-color: transparent; + } +} +.navbar-default .navbar-link { + color: #777777; +} +.navbar-default .navbar-link:hover { + color: #333333; +} +.navbar-default .btn-link { + color: #777777; +} +.navbar-default .btn-link:hover, +.navbar-default .btn-link:focus { + color: #333333; +} +.navbar-default .btn-link[disabled]:hover, +fieldset[disabled] .navbar-default .btn-link:hover, +.navbar-default .btn-link[disabled]:focus, +fieldset[disabled] .navbar-default .btn-link:focus { + color: #cccccc; +} +.navbar-inverse { + background-color: #222222; + border-color: #080808; +} +.navbar-inverse .navbar-brand { + color: #9d9d9d; +} +.navbar-inverse .navbar-brand:hover, +.navbar-inverse .navbar-brand:focus { + color: #ffffff; + background-color: transparent; +} +.navbar-inverse .navbar-text { + color: #9d9d9d; +} +.navbar-inverse .navbar-nav > li > a { + color: #9d9d9d; +} +.navbar-inverse .navbar-nav > li > a:hover, +.navbar-inverse .navbar-nav > li > a:focus { + color: #ffffff; + background-color: transparent; +} +.navbar-inverse .navbar-nav > .active > a, +.navbar-inverse .navbar-nav > .active > a:hover, +.navbar-inverse .navbar-nav > .active > a:focus { + color: #ffffff; + background-color: #080808; +} +.navbar-inverse .navbar-nav > .disabled > a, +.navbar-inverse .navbar-nav > .disabled > a:hover, +.navbar-inverse .navbar-nav > .disabled > a:focus { + color: #444444; + background-color: transparent; +} +.navbar-inverse .navbar-toggle { + border-color: #333333; +} +.navbar-inverse .navbar-toggle:hover, +.navbar-inverse .navbar-toggle:focus { + background-color: #333333; +} +.navbar-inverse .navbar-toggle .icon-bar { + background-color: #ffffff; +} +.navbar-inverse .navbar-collapse, +.navbar-inverse .navbar-form { + border-color: #101010; +} +.navbar-inverse .navbar-nav > .open > a, +.navbar-inverse .navbar-nav > .open > a:hover, +.navbar-inverse .navbar-nav > .open > a:focus { + background-color: #080808; + color: #ffffff; +} +@media (max-width: 991px) { + .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header { + border-color: #080808; + } + .navbar-inverse .navbar-nav .open .dropdown-menu .divider { + background-color: #080808; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a { + color: #9d9d9d; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover, + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus { + color: #ffffff; + background-color: transparent; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a, + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover, + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus { + color: #ffffff; + background-color: #080808; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a, + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover, + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus { + color: #444444; + background-color: transparent; + } +} +.navbar-inverse .navbar-link { + color: #9d9d9d; +} +.navbar-inverse .navbar-link:hover { + color: #ffffff; +} +.navbar-inverse .btn-link { + color: #9d9d9d; +} +.navbar-inverse .btn-link:hover, +.navbar-inverse .btn-link:focus { + color: #ffffff; +} +.navbar-inverse .btn-link[disabled]:hover, +fieldset[disabled] .navbar-inverse .btn-link:hover, +.navbar-inverse .btn-link[disabled]:focus, +fieldset[disabled] .navbar-inverse .btn-link:focus { + color: #444444; +} +.breadcrumb { + padding: 8px 15px; + margin-bottom: 20px; + list-style: none; + background-color: #f5f5f5; + border-radius: 4px; +} +.breadcrumb > li { + display: inline-block; +} +.breadcrumb > li + li:before { + content: "/\00a0"; + padding: 0 5px; + color: #cccccc; +} +.breadcrumb > .active { + color: #777777; +} +.pagination { + display: inline-block; + padding-left: 0; + margin: 20px 0; + border-radius: 4px; +} +.pagination > li { + display: inline; +} +.pagination > li > a, +.pagination > li > span { + position: relative; + float: left; + padding: 6px 12px; + line-height: 1.42857143; + text-decoration: none; + color: #337ab7; + background-color: #ffffff; + border: 1px solid #dddddd; + margin-left: -1px; +} +.pagination > li:first-child > a, +.pagination > li:first-child > span { + margin-left: 0; + border-bottom-left-radius: 4px; + border-top-left-radius: 4px; +} +.pagination > li:last-child > a, +.pagination > li:last-child > span { + border-bottom-right-radius: 4px; + border-top-right-radius: 4px; +} +.pagination > li > a:hover, +.pagination > li > span:hover, +.pagination > li > a:focus, +.pagination > li > span:focus { + color: #23527c; + background-color: #eeeeee; + border-color: #dddddd; +} +.pagination > .active > a, +.pagination > .active > span, +.pagination > .active > a:hover, +.pagination > .active > span:hover, +.pagination > .active > a:focus, +.pagination > .active > span:focus { + z-index: 2; + color: #ffffff; + background-color: #337ab7; + border-color: #337ab7; + cursor: default; +} +.pagination > .disabled > span, +.pagination > .disabled > span:hover, +.pagination > .disabled > span:focus, +.pagination > .disabled > a, +.pagination > .disabled > a:hover, +.pagination > .disabled > a:focus { + color: #777777; + background-color: #ffffff; + border-color: #dddddd; + cursor: not-allowed; +} +.pagination-lg > li > a, +.pagination-lg > li > span { + padding: 10px 16px; + font-size: 18px; +} +.pagination-lg > li:first-child > a, +.pagination-lg > li:first-child > span { + border-bottom-left-radius: 6px; + border-top-left-radius: 6px; +} +.pagination-lg > li:last-child > a, +.pagination-lg > li:last-child > span { + border-bottom-right-radius: 6px; + border-top-right-radius: 6px; +} +.pagination-sm > li > a, +.pagination-sm > li > span { + padding: 5px 10px; + font-size: 12px; +} +.pagination-sm > li:first-child > a, +.pagination-sm > li:first-child > span { + border-bottom-left-radius: 3px; + border-top-left-radius: 3px; +} +.pagination-sm > li:last-child > a, +.pagination-sm > li:last-child > span { + border-bottom-right-radius: 3px; + border-top-right-radius: 3px; +} +.pager { + padding-left: 0; + margin: 20px 0; + list-style: none; + text-align: center; +} +.pager li { + display: inline; +} +.pager li > a, +.pager li > span { + display: inline-block; + padding: 5px 14px; + background-color: #ffffff; + border: 1px solid #dddddd; + border-radius: 15px; +} +.pager li > a:hover, +.pager li > a:focus { + text-decoration: none; + background-color: #eeeeee; +} +.pager .next > a, +.pager .next > span { + float: right; +} +.pager .previous > a, +.pager .previous > span { + float: left; +} +.pager .disabled > a, +.pager .disabled > a:hover, +.pager .disabled > a:focus, +.pager .disabled > span { + color: #777777; + background-color: #ffffff; + cursor: not-allowed; +} +.label { + display: inline; + padding: .2em .6em .3em; + font-size: 75%; + font-weight: bold; + line-height: 1; + color: #ffffff; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + border-radius: .25em; +} +a.label:hover, +a.label:focus { + color: #ffffff; + text-decoration: none; + cursor: pointer; +} +.label:empty { + display: none; +} +.btn .label { + position: relative; + top: -1px; +} +.label-default { + background-color: #777777; +} +.label-default[href]:hover, +.label-default[href]:focus { + background-color: #5e5e5e; +} +.label-primary { + background-color: #337ab7; +} +.label-primary[href]:hover, +.label-primary[href]:focus { + background-color: #286090; +} +.label-success { + background-color: #5cb85c; +} +.label-success[href]:hover, +.label-success[href]:focus { + background-color: #449d44; +} +.label-info { + background-color: #5bc0de; +} +.label-info[href]:hover, +.label-info[href]:focus { + background-color: #31b0d5; +} +.label-warning { + background-color: #f0ad4e; +} +.label-warning[href]:hover, +.label-warning[href]:focus { + background-color: #ec971f; +} +.label-danger { + background-color: #d9534f; +} +.label-danger[href]:hover, +.label-danger[href]:focus { + background-color: #c9302c; +} +.badge { + display: inline-block; + min-width: 10px; + padding: 3px 7px; + font-size: 12px; + font-weight: bold; + color: #ffffff; + line-height: 1; + vertical-align: baseline; + white-space: nowrap; + text-align: center; + background-color: #777777; + border-radius: 10px; +} +.badge:empty { + display: none; +} +.btn .badge { + position: relative; + top: -1px; +} +.btn-xs .badge { + top: 0; + padding: 1px 5px; +} +a.badge:hover, +a.badge:focus { + color: #ffffff; + text-decoration: none; + cursor: pointer; +} +.list-group-item.active > .badge, +.nav-pills > .active > a > .badge { + color: #337ab7; + background-color: #ffffff; +} +.list-group-item > .badge { + float: right; +} +.list-group-item > .badge + .badge { + margin-right: 5px; +} +.nav-pills > li > a > .badge { + margin-left: 3px; +} +.jumbotron { + padding: 30px 15px; + margin-bottom: 30px; + color: inherit; + background-color: #eeeeee; +} +.jumbotron h1, +.jumbotron .h1 { + color: inherit; +} +.jumbotron p { + margin-bottom: 15px; + font-size: 21px; + font-weight: 200; +} +.jumbotron > hr { + border-top-color: #d5d5d5; +} +.container .jumbotron, +.container-fluid .jumbotron { + border-radius: 6px; +} +.jumbotron .container { + max-width: 100%; +} +@media screen and (min-width: 768px) { + .jumbotron { + padding: 48px 0; + } + .container .jumbotron, + .container-fluid .jumbotron { + padding-left: 60px; + padding-right: 60px; + } + .jumbotron h1, + .jumbotron .h1 { + font-size: 63px; + } +} +.thumbnail { + display: block; + padding: 4px; + margin-bottom: 20px; + line-height: 1.42857143; + background-color: #ffffff; + border: 1px solid #dddddd; + border-radius: 4px; + -webkit-transition: border 0.2s ease-in-out; + -o-transition: border 0.2s ease-in-out; + transition: border 0.2s ease-in-out; +} +.thumbnail > img, +.thumbnail a > img { + margin-left: auto; + margin-right: auto; +} +a.thumbnail:hover, +a.thumbnail:focus, +a.thumbnail.active { + border-color: #337ab7; +} +.thumbnail .caption { + padding: 9px; + color: #333333; +} +.alert { + padding: 15px; + margin-bottom: 20px; + border: 1px solid transparent; + border-radius: 4px; +} +.alert h4 { + margin-top: 0; + color: inherit; +} +.alert .alert-link { + font-weight: bold; +} +.alert > p, +.alert > ul { + margin-bottom: 0; +} +.alert > p + p { + margin-top: 5px; +} +.alert-dismissable, +.alert-dismissible { + padding-right: 35px; +} +.alert-dismissable .close, +.alert-dismissible .close { + position: relative; + top: -2px; + right: -21px; + color: inherit; +} +.alert-success { + background-color: #dff0d8; + border-color: #d6e9c6; + color: #3c763d; +} +.alert-success hr { + border-top-color: #c9e2b3; +} +.alert-success .alert-link { + color: #2b542c; +} +.alert-info { + background-color: #d9edf7; + border-color: #bce8f1; + color: #31708f; +} +.alert-info hr { + border-top-color: #a6e1ec; +} +.alert-info .alert-link { + color: #245269; +} +.alert-warning { + background-color: #fcf8e3; + border-color: #faebcc; + color: #8a6d3b; +} +.alert-warning hr { + border-top-color: #f7e1b5; +} +.alert-warning .alert-link { + color: #66512c; +} +.alert-danger { + background-color: #f2dede; + border-color: #ebccd1; + color: #a94442; +} +.alert-danger hr { + border-top-color: #e4b9c0; +} +.alert-danger .alert-link { + color: #843534; +} +@-webkit-keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +@keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +.progress { + overflow: hidden; + height: 20px; + margin-bottom: 20px; + background-color: #f5f5f5; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); +} +.progress-bar { + float: left; + width: 0%; + height: 100%; + font-size: 12px; + line-height: 20px; + color: #ffffff; + text-align: center; + background-color: #337ab7; + -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + -webkit-transition: width 0.6s ease; + -o-transition: width 0.6s ease; + transition: width 0.6s ease; +} +.progress-striped .progress-bar, +.progress-bar-striped { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-size: 40px 40px; +} +.progress.active .progress-bar, +.progress-bar.active { + -webkit-animation: progress-bar-stripes 2s linear infinite; + -o-animation: progress-bar-stripes 2s linear infinite; + animation: progress-bar-stripes 2s linear infinite; +} +.progress-bar-success { + background-color: #5cb85c; +} +.progress-striped .progress-bar-success { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-bar-info { + background-color: #5bc0de; +} +.progress-striped .progress-bar-info { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-bar-warning { + background-color: #f0ad4e; +} +.progress-striped .progress-bar-warning { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-bar-danger { + background-color: #d9534f; +} +.progress-striped .progress-bar-danger { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.media { + margin-top: 15px; +} +.media:first-child { + margin-top: 0; +} +.media-right, +.media > .pull-right { + padding-left: 10px; +} +.media-left, +.media > .pull-left { + padding-right: 10px; +} +.media-left, +.media-right, +.media-body { + display: table-cell; + vertical-align: top; +} +.media-middle { + vertical-align: middle; +} +.media-bottom { + vertical-align: bottom; +} +.media-heading { + margin-top: 0; + margin-bottom: 5px; +} +.media-list { + padding-left: 0; + list-style: none; +} +.list-group { + margin-bottom: 20px; + padding-left: 0; +} +.list-group-item { + position: relative; + display: block; + padding: 10px 15px; + margin-bottom: -1px; + background-color: #ffffff; + border: 1px solid #dddddd; +} +.list-group-item:first-child { + border-top-right-radius: 4px; + border-top-left-radius: 4px; +} +.list-group-item:last-child { + margin-bottom: 0; + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; +} +a.list-group-item { + color: #555555; +} +a.list-group-item .list-group-item-heading { + color: #333333; +} +a.list-group-item:hover, +a.list-group-item:focus { + text-decoration: none; + color: #555555; + background-color: #f5f5f5; +} +.list-group-item.disabled, +.list-group-item.disabled:hover, +.list-group-item.disabled:focus { + background-color: #eeeeee; + color: #777777; + cursor: not-allowed; +} +.list-group-item.disabled .list-group-item-heading, +.list-group-item.disabled:hover .list-group-item-heading, +.list-group-item.disabled:focus .list-group-item-heading { + color: inherit; +} +.list-group-item.disabled .list-group-item-text, +.list-group-item.disabled:hover .list-group-item-text, +.list-group-item.disabled:focus .list-group-item-text { + color: #777777; +} +.list-group-item.active, +.list-group-item.active:hover, +.list-group-item.active:focus { + z-index: 2; + color: #ffffff; + background-color: #337ab7; + border-color: #337ab7; +} +.list-group-item.active .list-group-item-heading, +.list-group-item.active:hover .list-group-item-heading, +.list-group-item.active:focus .list-group-item-heading, +.list-group-item.active .list-group-item-heading > small, +.list-group-item.active:hover .list-group-item-heading > small, +.list-group-item.active:focus .list-group-item-heading > small, +.list-group-item.active .list-group-item-heading > .small, +.list-group-item.active:hover .list-group-item-heading > .small, +.list-group-item.active:focus .list-group-item-heading > .small { + color: inherit; +} +.list-group-item.active .list-group-item-text, +.list-group-item.active:hover .list-group-item-text, +.list-group-item.active:focus .list-group-item-text { + color: #c7ddef; +} +.list-group-item-success { + color: #3c763d; + background-color: #dff0d8; +} +a.list-group-item-success { + color: #3c763d; +} +a.list-group-item-success .list-group-item-heading { + color: inherit; +} +a.list-group-item-success:hover, +a.list-group-item-success:focus { + color: #3c763d; + background-color: #d0e9c6; +} +a.list-group-item-success.active, +a.list-group-item-success.active:hover, +a.list-group-item-success.active:focus { + color: #fff; + background-color: #3c763d; + border-color: #3c763d; +} +.list-group-item-info { + color: #31708f; + background-color: #d9edf7; +} +a.list-group-item-info { + color: #31708f; +} +a.list-group-item-info .list-group-item-heading { + color: inherit; +} +a.list-group-item-info:hover, +a.list-group-item-info:focus { + color: #31708f; + background-color: #c4e3f3; +} +a.list-group-item-info.active, +a.list-group-item-info.active:hover, +a.list-group-item-info.active:focus { + color: #fff; + background-color: #31708f; + border-color: #31708f; +} +.list-group-item-warning { + color: #8a6d3b; + background-color: #fcf8e3; +} +a.list-group-item-warning { + color: #8a6d3b; +} +a.list-group-item-warning .list-group-item-heading { + color: inherit; +} +a.list-group-item-warning:hover, +a.list-group-item-warning:focus { + color: #8a6d3b; + background-color: #faf2cc; +} +a.list-group-item-warning.active, +a.list-group-item-warning.active:hover, +a.list-group-item-warning.active:focus { + color: #fff; + background-color: #8a6d3b; + border-color: #8a6d3b; +} +.list-group-item-danger { + color: #a94442; + background-color: #f2dede; +} +a.list-group-item-danger { + color: #a94442; +} +a.list-group-item-danger .list-group-item-heading { + color: inherit; +} +a.list-group-item-danger:hover, +a.list-group-item-danger:focus { + color: #a94442; + background-color: #ebcccc; +} +a.list-group-item-danger.active, +a.list-group-item-danger.active:hover, +a.list-group-item-danger.active:focus { + color: #fff; + background-color: #a94442; + border-color: #a94442; +} +.list-group-item-heading { + margin-top: 0; + margin-bottom: 5px; +} +.list-group-item-text { + margin-bottom: 0; + line-height: 1.3; +} +.panel { + margin-bottom: 20px; + background-color: #ffffff; + border: 1px solid transparent; + border-radius: 4px; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); +} +.panel-body { + padding: 15px; +} +.panel-heading { + padding: 10px 15px; + border-bottom: 1px solid transparent; + border-top-right-radius: 3px; + border-top-left-radius: 3px; +} +.panel-heading > .dropdown .dropdown-toggle { + color: inherit; +} +.panel-title { + margin-top: 0; + margin-bottom: 0; + font-size: 16px; + color: inherit; +} +.panel-title > a { + color: inherit; +} +.panel-footer { + padding: 10px 15px; + background-color: #f5f5f5; + border-top: 1px solid #dddddd; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel > .list-group, +.panel > .panel-collapse > .list-group { + margin-bottom: 0; +} +.panel > .list-group .list-group-item, +.panel > .panel-collapse > .list-group .list-group-item { + border-width: 1px 0; + border-radius: 0; +} +.panel > .list-group:first-child .list-group-item:first-child, +.panel > .panel-collapse > .list-group:first-child .list-group-item:first-child { + border-top: 0; + border-top-right-radius: 3px; + border-top-left-radius: 3px; +} +.panel > .list-group:last-child .list-group-item:last-child, +.panel > .panel-collapse > .list-group:last-child .list-group-item:last-child { + border-bottom: 0; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel-heading + .list-group .list-group-item:first-child { + border-top-width: 0; +} +.list-group + .panel-footer { + border-top-width: 0; +} +.panel > .table, +.panel > .table-responsive > .table, +.panel > .panel-collapse > .table { + margin-bottom: 0; +} +.panel > .table caption, +.panel > .table-responsive > .table caption, +.panel > .panel-collapse > .table caption { + padding-left: 15px; + padding-right: 15px; +} +.panel > .table:first-child, +.panel > .table-responsive:first-child > .table:first-child { + border-top-right-radius: 3px; + border-top-left-radius: 3px; +} +.panel > .table:first-child > thead:first-child > tr:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child { + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} +.panel > .table:first-child > thead:first-child > tr:first-child td:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child td:first-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child, +.panel > .table:first-child > thead:first-child > tr:first-child th:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child th:first-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child { + border-top-left-radius: 3px; +} +.panel > .table:first-child > thead:first-child > tr:first-child td:last-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child, +.panel > .table:first-child > tbody:first-child > tr:first-child td:last-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child, +.panel > .table:first-child > thead:first-child > tr:first-child th:last-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child, +.panel > .table:first-child > tbody:first-child > tr:first-child th:last-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child { + border-top-right-radius: 3px; +} +.panel > .table:last-child, +.panel > .table-responsive:last-child > .table:last-child { + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel > .table:last-child > tbody:last-child > tr:last-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child { + border-bottom-left-radius: 3px; + border-bottom-right-radius: 3px; +} +.panel > .table:last-child > tbody:last-child > tr:last-child td:first-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child, +.panel > .table:last-child > tbody:last-child > tr:last-child th:first-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child { + border-bottom-left-radius: 3px; +} +.panel > .table:last-child > tbody:last-child > tr:last-child td:last-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child, +.panel > .table:last-child > tbody:last-child > tr:last-child th:last-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child { + border-bottom-right-radius: 3px; +} +.panel > .panel-body + .table, +.panel > .panel-body + .table-responsive, +.panel > .table + .panel-body, +.panel > .table-responsive + .panel-body { + border-top: 1px solid #dddddd; +} +.panel > .table > tbody:first-child > tr:first-child th, +.panel > .table > tbody:first-child > tr:first-child td { + border-top: 0; +} +.panel > .table-bordered, +.panel > .table-responsive > .table-bordered { + border: 0; +} +.panel > .table-bordered > thead > tr > th:first-child, +.panel > .table-responsive > .table-bordered > thead > tr > th:first-child, +.panel > .table-bordered > tbody > tr > th:first-child, +.panel > .table-responsive > .table-bordered > tbody > tr > th:first-child, +.panel > .table-bordered > tfoot > tr > th:first-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child, +.panel > .table-bordered > thead > tr > td:first-child, +.panel > .table-responsive > .table-bordered > thead > tr > td:first-child, +.panel > .table-bordered > tbody > tr > td:first-child, +.panel > .table-responsive > .table-bordered > tbody > tr > td:first-child, +.panel > .table-bordered > tfoot > tr > td:first-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child { + border-left: 0; +} +.panel > .table-bordered > thead > tr > th:last-child, +.panel > .table-responsive > .table-bordered > thead > tr > th:last-child, +.panel > .table-bordered > tbody > tr > th:last-child, +.panel > .table-responsive > .table-bordered > tbody > tr > th:last-child, +.panel > .table-bordered > tfoot > tr > th:last-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child, +.panel > .table-bordered > thead > tr > td:last-child, +.panel > .table-responsive > .table-bordered > thead > tr > td:last-child, +.panel > .table-bordered > tbody > tr > td:last-child, +.panel > .table-responsive > .table-bordered > tbody > tr > td:last-child, +.panel > .table-bordered > tfoot > tr > td:last-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child { + border-right: 0; +} +.panel > .table-bordered > thead > tr:first-child > td, +.panel > .table-responsive > .table-bordered > thead > tr:first-child > td, +.panel > .table-bordered > tbody > tr:first-child > td, +.panel > .table-responsive > .table-bordered > tbody > tr:first-child > td, +.panel > .table-bordered > thead > tr:first-child > th, +.panel > .table-responsive > .table-bordered > thead > tr:first-child > th, +.panel > .table-bordered > tbody > tr:first-child > th, +.panel > .table-responsive > .table-bordered > tbody > tr:first-child > th { + border-bottom: 0; +} +.panel > .table-bordered > tbody > tr:last-child > td, +.panel > .table-responsive > .table-bordered > tbody > tr:last-child > td, +.panel > .table-bordered > tfoot > tr:last-child > td, +.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td, +.panel > .table-bordered > tbody > tr:last-child > th, +.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th, +.panel > .table-bordered > tfoot > tr:last-child > th, +.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th { + border-bottom: 0; +} +.panel > .table-responsive { + border: 0; + margin-bottom: 0; +} +.panel-group { + margin-bottom: 20px; +} +.panel-group .panel { + margin-bottom: 0; + border-radius: 4px; +} +.panel-group .panel + .panel { + margin-top: 5px; +} +.panel-group .panel-heading { + border-bottom: 0; +} +.panel-group .panel-heading + .panel-collapse > .panel-body, +.panel-group .panel-heading + .panel-collapse > .list-group { + border-top: 1px solid #dddddd; +} +.panel-group .panel-footer { + border-top: 0; +} +.panel-group .panel-footer + .panel-collapse .panel-body { + border-bottom: 1px solid #dddddd; +} +.panel-default { + border-color: #dddddd; +} +.panel-default > .panel-heading { + color: #333333; + background-color: #f5f5f5; + border-color: #dddddd; +} +.panel-default > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #dddddd; +} +.panel-default > .panel-heading .badge { + color: #f5f5f5; + background-color: #333333; +} +.panel-default > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #dddddd; +} +.panel-primary { + border-color: #337ab7; +} +.panel-primary > .panel-heading { + color: #ffffff; + background-color: #337ab7; + border-color: #337ab7; +} +.panel-primary > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #337ab7; +} +.panel-primary > .panel-heading .badge { + color: #337ab7; + background-color: #ffffff; +} +.panel-primary > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #337ab7; +} +.panel-success { + border-color: #d6e9c6; +} +.panel-success > .panel-heading { + color: #3c763d; + background-color: #dff0d8; + border-color: #d6e9c6; +} +.panel-success > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #d6e9c6; +} +.panel-success > .panel-heading .badge { + color: #dff0d8; + background-color: #3c763d; +} +.panel-success > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #d6e9c6; +} +.panel-info { + border-color: #bce8f1; +} +.panel-info > .panel-heading { + color: #31708f; + background-color: #d9edf7; + border-color: #bce8f1; +} +.panel-info > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #bce8f1; +} +.panel-info > .panel-heading .badge { + color: #d9edf7; + background-color: #31708f; +} +.panel-info > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #bce8f1; +} +.panel-warning { + border-color: #faebcc; +} +.panel-warning > .panel-heading { + color: #8a6d3b; + background-color: #fcf8e3; + border-color: #faebcc; +} +.panel-warning > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #faebcc; +} +.panel-warning > .panel-heading .badge { + color: #fcf8e3; + background-color: #8a6d3b; +} +.panel-warning > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #faebcc; +} +.panel-danger { + border-color: #ebccd1; +} +.panel-danger > .panel-heading { + color: #a94442; + background-color: #f2dede; + border-color: #ebccd1; +} +.panel-danger > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #ebccd1; +} +.panel-danger > .panel-heading .badge { + color: #f2dede; + background-color: #a94442; +} +.panel-danger > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #ebccd1; +} +.embed-responsive { + position: relative; + display: block; + height: 0; + padding: 0; + overflow: hidden; +} +.embed-responsive .embed-responsive-item, +.embed-responsive iframe, +.embed-responsive embed, +.embed-responsive object, +.embed-responsive video { + position: absolute; + top: 0; + left: 0; + bottom: 0; + height: 100%; + width: 100%; + border: 0; +} +.embed-responsive.embed-responsive-16by9 { + padding-bottom: 56.25%; +} +.embed-responsive.embed-responsive-4by3 { + padding-bottom: 75%; +} +.well { + min-height: 20px; + padding: 19px; + margin-bottom: 20px; + background-color: #f5f5f5; + border: 1px solid #e3e3e3; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); +} +.well blockquote { + border-color: #ddd; + border-color: rgba(0, 0, 0, 0.15); +} +.well-lg { + padding: 24px; + border-radius: 6px; +} +.well-sm { + padding: 9px; + border-radius: 3px; +} +.close { + float: right; + font-size: 21px; + font-weight: bold; + line-height: 1; + color: #000000; + text-shadow: 0 1px 0 #ffffff; + opacity: 0.2; + filter: alpha(opacity=20); +} +.close:hover, +.close:focus { + color: #000000; + text-decoration: none; + cursor: pointer; + opacity: 0.5; + filter: alpha(opacity=50); +} +button.close { + padding: 0; + cursor: pointer; + background: transparent; + border: 0; + -webkit-appearance: none; +} +.modal-open { + overflow: hidden; +} +.modal { + display: none; + overflow: hidden; + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1040; + -webkit-overflow-scrolling: touch; + outline: 0; +} +.modal.fade .modal-dialog { + -webkit-transform: translate(0, -25%); + -ms-transform: translate(0, -25%); + -o-transform: translate(0, -25%); + transform: translate(0, -25%); + -webkit-transition: -webkit-transform 0.3s ease-out; + -moz-transition: -moz-transform 0.3s ease-out; + -o-transition: -o-transform 0.3s ease-out; + transition: transform 0.3s ease-out; +} +.modal.in .modal-dialog { + -webkit-transform: translate(0, 0); + -ms-transform: translate(0, 0); + -o-transform: translate(0, 0); + transform: translate(0, 0); +} +.modal-open .modal { + overflow-x: hidden; + overflow-y: auto; +} +.modal-dialog { + position: relative; + width: auto; + margin: 10px; +} +.modal-content { + position: relative; + background-color: #ffffff; + border: 1px solid #999999; + border: 1px solid rgba(0, 0, 0, 0.2); + border-radius: 6px; + -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); + box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); + background-clip: padding-box; + outline: 0; +} +.modal-backdrop { + position: absolute; + top: 0; + right: 0; + left: 0; + background-color: #000000; +} +.modal-backdrop.fade { + opacity: 0; + filter: alpha(opacity=0); +} +.modal-backdrop.in { + opacity: 0.5; + filter: alpha(opacity=50); +} +.modal-header { + padding: 15px; + border-bottom: 1px solid #e5e5e5; + min-height: 16.42857143px; +} +.modal-header .close { + margin-top: -2px; +} +.modal-title { + margin: 0; + line-height: 1.42857143; +} +.modal-body { + position: relative; + padding: 15px; +} +.modal-footer { + padding: 15px; + text-align: right; + border-top: 1px solid #e5e5e5; +} +.modal-footer .btn + .btn { + margin-left: 5px; + margin-bottom: 0; +} +.modal-footer .btn-group .btn + .btn { + margin-left: -1px; +} +.modal-footer .btn-block + .btn-block { + margin-left: 0; +} +.modal-scrollbar-measure { + position: absolute; + top: -9999px; + width: 50px; + height: 50px; + overflow: scroll; +} +@media (min-width: 768px) { + .modal-dialog { + width: 600px; + margin: 30px auto; + } + .modal-content { + -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); + box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); + } + .modal-sm { + width: 300px; + } +} +@media (min-width: 992px) { + .modal-lg { + width: 900px; + } +} +.tooltip { + position: absolute; + z-index: 1070; + display: block; + visibility: visible; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 12px; + font-weight: normal; + line-height: 1.4; + opacity: 0; + filter: alpha(opacity=0); +} +.tooltip.in { + opacity: 0.9; + filter: alpha(opacity=90); +} +.tooltip.top { + margin-top: -3px; + padding: 5px 0; +} +.tooltip.right { + margin-left: 3px; + padding: 0 5px; +} +.tooltip.bottom { + margin-top: 3px; + padding: 5px 0; +} +.tooltip.left { + margin-left: -3px; + padding: 0 5px; +} +.tooltip-inner { + max-width: 200px; + padding: 3px 8px; + color: #ffffff; + text-align: center; + text-decoration: none; + background-color: #000000; + border-radius: 4px; +} +.tooltip-arrow { + position: absolute; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} +.tooltip.top .tooltip-arrow { + bottom: 0; + left: 50%; + margin-left: -5px; + border-width: 5px 5px 0; + border-top-color: #000000; +} +.tooltip.top-left .tooltip-arrow { + bottom: 0; + right: 5px; + margin-bottom: -5px; + border-width: 5px 5px 0; + border-top-color: #000000; +} +.tooltip.top-right .tooltip-arrow { + bottom: 0; + left: 5px; + margin-bottom: -5px; + border-width: 5px 5px 0; + border-top-color: #000000; +} +.tooltip.right .tooltip-arrow { + top: 50%; + left: 0; + margin-top: -5px; + border-width: 5px 5px 5px 0; + border-right-color: #000000; +} +.tooltip.left .tooltip-arrow { + top: 50%; + right: 0; + margin-top: -5px; + border-width: 5px 0 5px 5px; + border-left-color: #000000; +} +.tooltip.bottom .tooltip-arrow { + top: 0; + left: 50%; + margin-left: -5px; + border-width: 0 5px 5px; + border-bottom-color: #000000; +} +.tooltip.bottom-left .tooltip-arrow { + top: 0; + right: 5px; + margin-top: -5px; + border-width: 0 5px 5px; + border-bottom-color: #000000; +} +.tooltip.bottom-right .tooltip-arrow { + top: 0; + left: 5px; + margin-top: -5px; + border-width: 0 5px 5px; + border-bottom-color: #000000; +} +.popover { + position: absolute; + top: 0; + left: 0; + z-index: 1060; + display: none; + max-width: 276px; + padding: 1px; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + font-weight: normal; + line-height: 1.42857143; + text-align: left; + background-color: #ffffff; + background-clip: padding-box; + border: 1px solid #cccccc; + border: 1px solid rgba(0, 0, 0, 0.2); + border-radius: 6px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + white-space: normal; +} +.popover.top { + margin-top: -10px; +} +.popover.right { + margin-left: 10px; +} +.popover.bottom { + margin-top: 10px; +} +.popover.left { + margin-left: -10px; +} +.popover-title { + margin: 0; + padding: 8px 14px; + font-size: 14px; + background-color: #f7f7f7; + border-bottom: 1px solid #ebebeb; + border-radius: 5px 5px 0 0; +} +.popover-content { + padding: 9px 14px; +} +.popover > .arrow, +.popover > .arrow:after { + position: absolute; + display: block; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} +.popover > .arrow { + border-width: 11px; +} +.popover > .arrow:after { + border-width: 10px; + content: ""; +} +.popover.top > .arrow { + left: 50%; + margin-left: -11px; + border-bottom-width: 0; + border-top-color: #999999; + border-top-color: rgba(0, 0, 0, 0.25); + bottom: -11px; +} +.popover.top > .arrow:after { + content: " "; + bottom: 1px; + margin-left: -10px; + border-bottom-width: 0; + border-top-color: #ffffff; +} +.popover.right > .arrow { + top: 50%; + left: -11px; + margin-top: -11px; + border-left-width: 0; + border-right-color: #999999; + border-right-color: rgba(0, 0, 0, 0.25); +} +.popover.right > .arrow:after { + content: " "; + left: 1px; + bottom: -10px; + border-left-width: 0; + border-right-color: #ffffff; +} +.popover.bottom > .arrow { + left: 50%; + margin-left: -11px; + border-top-width: 0; + border-bottom-color: #999999; + border-bottom-color: rgba(0, 0, 0, 0.25); + top: -11px; +} +.popover.bottom > .arrow:after { + content: " "; + top: 1px; + margin-left: -10px; + border-top-width: 0; + border-bottom-color: #ffffff; +} +.popover.left > .arrow { + top: 50%; + right: -11px; + margin-top: -11px; + border-right-width: 0; + border-left-color: #999999; + border-left-color: rgba(0, 0, 0, 0.25); +} +.popover.left > .arrow:after { + content: " "; + right: 1px; + border-right-width: 0; + border-left-color: #ffffff; + bottom: -10px; +} +.carousel { + position: relative; +} +.carousel-inner { + position: relative; + overflow: hidden; + width: 100%; +} +.carousel-inner > .item { + display: none; + position: relative; + -webkit-transition: 0.6s ease-in-out left; + -o-transition: 0.6s ease-in-out left; + transition: 0.6s ease-in-out left; +} +.carousel-inner > .item > img, +.carousel-inner > .item > a > img { + line-height: 1; +} +@media all and (transform-3d), (-webkit-transform-3d) { + .carousel-inner > .item { + transition: transform 0.6s ease-in-out; + backface-visibility: hidden; + perspective: 1000; + } + .carousel-inner > .item.next, + .carousel-inner > .item.active.right { + transform: translate3d(100%, 0, 0); + left: 0; + } + .carousel-inner > .item.prev, + .carousel-inner > .item.active.left { + transform: translate3d(-100%, 0, 0); + left: 0; + } + .carousel-inner > .item.next.left, + .carousel-inner > .item.prev.right, + .carousel-inner > .item.active { + transform: translate3d(0, 0, 0); + left: 0; + } +} +.carousel-inner > .active, +.carousel-inner > .next, +.carousel-inner > .prev { + display: block; +} +.carousel-inner > .active { + left: 0; +} +.carousel-inner > .next, +.carousel-inner > .prev { + position: absolute; + top: 0; + width: 100%; +} +.carousel-inner > .next { + left: 100%; +} +.carousel-inner > .prev { + left: -100%; +} +.carousel-inner > .next.left, +.carousel-inner > .prev.right { + left: 0; +} +.carousel-inner > .active.left { + left: -100%; +} +.carousel-inner > .active.right { + left: 100%; +} +.carousel-control { + position: absolute; + top: 0; + left: 0; + bottom: 0; + width: 15%; + opacity: 0.5; + filter: alpha(opacity=50); + font-size: 20px; + color: #ffffff; + text-align: center; + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); +} +.carousel-control.left { + background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); + background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); + background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1); +} +.carousel-control.right { + left: auto; + right: 0; + background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); + background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); + background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1); +} +.carousel-control:hover, +.carousel-control:focus { + outline: 0; + color: #ffffff; + text-decoration: none; + opacity: 0.9; + filter: alpha(opacity=90); +} +.carousel-control .icon-prev, +.carousel-control .icon-next, +.carousel-control .glyphicon-chevron-left, +.carousel-control .glyphicon-chevron-right { + position: absolute; + top: 50%; + z-index: 5; + display: inline-block; +} +.carousel-control .icon-prev, +.carousel-control .glyphicon-chevron-left { + left: 50%; + margin-left: -10px; +} +.carousel-control .icon-next, +.carousel-control .glyphicon-chevron-right { + right: 50%; + margin-right: -10px; +} +.carousel-control .icon-prev, +.carousel-control .icon-next { + width: 20px; + height: 20px; + margin-top: -10px; + font-family: serif; +} +.carousel-control .icon-prev:before { + content: '\2039'; +} +.carousel-control .icon-next:before { + content: '\203a'; +} +.carousel-indicators { + position: absolute; + bottom: 10px; + left: 50%; + z-index: 15; + width: 60%; + margin-left: -30%; + padding-left: 0; + list-style: none; + text-align: center; +} +.carousel-indicators li { + display: inline-block; + width: 10px; + height: 10px; + margin: 1px; + text-indent: -999px; + border: 1px solid #ffffff; + border-radius: 10px; + cursor: pointer; + background-color: #000 \9; + background-color: rgba(0, 0, 0, 0); +} +.carousel-indicators .active { + margin: 0; + width: 12px; + height: 12px; + background-color: #ffffff; +} +.carousel-caption { + position: absolute; + left: 15%; + right: 15%; + bottom: 20px; + z-index: 10; + padding-top: 20px; + padding-bottom: 20px; + color: #ffffff; + text-align: center; + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); +} +.carousel-caption .btn { + text-shadow: none; +} +@media screen and (min-width: 768px) { + .carousel-control .glyphicon-chevron-left, + .carousel-control .glyphicon-chevron-right, + .carousel-control .icon-prev, + .carousel-control .icon-next { + width: 30px; + height: 30px; + margin-top: -15px; + font-size: 30px; + } + .carousel-control .glyphicon-chevron-left, + .carousel-control .icon-prev { + margin-left: -15px; + } + .carousel-control .glyphicon-chevron-right, + .carousel-control .icon-next { + margin-right: -15px; + } + .carousel-caption { + left: 20%; + right: 20%; + padding-bottom: 30px; + } + .carousel-indicators { + bottom: 20px; + } +} +.clearfix:before, +.clearfix:after, +.dl-horizontal dd:before, +.dl-horizontal dd:after, +.container:before, +.container:after, +.container-fluid:before, +.container-fluid:after, +.row:before, +.row:after, +.form-horizontal .form-group:before, +.form-horizontal .form-group:after, +.btn-toolbar:before, +.btn-toolbar:after, +.btn-group-vertical > .btn-group:before, +.btn-group-vertical > .btn-group:after, +.nav:before, +.nav:after, +.navbar:before, +.navbar:after, +.navbar-header:before, +.navbar-header:after, +.navbar-collapse:before, +.navbar-collapse:after, +.pager:before, +.pager:after, +.panel-body:before, +.panel-body:after, +.modal-footer:before, +.modal-footer:after { + content: " "; + display: table; +} +.clearfix:after, +.dl-horizontal dd:after, +.container:after, +.container-fluid:after, +.row:after, +.form-horizontal .form-group:after, +.btn-toolbar:after, +.btn-group-vertical > .btn-group:after, +.nav:after, +.navbar:after, +.navbar-header:after, +.navbar-collapse:after, +.pager:after, +.panel-body:after, +.modal-footer:after { + clear: both; +} +.center-block { + display: block; + margin-left: auto; + margin-right: auto; +} +.pull-right { + float: right !important; +} +.pull-left { + float: left !important; +} +.hide { + display: none !important; +} +.show { + display: block !important; +} +.invisible { + visibility: hidden; +} +.text-hide { + font: 0/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0; +} +.hidden { + display: none !important; + visibility: hidden !important; +} +.affix { + position: fixed; +} +@-ms-viewport { + width: device-width; +} +.visible-xs, +.visible-sm, +.visible-md, +.visible-lg { + display: none !important; +} +.visible-xs-block, +.visible-xs-inline, +.visible-xs-inline-block, +.visible-sm-block, +.visible-sm-inline, +.visible-sm-inline-block, +.visible-md-block, +.visible-md-inline, +.visible-md-inline-block, +.visible-lg-block, +.visible-lg-inline, +.visible-lg-inline-block { + display: none !important; +} +@media (max-width: 767px) { + .visible-xs { + display: block !important; + } + table.visible-xs { + display: table; + } + tr.visible-xs { + display: table-row !important; + } + th.visible-xs, + td.visible-xs { + display: table-cell !important; + } +} +@media (max-width: 767px) { + .visible-xs-block { + display: block !important; + } +} +@media (max-width: 767px) { + .visible-xs-inline { + display: inline !important; + } +} +@media (max-width: 767px) { + .visible-xs-inline-block { + display: inline-block !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm { + display: block !important; + } + table.visible-sm { + display: table; + } + tr.visible-sm { + display: table-row !important; + } + th.visible-sm, + td.visible-sm { + display: table-cell !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-block { + display: block !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-inline { + display: inline !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-inline-block { + display: inline-block !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md { + display: block !important; + } + table.visible-md { + display: table; + } + tr.visible-md { + display: table-row !important; + } + th.visible-md, + td.visible-md { + display: table-cell !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-block { + display: block !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-inline { + display: inline !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-inline-block { + display: inline-block !important; + } +} +@media (min-width: 1200px) { + .visible-lg { + display: block !important; + } + table.visible-lg { + display: table; + } + tr.visible-lg { + display: table-row !important; + } + th.visible-lg, + td.visible-lg { + display: table-cell !important; + } +} +@media (min-width: 1200px) { + .visible-lg-block { + display: block !important; + } +} +@media (min-width: 1200px) { + .visible-lg-inline { + display: inline !important; + } +} +@media (min-width: 1200px) { + .visible-lg-inline-block { + display: inline-block !important; + } +} +@media (max-width: 767px) { + .hidden-xs { + display: none !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .hidden-sm { + display: none !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .hidden-md { + display: none !important; + } +} +@media (min-width: 1200px) { + .hidden-lg { + display: none !important; + } +} +.visible-print { + display: none !important; +} +@media print { + .visible-print { + display: block !important; + } + table.visible-print { + display: table; + } + tr.visible-print { + display: table-row !important; + } + th.visible-print, + td.visible-print { + display: table-cell !important; + } +} +.visible-print-block { + display: none !important; +} +@media print { + .visible-print-block { + display: block !important; + } +} +.visible-print-inline { + display: none !important; +} +@media print { + .visible-print-inline { + display: inline !important; + } +} +.visible-print-inline-block { + display: none !important; +} +@media print { + .visible-print-inline-block { + display: inline-block !important; + } +} +@media print { + .hidden-print { + display: none !important; + } +} diff --git a/food-open/food-open-web/src/main/resources/static/assets/css/font-awesome.css b/food-open/food-open-web/src/main/resources/static/assets/css/font-awesome.css new file mode 100644 index 0000000..4040b3c --- /dev/null +++ b/food-open/food-open-web/src/main/resources/static/assets/css/font-awesome.css @@ -0,0 +1,1672 @@ +/*! + * Font Awesome 4.2.0 by @davegandy - http://fontawesome.io - @fontawesome + * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) + */ +/* FONT PATH + * -------------------------- */ +@font-face { + font-family: 'FontAwesome'; + src: url('../fonts/fontawesome-webfont.eot?v=4.2.0'); + src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.2.0') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff?v=4.2.0') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.2.0') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.2.0#fontawesomeregular') format('svg'); + font-weight: normal; + font-style: normal; +} +.fa { + display: inline-block; + font: normal normal normal 14px/1 FontAwesome; + font-size: inherit; + text-rendering: auto; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +/* makes the font 33% larger relative to the icon container */ +.fa-lg { + font-size: 1.33333333em; + line-height: 0.75em; + vertical-align: -15%; +} +.fa-2x { + font-size: 2em; +} +.fa-3x { + font-size: 3em; +} +.fa-4x { + font-size: 4em; +} +.fa-5x { + font-size: 5em; +} +.fa-fw { + width: 1.28571429em; + text-align: center; +} +.fa-ul { + padding-left: 0; + margin-left: 2.14285714em; + list-style-type: none; +} +.fa-ul > li { + position: relative; +} +.fa-li { + position: absolute; + left: -2.14285714em; + width: 2.14285714em; + top: 0.14285714em; + text-align: center; +} +.fa-li.fa-lg { + left: -1.85714286em; +} +.fa-border { + padding: .2em .25em .15em; + border: solid 0.08em #eeeeee; + border-radius: .1em; +} +.pull-right { + float: right; +} +.pull-left { + float: left; +} +.fa.pull-left { + margin-right: .3em; +} +.fa.pull-right { + margin-left: .3em; +} +.fa-spin { + -webkit-animation: fa-spin 2s infinite linear; + animation: fa-spin 2s infinite linear; +} +@-webkit-keyframes fa-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} +@keyframes fa-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} +.fa-rotate-90 { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); + -webkit-transform: rotate(90deg); + -ms-transform: rotate(90deg); + transform: rotate(90deg); +} +.fa-rotate-180 { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2); + -webkit-transform: rotate(180deg); + -ms-transform: rotate(180deg); + transform: rotate(180deg); +} +.fa-rotate-270 { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); + -webkit-transform: rotate(270deg); + -ms-transform: rotate(270deg); + transform: rotate(270deg); +} +.fa-flip-horizontal { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1); + -webkit-transform: scale(-1, 1); + -ms-transform: scale(-1, 1); + transform: scale(-1, 1); +} +.fa-flip-vertical { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1); + -webkit-transform: scale(1, -1); + -ms-transform: scale(1, -1); + transform: scale(1, -1); +} +:root .fa-rotate-90, +:root .fa-rotate-180, +:root .fa-rotate-270, +:root .fa-flip-horizontal, +:root .fa-flip-vertical { + filter: none; +} +.fa-stack { + position: relative; + display: inline-block; + width: 2em; + height: 2em; + line-height: 2em; + vertical-align: middle; +} +.fa-stack-1x, +.fa-stack-2x { + position: absolute; + left: 0; + width: 100%; + text-align: center; +} +.fa-stack-1x { + line-height: inherit; +} +.fa-stack-2x { + font-size: 2em; +} +.fa-inverse { + color: #ffffff; +} +/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen + readers do not read off random characters that represent icons */ +.fa-glass:before { + content: "\f000"; +} +.fa-music:before { + content: "\f001"; +} +.fa-search:before { + content: "\f002"; +} +.fa-envelope-o:before { + content: "\f003"; +} +.fa-heart:before { + content: "\f004"; +} +.fa-star:before { + content: "\f005"; +} +.fa-star-o:before { + content: "\f006"; +} +.fa-user:before { + content: "\f007"; +} +.fa-film:before { + content: "\f008"; +} +.fa-th-large:before { + content: "\f009"; +} +.fa-th:before { + content: "\f00a"; +} +.fa-th-list:before { + content: "\f00b"; +} +.fa-check:before { + content: "\f00c"; +} +.fa-remove:before, +.fa-close:before, +.fa-times:before { + content: "\f00d"; +} +.fa-search-plus:before { + content: "\f00e"; +} +.fa-search-minus:before { + content: "\f010"; +} +.fa-power-off:before { + content: "\f011"; +} +.fa-signal:before { + content: "\f012"; +} +.fa-gear:before, +.fa-cog:before { + content: "\f013"; +} +.fa-trash-o:before { + content: "\f014"; +} +.fa-home:before { + content: "\f015"; +} +.fa-file-o:before { + content: "\f016"; +} +.fa-clock-o:before { + content: "\f017"; +} +.fa-road:before { + content: "\f018"; +} +.fa-download:before { + content: "\f019"; +} +.fa-arrow-circle-o-down:before { + content: "\f01a"; +} +.fa-arrow-circle-o-up:before { + content: "\f01b"; +} +.fa-inbox:before { + content: "\f01c"; +} +.fa-play-circle-o:before { + content: "\f01d"; +} +.fa-rotate-right:before, +.fa-repeat:before { + content: "\f01e"; +} +.fa-refresh:before { + content: "\f021"; +} +.fa-list-alt:before { + content: "\f022"; +} +.fa-lock:before { + content: "\f023"; +} +.fa-flag:before { + content: "\f024"; +} +.fa-headphones:before { + content: "\f025"; +} +.fa-volume-off:before { + content: "\f026"; +} +.fa-volume-down:before { + content: "\f027"; +} +.fa-volume-up:before { + content: "\f028"; +} +.fa-qrcode:before { + content: "\f029"; +} +.fa-barcode:before { + content: "\f02a"; +} +.fa-tag:before { + content: "\f02b"; +} +.fa-tags:before { + content: "\f02c"; +} +.fa-book:before { + content: "\f02d"; +} +.fa-bookmark:before { + content: "\f02e"; +} +.fa-print:before { + content: "\f02f"; +} +.fa-camera:before { + content: "\f030"; +} +.fa-font:before { + content: "\f031"; +} +.fa-bold:before { + content: "\f032"; +} +.fa-italic:before { + content: "\f033"; +} +.fa-text-height:before { + content: "\f034"; +} +.fa-text-width:before { + content: "\f035"; +} +.fa-align-left:before { + content: "\f036"; +} +.fa-align-center:before { + content: "\f037"; +} +.fa-align-right:before { + content: "\f038"; +} +.fa-align-justify:before { + content: "\f039"; +} +.fa-list:before { + content: "\f03a"; +} +.fa-dedent:before, +.fa-outdent:before { + content: "\f03b"; +} +.fa-indent:before { + content: "\f03c"; +} +.fa-video-camera:before { + content: "\f03d"; +} +.fa-photo:before, +.fa-image:before, +.fa-picture-o:before { + content: "\f03e"; +} +.fa-pencil:before { + content: "\f040"; +} +.fa-map-marker:before { + content: "\f041"; +} +.fa-adjust:before { + content: "\f042"; +} +.fa-tint:before { + content: "\f043"; +} +.fa-edit:before, +.fa-pencil-square-o:before { + content: "\f044"; +} +.fa-share-square-o:before { + content: "\f045"; +} +.fa-check-square-o:before { + content: "\f046"; +} +.fa-arrows:before { + content: "\f047"; +} +.fa-step-backward:before { + content: "\f048"; +} +.fa-fast-backward:before { + content: "\f049"; +} +.fa-backward:before { + content: "\f04a"; +} +.fa-play:before { + content: "\f04b"; +} +.fa-pause:before { + content: "\f04c"; +} +.fa-stop:before { + content: "\f04d"; +} +.fa-forward:before { + content: "\f04e"; +} +.fa-fast-forward:before { + content: "\f050"; +} +.fa-step-forward:before { + content: "\f051"; +} +.fa-eject:before { + content: "\f052"; +} +.fa-chevron-left:before { + content: "\f053"; +} +.fa-chevron-right:before { + content: "\f054"; +} +.fa-plus-circle:before { + content: "\f055"; +} +.fa-minus-circle:before { + content: "\f056"; +} +.fa-times-circle:before { + content: "\f057"; +} +.fa-check-circle:before { + content: "\f058"; +} +.fa-question-circle:before { + content: "\f059"; +} +.fa-info-circle:before { + content: "\f05a"; +} +.fa-crosshairs:before { + content: "\f05b"; +} +.fa-times-circle-o:before { + content: "\f05c"; +} +.fa-check-circle-o:before { + content: "\f05d"; +} +.fa-ban:before { + content: "\f05e"; +} +.fa-arrow-left:before { + content: "\f060"; +} +.fa-arrow-right:before { + content: "\f061"; +} +.fa-arrow-up:before { + content: "\f062"; +} +.fa-arrow-down:before { + content: "\f063"; +} +.fa-mail-forward:before, +.fa-share:before { + content: "\f064"; +} +.fa-expand:before { + content: "\f065"; +} +.fa-compress:before { + content: "\f066"; +} +.fa-plus:before { + content: "\f067"; +} +.fa-minus:before { + content: "\f068"; +} +.fa-asterisk:before { + content: "\f069"; +} +.fa-exclamation-circle:before { + content: "\f06a"; +} +.fa-gift:before { + content: "\f06b"; +} +.fa-leaf:before { + content: "\f06c"; +} +.fa-fire:before { + content: "\f06d"; +} +.fa-eye:before { + content: "\f06e"; +} +.fa-eye-slash:before { + content: "\f070"; +} +.fa-warning:before, +.fa-exclamation-triangle:before { + content: "\f071"; +} +.fa-plane:before { + content: "\f072"; +} +.fa-calendar:before { + content: "\f073"; +} +.fa-random:before { + content: "\f074"; +} +.fa-comment:before { + content: "\f075"; +} +.fa-magnet:before { + content: "\f076"; +} +.fa-chevron-up:before { + content: "\f077"; +} +.fa-chevron-down:before { + content: "\f078"; +} +.fa-retweet:before { + content: "\f079"; +} +.fa-shopping-cart:before { + content: "\f07a"; +} +.fa-folder:before { + content: "\f07b"; +} +.fa-folder-open:before { + content: "\f07c"; +} +.fa-arrows-v:before { + content: "\f07d"; +} +.fa-arrows-h:before { + content: "\f07e"; +} +.fa-bar-chart-o:before, +.fa-bar-chart:before { + content: "\f080"; +} +.fa-twitter-square:before { + content: "\f081"; +} +.fa-facebook-square:before { + content: "\f082"; +} +.fa-camera-retro:before { + content: "\f083"; +} +.fa-key:before { + content: "\f084"; +} +.fa-gears:before, +.fa-cogs:before { + content: "\f085"; +} +.fa-comments:before { + content: "\f086"; +} +.fa-thumbs-o-up:before { + content: "\f087"; +} +.fa-thumbs-o-down:before { + content: "\f088"; +} +.fa-star-half:before { + content: "\f089"; +} +.fa-heart-o:before { + content: "\f08a"; +} +.fa-sign-out:before { + content: "\f08b"; +} +.fa-linkedin-square:before { + content: "\f08c"; +} +.fa-thumb-tack:before { + content: "\f08d"; +} +.fa-external-link:before { + content: "\f08e"; +} +.fa-sign-in:before { + content: "\f090"; +} +.fa-trophy:before { + content: "\f091"; +} +.fa-github-square:before { + content: "\f092"; +} +.fa-upload:before { + content: "\f093"; +} +.fa-lemon-o:before { + content: "\f094"; +} +.fa-phone:before { + content: "\f095"; +} +.fa-square-o:before { + content: "\f096"; +} +.fa-bookmark-o:before { + content: "\f097"; +} +.fa-phone-square:before { + content: "\f098"; +} +.fa-twitter:before { + content: "\f099"; +} +.fa-facebook:before { + content: "\f09a"; +} +.fa-github:before { + content: "\f09b"; +} +.fa-unlock:before { + content: "\f09c"; +} +.fa-credit-card:before { + content: "\f09d"; +} +.fa-rss:before { + content: "\f09e"; +} +.fa-hdd-o:before { + content: "\f0a0"; +} +.fa-bullhorn:before { + content: "\f0a1"; +} +.fa-bell:before { + content: "\f0f3"; +} +.fa-certificate:before { + content: "\f0a3"; +} +.fa-hand-o-right:before { + content: "\f0a4"; +} +.fa-hand-o-left:before { + content: "\f0a5"; +} +.fa-hand-o-up:before { + content: "\f0a6"; +} +.fa-hand-o-down:before { + content: "\f0a7"; +} +.fa-arrow-circle-left:before { + content: "\f0a8"; +} +.fa-arrow-circle-right:before { + content: "\f0a9"; +} +.fa-arrow-circle-up:before { + content: "\f0aa"; +} +.fa-arrow-circle-down:before { + content: "\f0ab"; +} +.fa-globe:before { + content: "\f0ac"; +} +.fa-wrench:before { + content: "\f0ad"; +} +.fa-tasks:before { + content: "\f0ae"; +} +.fa-filter:before { + content: "\f0b0"; +} +.fa-briefcase:before { + content: "\f0b1"; +} +.fa-arrows-alt:before { + content: "\f0b2"; +} +.fa-group:before, +.fa-users:before { + content: "\f0c0"; +} +.fa-chain:before, +.fa-link:before { + content: "\f0c1"; +} +.fa-cloud:before { + content: "\f0c2"; +} +.fa-flask:before { + content: "\f0c3"; +} +.fa-cut:before, +.fa-scissors:before { + content: "\f0c4"; +} +.fa-copy:before, +.fa-files-o:before { + content: "\f0c5"; +} +.fa-paperclip:before { + content: "\f0c6"; +} +.fa-save:before, +.fa-floppy-o:before { + content: "\f0c7"; +} +.fa-square:before { + content: "\f0c8"; +} +.fa-navicon:before, +.fa-reorder:before, +.fa-bars:before { + content: "\f0c9"; +} +.fa-list-ul:before { + content: "\f0ca"; +} +.fa-list-ol:before { + content: "\f0cb"; +} +.fa-strikethrough:before { + content: "\f0cc"; +} +.fa-underline:before { + content: "\f0cd"; +} +.fa-table:before { + content: "\f0ce"; +} +.fa-magic:before { + content: "\f0d0"; +} +.fa-truck:before { + content: "\f0d1"; +} +.fa-pinterest:before { + content: "\f0d2"; +} +.fa-pinterest-square:before { + content: "\f0d3"; +} +.fa-google-plus-square:before { + content: "\f0d4"; +} +.fa-google-plus:before { + content: "\f0d5"; +} +.fa-money:before { + content: "\f0d6"; +} +.fa-caret-down:before { + content: "\f0d7"; +} +.fa-caret-up:before { + content: "\f0d8"; +} +.fa-caret-left:before { + content: "\f0d9"; +} +.fa-caret-right:before { + content: "\f0da"; +} +.fa-columns:before { + content: "\f0db"; +} +.fa-unsorted:before, +.fa-sort:before { + content: "\f0dc"; +} +.fa-sort-down:before, +.fa-sort-desc:before { + content: "\f0dd"; +} +.fa-sort-up:before, +.fa-sort-asc:before { + content: "\f0de"; +} +.fa-envelope:before { + content: "\f0e0"; +} +.fa-linkedin:before { + content: "\f0e1"; +} +.fa-rotate-left:before, +.fa-undo:before { + content: "\f0e2"; +} +.fa-legal:before, +.fa-gavel:before { + content: "\f0e3"; +} +.fa-dashboard:before, +.fa-tachometer:before { + content: "\f0e4"; +} +.fa-comment-o:before { + content: "\f0e5"; +} +.fa-comments-o:before { + content: "\f0e6"; +} +.fa-flash:before, +.fa-bolt:before { + content: "\f0e7"; +} +.fa-sitemap:before { + content: "\f0e8"; +} +.fa-umbrella:before { + content: "\f0e9"; +} +.fa-paste:before, +.fa-clipboard:before { + content: "\f0ea"; +} +.fa-lightbulb-o:before { + content: "\f0eb"; +} +.fa-exchange:before { + content: "\f0ec"; +} +.fa-cloud-download:before { + content: "\f0ed"; +} +.fa-cloud-upload:before { + content: "\f0ee"; +} +.fa-user-md:before { + content: "\f0f0"; +} +.fa-stethoscope:before { + content: "\f0f1"; +} +.fa-suitcase:before { + content: "\f0f2"; +} +.fa-bell-o:before { + content: "\f0a2"; +} +.fa-coffee:before { + content: "\f0f4"; +} +.fa-cutlery:before { + content: "\f0f5"; +} +.fa-file-text-o:before { + content: "\f0f6"; +} +.fa-building-o:before { + content: "\f0f7"; +} +.fa-hospital-o:before { + content: "\f0f8"; +} +.fa-ambulance:before { + content: "\f0f9"; +} +.fa-medkit:before { + content: "\f0fa"; +} +.fa-fighter-jet:before { + content: "\f0fb"; +} +.fa-beer:before { + content: "\f0fc"; +} +.fa-h-square:before { + content: "\f0fd"; +} +.fa-plus-square:before { + content: "\f0fe"; +} +.fa-angle-double-left:before { + content: "\f100"; +} +.fa-angle-double-right:before { + content: "\f101"; +} +.fa-angle-double-up:before { + content: "\f102"; +} +.fa-angle-double-down:before { + content: "\f103"; +} +.fa-angle-left:before { + content: "\f104"; +} +.fa-angle-right:before { + content: "\f105"; +} +.fa-angle-up:before { + content: "\f106"; +} +.fa-angle-down:before { + content: "\f107"; +} +.fa-desktop:before { + content: "\f108"; +} +.fa-laptop:before { + content: "\f109"; +} +.fa-tablet:before { + content: "\f10a"; +} +.fa-mobile-phone:before, +.fa-mobile:before { + content: "\f10b"; +} +.fa-circle-o:before { + content: "\f10c"; +} +.fa-quote-left:before { + content: "\f10d"; +} +.fa-quote-right:before { + content: "\f10e"; +} +.fa-spinner:before { + content: "\f110"; +} +.fa-circle:before { + content: "\f111"; +} +.fa-mail-reply:before, +.fa-reply:before { + content: "\f112"; +} +.fa-github-alt:before { + content: "\f113"; +} +.fa-folder-o:before { + content: "\f114"; +} +.fa-folder-open-o:before { + content: "\f115"; +} +.fa-smile-o:before { + content: "\f118"; +} +.fa-frown-o:before { + content: "\f119"; +} +.fa-meh-o:before { + content: "\f11a"; +} +.fa-gamepad:before { + content: "\f11b"; +} +.fa-keyboard-o:before { + content: "\f11c"; +} +.fa-flag-o:before { + content: "\f11d"; +} +.fa-flag-checkered:before { + content: "\f11e"; +} +.fa-terminal:before { + content: "\f120"; +} +.fa-code:before { + content: "\f121"; +} +.fa-mail-reply-all:before, +.fa-reply-all:before { + content: "\f122"; +} +.fa-star-half-empty:before, +.fa-star-half-full:before, +.fa-star-half-o:before { + content: "\f123"; +} +.fa-location-arrow:before { + content: "\f124"; +} +.fa-crop:before { + content: "\f125"; +} +.fa-code-fork:before { + content: "\f126"; +} +.fa-unlink:before, +.fa-chain-broken:before { + content: "\f127"; +} +.fa-question:before { + content: "\f128"; +} +.fa-info:before { + content: "\f129"; +} +.fa-exclamation:before { + content: "\f12a"; +} +.fa-superscript:before { + content: "\f12b"; +} +.fa-subscript:before { + content: "\f12c"; +} +.fa-eraser:before { + content: "\f12d"; +} +.fa-puzzle-piece:before { + content: "\f12e"; +} +.fa-microphone:before { + content: "\f130"; +} +.fa-microphone-slash:before { + content: "\f131"; +} +.fa-shield:before { + content: "\f132"; +} +.fa-calendar-o:before { + content: "\f133"; +} +.fa-fire-extinguisher:before { + content: "\f134"; +} +.fa-rocket:before { + content: "\f135"; +} +.fa-maxcdn:before { + content: "\f136"; +} +.fa-chevron-circle-left:before { + content: "\f137"; +} +.fa-chevron-circle-right:before { + content: "\f138"; +} +.fa-chevron-circle-up:before { + content: "\f139"; +} +.fa-chevron-circle-down:before { + content: "\f13a"; +} +.fa-html5:before { + content: "\f13b"; +} +.fa-css3:before { + content: "\f13c"; +} +.fa-anchor:before { + content: "\f13d"; +} +.fa-unlock-alt:before { + content: "\f13e"; +} +.fa-bullseye:before { + content: "\f140"; +} +.fa-ellipsis-h:before { + content: "\f141"; +} +.fa-ellipsis-v:before { + content: "\f142"; +} +.fa-rss-square:before { + content: "\f143"; +} +.fa-play-circle:before { + content: "\f144"; +} +.fa-ticket:before { + content: "\f145"; +} +.fa-minus-square:before { + content: "\f146"; +} +.fa-minus-square-o:before { + content: "\f147"; +} +.fa-level-up:before { + content: "\f148"; +} +.fa-level-down:before { + content: "\f149"; +} +.fa-check-square:before { + content: "\f14a"; +} +.fa-pencil-square:before { + content: "\f14b"; +} +.fa-external-link-square:before { + content: "\f14c"; +} +.fa-share-square:before { + content: "\f14d"; +} +.fa-compass:before { + content: "\f14e"; +} +.fa-toggle-down:before, +.fa-caret-square-o-down:before { + content: "\f150"; +} +.fa-toggle-up:before, +.fa-caret-square-o-up:before { + content: "\f151"; +} +.fa-toggle-right:before, +.fa-caret-square-o-right:before { + content: "\f152"; +} +.fa-euro:before, +.fa-eur:before { + content: "\f153"; +} +.fa-gbp:before { + content: "\f154"; +} +.fa-dollar:before, +.fa-usd:before { + content: "\f155"; +} +.fa-rupee:before, +.fa-inr:before { + content: "\f156"; +} +.fa-cny:before, +.fa-rmb:before, +.fa-yen:before, +.fa-jpy:before { + content: "\f157"; +} +.fa-ruble:before, +.fa-rouble:before, +.fa-rub:before { + content: "\f158"; +} +.fa-won:before, +.fa-krw:before { + content: "\f159"; +} +.fa-bitcoin:before, +.fa-btc:before { + content: "\f15a"; +} +.fa-file:before { + content: "\f15b"; +} +.fa-file-text:before { + content: "\f15c"; +} +.fa-sort-alpha-asc:before { + content: "\f15d"; +} +.fa-sort-alpha-desc:before { + content: "\f15e"; +} +.fa-sort-amount-asc:before { + content: "\f160"; +} +.fa-sort-amount-desc:before { + content: "\f161"; +} +.fa-sort-numeric-asc:before { + content: "\f162"; +} +.fa-sort-numeric-desc:before { + content: "\f163"; +} +.fa-thumbs-up:before { + content: "\f164"; +} +.fa-thumbs-down:before { + content: "\f165"; +} +.fa-youtube-square:before { + content: "\f166"; +} +.fa-youtube:before { + content: "\f167"; +} +.fa-xing:before { + content: "\f168"; +} +.fa-xing-square:before { + content: "\f169"; +} +.fa-youtube-play:before { + content: "\f16a"; +} +.fa-dropbox:before { + content: "\f16b"; +} +.fa-stack-overflow:before { + content: "\f16c"; +} +.fa-instagram:before { + content: "\f16d"; +} +.fa-flickr:before { + content: "\f16e"; +} +.fa-adn:before { + content: "\f170"; +} +.fa-bitbucket:before { + content: "\f171"; +} +.fa-bitbucket-square:before { + content: "\f172"; +} +.fa-tumblr:before { + content: "\f173"; +} +.fa-tumblr-square:before { + content: "\f174"; +} +.fa-long-arrow-down:before { + content: "\f175"; +} +.fa-long-arrow-up:before { + content: "\f176"; +} +.fa-long-arrow-left:before { + content: "\f177"; +} +.fa-long-arrow-right:before { + content: "\f178"; +} +.fa-apple:before { + content: "\f179"; +} +.fa-windows:before { + content: "\f17a"; +} +.fa-android:before { + content: "\f17b"; +} +.fa-linux:before { + content: "\f17c"; +} +.fa-dribbble:before { + content: "\f17d"; +} +.fa-skype:before { + content: "\f17e"; +} +.fa-foursquare:before { + content: "\f180"; +} +.fa-trello:before { + content: "\f181"; +} +.fa-female:before { + content: "\f182"; +} +.fa-male:before { + content: "\f183"; +} +.fa-gittip:before { + content: "\f184"; +} +.fa-sun-o:before { + content: "\f185"; +} +.fa-moon-o:before { + content: "\f186"; +} +.fa-archive:before { + content: "\f187"; +} +.fa-bug:before { + content: "\f188"; +} +.fa-vk:before { + content: "\f189"; +} +.fa-weibo:before { + content: "\f18a"; +} +.fa-renren:before { + content: "\f18b"; +} +.fa-pagelines:before { + content: "\f18c"; +} +.fa-stack-exchange:before { + content: "\f18d"; +} +.fa-arrow-circle-o-right:before { + content: "\f18e"; +} +.fa-arrow-circle-o-left:before { + content: "\f190"; +} +.fa-toggle-left:before, +.fa-caret-square-o-left:before { + content: "\f191"; +} +.fa-dot-circle-o:before { + content: "\f192"; +} +.fa-wheelchair:before { + content: "\f193"; +} +.fa-vimeo-square:before { + content: "\f194"; +} +.fa-turkish-lira:before, +.fa-try:before { + content: "\f195"; +} +.fa-plus-square-o:before { + content: "\f196"; +} +.fa-space-shuttle:before { + content: "\f197"; +} +.fa-slack:before { + content: "\f198"; +} +.fa-envelope-square:before { + content: "\f199"; +} +.fa-wordpress:before { + content: "\f19a"; +} +.fa-openid:before { + content: "\f19b"; +} +.fa-institution:before, +.fa-bank:before, +.fa-university:before { + content: "\f19c"; +} +.fa-mortar-board:before, +.fa-graduation-cap:before { + content: "\f19d"; +} +.fa-yahoo:before { + content: "\f19e"; +} +.fa-google:before { + content: "\f1a0"; +} +.fa-reddit:before { + content: "\f1a1"; +} +.fa-reddit-square:before { + content: "\f1a2"; +} +.fa-stumbleupon-circle:before { + content: "\f1a3"; +} +.fa-stumbleupon:before { + content: "\f1a4"; +} +.fa-delicious:before { + content: "\f1a5"; +} +.fa-digg:before { + content: "\f1a6"; +} +.fa-pied-piper:before { + content: "\f1a7"; +} +.fa-pied-piper-alt:before { + content: "\f1a8"; +} +.fa-drupal:before { + content: "\f1a9"; +} +.fa-joomla:before { + content: "\f1aa"; +} +.fa-language:before { + content: "\f1ab"; +} +.fa-fax:before { + content: "\f1ac"; +} +.fa-building:before { + content: "\f1ad"; +} +.fa-child:before { + content: "\f1ae"; +} +.fa-paw:before { + content: "\f1b0"; +} +.fa-spoon:before { + content: "\f1b1"; +} +.fa-cube:before { + content: "\f1b2"; +} +.fa-cubes:before { + content: "\f1b3"; +} +.fa-behance:before { + content: "\f1b4"; +} +.fa-behance-square:before { + content: "\f1b5"; +} +.fa-steam:before { + content: "\f1b6"; +} +.fa-steam-square:before { + content: "\f1b7"; +} +.fa-recycle:before { + content: "\f1b8"; +} +.fa-automobile:before, +.fa-car:before { + content: "\f1b9"; +} +.fa-cab:before, +.fa-taxi:before { + content: "\f1ba"; +} +.fa-tree:before { + content: "\f1bb"; +} +.fa-spotify:before { + content: "\f1bc"; +} +.fa-deviantart:before { + content: "\f1bd"; +} +.fa-soundcloud:before { + content: "\f1be"; +} +.fa-database:before { + content: "\f1c0"; +} +.fa-file-pdf-o:before { + content: "\f1c1"; +} +.fa-file-word-o:before { + content: "\f1c2"; +} +.fa-file-excel-o:before { + content: "\f1c3"; +} +.fa-file-powerpoint-o:before { + content: "\f1c4"; +} +.fa-file-photo-o:before, +.fa-file-picture-o:before, +.fa-file-image-o:before { + content: "\f1c5"; +} +.fa-file-zip-o:before, +.fa-file-archive-o:before { + content: "\f1c6"; +} +.fa-file-sound-o:before, +.fa-file-audio-o:before { + content: "\f1c7"; +} +.fa-file-movie-o:before, +.fa-file-video-o:before { + content: "\f1c8"; +} +.fa-file-code-o:before { + content: "\f1c9"; +} +.fa-vine:before { + content: "\f1ca"; +} +.fa-codepen:before { + content: "\f1cb"; +} +.fa-jsfiddle:before { + content: "\f1cc"; +} +.fa-life-bouy:before, +.fa-life-buoy:before, +.fa-life-saver:before, +.fa-support:before, +.fa-life-ring:before { + content: "\f1cd"; +} +.fa-circle-o-notch:before { + content: "\f1ce"; +} +.fa-ra:before, +.fa-rebel:before { + content: "\f1d0"; +} +.fa-ge:before, +.fa-empire:before { + content: "\f1d1"; +} +.fa-git-square:before { + content: "\f1d2"; +} +.fa-git:before { + content: "\f1d3"; +} +.fa-hacker-news:before { + content: "\f1d4"; +} +.fa-tencent-weibo:before { + content: "\f1d5"; +} +.fa-qq:before { + content: "\f1d6"; +} +.fa-wechat:before, +.fa-weixin:before { + content: "\f1d7"; +} +.fa-send:before, +.fa-paper-plane:before { + content: "\f1d8"; +} +.fa-send-o:before, +.fa-paper-plane-o:before { + content: "\f1d9"; +} +.fa-history:before { + content: "\f1da"; +} +.fa-circle-thin:before { + content: "\f1db"; +} +.fa-header:before { + content: "\f1dc"; +} +.fa-paragraph:before { + content: "\f1dd"; +} +.fa-sliders:before { + content: "\f1de"; +} +.fa-share-alt:before { + content: "\f1e0"; +} +.fa-share-alt-square:before { + content: "\f1e1"; +} +.fa-bomb:before { + content: "\f1e2"; +} +.fa-soccer-ball-o:before, +.fa-futbol-o:before { + content: "\f1e3"; +} +.fa-tty:before { + content: "\f1e4"; +} +.fa-binoculars:before { + content: "\f1e5"; +} +.fa-plug:before { + content: "\f1e6"; +} +.fa-slideshare:before { + content: "\f1e7"; +} +.fa-twitch:before { + content: "\f1e8"; +} +.fa-yelp:before { + content: "\f1e9"; +} +.fa-newspaper-o:before { + content: "\f1ea"; +} +.fa-wifi:before { + content: "\f1eb"; +} +.fa-calculator:before { + content: "\f1ec"; +} +.fa-paypal:before { + content: "\f1ed"; +} +.fa-google-wallet:before { + content: "\f1ee"; +} +.fa-cc-visa:before { + content: "\f1f0"; +} +.fa-cc-mastercard:before { + content: "\f1f1"; +} +.fa-cc-discover:before { + content: "\f1f2"; +} +.fa-cc-amex:before { + content: "\f1f3"; +} +.fa-cc-paypal:before { + content: "\f1f4"; +} +.fa-cc-stripe:before { + content: "\f1f5"; +} +.fa-bell-slash:before { + content: "\f1f6"; +} +.fa-bell-slash-o:before { + content: "\f1f7"; +} +.fa-trash:before { + content: "\f1f8"; +} +.fa-copyright:before { + content: "\f1f9"; +} +.fa-at:before { + content: "\f1fa"; +} +.fa-eyedropper:before { + content: "\f1fb"; +} +.fa-paint-brush:before { + content: "\f1fc"; +} +.fa-birthday-cake:before { + content: "\f1fd"; +} +.fa-area-chart:before { + content: "\f1fe"; +} +.fa-pie-chart:before { + content: "\f200"; +} +.fa-line-chart:before { + content: "\f201"; +} +.fa-lastfm:before { + content: "\f202"; +} +.fa-lastfm-square:before { + content: "\f203"; +} +.fa-toggle-off:before { + content: "\f204"; +} +.fa-toggle-on:before { + content: "\f205"; +} +.fa-bicycle:before { + content: "\f206"; +} +.fa-bus:before { + content: "\f207"; +} +.fa-ioxhost:before { + content: "\f208"; +} +.fa-angellist:before { + content: "\f209"; +} +.fa-cc:before { + content: "\f20a"; +} +.fa-shekel:before, +.fa-sheqel:before, +.fa-ils:before { + content: "\f20b"; +} +.fa-meanpath:before { + content: "\f20c"; +} diff --git a/food-open/food-open-web/src/main/resources/static/assets/css/prettify.css b/food-open/food-open-web/src/main/resources/static/assets/css/prettify.css new file mode 100644 index 0000000..233ed18 --- /dev/null +++ b/food-open/food-open-web/src/main/resources/static/assets/css/prettify.css @@ -0,0 +1,150 @@ +.com { color: #93a1a1; } +.lit { color: #195f91; } +.pun, .opn, .clo { color: #93a1a1; } +.fun { color: #dc322f; } +.str, .atv { color: #D14; } +.kwd, .prettyprint .tag { color: #1e347b; } +.typ, .atn, .dec, .var { color: teal; } +.pln { color: #48484c; } + +.prettyprint { + padding: 8px; + background-color: #f7f7f9; + border: 1px solid #e1e1e8; +} +.prettyprint.linenums { + -webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; + box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; +} + +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { + margin: 0 0 0 33px; /* IE indents via margin-left */ +} +ol.linenums li { + padding-left: 12px; + color: #bebec5; + line-height: 20px; + text-shadow: 0 1px 0 #fff; +} + + +/* + * Derived from einaros's Sons of Obsidian theme at + * http://studiostyl.es/schemes/son-of-obsidian by + * Alex Ford of CodeTunnel: + * http://CodeTunnel.com/blog/post/71/google-code-prettify-obsidian-theme + */ +/** +.str +{ + color: #EC7600; +} +.kwd +{ + color: #93C763; +} +.com +{ + color: #66747B; +} +.typ +{ + color: #678CB1; +} +.lit +{ + color: #FACD22; +} +.pun +{ + color: #F1F2F3; +} +.pln +{ + color: #F1F2F3; +} +.tag +{ + color: #8AC763; +} +.atn +{ + color: #E0E2E4; +} +.atv +{ + color: #EC7600; +} +.dec +{ + color: purple; +} +pre.prettyprint +{ + border: 0px solid #888; +} +ol.linenums +{ + margin-top: 0; + margin-bottom: 0; +} +.prettyprint { + background: #000; +} +li.L0, li.L1, li.L2, li.L3, li.L4, li.L5, li.L6, li.L7, li.L8, li.L9 +{ + color: #555; + list-style-type: decimal; +} +li.L1, li.L3, li.L5, li.L7, li.L9 { + background: #111; +} +@media print +{ + .str + { + color: #060; + } + .kwd + { + color: #006; + font-weight: bold; + } + .com + { + color: #600; + font-style: italic; + } + .typ + { + color: #404; + font-weight: bold; + } + .lit + { + color: #044; + } + .pun + { + color: #440; + } + .pln + { + color: #000; + } + .tag + { + color: #006; + font-weight: bold; + } + .atn + { + color: #404; + } + .atv + { + color: #060; + } +} +*/ \ No newline at end of file diff --git a/food-open/food-open-web/src/main/resources/static/assets/fonts/FontAwesome.otf b/food-open/food-open-web/src/main/resources/static/assets/fonts/FontAwesome.otf new file mode 100644 index 0000000..81c9ad9 Binary files /dev/null and b/food-open/food-open-web/src/main/resources/static/assets/fonts/FontAwesome.otf differ diff --git a/food-open/food-open-web/src/main/resources/static/assets/fonts/OpenSans-300.woff b/food-open/food-open-web/src/main/resources/static/assets/fonts/OpenSans-300.woff new file mode 100644 index 0000000..99f3353 Binary files /dev/null and b/food-open/food-open-web/src/main/resources/static/assets/fonts/OpenSans-300.woff differ diff --git a/food-open/food-open-web/src/main/resources/static/assets/fonts/OpenSans-400.woff b/food-open/food-open-web/src/main/resources/static/assets/fonts/OpenSans-400.woff new file mode 100644 index 0000000..55b25f8 Binary files /dev/null and b/food-open/food-open-web/src/main/resources/static/assets/fonts/OpenSans-400.woff differ diff --git a/food-open/food-open-web/src/main/resources/static/assets/fonts/fontawesome-webfont.eot b/food-open/food-open-web/src/main/resources/static/assets/fonts/fontawesome-webfont.eot new file mode 100644 index 0000000..84677bc Binary files /dev/null and b/food-open/food-open-web/src/main/resources/static/assets/fonts/fontawesome-webfont.eot differ diff --git a/food-open/food-open-web/src/main/resources/static/assets/fonts/fontawesome-webfont.svg b/food-open/food-open-web/src/main/resources/static/assets/fonts/fontawesome-webfont.svg new file mode 100644 index 0000000..d907b25 --- /dev/null +++ b/food-open/food-open-web/src/main/resources/static/assets/fonts/fontawesome-webfont.svg @@ -0,0 +1,520 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-web/src/main/resources/static/assets/fonts/fontawesome-webfont.ttf b/food-open/food-open-web/src/main/resources/static/assets/fonts/fontawesome-webfont.ttf new file mode 100644 index 0000000..96a3639 Binary files /dev/null and b/food-open/food-open-web/src/main/resources/static/assets/fonts/fontawesome-webfont.ttf differ diff --git a/food-open/food-open-web/src/main/resources/static/assets/fonts/fontawesome-webfont.woff b/food-open/food-open-web/src/main/resources/static/assets/fonts/fontawesome-webfont.woff new file mode 100644 index 0000000..628b6a5 Binary files /dev/null and b/food-open/food-open-web/src/main/resources/static/assets/fonts/fontawesome-webfont.woff differ diff --git a/food-open/food-open-web/src/main/resources/static/assets/fonts/glyphicons-halflings-regular.eot b/food-open/food-open-web/src/main/resources/static/assets/fonts/glyphicons-halflings-regular.eot new file mode 100644 index 0000000..4a4ca86 Binary files /dev/null and b/food-open/food-open-web/src/main/resources/static/assets/fonts/glyphicons-halflings-regular.eot differ diff --git a/food-open/food-open-web/src/main/resources/static/assets/fonts/glyphicons-halflings-regular.svg b/food-open/food-open-web/src/main/resources/static/assets/fonts/glyphicons-halflings-regular.svg new file mode 100644 index 0000000..25691af --- /dev/null +++ b/food-open/food-open-web/src/main/resources/static/assets/fonts/glyphicons-halflings-regular.svg @@ -0,0 +1,229 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/food-open/food-open-web/src/main/resources/static/assets/fonts/glyphicons-halflings-regular.ttf b/food-open/food-open-web/src/main/resources/static/assets/fonts/glyphicons-halflings-regular.ttf new file mode 100644 index 0000000..67fa00b Binary files /dev/null and b/food-open/food-open-web/src/main/resources/static/assets/fonts/glyphicons-halflings-regular.ttf differ diff --git a/food-open/food-open-web/src/main/resources/static/assets/fonts/glyphicons-halflings-regular.woff b/food-open/food-open-web/src/main/resources/static/assets/fonts/glyphicons-halflings-regular.woff new file mode 100644 index 0000000..8c54182 Binary files /dev/null and b/food-open/food-open-web/src/main/resources/static/assets/fonts/glyphicons-halflings-regular.woff differ diff --git a/food-open/food-open-web/src/main/resources/static/assets/fonts/readme b/food-open/food-open-web/src/main/resources/static/assets/fonts/readme new file mode 100644 index 0000000..b2428ce --- /dev/null +++ b/food-open/food-open-web/src/main/resources/static/assets/fonts/readme @@ -0,0 +1,3 @@ +Google fonts saved to be locally available during development +http://www.google.com/fonts#UsePlace:use/Collection:Open+Sans + diff --git a/food-open/food-open-web/src/main/resources/static/assets/js/ace-elements.js b/food-open/food-open-web/src/main/resources/static/assets/js/ace-elements.js new file mode 100644 index 0000000..03ea19d --- /dev/null +++ b/food-open/food-open-web/src/main/resources/static/assets/js/ace-elements.js @@ -0,0 +1,2534 @@ +/*! + * Ace v1.3.3 + */ + +if (typeof jQuery === 'undefined') { throw new Error('Ace\'s JavaScript requires jQuery') } + +/** + Ace custom scroller. It is not as feature-rich as plugins such as NiceScroll but it's good enough for most cases. +*/ +(function($ , undefined) { + var Ace_Scroll = function(element , _settings) { + var self = this; + + var attrib_values = ace.helper.getAttrSettings(element, $.fn.ace_scroll.defaults); + var settings = $.extend({}, $.fn.ace_scroll.defaults, _settings, attrib_values); + + this.size = 0; + this.lock = false; + this.lock_anyway = false; + + this.$element = $(element); + this.element = element; + + var vertical = true; + + var disabled = false; + var active = false; + var created = false; + + var $content_wrap = null, content_wrap = null; + var $track = null, $bar = null, track = null, bar = null; + var bar_style = null; + + var bar_size = 0, bar_pos = 0, bar_max_pos = 0, bar_size_2 = 0, move_bar = true; + var reset_once = false; + + var styleClass = ''; + var trackFlip = false;//vertical on left or horizontal on top + var trackSize = 0; + + var css_pos, + css_size, + max_css_size, + client_size, + scroll_direction, + scroll_size; + + var ratio = 1; + var inline_style = false; + var mouse_track = false; + var mouse_release_target = 'onmouseup' in window ? window : 'html'; + var dragEvent = settings.dragEvent || false; + + var trigger_scroll = _settings.scrollEvent || false; + + + var detached = settings.detached || false;//when detached, hideOnIdle as well? + var updatePos = settings.updatePos || false;//default is true + + var hideOnIdle = settings.hideOnIdle || false; + var hideDelay = settings.hideDelay || 1500; + var insideTrack = false;//used to hide scroll track when mouse is up and outside of track + var observeContent = settings.observeContent || false; + var prevContentSize = 0; + + var is_dirty = true;//to prevent consecutive 'reset' calls + + this.create = function(_settings) { + if(created) return; + //if(disabled) return; + if(_settings) settings = $.extend({}, $.fn.ace_scroll.defaults, _settings); + + this.size = parseInt(this.$element.attr('data-size')) || settings.size || 200; + vertical = !settings['horizontal']; + + css_pos = vertical ? 'top' : 'left';//'left' for horizontal + css_size = vertical ? 'height' : 'width';//'width' for horizontal + max_css_size = vertical ? 'maxHeight' : 'maxWidth'; + + client_size = vertical ? 'clientHeight' : 'clientWidth'; + scroll_direction = vertical ? 'scrollTop' : 'scrollLeft'; + scroll_size = vertical ? 'scrollHeight' : 'scrollWidth'; + + + + this.$element.addClass('ace-scroll'); + if(this.$element.css('position') == 'static') { + inline_style = this.element.style.position; + this.element.style.position = 'relative'; + } else inline_style = false; + + var scroll_bar = null; + if(!detached) { + this.$element.wrapInner('
'); + this.$element.prepend('
'); + } + else { + scroll_bar = $('
').appendTo('body'); + } + + + $content_wrap = this.$element; + if(!detached) $content_wrap = this.$element.find('.scroll-content').eq(0); + + if(!vertical) $content_wrap.wrapInner('
'); + + content_wrap = $content_wrap.get(0); + if(detached) { + //set position for detached scrollbar + $track = scroll_bar; + setTrackPos(); + } + else $track = this.$element.find('.scroll-track').eq(0); + + $bar = $track.find('.scroll-bar').eq(0); + track = $track.get(0); + bar = $bar.get(0); + bar_style = bar.style; + + //add styling classes and horizontalness + if(!vertical) $track.addClass('scroll-hz'); + if(settings.styleClass) { + styleClass = settings.styleClass; + $track.addClass(styleClass); + trackFlip = !!styleClass.match(/scroll\-left|scroll\-top/); + } + + //calculate size of track! + if(trackSize == 0) { + $track.show(); + getTrackSize(); + } + + $track.hide(); + + + //if(!touchDrag) { + $track.on('mousedown', mouse_down_track); + $bar.on('mousedown', mouse_down_bar); + //} + + $content_wrap.on('scroll', function() { + if(move_bar) { + bar_pos = parseInt(Math.round(this[scroll_direction] * ratio)); + bar_style[css_pos] = bar_pos + 'px'; + } + move_bar = false; + if(trigger_scroll) this.$element.trigger('scroll', [content_wrap]); + }) + + + if(settings.mouseWheel) { + this.lock = settings.mouseWheelLock; + this.lock_anyway = settings.lockAnyway; + + //mousewheel library available? + this.$element.on(!!$.event.special.mousewheel ? 'mousewheel.ace_scroll' : 'mousewheel.ace_scroll DOMMouseScroll.ace_scroll', function(event) { + if(disabled) return; + checkContentChanges(true); + + if(!active) return !self.lock_anyway; + + if(mouse_track) { + mouse_track = false; + $('html').off('.ace_scroll') + $(mouse_release_target).off('.ace_scroll'); + if(dragEvent) self.$element.trigger('drag.end'); + } + + + event.deltaY = event.deltaY || 0; + var delta = (event.deltaY > 0 || event.originalEvent.detail < 0 || event.originalEvent.wheelDelta > 0) ? 1 : -1 + var scrollEnd = false//have we reached the end of scrolling? + + var clientSize = content_wrap[client_size], scrollAmount = content_wrap[scroll_direction]; + if( !self.lock ) { + if(delta == -1) scrollEnd = (content_wrap[scroll_size] <= scrollAmount + clientSize); + else scrollEnd = (scrollAmount == 0); + } + + self.move_bar(true); + + //var step = parseInt( Math.min(Math.max(parseInt(clientSize / 8) , 80) , self.size) ) + 1; + var step = parseInt(clientSize / 8); + if(step < 80) step = 80; + if(step > self.size) step = self.size; + step += 1; + + content_wrap[scroll_direction] = scrollAmount - (delta * step); + + + return scrollEnd && !self.lock_anyway; + }) + } + + + //swipe not available yet + var touchDrag = ace.vars['touch'] && 'ace_drag' in $.event.special && settings.touchDrag //&& !settings.touchSwipe; + //add drag event for touch devices to scroll + if(touchDrag/** || ($.fn.swipe && settings.touchSwipe)*/) { + var dir = '', event_name = touchDrag ? 'ace_drag' : 'swipe'; + this.$element.on(event_name + '.ace_scroll', function(event) { + if(disabled) { + event.retval.cancel = true; + return; + } + checkContentChanges(true); + + if(!active) { + event.retval.cancel = this.lock_anyway; + return; + } + + dir = event.direction; + if( (vertical && (dir == 'up' || dir == 'down')) + || + (!vertical && (dir == 'left' || dir == 'right')) + ) + { + var distance = vertical ? event.dy : event.dx; + + if(distance != 0) { + if(Math.abs(distance) > 20 && touchDrag) distance = distance * 2; + + self.move_bar(true); + content_wrap[scroll_direction] = content_wrap[scroll_direction] + distance; + } + } + + }) + } + + + ///////////////////////////////// + + if(hideOnIdle) { + $track.addClass('idle-hide'); + } + if(observeContent) { + $track.on('mouseenter.ace_scroll', function() { + insideTrack = true; + checkContentChanges(false); + }).on('mouseleave.ace_scroll', function() { + insideTrack = false; + if(mouse_track == false) hideScrollbars(); + }); + } + + + + //some mobile browsers don't have mouseenter + this.$element.on('mouseenter.ace_scroll touchstart.ace_scroll', function(e) { + //if(ace.vars['old_ie']) return;//IE8 has a problem triggering event two times and strangely wrong values for this.size especially in fullscreen widget! + + is_dirty = true; + if(observeContent) checkContentChanges(true); + else if(settings.hoverReset) self.reset(true); + + $track.addClass('scroll-hover'); + }).on('mouseleave.ace_scroll touchend.ace_scroll', function() { + $track.removeClass('scroll-hover'); + }); + // + + if(!vertical) $content_wrap.children(0).css(css_size, this.size);//the extra wrapper + $content_wrap.css(max_css_size , this.size); + + disabled = false; + created = true; + } + this.is_active = function() { + return active; + } + this.is_enabled = function() { + return !disabled; + } + this.move_bar = function($move) { + move_bar = $move; + } + + this.get_track = function() { + return track; + } + + this.reset = function(innert_call) { + if(disabled) return;// this; + if(!created) this.create(); + ///////////////////// + var size = this.size; + + if(innert_call && !is_dirty) { + return; + } + is_dirty = false; + + if(detached) { + var border_size = parseInt(Math.round( (parseInt($content_wrap.css('border-top-width')) + parseInt($content_wrap.css('border-bottom-width'))) / 2.5 ));//(2.5 from trial?!) + size -= border_size;//only if detached + } + + var content_size = vertical ? content_wrap[scroll_size] : size; + if( (vertical && content_size == 0) || (!vertical && this.element.scrollWidth == 0) ) { + //element is hidden + //this.$element.addClass('scroll-hidden'); + $track.removeClass('scroll-active') + return;// this; + } + + var available_space = vertical ? size : content_wrap.clientWidth; + + if(!vertical) $content_wrap.children(0).css(css_size, size);//the extra wrapper + $content_wrap.css(max_css_size , this.size); + + + if(content_size > available_space) { + active = true; + $track.css(css_size, available_space).show(); + + ratio = parseFloat((available_space / content_size).toFixed(5)) + + bar_size = parseInt(Math.round(available_space * ratio)); + bar_size_2 = parseInt(Math.round(bar_size / 2)); + + bar_max_pos = available_space - bar_size; + bar_pos = parseInt(Math.round(content_wrap[scroll_direction] * ratio)); + + bar_style[css_size] = bar_size + 'px'; + bar_style[css_pos] = bar_pos + 'px'; + + $track.addClass('scroll-active'); + + if(trackSize == 0) { + getTrackSize(); + } + + if(!reset_once) { + //this.$element.removeClass('scroll-hidden'); + if(settings.reset) { + //reset scrollbar to zero position at first + content_wrap[scroll_direction] = 0; + bar_style[css_pos] = 0; + } + reset_once = true; + } + + if(detached) setTrackPos(); + } else { + active = false; + $track.hide(); + $track.removeClass('scroll-active'); + $content_wrap.css(max_css_size , ''); + } + + return;// this; + } + this.disable = function() { + content_wrap[scroll_direction] = 0; + bar_style[css_pos] = 0; + + disabled = true; + active = false; + $track.hide(); + + this.$element.addClass('scroll-disabled'); + + $track.removeClass('scroll-active'); + $content_wrap.css(max_css_size , ''); + } + this.enable = function() { + disabled = false; + this.$element.removeClass('scroll-disabled'); + } + this.destroy = function() { + active = false; + disabled = false; + created = false; + + this.$element.removeClass('ace-scroll scroll-disabled scroll-active'); + this.$element.off('.ace_scroll') + + if(!detached) { + if(!vertical) { + //remove the extra wrapping div + $content_wrap.find('> div').children().unwrap(); + } + $content_wrap.children().unwrap(); + $content_wrap.remove(); + } + + $track.remove(); + + if(inline_style !== false) this.element.style.position = inline_style; + + if(idleTimer != null) { + clearTimeout(idleTimer); + idleTimer = null; + } + } + this.modify = function(_settings) { + if(_settings) settings = $.extend({}, settings, _settings); + + this.destroy(); + this.create(); + is_dirty = true; + this.reset(true); + } + this.update = function(_settings) { + if(_settings) settings = $.extend({}, settings, _settings); + + this.size = _settings.size || this.size; + + this.lock = _settings.mouseWheelLock || this.lock; + this.lock_anyway = _settings.lockAnyway || this.lock_anyway; + + if(_settings.styleClass != undefined) { + if(styleClass) $track.removeClass(styleClass); + styleClass = _settings.styleClass; + if(styleClass) $track.addClass(styleClass); + trackFlip = !!styleClass.match(/scroll\-left|scroll\-top/); + } + } + + this.start = function() { + content_wrap[scroll_direction] = 0; + } + this.end = function() { + content_wrap[scroll_direction] = content_wrap[scroll_size]; + } + + this.hide = function() { + $track.hide(); + } + this.show = function() { + $track.show(); + } + + + this.update_scroll = function() { + move_bar = false; + bar_style[css_pos] = bar_pos + 'px'; + content_wrap[scroll_direction] = parseInt(Math.round(bar_pos / ratio)); + } + + function mouse_down_track(e) { + e.preventDefault(); + e.stopPropagation(); + + var track_offset = $track.offset(); + var track_pos = track_offset[css_pos];//top for vertical, left for horizontal + var mouse_pos = vertical ? e.pageY : e.pageX; + + if(mouse_pos > track_pos + bar_pos) { + bar_pos = mouse_pos - track_pos - bar_size + bar_size_2; + if(bar_pos > bar_max_pos) { + bar_pos = bar_max_pos; + } + } + else { + bar_pos = mouse_pos - track_pos - bar_size_2; + if(bar_pos < 0) bar_pos = 0; + } + + self.update_scroll() + } + + var mouse_pos1 = -1, mouse_pos2 = -1; + function mouse_down_bar(e) { + e.preventDefault(); + e.stopPropagation(); + + if(vertical) { + mouse_pos2 = mouse_pos1 = e.pageY; + } else { + mouse_pos2 = mouse_pos1 = e.pageX; + } + + mouse_track = true; + $('html').off('mousemove.ace_scroll').on('mousemove.ace_scroll', mouse_move_bar) + $(mouse_release_target).off('mouseup.ace_scroll').on('mouseup.ace_scroll', mouse_up_bar); + + $track.addClass('active'); + if(dragEvent) self.$element.trigger('drag.start'); + } + function mouse_move_bar(e) { + e.preventDefault(); + e.stopPropagation(); + + if(vertical) { + mouse_pos2 = e.pageY; + } else { + mouse_pos2 = e.pageX; + } + + + if(mouse_pos2 - mouse_pos1 + bar_pos > bar_max_pos) { + mouse_pos2 = mouse_pos1 + bar_max_pos - bar_pos; + } else if(mouse_pos2 - mouse_pos1 + bar_pos < 0) { + mouse_pos2 = mouse_pos1 - bar_pos; + } + bar_pos = bar_pos + (mouse_pos2 - mouse_pos1); + + mouse_pos1 = mouse_pos2; + + if(bar_pos < 0) { + bar_pos = 0; + } + else if(bar_pos > bar_max_pos) { + bar_pos = bar_max_pos; + } + + self.update_scroll() + } + function mouse_up_bar(e) { + e.preventDefault(); + e.stopPropagation(); + + mouse_track = false; + $('html').off('.ace_scroll') + $(mouse_release_target).off('.ace_scroll'); + + $track.removeClass('active'); + if(dragEvent) self.$element.trigger('drag.end'); + + if(active && hideOnIdle && !insideTrack) hideScrollbars(); + } + + + var idleTimer = null; + var prevCheckTime = 0; + function checkContentChanges(hideSoon) { + //check if content size has been modified since last time? + //and with at least 1s delay + var newCheck = +new Date(); + if(observeContent && newCheck - prevCheckTime > 1000) { + var newSize = content_wrap[scroll_size]; + if(prevContentSize != newSize) { + prevContentSize = newSize; + is_dirty = true; + self.reset(true); + } + prevCheckTime = newCheck; + } + + //show scrollbars when not idle anymore i.e. triggered by mousewheel, dragging, etc + if(active && hideOnIdle) { + if(idleTimer != null) { + clearTimeout(idleTimer); + idleTimer = null; + } + $track.addClass('not-idle'); + + if(!insideTrack && hideSoon == true) { + //hideSoon is false when mouse enters track + hideScrollbars(); + } + } + } + + function hideScrollbars() { + if(idleTimer != null) { + clearTimeout(idleTimer); + idleTimer = null; + } + idleTimer = setTimeout(function() { + idleTimer = null; + $track.removeClass('not-idle'); + } , hideDelay); + } + + //for detached scrollbars + function getTrackSize() { + $track.css('visibility', 'hidden').addClass('scroll-hover'); + if(vertical) trackSize = parseInt($track.outerWidth()) || 0; + else trackSize = parseInt($track.outerHeight()) || 0; + $track.css('visibility', '').removeClass('scroll-hover'); + } + this.track_size = function() { + if(trackSize == 0) getTrackSize(); + return trackSize; + } + + //for detached scrollbars + function setTrackPos() { + if(updatePos === false) return; + + var off = $content_wrap.offset();//because we want it relative to parent not document + var left = off.left; + var top = off.top; + + if(vertical) { + if(!trackFlip) { + left += ($content_wrap.outerWidth() - trackSize) + } + } + else { + if(!trackFlip) { + top += ($content_wrap.outerHeight() - trackSize) + } + } + + if(updatePos === true) $track.css({top: parseInt(top), left: parseInt(left)}); + else if(updatePos === 'left') $track.css('left', parseInt(left)); + else if(updatePos === 'top') $track.css('top', parseInt(top)); + } + + + + this.create(); + is_dirty = true; + this.reset(true); + prevContentSize = content_wrap[scroll_size]; + + return this; + } + + + $.fn.ace_scroll = function (option,value) { + var retval; + + var $set = this.each(function () { + var $this = $(this); + var data = $this.data('ace_scroll'); + var options = typeof option === 'object' && option; + + if (!data) $this.data('ace_scroll', (data = new Ace_Scroll(this, options))); + //else if(typeof options == 'object') data['modify'](options); + if (typeof option === 'string') retval = data[option](value); + }); + + return (retval === undefined) ? $set : retval; + }; + + + $.fn.ace_scroll.defaults = { + 'size' : 200, + 'horizontal': false, + 'mouseWheel': true, + 'mouseWheelLock': false, + 'lockAnyway': false, + 'styleClass' : false, + + 'observeContent': false, + 'hideOnIdle': false, + 'hideDelay': 1500, + + 'hoverReset': true //reset scrollbar sizes on mouse hover because of possible sizing changes + , + 'reset': false //true= set scrollTop = 0 + , + 'dragEvent': false + , + 'touchDrag': true + , + 'touchSwipe': false + , + 'scrollEvent': false //trigger scroll event + + , + 'detached': false + , + 'updatePos': true + /** + , + 'track' : true, + 'show' : false, + 'dark': false, + 'alwaysVisible': false, + 'margin': false, + 'thin': false, + 'position': 'right' + */ + } + + /** + $(document).on('ace.settings.ace_scroll', function(e, name) { + if(name == 'sidebar_collapsed') $('.ace-scroll').scroller('reset'); + }); + $(window).on('resize.ace_scroll', function() { + $('.ace-scroll').scroller('reset'); + }); + */ + +})(window.jQuery);;/** + Custom color picker element. Converts html select elements to a dropdown color picker. +*/ +(function($ , undefined) { + var Ace_Colorpicker = function(element, _options) { + + var attrib_values = ace.helper.getAttrSettings(element, $.fn.ace_colorpicker.defaults); + var options = $.extend({}, $.fn.ace_colorpicker.defaults, _options, attrib_values); + + + var $element = $(element); + var color_list = ''; + var color_selected = ''; + var selection = null; + var color_array = []; + + $element.addClass('hide').find('option').each(function() { + var $class = 'colorpick-btn'; + var color = this.value.replace(/[^\w\s,#\(\)\.]/g, ''); + if(this.value != color) this.value = color; + if(this.selected) { + $class += ' selected'; + color_selected = color; + } + color_array.push(color) + color_list += '
  • '; + }). + end() + .on('change.color', function(){ + $element.next().find('.btn-colorpicker').css('background-color', this.value); + }) + .after('') + + + var dropdown = $element.next().find('.dropdown-menu') + dropdown.on(ace.click_event, function(e) { + var a = $(e.target); + if(!a.is('.colorpick-btn')) return false; + + if(selection) selection.removeClass('selected'); + selection = a; + selection.addClass('selected'); + var color = selection.data('color'); + + $element.val(color).trigger('change'); + + e.preventDefault(); + return true;//to hide dropdown + }) + selection = $element.next().find('a.selected'); + + this.pick = function(index, insert) { + if(typeof index === 'number') { + if(index >= color_array.length) return; + element.selectedIndex = index; + dropdown.find('a:eq('+index+')').trigger(ace.click_event); + } + else if(typeof index === 'string') { + var color = index.replace(/[^\w\s,#\(\)\.]/g, ''); + index = color_array.indexOf(color); + //add this color if it doesn't exist + if(index == -1 && insert === true) { + color_array.push(color); + + $('