food-waimai-web

main
unity 9 months ago
parent 419b41a69b
commit 41375b69f2

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>food-waimai-web</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>

@ -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/<project>=UTF-8

@ -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

@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>package</id>
<formats>
<format>dir</format>
<format>zip</format>
</formats>
<includeBaseDirectory>true</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>src/main/bin</directory>
<outputDirectory>bin</outputDirectory>
</fileSet>
<fileSet>
<directory>src/main/resources</directory>
<outputDirectory>conf</outputDirectory>
<includes>
<include>application.properties</include>
<include>logback.xml</include>
</includes>
</fileSet>
<fileSet>
<directory>src/main/conf</directory>
<outputDirectory>conf</outputDirectory>
</fileSet>
<fileSet>
<directory>src/main/logs</directory>
<outputDirectory>logs</outputDirectory>
</fileSet>
<fileSet>
<directory>src/main/lib</directory>
<outputDirectory>lib</outputDirectory>
</fileSet>
<fileSet>
<directory>src/main/temp</directory>
<outputDirectory>temp</outputDirectory>
</fileSet>
</fileSets>
<files>
<file>
<source>${project.build.directory}/${artifactId}-${version}.jar</source>
<outputDirectory>lib</outputDirectory>
<destName>${artifactId}-${version}.jar</destName>
</file>
</files>
</assembly>

@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="Spring" name="Spring">
<configuration />
</facet>
<facet type="web" name="Web">
<configuration>
<webroots />
<sourceRoots>
<root url="file://$MODULE_DIR$/src/main/java" />
<root url="file://$MODULE_DIR$/src/main/resources" />
</sourceRoots>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.0.2.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.0.2.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.0.2.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.0.2.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.0.2.RELEASE" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.10.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.10.0" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.25" level="project" />
<orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.3.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.0.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.0.6.RELEASE" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.yaml:snakeyaml:1.19" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.0.2.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.4" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.9.4" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.9.4" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.5" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.5" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.9.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.0.2.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:8.5.31" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:8.5.31" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:8.5.31" level="project" />
<orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.0.9.Final" level="project" />
<orderEntry type="library" name="Maven: javax.validation:validation-api:2.0.1.Final" level="project" />
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.3.2.Final" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.3.4" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.0.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.0.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.0.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.0.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.0.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-freemarker:2.0.2.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.freemarker:freemarker:2.3.28" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.0.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.4" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.0" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.47" level="project" />
<orderEntry type="module" module-name="food-api" />
<orderEntry type="library" name="Maven: com.jwsaas:common-utils:1.0.0" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.11" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.25" level="project" />
<orderEntry type="library" name="Maven: com.jwsaas:common-dubbo:1.0.0" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-all:4.1.24.Final" level="project" />
<orderEntry type="library" name="Maven: org.apache.curator:curator-client:2.11.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.zookeeper:zookeeper:3.4.6" level="project" />
<orderEntry type="library" name="Maven: jline:jline:0.9.94" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty:3.7.0.Final" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:guava:16.0.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.curator:curator-framework:2.11.0" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:dubbo:2.6.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.0.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.javassist:javassist:3.20.0-GA" level="project" />
<orderEntry type="library" name="Maven: org.jboss.netty:netty:3.2.5.Final" level="project" />
<orderEntry type="library" name="Maven: com.vdurmont:emoji-java:4.0.0" level="project" />
<orderEntry type="library" name="Maven: org.json:json:20170516" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-amqp:2.0.2.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-messaging:5.0.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.amqp:spring-rabbit:2.0.3.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.amqp:spring-amqp:2.0.3.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.rabbitmq:amqp-client:5.1.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.0.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.retry:spring-retry:1.2.2.RELEASE" level="project" />
</component>
</module>

@ -0,0 +1,135 @@
<?xml version="1.0"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.jwsaas</groupId>
<artifactId>food-parent</artifactId>
<version>2.0.0</version>
</parent>
<artifactId>food-waimai-web</artifactId>
<name>food-waimai-web</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.boot.version>2.0.2.RELEASE</spring.boot.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
</dependency>
<!-- fastjson -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
</dependency>
<!-- food-api -->
<dependency>
<groupId>com.jwsaas</groupId>
<artifactId>food-api</artifactId>
</dependency>
<dependency>
<groupId>com.jwsaas</groupId>
<artifactId>common-dubbo</artifactId>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
<exclusion>
<artifactId>dubbo</artifactId>
<groupId>com.alibaba</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo</artifactId>
<version>2.6.5</version>
</dependency>
<dependency>
<groupId>com.vdurmont</groupId>
<artifactId>emoji-java</artifactId>
<version>4.0.0</version>
</dependency>
<!-- mq -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.boot.version}</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>assembly.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<excludes>
<exclude>application.properties</exclude>
<exclude>logback.xml</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>

@ -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

File diff suppressed because it is too large Load Diff

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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=-Xms256m
wrapper.java.additional.2=-Xmx512m
wrapper.java.additional.3=-XX:PermSize=128m
wrapper.java.additional.4=-XX:MaxPermSize=256m
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=Food2WaiMaiWeb Application
wrapper.name=food2WaiMaiWeb
wrapper.displayname=Food2WaiMaiWeb Application
wrapper.description=Food2WaiMaiWeb Application
wrapper.ntservice.dependency.1=
wrapper.ntservice.starttype=AUTO_START
wrapper.ntservice.interactive=false

@ -0,0 +1,17 @@
package com.jwsaas;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ImportResource;
@ComponentScan(basePackages = "com.jwsaas")
@ImportResource(locations = { "classpath*:META-INF/spring/spring-*.xml" })
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}

@ -0,0 +1,13 @@
package com.jwsaas;
public class Global {
public static final String APP_SIGN = "foodWaiMai";
// 树路径(path)分隔符
public static final String PATH_SEPARATOR = ",";
//是否启用MQ上传
public static final boolean USEMQ = true;
}

@ -0,0 +1,67 @@
package com.jwsaas.config;
import java.util.Map;
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.utils.JSONUtil;
@Component
public class MQMessageSender {
@Autowired
private RabbitTemplate rabbitTemplate;
public void send4elemecreate(String tenantId, Map<String, Object> message, CorrelationData correlationData) throws Exception {
message.put("tenantId", tenantId);
this.rabbitTemplate.convertAndSend(RabbitConstant.EXCHANGE_NAME, RabbitConstant.ROUTING_KEY_ELEME_CREATE, JSONUtil.toJSONString(message), correlationData);
}
public void send4elemeupdate(String tenantId, Map<String, Object> message, CorrelationData correlationData) throws Exception {
message.put("tenantId", tenantId);
this.rabbitTemplate.convertAndSend(RabbitConstant.EXCHANGE_NAME, RabbitConstant.ROUTING_KEY_ELEME_UPDATE, JSONUtil.toJSONString(message), correlationData);
}
public void send4meituancreate(String tenantId, Map<String, Object> message, CorrelationData correlationData) throws Exception {
message.put("tenantId", tenantId);
this.rabbitTemplate.convertAndSend(RabbitConstant.EXCHANGE_NAME, RabbitConstant.ROUTING_KEY_MEITUAN_CREATE, JSONUtil.toJSONString(message), correlationData);
}
public void send4meituanupdate(String tenantId, Map<String, Object> message, CorrelationData correlationData) throws Exception {
message.put("tenantId", tenantId);
this.rabbitTemplate.convertAndSend(RabbitConstant.EXCHANGE_NAME, RabbitConstant.ROUTING_KEY_MEITUAN_UPDATE, JSONUtil.toJSONString(message), correlationData);
}
public void send4qimaicreate(String tenantId, Map<String, Object> message, CorrelationData correlationData) throws Exception {
message.put("tenantId", tenantId);
this.rabbitTemplate.convertAndSend(RabbitConstant.EXCHANGE_NAME, RabbitConstant.ROUTING_KEY_QIMAI_CREATE, JSONUtil.toJSONString(message), correlationData);
}
public void send4qimaiupdate(String tenantId, Map<String, Object> message, CorrelationData correlationData) throws Exception {
message.put("tenantId", tenantId);
this.rabbitTemplate.convertAndSend(RabbitConstant.EXCHANGE_NAME, RabbitConstant.ROUTING_KEY_QIMAI_UPDATE, JSONUtil.toJSONString(message), correlationData);
}
public void send4tidiancreate(String tenantId, Map<String, Object> message, CorrelationData correlationData) throws Exception {
message.put("tenantId", tenantId);
this.rabbitTemplate.convertAndSend(RabbitConstant.EXCHANGE_NAME, RabbitConstant.ROUTING_KEY_TIDIAN_CREATE, JSONUtil.toJSONString(message), correlationData);
}
public void send4tidianupdate(String tenantId, Map<String, Object> message, CorrelationData correlationData) throws Exception {
message.put("tenantId", tenantId);
this.rabbitTemplate.convertAndSend(RabbitConstant.EXCHANGE_NAME, RabbitConstant.ROUTING_KEY_TIDIAN_UPDATE, JSONUtil.toJSONString(message), correlationData);
}
public void send4shopmeituancreate(String tenantId, Map<String, Object> message, CorrelationData correlationData) throws Exception {
message.put("tenantId", tenantId);
this.rabbitTemplate.convertAndSend(RabbitConstant.EXCHANGE_NAME, RabbitConstant.ROUTING_KEY_SHOPMEITUAN_CREATE, JSONUtil.toJSONString(message), correlationData);
}
public void send4shopmeituanupdate(String tenantId, Map<String, Object> message, CorrelationData correlationData) throws Exception {
message.put("tenantId", tenantId);
this.rabbitTemplate.convertAndSend(RabbitConstant.EXCHANGE_NAME, RabbitConstant.ROUTING_KEY_SHOPMEITUAN_UPDATE, JSONUtil.toJSONString(message), correlationData);
}
}

@ -0,0 +1,70 @@
package com.jwsaas.config;
public class RabbitConstant {
public final static String EXCHANGE_NAME = "exchange";// 交换器
/**
* 饿
*/
public final static String QUEUE_NAME_ELEME_CREATE = "queue4elemecreate";// 饿了么新订单
public final static String ROUTING_KEY_ELEME_CREATE = "routing4elemecreate";// 饿了么新订单
public final static String QUEUE_NAME_ELEME_UPDATE = "queue4elemeupdate";// 饿了么更新订单
public final static String ROUTING_KEY_ELEME_UPDATE = "routing4elemeupdate";// 饿了么更新订单
/**
*
*/
public final static String QUEUE_NAME_MEITUAN_CREATE = "queue4meituancreate";// 美团新订单
public final static String ROUTING_KEY_MEITUAN_CREATE = "routing4meituancreate";// 美团新订单
public final static String QUEUE_NAME_MEITUAN_UPDATE = "queue4meituanupdate";// 美团更新订单
public final static String ROUTING_KEY_MEITUAN_UPDATE = "routing4meituanupdate";// 美团更新订单
/**
*
*/
public final static String QUEUE_NAME_QIMAI_CREATE = "queue4qimaicreate";// 企迈新订单
public final static String ROUTING_KEY_QIMAI_CREATE = "routing4qimaicreate";// 企迈新订单
public final static String QUEUE_NAME_QIMAI_UPDATE = "queue4qimaiupdate";// 企迈更新订单
public final static String ROUTING_KEY_QIMAI_UPDATE = "routing4qimaiupdate";// 企迈更新订单
/**
*
*/
public final static String QUEUE_NAME_TIDIAN_CREATE = "queue4tidiancreate";// 提点新订单
public final static String ROUTING_KEY_TIDIAN_CREATE = "routing4tidiancreate";// 提点新订单
public final static String QUEUE_NAME_TIDIAN_UPDATE = "queue4tidianupdate";// 提点更新订单
public final static String ROUTING_KEY_TIDIAN_UPDATE = "routing4tidianupdate";// 提点更新订单
/**
*
*/
public final static String QUEUE_NAME_SHOPMEITUAN_CREATE = "queue4shopmeituancreate";// 商家美团新订单
public final static String ROUTING_KEY_SHOPMEITUAN_CREATE = "routing4shopmeituancreate";// 商家美团新订单
public final static String QUEUE_NAME_SHOPMEITUAN_UPDATE = "queue4shopmeituanupdate";// 商家美团更新订单
public final static String ROUTING_KEY_SHOPMEITUAN_UPDATE = "routing4shopmeituanupdate";// 商家美团更新订单
}

@ -0,0 +1,187 @@
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); // 必须要设置
connectionFactory.setChannelCacheSize(100);
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);
}
// 队列-饿了么新增订单
@Bean(name = "queue4elemecreate")
public Queue queue4elemecreate() {
return QueueBuilder.durable(RabbitConstant.QUEUE_NAME_ELEME_CREATE).build();
}
// 绑定-饿了么新增订单
@Bean(name = "binding4elemecreate")
public Binding binding4elemecreate() {
return BindingBuilder.bind(this.queue4elemecreate()).to(this.defaultExchange()).with(RabbitConstant.ROUTING_KEY_ELEME_CREATE);
}
// 队列-饿了么更新订单
@Bean(name = "queue4elemeupdate")
public Queue queue4elemeupdate() {
return QueueBuilder.durable(RabbitConstant.QUEUE_NAME_ELEME_UPDATE).build();
}
// 绑定-饿了么更新订单
@Bean(name = "binding4elemeupdate")
public Binding binding4elemeupdate() {
return BindingBuilder.bind(this.queue4elemeupdate()).to(this.defaultExchange()).with(RabbitConstant.ROUTING_KEY_ELEME_UPDATE);
}
// 队列-美团新增订单
@Bean(name = "queue4meituancreate")
public Queue queue4meituancreate() {
return QueueBuilder.durable(RabbitConstant.QUEUE_NAME_MEITUAN_CREATE).build();
}
// 绑定-美团新增订单
@Bean(name = "binding4meituancreate")
public Binding binding4meituancreate() {
return BindingBuilder.bind(this.queue4meituancreate()).to(this.defaultExchange()).with(RabbitConstant.ROUTING_KEY_MEITUAN_CREATE);
}
// 队列-美团更新订单
@Bean(name = "queue4meituanupdate")
public Queue queue4meituanupdate() {
return QueueBuilder.durable(RabbitConstant.QUEUE_NAME_MEITUAN_UPDATE).build();
}
// 绑定-美团更新订单
@Bean(name = "binding4meituanupdate")
public Binding binding4meituanupdate() {
return BindingBuilder.bind(this.queue4meituanupdate()).to(this.defaultExchange()).with(RabbitConstant.ROUTING_KEY_MEITUAN_UPDATE);
}
// 队列-企迈新增订单
@Bean(name = "queue4qimaicreate")
public Queue queue4qimaicreate() {
return QueueBuilder.durable(RabbitConstant.QUEUE_NAME_QIMAI_CREATE).build();
}
// 绑定-企迈新增订单
@Bean(name = "binding4qimaicreate")
public Binding binding4qimaicreate() {
return BindingBuilder.bind(this.queue4qimaicreate()).to(this.defaultExchange()).with(RabbitConstant.ROUTING_KEY_QIMAI_CREATE);
}
// 队列-企迈更新订单
@Bean(name = "queue4qimaiupdate")
public Queue queue4qimaiupdate() {
return QueueBuilder.durable(RabbitConstant.QUEUE_NAME_QIMAI_UPDATE).build();
}
// 绑定-企迈更新订单
@Bean(name = "binding4qimaiupdate")
public Binding binding4qimaiupdate() {
return BindingBuilder.bind(this.queue4qimaiupdate()).to(this.defaultExchange()).with(RabbitConstant.ROUTING_KEY_QIMAI_UPDATE);
}
// 队列-提点新增订单
@Bean(name = "queue4tidiancreate")
public Queue queue4tidiancreate() {
return QueueBuilder.durable(RabbitConstant.QUEUE_NAME_TIDIAN_CREATE).build();
}
// 绑定-提点新增订单
@Bean(name = "binding4tidiancreate")
public Binding binding4tidiancreate() {
return BindingBuilder.bind(this.queue4tidiancreate()).to(this.defaultExchange()).with(RabbitConstant.ROUTING_KEY_TIDIAN_CREATE);
}
// 队列-提点更新订单
@Bean(name = "queue4tidianupdate")
public Queue queue4tidianupdate() {
return QueueBuilder.durable(RabbitConstant.QUEUE_NAME_TIDIAN_UPDATE).build();
}
// 绑定-提点更新订单
@Bean(name = "binding4tidianupdate")
public Binding binding4tidianupdate() {
return BindingBuilder.bind(this.queue4tidianupdate()).to(this.defaultExchange()).with(RabbitConstant.ROUTING_KEY_TIDIAN_UPDATE);
}
// 队列-美团新增订单
@Bean(name = "queue4shopmeituancreate")
public Queue queue4shopmeituancreate() {
return QueueBuilder.durable(RabbitConstant.QUEUE_NAME_SHOPMEITUAN_CREATE).build();
}
// 绑定-美团新增订单
@Bean(name = "binding4shopmeituancreate")
public Binding binding4shopmeituancreate() {
return BindingBuilder.bind(this.queue4shopmeituancreate()).to(this.defaultExchange()).with(RabbitConstant.ROUTING_KEY_SHOPMEITUAN_CREATE);
}
// 队列-美团更新订单
@Bean(name = "queue4shopmeituanupdate")
public Queue queue4shopmeituanupdate() {
return QueueBuilder.durable(RabbitConstant.QUEUE_NAME_SHOPMEITUAN_UPDATE).build();
}
// 绑定-美团更新订单
@Bean(name = "binding4shopmeituanupdate")
public Binding binding4shopmeituanupdate() {
return BindingBuilder.bind(this.queue4shopmeituanupdate()).to(this.defaultExchange()).with(RabbitConstant.ROUTING_KEY_SHOPMEITUAN_UPDATE);
}
}

@ -0,0 +1,51 @@
package com.jwsaas.controller;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
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;
}
public static String filter(String str) {
if (str.trim().isEmpty()) {
return str;
}
String pattern = "[\ud83c\udc00-\ud83c\udfff]|[\ud83d\udc00-\ud83d\udfff]|[\u2600-\u27ff]";
String reStr = "";
Pattern emoji = Pattern.compile(pattern);
Matcher emojiMatcher = emoji.matcher(str);
str = emojiMatcher.replaceAll(reStr);
return str;
}
}

@ -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";
}
}

@ -0,0 +1,512 @@
package com.jwsaas.controller.waimai;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
public class BaiduOrderEntity implements Serializable {
private static final long serialVersionUID = 1L;
private String body;// 订单内容
private String source;// 百度应用编号
private String shopId;// 商户ID
private String baiduShopId;// 百度商户ID
private String baiduShopName;// 百度商户名称
private String orderId;// 订单ID
private Integer sendImmediately;// 是否立即送餐
private String orderIndex;// 订单当日流水号
private Integer status;// 订单状态
private Integer expectTimeMode;// 送达时间类型
private String sendTime;// 期望送达时间
private String pickupTime;// 取餐时间
private String atshopTime;// 到店时间
private String deliveryTime;// 送餐时间
private String deliveryPhone;// 骑士手机号
private String finishedTime;// 完成时间
private String confirmTime;// 确认时间
private String cancelTime;// 取消时间
private Integer sendFee;// 配送费
private Integer packageFee;// 餐盒费
private Integer discountFee;// 优惠总金额
private Integer shopFee;// 商户应收金额
private Integer totalFee;// 订单总金额
private Integer userFee;// 用户实付金额
private Integer payType;// 付款类型
private Integer needInvoice;// 是否需要发票
private String invoiceTitle;// 发票抬头
private String remark;// 订单备注
private Integer deliveryParty;// 物流类型
private String createTime;// 创建时间
private String mealNum;// 餐具数量
private String responsibleParty;// 取消订单责任承担方
private Integer commission;// 佣金
private String user;// 订单客户信息
private String shop;// 商户信息
private String products;// 订单商品信息数组
private String discount;// 优惠信息
private String partRefundInfo;// 部分退款
private List<BaiduOrderProductEntity> productList;// 商品信息列表
public BaiduOrderEntity(JSONObject jsonObject) {
body = jsonObject.toJSONString();
if (jsonObject.containsKey("body")) {
JSONObject boday = jsonObject.getJSONObject("body");
if (boday.containsKey("errno")) {
Integer errno = boday.getInteger("errno");
}
if (boday.containsKey("error")) {
String error = boday.getString("error");
}
if (boday.containsKey("data")) {
JSONObject data = boday.getJSONObject("data");
if (data.containsKey("source")) {
source = boday.getString("source");
}
if (data.containsKey("shop")) {
shop = jsonObject.getString("shop");
JSONObject shopJSON = data.getJSONObject("shop");
if (shopJSON.containsKey("id"))
shopId = shopJSON.getString("id");
if (shopJSON.containsKey("baidu_shop_id"))
baiduShopId = shopJSON.getString("baidu_shop_id");
if (shopJSON.containsKey("name"))
baiduShopName = shopJSON.getString("name");
}
if (data.containsKey("order")) {
JSONObject order = data.getJSONObject("order");
if (order.containsKey("order_id"))
orderId = order.getString("order_id");
if (order.containsKey("send_immediately"))
sendImmediately = order.getInteger("send_immediately");
if (order.containsKey("order_index"))
orderIndex = order.getString("order_index");
if (order.containsKey("status"))
status = order.getInteger("status");
if (order.containsKey("expect_time_mode"))
expectTimeMode = order.getInteger("expect_time_mode");
if (order.containsKey("send_time"))
sendTime = order.getString("send_time");
if (order.containsKey("pickup_time"))
pickupTime = order.getString("pickup_time");
if (order.containsKey("atshop_time"))
atshopTime = order.getString("atshop_time");
if (order.containsKey("delivery_time"))
deliveryTime = order.getString("delivery_time");
if (order.containsKey("delivery_phone"))
deliveryPhone = order.getString("delivery_phone");
if (order.containsKey("finished_time"))
finishedTime = order.getString("finished_time");
if (order.containsKey("confirm_time"))
confirmTime = order.getString("confirm_time");
if (order.containsKey("cancel_time"))
cancelTime = order.getString("cancel_time");
if (order.containsKey("send_fee"))
sendFee = order.getInteger("send_fee");
if (order.containsKey("package_fee"))
packageFee = order.getInteger("package_fee");
if (order.containsKey("discount_fee"))
discountFee = order.getInteger("discount_fee");
if (order.containsKey("shop_fee"))
shopFee = order.getInteger("shop_fee");
if (order.containsKey("total_fee"))
totalFee = order.getInteger("total_fee");
if (order.containsKey("user_fee"))
userFee = order.getInteger("user_fee");
if (order.containsKey("pay_type"))
payType = order.getInteger("pay_type");
if (order.containsKey("need_invoice"))
needInvoice = order.getInteger("need_invoice");
if (order.containsKey("invoice_title"))
invoiceTitle = order.getString("invoice_title");
if (order.containsKey("remark"))
remark = order.getString("remark");
if (order.containsKey("delivery_party"))
deliveryParty = order.getInteger("delivery_party");
if (order.containsKey("create_time"))
createTime = order.getString("create_time");
if (order.containsKey("meal_num"))
mealNum = order.getString("meal_num");
if (order.containsKey("responsible_party"))
responsibleParty = order.getString("responsible_party");
if (order.containsKey("commission"))
commission = order.getInteger("commission");
}
if (data.containsKey("user")) {
user = data.getJSONObject("user").toJSONString();
}
if (data.containsKey("products")) {
products = data.getJSONArray("products").toJSONString();
JSONArray products = data.getJSONArray("products");
productList = new ArrayList<>();
for (int i = 0; i < products.size(); i++) {
JSONArray product = products.getJSONArray(i);
for (int j = 0; j < product.size(); j++) {
BaiduOrderProductEntity baiduOrderProductEntity = new BaiduOrderProductEntity(product.getJSONObject(j));
productList.add(baiduOrderProductEntity);
}
}
}
if (data.containsKey("discount")) {
discount = data.getJSONArray("discount").toJSONString();
}
if (data.containsKey("part_refund_info")) {
partRefundInfo = data.getJSONArray("part_refund_info").toJSONString();
}
}
}
}
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public String getShopId() {
return shopId;
}
public void setShopId(String shopId) {
this.shopId = shopId;
}
public String getBaiduShopId() {
return baiduShopId;
}
public void setBaiduShopId(String baiduShopId) {
this.baiduShopId = baiduShopId;
}
public String getBaiduShopName() {
return baiduShopName;
}
public void setBaiduShopName(String baiduShopName) {
this.baiduShopName = baiduShopName;
}
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public Integer getSendImmediately() {
return sendImmediately;
}
public void setSendImmediately(Integer sendImmediately) {
this.sendImmediately = sendImmediately;
}
public String getOrderIndex() {
return orderIndex;
}
public void setOrderIndex(String orderIndex) {
this.orderIndex = orderIndex;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getExpectTimeMode() {
return expectTimeMode;
}
public void setExpectTimeMode(Integer expectTimeMode) {
this.expectTimeMode = expectTimeMode;
}
public String getSendTime() {
return sendTime;
}
public void setSendTime(String sendTime) {
this.sendTime = sendTime;
}
public String getPickupTime() {
return pickupTime;
}
public void setPickupTime(String pickupTime) {
this.pickupTime = pickupTime;
}
public String getAtshopTime() {
return atshopTime;
}
public void setAtshopTime(String atshopTime) {
this.atshopTime = atshopTime;
}
public String getDeliveryTime() {
return deliveryTime;
}
public void setDeliveryTime(String deliveryTime) {
this.deliveryTime = deliveryTime;
}
public String getDeliveryPhone() {
return deliveryPhone;
}
public void setDeliveryPhone(String deliveryPhone) {
this.deliveryPhone = deliveryPhone;
}
public String getFinishedTime() {
return finishedTime;
}
public void setFinishedTime(String finishedTime) {
this.finishedTime = finishedTime;
}
public String getConfirmTime() {
return confirmTime;
}
public void setConfirmTime(String confirmTime) {
this.confirmTime = confirmTime;
}
public String getCancelTime() {
return cancelTime;
}
public void setCancelTime(String cancelTime) {
this.cancelTime = cancelTime;
}
public Integer getSendFee() {
return sendFee;
}
public void setSendFee(Integer sendFee) {
this.sendFee = sendFee;
}
public Integer getPackageFee() {
return packageFee;
}
public void setPackageFee(Integer packageFee) {
this.packageFee = packageFee;
}
public Integer getDiscountFee() {
return discountFee;
}
public void setDiscountFee(Integer discountFee) {
this.discountFee = discountFee;
}
public Integer getShopFee() {
return shopFee;
}
public void setShopFee(Integer shopFee) {
this.shopFee = shopFee;
}
public Integer getTotalFee() {
return totalFee;
}
public void setTotalFee(Integer totalFee) {
this.totalFee = totalFee;
}
public Integer getUserFee() {
return userFee;
}
public void setUserFee(Integer userFee) {
this.userFee = userFee;
}
public Integer getPayType() {
return payType;
}
public void setPayType(Integer payType) {
this.payType = payType;
}
public Integer getNeedInvoice() {
return needInvoice;
}
public void setNeedInvoice(Integer needInvoice) {
this.needInvoice = needInvoice;
}
public String getInvoiceTitle() {
return invoiceTitle;
}
public void setInvoiceTitle(String invoiceTitle) {
this.invoiceTitle = invoiceTitle;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Integer getDeliveryParty() {
return deliveryParty;
}
public void setDeliveryParty(Integer deliveryParty) {
this.deliveryParty = deliveryParty;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public String getMealNum() {
return mealNum;
}
public void setMealNum(String mealNum) {
this.mealNum = mealNum;
}
public String getResponsibleParty() {
return responsibleParty;
}
public void setResponsibleParty(String responsibleParty) {
this.responsibleParty = responsibleParty;
}
public Integer getCommission() {
return commission;
}
public void setCommission(Integer commission) {
this.commission = commission;
}
public String getUser() {
return user;
}
public void setUser(String user) {
this.user = user;
}
public String getShop() {
return shop;
}
public void setShop(String shop) {
this.shop = shop;
}
public String getProducts() {
return products;
}
public void setProducts(String products) {
this.products = products;
}
public String getDiscount() {
return discount;
}
public void setDiscount(String discount) {
this.discount = discount;
}
public String getPartRefundInfo() {
return partRefundInfo;
}
public void setPartRefundInfo(String partRefundInfo) {
this.partRefundInfo = partRefundInfo;
}
public List<BaiduOrderProductEntity> getProductList() {
return productList;
}
public void setProductList(List<BaiduOrderProductEntity> productList) {
this.productList = productList;
}
}

@ -0,0 +1,283 @@
package com.jwsaas.controller.waimai;
import java.io.Serializable;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
public class BaiduOrderProductEntity implements Serializable {
private static final long serialVersionUID = 1379568009771599898L;
private String orderId;// 订单ID
private String baiduProductId;// 百度商品ID
private String otherDishId;// 第三方菜品ID
private String productId;// 第三方套餐ID
private String upc;// 商品UPC
private Integer productType;// 菜品类型
private String productName;// 商品名称
private Integer productAmount;// 商品份数
private Integer productPrice;// 价格
private String productAttr;// 商品规格
private String baiduAttrId;// 百度规格ID
private String attrId;// 第三方规格ID
private String option;// 规格名称
private String productFeatures;// 商品属性
private Integer productFee;// 商品总价
private Integer packageFee;// 餐盒总价
private Integer packagePrice;// 餐盒单价
private Integer packageAmount;// 餐盒数量
private Integer totalFee;// 总价
private String productCustomIndex;// 商品唯一串
private Integer isFixedPrice;// 是否固定价格
private String group;// 套餐内组合
public BaiduOrderProductEntity(JSONObject jsonObject) {
if (jsonObject.containsKey("baidu_product_id"))
baiduProductId = jsonObject.getString("baidu_product_id");
if (jsonObject.containsKey("other_dish_id"))
otherDishId = jsonObject.getString("other_dish_id");
if (jsonObject.containsKey("product_id"))
productId = jsonObject.getString("product_id");
if (jsonObject.containsKey("upc"))
upc = jsonObject.getString("upc");
if (jsonObject.containsKey("product_type"))
productType = jsonObject.getInteger("product_type");
if (jsonObject.containsKey("product_name"))
productName = jsonObject.getString("product_name");
if (jsonObject.containsKey("product_amount"))
productAmount = jsonObject.getInteger("product_amount");
if (jsonObject.containsKey("product_price"))
productPrice = jsonObject.getInteger("product_price");
if (jsonObject.containsKey("product_attr")) {
productAttr = jsonObject.getString("product_attr");
JSONArray product_attr = jsonObject.getJSONArray("product_attr");
// 规格解析
for (int i = 0; i < product_attr.size(); i++) {
JSONObject attr = product_attr.getJSONObject(i);
if (attr.containsKey("baidu_attr_id"))
baiduAttrId = attr.getString("baidu_attr_id");
if (attr.containsKey("attr_id"))
attrId = attr.getString("attr_id");
if (attr.containsKey("option"))
option = attr.getString("option");
}
}
if (jsonObject.containsKey("product_features"))
productFeatures = jsonObject.getString("product_features");
if (jsonObject.containsKey("product_fee"))
productFee = jsonObject.getInteger("product_fee");
if (jsonObject.containsKey("package_fee"))
packageFee = jsonObject.getInteger("package_fee");
if (jsonObject.containsKey("package_price"))
packagePrice = jsonObject.getInteger("package_price");
if (jsonObject.containsKey("package_amount"))
packageAmount = jsonObject.getInteger("package_amount");
if (jsonObject.containsKey("total_fee"))
totalFee = jsonObject.getInteger("total_fee");
if (jsonObject.containsKey("product_custom_index"))
productCustomIndex = jsonObject.getString("product_custom_index");
if (jsonObject.containsKey("is_fixed_price"))
isFixedPrice = jsonObject.getInteger("is_fixed_price");
if (jsonObject.containsKey("group"))
group = jsonObject.getString("group");
}
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public String getBaiduProductId() {
return baiduProductId;
}
public void setBaiduProductId(String baiduProductId) {
this.baiduProductId = baiduProductId;
}
public String getOtherDishId() {
return otherDishId;
}
public void setOtherDishId(String otherDishId) {
this.otherDishId = otherDishId;
}
public String getProductId() {
return productId;
}
public void setProductId(String productId) {
this.productId = productId;
}
public String getUpc() {
return upc;
}
public void setUpc(String upc) {
this.upc = upc;
}
public Integer getProductType() {
return productType;
}
public void setProductType(Integer productType) {
this.productType = productType;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public Integer getProductAmount() {
return productAmount;
}
public void setProductAmount(Integer productAmount) {
this.productAmount = productAmount;
}
public Integer getProductPrice() {
return productPrice;
}
public void setProductPrice(Integer productPrice) {
this.productPrice = productPrice;
}
public String getProductAttr() {
return productAttr;
}
public void setProductAttr(String productAttr) {
this.productAttr = productAttr;
}
public String getBaiduAttrId() {
return baiduAttrId;
}
public void setBaiduAttrId(String baiduAttrId) {
this.baiduAttrId = baiduAttrId;
}
public String getAttrId() {
return attrId;
}
public void setAttrId(String attrId) {
this.attrId = attrId;
}
public String getOption() {
return option;
}
public void setOption(String option) {
this.option = option;
}
public String getProductFeatures() {
return productFeatures;
}
public void setProductFeatures(String productFeatures) {
this.productFeatures = productFeatures;
}
public Integer getProductFee() {
return productFee;
}
public void setProductFee(Integer productFee) {
this.productFee = productFee;
}
public Integer getPackageFee() {
return packageFee;
}
public void setPackageFee(Integer packageFee) {
this.packageFee = packageFee;
}
public Integer getPackagePrice() {
return packagePrice;
}
public void setPackagePrice(Integer packagePrice) {
this.packagePrice = packagePrice;
}
public Integer getPackageAmount() {
return packageAmount;
}
public void setPackageAmount(Integer packageAmount) {
this.packageAmount = packageAmount;
}
public Integer getTotalFee() {
return totalFee;
}
public void setTotalFee(Integer totalFee) {
this.totalFee = totalFee;
}
public String getProductCustomIndex() {
return productCustomIndex;
}
public void setProductCustomIndex(String productCustomIndex) {
this.productCustomIndex = productCustomIndex;
}
public Integer getIsFixedPrice() {
return isFixedPrice;
}
public void setIsFixedPrice(Integer isFixedPrice) {
this.isFixedPrice = isFixedPrice;
}
public String getGroup() {
return group;
}
public void setGroup(String group) {
this.group = group;
}
}

@ -0,0 +1,148 @@
package com.jwsaas.controller.waimai;
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 javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
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.JSONObject;
import com.jwsaas.Global;
import com.jwsaas.controller.BaseController;
import com.jwsaas.entity.food.BaiduOrder;
import com.jwsaas.entity.food.BaiduOrderProduct;
import com.jwsaas.service.food.BaiduOrderProductService;
import com.jwsaas.service.food.BaiduOrderService;
import com.vdurmont.emoji.EmojiParser;
@Controller(Global.APP_SIGN + "BaiduWaimaiOrderController")
@RequestMapping("/waimai/baidu")
public class BaiduWaimaiOrderController extends BaseController {
@Resource
private BaiduOrderService baiduOrderService;
@Resource
private BaiduOrderProductService baiduOrderProductService;
@RequestMapping(value = "/order", method = { RequestMethod.POST })
@ResponseBody
public Object order(HttpServletRequest request, HttpServletResponse response) {
String info = "百度外卖订单推送";
Map<String, Object> result = new HashMap<>();
try {
String type = getParameter(request, "type");// 1新增;2修改
String tenantId = getParameter(request, "tenantId");// 企业编号
String body = getParameter(request, "body");
body = EmojiParser.removeAllEmojis(body);
logger.error(tenantId);
logger.error(body);
Date createDate = new Date();
String createUser = "push-user";
BaiduOrderEntity baiduOrderEntity = new BaiduOrderEntity(JSONObject.parseObject(EmojiParser.removeAllEmojis(body)));
BaiduOrder baiduOrder = new BaiduOrder();
baiduOrder.setBody(baiduOrderEntity.getBody());
baiduOrder.setAtshopTime(baiduOrderEntity.getAtshopTime());
baiduOrder.setBaiduShopId(baiduOrderEntity.getBaiduShopId());
baiduOrder.setBaiduShopName(baiduOrderEntity.getBaiduShopName());
baiduOrder.setCancelTime(baiduOrderEntity.getCancelTime());
baiduOrder.setCommission(baiduOrderEntity.getCommission());
baiduOrder.setConfirmTime(baiduOrderEntity.getConfirmTime());
baiduOrder.setCreateDate(createDate);
baiduOrder.setCreateTime(baiduOrderEntity.getCreateTime());
baiduOrder.setCreateUser(createUser);
baiduOrder.setDeliveryParty(baiduOrderEntity.getDeliveryParty());
baiduOrder.setDeliveryPhone(baiduOrderEntity.getDeliveryPhone());
baiduOrder.setDeliveryTime(baiduOrderEntity.getDeliveryTime());
baiduOrder.setDiscount(baiduOrderEntity.getDiscount());
baiduOrder.setDiscountFee(baiduOrderEntity.getDiscountFee());
baiduOrder.setExpectTimeMode(baiduOrderEntity.getExpectTimeMode());
baiduOrder.setFinishedTime(baiduOrderEntity.getFinishedTime());
baiduOrder.setInvoiceTitle(baiduOrderEntity.getInvoiceTitle());
baiduOrder.setMealNum(baiduOrderEntity.getMealNum());
baiduOrder.setNeedInvoice(baiduOrderEntity.getNeedInvoice());
baiduOrder.setOrderId(baiduOrderEntity.getOrderId());
baiduOrder.setOrderIndex(baiduOrderEntity.getOrderIndex());
baiduOrder.setPackageFee(baiduOrderEntity.getPackageFee());
baiduOrder.setPartRefundInfo(baiduOrderEntity.getPartRefundInfo());
baiduOrder.setPayType(baiduOrderEntity.getPayType());
baiduOrder.setPickupTime(baiduOrderEntity.getPickupTime());
baiduOrder.setProducts(baiduOrderEntity.getProducts());
baiduOrder.setRemark(baiduOrderEntity.getRemark());
baiduOrder.setResponsibleParty(baiduOrderEntity.getResponsibleParty());
baiduOrder.setSendFee(baiduOrderEntity.getSendFee());
baiduOrder.setSendImmediately(baiduOrderEntity.getSendImmediately());
baiduOrder.setSendTime(baiduOrderEntity.getSendTime());
baiduOrder.setShop(baiduOrderEntity.getShop());
baiduOrder.setShopFee(baiduOrderEntity.getSendFee());
baiduOrder.setShopId(baiduOrderEntity.getShopId());
baiduOrder.setSource(baiduOrderEntity.getSource());
baiduOrder.setStatus(baiduOrderEntity.getStatus());
baiduOrder.setTenantId(tenantId);
baiduOrder.setTotalFee(baiduOrderEntity.getTotalFee());
baiduOrder.setUser(baiduOrderEntity.getUser());
baiduOrder.setUserFee(baiduOrderEntity.getUserFee());
List<BaiduOrderProductEntity> list = baiduOrderEntity.getProductList();
List<BaiduOrderProduct> productList = new ArrayList<>();
for (BaiduOrderProductEntity baiduOrderProductEntity : list) {
BaiduOrderProduct order = new BaiduOrderProduct();
order.setAttrId(baiduOrderProductEntity.getAttrId());
order.setBaiduAttrId(baiduOrderProductEntity.getBaiduAttrId());
order.setBaiduProductId(baiduOrderProductEntity.getBaiduProductId());
order.setCreateDate(createDate);
order.setCreateUser(createUser);
order.setGroup(baiduOrderProductEntity.getGroup());
order.setIsFixedPrice(baiduOrderProductEntity.getIsFixedPrice());
order.setOption(baiduOrderProductEntity.getOption());
order.setOrderId(baiduOrder.getOrderId());
order.setOtherDishId(baiduOrderProductEntity.getOtherDishId());
order.setPackageAmount(baiduOrderProductEntity.getPackageAmount());
order.setPackageFee(baiduOrderProductEntity.getPackageFee());
order.setPackagePrice(baiduOrderProductEntity.getPackagePrice());
order.setProductAmount(baiduOrderProductEntity.getPackageAmount());
order.setProductAttr(baiduOrderProductEntity.getProductAttr());
order.setProductCustomIndex(baiduOrderProductEntity.getProductCustomIndex());
order.setProductFeatures(baiduOrderProductEntity.getProductFeatures());
order.setProductFee(baiduOrderProductEntity.getProductFee());
order.setProductId(baiduOrderProductEntity.getProductId());
order.setProductName(baiduOrderProductEntity.getProductName());
order.setProductPrice(baiduOrderProductEntity.getProductPrice());
order.setProductType(baiduOrderProductEntity.getProductType());
order.setTenantId(tenantId);
order.setTotalFee(baiduOrderProductEntity.getTotalFee());
order.setUpc(baiduOrderProductEntity.getUpc());
productList.add(order);
}
List<BaiduOrder> orderList = baiduOrderService.findList(tenantId, "orderId", baiduOrder.getOrderId());
if ("1".equals(type)) {
logger.error("百度外卖订单推送,订单新增====>>:", orderList.size());
if (orderList == null || orderList.size() <= 0) {
baiduOrderService.saveOrder(tenantId, baiduOrder, productList);
}
} else if ("2".equals(type)) {
logger.error("百度外卖订单推送,订单数量====>>:", orderList.size());
if (orderList != null && orderList.size() > 0) {
BaiduOrder oldBaiduOrder = orderList.get(0);
baiduOrder.setId(oldBaiduOrder.getId());
baiduOrderService.update(tenantId, baiduOrder);
}
}
result.put("orderId", baiduOrder.getOrderId());
result.put("storeId", baiduOrder.getShopId());
result.put("status", "success");
} catch (Exception e) {
logger.error("百度外卖订单推送:", e);
result.put("status", "error");
}
return result;
}
}

@ -0,0 +1,493 @@
package com.jwsaas.controller.waimai;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jwsaas.utils.DateUtils;
public class ElemeOrderDetailEntity implements Serializable {
private static final long serialVersionUID = -3105563592467144321L;
private String storeId;// 系统门店ID
private String orderId;// 饿了么订单id
private String address;// 顾客送餐地址
private String createdAt;// 下单时间
private String activeAt;// 订单生效时间
private Double deliverFee;// 配送费
private String deliverTime;// 送餐时间
private String description;// 订单备注
private String invoice;// 发票抬头
private Integer isBook;// 是否预订单
private Integer isOnlinePaid;// 是否在线支付
private String phoneList;// 顾客联系电话
private String shopId;// 店铺Id
private String shopName;// 店铺名称
private Integer daySn;// 店铺当日订单流水号
private String status;// 订单状态
private String refundStatus;// 退单状态
private String userId;// 用户id
private Double totalPrice;// 订单总价
private Double originalPrice;// 原始价格
private String consignee;// 订单收货人
private String deliveryGeo;// 订单收货地址经纬度
private String deliveryPoiAddress;// 顾客送餐详情地址
private Integer invoiced;// 是否需要发票
private Double income;// 店铺实收
private Double serviceRate;// 饿了么服务费率
private Double serviceFee;// 饿了么服务费
private Double hongbao;// 订单中红包金额
private Double packageFee;// 餐盒费
private Double activityTotal;// 订单活动总额
private Double shopPart;// 店铺承担活动费用
private Double elemePart;// 饿了么承担活动费用
private Integer downgraded;// 降级标识
private List<ElemeOrderDetailGroupEntity> list;
public static String jsonGetDate(JSONObject jsonObject, String key) {
String value = null;
try {
value = DateUtils.format(jsonObject.getDate(key), DateUtils.SHOW_DATETIME_FORMAT);
} catch (Exception e) {
value = null;
}
return value;
}
public ElemeOrderDetailEntity() {
}
public ElemeOrderDetailEntity(JSONObject jsonObject) {
if (jsonObject.containsKey("address")) {
address = jsonObject.getString("address");
}
if (jsonObject.containsKey("createdAt")) {
createdAt = jsonGetDate(jsonObject, "createdAt");
}
if (jsonObject.containsKey("activeAt")) {
activeAt = jsonGetDate(jsonObject, "activeAt");
}
if (jsonObject.containsKey("deliverFee")) {
deliverFee = jsonObject.getDouble("deliverFee");
}
if (jsonObject.containsKey("deliverTime")) {
deliverTime = jsonGetDate(jsonObject, "deliverTime");
}
if (jsonObject.containsKey("description")) {
description = jsonObject.getString("description");
}
if (jsonObject.containsKey("invoice")) {
invoice = jsonObject.getString("invoice");
}
if (jsonObject.containsKey("book")) {
isBook = jsonObject.getBoolean("book") ? 1 : 0;
}
if (jsonObject.containsKey("onlinePaid")) {
isOnlinePaid = jsonObject.getBoolean("onlinePaid") ? 1 : 0;
}
if (jsonObject.containsKey("id")) {
orderId = jsonObject.getString("id");
}
if (jsonObject.containsKey("phoneList")) {
phoneList = jsonObject.getJSONArray("phoneList").toString();
}
if (jsonObject.containsKey("shopId")) {
shopId = String.valueOf(jsonObject.getLong("shopId"));
}
if (jsonObject.containsKey("shopName")) {
shopName = jsonObject.getString("shopName");
}
if (jsonObject.containsKey("daySn")) {
daySn = jsonObject.getInteger("daySn");
}
if (jsonObject.containsKey("status")) {
status = jsonObject.getString("status");
}
if (jsonObject.containsKey("refundStatus")) {
refundStatus = jsonObject.getString("refundStatus");
}
if (jsonObject.containsKey("userId")) {
userId = String.valueOf(jsonObject.getLong("userId"));
}
if (jsonObject.containsKey("totalPrice")) {
totalPrice = jsonObject.getDouble("totalPrice");
}
if (jsonObject.containsKey("originalPrice")) {
originalPrice = jsonObject.getDouble("originalPrice");
}
if (jsonObject.containsKey("consignee")) {
consignee = jsonObject.getString("consignee");
}
if (jsonObject.containsKey("deliveryGeo")) {
deliveryGeo = jsonObject.getString("deliveryGeo");
}
if (jsonObject.containsKey("deliveryPoiAddress")) {
deliveryPoiAddress = jsonObject.getString("deliveryPoiAddress");
}
if (jsonObject.containsKey("invoiced")) {
invoiced = jsonObject.getBoolean("invoiced") ? 1 : 0;
}
if (jsonObject.containsKey("income")) {
income = jsonObject.getDouble("income");
}
if (jsonObject.containsKey("serviceRate")) {
serviceRate = jsonObject.getDouble("serviceRate");
}
if (jsonObject.containsKey("serviceFee")) {
serviceFee = jsonObject.getDouble("serviceFee");
}
if (jsonObject.containsKey("hongbao")) {
hongbao = jsonObject.getDouble("hongbao");
}
if (jsonObject.containsKey("packageFee")) {
packageFee = jsonObject.getDouble("packageFee");
}
if (jsonObject.containsKey("activityTotal")) {
activityTotal = jsonObject.getDouble("activityTotal");
}
if (jsonObject.containsKey("shopPart")) {
shopPart = jsonObject.getDouble("shopPart");
}
if (jsonObject.containsKey("elemePart")) {
elemePart = jsonObject.getDouble("elemePart");
}
if (jsonObject.containsKey("downgraded")) {
downgraded = jsonObject.getBoolean("downgraded") ? 1 : 0;
}
if (jsonObject.containsKey("groups")) {
list = new ArrayList<ElemeOrderDetailGroupEntity>();
JSONArray groups = jsonObject.getJSONArray("groups");
for (int i = 0; i < groups.size(); i++) {
JSONObject groupObject = groups.getJSONObject(i);
String groupName = "";
if (groupObject.containsKey("name")) {
groupName = groupObject.getString("name");
}
String groupType = "";
if (groupObject.containsKey("type")) {
groupType = groupObject.getString("type");
}
if (groupObject.containsKey("items")) {
JSONArray items = groupObject.getJSONArray("items");
for (int j = 0; j < items.size(); j++) {
ElemeOrderDetailGroupEntity entity = new ElemeOrderDetailGroupEntity(items.getJSONObject(j));
entity.setGroupName(groupName);
entity.setGroupType(groupType);
entity.setOrderId(orderId);
list.add(entity);
}
}
}
}
}
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 getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public Double getDeliverFee() {
return deliverFee;
}
public void setDeliverFee(Double deliverFee) {
this.deliverFee = deliverFee;
}
public String getCreatedAt() {
return createdAt;
}
public void setCreatedAt(String createdAt) {
this.createdAt = createdAt;
}
public String getActiveAt() {
return activeAt;
}
public void setActiveAt(String activeAt) {
this.activeAt = activeAt;
}
public String getDeliverTime() {
return deliverTime;
}
public void setDeliverTime(String deliverTime) {
this.deliverTime = deliverTime;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getInvoice() {
return invoice;
}
public void setInvoice(String invoice) {
this.invoice = invoice;
}
public Integer getIsBook() {
return isBook;
}
public void setIsBook(Integer isBook) {
this.isBook = isBook;
}
public Integer getIsOnlinePaid() {
return isOnlinePaid;
}
public void setIsOnlinePaid(Integer isOnlinePaid) {
this.isOnlinePaid = isOnlinePaid;
}
public String getPhoneList() {
return phoneList;
}
public void setPhoneList(String phoneList) {
this.phoneList = phoneList;
}
public String getShopId() {
return shopId;
}
public void setShopId(String shopId) {
this.shopId = shopId;
}
public String getShopName() {
return shopName;
}
public void setShopName(String shopName) {
this.shopName = shopName;
}
public Integer getDaySn() {
return daySn;
}
public void setDaySn(Integer daySn) {
this.daySn = daySn;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getRefundStatus() {
return refundStatus;
}
public void setRefundStatus(String refundStatus) {
this.refundStatus = refundStatus;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public Double getTotalPrice() {
return totalPrice;
}
public void setTotalPrice(Double totalPrice) {
this.totalPrice = totalPrice;
}
public Double getOriginalPrice() {
return originalPrice;
}
public void setOriginalPrice(Double originalPrice) {
this.originalPrice = originalPrice;
}
public String getConsignee() {
return consignee;
}
public void setConsignee(String consignee) {
this.consignee = consignee;
}
public String getDeliveryGeo() {
return deliveryGeo;
}
public void setDeliveryGeo(String deliveryGeo) {
this.deliveryGeo = deliveryGeo;
}
public String getDeliveryPoiAddress() {
return deliveryPoiAddress;
}
public void setDeliveryPoiAddress(String deliveryPoiAddress) {
this.deliveryPoiAddress = deliveryPoiAddress;
}
public Integer getInvoiced() {
return invoiced;
}
public void setInvoiced(Integer invoiced) {
this.invoiced = invoiced;
}
public Double getIncome() {
return income;
}
public void setIncome(Double income) {
this.income = income;
}
public Double getServiceRate() {
return serviceRate;
}
public void setServiceRate(Double serviceRate) {
this.serviceRate = serviceRate;
}
public Double getServiceFee() {
return serviceFee;
}
public void setServiceFee(Double serviceFee) {
this.serviceFee = serviceFee;
}
public Double getHongbao() {
return hongbao;
}
public void setHongbao(Double hongbao) {
this.hongbao = hongbao;
}
public Double getPackageFee() {
return packageFee;
}
public void setPackageFee(Double packageFee) {
this.packageFee = packageFee;
}
public Double getActivityTotal() {
return activityTotal;
}
public void setActivityTotal(Double activityTotal) {
this.activityTotal = activityTotal;
}
public Double getShopPart() {
return shopPart;
}
public void setShopPart(Double shopPart) {
this.shopPart = shopPart;
}
public Double getElemePart() {
return elemePart;
}
public void setElemePart(Double elemePart) {
this.elemePart = elemePart;
}
public Integer getDowngraded() {
return downgraded;
}
public void setDowngraded(Integer downgraded) {
this.downgraded = downgraded;
}
public List<ElemeOrderDetailGroupEntity> getList() {
return list;
}
public void setList(List<ElemeOrderDetailGroupEntity> list) {
this.list = list;
}
}

@ -0,0 +1,141 @@
package com.jwsaas.controller.waimai;
import java.io.Serializable;
import com.alibaba.fastjson.JSONObject;
public class ElemeOrderDetailGroupEntity implements Serializable {
private static final long serialVersionUID = -6256364576519596920L;
private String orderId;// 订单ID
private String groupName;// 分组名称
private String groupType;// 分组类型
private String specId;// 规格商品Id
private String skuId;// skuId
private String categoryId;// 商品分类Id
private String name;// 售品名称
private Double price;// 售品价格
private Integer quantity;// 售品数量
private Double total;// 总价
public ElemeOrderDetailGroupEntity() {
}
public ElemeOrderDetailGroupEntity(JSONObject jsonObject) {
if (jsonObject.containsKey("id")) {
specId = String.valueOf(jsonObject.getLong("id"));
}
if (jsonObject.containsKey("skuId")) {
skuId = String.valueOf(jsonObject.getLong("skuId"));
}
if (jsonObject.containsKey("categoryId")) {
categoryId = String.valueOf(jsonObject.getLong("categoryId"));
}
if (jsonObject.containsKey("name")) {
name = jsonObject.getString("name");
if(name.length() > 64){
name = name.substring(0,63);
}
}
if (jsonObject.containsKey("price")) {
price = jsonObject.getDouble("price");
}
if (jsonObject.containsKey("total")) {
total = jsonObject.getDouble("total");
}
if (jsonObject.containsKey("quantity")) {
quantity = jsonObject.getInteger("quantity");
}
}
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public String getGroupName() {
return groupName;
}
public void setGroupName(String groupName) {
this.groupName = groupName;
}
public String getGroupType() {
return groupType;
}
public void setGroupType(String groupType) {
this.groupType = groupType;
}
public String getSpecId() {
return specId;
}
public void setSpecId(String specId) {
this.specId = specId;
}
public String getSkuId() {
return skuId;
}
public void setSkuId(String skuId) {
this.skuId = skuId;
}
public String getCategoryId() {
return categoryId;
}
public void setCategoryId(String categoryId) {
this.categoryId = categoryId;
}
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 Integer getQuantity() {
return quantity;
}
public void setQuantity(Integer quantity) {
this.quantity = quantity;
}
public Double getTotal() {
return total;
}
public void setTotal(Double total) {
this.total = total;
}
}

@ -0,0 +1,223 @@
package com.jwsaas.controller.waimai;
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 java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.amqp.rabbit.support.CorrelationData;
import org.springframework.stereotype.Controller;
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.JSONObject;
import com.jwsaas.Global;
import com.jwsaas.condition.Criteria;
import com.jwsaas.condition.Restrictions;
import com.jwsaas.config.MQMessageSender;
import com.jwsaas.controller.BaseController;
import com.jwsaas.entity.food.ElemeOrderDetail;
import com.jwsaas.entity.food.ElemeOrderDetailGroup;
import com.jwsaas.service.food.ElemeOrderDetailGroupService;
import com.jwsaas.service.food.ElemeOrderDetailService;
import com.vdurmont.emoji.EmojiParser;
@Controller(Global.APP_SIGN + "ElemeWaimaiOrderController")
@RequestMapping("/waimai/eleme")
public class ElemeWaimaiOrderController extends BaseController {
@Resource
private ElemeOrderDetailService elemeOrderDetailService;
@Resource
private ElemeOrderDetailGroupService elemeOrderDetailGroupService;
@Resource
private MQMessageSender mqMessageSender;
@RequestMapping(value = "/order", method = { RequestMethod.POST })
@ResponseBody
public Object order(HttpServletRequest request, HttpServletResponse response) {
String info = "饿了么订单推送";
Map<String, Object> result = new HashMap<>();
try {
String tenantId = getParameter(request, "tenantId");// 企业编号
String storeId = getParameter(request, "storeId");// 门店ID
String type = getParameter(request, "type");// 1新增;2修改
String message = getParameter(request, "message");// 消息体
message = EmojiParser.removeAllEmojis(message);
message = filter(message);
logger.error(tenantId);
logger.error(storeId);
logger.error(message);
ElemeOrderDetailEntity entity = new ElemeOrderDetailEntity(JSONObject.parseObject(EmojiParser.removeAllEmojis(message)));
entity.setStoreId(storeId);
// 订单入库
Criteria criteria = new Criteria();
criteria.add(Restrictions.eq("orderId", entity.getOrderId()));
List<ElemeOrderDetail> orderList = elemeOrderDetailService.getList(tenantId, criteria);
if (!CollectionUtils.isEmpty(orderList)) {
ElemeOrderDetail newEntity = orderList.get(0);
newEntity.setStoreId(storeId);
newEntity.setMessage(message);
newEntity.setActiveAt(entity.getActiveAt());
newEntity.setActivityTotal(entity.getActivityTotal());
newEntity.setAddress(entity.getAddress());
newEntity.setConsignee(entity.getConsignee());
newEntity.setCreatedAt(entity.getCreatedAt());
newEntity.setModifyDate(new Date());
newEntity.setModifyUser("open-api");
newEntity.setDaySn(entity.getDaySn());
newEntity.setDeliverFee(entity.getDeliverFee());
newEntity.setDeliverTime(entity.getDeliverTime());
newEntity.setDeliveryGeo(entity.getDeliveryGeo());
newEntity.setDeliveryPoiAddress(entity.getDeliveryPoiAddress());
newEntity.setDescription(entity.getDescription());
newEntity.setDowngraded(entity.getDowngraded());
newEntity.setElemePart(entity.getElemePart());
newEntity.setHongbao(entity.getHongbao());
newEntity.setIncome(entity.getIncome());
newEntity.setInvoice(entity.getInvoice());
newEntity.setInvoiced(entity.getInvoiced());
newEntity.setIsBook(entity.getIsBook());
newEntity.setIsOnlinePaid(entity.getIsOnlinePaid());
newEntity.setOrderId(entity.getOrderId());
newEntity.setOriginalPrice(entity.getOriginalPrice());
newEntity.setPackageFee(entity.getPackageFee());
newEntity.setPhoneList(entity.getPhoneList());
newEntity.setRefundStatus(entity.getRefundStatus());
newEntity.setServiceFee(entity.getServiceFee());
newEntity.setServiceRate(entity.getServiceRate());
newEntity.setShopId(entity.getShopId());
newEntity.setShopName(entity.getShopName());
newEntity.setShopPart(entity.getShopPart());
newEntity.setStatus(entity.getStatus());
newEntity.setStoreId(entity.getStoreId());
newEntity.setTenantId(tenantId);
newEntity.setTotalPrice(entity.getTotalPrice());
newEntity.setUserId(entity.getUserId());
List<ElemeOrderDetailGroup> groupList = new ArrayList<ElemeOrderDetailGroup>();
if (!CollectionUtils.isEmpty(entity.getList())) {
for (ElemeOrderDetailGroupEntity elemeOrderDetailGroupEntity : entity.getList()) {
ElemeOrderDetailGroup groupNew = new ElemeOrderDetailGroup();
groupNew.setCategoryId(elemeOrderDetailGroupEntity.getCategoryId());
groupNew.setCreateDate(new Date());
groupNew.setCreateUser("open-api");
groupNew.setGroupName(elemeOrderDetailGroupEntity.getGroupName());
groupNew.setGroupType(elemeOrderDetailGroupEntity.getGroupType());
groupNew.setName(elemeOrderDetailGroupEntity.getName());
groupNew.setOrderId(elemeOrderDetailGroupEntity.getOrderId());
groupNew.setPrice(elemeOrderDetailGroupEntity.getPrice());
groupNew.setQuantity(elemeOrderDetailGroupEntity.getQuantity());
groupNew.setSpecId(elemeOrderDetailGroupEntity.getSpecId());
groupNew.setSkuId(elemeOrderDetailGroupEntity.getSkuId());
groupNew.setTenantId(tenantId);
groupNew.setTotal(elemeOrderDetailGroupEntity.getTotal());
groupList.add(groupNew);
}
}
if(Global.USEMQ){
// 放入消息队列
Map<String, Object> waimai_message = new HashMap<>();
waimai_message.put("type", "elemeupdate");
waimai_message.put("newEntity", newEntity);
waimai_message.put("groupList", groupList);
CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString());
this.mqMessageSender.send4elemeupdate(tenantId, waimai_message, correlationData);
logger.error("饿了么新订单发布(MQ)成功");
}else{
this.elemeOrderDetailService.updateDetail(tenantId, newEntity, groupList);
}
} else {
ElemeOrderDetail newEntity = new ElemeOrderDetail();
newEntity.setStoreId(storeId);
newEntity.setMessage(message);
newEntity.setActiveAt(entity.getActiveAt());
newEntity.setActivityTotal(entity.getActivityTotal());
newEntity.setAddress(entity.getAddress());
newEntity.setConsignee(entity.getConsignee());
newEntity.setCreatedAt(entity.getCreatedAt());
newEntity.setCreateDate(new Date());
newEntity.setCreateUser("open-api");
newEntity.setDaySn(entity.getDaySn());
newEntity.setDeliverFee(entity.getDeliverFee());
newEntity.setDeliverTime(entity.getDeliverTime());
newEntity.setDeliveryGeo(entity.getDeliveryGeo());
newEntity.setDeliveryPoiAddress(entity.getDeliveryPoiAddress());
newEntity.setDescription(entity.getDescription());
newEntity.setDowngraded(entity.getDowngraded());
newEntity.setElemePart(entity.getElemePart());
newEntity.setHongbao(entity.getHongbao());
newEntity.setIncome(entity.getIncome());
newEntity.setInvoice(entity.getInvoice());
newEntity.setInvoiced(entity.getInvoiced());
newEntity.setIsBook(entity.getIsBook());
newEntity.setIsOnlinePaid(entity.getIsOnlinePaid());
newEntity.setOrderId(entity.getOrderId());
newEntity.setOriginalPrice(entity.getOriginalPrice());
newEntity.setPackageFee(entity.getPackageFee());
newEntity.setPhoneList(entity.getPhoneList());
newEntity.setRefundStatus(entity.getRefundStatus());
newEntity.setServiceFee(entity.getServiceFee());
newEntity.setServiceRate(entity.getServiceRate());
newEntity.setShopId(entity.getShopId());
newEntity.setShopName(entity.getShopName());
newEntity.setShopPart(entity.getShopPart());
newEntity.setStatus(entity.getStatus());
newEntity.setStoreId(entity.getStoreId());
newEntity.setTenantId(tenantId);
newEntity.setTotalPrice(entity.getTotalPrice());
newEntity.setUserId(entity.getUserId());
List<ElemeOrderDetailGroup> groupList = new ArrayList<ElemeOrderDetailGroup>();
if (!CollectionUtils.isEmpty(entity.getList())) {
for (ElemeOrderDetailGroupEntity elemeOrderDetailGroupEntity : entity.getList()) {
ElemeOrderDetailGroup groupNew = new ElemeOrderDetailGroup();
groupNew.setCategoryId(elemeOrderDetailGroupEntity.getCategoryId());
groupNew.setCreateDate(new Date());
groupNew.setCreateUser("open-api");
groupNew.setGroupName(elemeOrderDetailGroupEntity.getGroupName());
groupNew.setGroupType(elemeOrderDetailGroupEntity.getGroupType());
groupNew.setName(elemeOrderDetailGroupEntity.getName());
groupNew.setOrderId(elemeOrderDetailGroupEntity.getOrderId());
groupNew.setPrice(elemeOrderDetailGroupEntity.getPrice());
groupNew.setQuantity(elemeOrderDetailGroupEntity.getQuantity());
groupNew.setSpecId(elemeOrderDetailGroupEntity.getSpecId());
groupNew.setSkuId(elemeOrderDetailGroupEntity.getSkuId());
groupNew.setTenantId(tenantId);
groupNew.setTotal(elemeOrderDetailGroupEntity.getTotal());
groupList.add(groupNew);
}
}
if(Global.USEMQ){
// 放入消息队列
Map<String, Object> waimai_message = new HashMap<>();
waimai_message.put("type", "elemecreate");
waimai_message.put("newEntity", newEntity);
waimai_message.put("groupList", groupList);
CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString());
this.mqMessageSender.send4elemecreate(tenantId, waimai_message, correlationData);
logger.error("饿了么新订单更新发布(MQ)成功");
}else{
this.elemeOrderDetailService.saveDetail(tenantId, newEntity, groupList);
}
}
logger.error("饿了么订单推送:", message);
result.put("status", "success");
} catch (Exception e) {
logger.error("饿了么订单推送:", e);
result.put("status", "error");
}
return result;
}
}

@ -0,0 +1,349 @@
package com.jwsaas.controller.waimai;
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 javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.amqp.rabbit.support.CorrelationData;
import org.springframework.stereotype.Controller;
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.JSONObject;
import com.jwsaas.Global;
import com.jwsaas.condition.Criteria;
import com.jwsaas.condition.Restrictions;
import com.jwsaas.config.MQMessageSender;
import com.jwsaas.controller.BaseController;
import com.jwsaas.entity.food.MeituanOrder;
import com.jwsaas.entity.food.MeituanOrderExtra;
import com.jwsaas.entity.food.MeituanOrderItem;
import com.jwsaas.service.food.MeituanOrderExtraService;
import com.jwsaas.service.food.MeituanOrderItemService;
import com.jwsaas.service.food.MeituanOrderService;
import com.jwsaas.utils.DateUtils;
import com.vdurmont.emoji.EmojiParser;
@Controller(Global.APP_SIGN + "MeiTuanOrderController")
@RequestMapping("/waimai/meituan")
public class MeiTuanOrderController extends BaseController {
@Resource
protected MeituanOrderService meituanOrderService;
@Resource
protected MeituanOrderItemService meituanOrderItemService;
@Resource
protected MeituanOrderExtraService meituanOrderExtraService;
@Resource
private MQMessageSender mqMessageSender;
@RequestMapping(value = "/order", method = { RequestMethod.POST })
@ResponseBody
public Object order(HttpServletRequest request, HttpServletResponse response) {
String info = "美团订单推送";
Map<String, Object> result = new HashMap<>();
String tenantId = getParameter(request, "tenantId");// 企业编号
String storeId = getParameter(request, "storeId");// 门店ID
String message = getParameter(request, "message");// 消息体
message = EmojiParser.removeAllEmojis(message);
message = filter(message);
String reasonCode = getParameter(request, "reasonCode");// 订单取消CODE
String reason = getParameter(request, "reason");// 取消原因
String refundReasonCode = getParameter(request, "refundReasonCode");// 退单CODE
String refundReason = getParameter(request, "refundReason");// 退单原因
String shipTime = getParameter(request, "shipTime");// 配送时间
String shippingStatus = getParameter(request, "shippingStatus");// 配送状态
String dispatcherMobile = getParameter(request, "dispatcherMobile");// 骑手电话
String dispatcherName = getParameter(request, "dispatcherName");// 骑手名称
String pickType = getParameter(request, "pickType");// 取餐类型
String status = null;
logger.error(tenantId);
logger.error(storeId);
logger.error(message);
try {
MeituanOrderEntity entity = new MeituanOrderEntity(JSONObject.parseObject(message));
entity.setStoreId(storeId);
entity.setMessage(message);
// 订单入库
Criteria criteria = new Criteria();
criteria.add(Restrictions.eq("orderId", entity.getOrderId()));
List<MeituanOrder> orderList = meituanOrderService.getList(tenantId, criteria);
if (!CollectionUtils.isEmpty(orderList)) {
MeituanOrder newEntity = orderList.get(0);
if (reason != null && !"".equals(reason)) {
newEntity.setCancelReason(reason);
}
if (reasonCode != null && !"".equals(reasonCode)) {
newEntity.setCancelReasonCode(reasonCode);
}
newEntity.setCaution(entity.getCaution());
newEntity.setCityId(entity.getCityId());
newEntity.setCreateDate(new Date());
newEntity.setCreateUser("open-api");
newEntity.setCTime(entity.getcTime());
newEntity.setDaySeq(entity.getDaySeq());
newEntity.setDeliveryTime(entity.getDeliveryTime());
newEntity.setDetail(entity.getDetail());
newEntity.setDinnersNumber(entity.getDinnersNumber());
newEntity.setExtras(entity.getExtras());
newEntity.setHasInvoiced(entity.getHasInvoiced());
newEntity.setInvoiceTitle(entity.getInvoiceTitle());
newEntity.setIsPre(entity.getIsPre());
newEntity.setIsThirdShipping(entity.getIsThirdShipping());
newEntity.setLatitude(entity.getLatitude());
if (dispatcherMobile != null && !"".equals(dispatcherMobile)) {
newEntity.setLogisticsDispatcherMobile(dispatcherMobile);
}
if (dispatcherName != null && !"".equals(dispatcherName)) {
newEntity.setLogisticsDispatcherName(dispatcherName);
}
if (shippingStatus != null && !"".equals(shippingStatus)) {
String shipDateTime = DateUtils.format(new Date(Long.parseLong(shipTime) * 1000), DateUtils.SHOW_DATETIME_FORMAT);
switch (shippingStatus) {
case "0":
// 配送单发往配送
// 配送单下单时间
newEntity.setLogisticsSendTime(shipDateTime);
break;
case "10":
// 配送单已确认
newEntity.setLogisticsConfirmTime(shipDateTime);
break;
case "20":
// 骑手已取餐
newEntity.setLogisticsFetchTime(shipDateTime);
break;
case "40":
// 骑手已送达
newEntity.setLogisticsCompletedTime(shipDateTime);
break;
case "100":
// 配送单已取消
break;
default:
break;
}
}
newEntity.setLogisticsCode(entity.getLogisticsCode());
newEntity.setLogisticsId(entity.getLogisticsId());
newEntity.setLogisticsName(entity.getLogisticsName());
if (shippingStatus != null && !"".equals(shippingStatus)) {
newEntity.setLogisticsStatus(shippingStatus);
}
newEntity.setLongitude(entity.getLongitude());
newEntity.setMessage(message);
newEntity.setOrderCancelTime(entity.getOrderCancelTime());
newEntity.setOrderCompletedTime(entity.getOrderCompletedTime());
newEntity.setOrderConfirmTime(entity.getOrderConfirmTime());
newEntity.setOrderId(entity.getOrderId());
newEntity.setOrderIdView(entity.getOrderIdView());
newEntity.setOrderSendTime(entity.getOrderSendTime());
newEntity.setOriginalPrice(entity.getOriginalPrice());
newEntity.setPayType(entity.getPayType());
newEntity.setPoiAddress(entity.getPoiAddress());
newEntity.setPoiId(entity.getPoiId());
newEntity.setPoiName(entity.getPoiName());
newEntity.setPoiPhone(entity.getPoiPhone());
newEntity.setPoiReceiveDetail(entity.getPoiReceiveDetail());
newEntity.setRecipientAddress(entity.getRecipientAddress());
newEntity.setRecipientName(entity.getRecipientName());
newEntity.setRecipientPhone(entity.getRecipientPhone());
if (refundReason != null && !"".equals(refundReason)) {
newEntity.setRefundReason(refundReason);
}
if (refundReasonCode != null && !"".equals(refundReasonCode)) {
newEntity.setRefundReasonCode(refundReasonCode);
}
if (dispatcherMobile != null && !"".equals(dispatcherMobile)) {
newEntity.setShipperPhone(dispatcherMobile);
}
newEntity.setStatus(entity.getStatus());
newEntity.setStoreId(storeId);
newEntity.setTenantId(tenantId);
newEntity.setTotal(entity.getTotal());
newEntity.setUTime(entity.getuTime());
newEntity.setFoodShareFeeChargeByPoi(entity.getFoodShareFeeChargeByPoi());
newEntity.setWmPoiReceiveCent(entity.getWmPoiReceiveCent());
status = String.valueOf(newEntity.getStatus());
if (Global.USEMQ) {
// 放入消息队列
Map<String, Object> waimai_message = new HashMap<>();
waimai_message.put("type", "meituanupdate");
waimai_message.put("newEntity", newEntity);
CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString());
this.mqMessageSender.send4meituanupdate(tenantId, waimai_message, correlationData);
} else {
this.meituanOrderService.update(tenantId, newEntity);
}
} else {
MeituanOrder newEntity = new MeituanOrder();
if (reason != null && !"".equals(reason)) {
newEntity.setCancelReason(reason);
}
if (reasonCode != null && !"".equals(reasonCode)) {
newEntity.setCancelReasonCode(reasonCode);
}
newEntity.setCaution(entity.getCaution());
newEntity.setCityId(entity.getCityId());
newEntity.setCreateDate(new Date());
newEntity.setCreateUser("open-api");
newEntity.setCTime(entity.getcTime());
newEntity.setDaySeq(entity.getDaySeq());
newEntity.setDeliveryTime(entity.getDeliveryTime());
newEntity.setDetail(entity.getDetail());
newEntity.setDinnersNumber(entity.getDinnersNumber());
newEntity.setExtras(entity.getExtras());
newEntity.setHasInvoiced(entity.getHasInvoiced());
newEntity.setInvoiceTitle(entity.getInvoiceTitle());
newEntity.setIsPre(entity.getIsPre());
newEntity.setIsThirdShipping(entity.getIsThirdShipping());
newEntity.setLatitude(entity.getLatitude());
if (dispatcherMobile != null && !"".equals(dispatcherMobile)) {
newEntity.setLogisticsDispatcherMobile(dispatcherMobile);
}
if (dispatcherName != null && !"".equals(dispatcherName)) {
newEntity.setLogisticsDispatcherName(dispatcherName);
}
if (shippingStatus != null && !"".equals(shippingStatus)) {
String shipDateTime = DateUtils.format(new Date(Long.parseLong(shipTime) * 1000), DateUtils.SHOW_DATETIME_FORMAT);
switch (shippingStatus) {
case "0":
// 配送单发往配送
// 配送单下单时间
newEntity.setLogisticsSendTime(shipDateTime);
break;
case "10":
// 配送单已确认
newEntity.setLogisticsConfirmTime(shipDateTime);
break;
case "20":
// 骑手已取餐
newEntity.setLogisticsFetchTime(shipDateTime);
break;
case "40":
// 骑手已送达
newEntity.setLogisticsCompletedTime(shipDateTime);
break;
case "100":
// 配送单已取消
break;
default:
break;
}
}
newEntity.setLogisticsCode(entity.getLogisticsCode());
newEntity.setLogisticsId(entity.getLogisticsId());
newEntity.setLogisticsName(entity.getLogisticsName());
if (shippingStatus != null && !"".equals(shippingStatus)) {
newEntity.setLogisticsStatus(shippingStatus);
}
newEntity.setLongitude(entity.getLongitude());
newEntity.setMessage(message);
newEntity.setOrderCancelTime(entity.getOrderCancelTime());
newEntity.setOrderCompletedTime(entity.getOrderCompletedTime());
newEntity.setOrderConfirmTime(entity.getOrderConfirmTime());
newEntity.setOrderId(entity.getOrderId());
newEntity.setOrderIdView(entity.getOrderIdView());
newEntity.setOrderSendTime(entity.getOrderSendTime());
newEntity.setOriginalPrice(entity.getOriginalPrice());
newEntity.setPayType(entity.getPayType());
newEntity.setPoiAddress(entity.getPoiAddress());
newEntity.setPoiId(entity.getPoiId());
newEntity.setPoiName(entity.getPoiName());
newEntity.setPoiPhone(entity.getPoiPhone());
newEntity.setPoiReceiveDetail(entity.getPoiReceiveDetail());
newEntity.setRecipientAddress(entity.getRecipientAddress());
newEntity.setRecipientName(entity.getRecipientName());
newEntity.setRecipientPhone(entity.getRecipientPhone());
newEntity.setShippingFee(entity.getShippingFee());
if (refundReason != null && !"".equals(refundReason)) {
newEntity.setRefundReason(refundReason);
}
if (refundReasonCode != null && !"".equals(refundReasonCode)) {
newEntity.setRefundReasonCode(refundReasonCode);
}
if (dispatcherMobile != null && !"".equals(dispatcherMobile)) {
newEntity.setShipperPhone(dispatcherMobile);
}
newEntity.setStatus(entity.getStatus());
newEntity.setStoreId(storeId);
newEntity.setTenantId(tenantId);
newEntity.setTotal(entity.getTotal());
newEntity.setUTime(entity.getuTime());
newEntity.setFoodShareFeeChargeByPoi(entity.getFoodShareFeeChargeByPoi());
newEntity.setWmPoiReceiveCent(entity.getWmPoiReceiveCent());
List<MeituanOrderItem> itemList = new ArrayList<>();
for (MeituanOrderItemEntity meituanOrderItemEntity : entity.getOrderItemList()) {
MeituanOrderItem item = new MeituanOrderItem();
item.setBoxNum(meituanOrderItemEntity.getBoxNum());
item.setBoxPrice(meituanOrderItemEntity.getBoxPrice());
item.setCreateDate(new Date());
item.setCreateUser("open-api");
item.setDiscount(meituanOrderItemEntity.getDiscount());
item.setDishName(meituanOrderItemEntity.getDishName());
item.setEDishCode(meituanOrderItemEntity.geteDishCode());
item.setOrderId(entity.getOrderId());
item.setPrice(meituanOrderItemEntity.getPrice());
item.setProperty(meituanOrderItemEntity.getProperty());
item.setQuantity(meituanOrderItemEntity.getQuantity());
item.setSkuId(meituanOrderItemEntity.getSkuId());
item.setSpec(meituanOrderItemEntity.getSpec());
item.setTenantId(tenantId);
item.setUnit(meituanOrderItemEntity.getUnit());
itemList.add(item);
}
List<MeituanOrderExtra> extraList = new ArrayList<>();
for (MeituanOrderExtraEntity meituanOrderExtraEntity : entity.getOrderExtraList()) {
MeituanOrderExtra extra = new MeituanOrderExtra();
extra.setActDetailId(meituanOrderExtraEntity.getActDetailId());
extra.setAvgSendTime(meituanOrderExtraEntity.getAvgSendTime());
extra.setCreateDate(new Date());
extra.setCreateUser("open-api");
extra.setMtCharge(meituanOrderExtraEntity.getMtCharge());
extra.setOrderId(entity.getOrderId());
extra.setPoiCharge(meituanOrderExtraEntity.getPoiCharge());
extra.setReduceFee(meituanOrderExtraEntity.getReduceFee());
extra.setRemark(meituanOrderExtraEntity.getRemark());
extra.setTenantId(tenantId);
extra.setType(meituanOrderExtraEntity.getType());
extraList.add(extra);
}
if (pickType != null) {
newEntity.setPickType(Integer.parseInt(pickType));
}
status = String.valueOf(newEntity.getStatus());
if (Global.USEMQ) {
// 放入消息队列
Map<String, Object> waimai_message = new HashMap<>();
waimai_message.put("type", "meituancreate");
waimai_message.put("newEntity", newEntity);
waimai_message.put("itemList", itemList);
waimai_message.put("extraList", extraList);
CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString());
this.mqMessageSender.send4meituancreate(tenantId, waimai_message, correlationData);
} else {
this.meituanOrderService.saveOrder(tenantId, newEntity, itemList, extraList);
}
}
result.put("info", "success");
result.put("status", status);
result.put("refundReasonCode", refundReasonCode);
} catch (Exception e) {
logger.error(info, e);
result.put("status", "error");
}
return result;
}
}

@ -0,0 +1,752 @@
package com.jwsaas.controller.waimai;
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.jwsaas.utils.DateUtils;
public class MeituanOrderEntity implements Serializable {
private static final long serialVersionUID = -975253547225858225L;
private String message;// 消息
private String storeId;// erp方门店id
private String orderId;// 订单ID
private String cTime;// 订单创建时间
private String caution;// 订单备注
private String deliveryTime;// 用户预计送达时间
private String detail;// 订单菜品详情
private String cityId;// 城市Id
private String extras;// 订单扩展信息
private Integer hasInvoiced;// 是否需要发票
private String invoiceTitle;// 发票抬头
private Integer isPre;// 是否是预定单
private Integer isThirdShipping;// 是否第三方配送
private Double latitude;// 实际送餐地址纬度
private Double longitude;// 实际送餐地址经度
private String poiReceiveDetail;// 商家对账信息
private String logisticsCode;// 配送类型码
private String logisticsCompletedTime;// 配送完成时间
private String logisticsConfirmTime;// 配送单确认时间
private String logisticsDispatcherMobile;// 骑手电话
private String logisticsDispatcherName;// 骑手姓名
private String logisticsFetchTime;// 骑手取单时间
private String logisticsId;// 配送方ID
private String logisticsName;// 配送方名称
private String logisticsSendTime;// 配送单下单时间
private String logisticsStatus;// 配送订单状态code
private String orderCompletedTime;// 订单完成时间
private String orderConfirmTime;// 商户确认时间
private String orderCancelTime;// 订单取消时间
private String orderIdView;// 订单展示Id
private String orderSendTime;// 用户下单时间
private Double originalPrice;// 订单原价
private Integer payType;// 订单支付类型
private String poiAddress;// 门店地址
private String poiId;// 门店Id
private String poiName;// 门店名称
private String poiPhone;// 门店服务电话
private String recipientAddress;// 收货人地址
private String recipientName;// 收货人名称
private String recipientPhone;// 收货人电话
private String backupRecipientPhone;//备份隐私号
private String shipperPhone;// 配送骑手电话
private Double shippingFee;// 配送费用
private Integer status;// 订单状态
private Double total;// 总价
private String uTime;// 订单更新时间
private Integer daySeq;// 门店当天的订单流水号
private Integer dinnersNumber;// 就餐人数
private String cancelReason;// 订单取消原因
private String cancelReasonCode;// 订单取消code
private String refundReason;// 订单退款原因
private String refundReasonCode;// 订单退款code
private Double foodShareFeeChargeByPoi;// 菜品分成(分)
private Double wmPoiReceiveCent;// 商家应收款(分)
List<MeituanOrderItemEntity> orderItemList;
List<MeituanOrderExtraEntity> orderExtraList;
public MeituanOrderEntity() {
}
public MeituanOrderEntity(JSONObject jsonObject) {
if (jsonObject.containsKey("cTime")) {
cTime = DateUtils.format(new Date(jsonObject.getLong("cTime") * 1000), DateUtils.SHOW_DATETIME_FORMAT);
}
if (jsonObject.containsKey("caution")) {
caution = jsonObject.getString("caution");
}
if (jsonObject.containsKey("deliveryTime")) {
deliveryTime = jsonObject.getLong("deliveryTime") == null ? null : DateUtils.format(new Date(jsonObject.getLong("deliveryTime") * 1000), DateUtils.SHOW_DATETIME_FORMAT);
}
if (jsonObject.containsKey("cityId")) {
cityId = String.valueOf(jsonObject.getLong("cityId"));
}
if (jsonObject.containsKey("hasInvoiced")) {
hasInvoiced = jsonObject.getInteger("hasInvoiced");
}
if (jsonObject.containsKey("invoiceTitle")) {
invoiceTitle = jsonObject.getString("invoiceTitle");
}
if (jsonObject.containsKey("isPre")) {
isPre = jsonObject.getInteger("isPre");
}
if (jsonObject.containsKey("isThirdShipping")) {
isThirdShipping = jsonObject.getInteger("isThirdShipping");
}
if (jsonObject.containsKey("latitude")) {
latitude = jsonObject.getDouble("latitude");
}
if (jsonObject.containsKey("longitude")) {
longitude = jsonObject.getDouble("longitude");
}
if (jsonObject.containsKey("logisticsCode")) {
logisticsCode = jsonObject.getString("logisticsCode");
}
if (jsonObject.containsKey("logisticsCompletedTime")) {
logisticsCompletedTime = jsonObject.getLong("logisticsCompletedTime") == null ? null
: DateUtils.format(new Date(jsonObject.getLong("logisticsCompletedTime") * 1000), DateUtils.SHOW_DATETIME_FORMAT);
}
if (jsonObject.containsKey("logisticsConfirmTime")) {
logisticsConfirmTime = jsonObject.getLong("logisticsConfirmTime") == null ? null
: DateUtils.format(new Date(jsonObject.getLong("logisticsConfirmTime") * 1000), DateUtils.SHOW_DATETIME_FORMAT);
}
if (jsonObject.containsKey("logisticsDispatcherMobile")) {
logisticsDispatcherMobile = jsonObject.getString("logisticsDispatcherMobile");
}
if (jsonObject.containsKey("logisticsDispatcherName")) {
logisticsDispatcherName = jsonObject.getString("logisticsDispatcherName");
}
if (jsonObject.containsKey("logisticsFetchTime")) {
logisticsFetchTime = jsonObject.getLong("logisticsFetchTime") == null ? null : DateUtils.format(new Date(jsonObject.getLong("logisticsFetchTime") * 1000), DateUtils.SHOW_DATETIME_FORMAT);
}
if (jsonObject.containsKey("logisticsId")) {
logisticsId = jsonObject.getString("logisticsId");
}
if (jsonObject.containsKey("logisticsName")) {
logisticsName = jsonObject.getString("logisticsName");
}
if (jsonObject.containsKey("logisticsSendTime")) {
logisticsSendTime = jsonObject.getLong("logisticsSendTime") == null ? null : DateUtils.format(new Date(jsonObject.getLong("logisticsSendTime") * 1000), DateUtils.SHOW_DATETIME_FORMAT);
}
if (jsonObject.containsKey("logisticsStatus")) {
logisticsStatus = jsonObject.getString("logisticsStatus");
}
if (jsonObject.containsKey("orderCompletedTime")) {
orderCompletedTime = jsonObject.getLong("orderCompletedTime") == null ? null : DateUtils.format(new Date(jsonObject.getLong("orderCompletedTime") * 1000), DateUtils.SHOW_DATETIME_FORMAT);
}
if (jsonObject.containsKey("orderConfirmTime")) {
orderConfirmTime = jsonObject.getLong("orderConfirmTime") == null ? null : DateUtils.format(new Date(jsonObject.getLong("orderConfirmTime") * 1000), DateUtils.SHOW_DATETIME_FORMAT);
}
if (jsonObject.containsKey("orderCancelTime")) {
orderCancelTime = jsonObject.getLong("orderCancelTime") == null ? null : DateUtils.format(new Date(jsonObject.getLong("orderCancelTime") * 1000), DateUtils.SHOW_DATETIME_FORMAT);
}
if (jsonObject.containsKey("orderId")) {
orderId = String.valueOf(jsonObject.getLong("orderId"));
}
if (jsonObject.containsKey("orderIdView")) {
orderIdView = String.valueOf(jsonObject.getLong("orderIdView"));
}
if (jsonObject.containsKey("orderSendTime")) {
orderSendTime = jsonObject.getLong("orderSendTime") == null ? null : DateUtils.format(new Date(jsonObject.getLong("orderSendTime") * 1000), DateUtils.SHOW_DATETIME_FORMAT);
}
if (jsonObject.containsKey("originalPrice")) {
originalPrice = jsonObject.getDouble("originalPrice");
}
if (jsonObject.containsKey("payType")) {
payType = jsonObject.getInteger("payType");
}
if (jsonObject.containsKey("poiAddress")) {
poiAddress = jsonObject.getString("poiAddress");
}
if (jsonObject.containsKey("poiId")) {
poiId = String.valueOf(jsonObject.getLong("poiId"));
}
if (jsonObject.containsKey("poiName")) {
poiName = jsonObject.getString("poiName");
}
if (jsonObject.containsKey("poiPhone")) {
poiPhone = jsonObject.getString("poiPhone");
}
if (jsonObject.containsKey("recipientAddress")) {
recipientAddress = jsonObject.getString("recipientAddress");
}
if (jsonObject.containsKey("recipientName")) {
recipientName = jsonObject.getString("recipientName");
}
if (jsonObject.containsKey("recipientPhone")) {
recipientPhone = jsonObject.getString("recipientPhone");
}
if (jsonObject.containsKey("backupRecipientPhone")) {
backupRecipientPhone = jsonObject.getString("backupRecipientPhone");
}
if (jsonObject.containsKey("shipperPhone")) {
shipperPhone = jsonObject.getString("shipperPhone");
}
if (jsonObject.containsKey("shippingFee")) {
shippingFee = jsonObject.getDouble("shippingFee");
}
if (jsonObject.containsKey("status")) {
status = jsonObject.getInteger("status");
}
if (jsonObject.containsKey("total")) {
total = jsonObject.getDouble("total");
}
if (jsonObject.containsKey("uTime")) {
uTime = jsonObject.getLong("uTime") == null ? null : DateUtils.format(new Date(jsonObject.getLong("uTime") * 1000), DateUtils.SHOW_DATETIME_FORMAT);
}
if (jsonObject.containsKey("daySeq")) {
daySeq = jsonObject.getInteger("daySeq");
}
if (jsonObject.containsKey("dinnersNumber")) {
dinnersNumber = jsonObject.getInteger("dinnersNumber");
}
if (jsonObject.containsKey("poiReceiveDetail")) {
poiReceiveDetail = jsonObject.getString("poiReceiveDetail");
JSONObject poiReceiveObject = JSONArray.parseObject(poiReceiveDetail);
if (poiReceiveObject.containsKey("foodShareFeeChargeByPoi")) {
foodShareFeeChargeByPoi = poiReceiveObject.getDouble("foodShareFeeChargeByPoi");
}
if (poiReceiveObject.containsKey("wmPoiReceiveCent")) {
wmPoiReceiveCent = poiReceiveObject.getDouble("wmPoiReceiveCent");
}
}
if (jsonObject.containsKey("detail")) {
orderItemList = new ArrayList<>();
detail = jsonObject.getString("detail");
JSONArray detailArray = JSONArray.parseArray(detail);
for (int i = 0; i < detailArray.size(); i++) {
JSONObject detailObject = detailArray.getJSONObject(i);
MeituanOrderItemEntity orderItem = new MeituanOrderItemEntity(detailObject);
orderItem.setOrderId(orderId);
orderItemList.add(orderItem);
}
}
if (jsonObject.containsKey("extras")) {
orderExtraList = new ArrayList<>();
extras = jsonObject.getString("extras");
JSONArray extrasArray = JSONArray.parseArray(extras);
for (int i = 0; i < extrasArray.size(); i++) {
JSONObject extrasObject = extrasArray.getJSONObject(i);
MeituanOrderExtraEntity orderExtra = new MeituanOrderExtraEntity(extrasObject);
orderExtra.setOrderId(orderId);
orderExtraList.add(orderExtra);
}
}
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
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 getcTime() {
return cTime;
}
public void setcTime(String cTime) {
this.cTime = cTime;
}
public String getCaution() {
return caution;
}
public void setCaution(String caution) {
this.caution = caution;
}
public String getDeliveryTime() {
return deliveryTime;
}
public void setDeliveryTime(String deliveryTime) {
this.deliveryTime = deliveryTime;
}
public String getDetail() {
return detail;
}
public void setDetail(String detail) {
this.detail = detail;
}
public String getCityId() {
return cityId;
}
public void setCityId(String cityId) {
this.cityId = cityId;
}
public String getExtras() {
return extras;
}
public void setExtras(String extras) {
this.extras = extras;
}
public Integer getHasInvoiced() {
return hasInvoiced;
}
public void setHasInvoiced(Integer hasInvoiced) {
this.hasInvoiced = hasInvoiced;
}
public String getInvoiceTitle() {
return invoiceTitle;
}
public void setInvoiceTitle(String invoiceTitle) {
this.invoiceTitle = invoiceTitle;
}
public Integer getIsPre() {
return isPre;
}
public void setIsPre(Integer isPre) {
this.isPre = isPre;
}
public Integer getIsThirdShipping() {
return isThirdShipping;
}
public void setIsThirdShipping(Integer isThirdShipping) {
this.isThirdShipping = isThirdShipping;
}
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 String getPoiReceiveDetail() {
return poiReceiveDetail;
}
public void setPoiReceiveDetail(String poiReceiveDetail) {
this.poiReceiveDetail = poiReceiveDetail;
}
public String getLogisticsCode() {
return logisticsCode;
}
public void setLogisticsCode(String logisticsCode) {
this.logisticsCode = logisticsCode;
}
public String getLogisticsCompletedTime() {
return logisticsCompletedTime;
}
public void setLogisticsCompletedTime(String logisticsCompletedTime) {
this.logisticsCompletedTime = logisticsCompletedTime;
}
public String getLogisticsConfirmTime() {
return logisticsConfirmTime;
}
public void setLogisticsConfirmTime(String logisticsConfirmTime) {
this.logisticsConfirmTime = logisticsConfirmTime;
}
public String getLogisticsDispatcherMobile() {
return logisticsDispatcherMobile;
}
public void setLogisticsDispatcherMobile(String logisticsDispatcherMobile) {
this.logisticsDispatcherMobile = logisticsDispatcherMobile;
}
public String getLogisticsDispatcherName() {
return logisticsDispatcherName;
}
public void setLogisticsDispatcherName(String logisticsDispatcherName) {
this.logisticsDispatcherName = logisticsDispatcherName;
}
public String getLogisticsFetchTime() {
return logisticsFetchTime;
}
public void setLogisticsFetchTime(String logisticsFetchTime) {
this.logisticsFetchTime = logisticsFetchTime;
}
public String getLogisticsId() {
return logisticsId;
}
public void setLogisticsId(String logisticsId) {
this.logisticsId = logisticsId;
}
public String getLogisticsName() {
return logisticsName;
}
public void setLogisticsName(String logisticsName) {
this.logisticsName = logisticsName;
}
public String getLogisticsSendTime() {
return logisticsSendTime;
}
public void setLogisticsSendTime(String logisticsSendTime) {
this.logisticsSendTime = logisticsSendTime;
}
public String getLogisticsStatus() {
return logisticsStatus;
}
public void setLogisticsStatus(String logisticsStatus) {
this.logisticsStatus = logisticsStatus;
}
public String getOrderCompletedTime() {
return orderCompletedTime;
}
public void setOrderCompletedTime(String orderCompletedTime) {
this.orderCompletedTime = orderCompletedTime;
}
public String getOrderConfirmTime() {
return orderConfirmTime;
}
public void setOrderConfirmTime(String orderConfirmTime) {
this.orderConfirmTime = orderConfirmTime;
}
public String getOrderCancelTime() {
return orderCancelTime;
}
public void setOrderCancelTime(String orderCancelTime) {
this.orderCancelTime = orderCancelTime;
}
public String getOrderIdView() {
return orderIdView;
}
public void setOrderIdView(String orderIdView) {
this.orderIdView = orderIdView;
}
public String getOrderSendTime() {
return orderSendTime;
}
public void setOrderSendTime(String orderSendTime) {
this.orderSendTime = orderSendTime;
}
public Double getOriginalPrice() {
return originalPrice;
}
public void setOriginalPrice(Double originalPrice) {
this.originalPrice = originalPrice;
}
public Integer getPayType() {
return payType;
}
public void setPayType(Integer payType) {
this.payType = payType;
}
public String getPoiAddress() {
return poiAddress;
}
public void setPoiAddress(String poiAddress) {
this.poiAddress = poiAddress;
}
public String getPoiId() {
return poiId;
}
public void setPoiId(String poiId) {
this.poiId = poiId;
}
public String getPoiName() {
return poiName;
}
public void setPoiName(String poiName) {
this.poiName = poiName;
}
public String getPoiPhone() {
return poiPhone;
}
public void setPoiPhone(String poiPhone) {
this.poiPhone = poiPhone;
}
public String getRecipientAddress() {
return recipientAddress;
}
public void setRecipientAddress(String recipientAddress) {
this.recipientAddress = recipientAddress;
}
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 getBackupRecipientPhone() {
return backupRecipientPhone;
}
public void setBackupRecipientPhone(String backupRecipientPhone) {
this.backupRecipientPhone = backupRecipientPhone;
}
public String getShipperPhone() {
return shipperPhone;
}
public void setShipperPhone(String shipperPhone) {
this.shipperPhone = shipperPhone;
}
public Double getShippingFee() {
return shippingFee;
}
public void setShippingFee(Double shippingFee) {
this.shippingFee = shippingFee;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Double getTotal() {
return total;
}
public void setTotal(Double total) {
this.total = total;
}
public String getuTime() {
return uTime;
}
public void setuTime(String uTime) {
this.uTime = uTime;
}
public Integer getDaySeq() {
return daySeq;
}
public void setDaySeq(Integer daySeq) {
this.daySeq = daySeq;
}
public Integer getDinnersNumber() {
return dinnersNumber;
}
public void setDinnersNumber(Integer dinnersNumber) {
this.dinnersNumber = dinnersNumber;
}
public String getCancelReason() {
return cancelReason;
}
public void setCancelReason(String cancelReason) {
this.cancelReason = cancelReason;
}
public String getCancelReasonCode() {
return cancelReasonCode;
}
public void setCancelReasonCode(String cancelReasonCode) {
this.cancelReasonCode = cancelReasonCode;
}
public String getRefundReason() {
return refundReason;
}
public void setRefundReason(String refundReason) {
this.refundReason = refundReason;
}
public String getRefundReasonCode() {
return refundReasonCode;
}
public void setRefundReasonCode(String refundReasonCode) {
this.refundReasonCode = refundReasonCode;
}
public Double getFoodShareFeeChargeByPoi() {
return foodShareFeeChargeByPoi;
}
public void setFoodShareFeeChargeByPoi(Double foodShareFeeChargeByPoi) {
this.foodShareFeeChargeByPoi = foodShareFeeChargeByPoi;
}
public Double getWmPoiReceiveCent() {
return wmPoiReceiveCent;
}
public void setWmPoiReceiveCent(Double wmPoiReceiveCent) {
this.wmPoiReceiveCent = wmPoiReceiveCent;
}
public List<MeituanOrderItemEntity> getOrderItemList() {
return orderItemList;
}
public void setOrderItemList(List<MeituanOrderItemEntity> orderItemList) {
this.orderItemList = orderItemList;
}
public List<MeituanOrderExtraEntity> getOrderExtraList() {
return orderExtraList;
}
public void setOrderExtraList(List<MeituanOrderExtraEntity> orderExtraList) {
this.orderExtraList = orderExtraList;
}
public static void main(String[] args) {
JSONObject jsonObject = JSONObject.parseObject("{\"actOrderChargeByMt\":[{\"comment\":\"活动款\",\"feeTypeDesc\":\"活动款\",\"feeTypeId\":10019,\"moneyCent\":0}],\"actOrderChargeByPoi\":[],\"foodShareFeeChargeByPoi\":308,\"logisticsFee\":300,\"onlinePayment\":2350,\"wmPoiReceiveCent\":1742}");
System.out.println("========>"+jsonObject.getDouble("foodShareFeeChargeByPoi"));
System.out.println("========>"+jsonObject.getDouble("wmPoiReceiveCent"));
}
}

@ -0,0 +1,113 @@
package com.jwsaas.controller.waimai;
import java.io.Serializable;
import com.alibaba.fastjson.JSONObject;
public class MeituanOrderExtraEntity implements Serializable {
private static final long serialVersionUID = -5656137756648724626L;
private String orderId;// 订单ID
private Double mtCharge;// 优惠金额中美团承担的部分
private Double poiCharge;// 优惠金额中商家承担的部分
private Double reduceFee;// 活动优惠总金额
private String remark;// 优惠说明
private Integer type;// 活动类型
private String actDetailId;// 活动ID
private Double avgSendTime;// 餐厅平均送餐时间
public MeituanOrderExtraEntity() {
}
public MeituanOrderExtraEntity(JSONObject jsonObject) {
if (jsonObject.containsKey("mt_charge")) {
mtCharge = jsonObject.getDouble("mt_charge");
}
if (jsonObject.containsKey("poi_charge")) {
poiCharge = jsonObject.getDouble("poi_charge");
}
if (jsonObject.containsKey("reduce_fee")) {
reduceFee = jsonObject.getDouble("reduce_fee");
}
if (jsonObject.containsKey("remark")) {
remark = jsonObject.getString("remark");
}
if (jsonObject.containsKey("type")) {
type = jsonObject.getInteger("type");
}
}
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public Double getMtCharge() {
return mtCharge;
}
public void setMtCharge(Double mtCharge) {
this.mtCharge = mtCharge;
}
public Double getPoiCharge() {
return poiCharge;
}
public void setPoiCharge(Double poiCharge) {
this.poiCharge = poiCharge;
}
public Double getReduceFee() {
return reduceFee;
}
public void setReduceFee(Double reduceFee) {
this.reduceFee = reduceFee;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getActDetailId() {
return actDetailId;
}
public void setActDetailId(String actDetailId) {
this.actDetailId = actDetailId;
}
public Double getAvgSendTime() {
return avgSendTime;
}
public void setAvgSendTime(Double avgSendTime) {
this.avgSendTime = avgSendTime;
}
}

@ -0,0 +1,171 @@
package com.jwsaas.controller.waimai;
import java.io.Serializable;
import com.alibaba.fastjson.JSONObject;
public class MeituanOrderItemEntity implements Serializable {
private static final long serialVersionUID = 2256815358403798672L;
private String orderId;// 订单ID
private String eDishCode;// erp方菜品id
private Integer boxNum;// 餐盒数量
private Double boxPrice;// 餐盒单价
private String dishName;// 菜品名
private Double price;// 价格
private String skuId;// erp方菜品sku
private String quantity;// 菜品份数
private String unit;// 单位
private Double discount;// 菜品折扣
private String spec;// 菜品规格
private String property;// 菜品属性
public MeituanOrderItemEntity() {
}
public MeituanOrderItemEntity(JSONObject jsonObject) {
if (jsonObject.containsKey("app_food_code")) {
eDishCode = jsonObject.getString("app_food_code");
}
if (jsonObject.containsKey("box_num")) {
boxNum = jsonObject.getInteger("box_num");
}
if (jsonObject.containsKey("box_price")) {
boxPrice = jsonObject.getDouble("box_price");
}
if (jsonObject.containsKey("food_name")) {
dishName = jsonObject.getString("food_name");
}
if (jsonObject.containsKey("price")) {
price = jsonObject.getDouble("price");
}
if (jsonObject.containsKey("sku_id")) {
skuId = jsonObject.getString("sku_id");
}
if (jsonObject.containsKey("quantity")) {
quantity = String.valueOf(jsonObject.getInteger("quantity"));
}
if (jsonObject.containsKey("unit")) {
unit = jsonObject.getString("unit");
}
if (jsonObject.containsKey("food_discount")) {
discount = jsonObject.getDouble("food_discount");
}
if (jsonObject.containsKey("spec")) {
spec = jsonObject.getString("spec");
}
if (jsonObject.containsKey("food_property")) {
property = jsonObject.getString("food_property");
}
}
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public String geteDishCode() {
return eDishCode;
}
public void seteDishCode(String eDishCode) {
this.eDishCode = eDishCode;
}
public Integer getBoxNum() {
return boxNum;
}
public void setBoxNum(Integer boxNum) {
this.boxNum = boxNum;
}
public Double getBoxPrice() {
return boxPrice;
}
public void setBoxPrice(Double boxPrice) {
this.boxPrice = boxPrice;
}
public String getDishName() {
return dishName;
}
public void setDishName(String dishName) {
this.dishName = dishName;
}
public Double getPrice() {
return price;
}
public void setPrice(Double price) {
this.price = price;
}
public String getSkuId() {
return skuId;
}
public void setSkuId(String skuId) {
this.skuId = skuId;
}
public String getQuantity() {
return quantity;
}
public void setQuantity(String quantity) {
this.quantity = quantity;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public Double getDiscount() {
return discount;
}
public void setDiscount(Double discount) {
this.discount = discount;
}
public String getSpec() {
return spec;
}
public void setSpec(String spec) {
this.spec = spec;
}
public String getProperty() {
return property;
}
public void setProperty(String property) {
this.property = property;
}
}

@ -0,0 +1,293 @@
package com.jwsaas.controller.waimai;
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 javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.amqp.rabbit.support.CorrelationData;
import org.springframework.stereotype.Controller;
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.JSONObject;
import com.jwsaas.Global;
import com.jwsaas.condition.Criteria;
import com.jwsaas.condition.Restrictions;
import com.jwsaas.config.MQMessageSender;
import com.jwsaas.controller.BaseController;
import com.jwsaas.entity.food.QimaiOrder;
import com.jwsaas.entity.food.QimaiOrderItem;
import com.jwsaas.entity.food.QimaiOrderPay;
import com.jwsaas.service.food.QimaiOrderItemService;
import com.jwsaas.service.food.QimaiOrderPayService;
import com.jwsaas.service.food.QimaiOrderService;
@Controller(Global.APP_SIGN + "QiMaiOrderController")
@RequestMapping("/waimai/qimai")
public class QiMaiOrderController extends BaseController {
@Resource
protected QimaiOrderService qimaiOrderService;
@Resource
protected QimaiOrderItemService qimaiOrderItemService;
@Resource
protected QimaiOrderPayService qimaiOrderPayService;
@Resource
private MQMessageSender mqMessageSender;
@RequestMapping(value = "/order", method = { RequestMethod.POST })
@ResponseBody
public Object order(HttpServletRequest request, HttpServletResponse response) {
String info = "企迈订单推送";
Map<String, Object> result = new HashMap<>();
String tenantId = getParameter(request, "tenantId");// 企业编号
String storeId = getParameter(request, "storeId");// 门店ID
String message = getParameter(request, "message");// 消息体
message = filter(message);
logger.error(tenantId);
logger.error(storeId);
//logger.error(message);
try {
QiMaiOrderEntity entity = new QiMaiOrderEntity(JSONObject.parseObject(message).getJSONObject("data"));
entity.setStoreId(storeId);
entity.setMessage(message);
Date operateDate = new Date();
String operateUser = "open-api";
// 订单入库
Criteria criteria = new Criteria();
criteria.add(Restrictions.eq("orderId", entity.getOrderId()));
List<QimaiOrder> orderList = qimaiOrderService.getList(tenantId, criteria);
if (!CollectionUtils.isEmpty(orderList)) {
QimaiOrder newEntity = orderList.get(0);
newEntity.setStoreId(storeId);
newEntity.setMessage(message);
newEntity.setAcceptMobile(entity.getAcceptMobile());
newEntity.setAcceptName(entity.getAcceptName());
newEntity.setAddress(entity.getAddress());
newEntity.setAmount(entity.getAmount());
newEntity.setCompletedAt(entity.getCompletedAt());
newEntity.setCouponType(entity.getCouponType());
newEntity.setCreateDate(new Date());
newEntity.setCreatedTime(entity.getCreatedTime());
newEntity.setExpress(entity.getExpress());
newEntity.setFinalStatus(entity.getFinalStatus());
newEntity.setFreight(entity.getFreight());
newEntity.setGoods(entity.getGoods());
newEntity.setGoodsName(entity.getGoodsName());
newEntity.setLat(entity.getLat());
newEntity.setLng(entity.getLng());
newEntity.setMealTime(entity.getMealTime());
newEntity.setMinusAmount(entity.getMinusAmount());
newEntity.setMoblie(entity.getMoblie());
newEntity.setModifyDate(operateDate);
newEntity.setModifyUser(operateUser);
newEntity.setMultiStoreId(entity.getMultiStoreId());
newEntity.setMultiStoreMark(entity.getMultiStoreMark());
newEntity.setMultiStoreName(entity.getMultiStoreName());
newEntity.setMutilUser(entity.getMutilUser());
newEntity.setOrderId(entity.getOrderId());
newEntity.setOrderNo(entity.getOrderNo());
newEntity.setPayModel(entity.getPayModel());
newEntity.setPayTime(entity.getPayTime());
newEntity.setPayUserName(entity.getPayUserName());
newEntity.setPeopleNumber(entity.getPeopleNumber());
newEntity.setPostscript(entity.getPostscript());
newEntity.setReceivableAmount(entity.getReceivableAmount());
newEntity.setRefundOrderId(entity.getRefundOrderId());
newEntity.setRefundOrderStatus(entity.getRefundOrderStatus());
newEntity.setRefundOrderStatusText(entity.getRefundOrderStatusText());
newEntity.setReserveTakeoutTime(entity.getReserveTakeoutTime());
newEntity.setSortNum(entity.getSortNum());
newEntity.setSource(entity.getSource());
newEntity.setSourceTxt(entity.getSourceTxt());
newEntity.setStatus(entity.getStatus());
newEntity.setStatusText(entity.getSourceTxt());
newEntity.setTableNumber(entity.getTableNumber());
newEntity.setTablewarePrice(entity.getTablewarePrice());
newEntity.setTenantId(tenantId);
newEntity.setThirdDelivery(entity.getThirdDelivery());
newEntity.setTotalAmount(entity.getTotalAmount());
newEntity.setTypeCateText(entity.getTypeCateText());
newEntity.setUseCoupon(entity.getUseCoupon());
newEntity.setUserName(entity.getUserName());
newEntity.setUserNameAll(entity.getUserNameAll());
newEntity.setWalletAmount(entity.getWalletAmount());
List<QiMaiOrderItemEntity> items = entity.getOrderItems();
List<QiMaiOrderPayEntity> pays = entity.getOrderPays();
List<QimaiOrderItem> itemList = new ArrayList<>();
if (items != null && items.size() > 0) {
for (QiMaiOrderItemEntity itemEntity : items) {
QimaiOrderItem it = new QimaiOrderItem();
it.setCostPrice(itemEntity.getCostPrice());
it.setCreateDate(operateDate);
it.setCreateUser(operateUser);
it.setDishId(itemEntity.getDishId());
it.setImage(itemEntity.getImage());
it.setIncomeRate(itemEntity.getIncomeRate());
it.setIncomeRate2(itemEntity.getIncomeRate2());
it.setIsGive(itemEntity.getIsGive());
it.setIsSend(itemEntity.getIsSend());
it.setMinus(itemEntity.getMinus());
it.setName(itemEntity.getName());
it.setNum(itemEntity.getNum());
it.setOrderId(entity.getOrderId());
it.setPrice(itemEntity.getPrice());
it.setSentAt(itemEntity.getSentAt());
it.setTenantId(tenantId);
it.setTradeMark(itemEntity.getTradeMark());
itemList.add(it);
}
}
List<QimaiOrderPay> payList = new ArrayList<>();
if (pays != null && pays.size() > 0) {
for (QiMaiOrderPayEntity payEntity : pays) {
QimaiOrderPay py = new QimaiOrderPay();
py.setName(payEntity.getName());
py.setOrderId(entity.getOrderId());
py.setTenantId(tenantId);
py.setType(payEntity.getType());
py.setCreateDate(operateDate);
py.setCreateUser(operateUser);
payList.add(py);
}
}
if (Global.USEMQ) {
// 放入消息队列
Map<String, Object> waimai_message = new HashMap<>();
waimai_message.put("type", "qimaiupdate");
waimai_message.put("newEntity", newEntity);
waimai_message.put("itemList", itemList);
waimai_message.put("payList", payList);
CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString());
this.mqMessageSender.send4qimaiupdate(tenantId, waimai_message, correlationData);
} else {
this.qimaiOrderService.updateOrder(tenantId, newEntity, itemList, payList);
}
} else {
QimaiOrder newEntity = new QimaiOrder();
newEntity.setStoreId(storeId);
newEntity.setMessage(message);
newEntity.setAcceptMobile(entity.getAcceptMobile());
newEntity.setAcceptName(entity.getAcceptName());
newEntity.setAddress(entity.getAddress());
newEntity.setAmount(entity.getAmount());
newEntity.setCompletedAt(entity.getCompletedAt());
newEntity.setCouponType(entity.getCouponType());
newEntity.setCreateDate(operateDate);
newEntity.setCreatedTime(entity.getCreatedTime());
newEntity.setCreateUser(operateUser);
newEntity.setExpress(entity.getExpress());
newEntity.setFinalStatus(entity.getFinalStatus());
newEntity.setFreight(entity.getFreight());
newEntity.setGoods(entity.getGoods());
newEntity.setGoodsName(entity.getGoodsName());
newEntity.setLat(entity.getLat());
newEntity.setLng(entity.getLng());
newEntity.setMealTime(entity.getMealTime());
newEntity.setMinusAmount(entity.getMinusAmount());
newEntity.setMoblie(entity.getMoblie());
newEntity.setMultiStoreId(entity.getMultiStoreId());
newEntity.setMultiStoreMark(entity.getMultiStoreMark());
newEntity.setMultiStoreName(entity.getMultiStoreName());
newEntity.setMutilUser(entity.getMutilUser());
newEntity.setOrderId(entity.getOrderId());
newEntity.setOrderNo(entity.getOrderNo());
newEntity.setPayModel(entity.getPayModel());
newEntity.setPayTime(entity.getPayTime());
newEntity.setPayUserName(entity.getPayUserName());
newEntity.setPeopleNumber(entity.getPeopleNumber());
newEntity.setPostscript(entity.getPostscript());
newEntity.setReceivableAmount(entity.getReceivableAmount());
newEntity.setRefundOrderId(entity.getRefundOrderId());
newEntity.setRefundOrderStatus(entity.getRefundOrderStatus());
newEntity.setRefundOrderStatusText(entity.getRefundOrderStatusText());
newEntity.setReserveTakeoutTime(entity.getReserveTakeoutTime());
newEntity.setSortNum(entity.getSortNum());
newEntity.setSource(entity.getSource());
newEntity.setSourceTxt(entity.getSourceTxt());
newEntity.setStatus(entity.getStatus());
newEntity.setStatusText(entity.getSourceTxt());
newEntity.setTableNumber(entity.getTableNumber());
newEntity.setTablewarePrice(entity.getTablewarePrice());
newEntity.setTenantId(tenantId);
newEntity.setThirdDelivery(entity.getThirdDelivery());
newEntity.setTotalAmount(entity.getTotalAmount());
newEntity.setTypeCateText(entity.getTypeCateText());
newEntity.setUseCoupon(entity.getUseCoupon());
newEntity.setUserName(entity.getUserName());
newEntity.setUserNameAll(entity.getUserNameAll());
newEntity.setWalletAmount(entity.getWalletAmount());
List<QiMaiOrderItemEntity> items = entity.getOrderItems();
List<QiMaiOrderPayEntity> pays = entity.getOrderPays();
List<QimaiOrderItem> itemList = new ArrayList<>();
if (items != null && items.size() > 0) {
for (QiMaiOrderItemEntity itemEntity : items) {
QimaiOrderItem it = new QimaiOrderItem();
it.setCostPrice(itemEntity.getCostPrice());
it.setCreateDate(operateDate);
it.setCreateUser(operateUser);
it.setDishId(itemEntity.getDishId());
it.setImage(itemEntity.getImage());
it.setIncomeRate(itemEntity.getIncomeRate());
it.setIncomeRate2(itemEntity.getIncomeRate2());
it.setIsGive(itemEntity.getIsGive());
it.setIsSend(itemEntity.getIsSend());
it.setMinus(itemEntity.getMinus());
it.setName(itemEntity.getName());
it.setNum(itemEntity.getNum());
it.setOrderId(entity.getOrderId());
it.setPrice(itemEntity.getPrice());
it.setSentAt(itemEntity.getSentAt());
it.setTenantId(tenantId);
it.setTradeMark(itemEntity.getTradeMark());
itemList.add(it);
}
}
List<QimaiOrderPay> payList = new ArrayList<>();
if (pays != null && pays.size() > 0) {
for (QiMaiOrderPayEntity payEntity : pays) {
QimaiOrderPay py = new QimaiOrderPay();
py.setName(payEntity.getName());
py.setOrderId(entity.getOrderId());
py.setTenantId(tenantId);
py.setType(payEntity.getType());
py.setCreateDate(operateDate);
py.setCreateUser(operateUser);
payList.add(py);
}
}
if (Global.USEMQ) {
// 放入消息队列
Map<String, Object> waimai_message = new HashMap<>();
waimai_message.put("type", "qimaicreate");
waimai_message.put("newEntity", newEntity);
waimai_message.put("itemList", itemList);
waimai_message.put("payList", payList);
CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString());
this.mqMessageSender.send4qimaicreate(tenantId, waimai_message, correlationData);
}else{
this.qimaiOrderService.saveOrder(tenantId, newEntity, itemList, payList);
}
}
result.put("info", "success");
result.put("final_status", entity.getFinalStatus());
result.put("refund_order_status", entity.getRefundOrderStatus());
} catch (Exception e) {
logger.error(info, e);
result.put("status", "error");
}
return result;
}
}

@ -0,0 +1,695 @@
package com.jwsaas.controller.waimai;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
public class QiMaiOrderEntity implements Serializable {
private static final long serialVersionUID = -975253547225858225L;
private String message;// 消息
private String storeId;// 巨为门店id
private String orderId;// 订单ID
private String multiStoreName;// 门店名称
private String multiStoreId;// 门店ID
private String orderNo;// 订单号
private String createdTime;// 创建时间
private String payTime;// 支付时间
private Integer status;// 订单状态
private String sortNum;// 取单号
private Double amount;// 应付价格
private Double totalAmount;// 总价格
private Double minusAmount;// 优惠价格
private Integer useCoupon;// 是否使用优惠券
private Integer couponType;// 使用的优惠券类型
private String postscript;// 备注
private String typeCateText;// 订单类型文字
private String userName;// 用户名称
private String payUserName;// 支付用户名称
private Integer source;// 订单来源
private String sourceTxt;// 来源文字
private String moblie;// 用户手机号
private String userNameAll;// 用户全称
private String goodsName;// 商品名称集合
private String refundOrderId;// 退款订单id
private Integer refundOrderStatus;// 退款订单状态
private String refundOrderStatusText;// 退款订单状态文字
private String goods;// 商品详情
private List<QiMaiOrderItemEntity> orderItems;// 商品详情
private Integer mutilUser;// 是否多人点餐
private String tableNumber;// 桌号
private Double freight;// 配送费
private Double tablewarePrice;// 餐具费
private Integer finalStatus;// 状态
private String statusText;// 状态文字
private Integer peopleNumber;// 就餐人数
private String multiStoreMark;// 门店编码
private String completedAt;// 订单完成时间
private String reserveTakeoutTime;// 预计送达时间
private String mealTime;// 预点餐订单的就餐时间
private Integer express;// 配送快递
private String lat;// 纬度
private String lng;// 经度
private String thirdDelivery;// 配送信息
private String acceptName;// 收件人名称
private String acceptMobile;// 收件人联系方式
private String address;// 收件人地址
private String payModel;// 支付详情
private List<QiMaiOrderPayEntity> orderPays;// 支付详情
private Double walletAmount;// 余额支付金额
private Double receivableAmount;// 实际支付金额
public QiMaiOrderEntity() {
}
public QiMaiOrderEntity(JSONObject jsonObject) {
if (jsonObject.containsKey("id")) {
orderId = jsonObject.getString("id");
}
if (jsonObject.containsKey("multi_store_name")) {
multiStoreName = jsonObject.getString("multi_store_name");
}
if (jsonObject.containsKey("multi_store_id")) {
multiStoreId = jsonObject.getString("multi_store_id");
}
if (jsonObject.containsKey("order_no")) {
orderNo = jsonObject.getString("order_no");
}
if (jsonObject.containsKey("created_time")) {
createdTime = jsonObject.getString("created_time");
}
if (jsonObject.containsKey("pay_time")) {
payTime = jsonObject.getString("pay_time");
}
if (jsonObject.containsKey("status")) {
status = jsonObject.getInteger("status");
}
if (jsonObject.containsKey("sort_num")) {
sortNum = jsonObject.getString("sort_num");
}
if (jsonObject.containsKey("amount")) {
amount = jsonObject.getDouble("amount");
}
if (jsonObject.containsKey("total_amount")) {
totalAmount = jsonObject.getDouble("total_amount");
}
if (jsonObject.containsKey("minus_amount")) {
minusAmount = jsonObject.getDouble("minus_amount");
}
if (jsonObject.containsKey("use_coupon")) {
useCoupon = jsonObject.getInteger("use_coupon");
}
if (jsonObject.containsKey("coupon_type")) {
couponType = jsonObject.getInteger("coupon_type");
}
if (jsonObject.containsKey("postscript")) {
postscript = jsonObject.getString("postscript");
}
if (jsonObject.containsKey("typeCateText")) {
typeCateText = jsonObject.getString("typeCateText");
}
if (jsonObject.containsKey("user_name")) {
userName = jsonObject.getString("user_name");
}
if (jsonObject.containsKey("pay_user_name")) {
payUserName = jsonObject.getString("pay_user_name");
}
if (jsonObject.containsKey("source")) {
source = jsonObject.getInteger("source");
}
if (jsonObject.containsKey("source_txt")) {
sourceTxt = jsonObject.getString("source_txt");
}
if (jsonObject.containsKey("source_txt")) {
sourceTxt = jsonObject.getString("source_txt");
}
if (jsonObject.containsKey("moblie")) {
moblie = jsonObject.getString("moblie");
}
if (jsonObject.containsKey("user_name_all")) {
userNameAll = jsonObject.getString("user_name_all");
}
if (jsonObject.containsKey("goods_name")) {
goodsName = jsonObject.getString("goods_name");
}
if (jsonObject.containsKey("refund_order_id")) {
refundOrderId = jsonObject.getString("refund_order_id");
}
if (jsonObject.containsKey("refund_order_status")) {
refundOrderStatus = jsonObject.getInteger("refund_order_status");
}
if (jsonObject.containsKey("refund_order_status_text")) {
refundOrderStatusText = jsonObject.getString("refund_order_status_text");
}
if (jsonObject.containsKey("goods")) {
goods = jsonObject.getString("goods");
orderItems = new ArrayList<>();
JSONObject goodJson = JSONObject.parseObject(goods);
if (goodJson.containsKey("goods")) {
JSONArray goodsArrayJson = goodJson.getJSONArray("goods");
for (int i = 0; i < goodsArrayJson.size(); i++) {
JSONObject detailObject = goodsArrayJson.getJSONObject(i);
QiMaiOrderItemEntity orderItem = new QiMaiOrderItemEntity(detailObject);
orderItem.setOrderId(orderId);
orderItems.add(orderItem);
}
}
}
if (jsonObject.containsKey("mutil_user")) {
mutilUser = jsonObject.getInteger("mutil_user");
}
if (jsonObject.containsKey("table_number")) {
tableNumber = jsonObject.getString("table_number");
}
if (jsonObject.containsKey("freight")) {
freight = jsonObject.getDouble("freight");
}
if (jsonObject.containsKey("tableware_price")) {
tablewarePrice = jsonObject.getDouble("tableware_price");
}
if (jsonObject.containsKey("final_status")) {
finalStatus = jsonObject.getInteger("final_status");
}
if (jsonObject.containsKey("status_text")) {
statusText = jsonObject.getString("status_text");
}
if (jsonObject.containsKey("people_number")) {
peopleNumber = jsonObject.getInteger("people_number");
}
if (jsonObject.containsKey("multi_store_mark")) {
multiStoreMark = jsonObject.getString("multi_store_mark");
}
if (jsonObject.containsKey("completed_at")) {
completedAt = jsonObject.getString("completed_at");
}
if (jsonObject.containsKey("reserve_takeout_time")) {
reserveTakeoutTime = jsonObject.getString("reserve_takeout_time");
}
if (jsonObject.containsKey("meal_time")) {
mealTime = jsonObject.getString("meal_time");
}
if (jsonObject.containsKey("express")) {
express = jsonObject.getInteger("express");
}
if (jsonObject.containsKey("lat")) {
lat = jsonObject.getString("lat");
}
if (jsonObject.containsKey("lng")) {
lng = jsonObject.getString("lng");
}
if (jsonObject.containsKey("third_delivery")) {
thirdDelivery = jsonObject.getString("third_delivery");
}
if (jsonObject.containsKey("third_delivery")) {
thirdDelivery = jsonObject.getString("third_delivery");
}
if (jsonObject.containsKey("accept_name")) {
acceptName = jsonObject.getString("accept_name");
}
if (jsonObject.containsKey("accept_mobile")) {
acceptMobile = jsonObject.getString("accept_mobile");
}
if (jsonObject.containsKey("address")) {
address = jsonObject.getString("address");
}
if (jsonObject.containsKey("pay_model")) {
payModel = jsonObject.getString("pay_model");
orderPays = new ArrayList<>();
JSONObject paysArrayJson = JSONObject.parseObject(payModel);
QiMaiOrderPayEntity orderPay = new QiMaiOrderPayEntity(paysArrayJson);
orderPay.setOrderId(orderId);
orderPays.add(orderPay);
}
if (jsonObject.containsKey("wallet_amount")) {
walletAmount = jsonObject.getDouble("wallet_amount");
}
if (jsonObject.containsKey("receivable_amount")) {
receivableAmount = jsonObject.getDouble("receivable_amount");
}
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
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 getMultiStoreName() {
return multiStoreName;
}
public void setMultiStoreName(String multiStoreName) {
this.multiStoreName = multiStoreName;
}
public String getMultiStoreId() {
return multiStoreId;
}
public void setMultiStoreId(String multiStoreId) {
this.multiStoreId = multiStoreId;
}
public String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public String getCreatedTime() {
return createdTime;
}
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
public String getPayTime() {
return payTime;
}
public void setPayTime(String payTime) {
this.payTime = payTime;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getSortNum() {
return sortNum;
}
public void setSortNum(String sortNum) {
this.sortNum = sortNum;
}
public Double getAmount() {
return amount;
}
public void setAmount(Double amount) {
this.amount = amount;
}
public Double getTotalAmount() {
return totalAmount;
}
public void setTotalAmount(Double totalAmount) {
this.totalAmount = totalAmount;
}
public Double getMinusAmount() {
return minusAmount;
}
public void setMinusAmount(Double minusAmount) {
this.minusAmount = minusAmount;
}
public Integer getUseCoupon() {
return useCoupon;
}
public void setUseCoupon(Integer useCoupon) {
this.useCoupon = useCoupon;
}
public Integer getCouponType() {
return couponType;
}
public void setCouponType(Integer couponType) {
this.couponType = couponType;
}
public String getPostscript() {
return postscript;
}
public void setPostscript(String postscript) {
this.postscript = postscript;
}
public String getTypeCateText() {
return typeCateText;
}
public void setTypeCateText(String typeCateText) {
this.typeCateText = typeCateText;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getPayUserName() {
return payUserName;
}
public void setPayUserName(String payUserName) {
this.payUserName = payUserName;
}
public Integer getSource() {
return source;
}
public void setSource(Integer source) {
this.source = source;
}
public String getSourceTxt() {
return sourceTxt;
}
public void setSourceTxt(String sourceTxt) {
this.sourceTxt = sourceTxt;
}
public String getMoblie() {
return moblie;
}
public void setMoblie(String moblie) {
this.moblie = moblie;
}
public String getUserNameAll() {
return userNameAll;
}
public void setUserNameAll(String userNameAll) {
this.userNameAll = userNameAll;
}
public String getGoodsName() {
return goodsName;
}
public void setGoodsName(String goodsName) {
this.goodsName = goodsName;
}
public String getRefundOrderId() {
return refundOrderId;
}
public void setRefundOrderId(String refundOrderId) {
this.refundOrderId = refundOrderId;
}
public Integer getRefundOrderStatus() {
return refundOrderStatus;
}
public void setRefundOrderStatus(Integer refundOrderStatus) {
this.refundOrderStatus = refundOrderStatus;
}
public String getRefundOrderStatusText() {
return refundOrderStatusText;
}
public void setRefundOrderStatusText(String refundOrderStatusText) {
this.refundOrderStatusText = refundOrderStatusText;
}
public String getGoods() {
return goods;
}
public void setGoods(String goods) {
this.goods = goods;
}
public List<QiMaiOrderItemEntity> getOrderItems() {
return orderItems;
}
public void setOrderItems(List<QiMaiOrderItemEntity> orderItems) {
this.orderItems = orderItems;
}
public Integer getMutilUser() {
return mutilUser;
}
public void setMutilUser(Integer mutilUser) {
this.mutilUser = mutilUser;
}
public String getTableNumber() {
return tableNumber;
}
public void setTableNumber(String tableNumber) {
this.tableNumber = tableNumber;
}
public Double getFreight() {
return freight;
}
public void setFreight(Double freight) {
this.freight = freight;
}
public Double getTablewarePrice() {
return tablewarePrice;
}
public void setTablewarePrice(Double tablewarePrice) {
this.tablewarePrice = tablewarePrice;
}
public Integer getFinalStatus() {
return finalStatus;
}
public void setFinalStatus(Integer finalStatus) {
this.finalStatus = finalStatus;
}
public String getStatusText() {
return statusText;
}
public void setStatusText(String statusText) {
this.statusText = statusText;
}
public Integer getPeopleNumber() {
return peopleNumber;
}
public void setPeopleNumber(Integer peopleNumber) {
this.peopleNumber = peopleNumber;
}
public String getMultiStoreMark() {
return multiStoreMark;
}
public void setMultiStoreMark(String multiStoreMark) {
this.multiStoreMark = multiStoreMark;
}
public String getCompletedAt() {
return completedAt;
}
public void setCompletedAt(String completedAt) {
this.completedAt = completedAt;
}
public String getReserveTakeoutTime() {
return reserveTakeoutTime;
}
public void setReserveTakeoutTime(String reserveTakeoutTime) {
this.reserveTakeoutTime = reserveTakeoutTime;
}
public String getMealTime() {
return mealTime;
}
public void setMealTime(String mealTime) {
this.mealTime = mealTime;
}
public Integer getExpress() {
return express;
}
public void setExpress(Integer express) {
this.express = express;
}
public String getLat() {
return lat;
}
public void setLat(String lat) {
this.lat = lat;
}
public String getLng() {
return lng;
}
public void setLng(String lng) {
this.lng = lng;
}
public String getThirdDelivery() {
return thirdDelivery;
}
public void setThirdDelivery(String thirdDelivery) {
this.thirdDelivery = thirdDelivery;
}
public String getAcceptName() {
return acceptName;
}
public void setAcceptName(String acceptName) {
this.acceptName = acceptName;
}
public String getAcceptMobile() {
return acceptMobile;
}
public void setAcceptMobile(String acceptMobile) {
this.acceptMobile = acceptMobile;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getPayModel() {
return payModel;
}
public void setPayModel(String payModel) {
this.payModel = payModel;
}
public List<QiMaiOrderPayEntity> getOrderPays() {
return orderPays;
}
public void setOrderPays(List<QiMaiOrderPayEntity> orderPays) {
this.orderPays = orderPays;
}
public Double getWalletAmount() {
return walletAmount;
}
public void setWalletAmount(Double walletAmount) {
this.walletAmount = walletAmount;
}
public Double getReceivableAmount() {
return receivableAmount;
}
public void setReceivableAmount(Double receivableAmount) {
this.receivableAmount = receivableAmount;
}
}

@ -0,0 +1,197 @@
package com.jwsaas.controller.waimai;
import java.io.Serializable;
import com.alibaba.fastjson.JSONObject;
public class QiMaiOrderItemEntity implements Serializable {
private static final long serialVersionUID = 7930172251524778092L;
private String orderId;// 订单ID
private String dishId;// 菜品id
private String name;// 商品名称
private String image;// 图片
private Double price;// 价格
private Double minus;// 优惠金额
private Double costPrice;// 成本价格
private Integer num;// 数量
private Integer isSend;// 是否发货
private String sentAt;// 发货时间
private Integer isGive;// 是否赠品
private Double incomeRate;// 推广员佣金
private String tradeMark;// 商品标识
private Double incomeRate2;// 邀请人佣金
public QiMaiOrderItemEntity() {
}
public QiMaiOrderItemEntity(JSONObject jsonObject) {
if (jsonObject.containsKey("id")) {
dishId = jsonObject.getString("id");
}
if (jsonObject.containsKey("name")) {
name = jsonObject.getString("name");
}
if (jsonObject.containsKey("image")) {
image = jsonObject.getString("image");
}
if (jsonObject.containsKey("price")) {
price = jsonObject.getDouble("price");
}
if (jsonObject.containsKey("minus")) {
minus = jsonObject.getDouble("minus");
}
if (jsonObject.containsKey("cost_price")) {
costPrice = jsonObject.getDouble("cost_price");
}
if (jsonObject.containsKey("num")) {
num = jsonObject.getInteger("num");
}
if (jsonObject.containsKey("is_send")) {
isSend = jsonObject.getInteger("is_send");
}
if (jsonObject.containsKey("sent_at")) {
sentAt = jsonObject.getString("sent_at");
}
if (jsonObject.containsKey("is_give")) {
isGive = jsonObject.getInteger("is_give");
}
if (jsonObject.containsKey("income_rate")) {
incomeRate = jsonObject.getDouble("income_rate");
}
if (jsonObject.containsKey("trade_mark")) {
tradeMark = jsonObject.getString("trade_mark");
}
if (jsonObject.containsKey("income_rate2")) {
incomeRate2 = jsonObject.getDouble("income_rate2");
}
}
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public String getDishId() {
return dishId;
}
public void setDishId(String dishId) {
this.dishId = dishId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
public Double getPrice() {
return price;
}
public void setPrice(Double price) {
this.price = price;
}
public Double getMinus() {
return minus;
}
public void setMinus(Double minus) {
this.minus = minus;
}
public Double getCostPrice() {
return costPrice;
}
public void setCostPrice(Double costPrice) {
this.costPrice = costPrice;
}
public Integer getNum() {
return num;
}
public void setNum(Integer num) {
this.num = num;
}
public Integer getIsSend() {
return isSend;
}
public void setIsSend(Integer isSend) {
this.isSend = isSend;
}
public String getSentAt() {
return sentAt;
}
public void setSentAt(String sentAt) {
this.sentAt = sentAt;
}
public Integer getIsGive() {
return isGive;
}
public void setIsGive(Integer isGive) {
this.isGive = isGive;
}
public Double getIncomeRate() {
return incomeRate;
}
public void setIncomeRate(Double incomeRate) {
this.incomeRate = incomeRate;
}
public String getTradeMark() {
return tradeMark;
}
public void setTradeMark(String tradeMark) {
this.tradeMark = tradeMark;
}
public Double getIncomeRate2() {
return incomeRate2;
}
public void setIncomeRate2(Double incomeRate2) {
this.incomeRate2 = incomeRate2;
}
}

@ -0,0 +1,53 @@
package com.jwsaas.controller.waimai;
import java.io.Serializable;
import com.alibaba.fastjson.JSONObject;
public class QiMaiOrderPayEntity implements Serializable {
private static final long serialVersionUID = 5938158311962070095L;
private String orderId;//订单ID
private String name;//支付方式名称
private Integer type;//支付方式id
public QiMaiOrderPayEntity() {
}
public QiMaiOrderPayEntity(JSONObject jsonObject) {
if (jsonObject.containsKey("name")) {
name = jsonObject.getString("name");
}
if (jsonObject.containsKey("type")) {
type = jsonObject.getInteger("type");
}
}
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
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;
}
}

@ -0,0 +1,337 @@
package com.jwsaas.controller.waimai;
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 javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.jwsaas.entity.ops.AppShopmeituanSetStore;
import com.jwsaas.service.ops.AppShopmeituanSetStoreService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.amqp.rabbit.support.CorrelationData;
import org.springframework.stereotype.Controller;
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.JSONObject;
import com.jwsaas.Global;
import com.jwsaas.condition.Criteria;
import com.jwsaas.condition.Restrictions;
import com.jwsaas.config.MQMessageSender;
import com.jwsaas.controller.BaseController;
import com.jwsaas.entity.food.ShopMeituanOrder;
import com.jwsaas.entity.food.ShopMeituanOrderExtra;
import com.jwsaas.entity.food.ShopMeituanOrderItem;
import com.jwsaas.service.food.ShopMeituanOrderExtraService;
import com.jwsaas.service.food.ShopMeituanOrderItemService;
import com.jwsaas.service.food.ShopMeituanOrderService;
import com.vdurmont.emoji.EmojiParser;
@Controller(Global.APP_SIGN + "ShopMeiTuanOrderController")
@RequestMapping("/waimai/shopmeituan")
public class ShopMeiTuanOrderController extends BaseController {
@Resource
protected ShopMeituanOrderService shopMeituanOrderService;
@Resource
protected ShopMeituanOrderItemService shopMeituanOrderItemService;
@Resource
protected ShopMeituanOrderExtraService shopMeituanOrderExtraService;
@Resource
private AppShopmeituanSetStoreService appShopmeituanSetStoreService;
@Resource
private MQMessageSender mqMessageSender;
@RequestMapping(value = "/order", method = { RequestMethod.POST })
@ResponseBody
public Object order(HttpServletRequest request, HttpServletResponse response) {
String info = "美团订单推送";
Map<String, Object> result = new HashMap<>();
String tenantId = getParameter(request, "tenantId");// 企业编号
String storeId = getParameter(request, "storeId");// 门店ID
String message = getParameter(request, "message");// 消息体
message = EmojiParser.removeAllEmojis(message);
message = filter(message);
String reasonCode = getParameter(request, "reasonCode");// 订单取消CODE
String reason = getParameter(request, "reason");// 取消原因
String refundReasonCode = getParameter(request, "refundReasonCode");// 退单CODE
String refundReason = getParameter(request, "refundReason");// 退单原因
String pickType = getParameter(request, "pickType");// 取餐类型
String status = null;
logger.error(tenantId);
logger.error(storeId);
//logger.error(message);
try {
if("571022".equals(tenantId) || "210008".equals(tenantId)){
Criteria criteria = new Criteria();
criteria.add(Restrictions.eq("storeId",storeId));
List<AppShopmeituanSetStore> storeList = appShopmeituanSetStoreService.getList("10001",criteria);
if(CollectionUtils.isNotEmpty(storeList)){
tenantId = storeList.get(0).getTenantCode();
}
}
Date operateDate = new Date();
ShopMeituanOrderEntity entity = new ShopMeituanOrderEntity(JSONObject.parseObject(message));
entity.setStoreId(storeId);
entity.setMessage(message);
// 订单入库
Criteria criteria = new Criteria();
criteria.add(Restrictions.eq("orderId", entity.getOrderId()));
List<ShopMeituanOrder> orderList = shopMeituanOrderService.getList(tenantId, criteria);
if (!CollectionUtils.isEmpty(orderList)) {
ShopMeituanOrder newEntity = orderList.get(0);
newEntity.setStoreId(storeId);
newEntity.setModifyUser("open-api");
newEntity.setModifyDate(operateDate);
if (reason != null && !"".equals(reason)) {
newEntity.setCancelReason(reason);
}
if (reasonCode != null && !"".equals(reasonCode)) {
newEntity.setCancelReasonCode(reasonCode);
}
if (refundReason != null && !"".equals(refundReason)) {
newEntity.setRefundReason(refundReason);
}
if (refundReasonCode != null && !"".equals(refundReasonCode)) {
newEntity.setRefundReasonCode(refundReasonCode);
}
newEntity.setTenantId(tenantId);
newEntity.setMessage(message);
newEntity.setOrderId(entity.getOrderId());
newEntity.setOrderIdView(entity.getOrderIdView());
newEntity.setWmPoiName(entity.getWmPoiName());
newEntity.setWmPoiAddress(entity.getWmPoiAddress());
newEntity.setWmPoiPhone(entity.getWmPoiPhone());
newEntity.setRecipientAddress(entity.getRecipientAddress());
newEntity.setRecipientPhone(entity.getRecipientPhone());
newEntity.setBackupRecipientPhone(entity.getBackupRecipientPhone());
newEntity.setRecipientName(entity.getRecipientName());
newEntity.setShippingFee(entity.getShippingFee());
newEntity.setTotal(entity.getTotal());
newEntity.setOriginalPrice(entity.getOriginalPrice());
newEntity.setCaution(entity.getCaution());
newEntity.setShipperPhone(entity.getShipperPhone());
newEntity.setStatus(entity.getStatus());
newEntity.setCityId(entity.getCityId());
newEntity.setHasInvoiced(entity.getHasInvoiced());
newEntity.setInvoiceTitle(entity.getInvoiceTitle());
newEntity.setTaxpayerId(entity.getTaxpayerId());
newEntity.setCTime(entity.getCTime());
newEntity.setDeliveryTime(entity.getDeliveryTime());
newEntity.setIsThirdShipping(entity.getIsThirdShipping());
newEntity.setPayType(entity.getPayType());
newEntity.setLatitude(entity.getLatitude());
newEntity.setLongitude(entity.getLongitude());
newEntity.setDaySeq(entity.getDaySeq());
newEntity.setIsFavorites(entity.getIsFavorites());
newEntity.setIsPoiFirstOrder(entity.getIsPoiFirstOrder());
newEntity.setDinnersNumber(entity.getDinnersNumber());
newEntity.setLogisticsCode(entity.getLogisticsCode());
List<ShopMeituanOrderItem> itemList = new ArrayList<>();
for (ShopMeituanOrderItemEntity meituanOrderItemEntity : entity.getOrderItemList()) {
ShopMeituanOrderItem item = new ShopMeituanOrderItem();
item.setTenantId(tenantId);
item.setCreateDate(operateDate);
item.setCreateUser("open-api");
item.setOrderId(entity.getOrderId());
item.setAppFoodCode(meituanOrderItemEntity.getAppFoodCode());
item.setFoodName(meituanOrderItemEntity.getFoodName());
item.setQuantity(meituanOrderItemEntity.getQuantity());
item.setPrice(meituanOrderItemEntity.getPrice());
item.setStoreId(storeId);
item.setSkuId(meituanOrderItemEntity.getSkuId());
item.setBoxNum(meituanOrderItemEntity.getBoxNum());
item.setBoxPrice(meituanOrderItemEntity.getBoxPrice());
item.setUnit(meituanOrderItemEntity.getUnit());
item.setFoodDiscount(meituanOrderItemEntity.getFoodDiscount());
item.setFoodProperty(meituanOrderItemEntity.getFoodProperty());
item.setCartId(meituanOrderItemEntity.getCartId());
itemList.add(item);
}
List<ShopMeituanOrderExtra> extraList = new ArrayList<>();
for (ShopMeituanOrderExtraEntity meituanOrderExtraEntity : entity.getOrderExtraList()) {
ShopMeituanOrderExtra extra = new ShopMeituanOrderExtra();
extra.setTenantId(tenantId);
extra.setCreateDate(operateDate);
extra.setCreateUser("open-api");
extra.setOrderId(entity.getOrderId());
extra.setReduceFee(meituanOrderExtraEntity.getReduceFee());
extra.setPoiCharge(meituanOrderExtraEntity.getPoiCharge());
extra.setMtCharge(meituanOrderExtraEntity.getMtCharge());
extra.setRemark(meituanOrderExtraEntity.getRemark());
extra.setType(meituanOrderExtraEntity.getType());
extra.setActDetailId(meituanOrderExtraEntity.getActDetailId());
extraList.add(extra);
}
if (pickType != null) {
newEntity.setPickType(Integer.parseInt(pickType));
}
newEntity.setAvgSendTime(entity.getAvgSendTime());
newEntity.setOrderSendTime(entity.getOrderSendTime());
newEntity.setOrderReceiveTime(entity.getOrderReceiveTime());
newEntity.setOrderConfirmTime(entity.getOrderConfirmTime());
newEntity.setOrderCancelTime(entity.getOrderCancelTime());
newEntity.setOrderCompletedTime(entity.getOrderCompletedTime());
newEntity.setLogisticsStatus(entity.getLogisticsStatus());
newEntity.setLogisticsId(entity.getLogisticsId());
newEntity.setLogisticsName(entity.getLogisticsName());
newEntity.setLogisticsSendTime(entity.getLogisticsSendTime());
newEntity.setLogisticsConfirmTime(entity.getLogisticsConfirmTime());
newEntity.setLogisticsCancelTime(entity.getLogisticsCancelTime());
newEntity.setLogisticsFetchTime(entity.getLogisticsFetchTime());
newEntity.setLogisticsCompletedTime(entity.getLogisticsCompletedTime());
newEntity.setLogisticsDispatcherName(entity.getLogisticsDispatcherName());
newEntity.setLogisticsDispatcherMobile(entity.getLogisticsDispatcherMobile());
newEntity.setChannel(entity.getChannel());
newEntity.setFoodShareFeeChargeByPoi(entity.getFoodShareFeeChargeByPoi());
newEntity.setWmPoiReceiveCent(entity.getWmPoiReceiveCent());
status = String.valueOf(newEntity.getStatus());
// 放入消息队列
Map<String, Object> waimai_message = new HashMap<>();
waimai_message.put("type", "shopmeituanupdate");
waimai_message.put("newEntity", newEntity);
CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString());
this.mqMessageSender.send4shopmeituanupdate(tenantId, waimai_message, correlationData);
} else {
ShopMeituanOrder newEntity = new ShopMeituanOrder();
if (reason != null && !"".equals(reason)) {
newEntity.setCancelReason(reason);
}
if (reasonCode != null && !"".equals(reasonCode)) {
newEntity.setCancelReasonCode(reasonCode);
}
if (refundReason != null && !"".equals(refundReason)) {
newEntity.setRefundReason(refundReason);
}
if (refundReasonCode != null && !"".equals(refundReasonCode)) {
newEntity.setRefundReasonCode(refundReasonCode);
}
newEntity.setStoreId(storeId);
newEntity.setCreateDate(operateDate);
newEntity.setCreateUser("open-api");
newEntity.setTenantId(tenantId);
newEntity.setMessage(message);
newEntity.setOrderId(entity.getOrderId());
newEntity.setOrderIdView(entity.getOrderIdView());
newEntity.setWmPoiName(entity.getWmPoiName());
newEntity.setWmPoiAddress(entity.getWmPoiAddress());
newEntity.setWmPoiPhone(entity.getWmPoiPhone());
newEntity.setRecipientAddress(entity.getRecipientAddress());
newEntity.setRecipientPhone(entity.getRecipientPhone());
newEntity.setBackupRecipientPhone(entity.getBackupRecipientPhone());
newEntity.setRecipientName(entity.getRecipientName());
newEntity.setShippingFee(entity.getShippingFee());
newEntity.setTotal(entity.getTotal());
newEntity.setOriginalPrice(entity.getOriginalPrice());
newEntity.setCaution(entity.getCaution());
newEntity.setShipperPhone(entity.getShipperPhone());
newEntity.setStatus(entity.getStatus());
newEntity.setCityId(entity.getCityId());
newEntity.setHasInvoiced(entity.getHasInvoiced());
newEntity.setInvoiceTitle(entity.getInvoiceTitle());
newEntity.setTaxpayerId(entity.getTaxpayerId());
newEntity.setCTime(entity.getCTime());
newEntity.setDeliveryTime(entity.getDeliveryTime());
newEntity.setIsThirdShipping(entity.getIsThirdShipping());
newEntity.setPayType(entity.getPayType());
newEntity.setLatitude(entity.getLatitude());
newEntity.setLongitude(entity.getLongitude());
newEntity.setDaySeq(entity.getDaySeq());
newEntity.setIsFavorites(entity.getIsFavorites());
newEntity.setIsPoiFirstOrder(entity.getIsPoiFirstOrder());
newEntity.setDinnersNumber(entity.getDinnersNumber());
newEntity.setLogisticsCode(entity.getLogisticsCode());
List<ShopMeituanOrderItem> itemList = new ArrayList<>();
for (ShopMeituanOrderItemEntity meituanOrderItemEntity : entity.getOrderItemList()) {
ShopMeituanOrderItem item = new ShopMeituanOrderItem();
item.setTenantId(tenantId);
item.setCreateDate(operateDate);
item.setCreateUser("open-api");
item.setOrderId(entity.getOrderId());
item.setAppFoodCode(meituanOrderItemEntity.getAppFoodCode());
item.setFoodName(meituanOrderItemEntity.getFoodName());
item.setQuantity(meituanOrderItemEntity.getQuantity());
item.setPrice(meituanOrderItemEntity.getPrice());
item.setStoreId(storeId);
item.setSkuId(meituanOrderItemEntity.getSkuId());
item.setBoxNum(meituanOrderItemEntity.getBoxNum());
item.setBoxPrice(meituanOrderItemEntity.getBoxPrice());
item.setUnit(meituanOrderItemEntity.getUnit());
item.setFoodDiscount(meituanOrderItemEntity.getFoodDiscount());
item.setFoodProperty(meituanOrderItemEntity.getFoodProperty());
item.setCartId(meituanOrderItemEntity.getCartId());
itemList.add(item);
}
List<ShopMeituanOrderExtra> extraList = new ArrayList<>();
for (ShopMeituanOrderExtraEntity meituanOrderExtraEntity : entity.getOrderExtraList()) {
ShopMeituanOrderExtra extra = new ShopMeituanOrderExtra();
extra.setTenantId(tenantId);
extra.setCreateDate(operateDate);
extra.setCreateUser("open-api");
extra.setOrderId(entity.getOrderId());
extra.setReduceFee(meituanOrderExtraEntity.getReduceFee());
extra.setPoiCharge(meituanOrderExtraEntity.getPoiCharge());
extra.setMtCharge(meituanOrderExtraEntity.getMtCharge());
extra.setRemark(meituanOrderExtraEntity.getRemark());
extra.setType(meituanOrderExtraEntity.getType());
extra.setActDetailId(meituanOrderExtraEntity.getActDetailId());
extraList.add(extra);
}
if (pickType != null) {
newEntity.setPickType(Integer.parseInt(pickType));
}
newEntity.setAvgSendTime(entity.getAvgSendTime());
newEntity.setOrderSendTime(entity.getOrderSendTime());
newEntity.setOrderReceiveTime(entity.getOrderReceiveTime());
newEntity.setOrderConfirmTime(entity.getOrderConfirmTime());
newEntity.setOrderCancelTime(entity.getOrderCancelTime());
newEntity.setOrderCompletedTime(entity.getOrderCompletedTime());
newEntity.setLogisticsStatus(entity.getLogisticsStatus());
newEntity.setLogisticsId(entity.getLogisticsId());
newEntity.setLogisticsName(entity.getLogisticsName());
newEntity.setLogisticsSendTime(entity.getLogisticsSendTime());
newEntity.setLogisticsConfirmTime(entity.getLogisticsConfirmTime());
newEntity.setLogisticsCancelTime(entity.getLogisticsCancelTime());
newEntity.setLogisticsFetchTime(entity.getLogisticsFetchTime());
newEntity.setLogisticsCompletedTime(entity.getLogisticsCompletedTime());
newEntity.setLogisticsDispatcherName(entity.getLogisticsDispatcherName());
newEntity.setLogisticsDispatcherMobile(entity.getLogisticsDispatcherMobile());
newEntity.setChannel(entity.getChannel());
newEntity.setFoodShareFeeChargeByPoi(entity.getFoodShareFeeChargeByPoi());
newEntity.setWmPoiReceiveCent(entity.getWmPoiReceiveCent());
status = String.valueOf(newEntity.getStatus());
// 放入消息队列
Map<String, Object> waimai_message = new HashMap<>();
waimai_message.put("type", "shopmeituancreate");
waimai_message.put("newEntity", newEntity);
waimai_message.put("itemList", itemList);
waimai_message.put("extraList", extraList);
CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString());
this.mqMessageSender.send4shopmeituancreate(tenantId, waimai_message, correlationData);
}
result.put("info", "success");
result.put("status", status);
result.put("refundReasonCode", refundReasonCode);
} catch (Exception e) {
logger.error(info, e);
result.put("status", "error");
}
return result;
}
}

@ -0,0 +1,199 @@
package com.jwsaas.controller.waimai;
import java.io.Serializable;
import com.alibaba.fastjson.JSONObject;
public class ShopMeituanOrderExtraEntity implements Serializable {
private static final long serialVersionUID = 1037261515303605701L;
/**
*ID
*/
private String orderId;
/**
*
*/
private Double reduceFee;
/**
*
*/
private Double poiCharge;
/**
*
*/
private Double mtCharge;
/**
*
*/
private String remark;
/**
*
*/
private Integer type;
/**
*ID
*/
private String actDetailId;
public ShopMeituanOrderExtraEntity() {
}
public ShopMeituanOrderExtraEntity(JSONObject jsonObject) {
if (jsonObject.containsKey("act_detail_id")) {
actDetailId = String.valueOf(jsonObject.getInteger("act_detail_id"));
}
if (jsonObject.containsKey("reduce_fee")) {
reduceFee = jsonObject.getDouble("reduce_fee");
}
if (jsonObject.containsKey("mt_charge")) {
mtCharge = jsonObject.getDouble("mt_charge");
}
if (jsonObject.containsKey("poi_charge")) {
poiCharge = jsonObject.getDouble("poi_charge");
}
if (jsonObject.containsKey("remark")) {
remark = jsonObject.getString("remark");
}
if (jsonObject.containsKey("type")) {
type = jsonObject.getInteger("type");
}
}
/**
* :ID
* :varchar(32)
* :false
*/
public String getOrderId() {
return this.orderId;
}
/**
* :ID
* :varchar(32)
* :false
*/
public void setOrderId(String orderId) {
this.orderId = orderId;
}
/**
* :
* :decimal(24,4)
* :false
*/
public Double getReduceFee() {
return this.reduceFee;
}
/**
* :
* :decimal(24,4)
* :false
*/
public void setReduceFee(Double reduceFee) {
this.reduceFee = reduceFee;
}
/**
* :
* :decimal(24,4)
* :false
*/
public Double getPoiCharge() {
return this.poiCharge;
}
/**
* :
* :decimal(24,4)
* :false
*/
public void setPoiCharge(Double poiCharge) {
this.poiCharge = poiCharge;
}
/**
* :
* :decimal(24,4)
* :false
*/
public Double getMtCharge() {
return this.mtCharge;
}
/**
* :
* :decimal(24,4)
* :false
*/
public void setMtCharge(Double mtCharge) {
this.mtCharge = mtCharge;
}
/**
* :
* :text
* :false
*/
public String getRemark() {
return this.remark;
}
/**
* :
* :text
* :false
*/
public void setRemark(String remark) {
this.remark = remark;
}
/**
* :
* :int
* :false
*/
public Integer getType() {
return this.type;
}
/**
* :
* :int
* :false
*/
public void setType(Integer type) {
this.type = type;
}
/**
* :ID
* :varchar(32)
* :false
*/
public String getActDetailId() {
return this.actDetailId;
}
/**
* :ID
* :varchar(32)
* :false
*/
public void setActDetailId(String actDetailId) {
this.actDetailId = actDetailId;
}
}

@ -0,0 +1,299 @@
package com.jwsaas.controller.waimai;
import java.io.Serializable;
import com.alibaba.fastjson.JSONObject;
public class ShopMeituanOrderItemEntity implements Serializable {
private static final long serialVersionUID = 1446333132378327741L;
/**
* ID
*/
private String orderId;
/**
* APPID
*/
private String appFoodCode;
/**
*
*/
private String foodName;
/**
*
*/
private String quantity;
/**
*
*/
private Double price;
/**
* erpID
*/
private String storeId;
/**
* erpsku
*/
private String skuId;
/**
*
*/
private Integer boxNum;
/**
*
*/
private Double boxPrice;
/**
*
*/
private String unit;
/**
*
*/
private Double foodDiscount;
/**
*
*/
private String foodProperty;
/**
*
*/
private Integer cartId;
public ShopMeituanOrderItemEntity() {
}
public ShopMeituanOrderItemEntity(JSONObject jsonObject) {
if (jsonObject.containsKey("app_food_code")) {
appFoodCode = jsonObject.getString("app_food_code");
}
if (jsonObject.containsKey("food_name")) {
foodName = jsonObject.getString("food_name");
}
if (jsonObject.containsKey("sku_id")) {
skuId = jsonObject.getString("sku_id");
}
if (jsonObject.containsKey("quantity")) {
quantity = String.valueOf(jsonObject.getDouble("quantity"));
}
if (jsonObject.containsKey("price")) {
price = jsonObject.getDouble("price");
}
if (jsonObject.containsKey("box_num")) {
boxNum = jsonObject.getDouble("box_num").intValue();
}
if (jsonObject.containsKey("box_price")) {
boxPrice = jsonObject.getDouble("box_price");
}
if (jsonObject.containsKey("unit")) {
unit = jsonObject.getString("unit");
}
if (jsonObject.containsKey("food_discount")) {
foodDiscount = jsonObject.getDouble("food_discount");
}
if (jsonObject.containsKey("food_property")) {
foodProperty = jsonObject.getString("food_property");
}
if (jsonObject.containsKey("cart_id")) {
cartId = jsonObject.getInteger("cart_id");
}
}
/**
* :ID :varchar(32) :false
*/
public String getOrderId() {
return this.orderId;
}
/**
* :ID :varchar(32) :false
*/
public void setOrderId(String orderId) {
this.orderId = orderId;
}
/**
* :APPID :varchar(32) :false
*/
public String getAppFoodCode() {
return this.appFoodCode;
}
/**
* :APPID :varchar(32) :false
*/
public void setAppFoodCode(String appFoodCode) {
this.appFoodCode = appFoodCode;
}
/**
* : :varchar(64) :false
*/
public String getFoodName() {
return this.foodName;
}
/**
* : :varchar(64) :false
*/
public void setFoodName(String foodName) {
this.foodName = foodName;
}
/**
* : :varchar(32) :false
*/
public String getQuantity() {
return this.quantity;
}
/**
* : :varchar(32) :false
*/
public void setQuantity(String quantity) {
this.quantity = quantity;
}
/**
* : :decimal(24,4) :false
*/
public Double getPrice() {
return this.price;
}
/**
* : :decimal(24,4) :false
*/
public void setPrice(Double price) {
this.price = price;
}
/**
* :erpID :varchar(32) :false
*/
public String getStoreId() {
return this.storeId;
}
/**
* :erpID :varchar(32) :false
*/
public void setStoreId(String storeId) {
this.storeId = storeId;
}
/**
* :erpsku :varchar(32) :false
*/
public String getSkuId() {
return this.skuId;
}
/**
* :erpsku :varchar(32) :false
*/
public void setSkuId(String skuId) {
this.skuId = skuId;
}
/**
* : :int :false
*/
public Integer getBoxNum() {
return this.boxNum;
}
/**
* : :int :false
*/
public void setBoxNum(Integer boxNum) {
this.boxNum = boxNum;
}
/**
* : :decimal(24,4) :false
*/
public Double getBoxPrice() {
return this.boxPrice;
}
/**
* : :decimal(24,4) :false
*/
public void setBoxPrice(Double boxPrice) {
this.boxPrice = boxPrice;
}
/**
* : :varchar(32) :false
*/
public String getUnit() {
return this.unit;
}
/**
* : :varchar(32) :false
*/
public void setUnit(String unit) {
this.unit = unit;
}
/**
* : :decimal(24,4) :false
*/
public Double getFoodDiscount() {
return this.foodDiscount;
}
/**
* : :decimal(24,4) :false
*/
public void setFoodDiscount(Double foodDiscount) {
this.foodDiscount = foodDiscount;
}
/**
* : :varchar(128) :false
*/
public String getFoodProperty() {
return this.foodProperty;
}
/**
* : :varchar(128) :false
*/
public void setFoodProperty(String foodProperty) {
this.foodProperty = foodProperty;
}
/**
* : :int :false
*/
public Integer getCartId() {
return this.cartId;
}
/**
* : :int :false
*/
public void setCartId(Integer cartId) {
this.cartId = cartId;
}
}

@ -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);
}
}
}

@ -0,0 +1,125 @@
package com.jwsaas.utils;
/**
* org.springframework.util.Assert
*/
public abstract class Assert {
/**
* Assert a boolean expression, throwing an {@code IllegalStateException} if
* the expression evaluates to {@code false}.
* <p>
* Call {@link #isTrue} if you wish to throw an
* {@code IllegalArgumentException} on an assertion failure.
*
* <pre class="code">
* Assert.state(id == null, "The id property must not already be initialized");
* </pre>
*
* @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}.
*
* <pre class="code">
* Assert.isTrue(i &gt; 0, "The value must be greater than zero");
* </pre>
*
* @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}.
*
* <pre class="code">
* Assert.isNull(value, "The value must be null");
* </pre>
*
* @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}.
*
* <pre class="code">
* Assert.notNull(clazz, "The class must not be null");
* </pre>
*
* @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");
}
}

@ -0,0 +1,492 @@
package com.jwsaas.utils;
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}<code>0</code>{@code length}
*
* @param date
* @param length
* @return
*/
public static String pad0(String date, int length) {
return padChar(date, length, '0');
}
/**
* {@code date}<code>9</code>{@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},
*
* <pre>
* time1 &lt; time2
* </pre>
*
* {@code time2}<code>null</code>
*
* @param time1
* yyyyMMddHHmmss140
* @param time2
* yyyyMMddHHmmss140
* @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},
*
* <pre>
* time1 &gt; time2
* </pre>
*
* {@code time2}<code>null</code>
*
* @param time1
* yyyyMMddHHmmss149
* @param time2
* yyyyMMddHHmmss149
* @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;
}
}
/**
* <code>datetime</code>
*
* @param datetime
* 814 yyyyMMddHHmmss140
* @return
*/
public static long toMilliseconds(String datetime) {
return parseDate(datetime).getTime();
}
/**
* {@link #DATETIME_FORMAT}Date,{@code datetime}814.
*
* @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));
}
/**
* datecountcount
*/
public static Date addMinute(Date date, int count) {
return new Date(date.getTime() + 60000L * count);
}
/**
* datecountcount
*/
public static Date addHour(Date date, int count) {
return new Date(date.getTime() + 3600000L * count);
}
/**
* datecountcount
*/
public static Date addDay(Date date, int count) {
return new Date(date.getTime() + 86400000L * count);
}
/**
* datecountcount
*/
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();
}
/**
* datecountcount
*/
public static Date addMonth(Date date, int count) {
Calendar c = Calendar.getInstance();
c.setTime(date);
c.add(Calendar.MONTH, count);
return c.getTime();
}
/**
* datecountcount
*/
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());
}
}

@ -0,0 +1,302 @@
package com.jwsaas.utils;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.alibaba.fastjson.JSONObject;
import com.jwsaas.controller.waimai.MeituanOrderEntity;
import com.jwsaas.controller.waimai.MeituanOrderItemEntity;
import com.vdurmont.emoji.EmojiParser;
public class EmojiFilter {
public final static String unicodeReg = "[" + "\u4E00-\u9FBF" + // CJK
// 统一表意符号
// (CJK
// Unified
// Ideographs)
"\u4DC0-\u4DFF" + // :易经六十四卦符号 (Yijing Hexagrams Symbols)
"\u0000-\u007F" + // C0控制符及基本拉丁文 (C0 Control and Basic Latin)
"\u0080-\u00FF" + // C1控制符及拉丁补充-1 (C1 Control and Latin 1
// Supplement)
"\u0100-\u017F" + // :拉丁文扩展-A (Latin Extended-A)
"\u0180-\u024F" + // :拉丁文扩展-B (Latin Extended-B)
"\u0250-\u02AF" + // :国际音标扩展 (IPA Extensions)
"\u02B0-\u02FF" + // :空白修饰字母 (Spacing Modifiers)
"\u0300-\u036F" + // :结合用读音符号 (Combining Diacritics Marks)
"\u0370-\u03FF" + // :希腊文及科普特文 (Greek and Coptic)
"\u0400-\u04FF" + // :西里尔字母 (Cyrillic)
"\u0500-\u052F" + // :西里尔字母补充 (Cyrillic Supplement)
"\u0530-\u058F" + // :亚美尼亚语 (Armenian)
"\u0590-\u05FF" + // :希伯来文 (Hebrew)
"\u0600-\u06FF" + // :阿拉伯文 (Arabic)
"\u0700-\u074F" + // :叙利亚文 (Syriac)
"\u0750-\u077F" + // :阿拉伯文补充 (Arabic Supplement)
"\u0780-\u07BF" + // :马尔代夫语 (Thaana)
// "\u07C0-\u077F"+//:西非书面语言 (N'Ko)
"\u0800-\u085F" + // :阿维斯塔语及巴列维语 (Avestan and Pahlavi)
"\u0860-\u087F" + // Mandaic
"\u0880-\u08AF" + // :撒马利亚语 (Samaritan)
"\u0900-\u097F" + // :天城文书 (Devanagari)
"\u0980-\u09FF" + // :孟加拉语 (Bengali)
"\u0A00-\u0A7F" + // :锡克教文 (Gurmukhi)
"\u0A80-\u0AFF" + // :古吉拉特文 (Gujarati)
"\u0B00-\u0B7F" + // :奥里亚文 (Oriya)
"\u0B80-\u0BFF" + // :泰米尔文 (Tamil)
"\u0C00-\u0C7F" + // :泰卢固文 (Telugu)
"\u0C80-\u0CFF" + // :卡纳达文 (Kannada)
"\u0D00-\u0D7F" + // :德拉维族语 (Malayalam)
"\u0D80-\u0DFF" + // :僧伽罗语 (Sinhala)
"\u0E00-\u0E7F" + // :泰文 (Thai)
"\u0E80-\u0EFF" + // :老挝文 (Lao)
"\u0F00-\u0FFF" + // :藏文 (Tibetan)
"\u1000-\u109F" + // :缅甸语 (Myanmar)
"\u10A0-\u10FF" + // :格鲁吉亚语 (Georgian)
"\u1100-\u11FF" + // :朝鲜文 (Hangul Jamo)
"\u1200-\u137F" + // :埃塞俄比亚语 (Ethiopic)
"\u1380-\u139F" + // :埃塞俄比亚语补充 (Ethiopic Supplement)
"\u13A0-\u13FF" + // :切罗基语 (Cherokee)
"\u1400-\u167F" + // :统一加拿大土著语音节 (Unified Canadian Aboriginal
// Syllabics)
"\u1680-\u169F" + // :欧甘字母 (Ogham)
"\u16A0-\u16FF" + // :如尼文 (Runic)
"\u1700-\u171F" + // :塔加拉语 (Tagalog)
"\u1720-\u173F" + // Hanunóo
"\u1740-\u175F" + // Buhid
"\u1760-\u177F" + // Tagbanwa
"\u1780-\u17FF" + // :高棉语 (Khmer)
"\u1800-\u18AF" + // :蒙古文 (Mongolian)
"\u18B0-\u18FF" + // Cham
"\u1900-\u194F" + // Limbu
"\u1950-\u197F" + // :德宏泰语 (Tai Le)
"\u1980-\u19DF" + // :新傣仂语 (New Tai Lue)
"\u19E0-\u19FF" + // :高棉语记号 (Kmer Symbols)
"\u1A00-\u1A1F" + // Buginese
"\u1A20-\u1A5F" + // Batak
"\u1A80-\u1AEF" + // Lanna
"\u1B00-\u1B7F" + // :巴厘语 (Balinese)
"\u1B80-\u1BB0" + // :巽他语 (Sundanese)
"\u1BC0-\u1BFF" + // Pahawh Hmong
"\u1C00-\u1C4F" + // :雷布查语(Lepcha)
"\u1C50-\u1C7F" + // Ol Chiki
"\u1C80-\u1CDF" + // :曼尼普尔语 (Meithei/Manipuri)
"\u1D00-\u1D7F" + // :语音学扩展 (Phone tic Extensions)
"\u1D80-\u1DBF" + // :语音学扩展补充 (Phonetic Extensions Supplement)
"\u1DC0-\u1DFF" + // 结合用读音符号补充 (Combining Diacritics Marks
// Supplement)
"\u1E00-\u1EFF" + // :拉丁文扩充附加 (Latin Extended Additional)
"\u1F00-\u1FFF" + // :希腊语扩充 (Greek Extended)
"\u2000-\u206F" + // :常用标点 (General Punctuation)
"\u2070-\u209F" + // :上标及下标 (Superscripts and Subscripts)
"\u20A0-\u20CF" + // :货币符号 (Currency Symbols)
"\u20D0-\u20FF" + // :组合用记号 (Combining Diacritics Marks for Symbols)
"\u2100-\u214F" + // :字母式符号 (Letterlike Symbols)
"\u2150-\u218F" + // :数字形式 (Number Form)
"\u2190-\u21FF" + // :箭头 (Arrows)
"\u2200-\u22FF" + // :数学运算符 (Mathematical Operator)
"\u2300-\u23FF" + // :杂项工业符号 (Miscellaneous Technical)
"\u2400-\u243F" + // :控制图片 (Control Pictures)
"\u2440-\u245F" + // :光学识别符 (Optical Character Recognition)
"\u2460-\u24FF" + // :封闭式字母数字 (Enclosed Alphanumerics)
"\u2500-\u257F" + // :制表符 (Box Drawing)
"\u2580-\u259F" + // :方块元素 (Block Element)
"\u25A0-\u25FF" + // :几何图形 (Geometric Shapes)
"\u2600-\u26FF" + // :杂项符号 (Miscellaneous Symbols)
"\u2700-\u27BF" + // :印刷符号 (Dingbats)
"\u27C0-\u27EF" + // :杂项数学符号-A (Miscellaneous Mathematical
// Symbols-A)
"\u27F0-\u27FF" + // :追加箭头-A (Supplemental Arrows-A)
"\u2800-\u28FF" + // :盲文点字模型 (Braille Patterns)
"\u2900-\u297F" + // :追加箭头-B (Supplemental Arrows-B)
"\u2980-\u29FF" + // :杂项数学符号-B (Miscellaneous Mathematical
// Symbols-B)
"\u2A00-\u2AFF" + // :追加数学运算符 (Supplemental Mathematical Operator)
"\u2B00-\u2BFF" + // :杂项符号和箭头 (Miscellaneous Symbols and Arrows)
"\u2C00-\u2C5F" + // :格拉哥里字母 (Glagolitic)
"\u2C60-\u2C7F" + // :拉丁文扩展-C (Latin Extended-C)
"\u2C80-\u2CFF" + // :古埃及语 (Coptic)
"\u2D00-\u2D2F" + // :格鲁吉亚语补充 (Georgian Supplement)
"\u2D30-\u2D7F" + // :提非纳文 (Tifinagh)
"\u2D80-\u2DDF" + // :埃塞俄比亚语扩展 (Ethiopic Extended)
"\u2E00-\u2E7F" + // :追加标点 (Supplemental Punctuation)
"\u2E80-\u2EFF" + // CJK 部首补充 (CJK Radicals Supplement)
"\u2F00-\u2FDF" + // :康熙字典部首 (Kangxi Radicals)
"\u2FF0-\u2FFF" + // :表意文字描述符 (Ideographic Description Characters)
"\u3000-\u303F" + // CJK 符号和标点 (CJK Symbols and Punctuation)
"\u3040-\u309F" + // :日文平假名 (Hiragana)
"\u30A0-\u30FF" + // :日文片假名 (Katakana)
"\u3100-\u312F" + // :注音字母 (Bopomofo)
"\u3130-\u318F" + // :朝鲜文兼容字母 (Hangul Compatibility Jamo)
"\u3190-\u319F" + // :象形字注释标志 (Kanbun)
"\u31A0-\u31BF" + // :注音字母扩展 (Bopomofo Extended)
"\u31C0-\u31EF" + // CJK 笔画 (CJK Strokes)
"\u31F0-\u31FF" + // :日文片假名语音扩展 (Katakana Phonetic Extensions)
"\u3200-\u32FF" + // :封闭式 CJK 文字和月份 (Enclosed CJK Letters and
// Months)
"\u3300-\u33FF" + // CJK 兼容 (CJK Compatibility)
"\u3400-\u4DBF" + // CJK 统一表意符号扩展 A (CJK Unified Ideographs
// Extension A)
"\u4DC0-\u4DFF" + // :易经六十四卦符号 (Yijing Hexagrams Symbols)
"\u4E00-\u9FBF" + // CJK 统一表意符号 (CJK Unified Ideographs)
"\uA000-\uA48F" + // :彝文音节 (Yi Syllables)
"\uA490-\uA4CF" + // :彝文字根 (Yi Radicals)
"\uA500-\uA61F" + // Vai
"\uA660-\uA6FF" + // :统一加拿大土著语音节补充 (Unified Canadian Aboriginal
// Syllabics Supplement)
"\uA700-\uA71F" + // :声调修饰字母 (Modifier Tone Letters)
"\uA720-\uA7FF" + // :拉丁文扩展-D (Latin Extended-D)
"\uA800-\uA82F" + // Syloti Nagri
"\uA840-\uA87F" + // :八思巴字 (Phags-pa)
"\uA880-\uA8DF" + // Saurashtra
"\uA900-\uA97F" + // :爪哇语 (Javanese)
"\uA980-\uA9DF" + // Chakma
"\uAA00-\uAA3F" + // Varang Kshiti
"\uAA40-\uAA6F" + // Sorang Sompeng
"\uAA80-\uAADF" + // Newari
"\uAB00-\uAB5F" + // :越南傣语 (Vi?t Thái)
"\uAB80-\uABA0" + // Kayah Li
"\uAC00-\uD7AF" + // :朝鲜文音节 (Hangul Syllables)
// "\uD800-\uDBFF"+//High-half zone of UTF-16
// "\uDC00-\uDFFF"+//Low-half zone of UTF-16
"\uE000-\uF8FF" + // :自行使用区域 (Private Use Zone)
"\uF900-\uFAFF" + // CJK 兼容象形文字 (CJK Compatibility Ideographs)
"\uFB00-\uFB4F" + // :字母表达形式 (Alphabetic Presentation Form)
"\uFB50-\uFDFF" + // 阿拉伯表达形式A (Arabic Presentation Form-A)
"\uFE00-\uFE0F" + // :变量选择符 (Variation Selector)
"\uFE10-\uFE1F" + // :竖排形式 (Vertical Forms)
"\uFE20-\uFE2F" + // :组合用半符号 (Combining Half Marks)
"\uFE30-\uFE4F" + // CJK 兼容形式 (CJK Compatibility Forms)
"\uFE50-\uFE6F" + // :小型变体形式 (Small Form Variants)
"\uFE70-\uFEFF" + // 阿拉伯表达形式B (Arabic Presentation Form-B)
"\uFF00-\uFFEF" + // :半型及全型形式 (Halfwidth and Fullwidth Form)
"\uFFF0-\uFFFF]";// :特殊 (Specials);
/**
* unicode
*
* @param str
*
* @return unicode
*/
public static String convert(String str) {
str = (str == null ? "" : str);
String tmp;
StringBuffer sb = new StringBuffer(1000);
char c;
int i, j;
sb.setLength(0);
for (i = 0; i < str.length(); i++) {
c = str.charAt(i);
sb.append("\\u");
j = (c >>> 8); // 取出高8位
tmp = Integer.toHexString(j);
if (tmp.length() == 1) {
sb.append("0");
}
sb.append(tmp);
j = (c & 0xFF); // 取出低8位
tmp = Integer.toHexString(j);
if (tmp.length() == 1) {
sb.append("0");
}
sb.append(tmp);
}
return (new String(sb).toUpperCase());
}
/**
* 2)unicode unicode
*
* @param str
*
* @return
*/
public static String revert(String str) {
str = (str == null ? "" : str);
if (str.indexOf("\\u") == -1)// 如果不是unicode码则原样返回
return str;
StringBuffer sb = new StringBuffer(1000);
for (int i = 0; i < str.length() - 6;) {
String strTemp = str.substring(i, i + 6);
String value = strTemp.substring(2);
int c = 0;
for (int j = 0; j < value.length(); j++) {
char tempChar = value.charAt(j);
int t = 0;
switch (tempChar) {
case 'a':
t = 10;
break;
case 'b':
t = 11;
break;
case 'c':
t = 12;
break;
case 'd':
t = 13;
break;
case 'e':
t = 14;
break;
case 'f':
t = 15;
break;
default:
t = tempChar - 48;
break;
}
c += t * ((int) Math.pow(16, (value.length() - j - 1)));
}
sb.append((char) c);
i = i + 6;
}
return sb.toString();
}
/**
*
* @author: Simon
* @Description:
* @date: 2017922 11:11:33
* @param string
* @return
*/
public static String filterEmoji(String string) {
try {
Pattern pattern = Pattern.compile(unicodeReg);
StringBuffer sbBuffer = new StringBuffer();
for (int i = 0; i < string.length(); i++) {
char c = string.charAt(i);
String temp = String.valueOf(c);
Matcher matcher = pattern.matcher(temp);
if (matcher.find()) {
sbBuffer.append(temp);
} else {
sbBuffer.append("");
}
}
return sbBuffer.toString();
} catch (Exception e) {
e.printStackTrace();
}
return "";
}
public static void main(String[] args) {
// String message = "{\"cTime\":1532760316,\"caution\":\"水果种类多点,我会给五星好评 收餐人隐私号 15656547948_5348手机号 131****7557\",\"deliveryTime\":0,\"detail\":[{\"app_food_code\":\"原味鸡蛋仔\",\"box_num\":1,\"box_price\":0,\"cart_id\":0,\"food_discount\":1,\"food_name\":\"原味鸡蛋仔\",\"food_property\":\"\",\"price\":10,\"quantity\":1,\"sku_id\":\"\",\"spec\":\"\",\"unit\":\"份\"},{\"app_food_code\":\"椰果\",\"box_num\":1,\"box_price\":0,\"cart_id\":0,\"food_discount\":1,\"food_name\":\"椰果\",\"food_property\":\"\",\"price\":2,\"quantity\":1,\"sku_id\":\"\",\"spec\":\"\",\"unit\":\"份\"},{\"app_food_code\":\"大果粒水果茶\uD83C\uDF49\",\"box_num\":1,\"box_price\":0,\"cart_id\":0,\"food_discount\":1,\"food_name\":\"大果粒水果茶\uD83C\uDF49\",\"food_property\":\"少冰,半糖\",\"price\":18,\"quantity\":1,\"sku_id\":\"\",\"spec\":\"\",\"unit\":\"份\"}],\"cityId\":340100,\"ePoiId\":\"571022_756373515946561536\",\"extras\":[{\"act_detail_id\":1333158319,\"mt_charge\":0,\"poi_charge\":6,\"reduce_fee\":6,\"remark\":\"满28.0元减6.0元\",\"type\":2},{\"act_detail_id\":1980953437,\"mt_charge\":0,\"poi_charge\":1,\"reduce_fee\":1,\"remark\":\"减配送费1.0元\",\"type\":25},{}],\"hasInvoiced\":0,\"invoiceTitle\":\"\",\"isPre\":0,\"isThirdShipping\":0,\"latitude\":31.855104,\"longitude\":117.174992,\"poiReceiveDetail\":{\"actOrderChargeByMt\":[{\"comment\":\"活动款\",\"feeTypeDesc\":\"活动款\",\"feeTypeId\":10019,\"moneyCent\":0}],\"actOrderChargeByPoi\":[{\"comment\":\"满28.0元减6.0元\",\"feeTypeDesc\":\"活动款\",\"feeTypeId\":10019,\"moneyCent\":600},{\"comment\":\"减配送费1.0元\",\"feeTypeDesc\":\"活动款\",\"feeTypeId\":10019,\"moneyCent\":100}],\"foodShareFeeChargeByPoi\":414,\"logisticsFee\":350,\"onlinePayment\":2650,\"wmPoiReceiveCent\":1886},\"logisticsCode\":\"1001\",\"logisticsCompletedTime\":1532761925,\"logisticsConfirmTime\":1532760363,\"logisticsDispatcherMobile\":15215694098,\"logisticsDispatcherName\":\"潘步群\",\"logisticsFetchTime\":1532760997,\"logisticsId\":5,\"logisticsName\":\"加盟\",\"logisticsSendTime\":1532760337,\"logisticsStatus\":40,\"orderCompletedTime\":1532761925,\"orderConfirmTime\":1532760997,\"orderCancelTime\":\"\",\"orderId\":42360153909115061,\"orderIdView\":42360153909115061,\"orderSendTime\":1532760335,\"originalPrice\":33.5,\"payType\":2,\"pickType\":0,\"poiAddress\":\"长江西路与振兴路交口东北角加侨悦山城振兴路地铁站A1出口城市便捷酒店旁\",\"poiId\":4236015,\"poiName\":\"HEY JUICE茶桔便加侨悦山店\",\"poiPhone\":\"15156879980\",\"recipientAddress\":\"西城山水居 (西城山水居北门11栋1单元2401)@#安徽省合肥市蜀山区井岗路井岗路西城山水居\",\"recipientName\":\"张虹(女士)\",\"recipientPhone\":\"15656547948_5348\",\"shipperPhone\":\"15215694098\",\"shippingFee\":3.5,\"status\":8,\"total\":26.5,\"uTime\":1532761925,\"daySeq\":17,\"dinnersNumber\":0}";
String message = "大果粒水果茶\uD83C\uDF49";
message = EmojiParser.removeAllEmojis(message);
// MeituanOrderEntity entity = new MeituanOrderEntity(JSONObject.parseObject(message));
// List<MeituanOrderItemEntity> list = entity.getOrderItemList();
// for (MeituanOrderItemEntity groupEntity : list) {
// System.out.println(groupEntity.getDishName());
// }
System.out.println(message);
}
}

@ -0,0 +1,18 @@
package com.jwsaas.utils;
@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);
}
}

@ -0,0 +1,167 @@
package com.jwsaas.utils;
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<Object>() {
@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> T parseObject(String text, Class<T> clazz) {
try {
return objectMapper.readValue(text, clazz);
} catch (Exception e) {
throw new JSONException(e.getMessage(), e);
}
}
public static <T> T parseObject(String text, Class<T> clazz, String charsetName) {
try {
return objectMapper.readValue(text.getBytes(charsetName), clazz);
} catch (Exception e) {
throw new JSONException(e.getMessage(), e);
}
}
public static <T> T parseObject(String text, TypeReference<T> 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);
}
}
/**
* jsontagPath tagPath :
*
* @param json
* @param tagPath
* @return
* @throws Exception
*/
public static List<String> readValueFromJson(String json, String tagPath) throws Exception {
// 返回值
List<String> value = new ArrayList<String>();
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<String> 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);
}
}
}

@ -0,0 +1,106 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
<!-- 美团订单表服务 -->
<dubbo:reference id="foodMeituanOrderService"
interface="com.jwsaas.service.food.MeituanOrderService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
<!-- 美团订单优惠信息服务 -->
<dubbo:reference id="foodMeituanOrderExtraService"
interface="com.jwsaas.service.food.MeituanOrderExtraService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
<!-- 美团订单明细表服务 -->
<dubbo:reference id="foodMeituanOrderItemService"
interface="com.jwsaas.service.food.MeituanOrderItemService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
<!-- 饿了么订单信息服务 -->
<dubbo:reference id="foodElemeOrderDetailService"
interface="com.jwsaas.service.food.ElemeOrderDetailService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
<!-- 饿了么订单篮子明细服务 -->
<dubbo:reference id="foodElemeOrderDetailGroupService"
interface="com.jwsaas.service.food.ElemeOrderDetailGroupService"
version="${reference.version}" group="${reference.group}" timeout="${reference.timeout}"
retries="${reference.retries}" />
<!-- 百度外卖订单服务 -->
<dubbo:reference id="foodBaiduOrderService"
interface="com.jwsaas.service.food.BaiduOrderService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
<!-- 百度外卖订单商品信息服务 -->
<dubbo:reference id="foodBaiduOrderProductService"
interface="com.jwsaas.service.food.BaiduOrderProductService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
<!-- 美团菜品分类服务 -->
<dubbo:reference id="foodMeituanFoodCategoryService"
interface="com.jwsaas.service.food.MeituanFoodCategoryService"
version="${reference.version}" group="${reference.group}" timeout="${reference.timeout}"
retries="${reference.retries}" />
<!-- 美团菜品信息服务 -->
<dubbo:reference id="foodMeituanFoodService"
interface="com.jwsaas.service.food.MeituanFoodService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
<!-- 饿了么菜品分类服务 -->
<dubbo:reference id="foodElemeFoodCategoryService"
interface="com.jwsaas.service.food.ElemeFoodCategoryService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
<!-- 饿了么分类菜品信息服务 -->
<dubbo:reference id="foodElemeCategoryFoodService"
interface="com.jwsaas.service.food.ElemeCategoryFoodService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
<!-- 百度菜品信息服务 -->
<dubbo:reference id="foodBaiduFoodService"
interface="com.jwsaas.service.food.BaiduFoodService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
<!-- 企迈订单表服务 -->
<dubbo:reference id="foodQimaiOrderService"
interface="com.jwsaas.service.food.QimaiOrderService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
<!-- 企迈订单明细表服务 -->
<dubbo:reference id="foodQimaiOrderItemService"
interface="com.jwsaas.service.food.QimaiOrderItemService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
<!-- 企迈订单支付信息服务 -->
<dubbo:reference id="foodQimaiOrderPayService"
interface="com.jwsaas.service.food.QimaiOrderPayService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
<!-- 美团订单表服务 -->
<dubbo:reference id="foodShopMeituanOrderService"
interface="com.jwsaas.service.food.ShopMeituanOrderService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
<!-- 美团订单优惠信息服务 -->
<dubbo:reference id="foodShopMeituanOrderExtraService"
interface="com.jwsaas.service.food.ShopMeituanOrderExtraService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
<!-- 美团订单明细表服务 -->
<dubbo:reference id="foodShopMeituanOrderItemService"
interface="com.jwsaas.service.food.ShopMeituanOrderItemService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
<!-- 商家美团店铺设置门店服务 -->
<dubbo:reference id="opsAppShopmeituanSetStoreService"
interface="com.jwsaas.service.ops.AppShopmeituanSetStoreService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
</beans>

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
<dubbo:application name="${application.name}" owner="${application.owner}"
organization="jwsaas" />
<dubbo:registry protocol="zookeeper" client="curator"
address="${zk.connect}" file="${dubbo.cache.address}" />
</beans>

@ -0,0 +1,48 @@
#Global
global.encoding=UTF-8
global.locale=zh_CN
#application.sign,application.index\u90FD\u4E0D\u80FD\u91CD\u590D
application.name=foodWaiMai
application.owner=
application.sign=1
application.description=${application.name}
application.index=0
#\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=600000
reference.retries=1
#dubbo cache address
dubbo.cache.address=/home/project/food/dubbo/food-waimai-web.cache
# EMBEDDED SERVER CONFIGURATION (ServerProperties)
server.port=8200
server.servlet.context-path=/foodWaiMai
server.compression.enabled=true
server.compression.mime-types=text/html,text/xml,text/plain,text/css,text/javascript,application/javascript,application/json,application/xml
server.compression.min-response-size=2048
# FREEMARKER (FreeMarkerProperties)
spring.freemarker.cache=false
spring.freemarker.charset=${global.encoding}
spring.freemarker.settings.template_exception_handler=com.jwsaas.freemarker.DefaultTemplateExceptionHandler
spring.freemarker.settings.auto_import=spring.ftl as spring
# INTERNATIONALIZATION (MessageSourceProperties)
spring.messages.basename=i18n/messages
#RabbitMQ
spring.rabbitmq.host=192.168.0.110
spring.rabbitmq.port=5672
spring.rabbitmq.virtual-host=/dev_test
spring.rabbitmq.publisher-confirms=true
spring.rabbitmq.username=dev
spring.rabbitmq.password=dev

@ -0,0 +1,5 @@
project.name=\u9910\u996eV2\u5916\u5356\u63a5\u5355
project.boduo.name=\u9910\u996eV2\u5916\u5356\u63a5\u5355
project.description=\u9910\u996eV2\u5916\u5356\u63a5\u5355
project.version=2.0
project.softwareName=\u9910\u996eV2\u5916\u5356\u63a5\u5355

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property name="APP_Name" value="food-waimai-web" />
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%-5level] %logger{120} - %msg %n</Pattern>
</encoder>
</appender>
<logger name="org.springframework.core" level="INFO" />
<logger name="org.springframework.beans" level="INFO" />
<logger name="org.springframework.context" level="INFO" />
<logger name="org.springframework.aop" level="INFO" />
<logger name="org.springframework.web.servlet.mvc" level="INFO" />
<logger name="org.springframework.web.servlet.handler" level="INFO" />
<logger name="org.springframework.boot.autoconfigure.logging" level="INFO" />
<logger name="org.springframework.web.servlet.view" level="INFO" />
<logger name="org.springframework.boot.web.filter" level="INFO" />
<logger name="org.springframework.web.servlet" level="INFO" />
<logger name="org.hibernate.validator" level="INFO" />
<logger name="druid.sql" level="INFO" />
<logger name="org.redisson" level="INFO" />
<logger name="org.apache.zookeeper" level="INFO" />
<logger name="com.alibaba.dubbo" level="INFO" />
<!-- <logger name="com.jwsaas" level="DEBUG" /> -->
<root level="DEBUG">
<appender-ref ref="STDOUT" />
</root>
</configuration>

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title><@spring.message "project.name"/></title>
<link rel="shortcut icon" href="${base}/favicon.ico" type="image/x-icon" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="<@spring.message "project.name"/>">
<meta name="keywords" content="">
<meta name="author" content="">
</head>
<script type="text/javascript">
</script>
<body>
404
<a href="${base}">点我返回首页</a>
</body>
</html>

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title><@spring.message "project.name"/></title>
<link rel="shortcut icon" href="${base}/favicon.ico" type="image/x-icon" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="<@spring.message "project.name"/>">
<meta name="keywords" content="">
<meta name="author" content="">
</head>
<script type="text/javascript">
</script>
<body>
Something went wrong (4XX): ${status} ${error}<br/>
<a href="${base}">点我返回首页</a>
</body>
</html>

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title><@spring.message "project.name"/></title>
<link rel="shortcut icon" href="${base}/favicon.ico" type="image/x-icon" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="<@spring.message "project.name"/>">
<meta name="keywords" content="">
<meta name="author" content="">
</head>
<script type="text/javascript">
</script>
<body>
Something went wrong: ${status} ${error}<br/>
request=${springMacroRequestContext}<br/>
<a href="${base}">点我返回首页</a>
</body>
</html>

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title><@spring.message "project.name"/></title>
<link rel="shortcut icon" href="${base}/favicon.ico" type="image/x-icon" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="<@spring.message "project.name"/>">
<meta name="keywords" content="">
<meta name="author" content="">
</head>
<script type="text/javascript">
</script>
<body>
<@spring.message "project.name"/>Web服务
</body>
</html>

@ -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()}</#if></#macro>
<#global base><@basePath/></#global>
<#--
* message
*
* Macro to translate a message code into a message.
-->
<#macro message code>${springMacroRequestContext.getMessage(code)}</#macro>
<#--
* 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)}</#macro>
<#--
* messageArgs
*
* Macro to translate a message code with arguments into a message.
-->
<#macro messageArgs code, args>${springMacroRequestContext.getMessage(code, args)}</#macro>
<#--
* 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)}</#macro>
<#--
* theme
*
* Macro to translate a theme message code into a message.
-->
<#macro theme code>${springMacroRequestContext.getThemeMessage(code)}</#macro>
<#--
* 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)}</#macro>
<#--
* themeArgs
*
* Macro to translate a theme message code with arguments into a message.
-->
<#macro themeArgs code, args>${springMacroRequestContext.getThemeMessage(code, args)}</#macro>
<#--
* 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)}</#macro>
<#--
* 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}</#macro>
<#--
* 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)>
</#if>
<#-- 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("")>
</#if>
</#macro>
<#--
* 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("")>
</#if>
</#macro>
<#--
* 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/>
<input type="${fieldType}" id="${status.expression}" name="${status.expression}" value="<#if fieldType!="password">${stringStatusValue}</#if>" ${attributes}<@closeTag/>
</#macro>
<#--
* 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"/>
</#macro>
<#--
* 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"/>
</#macro>
<#--
* 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/>
<textarea id="${status.expression}" name="${status.expression}" ${attributes}>${stringStatusValue}</textarea>
</#macro>
<#--
* 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/>
<select id="${status.expression}" name="${status.expression}" ${attributes}>
<#if options?is_hash>
<#list options?keys as value>
<option value="${value?html}"<@checkSelected value/>>${options[value]?html}</option>
</#list>
<#else>
<#list options as value>
<option value="${value?html}"<@checkSelected value/>>${value?html}</option>
</#list>
</#if>
</select>
</#macro>
<#--
* 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/>
<select multiple="multiple" id="${status.expression}" name="${status.expression}" ${attributes}>
<#list options?keys as value>
<#assign isSelected = contains(status.value?default([""]), value)>
<option value="${value?html}"<#if isSelected> selected="selected"</#if>>${options[value]?html}</option>
</#list>
</select>
</#macro>
<#--
* 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 '&nbsp;' or '<br>'
* @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}">
<input type="radio" id="${id}" name="${status.expression}" value="${value?html}"<#if stringStatusValue == value> checked="checked"</#if> ${attributes}<@closeTag/>
<label for="${id}">${options[value]?html}</label>${separator}
</#list>
</#macro>
<#--
* 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 '&nbsp;' or '<br>'
* @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)>
<input type="checkbox" id="${id}" name="${status.expression}" value="${value?html}"<#if isSelected> checked="checked"</#if> ${attributes}<@closeTag/>
<label for="${id}">${options[value]?html}</label>${separator}
</#list>
<input type="hidden" name="_${status.expression}" value="on"/>
</#macro>
<#--
* 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 '<br>'.
* @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 == "">
<b>${error}</b>
<#else>
<#if classOrStyle?index_of(":") == -1><#assign attr="class"><#else><#assign attr="style"></#if>
<span ${attr}="${classOrStyle}">${error}</span>
</#if>
<#if error_has_next>${separator}</#if>
</#list>
</#macro>
<#--
* 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>
<#if stringStatusValue?is_string && stringStatusValue == value>selected="selected"</#if>
</#macro>
<#--
* 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></#if>
</#list>
<#return false>
</#function>
<#--
* 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>></#if>
</#macro>

@ -0,0 +1,106 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
<!-- 美团订单表服务 -->
<dubbo:reference id="foodMeituanOrderService"
interface="com.jwsaas.service.food.MeituanOrderService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
<!-- 美团订单优惠信息服务 -->
<dubbo:reference id="foodMeituanOrderExtraService"
interface="com.jwsaas.service.food.MeituanOrderExtraService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
<!-- 美团订单明细表服务 -->
<dubbo:reference id="foodMeituanOrderItemService"
interface="com.jwsaas.service.food.MeituanOrderItemService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
<!-- 饿了么订单信息服务 -->
<dubbo:reference id="foodElemeOrderDetailService"
interface="com.jwsaas.service.food.ElemeOrderDetailService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
<!-- 饿了么订单篮子明细服务 -->
<dubbo:reference id="foodElemeOrderDetailGroupService"
interface="com.jwsaas.service.food.ElemeOrderDetailGroupService"
version="${reference.version}" group="${reference.group}" timeout="${reference.timeout}"
retries="${reference.retries}" />
<!-- 百度外卖订单服务 -->
<dubbo:reference id="foodBaiduOrderService"
interface="com.jwsaas.service.food.BaiduOrderService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
<!-- 百度外卖订单商品信息服务 -->
<dubbo:reference id="foodBaiduOrderProductService"
interface="com.jwsaas.service.food.BaiduOrderProductService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
<!-- 美团菜品分类服务 -->
<dubbo:reference id="foodMeituanFoodCategoryService"
interface="com.jwsaas.service.food.MeituanFoodCategoryService"
version="${reference.version}" group="${reference.group}" timeout="${reference.timeout}"
retries="${reference.retries}" />
<!-- 美团菜品信息服务 -->
<dubbo:reference id="foodMeituanFoodService"
interface="com.jwsaas.service.food.MeituanFoodService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
<!-- 饿了么菜品分类服务 -->
<dubbo:reference id="foodElemeFoodCategoryService"
interface="com.jwsaas.service.food.ElemeFoodCategoryService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
<!-- 饿了么分类菜品信息服务 -->
<dubbo:reference id="foodElemeCategoryFoodService"
interface="com.jwsaas.service.food.ElemeCategoryFoodService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
<!-- 百度菜品信息服务 -->
<dubbo:reference id="foodBaiduFoodService"
interface="com.jwsaas.service.food.BaiduFoodService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
<!-- 企迈订单表服务 -->
<dubbo:reference id="foodQimaiOrderService"
interface="com.jwsaas.service.food.QimaiOrderService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
<!-- 企迈订单明细表服务 -->
<dubbo:reference id="foodQimaiOrderItemService"
interface="com.jwsaas.service.food.QimaiOrderItemService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
<!-- 企迈订单支付信息服务 -->
<dubbo:reference id="foodQimaiOrderPayService"
interface="com.jwsaas.service.food.QimaiOrderPayService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
<!-- 美团订单表服务 -->
<dubbo:reference id="foodShopMeituanOrderService"
interface="com.jwsaas.service.food.ShopMeituanOrderService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
<!-- 美团订单优惠信息服务 -->
<dubbo:reference id="foodShopMeituanOrderExtraService"
interface="com.jwsaas.service.food.ShopMeituanOrderExtraService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
<!-- 美团订单明细表服务 -->
<dubbo:reference id="foodShopMeituanOrderItemService"
interface="com.jwsaas.service.food.ShopMeituanOrderItemService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
<!-- 商家美团店铺设置门店服务 -->
<dubbo:reference id="opsAppShopmeituanSetStoreService"
interface="com.jwsaas.service.ops.AppShopmeituanSetStoreService" version="${reference.version}"
group="${reference.group}" timeout="${reference.timeout}" retries="${reference.retries}" />
</beans>

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
<dubbo:application name="${application.name}" owner="${application.owner}"
organization="jwsaas" />
<dubbo:registry protocol="zookeeper" client="curator"
address="${zk.connect}" file="${dubbo.cache.address}" />
</beans>

@ -0,0 +1,48 @@
#Global
global.encoding=UTF-8
global.locale=zh_CN
#application.sign,application.index\u90FD\u4E0D\u80FD\u91CD\u590D
application.name=foodWaiMai
application.owner=
application.sign=1
application.description=${application.name}
application.index=0
#\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=600000
reference.retries=1
#dubbo cache address
dubbo.cache.address=/home/project/food/dubbo/food-waimai-web.cache
# EMBEDDED SERVER CONFIGURATION (ServerProperties)
server.port=8200
server.servlet.context-path=/foodWaiMai
server.compression.enabled=true
server.compression.mime-types=text/html,text/xml,text/plain,text/css,text/javascript,application/javascript,application/json,application/xml
server.compression.min-response-size=2048
# FREEMARKER (FreeMarkerProperties)
spring.freemarker.cache=false
spring.freemarker.charset=${global.encoding}
spring.freemarker.settings.template_exception_handler=com.jwsaas.freemarker.DefaultTemplateExceptionHandler
spring.freemarker.settings.auto_import=spring.ftl as spring
# INTERNATIONALIZATION (MessageSourceProperties)
spring.messages.basename=i18n/messages
#RabbitMQ
spring.rabbitmq.host=192.168.0.110
spring.rabbitmq.port=5672
spring.rabbitmq.virtual-host=/dev_test
spring.rabbitmq.publisher-confirms=true
spring.rabbitmq.username=dev
spring.rabbitmq.password=dev

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save