food-open

main
unity 9 months ago
parent 66990995d2
commit 69c0bee4a0

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

@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8

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

@ -0,0 +1,37 @@
<?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="lib">
<attributes>
<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-open-api</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,6 @@
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
encoding/lib=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,50 @@
<?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>erp.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,168 @@
<?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$/lib" />
<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$/lib" type="java-resource" />
<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="module" module-name="food-api" />
<orderEntry type="library" name="Maven: com.jwsaas:common-utils:1.0.0" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context:4.3.22.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aop:4.3.22.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-beans:4.3.22.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-expression:4.3.22.RELEASE" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.10" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.0" 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.0.39.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: 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.javassist:javassist:3.21.0-GA" level="project" />
<orderEntry type="module-library">
<library name="Maven: com.jwsaas.open:open-core:1.0.0">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/open-core-1.0.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:1.5.19.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:1.5.19.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:1.5.19.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:1.5.19.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:1.5.19.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.slf4j:jcl-over-slf4j:1.7.25" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.25" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:log4j-over-slf4j:1.7.25" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:1.5.19.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:8.5.37" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat:tomcat-annotations-api:8.5.37" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:8.5.37" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:8.5.37" level="project" />
<orderEntry type="library" name="Maven: org.hibernate:hibernate-validator:5.3.6.Final" level="project" />
<orderEntry type="library" name="Maven: javax.validation:validation-api:1.1.0.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:4.3.22.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:4.3.22.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-freemarker:1.5.19.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:4.3.22.RELEASE" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:1.5.19.RELEASE" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test:1.5.19.RELEASE" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:1.5.19.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.jayway.jsonpath:json-path:2.2.0" level="project" />
<orderEntry type="library" name="Maven: net.minidev:json-smart:2.2.1" level="project" />
<orderEntry type="library" name="Maven: net.minidev:accessors-smart:1.1" level="project" />
<orderEntry type="library" name="Maven: org.ow2.asm:asm:5.0.3" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:2.6.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:1.10.19" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.1" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-library:1.3" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.4.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-core:4.3.22.RELEASE" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:4.3.22.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.47" level="project" />
<orderEntry type="library" name="Maven: org.redisson:redisson:3.3.2" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-common:4.1.8.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.8.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.8.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.8.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.8.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-handler:4.1.8.Final" level="project" />
<orderEntry type="library" name="Maven: javax.cache:cache-api:1.0.0" level="project" />
<orderEntry type="library" name="Maven: io.projectreactor:reactor-stream:2.0.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: io.projectreactor:reactor-core:2.0.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.0" level="project" />
<orderEntry type="library" name="Maven: io.projectreactor.spring:reactor-spring-context:2.0.7.RELEASE" level="project" />
<orderEntry type="library" name="Maven: io.projectreactor.spring:reactor-spring-core:2.0.7.RELEASE" level="project" />
<orderEntry type="library" name="Maven: io.projectreactor:reactor-bus:2.0.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.goldmansachs:gs-collections:5.1.0" level="project" />
<orderEntry type="library" name="Maven: com.goldmansachs:gs-collections-api:5.1.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.4" level="project" />
<orderEntry type="library" name="Maven: commons-io:commons-io:2.5" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.6" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.10" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpmime:4.5.6" level="project" />
<orderEntry type="library" name="Maven: net.sourceforge.pinyin4j:pinyin4j:2.5.0" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-amqp:1.5.19.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-messaging:4.3.22.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.amqp:spring-rabbit:1.7.12.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-tx:4.3.22.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.retry:spring-retry:1.2.3.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.rabbitmq:http-client:1.1.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.rabbitmq:amqp-client:4.8.3" level="project" />
<orderEntry type="library" name="Maven: org.springframework.amqp:spring-amqp:1.7.12.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.0" level="project" />
<orderEntry type="library" name="Maven: com.thoughtworks.xstream:xstream:1.4.9" level="project" />
<orderEntry type="library" name="Maven: xmlpull:xmlpull:1.1.3.1" level="project" />
<orderEntry type="library" name="Maven: xpp3:xpp3_min:1.1.4c" 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.core:jackson-databind:2.9.4" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.9.4" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.9.4" level="project" />
<orderEntry type="library" name="Maven: org.codehaus.woodstox:stax2-api:3.1.4" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.woodstox:woodstox-core:5.0.3" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.9.4" level="project" />
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.17" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.9.4" level="project" />
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.59" level="project" />
<orderEntry type="library" name="Maven: dom4j:dom4j:1.6.1" level="project" />
<orderEntry type="library" name="Maven: xml-apis:xml-apis:1.4.01" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.servlet:javax.servlet-api:3.1.0" level="project" />
<orderEntry type="module-library">
<library name="Maven: com.qiniu:qiniu-logging-plugin-logback:1.0.1">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/qiniu-logging-plugin-logback-1.0.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="Maven: com.qiniu:qiniu-pandora-sdk:2.1.0">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/qiniu-pandora-sdk-2.1.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="Maven: com.squareup.okhttp3:okhttp:3.3.1" level="project" />
<orderEntry type="library" name="Maven: com.squareup.okio:okio:1.8.0" level="project" />
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.6.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
</component>
</module>

@ -0,0 +1,296 @@
<?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-open</artifactId>
<version>2.0.0</version>
</parent>
<artifactId>food-open-api</artifactId>
<name>food-open-api</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.boot.version>1.5.19.RELEASE</spring.boot.version>
<pinyin4j.version>2.5.0</pinyin4j.version>
<!-- MQTT Client -->
<mqttv3.version>1.2.0</mqttv3.version>
<xstream.version>1.4.9</xstream.version>
<bcprov.jdk15o.version>1.59</bcprov.jdk15o.version>
<servlet.api.version>3.1.0</servlet.api.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>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-releasetrain</artifactId>
<version>Fowler-SR2</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.jwsaas</groupId>
<artifactId>food-api</artifactId>
</dependency>
<dependency>
<groupId>com.jwsaas</groupId>
<artifactId>common-utils</artifactId>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</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>
<exclusion>
<artifactId>netty</artifactId>
<groupId>io.netty</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo</artifactId>
<version>2.6.5</version>
<exclusions>
<exclusion>
<artifactId>netty</artifactId>
<groupId>org.jboss.netty</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.jwsaas.open</groupId>
<artifactId>open-core</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${basedir}/lib/open-core-1.0.0.jar</systemPath>
</dependency>
<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.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- fastjson -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
</dependency>
<!-- redisson -->
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson</artifactId>
</dependency>
<!-- reactor-spring -->
<dependency>
<groupId>io.projectreactor.spring</groupId>
<artifactId>reactor-spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
</dependency>
<dependency>
<groupId>net.sourceforge.pinyin4j</groupId>
<artifactId>pinyin4j</artifactId>
<version>${pinyin4j.version}</version>
</dependency>
<!-- mq -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
<!-- MQTT Client -->
<dependency>
<groupId>org.eclipse.paho</groupId>
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
<version>${mqttv3.version}</version>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>${xstream.version}</version>
</dependency>
<!-- jackson -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>${bcprov.jdk15o.version}</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
<!-- j2ee -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>${servlet.api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.qiniu</groupId>
<artifactId>qiniu-logging-plugin-logback</artifactId>
<version>1.0.1</version>
<scope>system</scope>
<systemPath>${basedir}/lib/qiniu-logging-plugin-logback-1.0.1.jar</systemPath>
</dependency>
<dependency>
<groupId>com.qiniu</groupId>
<artifactId>qiniu-pandora-sdk</artifactId>
<version>2.1.0</version>
<scope>system</scope>
<systemPath>${basedir}/lib/qiniu-pandora-sdk-2.1.0.jar</systemPath>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>3.3.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.6.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.5.6</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>
<!-- 打包运行时需启用以下配置Start -->
<resources>
<resource>
<directory>${basedir}/lib</directory>
<targetPath>BOOT-INF/lib/</targetPath>
<includes>
<include>**/*.jar</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<targetPath>BOOT-INF/classes/</targetPath>
<excludes>
<exclude>application.properties</exclude>
<exclude>logback.xml</exclude>
</excludes>
</resource>
</resources>
<!-- 打包运行时需启用以下配置End -->
</build>
</project>

@ -0,0 +1,10 @@
2018-04-16
************更新记录************
优化修复:
1)xxx
新增功能:
1)交班信息上传时增加支付方式明细信息;
2)xxx

@ -0,0 +1,21 @@
1.com.boduo.Application中的main方法直接运行。适用于开发模式
2.打包运行。适用于安装部署。
注:
<!-- 打包运行时需启用以下配置 -->
<resources>
<resource>
<directory>${basedir}/src/lib</directory>
<targetPath>BOOT-INF/lib/</targetPath>
<includes>
<include>**/*.jar</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<targetPath>BOOT-INF/classes/</targetPath>
</resource>
</resources>

@ -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=-Xms512m
wrapper.java.additional.2=-Xmx1024m
wrapper.java.additional.3=-XX:PermSize=256m
wrapper.java.additional.4=-XX:MaxPermSize=512m
wrapper.java.additional.5=-Djava.net.preferIPv4Stack=true
wrapper.java.additional.6=-Dsun.lang.ClassLoader.allowArraySyntax=true
# Initial Java Heap Size (in MB)
wrapper.java.initmemory=128
# Maximum Java Heap Size (in MB)
wrapper.java.maxmemory=512
# Application parameters. Add parameters as needed starting from 1
wrapper.app.parameter.1=org.springframework.boot.loader.JarLauncher
wrapper.app.parameter.2=--spring.config.location=../conf/application.properties
wrapper.app.parameter.3=--logging.config=../conf/logback.xml
wrapper.app.parameter.4=--logging.path=../logs
wrapper.filter.trigger.1=java.lang.OutOfMemoryError
wrapper.filter.action.1=RESTART
wrapper.console.format=PM
wrapper.console.loglevel=INFO
wrapper.logfile=../logs/server_YYYYMMDD.log
wrapper.logfile.rollmode=DATE
wrapper.logfile.format=LPTM
wrapper.logfile.loglevel=INFO
wrapper.logfile.maxsize=0
wrapper.logfile.maxfiles=0
wrapper.syslog.loglevel=NONE
wrapper.ignore_sequence_gaps=TRUE
wrapper.pidfile.strict=TRUE
wrapper.console.title=Food-2.0 Open Api Application
wrapper.name=food2_open_api
wrapper.displayname=Food-2.0 Open Api Application
wrapper.description=Food-2.0 Open Api Application
wrapper.ntservice.dependency.1=
wrapper.ntservice.starttype=AUTO_START
wrapper.ntservice.interactive=false

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

@ -0,0 +1,30 @@
package com.jwsaas;
public class Constant {
/**
*
*/
public static final String DEFAULT_DB_SIGN = "10001";
/**
*
*/
public static final String CREATE_USER = "OpenApi";
/**
* redis
*/
public static final String DEFAULT_REDIS_PREFIX = "food20OpenApi";
/**
* (shared)
*/
public static final String SHARED_SIGN = "shared";
/**
* (food2)
*/
public static final String FOOD_SIGN = "food2";
}

@ -0,0 +1,8 @@
package com.jwsaas;
public class Global {
public static final String APP_SIGN = "food";
public static final String DATA_LIMIT = "30000";
}

@ -0,0 +1,23 @@
package com.jwsaas.api.boduo.erp.request;
import com.jwsaas.api.request.AbstractRequest;
import javax.validation.constraints.NotNull;
/**
* @Author:CHL
* @Date:Create in 2018/04/02
* @Description: erp
*/
public class AskTicketMoneyListRequest extends AbstractRequest {
@NotNull
private String ticketId;
public String getTicketId() {
return ticketId;
}
public void setTicketId(String ticketId) {
this.ticketId = ticketId;
}
}

@ -0,0 +1,81 @@
package com.jwsaas.api.boduo.erp.request;
import com.jwsaas.api.request.AbstractRequest;
import com.jwsaas.open.annotation.IgnoreSign;
import javax.validation.constraints.NotNull;
/**
* Created by Administrator on 2019\9\25 0025.
*/
public class CreateDispatchTicketRequest extends AbstractRequest {
@NotNull
private String storeErpNo;//要货门店定制erp门店编号
@IgnoreSign
private Double logisticsFee;//物流费用
@IgnoreSign
private Double orderMoney;//原料费用;
@IgnoreSign
private Double otherFee;//其他费用;
@IgnoreSign
private String description;//备注;
@IgnoreSign
@NotNull
private String materialInfo;//要货信息;
public String getStoreErpNo() {
return storeErpNo;
}
public void setStoreErpNo(String storeErpNo) {
this.storeErpNo = storeErpNo;
}
public Double getLogisticsFee() {
return logisticsFee;
}
public void setLogisticsFee(Double logisticsFee) {
this.logisticsFee = logisticsFee;
}
public Double getOrderMoney() {
return orderMoney;
}
public void setOrderMoney(Double orderMoney) {
this.orderMoney = orderMoney;
}
public Double getOtherFee() {
return otherFee;
}
public void setOtherFee(Double otherFee) {
this.otherFee = otherFee;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getMaterialInfo() {
return materialInfo;
}
public void setMaterialInfo(String materialInfo) {
this.materialInfo = materialInfo;
}
}

@ -0,0 +1,14 @@
package com.jwsaas.api.boduo.erp.request;
import com.jwsaas.api.request.AbstractRequest;
import javax.validation.constraints.NotNull;
/**
* @Author:CHL
* @Date:Create in 2018/3/30
* @Description: erp
*/
public class DeliveryModeListRequest extends AbstractRequest {
}

@ -0,0 +1,23 @@
package com.jwsaas.api.boduo.erp.request;
import com.jwsaas.api.request.AbstractRequest;
import javax.validation.constraints.NotNull;
/**
* @Author:CHL
* @Date:Create in 2018/4/28
* @Description: pos erp
*/
public class DishToErpSyncRequest extends AbstractRequest {
@NotNull
private String dishJson; //菜品json
public String getDishJson() {
return dishJson;
}
public void setDishJson(String dishJson) {
this.dishJson = dishJson;
}
}

@ -0,0 +1,8 @@
package com.jwsaas.api.boduo.erp.request;
import com.jwsaas.api.request.store.StoreBaseRequest;
import com.jwsaas.open.annotation.IgnoreSign;
public class ErpProductRatioRequest extends StoreBaseRequest {
}

@ -0,0 +1,9 @@
package com.jwsaas.api.boduo.erp.request;
import com.jwsaas.api.request.store.StoreBaseRequest;
import com.jwsaas.open.annotation.IgnoreSign;
public class ErpProductRequest extends StoreBaseRequest{
}

@ -0,0 +1,8 @@
package com.jwsaas.api.boduo.erp.request;
import com.jwsaas.api.request.store.StoreBaseRequest;
import com.jwsaas.open.annotation.IgnoreSign;
public class ErpProductSpecRequest extends StoreBaseRequest{
}

@ -0,0 +1,34 @@
package com.jwsaas.api.boduo.erp.request;
import com.jwsaas.api.request.AbstractRequest;
import javax.validation.constraints.NotNull;
/**
* @Author:CHL
* @Date:Create in 2018/4/27
* @Description: erppos
*/
public class ErpStoreAskMaterialRequest extends AbstractRequest {
@NotNull
private String customerNo; //erp客户编号
@NotNull
private String matePriceJson ; //erp中新物料编号与价格
public String getCustomerNo() {
return customerNo;
}
public void setCustomerNo(String customerNo) {
this.customerNo = customerNo;
}
public String getMatePriceJson() {
return matePriceJson;
}
public void setMatePriceJson(String matePriceJson) {
this.matePriceJson = matePriceJson;
}
}

@ -0,0 +1,63 @@
package com.jwsaas.api.boduo.erp.request;
import com.jwsaas.api.request.AbstractRequest;
import javax.validation.constraints.NotNull;
/**
* @Author:CHL
* @Date:Create in 2018/4/28
* @Description: erp pos
*/
public class ErpToPosMaterialSyncRequest extends AbstractRequest {
@NotNull
private String cInvCode; //物料编号
@NotNull
private String cInvName; //物料名称
@NotNull
private String cInvStd; //物料规格
@NotNull
private String cInvCCode; //分类编号
@NotNull
private String cComUnitCode; //主计量单位编码
public String getcInvCode() {
return cInvCode;
}
public void setcInvCode(String cInvCode) {
this.cInvCode = cInvCode;
}
public String getcInvName() {
return cInvName;
}
public void setcInvName(String cInvName) {
this.cInvName = cInvName;
}
public String getcInvStd() {
return cInvStd;
}
public void setcInvStd(String cInvStd) {
this.cInvStd = cInvStd;
}
public String getcInvCCode() {
return cInvCCode;
}
public void setcInvCCode(String cInvCCode) {
this.cInvCCode = cInvCCode;
}
public String getcComUnitCode() {
return cComUnitCode;
}
public void setcComUnitCode(String cComUnitCode) {
this.cComUnitCode = cComUnitCode;
}
}

@ -0,0 +1,23 @@
package com.jwsaas.api.boduo.erp.request;
import com.jwsaas.api.request.AbstractRequest;
import javax.validation.constraints.NotNull;
/**
* @Author:CHL
* @Date:Create in 2018/3/22
* @Description:
*/
public class MaterialDetailRequest extends AbstractRequest {
@NotNull
private String storeId;
public String getStoreId() {
return storeId;
}
public void setStoreId(String storeId) {
this.storeId = storeId;
}
}

@ -0,0 +1,23 @@
package com.jwsaas.api.boduo.erp.request;
import com.jwsaas.api.request.AbstractRequest;
import javax.validation.constraints.NotNull;
/**
* @Author:CHL
* @Date:Create in 2018/4/28
* @Description: erp pos
*/
public class MaterialToErpSyncRequest extends AbstractRequest {
@NotNull
private String matreialJson; //原料json
public String getMatreialJson() {
return matreialJson;
}
public void setMatreialJson(String matreialJson) {
this.matreialJson = matreialJson;
}
}

@ -0,0 +1,12 @@
package com.jwsaas.api.boduo.erp.request;
import com.jwsaas.api.request.AbstractRequest;
/**
* @Author:CHL
* @Date:Create in 2018/3/23
* @Description:
*/
public class MaterialTypeRequest extends AbstractRequest {
}

@ -0,0 +1,14 @@
package com.jwsaas.api.boduo.erp.request;
import com.jwsaas.api.request.AbstractRequest;
import javax.validation.constraints.NotNull;
/**
* @Author:CHL
* @Date:Create in 2018/3/23
* @Description:
*/
public class MaterialUnitRequest extends AbstractRequest {
}

@ -0,0 +1,60 @@
package com.jwsaas.api.boduo.erp.request;
import com.jwsaas.api.request.AbstractRequest;
import javax.validation.constraints.NotNull;
/**
* @Author:CHL
* @Date:Create in 2018/04/02
* @Description: erp
*/
public class PayMoneyTicketRequest extends AbstractRequest {
@NotNull
private String askGoodsTicket;
@NotNull
private Integer isHaveT6Blance; //是否使用余额度
private Integer deliveryMode; //配送标识
private String payType; //付款方式
private Integer isAskGoods; //是否要货
public String getAskGoodsTicket() {
return askGoodsTicket;
}
public void setAskGoodsTicket(String askGoodsTicket) {
this.askGoodsTicket = askGoodsTicket;
}
public Integer getIsHaveT6Blance() {
return isHaveT6Blance;
}
public void setIsHaveT6Blance(Integer isHaveT6Blance) {
this.isHaveT6Blance = isHaveT6Blance;
}
public Integer getDeliveryMode() {
return deliveryMode;
}
public void setDeliveryMode(Integer deliveryMode) {
this.deliveryMode = deliveryMode;
}
public String getPayType() {
return payType;
}
public void setPayType(String payType) {
this.payType = payType;
}
public Integer getIsAskGoods() {
return isAskGoods;
}
public void setIsAskGoods(Integer isAskGoods) {
this.isAskGoods = isAskGoods;
}
}

@ -0,0 +1,23 @@
package com.jwsaas.api.boduo.erp.request;
import com.jwsaas.api.request.AbstractRequest;
import javax.validation.constraints.NotNull;
/**
* @Author:CHL
* @Date:Create in 2018/3/30
* @Description: erp
*/
public class StoreAskMaterialSyncRequest extends AbstractRequest {
@NotNull
private String storeId;
public String getStoreId() {
return storeId;
}
public void setStoreId(String storeId) {
this.storeId = storeId;
}
}

@ -0,0 +1,22 @@
package com.jwsaas.api.boduo.erp.request;
import javax.validation.constraints.NotNull;
import com.jwsaas.api.request.AbstractRequest;
import com.jwsaas.open.annotation.IgnoreSign;
public class SyncMaterialRequest extends AbstractRequest {
@NotNull
@IgnoreSign
private String material;// 原料JSON
public String getMaterial() {
return material;
}
public void setMaterial(String material) {
this.material = material;
}
}

@ -0,0 +1,22 @@
package com.jwsaas.api.boduo.erp.request;
import javax.validation.constraints.NotNull;
import com.jwsaas.api.request.AbstractRequest;
import com.jwsaas.open.annotation.IgnoreSign;
public class SyncMaterialTypeRequest extends AbstractRequest {
@NotNull
@IgnoreSign
private String materialType;// 原料分类JSON
public String getMaterialType() {
return materialType;
}
public void setMaterialType(String materialType) {
this.materialType = materialType;
}
}

@ -0,0 +1,22 @@
package com.jwsaas.api.boduo.erp.request;
import javax.validation.constraints.NotNull;
import com.jwsaas.api.request.AbstractRequest;
import com.jwsaas.open.annotation.IgnoreSign;
public class SyncMaterialUnitRequest extends AbstractRequest {
@NotNull
@IgnoreSign
private String materialUnit;// 原料单位JSON
public String getMaterialUnit() {
return materialUnit;
}
public void setMaterialUnit(String materialUnit) {
this.materialUnit = materialUnit;
}
}

@ -0,0 +1,33 @@
package com.jwsaas.api.boduo.erp.request;
import com.jwsaas.api.request.AbstractRequest;
import javax.validation.constraints.NotNull;
/**
* @Author:CHL
* @Date:Create in 2018/5/16
* @Description:v1v2
*/
public class V1PosDishToV2Request extends AbstractRequest {
@NotNull
private String storeNos; //升级的门店编号
@NotNull
private String v1TenantId; //v1门店编号
public String getStoreNos() {
return storeNos;
}
public void setStoreNos(String storeNos) {
this.storeNos = storeNos;
}
public String getV1TenantId() {
return v1TenantId;
}
public void setV1TenantId(String v1TenantId) {
this.v1TenantId = v1TenantId;
}
}

@ -0,0 +1,117 @@
package com.jwsaas.api.boduo.erp.response;
/**
* @Author:CHL
* @Date:Create in 2018/04/02
* @Description: erp
*/
public class AskTicketMoneyListResponse {
private int status;
private String message;
private String errCode;
private String errMessage;
private Double sumMaterialMoney; //原料金额
private Double storeBalance; // 账户余额
private Double storeRebate; //返利
private Double useRebate; //能用的返利
private Double usualFreight; //常温运费
private Double coldFreight; //冷链运费
private Double askSumMoney; //要货总金额
private String description; // 备注
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getErrCode() {
return errCode;
}
public void setErrCode(String errCode) {
this.errCode = errCode;
}
public String getErrMessage() {
return errMessage;
}
public void setErrMessage(String errMessage) {
this.errMessage = errMessage;
}
public Double getSumMaterialMoney() {
return sumMaterialMoney;
}
public void setSumMaterialMoney(Double sumMaterialMoney) {
this.sumMaterialMoney = sumMaterialMoney;
}
public Double getStoreBalance() {
return storeBalance;
}
public void setStoreBalance(Double storeBalance) {
this.storeBalance = storeBalance;
}
public Double getStoreRebate() {
return storeRebate;
}
public void setStoreRebate(Double storeRebate) {
this.storeRebate = storeRebate;
}
public Double getUseRebate() {
return useRebate;
}
public void setUseRebate(Double useRebate) {
this.useRebate = useRebate;
}
public Double getUsualFreight() {
return usualFreight;
}
public void setUsualFreight(Double usualFreight) {
this.usualFreight = usualFreight;
}
public Double getColdFreight() {
return coldFreight;
}
public void setColdFreight(Double coldFreight) {
this.coldFreight = coldFreight;
}
public Double getAskSumMoney() {
return askSumMoney;
}
public void setAskSumMoney(Double askSumMoney) {
this.askSumMoney = askSumMoney;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}

@ -0,0 +1,58 @@
package com.jwsaas.api.boduo.erp.response;
import com.alibaba.fastjson.JSONArray;
/**
* @Author:CHL
* @Date:Create in 2018/3/23
* @Description:
*/
public class DeliveryModeListResponse {
private int status;
private String message;
private String errCode;
private String errMessage;
private JSONArray list; //配送方式集合
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getErrCode() {
return errCode;
}
public void setErrCode(String errCode) {
this.errCode = errCode;
}
public String getErrMessage() {
return errMessage;
}
public void setErrMessage(String errMessage) {
this.errMessage = errMessage;
}
public JSONArray getList() {
return list;
}
public void setList(JSONArray list) {
this.list = list;
}
}

@ -0,0 +1,57 @@
package com.jwsaas.api.boduo.erp.response;
/**
* @Author:CHL
* @Date:Create in 2018/3/23
* @Description:
*/
public class MaterialDetailResponse {
private int status;
private String message;
private String errCode;
private String errMessage;
private Integer count; //返回的执行记录数
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getErrCode() {
return errCode;
}
public void setErrCode(String errCode) {
this.errCode = errCode;
}
public String getErrMessage() {
return errMessage;
}
public void setErrMessage(String errMessage) {
this.errMessage = errMessage;
}
public Integer getCount() {
return count;
}
public void setCount(Integer count) {
this.count = count;
}
}

@ -0,0 +1,57 @@
package com.jwsaas.api.boduo.erp.response;
/**
* @Author:CHL
* @Date:Create in 2018/3/23
* @Description:
*/
public class MaterialTypeResponse {
private int status;
private String message;
private String errCode;
private String errMessage;
private Integer count; //返回的执行记录数
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getErrCode() {
return errCode;
}
public void setErrCode(String errCode) {
this.errCode = errCode;
}
public String getErrMessage() {
return errMessage;
}
public void setErrMessage(String errMessage) {
this.errMessage = errMessage;
}
public Integer getCount() {
return count;
}
public void setCount(Integer count) {
this.count = count;
}
}

@ -0,0 +1,57 @@
package com.jwsaas.api.boduo.erp.response;
/**
* @Author:CHL
* @Date:Create in 2018/3/23
* @Description:
*/
public class MaterialUnitResponse {
private int status;
private String message;
private String errCode;
private String errMessage;
private Integer count; //返回的执行记录数
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getErrCode() {
return errCode;
}
public void setErrCode(String errCode) {
this.errCode = errCode;
}
public String getErrMessage() {
return errMessage;
}
public void setErrMessage(String errMessage) {
this.errMessage = errMessage;
}
public Integer getCount() {
return count;
}
public void setCount(Integer count) {
this.count = count;
}
}

@ -0,0 +1,54 @@
package com.jwsaas.api.boduo.erp.response;
/**
* @Author:CHL
* @Date:Create in 2018/04/02
* @Description: erp
*/
public class PayMoneyTicketResponse {
private String status;
private String message;
private Double storeBalance; //账户余额
private Double storeRebate; // 返利金额
private Double payMoney; //要货扣除的金额
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public Double getStoreBalance() {
return storeBalance;
}
public void setStoreBalance(Double storeBalance) {
this.storeBalance = storeBalance;
}
public Double getStoreRebate() {
return storeRebate;
}
public void setStoreRebate(Double storeRebate) {
this.storeRebate = storeRebate;
}
public Double getPayMoney() {
return payMoney;
}
public void setPayMoney(Double payMoney) {
this.payMoney = payMoney;
}
}

@ -0,0 +1,57 @@
package com.jwsaas.api.boduo.erp.response;
/**
* @Author:CHL
* @Date:Create in 2018/3/23
* @Description:
*/
public class StoreAskMaterialSyncResponse {
private int status;
private String message;
private String errCode;
private String errMessage;
private Integer count; //返回的执行记录数
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getErrCode() {
return errCode;
}
public void setErrCode(String errCode) {
this.errCode = errCode;
}
public String getErrMessage() {
return errMessage;
}
public void setErrMessage(String errMessage) {
this.errMessage = errMessage;
}
public Integer getCount() {
return count;
}
public void setCount(Integer count) {
this.count = count;
}
}

@ -0,0 +1,34 @@
package com.jwsaas.api.boduo.erp.service;
import com.jwsaas.api.boduo.erp.request.AskTicketMoneyListRequest;
import com.jwsaas.api.boduo.erp.request.CreateDispatchTicketRequest;
import com.jwsaas.api.boduo.erp.request.PayMoneyTicketRequest;
import com.jwsaas.api.service.WopService;
/**
* @Author:CHL
* @Date:Create in 2018/3/30
* @Description: erp
*/
public interface AskGoodsTicketErpService extends WopService {
/**
* erp
* @param request
* @return
*/
Object getErpAskTicketMoneyList(AskTicketMoneyListRequest request);
/***
*
* @param request
* @return
*/
Object doErpPayMoneyTicket(PayMoneyTicketRequest request);
/**
* erp
* @param request
* @return
*/
Object createDispatchTicket(CreateDispatchTicketRequest request);
}

@ -0,0 +1,13 @@
package com.jwsaas.api.boduo.erp.service;
import com.jwsaas.api.boduo.erp.request.DeliveryModeListRequest;
import com.jwsaas.api.service.WopService;
/**
* @Author:CHL
* @Date:Create in 2018/3/30
* @Description: erp
*/
public interface DeliveryModeListService extends WopService {
Object getDeliveryModeList(DeliveryModeListRequest request);
}

@ -0,0 +1,14 @@
package com.jwsaas.api.boduo.erp.service;
import com.jwsaas.api.boduo.erp.request.ErpToPosMaterialSyncRequest;
import com.jwsaas.api.service.WopService;
/**
* @Author:CHL
* @Date:Create in 2018/4/28
* @Description: erp pos
*/
public interface ErpToPosDataService extends WopService {
Object saveMaterialDetail(ErpToPosMaterialSyncRequest request);
}

@ -0,0 +1,21 @@
package com.jwsaas.api.boduo.erp.service;
import com.jwsaas.api.boduo.erp.request.MaterialDetailRequest;
import com.jwsaas.api.boduo.erp.request.SyncMaterialRequest;
import com.jwsaas.api.service.WopService;
/**
* @Author:CHL
* @Date:Create in 2018/3/22
* @Description:
*/
public interface MaterialDetailService extends WopService {
Object getMaterialDetailTea(MaterialDetailRequest request);
/**
* ERP
* @param request
* @return
*/
Object syncMaterial(SyncMaterialRequest request);
}

@ -0,0 +1,22 @@
package com.jwsaas.api.boduo.erp.service;
import com.jwsaas.api.boduo.erp.request.MaterialTypeRequest;
import com.jwsaas.api.boduo.erp.request.SyncMaterialTypeRequest;
import com.jwsaas.api.service.WopService;
/**
* @Author:CHL
* @Date:Create in 2018/3/23
* @Description: erp
*/
public interface MaterialTypeService extends WopService {
Object getMaterialTypeTea(MaterialTypeRequest request);
/**
* ERP
* @param request
* @return
*/
Object syncMaterialType(SyncMaterialTypeRequest request);
}

@ -0,0 +1,24 @@
package com.jwsaas.api.boduo.erp.service;
import com.jwsaas.api.boduo.erp.request.MaterialUnitRequest;
import com.jwsaas.api.boduo.erp.request.SyncMaterialUnitRequest;
import com.jwsaas.api.service.WopService;
/**
* @Author:CHL
* @Date:Create in 2018/3/23
* @Description: erp
*/
public interface MaterialUnitService extends WopService {
Object getMaterialUnitTea(MaterialUnitRequest request);
/**
* ERP
* @param request
* @return
*/
Object syncMaterialUnit(SyncMaterialUnitRequest request);
}

@ -0,0 +1,71 @@
package com.jwsaas.api.boduo.erp.service;
import com.jwsaas.api.boduo.erp.request.DishToErpSyncRequest;
import com.jwsaas.api.boduo.erp.request.ErpProductRatioRequest;
import com.jwsaas.api.boduo.erp.request.ErpProductRequest;
import com.jwsaas.api.boduo.erp.request.ErpProductSpecRequest;
import com.jwsaas.api.boduo.erp.request.MaterialToErpSyncRequest;
import com.jwsaas.api.request.product.ProductRatioRequest;
import com.jwsaas.api.request.product.ProductRequest;
import com.jwsaas.api.request.product.ProductSpecRequest;
import com.jwsaas.api.service.WopService;
/**
* @Author:CHL
* @Date:Create in 2018/4/28
* @Description: pos erp
*/
public interface PosToErpDataService extends WopService {
Object saveDishSyncErpDetail(DishToErpSyncRequest request);
Object saveMaterialSyncErpDetail(MaterialToErpSyncRequest request);
// /**
// * 原料资料
// *
// * @param request
// * @return
// */
// Object erpProductList(ErpProductRequest request);
//
// /**
// * 原料规格资料
// *
// * @param request
// * @return
// */
// Object erpProductSpec(ErpProductSpecRequest request);
//
// /**
// * 原料库存系数
// *
// * @param request
// * @return
// */
// Object erpProductRatio(ErpProductRatioRequest request);
/**
*
*
* @param request
* @return
*/
Object boduoProductList(ProductRequest request);
/**
*
*
* @param request
* @return
*/
Object boduoProductSpec(ProductSpecRequest request);
/**
*
*
* @param request
* @return
*/
Object boduoProductRatio(ProductRatioRequest request);
}

@ -0,0 +1,15 @@
package com.jwsaas.api.boduo.erp.service;
import com.jwsaas.api.boduo.erp.request.ErpStoreAskMaterialRequest;
import com.jwsaas.api.boduo.erp.request.StoreAskMaterialSyncRequest;
import com.jwsaas.api.service.WopService;
/**
* @Author:CHL
* @Date:Create in 2018/3/30
* @Description: erp
*/
public interface StoreAskMaterialSyncService extends WopService {
Object getAskMaterialSync(StoreAskMaterialSyncRequest request);
Object getErpStoreAskMaterial(ErpStoreAskMaterialRequest request);
}

@ -0,0 +1,14 @@
package com.jwsaas.api.boduo.erp.service;
import com.jwsaas.api.boduo.erp.request.V1PosDishToV2Request;
import com.jwsaas.api.service.WopService;
/**
* @Author:CHL
* @Date:Create in 2018/05/16
* @Description: v1v2
*/
public interface V1PosToV2PosDataService extends WopService {
Object saveV1PosDishToV2Detail(V1PosDishToV2Request request);
}

@ -0,0 +1,601 @@
package com.jwsaas.api.boduo.erp.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jwsaas.api.boduo.erp.request.AskTicketMoneyListRequest;
import com.jwsaas.api.boduo.erp.request.CreateDispatchTicketRequest;
import com.jwsaas.api.boduo.erp.request.PayMoneyTicketRequest;
import com.jwsaas.api.boduo.erp.service.AskGoodsTicketErpService;
import com.jwsaas.api.entity.pos.MaterialInfo;
import com.jwsaas.api.response.mode.CommonDataResponse;
import com.jwsaas.api.service.impl.ErpBaseServiceImpl;
import com.jwsaas.bean.AppKeyInfo;
import com.jwsaas.cache.data.ProductUnitCache;
import com.jwsaas.condition.Criteria;
import com.jwsaas.condition.Restrictions;
import com.jwsaas.entity.food.*;
import com.jwsaas.http.HttpTool;
import com.jwsaas.open.annotation.HttpAction;
import com.jwsaas.open.annotation.NeedInSessionType;
import com.jwsaas.open.annotation.ServiceMethod;
import com.jwsaas.open.annotation.ServiceMethodBean;
import com.jwsaas.open.response.BusinessServiceErrorResponse;
import com.jwsaas.service.food.*;
import com.jwsaas.utils.AppKeyUtil;
import com.jwsaas.utils.DateUtils;
import com.jwsaas.utils.PropertiesUtil;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpResponse;
import javax.annotation.Resource;
import java.util.*;
/**
* @Author:CHL
* @Date:Create in 2018/3/30
* @Description:erp
*/
@ServiceMethodBean(version = "1.0")
public class AskGoodsTicketErpServiceImpl extends ErpBaseServiceImpl implements AskGoodsTicketErpService {
private static final long serialVersionUID = -345096567692034978L;
@Resource
private com.jwsaas.service.food.AskGoodsTicketService askGoodsTicketService;
@Resource
private com.jwsaas.service.food.AskGoodsDetailService askGoodsDetailService;
@Resource
private com.jwsaas.service.food.StoreService storeService;
@Resource
private com.jwsaas.service.food.ProductUnitService productUnitService;
@Resource
private DispatchTicketService dispatchTicketService;
@Resource
private ProductRatioService productRatioService;
@Resource
private ProductSpecService productSpecService;
@Resource
private StorageService storageService;
@Resource
private ProductUnitCache productUnitCache;
@ServiceMethod(method = "erp.trial.operation.money", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "查获erp中要货单扣款信息")
@Override
public Object getErpAskTicketMoneyList(AskTicketMoneyListRequest request) {
String appKey = request.getWopRequestContext().getAppKey();
logger.debug("appKey=" + appKey);
AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey);
String tenantCode = appKeyInfo.getTenantCode();
String tenantId = tenantCode;
String ticketId = request.getTicketId();
String info = "erp.ask.ticket.modey.list-->getErpAskTicketMoneyList 接口从erp中要货单扣款信息";
logger.info(info+"企业号:{}",tenantId);
CommonDataResponse response = null;
// AskTicketMoneyListResponse response = null;
try {
// response = new AskTicketMoneyListResponse();
response = new CommonDataResponse();
AskGoodsTicket ticket = this.askGoodsTicketService.get(tenantId,ticketId);
String deliveryMode = ticket.getDeliveryMode(); //配送方式
String storeId = ticket.getStoreId(); //门店ID
if(ticket == null){
response.setErrCode("error");
response.setMessage("获取要货单信息不存在,审核失败");
return response;
}
/* if(ticket.getErpToExamine()!=null && ticket.getErpToExamine()==1){
response.setErrCode("error");
response.setMessage("要获单已在erp中存在请作废该单据重新要货");
return response;
}*/
if(ticket.getStatus() == 3 || ticket.getStatus()==4 ){
response.setErrCode("error");
response.setMessage("要货单为配送状态或者为已收货状态,请重新生成要货单");
return response;
}
Store dbs = this.storeService.get(tenantId,storeId);
String storeNo=dbs.getExt1();
if(StringUtils.isEmpty(storeNo)){
response.setErrCode("error");
response.setMessage("门店属性扩展信息没有设置请在后台设置对应erp中的客户编号");
}
ticket.setStoreNo(storeNo);
List<AskGoodsDetail> agdList = this.askGoodsDetailService.findList(tenantId,"ticketId",ticketId);
// 开放接口签名
Map<String, Object> paramMap = new HashMap<>(20);
List<String> ignoreSignParams = new ArrayList<String>();
// 系统级参数
paramMap.put("appKey", PropertiesUtil.getValue(fileName, "open.api.appKey")); //开发者必须事先通过申请获取appKey/secret后,才能进行应用的开发
paramMap.put("method", "common.returnChargeConfirmInfo"); //方法名称
paramMap.put("v", PropertiesUtil.getValue(fileName, "open.api.version")); //服务方法的版本号
paramMap.put("format", PropertiesUtil.getValue(fileName, "open.api.format"));//报文的格式支持XML和JSON默认JSON
paramMap.put("locale", PropertiesUtil.getValue(fileName, "open.api.locale")); //本地化类型默认zh_CN
paramMap.put("timestamp", String.valueOf(System.currentTimeMillis()));//时间戳自1970-01-01 00:00:00.000起的毫秒数
paramMap.put("client", PropertiesUtil.getValue(fileName, "open.api.client"));//客户端类型
// 业务参数
String askgoodsJson = buildAskGoodsTicket(ticket);
String askgoodDetailJson = buildAskGoodsDetail(tenantId,agdList);
paramMap.put("goodsJson",askgoodsJson);
paramMap.put("goodsDetailsJson",askgoodDetailJson);
paramMap.put("deliveryMode",deliveryMode);
// 参数签名
String signValue = this.sign(paramMap, ignoreSignParams,PropertiesUtil.getValue(fileName,"open.api.secret"));
paramMap.put("sign",signValue); //签名串,请求参数的签名,服务平台通过它验证请求数据的合法性
String url=PropertiesUtil.getValue(fileName,"open.api.url");
long startTime = System.currentTimeMillis();
final HttpResponse hr = HttpTool.url(url).form(paramMap).post();
long endTime = System.currentTimeMillis();
logger.info("执行时间:{}",endTime-startTime);
final String content = HttpTool.getResponseAsString(hr);
logger.debug("调用erp接口 common.returnChargeConfirmInfo 返回的数据如下:{}",content);
if(this.isSuccessful(content)){
JSONObject object = JSON.parseObject(content);
String state = object.getString("state");
if(StringUtils.equals("1",state)){
Double sumMaterialMoney = Double.parseDouble(object.get("sumMaterialMoney")+""); //原料金额
Double storeBalance= Double.parseDouble(object.get("storeBalance")+""); // 账户余额
Double storeRebate= Double.parseDouble(object.get("storeRebate")+""); //返利
Double useRebate= Double.parseDouble(object.get("useRebate")+""); //能用的返利
Double usualFreight= Double.parseDouble(object.get("usualFreight")+""); //常温运费
Double coldFreight= Double.parseDouble(object.get("coldFreight")+""); //冷链运费
Double askSumMoney= Double.parseDouble(object.get("askSumMoney")+""); //要货总金额
String description= object.get("message")+""; // 备注
Map<String, Object> data = new HashMap<>();
data.put("sumMaterialMoney",sumMaterialMoney);
data.put("storeBalance",storeBalance);
data.put("storeRebate",storeRebate);
data.put("useRebate",useRebate);
data.put("usualFreight",usualFreight);
data.put("coldFreight",coldFreight);
data.put("askSumMoney",askSumMoney);
data.put("description",description);
response.setStatus(1);
response.setMessage("获取数据成功" + description);
response.setData(data);
//更新调用过erp接口后 单据的标识
ticket.setErpToExamine(1);
this.askGoodsTicketService.update(tenantId,ticket);
}else{
String description= object.get("message")+""; // 备注
response.setErrCode("error");
response.setMessage("调用erp接口失败,接口返回信息:" + description);
logger.info(content);
}
}else{
response.setErrCode("error");
response.setMessage("操作失败");
}
} catch (Exception e) {
e.printStackTrace();
logger.error(info + ",发生异常", e);
return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale());
}
return response;
}
/**
* erp
* @param agdList
* @return
*/
private String buildAskGoodsDetail(String tenantId,List<AskGoodsDetail> agdList) throws Exception {
List<Map<String,Object>> listMap = new ArrayList<>();
for(AskGoodsDetail ad:agdList){
Map<String,Object> map = new HashMap<>();
map.put("id",ad.getId());
map.put("ticketId",ad.getTicketId());
map.put("materialId",ad.getProductId());
map.put("materialName",ad.getProductName());
map.put("materialNo",ad.getProductNo());
map.put("spec",ad.getSpecName());
String packUnitId = ad.getPackUnitId();
map.put("stockUnit",packUnitId);
ProductUnit pu = getProductUnitDB(tenantId,packUnitId);
if(pu!=null){
map.put("stockUnitName",pu.getNo());
}
map.put("stockAmount",ad.getPackUnitAmount());
String dispatchUnitId = ad.getDispatchUnitId();
map.put("purchaseUnit",dispatchUnitId);
pu = getProductUnitDB(tenantId,dispatchUnitId);
if(pu != null){
map.put("purchaseUnitName",pu.getNo());
}
map.put("amount",ad.getAmount());
map.put("description",ad.getDescription());
map.put("price",ad.getPrice());
map.put("mmoney",ad.getMoney());
map.put("mWeight",0.0);
map.put("mwMoney",0.0);
map.put("freightCoefficient",0.0);
listMap.add(map);
}
return JSON.toJSONString(listMap);
}
private ProductUnit getProductUnitDB(String tenantId,String id) throws Exception{
ProductUnit pu = this.productUnitService.get(tenantId,id);
return pu;
}
/**
* erp
* @param ticket
* @return
*/
private String buildAskGoodsTicket(AskGoodsTicket ticket) {
Map<String ,Object> map = new HashMap<>();
map.put("id",ticket.getId());
map.put("no",ticket.getNo());
map.put("storeId",ticket.getStoreId());
map.put("storeNo",ticket.getStoreNo());
map.put("storeName",ticket.getStoreName());
map.put("effateDate",ticket.getSetDate());
map.put("description",ticket.getDescription());
map.put("status",ticket.getStatus());
map.put("setMan",ticket.getSetMan());
map.put("setDate",ticket.getSetDate());
map.put("checkMan",ticket.getCheckMan());
map.put("checkDate",ticket.getCheckDate());
map.put("materialMoney",ticket.getTotalMoney());
map.put("materialCost",0.0);
map.put("deliveryMode",ticket.getDeliveryMode());
map.put("deliveryModeDesc",ticket.getDeliveryModeDesc());
return JSON.toJSONString(map);
}
@ServiceMethod(method = "erp.pay.money.ticket", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "为此要货单买单,执行扣款")
@Override
public Object doErpPayMoneyTicket(PayMoneyTicketRequest request) {
String appKey = request.getWopRequestContext().getAppKey();
logger.debug("appKey=" + appKey);
AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey);
String tenantCode = appKeyInfo.getTenantCode();
String tenantId = tenantCode;
String askGoodsTicket = request.getAskGoodsTicket();
Integer isHaveT6Blance = request.getIsHaveT6Blance();
String payType = request.getPayType();
Integer isAskGoods = request.getIsAskGoods();
CommonDataResponse response = new CommonDataResponse();
List<AskGoodsTicket> atList = null;
try {
Criteria c = new Criteria();
c.add(Restrictions.eq("no", askGoodsTicket));
atList = this.askGoodsTicketService.getList(tenantId, c);
for (AskGoodsTicket at : atList) {
if(at.getStatus()==1){
response.setErrCode("error");
response.setMessage("订单已扣款,等待总部发货");
return response;
}
if(at.getStatus()==2){
response.setErrCode("error");
response.setMessage("订单已作废,请重新生成要货单");
return response;
}
if(at.getStatus()==3){
response.setErrCode("error");
response.setMessage("订单已配送,请重新生成要货单");
return response;
}
if(at.getStatus()==4){
response.setErrCode("error");
response.setMessage("订单已收货,请重新生成要货单");
return response;
}
}
} catch (Exception e) {
e.printStackTrace();
}
// 开放接口签名
Map<String, Object> paramMap = new HashMap<>(20);
List<String> ignoreSignParams = new ArrayList<String>();
// 系统级参数
paramMap.put("appKey", PropertiesUtil.getValue(fileName, "open.api.appKey")); //开发者必须事先通过申请获取appKey/secret后,才能进行应用的开发
paramMap.put("method", "tea.ask.pay.money"); //方法名称
paramMap.put("v", PropertiesUtil.getValue(fileName, "open.api.version")); //服务方法的版本号
paramMap.put("format", PropertiesUtil.getValue(fileName, "open.api.format"));//报文的格式支持XML和JSON默认JSON
paramMap.put("locale", PropertiesUtil.getValue(fileName, "open.api.locale")); //本地化类型默认zh_CN
paramMap.put("timestamp", String.valueOf(System.currentTimeMillis()));//时间戳自1970-01-01 00:00:00.000起的毫秒数
paramMap.put("client", PropertiesUtil.getValue(fileName, "open.api.client"));//客户端类型
// 业务参数
paramMap.put("askGoodsTicket",askGoodsTicket); //要货单号
paramMap.put("isHaveT6Blance",isHaveT6Blance); //是否使用erp 余额
paramMap.put("payType",payType); //付款方式
paramMap.put("isAskGoods",isAskGoods); //是否确认要货
// 参数签名
String signValue = this.sign(paramMap, ignoreSignParams,PropertiesUtil.getValue(fileName,"open.api.secret"));
paramMap.put("sign",signValue); //签名串,请求参数的签名,服务平台通过它验证请求数据的合法性
String url=PropertiesUtil.getValue(fileName,"open.api.url");
long startTime = System.currentTimeMillis();
final HttpResponse hr = HttpTool.url(url).form(paramMap).post();
long endTime = System.currentTimeMillis();
logger.info("执行时间:{}",endTime-startTime);
final String content = HttpTool.getResponseAsString(hr);
logger.debug("调用erp接口tea.ask.pay.money 返回的数据如下:{}",content);
if(StringUtils.isEmpty(content)|| content.length()==0 || !this.isSuccessful(content)){
response.setErrCode("error");
response.setMessage("调用erp接口失败,请联系督导协助处理");
}else{
JSONObject object = JSON.parseObject(content);
String state = object.getString("state");
if(StringUtils.equals("1",state)){
//账户余额 storeBalance 、返利金额 storeRebate、要货扣除的金额 payMoney
Double storeBalance = object.getDouble("storeBalance");
Double storeRebate = object.getDouble("storeRebate");
Double payMoney = object.getDouble("payMoney");
Map<String, Object> data = new HashMap<>();
data.put("storeBalance",storeBalance);
data.put("storeRebate",storeRebate);
data.put("payMoney",payMoney);
response.setStatus(1);
response.setMessage("调用erp接口扣款成功"+object.getString("message"));
response.setData(data);
//获取执行扣款数据成功后的操作
//NO.1 更新要货单的状态
try {
for(AskGoodsTicket atn :atList){
atn.setStatus(2); //更新要货单状态为已审核状态
String ticketId = atn.getId();
Criteria cc = new Criteria();
cc.add(Restrictions.eq("ticketId",ticketId));
List<AskGoodsDetail> adListn = this.askGoodsDetailService.getList(tenantId,cc);
AskGoodsTicketLog atlog = new AskGoodsTicketLog();
atlog.setTenantId(tenantId);
atlog.setCreateUser("erp_pos");
atlog.setCreateDate(new Date());
atlog.setType(3);
atlog.setStatus(2);
atlog.setPayStatus(0);
atlog.setDescription("erp扣款成功更新要货单状态");
this.askGoodsTicketService.updateAskGoodsTicket(tenantId,atn,adListn,atlog);
}
} catch (Exception e) {
e.printStackTrace();
}
}else{
response.setErrCode("error");
String description= object.get("message")+""; // 备注
response.setMessage("调用erp接口 扣款失败:"+description);
return response;
}
}
return response;
}
@ServiceMethod(method = "erp.store.material.dispatch", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "定制erp生成配送单")
@Override
public Object createDispatchTicket(CreateDispatchTicketRequest request) {
String info = "定制erp生成配送单";
String appKey = request.getWopRequestContext().getAppKey();
logger.debug("appKey=" + appKey);
AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey);
String tenantCode = appKeyInfo.getTenantCode();
String tenantId = tenantCode;
String storeErpNo = request.getStoreErpNo();
Double logisticsFee = request.getLogisticsFee() == null ? 0.0 : request.getLogisticsFee();
Double orderMoney = request.getOrderMoney() == null ? 0.0 : request.getOrderMoney();;
Double otherFee = request.getOtherFee() == null ? 0.0 : request.getOtherFee();;
String description = request.getDescription();
String materialInfo = request.getMaterialInfo();
CommonDataResponse response = null;
try{
response = new CommonDataResponse();
if(StringUtils.isEmpty(storeErpNo)){
response.setStatus(0);
response.setErrCode("error");
response.setMessage("门店编号不能为空!");
return response;
}
if(StringUtils.isEmpty(materialInfo)){
response.setStatus(0);
response.setErrCode("error");
response.setMessage("要货信息不能空!");
return response;
}
Criteria criteria = new Criteria();
criteria.add(Restrictions.eq("ext1",storeErpNo));
criteria.add(Restrictions.eq("deleteFlag",0));
criteria.add(Restrictions.eq("authFlag",1));
List<Store> stores = storeService.getList(tenantId,criteria);
if(CollectionUtils.isEmpty(stores) || stores.size() > 1 ){
response.setStatus(0);
response.setErrCode("error");
response.setMessage("门店信息错误!");
return response;
}
Store store = stores.get(0);
DispatchTicket ticket = new DispatchTicket();
ticket.setTenantId(tenantId);
ticket.setStoreId(store.getId());
ticket.setNo("BE"+DateUtils.getCurrDatetime());
ticket.setStatus(0);
ticket.setDescription(description);
ticket.setSetDate(new Date());
ticket.setSetMan("boduo-api");
ticket.setAddress(store.getAddress());
ticket.setLinkMan(store.getManager());
ticket.setLinkTelephone(store.getMobile());
ticket.setLogisticsFee(logisticsFee);
ticket.setOrderMoney(orderMoney);
ticket.setOtherFee(otherFee);
ticket.setCreateDate(new Date());
ticket.setCreateUser("boduo-api");
DispatchTicketLog log = new DispatchTicketLog();
log.setTenantId(tenantId);
log.setType(0);
log.setStatus(0);
log.setDescription("定制erp生成配送单,门店ErpNo:"+storeErpNo);
log.setCreateUser("api");
log.setCreateDate(new Date());
JSONArray jsons = new JSONArray().parseArray(materialInfo);
criteria = new Criteria();
criteria.add(Restrictions.limit("0","15000"));
criteria.add(Restrictions.order("createDate","desc"));
List<ProductRatio> ratios = productRatioService.getList(tenantId,criteria);
Map<String,ProductRatio> ratioMap = new HashMap<>();
for(ProductRatio ratio : ratios){
ratioMap.put(ratio.getProductId(),ratio);
}
Map<String,ProductUnit> unitMap = productUnitCache.getAllMap(tenantId);
List<Storage> storageList = storageService.getList(tenantId,new Criteria());
if(CollectionUtils.isEmpty(storageList)){
response.setStatus(0);
response.setErrCode("error");
response.setMessage("未查询到总部仓库信息!");
return response;
}
Storage storage = storageList.get(0);
criteria = new Criteria();
criteria.add(Restrictions.eq("p.deleteFlag", 0));
criteria.add(Restrictions.eq("ps.deleteFlag", 0));
criteria.add(Restrictions.eq("p.selfFlag", 0));
criteria.add(Restrictions.eq("p.stockFlag",1));
criteria.add(Restrictions.eq("p.type",10));
criteria.add(Restrictions.order("p.createDate","desc"));
criteria.add(Restrictions.limit("0","15000"));
List<ProductSpec> productSpecList = productSpecService.getListWithProduct(tenantId,criteria);
Map<String,ProductSpec> productSpecMap = new HashMap<>();
for(ProductSpec spec : productSpecList){
productSpecMap.put(spec.getProductNo(),spec);
}
Double totalAmount = 0.0;
List<DispatchTicketDetail> details = new ArrayList<>();
for(Object jsonStr : jsons){
MaterialInfo mater = new MaterialInfo((JSONObject)jsonStr);
String productNo = mater.getProductNo();
if(StringUtils.isEmpty(productNo)){
response.setStatus(0);
response.setErrCode("error");
response.setMessage("商品编号不能为空");
return response;
}
Double amount = mater.getAmount();
if(amount == null){
response.setStatus(0);
response.setErrCode("error");
response.setMessage("商品数量不能为空");
return response;
}
Double price = mater.getPrice() == null ? 0.0 : mater.getPrice();
DispatchTicketDetail detail = new DispatchTicketDetail();
detail.setTenantId(tenantId);
detail.setDispatchNo(ticket.getNo());
detail.setStorageId(storage.getId());
detail.setStorageName(storage.getName());
ProductSpec spec = productSpecMap.get(mater.getProductNo());
if(spec == null) {
criteria = new Criteria();
criteria.add(Restrictions.eq("p.deleteFlag", 0));
criteria.add(Restrictions.eq("ps.deleteFlag", 0));
criteria.add(Restrictions.eq("p.selfFlag", 0));
criteria.add(Restrictions.eq("p.stockFlag",1));
criteria.add(Restrictions.eq("p.type",10));
criteria.add(Restrictions.eq("p.no",mater.getProductNo()));
List<ProductSpec> maters = productSpecService.getListWithProduct(tenantId,criteria);
if(CollectionUtils.isNotEmpty(maters)){
spec = maters.get(0);
}else{
response.setStatus(0);
response.setErrCode("error");
response.setMessage("未查询到("+mater.getProductNo()+")的商品");
return response;
}
}
detail.setProductId(spec.getProductId());
detail.setProductNo(spec.getProductNo());
detail.setProductName(spec.getProductName());
detail.setProductDescription(spec.getProductDescription());
detail.setSpecId(spec.getId());
detail.setSpecName(spec.getName());
detail.setAskgoodsAmount(amount);
detail.setDispatchAmount(amount);
String dispatchUnitId = null;
if(ratioMap.get(detail.getProductId()) == null || StringUtils.isEmpty(ratioMap.get(detail.getProductId()).getDispatchUnitId())){
response.setStatus(0);
response.setErrCode("error");
response.setMessage("未查询到商品("+productNo+")的单位");
return response;
}
dispatchUnitId = ratioMap.get(detail.getProductId()).getDispatchUnitId();
String dispatchUnitName = unitMap.get(dispatchUnitId).getName();
detail.setDispatchUnitId(dispatchUnitId);
detail.setDispatchUnitName(dispatchUnitName);
String packUnitId = "";
if(ratioMap.get(detail.getProductId()) == null || StringUtils.isEmpty(ratioMap.get(detail.getProductId()).getPackUnitId())){
response.setStatus(0);
response.setErrCode("error");
response.setMessage("未查询到商品("+productNo+")的单位");
return response;
}
packUnitId = ratioMap.get(detail.getProductId()).getPackUnitId();
String packUnitName = unitMap.get(packUnitId).getName();
detail.setPackUnitId(packUnitId);
detail.setPackUnitName(packUnitName);
detail.setPrice(price);
detail.setMoney(price*amount);
totalAmount += detail.getMoney();
detail.setDescription(mater.getDescription());
detail.setDpScale(ratioMap.get(detail.getProductId()).getDpScale());
detail.setCreateDate(new Date());
detail.setCreateUser("boduo-api");
details.add(detail);
}
ticket.setOrderMoney(totalAmount);
ticket.setMoney(ticket.getOrderMoney() + logisticsFee+otherFee);
ticket = dispatchTicketService.saveTicket(tenantId,ticket,details,log);
if(ticket != null && StringUtils.isNotEmpty(ticket.getId())){
ReceiveGoodsTicket receiveGoodsTicket = dispatchTicketService.saveStoreReceiveGoodsTicketByAutoCheck(tenantId,ticket.getId());
if(receiveGoodsTicket != null ){
response.setStatus(1);
response.setMessage("保存成功");
}else{
response.setStatus(0);
response.setMessage("自动验收入库失败");
}
}else{
response.setStatus(0);
response.setMessage("生成配送单失败");
}
return response;
}catch (Exception e){
logger.error(info + ",发生异常", e);
response.setStatus(0);
response.setErrCode("error");
response.setMessage("定制erp生成配送单,失败");
return response;
}
}
}

@ -0,0 +1,94 @@
package com.jwsaas.api.boduo.erp.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jwsaas.api.boduo.erp.request.DeliveryModeListRequest;
import com.jwsaas.api.boduo.erp.response.DeliveryModeListResponse;
import com.jwsaas.api.boduo.erp.service.DeliveryModeListService;
import com.jwsaas.api.service.impl.ErpBaseServiceImpl;
import com.jwsaas.bean.AppKeyInfo;
import com.jwsaas.http.HttpTool;
import com.jwsaas.open.annotation.HttpAction;
import com.jwsaas.open.annotation.NeedInSessionType;
import com.jwsaas.open.annotation.ServiceMethod;
import com.jwsaas.open.annotation.ServiceMethodBean;
import com.jwsaas.open.response.BusinessServiceErrorResponse;
import com.jwsaas.utils.AppKeyUtil;
import com.jwsaas.utils.PropertiesUtil;
import org.apache.http.HttpResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Author:CHL
* @Date:Create in 2018/3/22
* @Description:
*/
@ServiceMethodBean(version = "1.0")
public class DeliveryModeListServiceImpl extends ErpBaseServiceImpl implements DeliveryModeListService {
private static final long serialVersionUID = -345096567692034912L;
@ServiceMethod(method = "erp.deliver.mode.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "从erp中获取配送方式")
@Override
public Object getDeliveryModeList(DeliveryModeListRequest request) {
String appKey = request.getWopRequestContext().getAppKey();
logger.debug("appKey=" + appKey);
AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey);
String tenantCode = appKeyInfo.getTenantCode();
String tenantId = tenantCode;
String info = "erp.deliver.mode.list-->getDeliveryModeList 接口获取erp中获取配送方式";
logger.info(info+"企业号:{}",tenantId);
DeliveryModeListResponse response = null;
try {
response = new DeliveryModeListResponse();
// 开放接口签名
Map<String, Object> paramMap = new HashMap<>(20);
List<String> ignoreSignParams = new ArrayList<String>();
// 系统级参数
paramMap.put("appKey", PropertiesUtil.getValue(fileName, "open.api.appKey")); //开发者必须事先通过申请获取appKey/secret后,才能进行应用的开发
paramMap.put("method", "dspway.dspway"); //方法名称
paramMap.put("v", PropertiesUtil.getValue(fileName, "open.api.version")); //服务方法的版本号
paramMap.put("format", PropertiesUtil.getValue(fileName, "open.api.format"));//报文的格式支持XML和JSON默认JSON
paramMap.put("locale", PropertiesUtil.getValue(fileName, "open.api.locale")); //本地化类型默认zh_CN
paramMap.put("timestamp", String.valueOf(System.currentTimeMillis()));//时间戳自1970-01-01 00:00:00.000起的毫秒数
paramMap.put("client", PropertiesUtil.getValue(fileName, "open.api.client"));//客户端类型
// 业务参数
// 参数签名
String signValue = this.sign(paramMap, ignoreSignParams,PropertiesUtil.getValue(fileName,"open.api.secret"));
paramMap.put("sign",signValue); //签名串,请求参数的签名,服务平台通过它验证请求数据的合法性
String url=PropertiesUtil.getValue(fileName,"open.api.url");
long startTime = System.currentTimeMillis();
final HttpResponse hr = HttpTool.url(url).form(paramMap).post();
long endTime = System.currentTimeMillis();
logger.info("执行时间:{}",endTime-startTime);
final String content = HttpTool.getResponseAsString(hr);
logger.debug("调用erp接口返回的数据如下{}",content);
if(this.isSuccessful(content)){
JSONObject object = JSON.parseObject(content);
JSONArray ja = object.getJSONArray("list");
response.setStatus(1);
response.setMessage("操作成功");
response.setList(ja);
}else{
response.setErrCode("error");
response.setMessage("操作失败");
response.setList(new JSONArray());
}
} catch (Exception e) {
e.printStackTrace();
logger.error(info + ",发生异常", e);
return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale());
}
return response;
}
}

@ -0,0 +1,159 @@
package com.jwsaas.api.boduo.erp.service.impl;
import com.alibaba.dubbo.common.utils.CollectionUtils;
import com.alibaba.fastjson.JSON;
import com.jwsaas.api.boduo.erp.request.ErpToPosMaterialSyncRequest;
import com.jwsaas.api.boduo.erp.service.ErpToPosDataService;
import com.jwsaas.api.response.mode.CommonDataResponse;
import com.jwsaas.api.service.impl.ErpBaseServiceImpl;
import com.jwsaas.bean.AppKeyInfo;
import com.jwsaas.condition.Criteria;
import com.jwsaas.condition.Restrictions;
import com.jwsaas.entity.food.Product;
import com.jwsaas.entity.food.ProductSpec;
import com.jwsaas.entity.food.ProductType;
import com.jwsaas.entity.food.ProductUnit;
import com.jwsaas.open.annotation.HttpAction;
import com.jwsaas.open.annotation.NeedInSessionType;
import com.jwsaas.open.annotation.ServiceMethod;
import com.jwsaas.open.annotation.ServiceMethodBean;
import com.jwsaas.open.response.BusinessServiceErrorResponse;
import com.jwsaas.util.Pinyin4jUtil;
import com.jwsaas.utils.AppKeyUtil;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Author:CHL
* @Date:Create in 2018/4/28
* @Description: erp pos
*/
@ServiceMethodBean(version = "1.0")
public class ErpToPosDataServiceImpl extends ErpBaseServiceImpl implements ErpToPosDataService {
private static final long serialVersionUID = -345096567692034912L;
@Resource
private com.jwsaas.service.food.ProductService productService;
@Resource
private com.jwsaas.service.food.ProductTypeService productTypeService;
@Resource
private com.jwsaas.service.food.ProductUnitService productUnitService;
/**
*
* @param request
* @return
*/
@ServiceMethod(method = "erp.material.to.pos.product", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "接收erp中原料数据持久化到pos后台接口")
@Override
public Object saveMaterialDetail(ErpToPosMaterialSyncRequest request) {
String appKey = request.getWopRequestContext().getAppKey();
//NO.1 获取应用参数
logger.debug("appKey=" + appKey);
AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey);
String tenantCode = appKeyInfo.getTenantCode();
String tenantId = tenantCode;
String info = "erp.material.to.pos.product-->saveMaterialDetail 接收erp中原料数据持久化到pos后台接口";
logger.info(info+"企业号:{}",tenantId);
CommonDataResponse response = null;
try {
String cInvCode = request.getcInvCode(); // 物料编号
String cInvName = request.getcInvName(); // 物料名称
String cInvStd = request.getcInvStd(); // 物料规格
String cInvCCode = request.getcInvCCode(); // 分类编号
String cComUnitCode = request.getcComUnitCode(); // 主计量单位编码
response = new CommonDataResponse();
//NO.2 持久化对象
Product p = writeDataToDB(tenantId,cInvCode,cInvName,cInvStd,cInvCCode,cComUnitCode);
Map<String,Object> map = new HashMap<>();
map.put("productId",p.getId());
map.put("productName",p.getName());
response.setStatus(1);
response.setMessage("物料信息同步成功");
response.setData(map);
} catch (Exception e) {
e.printStackTrace();
logger.error(info + ",发生异常", e);
return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale());
}
return response;
}
private Product writeDataToDB(String tenantId, String cInvCode,String cInvName,
String cInvStd, String cInvCCode,String cComUnitCode ) throws Exception {
// NO.1构建对象
Product p = new Product();
p.setTenantId(tenantId);
p.setType(10); //原料
p.setCreateUser("erp_pos");
p.setNo(cInvCode);
p.setName(cInvName);
p.setSpec(cInvStd); //规格
p.setSpell(Pinyin4jUtil.getPinYinHeadChar(cInvName).toUpperCase());
p.setStopFlag(0); //是否信用
p.setLyRate(0.00); //联营扣率
p.setStockFlag(1); // 管理库存
p.setPromotionFlag(1); //允许促销
p.setGiveFlag(1); //允许赠送
p.setMebDiscountFlag(0); //会员折上折
p.setSuitFlag(0); // 套餐
p.setSaleTax(0.00); //销项税
p.setPurchaseTax(17.00); //进项税
p.setPointValue(0.0); //积分值
p.setPointType(0); //积分类型
p.setLabelPrintFlag(0); //打印标签
p.setCurrentFlag(0); //是否可议价
p.setWeighFlag(0); //是否需要称重
p.setTapleFlag(0); //是否主食
p.setDiscountFlag(0); //可折扣
p.setCommissionValue(0.00); //提成值
p.setCommissionType(0); //提成方式
Criteria c = new Criteria();
c.add(Restrictions.eq("no",cInvCCode));
List<ProductType> ptList = this.productTypeService.getList(tenantId,c);
if(CollectionUtils.isNotEmpty(ptList)){
String typeId = ptList.get(0).getId();
p.setTypeId(typeId);
}
c = new Criteria();
c.add(Restrictions.eq("no",cComUnitCode));
List<ProductUnit> puList = this.productUnitService.getList(tenantId,c);
if(CollectionUtils.isNotEmpty(puList)){
String unitId = puList.get(0).getId();
p.setUnitId(unitId); //单位
}else{
logger.info("原料单位在pos中不存在{}", cComUnitCode);
}
logger.debug("持久化对象数据如下:{}",JSON.toJSONString(p));
//持久化操作
List<ProductSpec> specList = new ArrayList<>();
// 不启用规格
ProductSpec productSpec = new ProductSpec();
productSpec.setTenantId(tenantId);
productSpec.setNo("0");
productSpec.setName(p.getSpec());
productSpec.setPrice(0D);
productSpec.setMemberPrice(0D);
productSpec.setMinPrice( 0D);
productSpec.setCostPrice( 0D);
productSpec.setOtherPrice( 0D);
productSpec.setPurchasePrice(0D);
productSpec.setDispatchPrice(0D);
productSpec.setMaterialRate(100D);
productSpec.setCreateUser("erp_pos");
productSpec.setIsdefault(0);
specList.add(productSpec);
return this.productService.saveWithSpec(tenantId,p,specList);
}
}

@ -0,0 +1,362 @@
package com.jwsaas.api.boduo.erp.service.impl;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.apache.http.HttpResponse;
import com.alibaba.dubbo.common.utils.CollectionUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jwsaas.api.boduo.erp.request.MaterialTypeRequest;
import com.jwsaas.api.boduo.erp.request.SyncMaterialTypeRequest;
import com.jwsaas.api.boduo.erp.response.MaterialTypeResponse;
import com.jwsaas.api.boduo.erp.service.MaterialTypeService;
import com.jwsaas.api.entity.pos.MaterialTypeEntity;
import com.jwsaas.api.response.mode.CommonDataResponse;
import com.jwsaas.api.service.impl.ErpBaseServiceImpl;
import com.jwsaas.bean.AppKeyInfo;
import com.jwsaas.condition.Criteria;
import com.jwsaas.condition.Restrictions;
import com.jwsaas.entity.food.ProductType;
import com.jwsaas.http.HttpTool;
import com.jwsaas.open.annotation.HttpAction;
import com.jwsaas.open.annotation.NeedInSessionType;
import com.jwsaas.open.annotation.ServiceMethod;
import com.jwsaas.open.annotation.ServiceMethodBean;
import com.jwsaas.open.response.BusinessServiceErrorResponse;
import com.jwsaas.utils.AppKeyUtil;
import com.jwsaas.utils.PropertiesUtil;
/**
* @Author:CHL
* @Date:Create in 2018/3/22
* @Description:
*/
@ServiceMethodBean(version = "1.0")
public class MateriaTypeServiceImpl extends ErpBaseServiceImpl implements MaterialTypeService {
private static final long serialVersionUID = -345096567692034912L;
@Resource
private com.jwsaas.service.food.ProductTypeService productTypeService;
@ServiceMethod(method = "erp.material.type", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "从erp中获取原料分类接口")
@Override
public Object getMaterialTypeTea(MaterialTypeRequest request) {
String appKey = request.getWopRequestContext().getAppKey();
logger.debug("appKey=" + appKey);
AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey);
String tenantCode = appKeyInfo.getTenantCode();
String tenantId = tenantCode;
String info = "erp.material.type 接口获取erp中原料分类";
MaterialTypeResponse response = null;
try {
response = new MaterialTypeResponse();
// 开放接口签名
Map<String, Object> paramMap = new HashMap<>(20);
List<String> ignoreSignParams = new ArrayList<String>();
// 系统级参数
paramMap.put("appKey", PropertiesUtil.getValue(fileName, "open.api.appKey")); // 开发者必须事先通过申请获取appKey/secret后,才能进行应用的开发
paramMap.put("method", "inventoryClass.findAll"); // 方法名称
paramMap.put("v", PropertiesUtil.getValue(fileName, "open.api.version")); // 服务方法的版本号
paramMap.put("format", PropertiesUtil.getValue(fileName, "open.api.format"));// 报文的格式支持XML和JSON默认JSON
paramMap.put("locale", PropertiesUtil.getValue(fileName, "open.api.locale")); // 本地化类型默认zh_CN
paramMap.put("timestamp", String.valueOf(System.currentTimeMillis()));// 时间戳自1970-01-01
// 00:00:00.000起的毫秒数
paramMap.put("client", PropertiesUtil.getValue(fileName, "open.api.client"));// 客户端类型
// 业务参数
// 参数签名
String signValue = this.sign(paramMap, ignoreSignParams, PropertiesUtil.getValue(fileName, "open.api.secret"));
paramMap.put("sign", signValue); // 签名串,请求参数的签名,服务平台通过它验证请求数据的合法性
String url = PropertiesUtil.getValue(fileName, "open.api.url");
long startTime = System.currentTimeMillis();
final HttpResponse hr = HttpTool.url(url).form(paramMap).post();
long endTime = System.currentTimeMillis();
logger.info("执行时间:{}", endTime - startTime);
final String content = HttpTool.getResponseAsString(hr);
logger.debug("调用erp接口返回的数据如下{}", content);
int resoultCount = 0;
if (isSuccessful(content)) {
JSONObject object = JSON.parseObject(content);
JSONArray ja = object.getJSONArray("data");
resoultCount = ja.size();
for (int i = 0; i < ja.size(); i++) {
JSONObject jo = ja.getJSONObject(i);
String cInvCCode = jo.getString("cInvCCode"); // 分类编号
String cInvCName = jo.getString("cInvCName"); // 分类名称
String bInvCEnd = jo.getString("bInvCEnd"); // 父级分类编号
String bInvCName = jo.getString("bInvCName");
// 父级分类名称
/*
* if (bInvCEnd.length()==1 && cInvCCode.length()==1){
* //1级菜单 logger.warn("分类编号:{},分类名称:{},父级分类编号:{},父级分类名称:{}",
* cInvCCode,cInvCName,bInvCEnd,bInvCName); //向数据库同步
* writeDataToDB(tenantId,cInvCCode,cInvCName,bInvCEnd,
* bInvCName,resoultCount,1);
*
* }else
*/ if (bInvCEnd.length() == 1 && cInvCCode.length() == 2) {
// 2级菜单
logger.warn("分类编号:{},分类名称:{},父级分类编号:{},父级分类名称:{}", cInvCCode, cInvCName, bInvCEnd, bInvCName);
// 向数据库中同步操作
writeDataToDB(tenantId, cInvCCode, cInvCName, bInvCEnd, bInvCName, resoultCount, 1);
}
}
for (int i = 0; i < ja.size(); i++) {
JSONObject jo = ja.getJSONObject(i);
String cInvCCode = jo.getString("cInvCCode"); // 分类编号
String cInvCName = jo.getString("cInvCName"); // 分类名称
String bInvCEnd = jo.getString("bInvCEnd"); // 父级分类编号
String bInvCName = jo.getString("bInvCName"); // 父级分类名称
if (bInvCEnd.length() == 2) {
// 3级菜单
logger.debug("分类编号:{},分类名称:{},父级分类编号:{},父级分类名称:{}", cInvCCode, cInvCName, bInvCEnd, bInvCName);
writeDataToDB(tenantId, cInvCCode, cInvCName, bInvCEnd, bInvCName, resoultCount, 2);
}
}
for (int i = 0; i < ja.size(); i++) {
JSONObject jo = ja.getJSONObject(i);
String cInvCCode = jo.getString("cInvCCode"); // 分类编号
String cInvCName = jo.getString("cInvCName"); // 分类名称
String bInvCEnd = jo.getString("bInvCEnd"); // 父级分类编号
String bInvCName = jo.getString("bInvCName"); // 父级分类名称
if (bInvCEnd.length() == 4) {
// 4级菜单
logger.debug("分类编号:{},分类名称:{},父级分类编号:{},父级分类名称:{}", cInvCCode, cInvCName, bInvCEnd, bInvCName);
writeDataToDB(tenantId, cInvCCode, cInvCName, bInvCEnd, bInvCName, resoultCount, 3);
}
}
}
response.setStatus(1);
response.setMessage("操作成功");
response.setCount(resoultCount);
} catch (Exception e) {
e.printStackTrace();
logger.error(info + ",发生异常", e);
return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale());
}
return response;
}
private void writeDataToDB(String tenantId, String cInvCCode, String cInvCName, String bInvCEnd, String bInvCName, Integer resoultCount, int leaf) throws Exception {
// NO.1 检测编号是否存在
Criteria c = new Criteria();
c.add(Restrictions.eq("no", cInvCCode));
List<ProductType> ptList = productTypeService.getList(tenantId, c);
if (CollectionUtils.isNotEmpty(ptList)) {
resoultCount--;
} else {
ProductType pt = new ProductType();
pt.setTenantId(tenantId);
if (leaf != 1) {
c = new Criteria();
c.add(Restrictions.eq("no", bInvCEnd));
List<ProductType> parentPTList = productTypeService.getList(tenantId, c);
if (CollectionUtils.isNotEmpty(parentPTList)) {
ProductType parentPT = parentPTList.get(0);
pt.setParentId(parentPT.getId());
}
}
pt.setNo(cInvCCode);
pt.setName(cInvCName);
pt.setColor("#3f758a");
pt.setDeleteFlag(0);
pt.setSign("3");
pt.setCreateDate(new Date());
pt.setCreateUser("erp_pos");
this.productTypeService.save(tenantId, pt);
}
}
@ServiceMethod(method = "sync.material.type", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "同步原料分类")
@Override
public Object syncMaterialType(SyncMaterialTypeRequest request) {
String appKey = request.getWopRequestContext().getAppKey();
logger.debug("appKey=" + appKey);
AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey);
String tenantCode = appKeyInfo.getTenantCode();
String tenantId = tenantCode;
String materialType = request.getMaterialType();
String info = "sync.material.type 同步原料分类";
CommonDataResponse response = null;
try {
response = new CommonDataResponse();
// 存储一级分类
List<ProductType> updateOneList = new ArrayList<>();
List<ProductType> saveOneList = new ArrayList<>();
// 存储二级分类
List<ProductType> updateTwoList = new ArrayList<>();
List<ProductType> saveTwoList = new ArrayList<>();
// 存储三级分类
List<ProductType> updateThreeList = new ArrayList<>();
List<ProductType> saveThreeList = new ArrayList<>();
Date nowDate = new Date();
if (materialType != null && !"".equals(materialType)) {
JSONArray jsonUnits = new JSONArray().parseArray(materialType);
// 原料编号分级
List<MaterialTypeEntity> oneMaterialType = new ArrayList<>();
List<MaterialTypeEntity> twoMaterialType = new ArrayList<>();
List<MaterialTypeEntity> threeMaterialType = new ArrayList<>();
for (int i = 0; i < jsonUnits.size(); i++) {
MaterialTypeEntity materialTypeEntity = new MaterialTypeEntity(jsonUnits.getJSONObject(i));
if (materialTypeEntity.getNo().length() == 2) {
oneMaterialType.add(materialTypeEntity);
} else if (materialTypeEntity.getNo().length() == 4) {
twoMaterialType.add(materialTypeEntity);
} else {
threeMaterialType.add(materialTypeEntity);
}
}
// 先处理一级分类
for (MaterialTypeEntity materialTypeEntity : oneMaterialType) {
Criteria criteria = new Criteria();
criteria.add(Restrictions.eq("tenantId", tenantId));
criteria.add(Restrictions.eq("no", materialTypeEntity.getNo()));
criteria.add(Restrictions.eq("sign", "3"));
List<ProductType> typeList = productTypeService.getList(tenantId, criteria);
if (typeList != null && typeList.size() > 0) {
ProductType productType = typeList.get(0);
productType.setNo(materialTypeEntity.getNo());
productType.setName(materialTypeEntity.getName());
productType.setModifyUser("sync");
productType.setModifyDate(nowDate);
updateOneList.add(productType);
} else {
ProductType productType = new ProductType();
productType.setTenantId(tenantId);
productType.setNo(materialTypeEntity.getNo());
productType.setName(materialTypeEntity.getName());
productType.setColor("#3f758a");
productType.setDeleteFlag(0);
productType.setSign("3");
productType.setCreateUser("sync");
productType.setCreateDate(nowDate);
saveOneList.add(productType);
}
}
productTypeService.updateProductTypeBatch(tenantId, updateOneList, saveOneList);
// 处理二级分类
for (MaterialTypeEntity materialTypeEntity : twoMaterialType) {
Criteria criteria = new Criteria();
criteria.add(Restrictions.eq("tenantId", tenantId));
criteria.add(Restrictions.eq("no", materialTypeEntity.getNo()));
criteria.add(Restrictions.eq("sign", "3"));
List<ProductType> typeList = productTypeService.getList(tenantId, criteria);
if (typeList != null && typeList.size() > 0) {
ProductType productType = typeList.get(0);
productType.setNo(materialTypeEntity.getNo());
productType.setName(materialTypeEntity.getName());
// 获取上级类别
criteria = new Criteria();
criteria.add(Restrictions.eq("tenantId", tenantId));
criteria.add(Restrictions.eq("no", materialTypeEntity.getParentNo()));
criteria.add(Restrictions.eq("sign", "3"));
typeList = productTypeService.getList(tenantId, criteria);
if (typeList != null && typeList.size() > 0) {
ProductType productParentType = typeList.get(0);
productType.setParentId(productParentType.getId());
}
productType.setModifyUser("sync");
productType.setModifyDate(nowDate);
updateTwoList.add(productType);
} else {
ProductType productType = new ProductType();
productType.setTenantId(tenantId);
productType.setNo(materialTypeEntity.getNo());
productType.setName(materialTypeEntity.getName());
// 获取上级类别
criteria = new Criteria();
criteria.add(Restrictions.eq("tenantId", tenantId));
criteria.add(Restrictions.eq("no", materialTypeEntity.getParentNo()));
criteria.add(Restrictions.eq("sign", "3"));
typeList = productTypeService.getList(tenantId, criteria);
if (typeList != null && typeList.size() > 0) {
ProductType productParentType = typeList.get(0);
productType.setParentId(productParentType.getId());
}
productType.setColor("#3f758a");
productType.setDeleteFlag(0);
productType.setSign("3");
productType.setCreateUser("sync");
productType.setCreateDate(nowDate);
saveTwoList.add(productType);
}
}
productTypeService.updateProductTypeBatch(tenantId, updateTwoList, saveTwoList);
//处理3级分类
for (MaterialTypeEntity materialTypeEntity : threeMaterialType) {
Criteria criteria = new Criteria();
criteria.add(Restrictions.eq("tenantId", tenantId));
criteria.add(Restrictions.eq("no", materialTypeEntity.getNo()));
criteria.add(Restrictions.eq("sign", "3"));
List<ProductType> typeList = productTypeService.getList(tenantId, criteria);
if (typeList != null && typeList.size() > 0) {
ProductType productType = typeList.get(0);
productType.setNo(materialTypeEntity.getNo());
productType.setName(materialTypeEntity.getName());
// 获取上级类别
criteria = new Criteria();
criteria.add(Restrictions.eq("tenantId", tenantId));
criteria.add(Restrictions.eq("no", materialTypeEntity.getParentNo()));
criteria.add(Restrictions.eq("sign", "3"));
typeList = productTypeService.getList(tenantId, criteria);
if (typeList != null && typeList.size() > 0) {
ProductType productParentType = typeList.get(0);
productType.setParentId(productParentType.getId());
}
productType.setModifyUser("sync");
productType.setModifyDate(nowDate);
updateThreeList.add(productType);
} else {
ProductType productType = new ProductType();
productType.setTenantId(tenantId);
productType.setNo(materialTypeEntity.getNo());
productType.setName(materialTypeEntity.getName());
// 获取上级类别
criteria = new Criteria();
criteria.add(Restrictions.eq("tenantId", tenantId));
criteria.add(Restrictions.eq("no", materialTypeEntity.getParentNo()));
criteria.add(Restrictions.eq("sign", "3"));
typeList = productTypeService.getList(tenantId, criteria);
if (typeList != null && typeList.size() > 0) {
ProductType productParentType = typeList.get(0);
productType.setParentId(productParentType.getId());
}
productType.setColor("#3f758a");
productType.setDeleteFlag(0);
productType.setSign("3");
productType.setCreateUser("sync");
productType.setCreateDate(nowDate);
saveThreeList.add(productType);
}
}
productTypeService.updateProductTypeBatch(tenantId, updateThreeList, saveThreeList);
}
response.setStatus(1);
response.setMessage("原料分类同步成功");
} catch (Exception e) {
logger.error(info + ",发生异常", e);
return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale());
}
return response;
}
}

@ -0,0 +1,183 @@
package com.jwsaas.api.boduo.erp.service.impl;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.apache.http.HttpResponse;
import com.alibaba.dubbo.common.utils.CollectionUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jwsaas.api.boduo.erp.request.MaterialUnitRequest;
import com.jwsaas.api.boduo.erp.request.SyncMaterialUnitRequest;
import com.jwsaas.api.boduo.erp.response.MaterialUnitResponse;
import com.jwsaas.api.boduo.erp.service.MaterialUnitService;
import com.jwsaas.api.entity.pos.MaterialUnitEntity;
import com.jwsaas.api.response.mode.CommonDataResponse;
import com.jwsaas.api.service.impl.ErpBaseServiceImpl;
import com.jwsaas.bean.AppKeyInfo;
import com.jwsaas.condition.Criteria;
import com.jwsaas.condition.Restrictions;
import com.jwsaas.entity.food.ProductUnit;
import com.jwsaas.http.HttpTool;
import com.jwsaas.open.annotation.HttpAction;
import com.jwsaas.open.annotation.NeedInSessionType;
import com.jwsaas.open.annotation.ServiceMethod;
import com.jwsaas.open.annotation.ServiceMethodBean;
import com.jwsaas.open.response.BusinessServiceErrorResponse;
import com.jwsaas.utils.AppKeyUtil;
import com.jwsaas.utils.PropertiesUtil;
/**
* @Author:CHL
* @Date:Create in 2018/3/22
* @Description:
*/
@ServiceMethodBean(version = "1.0")
public class MateriaUnitServiceImpl extends ErpBaseServiceImpl implements MaterialUnitService {
private static final long serialVersionUID = -345096567692034912L;
@Resource
private com.jwsaas.service.food.ProductUnitService productUnitService;
@ServiceMethod(method = "erp.material.unit", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "从erp中获取原料单位接口")
@Override
public Object getMaterialUnitTea(MaterialUnitRequest request) {
String appKey = request.getWopRequestContext().getAppKey();
logger.debug("appKey=" + appKey);
AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey);
String tenantCode = appKeyInfo.getTenantCode();
String tenantId = tenantCode;
String info = "erp.material.unit 接口获取erp中原料单位";
MaterialUnitResponse response = null;
try {
response = new MaterialUnitResponse();
// 开放接口签名
Map<String, Object> paramMap = new HashMap<>(20);
List<String> ignoreSignParams = new ArrayList<String>();
// 系统级参数
paramMap.put("appKey", PropertiesUtil.getValue(fileName, "open.api.appKey")); // 开发者必须事先通过申请获取appKey/secret后,才能进行应用的开发
paramMap.put("method", "common.getListComputationUnit"); // 方法名称
paramMap.put("v", PropertiesUtil.getValue(fileName, "open.api.version")); // 服务方法的版本号
paramMap.put("format", PropertiesUtil.getValue(fileName, "open.api.format"));// 报文的格式支持XML和JSON默认JSON
paramMap.put("locale", PropertiesUtil.getValue(fileName, "open.api.locale")); // 本地化类型默认zh_CN
paramMap.put("timestamp", String.valueOf(System.currentTimeMillis()));// 时间戳自1970-01-01
// 00:00:00.000起的毫秒数
paramMap.put("client", PropertiesUtil.getValue(fileName, "open.api.client"));// 客户端类型
// 业务参数
// 参数签名
String signValue = this.sign(paramMap, ignoreSignParams, PropertiesUtil.getValue(fileName, "open.api.secret"));
paramMap.put("sign", signValue); // 签名串,请求参数的签名,服务平台通过它验证请求数据的合法性
String url = PropertiesUtil.getValue(fileName, "open.api.url");
long startTime = System.currentTimeMillis();
final HttpResponse hr = HttpTool.url(url).form(paramMap).post();
long endTime = System.currentTimeMillis();
logger.info("执行时间:{}", endTime - startTime);
final String content = HttpTool.getResponseAsString(hr);
int resoultCount = 0;
if (this.isSuccessful(content)) {
JSONObject object = JSON.parseObject(content);
JSONArray ja = object.getJSONArray("oocaTList");
resoultCount = ja.size();
for (int i = 0; i < ja.size(); i++) {
JSONObject jo = ja.getJSONObject(i);
// {"oocaTList":[{"cComunitCode":"BAG","cComUnitName":"袋、包","cGroupCode":"","iChangRate":"","iProportion":"","iNumber":"","cGroupName":"","iGroupType":""}]}
String no = jo.getString("cComunitCode");
Criteria c = new Criteria();
c.add(Restrictions.eq("no", no));
List<ProductUnit> puList = this.productUnitService.getList(tenantId, c);
// 如果有就跳过这条数据
if (CollectionUtils.isNotEmpty(puList)) {
resoultCount--;
continue;
}
String name = jo.getString("cComUnitName");
ProductUnit mu = new ProductUnit();
mu.setTenantId(tenantId);
mu.setNo(no);
mu.setName(name);
mu.setDeleteFlag(0);
mu.setNoType(2);
mu.setCreateUser("erp_pos");
this.productUnitService.save(tenantId, mu);
}
}
response.setStatus(1);
response.setMessage("操作成功");
response.setCount(resoultCount);
} catch (Exception e) {
e.printStackTrace();
logger.error(info + ",发生异常", e);
return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale());
}
return response;
}
@ServiceMethod(method = "sync.material.unit", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "同步原料单位")
@Override
public Object syncMaterialUnit(SyncMaterialUnitRequest request) {
String appKey = request.getWopRequestContext().getAppKey();
logger.debug("appKey=" + appKey);
AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey);
String tenantCode = appKeyInfo.getTenantCode();
String tenantId = tenantCode;
String materialUnit = request.getMaterialUnit();
String info = "sync.material.unit 同步原料单位";
CommonDataResponse response = null;
try {
response = new CommonDataResponse();
List<ProductUnit> updateList = new ArrayList<>();
List<ProductUnit> saveList = new ArrayList<>();
Date nowDate = new Date();
if (materialUnit != null && !"".equals(materialUnit)) {
JSONArray jsonUnits = new JSONArray().parseArray(materialUnit);
for (int i = 0; i < jsonUnits.size(); i++) {
// 前台资源
MaterialUnitEntity materialUnitEntity = new MaterialUnitEntity(jsonUnits.getJSONObject(i));
Criteria criteria = new Criteria();
criteria.add(Restrictions.eq("tenantId", tenantId));
criteria.add(Restrictions.eq("no", materialUnitEntity.getNo()));
List<ProductUnit> unitList = productUnitService.getList(tenantId, criteria);
if (unitList != null && unitList.size() > 0) {
ProductUnit productUnit = unitList.get(0);
productUnit.setNo(materialUnitEntity.getNo());
productUnit.setName(materialUnitEntity.getName());
productUnit.setModifyUser("sync");
productUnit.setModifyDate(nowDate);
updateList.add(productUnit);
} else {
ProductUnit productUnit = new ProductUnit();
productUnit.setTenantId(tenantId);
productUnit.setNo(materialUnitEntity.getNo());
productUnit.setName(materialUnitEntity.getName());
productUnit.setDeleteFlag(0);
productUnit.setNoType(1);
productUnit.setCreateUser("sync");
productUnit.setCreateDate(nowDate);
saveList.add(productUnit);
}
}
}
productUnitService.updateProductUnitBatch(tenantId, updateList, saveList);
response.setStatus(1);
response.setMessage("原料单位同步成功");
} catch (Exception e) {
logger.error(info + ",发生异常", e);
return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale());
}
return response;
}
}

@ -0,0 +1,489 @@
package com.jwsaas.api.boduo.erp.service.impl;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.apache.http.HttpResponse;
import com.alibaba.dubbo.common.utils.CollectionUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jwsaas.api.boduo.erp.request.MaterialDetailRequest;
import com.jwsaas.api.boduo.erp.request.SyncMaterialRequest;
import com.jwsaas.api.boduo.erp.response.MaterialDetailResponse;
import com.jwsaas.api.boduo.erp.service.MaterialDetailService;
import com.jwsaas.api.entity.pos.MaterialEntity;
import com.jwsaas.api.response.mode.CommonDataResponse;
import com.jwsaas.api.response.mode.CommonErrorCode;
import com.jwsaas.api.service.impl.ErpBaseServiceImpl;
import com.jwsaas.bean.AppKeyInfo;
import com.jwsaas.condition.Criteria;
import com.jwsaas.condition.Restrictions;
import com.jwsaas.entity.food.Product;
import com.jwsaas.entity.food.ProductRatio;
import com.jwsaas.entity.food.ProductSpec;
import com.jwsaas.entity.food.ProductType;
import com.jwsaas.entity.food.ProductUnit;
import com.jwsaas.http.HttpTool;
import com.jwsaas.open.annotation.HttpAction;
import com.jwsaas.open.annotation.NeedInSessionType;
import com.jwsaas.open.annotation.ServiceMethod;
import com.jwsaas.open.annotation.ServiceMethodBean;
import com.jwsaas.open.response.BusinessServiceErrorResponse;
import com.jwsaas.util.Pinyin4jUtil;
import com.jwsaas.utils.AppKeyUtil;
import com.jwsaas.utils.PropertiesUtil;
/**
* @Author:CHL
* @Date:Create in 2018/3/22
* @Description:
*/
@ServiceMethodBean(version = "1.0")
public class MaterialDetailServiceImpl extends ErpBaseServiceImpl implements MaterialDetailService {
private static final long serialVersionUID = -345096567692034912L;
@Resource
private com.jwsaas.service.food.StoreService storeService;
@Resource
private com.jwsaas.service.food.ProductService productService;
@Resource
private com.jwsaas.service.food.ProductTypeService productTypeService;
@Resource
private com.jwsaas.service.food.ProductUnitService productUnitService;
@Resource
private com.jwsaas.service.food.ProductSpecService productSpecService;
@Resource
private com.jwsaas.service.food.ProductRatioService productRatioService;
@ServiceMethod(method = "erp.material.detail", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "从erp中获取原料信息接口")
@Override
public Object getMaterialDetailTea(MaterialDetailRequest request) {
/****
* producttype=10
*/
String appKey = request.getWopRequestContext().getAppKey();
logger.debug("appKey=" + appKey);
AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey);
String tenantCode = appKeyInfo.getTenantCode();
String tenantId = tenantCode;
String storeId = request.getStoreId(); // 门店ID
String info = "erp.material.detail 接口获取erp中原料信息";
MaterialDetailResponse response = null;
try {
response = new MaterialDetailResponse();
// 开放接口签名
Map<String, Object> paramMap = new HashMap<>(20);
List<String> ignoreSignParams = new ArrayList<String>();
// 系统级参数
paramMap.put("appKey", PropertiesUtil.getValue(fileName, "open.api.appKey")); // 开发者必须事先通过申请获取appKey/secret后,才能进行应用的开发
paramMap.put("method", "inventory.getInventories"); // 方法名称
paramMap.put("v", PropertiesUtil.getValue(fileName, "open.api.version")); // 服务方法的版本号
paramMap.put("format", PropertiesUtil.getValue(fileName, "open.api.format"));// 报文的格式支持XML和JSON默认JSON
paramMap.put("locale", PropertiesUtil.getValue(fileName, "open.api.locale")); // 本地化类型默认zh_CN
paramMap.put("timestamp", String.valueOf(System.currentTimeMillis()));// 时间戳自1970-01-01
// 00:00:00.000起的毫秒数
paramMap.put("client", PropertiesUtil.getValue(fileName, "open.api.client"));// 客户端类型
// 业务参数
// 参数签名
String signValue = this.sign(paramMap, ignoreSignParams, PropertiesUtil.getValue(fileName, "open.api.secret"));
paramMap.put("sign", signValue); // 签名串,请求参数的签名,服务平台通过它验证请求数据的合法性
String url = PropertiesUtil.getValue(fileName, "open.api.url");
long startTime = System.currentTimeMillis();
final HttpResponse hr = HttpTool.url(url).form(paramMap).post();
long endTime = System.currentTimeMillis();
logger.info("执行时间:{}", endTime - startTime);
final String content = HttpTool.getResponseAsString(hr);
logger.info("调用erp接口返回的数据如下{}", content);
int resoultCount = 0;
if (this.isSuccessful(content)) {
JSONObject object = JSON.parseObject(content);
/**
* {"inventory":[{"cInvCode":"110100007","cInvName":"干玫瑰花(代用茶)",
* "cInvStd":"1*10KG","cInvCCode":"1101008",
* "iGroupType":0,"cGroupCode":"KG","cComUnitCode":"KG",
* "cSAComUnitCode":"KG","cPUComUnitCode":"KG","cSTComUnitCode":
* "KG",
* "cCAComUnitCode":"KG","cInvDefine14":"","cInvUnitPrice":0.0,
* "cInvSL":"0.0","imaaud017":"1","cwhCode":"0.0"}]}
**/
JSONArray ja = object.getJSONArray("inventory");
resoultCount = ja.size();
// 便利erp中获取物料信息持久化到数据库中
writeDataToDB(tenantId, ja);
}
response.setStatus(1);
response.setMessage("操作成功");
response.setCount(resoultCount);
} catch (Exception e) {
e.printStackTrace();
logger.error(info + ",发生异常", e);
return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale());
}
return response;
}
/***
*
*
* @param tenantId
* @param ja
*/
private void writeDataToDB(String tenantId, JSONArray ja) throws Exception {
for (int i = 0; i < ja.size(); i++) {
JSONObject jo = ja.getJSONObject(i);
String cInvCode = jo.getString("cInvCode"); // 物料编号
String cInvName = jo.getString("cInvName"); // 物料名称
String cInvStd = jo.getString("cInvStd"); // 物料规格
String cInvCCode = jo.getString("cInvCCode"); // 分类编号
String cComUnitCode = jo.getString("cComUnitCode"); // 主计量单位编码
// NO.1构建对象
Product p = new Product();
p.setTenantId(tenantId);
p.setType(10); // 原料
p.setCreateUser("erp_pos");
p.setNo(cInvCode);
p.setName(cInvName);
p.setSpec(cInvStd); // 规格
p.setSpell(Pinyin4jUtil.getPinYinHeadChar(cInvName).toUpperCase());
p.setStopFlag(0); // 是否信用
p.setLyRate(0.00); // 联营扣率
p.setStockFlag(1); // 管理库存
p.setPromotionFlag(1); // 允许促销
p.setGiveFlag(1); // 允许赠送
p.setMebDiscountFlag(0); // 会员折上折
p.setSuitFlag(0); // 套餐
p.setSaleTax(0.00); // 销项税
p.setPurchaseTax(17.00); // 进项税
p.setPointValue(0.0); // 积分值
p.setPointType(0); // 积分类型
p.setLabelPrintFlag(0); // 打印标签
p.setCurrentFlag(0); // 是否可议价
p.setWeighFlag(0); // 是否需要称重
p.setTapleFlag(0); // 是否主食
p.setDiscountFlag(0); // 可折扣
p.setCommissionValue(0.00); // 提成值
p.setCommissionType(0); // 提成方式
Criteria c = new Criteria();
c.add(Restrictions.eq("no", cInvCCode));
List<ProductType> ptList = this.productTypeService.getList(tenantId, c);
if (CollectionUtils.isNotEmpty(ptList)) {
String typeId = ptList.get(0).getId();
p.setTypeId(typeId);
}
c = new Criteria();
c.add(Restrictions.eq("no", cComUnitCode));
List<ProductUnit> puList = this.productUnitService.getList(tenantId, c);
if (CollectionUtils.isNotEmpty(puList)) {
String unitId = puList.get(0).getId();
p.setUnitId(unitId); // 单位
} else {
logger.error("持久化失败对象数据如下:{}", JSON.toJSONString(jo));
continue;
}
logger.debug("持久化对象数据如下:{}", JSON.toJSONString(p));
// 持久化操作
List<ProductSpec> specList = new ArrayList<>();
// 不启用规格
ProductSpec productSpec = new ProductSpec();
productSpec.setTenantId(tenantId);
productSpec.setNo("0");
productSpec.setName(p.getSpec());
productSpec.setPrice(0D);
productSpec.setMemberPrice(0D);
productSpec.setMinPrice(0D);
productSpec.setCostPrice(0D);
productSpec.setOtherPrice(0D);
productSpec.setPurchasePrice(0D);
productSpec.setDispatchPrice(0D);
productSpec.setMaterialRate(100D);
productSpec.setCreateUser("erp_pos");
productSpec.setIsdefault(0);
specList.add(productSpec);
this.productService.saveWithSpec(tenantId, p, specList);
}
}
private Map<String, Object> getCustomerNoByStoreId(String tenantId, String storeId) throws Exception {
String sql = "select * from cy_erp_store_mapping where storeId='" + storeId + "'";
Map<String, Object> maps = this.storeService.selectOne(tenantId, sql);
return maps;
}
@ServiceMethod(method = "sync.material", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "同步原料")
@Override
public Object syncMaterial(SyncMaterialRequest request) {
String appKey = request.getWopRequestContext().getAppKey();
logger.debug("appKey=" + appKey);
AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey);
String tenantCode = appKeyInfo.getTenantCode();
String tenantId = tenantCode;
String material = request.getMaterial();
String info = "sync.material.unit 同步原料单位";
CommonDataResponse response = null;
try {
response = new CommonDataResponse();
List<Product> updateList = new ArrayList<>();
List<ProductSpec> updateSpecList = new ArrayList<>();
List<ProductRatio> updateRatioList = new ArrayList<>();
List<Product> saveList = new ArrayList<>();
List<ProductSpec> saveSpecList = new ArrayList<>();
List<ProductRatio> saveRatioList = new ArrayList<>();
Date nowDate = new Date();
if (material != null && !"".equals(material)) {
JSONArray jsonUnits = new JSONArray().parseArray(material);
if (jsonUnits.size() > 200) {
response.setStatus(0);
response.setMessage("一次最多同步200条原料信息,请重新同步");
response.setErrCode(CommonErrorCode.error998.getCode());
response.setErrMessage("一次最多同步200条原料信息,请重新同步");
return response;
}
// 第一步加载系统的所有单位
Criteria criteria = new Criteria();
criteria.add(Restrictions.eq("tenantId", tenantId));
List<ProductUnit> unitList = productUnitService.getList(tenantId, criteria);
Map<String, ProductUnit> unitMap = new HashMap<>();
for (ProductUnit productUnit : unitList) {
unitMap.put(productUnit.getName(), productUnit);
}
// 第二部加载系统的所有分类
criteria = new Criteria();
criteria.add(Restrictions.eq("tenantId", tenantId));
criteria.add(Restrictions.eq("sign", "3"));
Map<String, ProductType> typeMap = new HashMap<>();
List<ProductType> typeList = productTypeService.getList(tenantId, criteria);
for (ProductType productType : typeList) {
typeMap.put(productType.getNo(), productType);
}
criteria = new Criteria();
criteria.add(Restrictions.eq("tenantId", tenantId));
criteria.add(Restrictions.eq("deleteFlag",0));
criteria.add(Restrictions.eq("stockFlag",1));
criteria.add(Restrictions.eq("type",10));
criteria.add(Restrictions.order("createDate","desc"));
criteria.add(Restrictions.limit("0","5000"));
List<Product> productList = productService.getList(tenantId, criteria);
Map<String,Product> productMap = new HashMap<>();
if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(productList)){
for(Product product : productList){
productMap.put(product.getNo(),product);
}
}
// 第三部组装同步数据
for (int i = 0; i < jsonUnits.size(); i++) {
// 前台资源
MaterialEntity materialEntity = new MaterialEntity(jsonUnits.getJSONObject(i));
Product product = null;
if(productMap.containsKey(materialEntity.getNo())){
product = productMap.get(materialEntity.getNo());
}else{
criteria = new Criteria();
criteria.add(Restrictions.eq("tenantId", tenantId));
criteria.add(Restrictions.eq("deleteFlag",0));
criteria.add(Restrictions.eq("stockFlag",1));
criteria.add(Restrictions.eq("no", materialEntity.getNo()));
List<Product> list = productService.getList(tenantId, criteria);
if (list != null && list.size() > 0) {
product = list.get(0);
}
}
if (product != null) {
//Product product = list.get(0);
// 封装原料属性
product.setNo(materialEntity.getNo());
product.setName(materialEntity.getName());
product.setSpec(materialEntity.getSpec());
ProductType productType = typeMap.get(materialEntity.getTypeNo());// 分类属性
if (productType != null) {
product.setTypeId(productType.getId());
product.setTypePath(productType.getPath());
}
ProductUnit productUnit = unitMap.get(materialEntity.getPackUnit());// 单位属性
if (productUnit != null) {
product.setUnitId(productUnit.getId());
}else{
response.setStatus(0);
response.setMessage("未查询到商品("+product.getName()+")的单位,请先同步商品单位");
return response;
}
product.setModifyDate(nowDate);
product.setModifyUser("sync");
updateList.add(product);
// 封装规格属性
criteria = new Criteria();
criteria.add(Restrictions.eq("tenantId", tenantId));
criteria.add(Restrictions.eq("productId", product.getId()));
List<ProductSpec> specList = productSpecService.getList(tenantId, criteria);
if (specList != null && specList.size() > 0) {
ProductSpec productSpec = specList.get(0);
productSpec.setName(materialEntity.getSpec());
productSpec.setCostPrice(materialEntity.getCostPrice());
productSpec.setModifyDate(nowDate);
productSpec.setModifyUser("sync");
updateSpecList.add(productSpec);
}
// 封装商品系数属性
criteria = new Criteria();
criteria.add(Restrictions.eq("tenantId", tenantId));
criteria.add(Restrictions.eq("productId", product.getId()));
List<ProductRatio> ratioList = productRatioService.getList(tenantId, criteria);
if (ratioList != null && ratioList.size() > 0) {
ProductRatio productRatio = ratioList.get(0);
ProductUnit dispatch = unitMap.get(materialEntity.getDispatchUnit());// 单位属性
if (dispatch != null) {
productRatio.setDispatchUnitId(dispatch.getId());
}else{
response.setStatus(0);
response.setMessage("未查询到商品("+product.getName()+")的配送单位,请先同步商品单位");
return response;
}
ProductUnit purchase = unitMap.get(materialEntity.getPurchaseUnit());// 单位属性
if (purchase != null) {
productRatio.setPurchaseUnitId(purchase.getId());
}else{
response.setStatus(0);
response.setMessage("未查询到商品("+product.getName()+")的采购单位,请先同步商品单位");
return response;
}
ProductUnit pack = unitMap.get(materialEntity.getPackUnit());// 单位属性
if (pack != null) {
productRatio.setPackUnitId(pack.getId());
productRatio.setSalesUnitId(pack.getId());
}else{
response.setStatus(0);
response.setMessage("未查询到商品("+product.getName()+")的门店库存单位,请先同步商品单位");
return response;
}
productRatio.setModifyDate(nowDate);
productRatio.setModifyUser("sync");
updateRatioList.add(productRatio);
}
} else {
// 封装原料属性
product = new Product();
product.setTenantId(tenantId);
ProductType productType = typeMap.get(materialEntity.getTypeNo());// 分类属性
if (productType != null) {
product.setTypeId(productType.getId());
product.setTypePath(productType.getPath());
}
product.setNo(materialEntity.getNo());
product.setName(materialEntity.getName());
product.setSpell(Pinyin4jUtil.getPinYinHeadChar(materialEntity.getName()).toUpperCase());
product.setShortName(materialEntity.getName());
product.setSpec(materialEntity.getSpec()); // 规格
ProductUnit productUnit = unitMap.get(materialEntity.getPackUnit());// 单位属性
if (productUnit != null) {
product.setUnitId(productUnit.getId());
}else{
response.setStatus(0);
response.setMessage("未查询到商品("+product.getName()+")的单位,请先同步商品单位");
return response;
}
product.setCommissionType(0);
product.setCommissionValue(0.00);
product.setDiscountFlag(0); // 可折扣
product.setTapleFlag(0); // 是否主食
product.setWeighFlag(0); // 是否需要称重
product.setCurrentFlag(0); // 是否可议价
product.setLabelPrintFlag(0); // 打印标签
product.setSuitFlag(0); // 打印标签
product.setMebDiscountFlag(0); // 会员折上折
product.setGiveFlag(0); // 允许赠送
product.setPromotionFlag(1); // 允许促销
product.setType(10); // 原料
product.setStockFlag(1); // 管理库存
product.setStopFlag(0); // 是否停用
product.setPointValue(0.0); // 积分值
product.setPointType(0); // 积分类型
product.setPurchaseTax(0.00); // 进项税
product.setSaleTax(0.00); // 销项税
product.setLyRate(0.00); // 联营扣率
product.setDeleteFlag(0);// 是否删除
product.setNoType(1);// 是否自动编号
product.setZcFlag(0);// 是否允许自采
product.setSelfFlag(0);// 是否自建商品
product.setCreateUser("sync");
product.setCreateDate(nowDate);
saveList.add(product);
// 封装规格属性
ProductSpec productSpec = new ProductSpec();
productSpec.setTenantId(tenantId);
productSpec.setNo("0");
productSpec.setName(materialEntity.getSpec());
productSpec.setCostPrice(materialEntity.getCostPrice());
productSpec.setIsdefault(1);
productSpec.setDeleteFlag(0);
productSpec.setCreateUser("sync");
productSpec.setCreateDate(nowDate);
saveSpecList.add(productSpec);
// 封装商品系数属性
ProductRatio productRatio = new ProductRatio();
productRatio.setTenantId(tenantId);
productRatio.setPdScale(1.00);
productRatio.setDpScale(1.00);
productRatio.setPsScale(1.00);
productRatio.setMaxStock(9999.00);
productRatio.setMinStock(0.00);
ProductUnit dispatch = unitMap.get(materialEntity.getDispatchUnit());// 单位属性
if (dispatch != null) {
productRatio.setDispatchUnitId(dispatch.getId());
}else{
response.setStatus(0);
response.setMessage("未查询到商品("+product.getName()+")的配送单位,请先同步商品单位");
return response;
}
ProductUnit purchase = unitMap.get(materialEntity.getPurchaseUnit());// 单位属性
if (purchase != null) {
productRatio.setPurchaseUnitId(purchase.getId());
}else{
response.setStatus(0);
response.setMessage("未查询到商品("+product.getName()+")的采购单位,请先同步商品单位");
return response;
}
ProductUnit pack = unitMap.get(materialEntity.getPackUnit());// 单位属性
if (pack != null) {
productRatio.setPackUnitId(pack.getId());
productRatio.setSalesUnitId(pack.getId());
}else{
response.setStatus(0);
response.setMessage("未查询到商品("+product.getName()+")的门店库存单位,请先同步商品单位");
return response;
}
productRatio.setCreateUser("sync");
productRatio.setCreateDate(nowDate);
saveRatioList.add(productRatio);
}
}
productService.updateProductBatch(tenantId, updateList, updateSpecList, updateRatioList, saveList, saveSpecList, saveRatioList);
}
response.setStatus(1);
response.setMessage("原料同步成功");
} catch (Exception e) {
logger.error(info + ",发生异常", e);
return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale());
}
return response;
}
}

@ -0,0 +1,921 @@
package com.jwsaas.api.boduo.erp.service.impl;
import java.util.*;
import javax.annotation.Resource;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpResponse;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jwsaas.api.boduo.erp.request.DishToErpSyncRequest;
import com.jwsaas.api.boduo.erp.request.MaterialToErpSyncRequest;
import com.jwsaas.api.boduo.erp.service.PosToErpDataService;
import com.jwsaas.api.request.product.ProductRatioRequest;
import com.jwsaas.api.request.product.ProductRequest;
import com.jwsaas.api.request.product.ProductSpecRequest;
import com.jwsaas.api.response.mode.CommonDataResponse;
import com.jwsaas.api.response.mode.CommonErrorCode;
import com.jwsaas.api.response.mode.CommonPagerResponse;
import com.jwsaas.api.service.impl.ErpBaseServiceImpl;
import com.jwsaas.bean.AppKeyInfo;
import com.jwsaas.condition.Criteria;
import com.jwsaas.condition.Restrictions;
import com.jwsaas.entity.food.Product;
import com.jwsaas.entity.food.ProductRatio;
import com.jwsaas.entity.food.ProductSpec;
import com.jwsaas.entity.food.Store;
import com.jwsaas.http.HttpTool;
import com.jwsaas.open.annotation.HttpAction;
import com.jwsaas.open.annotation.NeedInSessionType;
import com.jwsaas.open.annotation.ServiceMethod;
import com.jwsaas.open.annotation.ServiceMethodBean;
import com.jwsaas.open.response.BusinessServiceErrorResponse;
import com.jwsaas.pager.Pager;
import com.jwsaas.utils.AppKeyUtil;
import com.jwsaas.utils.PropertiesUtil;
/**
* @Author:CHL
* @Date:Create in 2018/4/28
* @Description: pos erp
*/
@ServiceMethodBean(version = "1.0")
public class PosToErpDataServiceImpl extends ErpBaseServiceImpl implements PosToErpDataService {
private static final long serialVersionUID = -345096567692034912L;
@Resource
private com.jwsaas.service.food.ProductService productService;
@Resource
private com.jwsaas.service.food.ProductSpecService productSpecService;
@Resource
private com.jwsaas.service.food.StoreService storeService;
@Resource
private com.jwsaas.service.food.ProductRatioService productRatioService;
/**
* erp
*
* @param request
* @return
*/
@ServiceMethod(method = "pos.save.dish.to.erp", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "pos中保存菜品向erp中同步接口")
@Override
public Object saveDishSyncErpDetail(DishToErpSyncRequest request) {
String appKey = request.getWopRequestContext().getAppKey();
logger.debug("appKey=" + appKey);
AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey);
String tenantCode = appKeyInfo.getTenantCode();
String tenantId = tenantCode;
String info = "pos.save.dish.to.erp-->saveDishSyncErpDetail pos中保存菜品向erp中同步接口";
logger.info(info + "企业号:{}", tenantId);
CommonDataResponse response = new CommonDataResponse();
// 菜品集合对像
String dishJson = request.getDishJson();
List<String> ignoreSignParams = new ArrayList<>();
// 开放接口签名
Map<String, Object> paramMap = new HashMap<>(20);
// 系统级参数
paramMap.put("appKey", PropertiesUtil.getValue(fileName, "open.api.appKey")); // 开发者必须事先通过申请获取appKey/secret后,才能进行应用的开发
paramMap.put("method", "common.saveFinishProductInfo"); // 方法名称
paramMap.put("v", PropertiesUtil.getValue(fileName, "open.api.version")); // 服务方法的版本号
paramMap.put("format", PropertiesUtil.getValue(fileName, "open.api.format"));// 报文的格式支持XML和JSON默认JSON
paramMap.put("locale", PropertiesUtil.getValue(fileName, "open.api.locale")); // 本地化类型默认zh_CN
paramMap.put("timestamp", String.valueOf(System.currentTimeMillis()));// 时间戳自1970-01-01
// 00:00:00.000起的毫秒数
paramMap.put("client", PropertiesUtil.getValue(fileName, "open.api.client"));// 客户端类型
// 业务参数
logger.debug("调用接品 common.saveFinishProductInfo 传的参数如下:{}", dishJson);
paramMap.put("materialDetailJson", dishJson);
// 不需要签名的参数
// 参数签名
String signValue = this.sign(paramMap, ignoreSignParams, PropertiesUtil.getValue(fileName, "open.api.secret"));
paramMap.put("sign", signValue); // 签名串,请求参数的签名,服务平台通过它验证请求数据的合法性
String url = PropertiesUtil.getValue(fileName, "open.api.url");
long startTime = System.currentTimeMillis();
final HttpResponse hr = HttpTool.url(url).form(paramMap).post();
long endTime = System.currentTimeMillis();
logger.info("执行时间:{}", endTime - startTime);
final String content = HttpTool.getResponseAsString(hr);
logger.debug("调用erp接口返回的数据如下{}", content);
// 返回数据成功
if (isSuccessful(content)) {
JSONObject object = JSON.parseObject(content);
String state = object.getString("state");
String msg = object.getString("msg");
// 当返回状态为1 标识操作成功
if (StringUtils.equals("1", state)) {
List<String> psIds = new ArrayList<>();
JSONArray jarray = JSON.parseArray(dishJson);
for (int i = 0; i < jarray.size(); i++) {
JSONObject jo = jarray.getJSONObject(i);
String specId = jo.getString("id");
psIds.add(specId);
}
// 根据菜单规格修改是否同步标识
Criteria c = new Criteria();
c.add(Restrictions.in("id", psIds));
List<ProductSpec> dsList = null;
try {
dsList = this.productSpecService.getList(tenantId, c);
for (ProductSpec ps : dsList) {
ps.setErpSyncStatus(1); // 是否同步到erp默认不同步
this.productSpecService.update(tenantId, ps);
}
} catch (Exception e) {
e.printStackTrace();
}
response.setStatus(1);
response.setMessage("操作成功!");
Map<String, Object> map = new HashMap<>();
map.put("state", state);
map.put("msg", msg);
response.setData(map);
} else {
response.setErrCode("error");
response.setErrMessage("调用erp接口返回错误信息如下" + msg);
} // end if
} else {
response.setErrCode("error");
response.setErrMessage("调用erp接口出错");
}
return response;
}
/**
* erp
*
* @param request
* @return
*/
@ServiceMethod(method = "pos.save.material.to.erp", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "pos中保存原料向erp中同步接口")
@Override
public Object saveMaterialSyncErpDetail(MaterialToErpSyncRequest request) {
String appKey = request.getWopRequestContext().getAppKey();
logger.debug("appKey=" + appKey);
AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey);
String tenantCode = appKeyInfo.getTenantCode();
String tenantId = tenantCode;
String info = "pos.save.material.to.erp-->saveMaterialSyncErpDetail pos中保存原料向erp中同步接口";
logger.info(info + "企业号:{}", tenantId);
String materialJson = request.getMatreialJson(); // 获取调用原料接口传的数据
CommonDataResponse response = new CommonDataResponse();
List<String> ignoreSignParams = new ArrayList<>();
// 开放接口签名
Map<String, Object> paramMap = new HashMap<>(20);
// 系统级参数
paramMap.put("appKey", PropertiesUtil.getValue(fileName, "open.api.appKey")); // 开发者必须事先通过申请获取appKey/secret后,才能进行应用的开发
paramMap.put("method", "common.saveOutsourceProducts"); // 方法名称
paramMap.put("v", PropertiesUtil.getValue(fileName, "open.api.version")); // 服务方法的版本号
paramMap.put("format", PropertiesUtil.getValue(fileName, "open.api.format"));// 报文的格式支持XML和JSON默认JSON
paramMap.put("locale", PropertiesUtil.getValue(fileName, "open.api.locale")); // 本地化类型默认zh_CN
paramMap.put("timestamp", String.valueOf(System.currentTimeMillis()));// 时间戳自1970-01-01
// 00:00:00.000起的毫秒数
paramMap.put("client", PropertiesUtil.getValue(fileName, "open.api.client"));// 客户端类型
// 业务参数
paramMap.put("materialDetailJson", materialJson);
// 不需要签名的参数
// 参数签名
String signValue = this.sign(paramMap, ignoreSignParams, PropertiesUtil.getValue(fileName, "open.api.secret"));
paramMap.put("sign", signValue); // 签名串,请求参数的签名,服务平台通过它验证请求数据的合法性
String url = PropertiesUtil.getValue(fileName, "open.api.url");
try {
long startTime = System.currentTimeMillis();
final HttpResponse hr = HttpTool.url(url).form(paramMap).post();
long endTime = System.currentTimeMillis();
logger.info("执行时间:{}", endTime - startTime);
final String content = HttpTool.getResponseAsString(hr);
logger.debug("门店自采物料同步至erp的结果为{}", content);
// 返回数据成功
if (isSuccessful(content)) {
JSONObject object = JSON.parseObject(content);
String state = object.getString("state");
String msg = object.getString("msg");
// 当返回状态为1 标识操作成功
if (StringUtils.equals("1", state)) {
JSONObject mdJson = JSON.parseObject(materialJson);
String materialNo = mdJson.getString("materialNo");
Criteria c = new Criteria();
c.add(Restrictions.eq("no", materialNo));
c.add(Restrictions.eq("type", 10));
List<Product> mdList = this.productService.getList(tenantId, c);
if (CollectionUtils.isNotEmpty(mdList)) {
Product p = mdList.get(0);
p.setErpSyncFlag(1); // 是否同步到erp默认不同步
this.productService.update(tenantId, p);
}
response.setStatus(1);
response.setMessage("操作成功!");
} else {
response.setErrCode("error");
response.setErrMessage("调用erp接口返回错误信息如下" + msg);
} // end if
} else {
response.setErrCode("error");
response.setErrMessage("调用erp接口出错");
}
} catch (Exception e) {
e.printStackTrace();
}
return response;
}
@ServiceMethod(method = "boduo.product.list", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "商品列表(分页)")
@Override
public Object boduoProductList(ProductRequest request) {
String info = "商品列表(分页)";
String appKey = request.getWopRequestContext().getAppKey();
logger.debug("appKey=" + appKey);
AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey);
String appId = appKeyInfo.getAppId();
String tenantCode = appKeyInfo.getTenantCode();
String appCode = appKeyInfo.getAppCode();
String tenantId = tenantCode;
int pageNumber = request.getPageNumber();
int pageSize = request.getPageSize();
CommonPagerResponse response = null;
try {
response = new CommonPagerResponse();
Store store = storeService.get(tenantId, request.getStoreId());
if (store == null) {
response.setStatus(0);
response.setMessage("门店ID不存在");
response.setErrCode(CommonErrorCode.error3.getCode());
response.setErrMessage(CommonErrorCode.error3.getMessage());
return response;
}
Pager pager = new Pager();
pager.setPageSize(pageSize);
pager.setPageNumber(pageNumber);
pager = productService.getPagerByStoreId(tenantId, request.getStoreId(), pager);
Set<String> productIdSet = new HashSet<>();
List<Map<String, Object>> list = new ArrayList<>();
if (pager.getList() != null && pager.getList().size() > 0) {
List<Product> source = (List<Product>) pager.getList();
for (Product product : source) {
if(productIdSet.contains(product.getId())){
//System.out.println("此商品Id 重复 01 >>>>>>>>> "+product.getId());
continue;
}
productIdSet.add(product.getId());
Map<String, Object> map = new HashMap<>();
map.put("tenantId", product.getTenantId());
map.put("id", product.getId());
map.put("brandId", product.getBrandId());
map.put("typeId", product.getTypeId());
map.put("typePath", product.getTypePath());
map.put("no", product.getNo());
map.put("name", product.getName());
map.put("spell", product.getSpell());
map.put("assistNo", product.getAssistNo());
map.put("barCode", product.getBarCode());
map.put("otherNo", product.getOtherNo());
map.put("shortName", product.getShortName());
map.put("english", product.getEnglish());
map.put("unitId", product.getUnitId());
map.put("description", product.getDescription());
map.put("commissionType", product.getCommissionType());
map.put("commissionValue", doubleFormat(product.getCommissionType()));
map.put("discountFlag", product.getDiscountFlag());
map.put("tapleFlag", product.getTapleFlag());
map.put("weighFlag", product.getWeighFlag());
map.put("currentFlag", product.getCurrentFlag());
map.put("labelPrintFlag", product.getLabelPrintFlag());
map.put("suitFlag", product.getSuitFlag());
map.put("mebDiscountFlag", product.getMebDiscountFlag());
map.put("giveFlag", product.getGiveFlag());
map.put("promotionFlag", product.getPromotionFlag());
map.put("type", product.getType());
map.put("stockFlag", product.getStockFlag());
map.put("pointType", product.getPointType());
map.put("pointValue", doubleFormat(product.getPointValue()));
map.put("purchaseTax", doubleFormat(product.getPurchaseTax()));
map.put("saleTax", doubleFormat(product.getSaleTax()));
map.put("lyRate", doubleFormat(product.getLyRate()));
map.put("groupName", product.getGroupName());
map.put("picture", product.getPicture());
map.put("stopFlag", product.getStopFlag());
map.put("price", product.getPrice());
map.put("memberPrice", doubleFormat(product.getMemberPrice()));
map.put("otherPrice", doubleFormat(product.getOtherPrice()));
map.put("costPrice", doubleFormat(product.getCostPrice()));
map.put("purchasePrice", doubleFormat(product.getPurchasePrice()));
map.put("dispatchPrice", doubleFormat(product.getDispatchPrice()));
map.put("minPrice", doubleFormat(product.getMinPrice()));
map.put("specCount", product.getSpecCount() == null ? 1 : product.getSpecCount());
map.put("kdsFlag", product.getKdsFlag());
list.add(map);
}
}
response.setStatus(1);
response.setMessage("获取成功");
response.setPageNumber(pager.getPageNumber());
response.setPageSize(pager.getPageSize());
response.setPageCount(pager.getPageCount());
response.setTotalCount(pager.getTotalCount());
if (pageNumber == 1 && store.getExt1() != null && !"".equals(store.getExt1())) {
// 第一步获取直营外购
List<Map<String, Object>> zyList = new ArrayList<>();
Criteria criteria = new Criteria();
criteria.add(Restrictions.like("typePath", "812862922350006272,812862924627513344"));
criteria.add(Restrictions.eq("deleteFlag", 0));
List<Product> productList = productService.getList(tenantId, criteria);
if (productList != null && productList.size() > 0) {
for (Product product : productList) {
if(productIdSet.contains(product.getId())){
//System.out.println("此商品Id 重复 02 >>>>>>>>> "+product.getId());
continue;
}
productIdSet.add(product.getId());
Map<String, Object> map = new HashMap<>();
map.put("tenantId", product.getTenantId());
map.put("id", product.getId());
map.put("brandId", product.getBrandId());
map.put("typeId", product.getTypeId());
map.put("typePath", product.getTypePath());
map.put("no", product.getNo());
map.put("name", product.getName());
map.put("spell", product.getSpell());
map.put("assistNo", product.getAssistNo());
map.put("barCode", product.getBarCode());
map.put("otherNo", product.getOtherNo());
map.put("shortName", product.getShortName());
map.put("english", product.getEnglish());
map.put("unitId", product.getUnitId());
map.put("description", product.getDescription());
map.put("commissionType", product.getCommissionType());
map.put("commissionValue", doubleFormat(product.getCommissionType()));
map.put("discountFlag", product.getDiscountFlag());
map.put("tapleFlag", product.getTapleFlag());
map.put("weighFlag", product.getWeighFlag());
map.put("currentFlag", product.getCurrentFlag());
map.put("labelPrintFlag", product.getLabelPrintFlag());
map.put("suitFlag", product.getSuitFlag());
map.put("mebDiscountFlag", product.getMebDiscountFlag());
map.put("giveFlag", product.getGiveFlag());
map.put("promotionFlag", product.getPromotionFlag());
map.put("type", product.getType());
map.put("stockFlag", product.getStockFlag());
map.put("pointType", product.getPointType());
map.put("pointValue", doubleFormat(product.getPointValue()));
map.put("purchaseTax", doubleFormat(product.getPurchaseTax()));
map.put("saleTax", doubleFormat(product.getSaleTax()));
map.put("lyRate", doubleFormat(product.getLyRate()));
map.put("groupName", product.getGroupName());
map.put("picture", product.getPicture());
map.put("stopFlag", product.getStopFlag());
map.put("price", product.getPrice());
map.put("memberPrice", doubleFormat(product.getMemberPrice()));
map.put("otherPrice", doubleFormat(product.getOtherPrice()));
map.put("costPrice", doubleFormat(product.getCostPrice()));
map.put("purchasePrice", doubleFormat(product.getPurchasePrice()));
map.put("dispatchPrice", doubleFormat(product.getDispatchPrice()));
map.put("minPrice", doubleFormat(product.getMinPrice()));
map.put("specCount", product.getSpecCount() == null ? 1 : product.getSpecCount());
map.put("kdsFlag", product.getKdsFlag());
zyList.add(map);
}
if (CollectionUtils.isNotEmpty(zyList)) {
list.addAll(zyList);
}
}
// 第二部获取要货原料
try {
List<Map<String, Object>> materialList = new ArrayList<>();
// 开放接口签名
Map<String, Object> paramMap = new HashMap<>(20);
List<String> ignoreSignParams = new ArrayList<String>();
// 系统级参数
paramMap.put("appKey", PropertiesUtil.getValue(fileName, "open.api.appKey")); // 开发者必须事先通过申请获取appKey/secret后,才能进行应用的开发
paramMap.put("method", "common.getCustomerToPriceInfo"); // 方法名称
paramMap.put("v", PropertiesUtil.getValue(fileName, "open.api.version")); // 服务方法的版本号
paramMap.put("format", PropertiesUtil.getValue(fileName, "open.api.format"));// 报文的格式支持XML和JSON默认JSON
paramMap.put("locale", PropertiesUtil.getValue(fileName, "open.api.locale")); // 本地化类型默认zh_CN
paramMap.put("timestamp", String.valueOf(System.currentTimeMillis()));// 时间戳自1970-01-01
paramMap.put("client", PropertiesUtil.getValue(fileName, "open.api.client"));// 客户端类型
// 业务参数
paramMap.put("cCusCode", store.getExt1());
// 参数签名
String signValue = this.sign(paramMap, ignoreSignParams, PropertiesUtil.getValue(fileName, "open.api.secret"));
paramMap.put("sign", signValue); // 签名串,请求参数的签名,服务平台通过它验证请求数据的合法性
String url = PropertiesUtil.getValue(fileName, "open.api.url");
long startTime = System.currentTimeMillis();
final HttpResponse hr = HttpTool.url(url).form(paramMap).post();
long endTime = System.currentTimeMillis();
logger.info("执行时间:{}", endTime - startTime);
final String content = HttpTool.getResponseAsString(hr);
logger.debug("调用erp接口返回的数据如下{}", content);
if (this.isSuccessful(content)) {
JSONObject object = JSON.parseObject(content);
JSONArray ja = object.getJSONArray("imaap");
List<String> nos = new ArrayList<>();
Map<String, Double> noMap = new HashMap<>();
for (int i = 0; i < ja.size(); i++) {
JSONObject jobject = ja.getJSONObject(i);
String materialNo = jobject.getString("imaa001");
Double materialPrice = jobject.getDouble("imaa157");
nos.add(materialNo);
noMap.put(materialNo, materialPrice);
}
if (nos != null && nos.size() > 0) {
criteria = new Criteria();
criteria.add(Restrictions.eq("tenantId", tenantId));
criteria.add(Restrictions.eq("type", 10));
criteria.add(Restrictions.in("no", nos));
List<Product> source = productService.getList(tenantId, criteria);
for (Product product : source) {
if(productIdSet.contains(product.getId())){
//System.out.println("此商品Id 重复 03 >>>>>>>>> "+product.getId());
continue;
}
productIdSet.add(product.getId());
Map<String, Object> map = new HashMap<>();
map.put("tenantId", product.getTenantId());
map.put("id", product.getId());
map.put("brandId", product.getBrandId());
map.put("typeId", product.getTypeId());
map.put("typePath", product.getTypePath());
map.put("no", product.getNo());
map.put("name", product.getName());
map.put("spell", product.getSpell());
map.put("assistNo", product.getAssistNo());
map.put("barCode", product.getBarCode());
map.put("otherNo", product.getOtherNo());
map.put("shortName", product.getShortName());
map.put("english", product.getEnglish());
map.put("unitId", product.getUnitId());
map.put("description", product.getDescription());
map.put("commissionType", product.getCommissionType());
map.put("commissionValue", doubleFormat(product.getCommissionType()));
map.put("discountFlag", product.getDiscountFlag());
map.put("tapleFlag", product.getTapleFlag());
map.put("weighFlag", product.getWeighFlag());
map.put("currentFlag", product.getCurrentFlag());
map.put("labelPrintFlag", product.getLabelPrintFlag());
map.put("suitFlag", product.getSuitFlag());
map.put("mebDiscountFlag", product.getMebDiscountFlag());
map.put("giveFlag", product.getGiveFlag());
map.put("promotionFlag", product.getPromotionFlag());
map.put("type", product.getType());
map.put("stockFlag", product.getStockFlag());
map.put("pointType", product.getPointType());
map.put("pointValue", doubleFormat(product.getPointValue()));
map.put("purchaseTax", doubleFormat(product.getPurchaseTax()));
map.put("saleTax", doubleFormat(product.getSaleTax()));
map.put("lyRate", doubleFormat(product.getLyRate()));
map.put("groupName", product.getGroupName());
map.put("picture", product.getPicture());
map.put("stopFlag", product.getStopFlag());
map.put("price", product.getPrice());
map.put("memberPrice", doubleFormat(product.getMemberPrice()));
map.put("otherPrice", doubleFormat(product.getOtherPrice()));
map.put("costPrice", doubleFormat(product.getCostPrice()));
map.put("purchasePrice", doubleFormat(product.getPurchasePrice()));
map.put("dispatchPrice", doubleFormat(noMap.get(product.getNo())));
map.put("minPrice", doubleFormat(product.getMinPrice()));
map.put("specCount", product.getSpecCount() == null ? 1 : product.getSpecCount());
map.put("kdsFlag", product.getKdsFlag());
materialList.add(map);
}
}
if (CollectionUtils.isNotEmpty(materialList)) {
list.addAll(materialList);
}
}
} catch (Exception e) {
logger.error(info + ",发生异常", e);
}
}
response.setList(list);
} catch (Exception e) {
logger.error(info + ",发生异常", e);
return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale());
}
return response;
}
@ServiceMethod(method = "boduo.product.spec", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "商品规格列表(分页)")
@Override
public Object boduoProductSpec(ProductSpecRequest request) {
String info = "商品规格列表(分页)";
String appKey = request.getWopRequestContext().getAppKey();
logger.debug("appKey=" + appKey);
AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey);
String appId = appKeyInfo.getAppId();
String tenantCode = appKeyInfo.getTenantCode();
String appCode = appKeyInfo.getAppCode();
String tenantId = tenantCode;
int pageNumber = request.getPageNumber();
int pageSize = request.getPageSize();
CommonPagerResponse response = null;
try {
response = new CommonPagerResponse();
Store store = storeService.get(tenantId, request.getStoreId());
if (store == null) {
response.setStatus(0);
response.setMessage("门店ID不存在");
response.setErrCode(CommonErrorCode.error3.getCode());
response.setErrMessage(CommonErrorCode.error3.getMessage());
return response;
}
Pager pager = new Pager();
pager.setPageSize(pageSize);
pager.setPageNumber(pageNumber);
//pager = productSpecService.getPagerByStoreIdProduct(tenantId, request.getStoreId(), pager);
pager = productSpecService.getPagerByStoreId(tenantId, request.getStoreId(), pager);
Criteria criterias = new Criteria();
criterias.add(Restrictions.eq("deleteFlag",1));
List<Product> products = productService.getList(tenantId,criterias);
Set<String> productIdSet = new HashSet<>();
if(CollectionUtils.isNotEmpty(products)){
for(Product p : products){
if(!productIdSet.contains(p.getId())) {
productIdSet.add(p.getId());
}
}
}
Set<String> specIdsSets = new HashSet<>();
List<Map<String, Object>> list = new ArrayList<>();
if (pager.getList() != null && pager.getList().size() > 0) {
List<ProductSpec> source = (List<ProductSpec>) pager.getList();
for (ProductSpec productSpec : source) {
if(specIdsSets.contains(productSpec.getId())){
//System.out.println("此规格商品重复 01 >>>>>>>>> "+productSpec.getId());
continue;
}
if(productIdSet.contains(productSpec.getProductId())){
//System.out.println("此商品已删除 01 >>>>>>>>> "+productSpec.getProductId());
continue;
}
specIdsSets.add(productSpec.getId());
Map<String, Object> map = new HashMap<>();
map.put("tenantId", productSpec.getTenantId());
map.put("id", productSpec.getId());
map.put("productId", productSpec.getProductId());
map.put("no", productSpec.getNo());
map.put("name", productSpec.getName());
map.put("price", doubleFormat(productSpec.getPrice()));
map.put("memberPrice", doubleFormat(productSpec.getMemberPrice()));
map.put("minPrice", doubleFormat(productSpec.getMinPrice()));
map.put("otherPrice", doubleFormat(productSpec.getOtherPrice()));
map.put("costPrice", doubleFormat(productSpec.getCostPrice()));
map.put("purchasePrice", doubleFormat(productSpec.getPurchasePrice()));
map.put("dispatchPrice", doubleFormat(productSpec.getDispatchPrice()));
map.put("materialRate", doubleFormat(productSpec.getMaterialRate()));
map.put("isdefault", productSpec.getIsdefault());
map.put("deleteFlag", productSpec.getDeleteFlag());
map.put("thUseLevel", doubleFormat(productSpec.getThUseLevel()));//理论万元用量
map.put("realThUseLevel", doubleFormat(productSpec.getRealThUseLevel()));//实际万元用量
map.put("cost", doubleFormat(productSpec.getCost()));//单项成本
list.add(map);
}
}
response.setStatus(1);
response.setMessage("获取成功");
response.setPageNumber(pager.getPageNumber());
response.setPageSize(pager.getPageSize());
response.setPageCount(pager.getPageCount());
response.setTotalCount(pager.getTotalCount());
if (pageNumber == 1 && store.getExt1() != null && !"".equals(store.getExt1())) {
// 第一步获取直营外购
List<Map<String, Object>> zyList = new ArrayList<>();
Criteria criteria = new Criteria();
criteria.add(Restrictions.like("typePath", "812862922350006272,812862924627513344"));
criteria.add(Restrictions.eq("deleteFlag", 0));
List<Product> productList = productService.getList(tenantId, criteria);
if (productList != null && productList.size() > 0) {
List<String> productIds = new ArrayList<>();
for (Product product : productList) {
productIds.add(product.getId());
}
if (productIds != null && productIds.size() > 0) {
criteria = new Criteria();
criteria.add(Restrictions.in("productId", productIds));
List<ProductSpec> specList = productSpecService.getList(tenantId, criteria);
if (specList != null && specList.size() > 0) {
for (ProductSpec productSpec : specList) {
if(specIdsSets.contains(productSpec.getId())){
//System.out.println("此规格商品重复 02 >>>>>>>>> "+productSpec.getId());
continue;
}
if(productIdSet.contains(productSpec.getProductId())){
//System.out.println("此商品已删除 02 >>>>>>>>> "+productSpec.getProductId());
continue;
}
specIdsSets.add(productSpec.getId());
Map<String, Object> map = new HashMap<>();
map.put("tenantId", productSpec.getTenantId());
map.put("id", productSpec.getId());
map.put("productId", productSpec.getProductId());
map.put("no", productSpec.getNo());
map.put("name", productSpec.getName());
map.put("price", doubleFormat(productSpec.getPrice()));
map.put("memberPrice", doubleFormat(productSpec.getMemberPrice()));
map.put("minPrice", doubleFormat(productSpec.getMinPrice()));
map.put("otherPrice", doubleFormat(productSpec.getOtherPrice()));
map.put("costPrice", doubleFormat(productSpec.getCostPrice()));
map.put("purchasePrice", doubleFormat(productSpec.getPurchasePrice()));
map.put("dispatchPrice", doubleFormat(productSpec.getDispatchPrice()));
map.put("materialRate", doubleFormat(productSpec.getMaterialRate()));
map.put("isdefault", productSpec.getIsdefault());
map.put("deleteFlag", productSpec.getDeleteFlag());
map.put("thUseLevel", doubleFormat(productSpec.getThUseLevel()));//理论万元用量
map.put("realThUseLevel", doubleFormat(productSpec.getRealThUseLevel()));//实际万元用量
map.put("cost", doubleFormat(productSpec.getCost()));//单项成本
zyList.add(map);
}
}
}
if (CollectionUtils.isNotEmpty(zyList)) {
list.addAll(zyList);
}
}
try {
// 第二部获取原料资料
List<Map<String, Object>> materialList = new ArrayList<>();
// 开放接口签名
Map<String, Object> paramMap = new HashMap<>(20);
List<String> ignoreSignParams = new ArrayList<String>();
// 系统级参数
paramMap.put("appKey", PropertiesUtil.getValue(fileName, "open.api.appKey")); // 开发者必须事先通过申请获取appKey/secret后,才能进行应用的开发
paramMap.put("method", "common.getCustomerToPriceInfo"); // 方法名称
paramMap.put("v", PropertiesUtil.getValue(fileName, "open.api.version")); // 服务方法的版本号
paramMap.put("format", PropertiesUtil.getValue(fileName, "open.api.format"));// 报文的格式支持XML和JSON默认JSON
paramMap.put("locale", PropertiesUtil.getValue(fileName, "open.api.locale")); // 本地化类型默认zh_CN
paramMap.put("timestamp", String.valueOf(System.currentTimeMillis()));// 时间戳自1970-01-01
paramMap.put("client", PropertiesUtil.getValue(fileName, "open.api.client"));// 客户端类型
// 业务参数
paramMap.put("cCusCode", store.getExt1());
// 参数签名
String signValue = this.sign(paramMap, ignoreSignParams, PropertiesUtil.getValue(fileName, "open.api.secret"));
paramMap.put("sign", signValue); // 签名串,请求参数的签名,服务平台通过它验证请求数据的合法性
String url = PropertiesUtil.getValue(fileName, "open.api.url");
long startTime = System.currentTimeMillis();
final HttpResponse hr = HttpTool.url(url).form(paramMap).post();
long endTime = System.currentTimeMillis();
logger.info("执行时间:{}", endTime - startTime);
final String content = HttpTool.getResponseAsString(hr);
logger.debug("调用erp接口返回的数据如下{}", content);
if (this.isSuccessful(content)) {
JSONObject object = JSON.parseObject(content);
JSONArray ja = object.getJSONArray("imaap");
List<String> nos = new ArrayList<>();
Map<String, Double> noMap = new HashMap<>();
for (int i = 0; i < ja.size(); i++) {
JSONObject jobject = ja.getJSONObject(i);
String materialNo = jobject.getString("imaa001");
Double materialPrice = jobject.getDouble("imaa157");
nos.add(materialNo);
noMap.put(materialNo, materialPrice);
}
if (nos != null && nos.size() > 0) {
criteria = new Criteria();
criteria.add(Restrictions.eq("p.tenantId", tenantId));
criteria.add(Restrictions.eq("p.type", 10));
criteria.add(Restrictions.in("p.no", nos));
List<ProductSpec> source = productSpecService.getListWithProduct(tenantId, criteria);
for (ProductSpec productSpec : source) {
if(specIdsSets.contains(productSpec.getId())){
//System.out.println("此规格商品重复 03 >>>>>>>>> "+productSpec.getId());
continue;
}
if(productIdSet.contains(productSpec.getProductId())){
//System.out.println("此商品已删除 03 >>>>>>>>> "+productSpec.getProductId());
continue;
}
specIdsSets.add(productSpec.getId());
Map<String, Object> map = new HashMap<>();
map.put("tenantId", productSpec.getTenantId());
map.put("id", productSpec.getId());
map.put("productId", productSpec.getProductId());
map.put("no", productSpec.getNo());
map.put("name", productSpec.getName());
map.put("price", doubleFormat(productSpec.getPrice()));
map.put("memberPrice", doubleFormat(productSpec.getMemberPrice()));
map.put("minPrice", doubleFormat(productSpec.getMinPrice()));
map.put("otherPrice", doubleFormat(productSpec.getOtherPrice()));
map.put("costPrice", doubleFormat(productSpec.getCostPrice()));
map.put("purchasePrice", doubleFormat(productSpec.getPurchasePrice()));
map.put("dispatchPrice", doubleFormat(noMap.get(productSpec.getProductNo())));
map.put("materialRate", doubleFormat(productSpec.getMaterialRate()));
map.put("isdefault", productSpec.getIsdefault());
map.put("deleteFlag", productSpec.getDeleteFlag());
map.put("thUseLevel", doubleFormat(productSpec.getThUseLevel()));//理论万元用量
map.put("realThUseLevel", doubleFormat(productSpec.getRealThUseLevel()));//实际万元用量
map.put("cost", doubleFormat(productSpec.getCost()));//单项成本
materialList.add(map);
}
}
if (CollectionUtils.isNotEmpty(materialList)) {
list.addAll(materialList);
}
}
} catch (Exception e) {
logger.error(info + ",发生异常", e);
}
}
response.setList(list);
} catch (Exception e) {
logger.error(info + ",发生异常", e);
return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale());
}
return response;
}
@ServiceMethod(method = "boduo.product.ratio", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "商品库存系统(分页)")
@Override
public Object boduoProductRatio(ProductRatioRequest request) {
String info = "商品库存系统(分页)";
String appKey = request.getWopRequestContext().getAppKey();
logger.debug("appKey=" + appKey);
AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey);
String appId = appKeyInfo.getAppId();
String tenantCode = appKeyInfo.getTenantCode();
String appCode = appKeyInfo.getAppCode();
String tenantId = tenantCode;
int pageNumber = request.getPageNumber();
int pageSize = request.getPageSize();
CommonPagerResponse response = null;
try {
response = new CommonPagerResponse();
Store store = storeService.get(tenantId, request.getStoreId());
if (store == null) {
response.setStatus(0);
response.setMessage("门店ID不存在");
response.setErrCode(CommonErrorCode.error3.getCode());
response.setErrMessage(CommonErrorCode.error3.getMessage());
return response;
}
Pager pager = new Pager();
pager.setPageSize(pageSize);
pager.setPageNumber(pageNumber);
//pager = productRatioService.getPagerByStoreIdProduct(tenantId, request.getStoreId(), pager);
pager = productRatioService.getPagerByStoreId(tenantId, request.getStoreId(), pager);
List<Map<String, Object>> list = new ArrayList<>();
if (pager.getList() != null && pager.getList().size() > 0) {
List<ProductRatio> source = (List<ProductRatio>) pager.getList();
for (ProductRatio productRatio : source) {
Map<String, Object> map = new HashMap<>();
map.put("tenantId", productRatio.getTenantId());
map.put("id", productRatio.getId());
map.put("productId", productRatio.getProductId());
map.put("dispatchUnitId", productRatio.getDispatchUnitId());
map.put("purchaseUnitId", productRatio.getPurchaseUnitId());
map.put("pdScale", doubleFormat(productRatio.getPdScale()));
map.put("packUnitId", productRatio.getPackUnitId());
map.put("dpScale", doubleFormat(productRatio.getDpScale()));
map.put("salesUnitId", productRatio.getSalesUnitId());
map.put("psScale", doubleFormat(productRatio.getPsScale()));
map.put("maxStock", doubleFormat(productRatio.getMaxStock()));
map.put("minStock", doubleFormat(productRatio.getMinStock()));
list.add(map);
}
}
response.setStatus(1);
response.setMessage("获取成功");
response.setPageNumber(pager.getPageNumber());
response.setPageSize(pager.getPageSize());
response.setPageCount(pager.getPageCount());
response.setTotalCount(pager.getTotalCount());
if (pageNumber == 1 && store.getExt1() != null && !"".equals(store.getExt1())) {
// 第一步获取直营外购
List<Map<String, Object>> zyList = new ArrayList<>();
Criteria criteria = new Criteria();
criteria.add(Restrictions.like("typePath", "812862922350006272,812862924627513344"));
criteria.add(Restrictions.eq("deleteFlag", 0));
List<Product> productList = productService.getList(tenantId, criteria);
if (productList != null && productList.size() > 0) {
List<String> productIds = new ArrayList<>();
for (Product product : productList) {
productIds.add(product.getId());
}
if (productIds != null && productIds.size() > 0) {
criteria = new Criteria();
criteria.add(Restrictions.in("productId", productIds));
List<ProductRatio> ratioList = productRatioService.getList(tenantId, criteria);
if (ratioList != null && ratioList.size() > 0) {
for (ProductRatio productRatio : ratioList) {
Map<String, Object> map = new HashMap<>();
map.put("tenantId", productRatio.getTenantId());
map.put("id", productRatio.getId());
map.put("productId", productRatio.getProductId());
map.put("dispatchUnitId", productRatio.getDispatchUnitId());
map.put("purchaseUnitId", productRatio.getPurchaseUnitId());
map.put("pdScale", doubleFormat(productRatio.getPdScale()));
map.put("packUnitId", productRatio.getPackUnitId());
map.put("dpScale", doubleFormat(productRatio.getDpScale()));
map.put("salesUnitId", productRatio.getSalesUnitId());
map.put("psScale", doubleFormat(productRatio.getPsScale()));
map.put("maxStock", doubleFormat(productRatio.getMaxStock()));
map.put("minStock", doubleFormat(productRatio.getMinStock()));
zyList.add(map);
}
}
}
if (CollectionUtils.isNotEmpty(zyList)) {
list.addAll(zyList);
}
}
try {
// 第二部获取原料资料
List<Map<String, Object>> materialList = new ArrayList<>();
// 开放接口签名
Map<String, Object> paramMap = new HashMap<>(20);
List<String> ignoreSignParams = new ArrayList<String>();
// 系统级参数
paramMap.put("appKey", PropertiesUtil.getValue(fileName, "open.api.appKey")); // 开发者必须事先通过申请获取appKey/secret后,才能进行应用的开发
paramMap.put("method", "common.getCustomerToPriceInfo"); // 方法名称
paramMap.put("v", PropertiesUtil.getValue(fileName, "open.api.version")); // 服务方法的版本号
paramMap.put("format", PropertiesUtil.getValue(fileName, "open.api.format"));// 报文的格式支持XML和JSON默认JSON
paramMap.put("locale", PropertiesUtil.getValue(fileName, "open.api.locale")); // 本地化类型默认zh_CN
paramMap.put("timestamp", String.valueOf(System.currentTimeMillis()));// 时间戳自1970-01-01
paramMap.put("client", PropertiesUtil.getValue(fileName, "open.api.client"));// 客户端类型
// 业务参数
paramMap.put("cCusCode", store.getExt1());
// 参数签名
String signValue = this.sign(paramMap, ignoreSignParams, PropertiesUtil.getValue(fileName, "open.api.secret"));
paramMap.put("sign", signValue); // 签名串,请求参数的签名,服务平台通过它验证请求数据的合法性
String url = PropertiesUtil.getValue(fileName, "open.api.url");
long startTime = System.currentTimeMillis();
final HttpResponse hr = HttpTool.url(url).form(paramMap).post();
long endTime = System.currentTimeMillis();
logger.info("执行时间:{}", endTime - startTime);
final String content = HttpTool.getResponseAsString(hr);
if (this.isSuccessful(content)) {
JSONObject object = JSON.parseObject(content);
JSONArray ja = object.getJSONArray("imaap");
List<String> nos = new ArrayList<>();
Map<String, Double> noMap = new HashMap<>();
for (int i = 0; i < ja.size(); i++) {
JSONObject jobject = ja.getJSONObject(i);
String materialNo = jobject.getString("imaa001");
Double materialPrice = jobject.getDouble("imaa157");
nos.add(materialNo);
noMap.put(materialNo, materialPrice);
}
if (nos != null && nos.size() > 0) {
criteria = new Criteria();
criteria.add(Restrictions.eq("p.tenantId", tenantId));
criteria.add(Restrictions.eq("p.type", 10));
criteria.add(Restrictions.in("p.no", nos));
List<ProductRatio> source = productRatioService.getListWithProduct(tenantId, criteria, false);
for (ProductRatio productRatio : source) {
Map<String, Object> map = new HashMap<>();
map.put("tenantId", productRatio.getTenantId());
map.put("id", productRatio.getId());
map.put("productId", productRatio.getProductId());
map.put("dispatchUnitId", productRatio.getDispatchUnitId());
map.put("purchaseUnitId", productRatio.getPurchaseUnitId());
map.put("pdScale", doubleFormat(productRatio.getPdScale()));
map.put("packUnitId", productRatio.getPackUnitId());
map.put("dpScale", doubleFormat(productRatio.getDpScale()));
map.put("salesUnitId", productRatio.getSalesUnitId());
map.put("psScale", doubleFormat(productRatio.getPsScale()));
map.put("maxStock", doubleFormat(productRatio.getMaxStock()));
map.put("minStock", doubleFormat(productRatio.getMinStock()));
materialList.add(map);
}
}
if (CollectionUtils.isNotEmpty(materialList)) {
list.addAll(materialList);
}
}
} catch (Exception e) {
logger.error(info + ",发生异常", e);
}
}
response.setList(list);
} catch (Exception e) {
logger.error(info + ",发生异常", e);
return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale());
}
return response;
}
}

@ -0,0 +1,233 @@
package com.jwsaas.api.boduo.erp.service.impl;
import com.alibaba.dubbo.common.utils.CollectionUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jwsaas.api.boduo.erp.request.ErpStoreAskMaterialRequest;
import com.jwsaas.api.boduo.erp.request.StoreAskMaterialSyncRequest;
import com.jwsaas.api.boduo.erp.response.DeliveryModeListResponse;
import com.jwsaas.api.boduo.erp.response.StoreAskMaterialSyncResponse;
import com.jwsaas.api.boduo.erp.service.StoreAskMaterialSyncService;
import com.jwsaas.api.response.mode.CommonDataResponse;
import com.jwsaas.api.service.impl.ErpBaseServiceImpl;
import com.jwsaas.bean.AppKeyInfo;
import com.jwsaas.condition.Criteria;
import com.jwsaas.condition.Restrictions;
import com.jwsaas.entity.food.Product;
import com.jwsaas.entity.food.ProductSpec;
import com.jwsaas.entity.food.Store;
import com.jwsaas.entity.food.StoreProduct;
import com.jwsaas.http.HttpTool;
import com.jwsaas.open.annotation.HttpAction;
import com.jwsaas.open.annotation.NeedInSessionType;
import com.jwsaas.open.annotation.ServiceMethod;
import com.jwsaas.open.annotation.ServiceMethodBean;
import com.jwsaas.open.response.BusinessServiceErrorResponse;
import com.jwsaas.util.StringUtils;
import com.jwsaas.utils.AppKeyUtil;
import com.jwsaas.utils.PropertiesUtil;
import org.apache.http.HttpResponse;
import javax.annotation.Resource;
import java.util.*;
/**
* @Author:CHL
* @Date:Create in 2018/3/22
* @Description:
*/
@ServiceMethodBean(version = "1.0")
public class StoreAskMaterialSyncServiceImpl extends ErpBaseServiceImpl implements StoreAskMaterialSyncService {
private static final long serialVersionUID = -345096567692034912L;
@Resource
private com.jwsaas.service.food.StoreService storeService;
@Resource
private com.jwsaas.service.food.ProductService productService;
@Resource
private com.jwsaas.service.food.ProductSpecService productSpecService;
@Resource
private com.jwsaas.service.food.StoreProductService storeProductService;
//接口获取erp中获取门店允许要货的物料信息
@ServiceMethod(method = "erp.store.ask.material.sync", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "从erp中获取门店允许要货的物料信息")
@Override
public Object getAskMaterialSync(StoreAskMaterialSyncRequest request) {
String appKey = request.getWopRequestContext().getAppKey();
//NO.1 获取应用参数
String storeId = request.getStoreId(); //门店ID
logger.debug("appKey=" + appKey);
AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey);
String tenantCode = appKeyInfo.getTenantCode();
String tenantId = tenantCode;
String info = "erp.store.ask.material.sync-->getAskMaterialSync 接口获取erp中获取门店允许要货的物料信息";
logger.info(info+"企业号:{}",tenantId);
StoreAskMaterialSyncResponse response = null;
try {
response = new StoreAskMaterialSyncResponse();
String cCusCode = "";
Store s = this.storeService.get(tenantId,storeId);
if(s==null){
response.setErrCode("error");
response.setMessage("操作失败");
response.setCount(0);
return response;
}
cCusCode = s.getExt1(); // 扩展信息
if(StringUtils.isEmpty(cCusCode)){
response.setErrCode("error");
response.setMessage("请先编辑门店信息中的扩展信息对应erp中的客户编号");
response.setCount(0);
return response;
}
// 开放接口签名
Map<String, Object> paramMap = new HashMap<>(20);
List<String> ignoreSignParams = new ArrayList<String>();
// 系统级参数
paramMap.put("appKey", PropertiesUtil.getValue(fileName, "open.api.appKey")); //开发者必须事先通过申请获取appKey/secret后,才能进行应用的开发
paramMap.put("method", "common.getCustomerToPriceInfo"); //方法名称
paramMap.put("v", PropertiesUtil.getValue(fileName, "open.api.version")); //服务方法的版本号
paramMap.put("format", PropertiesUtil.getValue(fileName, "open.api.format"));//报文的格式支持XML和JSON默认JSON
paramMap.put("locale", PropertiesUtil.getValue(fileName, "open.api.locale")); //本地化类型默认zh_CN
paramMap.put("timestamp", String.valueOf(System.currentTimeMillis()));//时间戳自1970-01-01 00:00:00.000起的毫秒数
paramMap.put("client", PropertiesUtil.getValue(fileName, "open.api.client"));//客户端类型
// 业务参数
paramMap.put("cCusCode",cCusCode);
// 参数签名
String signValue = this.sign(paramMap, ignoreSignParams,PropertiesUtil.getValue(fileName,"open.api.secret"));
paramMap.put("sign",signValue); //签名串,请求参数的签名,服务平台通过它验证请求数据的合法性
String url=PropertiesUtil.getValue(fileName,"open.api.url");
long startTime = System.currentTimeMillis();
final HttpResponse hr = HttpTool.url(url).form(paramMap).post();
long endTime = System.currentTimeMillis();
logger.info("执行时间:{}",endTime-startTime);
final String content = HttpTool.getResponseAsString(hr);
logger.debug("调用erp接口返回的数据如下{}",content);
if(this.isSuccessful(content)){
JSONObject object = JSON.parseObject(content);
JSONArray ja = object.getJSONArray("imaap");
for (int i =0 ;i<ja.size();i++) {
JSONObject jobject = ja.getJSONObject(i);
String materialNo = jobject.getString("imaa001");
Double materialPrice = jobject.getDouble("imaa157");
//便利erp中获取门店允许要的物料持久化到数据库中
writeDataToDB(tenantId,materialNo,materialPrice,s.getId());
}
response.setStatus(1);
response.setMessage("操作成功");
response.setCount(ja.size());
}else{
response.setErrCode("error");
response.setMessage("操作失败,调用erp接口--> common.getCustomerToPriceInfo获取门店原料信息失败");
response.setCount(0);
}
} catch (Exception e) {
e.printStackTrace();
logger.error(info + ",发生异常", e);
return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale());
}
return response;
}
private void writeDataToDB(String tenantId, String materialNo, Double materialPrice,String storeId) throws Exception {
Criteria c = new Criteria();
c.add(Restrictions.eq("no",materialNo));
c.add(Restrictions.eq("type",10));
List<Product> pList = this.productService.getList(tenantId,c);
for(Product p :pList){
String pId = p.getId();
c = new Criteria();
c.add(Restrictions.eq("storeId",storeId));
c.add(Restrictions.eq("productId",pId));
List<StoreProduct> spList = this.storeProductService.getList(tenantId,c);
if(CollectionUtils.isNotEmpty(spList)){
logger.warn("门店允许要货原料ID:{}",pId);
break;
}
String pTypeId = p.getTypeId();
String pTypePatch = p.getTypePath();
String pUnitId = p.getUnitId();
c = new Criteria();
c.add(Restrictions.eq("productId",pId));
List<ProductSpec> psList = this.productSpecService.getList(tenantId,c);
if(CollectionUtils.isNotEmpty(psList)) {
ProductSpec ps = psList.get(0);
StoreProduct sp = new StoreProduct();
sp.setTenantId(tenantId);
sp.setStoreId(storeId);
sp.setProductId(pId);
sp.setSpecId(ps.getId());
sp.setProductUnitId(pUnitId);
sp.setTypeId(pTypeId);
sp.setTypePath(pTypePatch);
sp.setPrice(0.0);
sp.setMinPrice(0.0);
sp.setMemberPrice(0.0);
sp.setOtherPrice(0.0);
sp.setCostPrice(0.0);
sp.setPurchasePrice(0.0);
sp.setDispatchPrice(materialPrice);
sp.setCreateUser("erp_pos");
sp.setCreateDate(new Date());
StoreProduct spdb = this.storeProductService.save(tenantId,sp);
logger.debug("持久化数据如下:{}",JSON.toJSONString(spdb));
}
}
}
//erp当门店要货物料发生改变后向pos这边推送的数据接口
@ServiceMethod(method = "erp.save.store.ask.material", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "erp门店要货物料发生改变后向pos这边推送的数据接口")
@Override
public Object getErpStoreAskMaterial(ErpStoreAskMaterialRequest request) {
String appKey = request.getWopRequestContext().getAppKey();
//NO.1 获取应用参数
String customerNo = request.getCustomerNo(); //门店erp编号信息
String materialPrices = request.getMatePriceJson(); //门店物料与价格的对应map格式的json
logger.debug("appKey=" + appKey);
AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey);
String tenantCode = appKeyInfo.getTenantCode();
String tenantId = tenantCode;
String info = "erp.save.store.ask.material-->getErpStoreAskMaterial erp当门店要货物料发生改变后向pos这边推送的数据接口";
logger.info(info+"企业号:{}",tenantId);
StoreAskMaterialSyncResponse response = null;
try {
response= new StoreAskMaterialSyncResponse();
Criteria c = new Criteria();
c.add(Restrictions.eq("ext1",customerNo));
List<Store> storeList = this.storeService.getList(tenantId,c);
if(CollectionUtils.isEmpty(storeList)){
response.setErrCode("error");
response.setErrMessage("没有查询到客户编号为:"+customerNo+"指定的门店");
}
Store s = storeList.get(0);
JSONArray ja = JSONArray.parseArray(materialPrices);
for (int i =0 ;i<ja.size();i++) {
JSONObject jobject = ja.getJSONObject(i);
String mNo = jobject.getString("materialNo");
Double mPrice = jobject.getDouble("materialPrice");
String storeId = s.getId();
//向erp中更新数据
writeDataToDB(tenantId,mNo,mPrice,storeId);
}
response.setStatus(1);
response.setMessage("操作成功");
response.setCount(ja.size());
} catch (Exception e) {
e.printStackTrace();
}
return response;
}
}

@ -0,0 +1,240 @@
package com.jwsaas.api.boduo.erp.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jwsaas.api.boduo.erp.request.V1PosDishToV2Request;
import com.jwsaas.api.boduo.erp.service.V1PosToV2PosDataService;
import com.jwsaas.api.response.mode.CommonDataResponse;
import com.jwsaas.api.service.impl.ErpBaseServiceImpl;
import com.jwsaas.bean.AppKeyInfo;
import com.jwsaas.condition.Criteria;
import com.jwsaas.condition.Restrictions;
import com.jwsaas.entity.food.ProductSpec;
import com.jwsaas.entity.food.Store;
import com.jwsaas.entity.food.StoreProduct;
import com.jwsaas.http.HttpTool;
import com.jwsaas.open.annotation.HttpAction;
import com.jwsaas.open.annotation.NeedInSessionType;
import com.jwsaas.open.annotation.ServiceMethod;
import com.jwsaas.open.annotation.ServiceMethodBean;
import com.jwsaas.open.response.BusinessServiceErrorResponse;
import com.jwsaas.utils.AppKeyUtil;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpResponse;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.*;
/**
* @Author:CHL
* @Date:Create in 2018/3/22
* @Description:
*/
@ServiceMethodBean(version = "1.0")
public class V1PosToV2PosDataServiceImpl extends ErpBaseServiceImpl implements V1PosToV2PosDataService {
private static final long serialVersionUID = -3450965676920349982L;
@Resource
private com.jwsaas.service.food.StoreService storeService;
@Resource
private com.jwsaas.service.food.StoreProductService storeProductService;
@Resource
private com.jwsaas.service.food.ProductSpecService productSpecService;
@ServiceMethod(method = "store.sale.dish.sync", httpAction = HttpAction.POST, needInSession = NeedInSessionType.NO, title = "从v1门店销售数据同步到v2")
@Override
public Object saveV1PosDishToV2Detail(V1PosDishToV2Request request) {
String appKey = request.getWopRequestContext().getAppKey();
logger.debug("appKey=" + appKey);
AppKeyInfo appKeyInfo = AppKeyUtil.decode(appKey);
String tenantCode = appKeyInfo.getTenantCode();
String tenantId = tenantCode;
//NO.1 获取升级的门店信息
String storeNos = request.getStoreNos();
String v1tenantId =request.getV1TenantId();
String info = "store.sale.dish.sync-->saveV1PosDishToV2Detail 接口从v1门店销售数据同步到v2";
logger.info(info+"企业号:{}",tenantId);
CommonDataResponse response = null;
try {
response = new CommonDataResponse();
String storeNoAr [] = StringUtils.split(storeNos,",");
//NO.2 遍历每个升级的门店编号
int hasNotStore =0; // 不存在的门店
int syncStore=0; // 已同步的门店
int syncDishCount=0; //同步数据条数
for(String storeNo:storeNoAr){
//NO.3 获取门店信息
Criteria c = new Criteria();
c.add(Restrictions.eq("no",storeNo));
List<Store> storeList = this.storeService.getList(tenantId,c);
if(CollectionUtils.isEmpty(storeList)){
hasNotStore++;
logger.info("此门店:{}在v2系统中不存在",storeNo);
continue;
}
Store s = storeList.get(0);
String storeId = s.getId();
String thirdNo = s.getThirdNo(); // v1门店编号
if (StringUtils.isEmpty(thirdNo)) {
logger.debug("v2门店信息里没有设置第三方编号");
continue;
}
//NO.4 获取门店销售商品信息
c= new Criteria();
c.add(Restrictions.eq("csp.storeId",storeId));
//销售的商品类型
c.add(Restrictions.eq("cp.type",0));
List<StoreProduct> storeProductList = this.storeProductService.getSyncStoreDishList(tenantId,c);
if(CollectionUtils.isNotEmpty(storeProductList)){
syncStore++;
logger.debug("此门店:{}在v2系统中不存在",storeNo);
continue;
}
//NO.5 调用数据同步接口
List<String> ignoreSignParams = new ArrayList<>();
// 开放接口签名
Map<String, Object> paramMap = new HashMap<>(20);
int pageNumber = 1;
paramMap.put("appKey", "00001"); //开发者必须事先通过申请获取appKey/secret后,才能进行应用的开发
paramMap.put("method","sync.store.dish"); //方法名称
paramMap.put("v","1.0"); //服务方法的版本号
paramMap.put("format","json");//报文的格式支持XML和JSON默认JSON
paramMap.put("locale","zh_CN"); //本地化类型默认zh_CN
paramMap.put("timestamp",String.valueOf(System.currentTimeMillis()));//时间戳自1970-01-01 00:00:00.000起的毫秒数
paramMap.put("client","weixin");//客户端类型
// 业务参数
paramMap.put("tenantId",v1tenantId);
paramMap.put("storeNo",thirdNo);
ignoreSignParams.add("storeNo");
// 参数签名
String signValue = this.sign(paramMap, ignoreSignParams,"abcdeabcdeabcdeabcdeabcde");
paramMap.put("sign",signValue); //签名串,请求参数的签名,服务平台通过它验证请求数据的合法性
paramMap.put("pageNumber",pageNumber);
paramMap.put("pageSize",20);
String url="http://s1.boduogroup.com:8088/open-web/api";
long startTime = System.currentTimeMillis();
final HttpResponse hr = HttpTool.url(url).form(paramMap).post();
long endTime = System.currentTimeMillis();
logger.info("执行时间:{}",endTime-startTime);
final String content = HttpTool.getResponseAsString(hr);
logger.debug("调用接口返回的数据如下:{}",content);
if(!isSuccessful(content)){
response.setErrCode("error");
response.setErrMessage("获取门店要销售商品同步接口失败");
return response;
}
JSONObject jo = JSON.parseObject(content); //把返回的数据转成json
//返回数据的状态
Integer status = jo.getInteger("status");
String message = jo.getString("message");
if(status!=1 ){
message = jo.getString("errMessage");
response.setErrCode("error");
response.setErrMessage("获取门店要销售商品同步接口失败" + message);
return response;
}
Integer pageCount = jo.getInteger("pageCount");// 总页数
List<StoreProduct> products = new ArrayList<>();
while(pageNumber<=pageCount){
JSONArray obja = jo.getJSONArray("list");
if(CollectionUtils.isEmpty(obja)){
response.setErrCode("error");
response.setErrMessage("没有查询到数据,同步失败");
return response;
}
for(int ii =0;ii<obja.size();ii++){
Map<String,Object> map = (Map<String,Object>) obja.get(ii);
//v1同步过来的菜品信息
String v1dishNo = map.get("dishNo")+""; //菜品编号
String v1specName = map.get("specName")+""; //规格名称
Double v1price = Double.parseDouble(map.get("price")== null?"0":map.get("price")+""); //门店价格
Double v1MemberPrice = Double.parseDouble(map.get("memberPrice")== null?"0":map.get("memberPrice")+""); //门店会员价格
//根据销售商品的编号规格查询商品
List<ProductSpec> specMap = getProductSpecByDishNoSpecName(tenantId,v1dishNo,v1specName);
if(CollectionUtils.isEmpty(specMap)){
continue;
}
StoreProduct product = new StoreProduct();
product.setTenantId(tenantId);
product.setCreateDate(new Date());
product.setCreateUser("sync_pos");
product.setStoreId(s.getId());
ProductSpec spec = specMap.get(0);
product.setProductId(spec.getProductId());
product.setSpecId(spec.getId());
product.setProductUnitId(spec.getUnitId());
product.setTypeId(spec.getTypeId());
product.setTypePath(spec.getTypePath());
/* product.setPrice(spec.getPrice());
product.setMemberPrice(spec.getMemberPrice());*/
//这点有点吭取的是门店获取的价格
product.setPrice(v1price);
product.setMemberPrice(v1MemberPrice);
products.add(product);
}
pageNumber++;
paramMap.put("pageNumber",pageNumber);
paramMap.put("pageSize",20);
final HttpResponse hr1 = HttpTool.url(url).form(paramMap).post();
logger.info("执行时间:{}",endTime-startTime);
final String content1 = HttpTool.getResponseAsString(hr1);
jo = JSON.parseObject(content1);
}
if(CollectionUtils.isNotEmpty(products)){
storeProductService.save(tenantId,products);
syncDishCount +=products.size();
}
}
//NO.6 构建返回数据并返回
Map<String,Object> map = new HashMap<>();
map.put("hasNotStore",hasNotStore); // 不存在的门店
map.put("syncStore",syncStore); // 已同步的门店
map.put("syncDishCount",syncDishCount);//同步数据条数
response.setStatus(0);
response.setMessage("同步成功");
response.setData(map);
} catch (Exception e) {
e.printStackTrace();
logger.error(info + ",发生异常", e);
return new BusinessServiceErrorResponse(request.getWopRequestContext(), "COMMON_ERROR", request.getWopRequestContext().getLocale());
}
return response;
}
private List<ProductSpec> getProductSpecByDishNoSpecName(String tenantId,String dishNo,String specName){
String info = "根据商品编号与规格名称获取信息";
logger.debug(info);
List<ProductSpec> list = new ArrayList<>();
try {
Criteria criteria = new Criteria();
criteria.add(Restrictions.eq("cp.tenantId",tenantId));
criteria.add(Restrictions.eq("cp.type",0));
criteria.add(Restrictions.eq("cp.deleteFlag",0));
criteria.add(Restrictions.eq("cp.`no`",dishNo));
criteria.add(Restrictions.eq("cps.name",specName));
list = this.productSpecService.getProductSpecByDishNoSpecName(tenantId,criteria);
}catch (Exception e){
logger.error(info + "时,发生异常", e);
}
return list;
}
}

@ -0,0 +1,118 @@
package com.jwsaas.api.entity.pos;
import java.io.Serializable;
import com.alibaba.fastjson.JSONObject;
public class MaterialEntity implements Serializable {
/**
*
*/
private static final long serialVersionUID = -3489356718972226084L;
private String no;// erp原料编号
private String name;// erp原料名称
private String spec;// erp原料规格名称
private String typeNo;// erp原料分类编号
private String purchaseUnit;// erp采购单位编号
private String dispatchUnit;// erp配送单位编号
private String packUnit;// erp销售单位编号
private double costPrice;// erp原料价格
public MaterialEntity() {
}
public MaterialEntity(JSONObject json) {
if (json.containsKey("no"))
no = json.getString("no");// erp分类编号
if (json.containsKey("name"))
name = json.getString("name");// erp分类名称
if (json.containsKey("spec"))
spec = json.getString("spec");// erp原料规格名称
if (json.containsKey("typeNo"))
typeNo = json.getString("typeNo");// erp原料分类编号
if (json.containsKey("purchaseUnit"))
purchaseUnit = json.getString("purchaseUnit");// erp采购单位编号
if (json.containsKey("dispatchUnit"))
dispatchUnit = json.getString("dispatchUnit");// erp配送单位编号
if (json.containsKey("packUnit"))
packUnit = json.getString("packUnit");// erp销售单位编号
if (json.containsKey("costPrice"))
costPrice = json.getDoubleValue("costPrice");// erp原料价格
}
public String getNo() {
return no;
}
public void setNo(String no) {
this.no = no;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSpec() {
return spec;
}
public void setSpec(String spec) {
this.spec = spec;
}
public String getTypeNo() {
return typeNo;
}
public void setTypeNo(String typeNo) {
this.typeNo = typeNo;
}
public void setCostPrice(double costPrice) {
this.costPrice = costPrice;
}
public String getPurchaseUnit() {
return purchaseUnit;
}
public void setPurchaseUnit(String purchaseUnit) {
this.purchaseUnit = purchaseUnit;
}
public String getDispatchUnit() {
return dispatchUnit;
}
public void setDispatchUnit(String dispatchUnit) {
this.dispatchUnit = dispatchUnit;
}
public String getPackUnit() {
return packUnit;
}
public void setPackUnit(String packUnit) {
this.packUnit = packUnit;
}
public double getCostPrice() {
return costPrice;
}
}

@ -0,0 +1,66 @@
package com.jwsaas.api.entity.pos;
import com.alibaba.fastjson.JSONObject;
import java.io.Serializable;
/**
* Created by Administrator on 2019\9\25 0025.
*/
public class MaterialInfo implements Serializable {
private static final long serialVersionUID = 6716085843120385605L;
private String productNo;
private Double amount;
private Double price;
private String description;
public MaterialInfo() {
}
public MaterialInfo(JSONObject json) {
if (json.containsKey("productNo"))
productNo = json.getString("productNo");
if (json.containsKey("amount"))
amount = json.getDouble("amount");
if (json.containsKey("price"))
price = json.getDouble("price");
if (json.containsKey("description"))
description = json.getString("description");
}
public String getProductNo() {
return productNo;
}
public void setProductNo(String productNo) {
this.productNo = productNo;
}
public Double getAmount() {
return amount;
}
public void setAmount(Double amount) {
this.amount = amount;
}
public Double getPrice() {
return price;
}
public void setPrice(Double price) {
this.price = price;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}

@ -0,0 +1,56 @@
package com.jwsaas.api.entity.pos;
import java.io.Serializable;
import com.alibaba.fastjson.JSONObject;
public class MaterialTypeEntity implements Serializable {
/**
*
*/
private static final long serialVersionUID = -3489356718972226084L;
private String no;// erp分类编号
private String name;// erp分类名称
private String parentNo;// 父分类编号
public MaterialTypeEntity() {
}
public MaterialTypeEntity(JSONObject json) {
if (json.containsKey("no"))
no = json.getString("no");// erp分类编号
if (json.containsKey("name"))
name = json.getString("name");// erp分类名称
if (json.containsKey("parentNo"))
parentNo = json.getString("parentNo");// erp父分类编号
}
public String getNo() {
return no;
}
public void setNo(String no) {
this.no = no;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getParentNo() {
return parentNo;
}
public void setParentNo(String parentNo) {
this.parentNo = parentNo;
}
}

@ -0,0 +1,45 @@
package com.jwsaas.api.entity.pos;
import java.io.Serializable;
import com.alibaba.fastjson.JSONObject;
public class MaterialUnitEntity implements Serializable {
/**
*
*/
private static final long serialVersionUID = -8436955093744482319L;
private String no;// erp单位编号
private String name;// erp单位名称
public MaterialUnitEntity() {
}
public MaterialUnitEntity(JSONObject json) {
if (json.containsKey("no"))
no = json.getString("no");// erp单位编号
if (json.containsKey("name"))
name = json.getString("name");// erp单位名称
}
public String getNo() {
return no;
}
public void setNo(String no) {
this.no = no;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

@ -0,0 +1,67 @@
package com.jwsaas.api.entity.pos;
import java.io.Serializable;
import com.alibaba.fastjson.JSONObject;
public class PosSetConfigEntity implements Serializable {
private static final long serialVersionUID = 6085891294284274775L;
private String id;//前台ID
private String group;//资源组
private String keys;//设置键
private String values;//设置值
public PosSetConfigEntity() {
}
public PosSetConfigEntity(JSONObject json) {
if (json.containsKey("id"))
id = json.getString("id");// 前台ID
if (json.containsKey("group"))
group = json.getString("group");// 资源组
if (json.containsKey("keys"))
keys = json.getString("keys");// 设置键
if (json.containsKey("values"))
values = json.getString("values");// 设置值
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getGroup() {
return group;
}
public void setGroup(String group) {
this.group = group;
}
public String getKeys() {
return keys;
}
public void setKeys(String keys) {
this.keys = keys;
}
public String getValues() {
return values;
}
public void setValues(String values) {
this.values = values;
}
}

@ -0,0 +1,218 @@
package com.jwsaas.api.entity.pos;
import java.io.Serializable;
import com.alibaba.fastjson.JSONObject;
public class PosSetModuleEntity implements Serializable {
private static final long serialVersionUID = -8017286920671469828L;
private String id;// 前台ID
private String area;// 区域
private String parentId;// 父功能
private String name;// 名称
private String alias;// 显示名称
private String keycode;// 资源code
private String keydata;// 资源值
private String color1;// 字体颜色
private String color2;// 背景色
private String color3;// 选中色
private String fontSize;// 字体类型
private String shortcut;// 按钮快捷键
private Integer orderNo;// 显示顺序
private String icon;// 图片
private String resourceId;// 资源ID
private Integer enable;// 是否启用
private Integer layout;// 布局类型
public PosSetModuleEntity() {
}
public PosSetModuleEntity(JSONObject json) {
if (json.containsKey("id"))
id = json.getString("id");// 前台ID
if (json.containsKey("area"))
area = json.getString("area");// 区域
if (json.containsKey("parentId"))
parentId = json.getString("parentId");// 父功能
if (json.containsKey("name"))
name = json.getString("name");// 名称
if (json.containsKey("alias"))
alias = json.getString("alias");// 显示名称
if (json.containsKey("keycode"))
keycode = json.getString("keycode");// 资源code
if (json.containsKey("keydata"))
keydata = json.getString("keydata");// 资源值
if (json.containsKey("color1"))
color1 = json.getString("color1");// 字体颜色
if (json.containsKey("color2"))
color2 = json.getString("color2");// 背景色
if (json.containsKey("color3"))
color3 = json.getString("color3");// 选中色
if (json.containsKey("fontSize"))
fontSize = json.getString("fontSize");// 字体类型
if (json.containsKey("shortcut"))
shortcut = json.getString("shortcut");// 按钮快捷键
if (json.containsKey("orderNo"))
orderNo = json.getInteger("orderNo");// 显示顺序
if (json.containsKey("icon"))
icon = json.getString("icon");// 图片
if (json.containsKey("resourceId"))
resourceId = json.getString("resourceId");// 资源ID
if (json.containsKey("enable"))
enable = json.getInteger("enable");// 是否启用
if (json.containsKey("layout"))
layout = json.getInteger("layout");// 布局
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getArea() {
return area;
}
public void setArea(String area) {
this.area = area;
}
public String getParentId() {
return parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAlias() {
return alias;
}
public void setAlias(String alias) {
this.alias = alias;
}
public String getKeycode() {
return keycode;
}
public void setKeycode(String keycode) {
this.keycode = keycode;
}
public String getKeydata() {
return keydata;
}
public void setKeydata(String keydata) {
this.keydata = keydata;
}
public String getColor1() {
return color1;
}
public void setColor1(String color1) {
this.color1 = color1;
}
public String getColor2() {
return color2;
}
public void setColor2(String color2) {
this.color2 = color2;
}
public String getColor3() {
return color3;
}
public void setColor3(String color3) {
this.color3 = color3;
}
public String getFontSize() {
return fontSize;
}
public void setFontSize(String fontSize) {
this.fontSize = fontSize;
}
public String getShortcut() {
return shortcut;
}
public void setShortcut(String shortcut) {
this.shortcut = shortcut;
}
public Integer getOrderNo() {
return orderNo;
}
public void setOrderNo(Integer orderNo) {
this.orderNo = orderNo;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public String getResourceId() {
return resourceId;
}
public void setResourceId(String resourceId) {
this.resourceId = resourceId;
}
public Integer getEnable() {
return enable;
}
public void setEnable(Integer enable) {
this.enable = enable;
}
public Integer getLayout() {
return layout;
}
public void setLayout(Integer layout) {
this.layout = layout;
}
}

@ -0,0 +1,101 @@
package com.jwsaas.api.entity.pos;
import java.io.Serializable;
import com.alibaba.fastjson.JSONObject;
public class PosSetResourcesEntity implements Serializable {
private static final long serialVersionUID = -206051758024485058L;
private String id;// 前台ID
private String group;// 资源组
private String name;// 资源名称
private String keycode;// 资源code
private String keydata;// 资源值
private Integer enable;// 是否启用
private String permission;// 权限
public PosSetResourcesEntity() {
}
public PosSetResourcesEntity(JSONObject json) {
if (json.containsKey("id"))
id = json.getString("id");// 前台ID
if (json.containsKey("group"))
group = json.getString("group");// 资源组
if (json.containsKey("name"))
name = json.getString("name");// 资源名称
if (json.containsKey("keycode"))
keycode = json.getString("keycode");// 资源code
if (json.containsKey("keydata"))
keydata = json.getString("keydata");// 资源值
if (json.containsKey("enable"))
enable = json.getInteger("enable");// 是否启用
if (json.containsKey("permission"))
permission = json.getString("permission");// 权限
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getGroup() {
return group;
}
public void setGroup(String group) {
this.group = group;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getKeycode() {
return keycode;
}
public void setKeycode(String keycode) {
this.keycode = keycode;
}
public String getKeydata() {
return keydata;
}
public void setKeydata(String keydata) {
this.keydata = keydata;
}
public Integer getEnable() {
return enable;
}
public void setEnable(Integer enable) {
this.enable = enable;
}
public String getPermission() {
return permission;
}
public void setPermission(String permission) {
this.permission = permission;
}
}

@ -0,0 +1,211 @@
package com.jwsaas.api.entity.pos;
import java.io.Serializable;
import com.alibaba.fastjson.JSONObject;
public class PosSetShortcutEntity implements Serializable {
private static final long serialVersionUID = 5716394299819347574L;
private String id;// 前台ID
private String area;// 区域
private String parentId;// 父功能
private String name;// 名称
private String alias;// 显示名称
private String keycode;// 资源code
private String keydata;// 资源值
private String color1;// 字体颜色
private String color2;// 背景色
private String color3;// 选中色
private String fontSize;// 字体类型
private String shortcut;// 按钮快捷键
private Integer orderNo;// 显示顺序
private String icon;// 图片
private String resourceId;// 资源ID
private Integer enable;// 是否启用
public PosSetShortcutEntity() {
}
public PosSetShortcutEntity(JSONObject json) {
if (json.containsKey("id"))
id = json.getString("id");// 前台ID
if (json.containsKey("area"))
area = json.getString("area");// 区域
if (json.containsKey("parentId"))
parentId = json.getString("parentId");// 父功能
if (json.containsKey("name"))
name = json.getString("name");// 名称
if (json.containsKey("alias"))
alias = json.getString("alias");// 显示名称
if (json.containsKey("keycode"))
keycode = json.getString("keycode");// 资源code
if (json.containsKey("keydata"))
keydata = json.getString("keydata");// 资源值
if (json.containsKey("color1"))
color1 = json.getString("color1");// 字体颜色
if (json.containsKey("color2"))
color2 = json.getString("color2");// 背景色
if (json.containsKey("color3"))
color3 = json.getString("color3");// 选中色
if (json.containsKey("fontSize"))
fontSize = json.getString("fontSize");// 字体类型
if (json.containsKey("shortcut"))
shortcut = json.getString("shortcut");// 按钮快捷键
if (json.containsKey("orderNo"))
orderNo = json.getInteger("orderNo");// 显示顺序
if (json.containsKey("icon"))
icon = json.getString("icon");// 图片
if (json.containsKey("resourceId"))
resourceId = json.getString("resourceId");// 资源ID
if (json.containsKey("enable"))
enable = json.getInteger("enable");// 是否启用
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getArea() {
return area;
}
public void setArea(String area) {
this.area = area;
}
public String getParentId() {
return parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAlias() {
return alias;
}
public void setAlias(String alias) {
this.alias = alias;
}
public String getKeycode() {
return keycode;
}
public void setKeycode(String keycode) {
this.keycode = keycode;
}
public String getKeydata() {
return keydata;
}
public void setKeydata(String keydata) {
this.keydata = keydata;
}
public String getColor1() {
return color1;
}
public void setColor1(String color1) {
this.color1 = color1;
}
public String getColor2() {
return color2;
}
public void setColor2(String color2) {
this.color2 = color2;
}
public String getColor3() {
return color3;
}
public void setColor3(String color3) {
this.color3 = color3;
}
public String getFontSize() {
return fontSize;
}
public void setFontSize(String fontSize) {
this.fontSize = fontSize;
}
public String getShortcut() {
return shortcut;
}
public void setShortcut(String shortcut) {
this.shortcut = shortcut;
}
public Integer getOrderNo() {
return orderNo;
}
public void setOrderNo(Integer orderNo) {
this.orderNo = orderNo;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public String getResourceId() {
return resourceId;
}
public void setResourceId(String resourceId) {
this.resourceId = resourceId;
}
public Integer getEnable() {
return enable;
}
public void setEnable(Integer enable) {
this.enable = enable;
}
}

@ -0,0 +1,55 @@
package com.jwsaas.api.entity.program;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonProperty;
public class AuthAccessToken implements Serializable {
private static final long serialVersionUID = 6560614925168568249L;
@JsonProperty(value = "access_token")
private String accessToken;// 获取到的凭证
@JsonProperty(value = "expires_in")
private int expiresIn;// 凭证有效时间单位秒。目前是7200秒之内的值。
@JsonProperty(value = "errcode")
private String errCode;// 错误码
@JsonProperty(value = "errmsg")
private String errMsg;// 错误信息
public String getAccessToken() {
return accessToken;
}
public void setAccessToken(String accessToken) {
this.accessToken = accessToken;
}
public int getExpiresIn() {
return expiresIn;
}
public void setExpiresIn(int expiresIn) {
this.expiresIn = expiresIn;
}
public String getErrCode() {
return errCode;
}
public void setErrCode(String errCode) {
this.errCode = errCode;
}
public String getErrMsg() {
return errMsg;
}
public void setErrMsg(String errMsg) {
this.errMsg = errMsg;
}
}

@ -0,0 +1,114 @@
package com.jwsaas.api.entity.program;
import java.io.Serializable;
import com.alibaba.fastjson.JSONObject;
public class ProgramStoreBusinessTicketDeliverEntity implements Serializable {
private static final long serialVersionUID = -8814873938456114399L;
private String clientId;//前台系统ID
private String orderTel;//订餐电话
private String name;//订餐姓名
private String address;//订餐地址
private Double latitude;//纬度
private Double longitude;//经度
private Integer deliverType;//配送类型
private Double deliverFee;//配送费
public ProgramStoreBusinessTicketDeliverEntity() {
}
public ProgramStoreBusinessTicketDeliverEntity(JSONObject json) {
if (json.containsKey("id"))
clientId = json.getString("id");// 前台系统ID
if (json.containsKey("orderTel"))
orderTel = json.getString("orderTel");// 订餐电话
if (json.containsKey("name"))
name = json.getString("name");// 订餐姓名
if (json.containsKey("address"))
address = json.getString("address");// 订餐地址
if (json.containsKey("latitude"))
latitude = json.getDouble("latitude");// 纬度
if (json.containsKey("longitude"))
longitude = json.getDouble("longitude");// 经度
if (json.containsKey("deliverType"))
deliverType = json.getInteger("deliverType");// 配送类型
if (json.containsKey("deliverFee"))
deliverFee = json.getDouble("deliverFee");// 配送费
}
public String getClientId() {
return clientId;
}
public void setClientId(String clientId) {
this.clientId = clientId;
}
public String getOrderTel() {
return orderTel;
}
public void setOrderTel(String orderTel) {
this.orderTel = orderTel;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public Double getLatitude() {
return latitude;
}
public void setLatitude(Double latitude) {
this.latitude = latitude;
}
public Double getLongitude() {
return longitude;
}
public void setLongitude(Double longitude) {
this.longitude = longitude;
}
public Integer getDeliverType() {
return deliverType;
}
public void setDeliverType(Integer deliverType) {
this.deliverType = deliverType;
}
public Double getDeliverFee() {
return deliverFee;
}
public void setDeliverFee(Double deliverFee) {
this.deliverFee = deliverFee;
}
}

@ -0,0 +1,481 @@
package com.jwsaas.api.entity.program;
import java.io.Serializable;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
public class ProgramStoreBusinessTicketEntity implements Serializable {
private static final long serialVersionUID = 1085851564382180511L;
private String clientId;// 前台系统ID
private String memberId;// 会员ID
private String openId;// 会员openId
private Integer sourceType;// 来源类型
private String touxiang;// 头像
private String memberName;// 会员姓名
private String no;// 单据编号
private String mobile;// 手机号
private String storeId;// 门店ID
private String storeNo;// 门店编号
private String storeName;// 门店名称
private Date saleDate;// 销售时间
private String tableNo;// 餐桌号
private String tableName;// 桌台名称
private Integer people;// 人数
private Integer busMode;// 营业模式
private String reserveTime;// 预定时间
private Double deliverFee;// 配送费
private Double packageFee;// 餐盒费
private Double amount;// 消费金额
private Double discount;// 优惠率
private Double discountTotal;// 优惠额
private Double receivable;// 应收金额
private Double maling;// 抹零金额
private Double paid;// 实收金额
private String noOrg;// 原单号
private String backCause;// 退单原因
private String seqNo;// 当日流水号
private String weather;// 天气
private String weeker;// 星期
private String ext2;// 扩展信息2
private Double deductionRate;//扣率;
private Double chargeBack;//扣款;
private List<ProgramStoreBusinessTicketInfoEntity> ticketInfo;// 主单优惠信息
private List<ProgramStoreOrderProductEntity> orderProduct;// 门店产品销售记录
private ProgramStoreBusinessTicketDeliverEntity ticketDeliver;// 门店配送信息
public ProgramStoreBusinessTicketEntity() {
}
public ProgramStoreBusinessTicketEntity(JSONObject json) {
if (json.containsKey("id"))
clientId = json.getString("id");// 前台系统ID
if (json.containsKey("memberId"))
memberId = json.getString("memberId");// 会员ID
if (json.containsKey("openId"))
openId = json.getString("openId");// 会员openId
if (json.containsKey("sourceType"))
sourceType = json.getInteger("sourceType");// 订单来源
if (json.containsKey("touxiang"))
touxiang = json.getString("touxiang");// 会员头像
if (json.containsKey("memberName"))
memberName = json.getString("memberName");// 会员名称
if (json.containsKey("mobile"))
mobile = json.getString("mobile");// 会员手机号
if (json.containsKey("storeId"))
storeId = json.getString("storeId");// 门店ID
if (json.containsKey("storeNo"))
storeNo = json.getString("storeNo");// 门店编号
if (json.containsKey("storeName"))
storeName = json.getString("storeName");// 门店名称
if (json.containsKey("saleDate")) {
try {
saleDate = json.getDate("saleDate");// 销售时间
} catch (Exception e) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
// 将字符串形式的时间转化为Date类型的时间
try {
Date date = sdf.parse("2000-01-01 00:00:00");
saleDate = date;
} catch (ParseException e1) {
e1.printStackTrace();
}
}
}
if (json.containsKey("tableNo"))
tableNo = json.getString("tableNo");// 餐桌号
if (json.containsKey("tableName"))
tableName = json.getString("tableName");// 餐桌号
if (json.containsKey("people"))
people = json.getInteger("people");// 人数
if (json.containsKey("busMode"))
busMode = json.getInteger("busMode");// 营业模式
if (json.containsKey("reserveTime"))
reserveTime = json.getString("reserveTime");// 预定时间
if (json.containsKey("deliverFee"))
deliverFee = json.getDouble("deliverFee");// 配送费
if (json.containsKey("packageFee"))
packageFee = json.getDouble("packageFee");// 餐盒费
if (json.containsKey("amount"))
amount = json.getDouble("amount");// 消费金额
if (json.containsKey("discount"))
discount = json.getDouble("discount");// 优惠率
if (json.containsKey("discountTotal"))
discountTotal = json.getDouble("discountTotal");// 优惠额
if (json.containsKey("receivable"))
receivable = json.getDouble("receivable");// 应收金额
if (json.containsKey("maling"))
maling = json.getDouble("maling");// 抹零金额
if (json.containsKey("paid"))
paid = json.getDouble("paid");// 抹零金额
if (json.containsKey("noOrg"))
noOrg = json.getString("noOrg");// 原单号
if (json.containsKey("backCause"))
backCause = json.getString("backCause");// 退单原因
if (json.containsKey("weather"))
weather = json.getString("weather");// 天气
if (json.containsKey("weeker"))
weeker = json.getString("weeker");// 星期
if (json.containsKey("ext2"))
ext2 = json.getString("ext2");// 订单备注
if (json.containsKey("deductionRate"))
deductionRate = json.getDouble("deductionRate");// 订单备注
if (json.containsKey("chargeBack"))
chargeBack = json.getDouble("chargeBack");// 订单备注
if (json.containsKey("ticket_info")) {
JSONArray ticket_info = json.getJSONArray("ticket_info");
ticketInfo = new ArrayList<>();
for (int i = 0; i < ticket_info.size(); i++) {
JSONObject infoObject = ticket_info.getJSONObject(i);
ProgramStoreBusinessTicketInfoEntity entity = new ProgramStoreBusinessTicketInfoEntity(infoObject);
ticketInfo.add(entity);
}
}
if (json.containsKey("order_product")) {
JSONArray order_product = json.getJSONArray("order_product");
orderProduct = new ArrayList<>();
for (int i = 0; i < order_product.size(); i++) {
JSONObject productObject = order_product.getJSONObject(i);
ProgramStoreOrderProductEntity entity = new ProgramStoreOrderProductEntity(productObject);
orderProduct.add(entity);
}
}
if (json.containsKey("ticket_deliver")) {
JSONObject ticket_deliver = json.getJSONObject("ticket_deliver");
ticketDeliver = new ProgramStoreBusinessTicketDeliverEntity(ticket_deliver);
}
}
public Double getDeductionRate() {
return deductionRate;
}
public void setDeductionRate(Double deductionRate) {
this.deductionRate = deductionRate;
}
public Double getChargeBack() {
return chargeBack;
}
public void setChargeBack(Double chargeBack) {
this.chargeBack = chargeBack;
}
public String getClientId() {
return clientId;
}
public void setClientId(String clientId) {
this.clientId = clientId;
}
public String getMemberId() {
return memberId;
}
public void setMemberId(String memberId) {
this.memberId = memberId;
}
public String getOpenId() {
return openId;
}
public void setOpenId(String openId) {
this.openId = openId;
}
public Integer getSourceType() {
return sourceType;
}
public void setSourceType(Integer sourceType) {
this.sourceType = sourceType;
}
public String getTouxiang() {
return touxiang;
}
public void setTouxiang(String touxiang) {
this.touxiang = touxiang;
}
public String getMemberName() {
return memberName;
}
public void setMemberName(String memberName) {
this.memberName = memberName;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getNo() {
return no;
}
public void setNo(String no) {
this.no = no;
}
public String getStoreId() {
return storeId;
}
public void setStoreId(String storeId) {
this.storeId = storeId;
}
public String getStoreNo() {
return storeNo;
}
public void setStoreNo(String storeNo) {
this.storeNo = storeNo;
}
public String getStoreName() {
return storeName;
}
public void setStoreName(String storeName) {
this.storeName = storeName;
}
public Date getSaleDate() {
return saleDate;
}
public void setSaleDate(Date saleDate) {
this.saleDate = saleDate;
}
public String getTableNo() {
return tableNo;
}
public void setTableNo(String tableNo) {
this.tableNo = tableNo;
}
public String getTableName() {
return tableName;
}
public void setTableName(String tableName) {
this.tableName = tableName;
}
public Integer getPeople() {
return people;
}
public void setPeople(Integer people) {
this.people = people;
}
public Integer getBusMode() {
return busMode;
}
public void setBusMode(Integer busMode) {
this.busMode = busMode;
}
public String getReserveTime() {
return reserveTime;
}
public void setReserveTime(String reserveTime) {
this.reserveTime = reserveTime;
}
public Double getDeliverFee() {
return deliverFee;
}
public void setDeliverFee(Double deliverFee) {
this.deliverFee = deliverFee;
}
public Double getPackageFee() {
return packageFee;
}
public void setPackageFee(Double packageFee) {
this.packageFee = packageFee;
}
public Double getAmount() {
return amount;
}
public void setAmount(Double amount) {
this.amount = amount;
}
public Double getDiscount() {
return discount;
}
public void setDiscount(Double discount) {
this.discount = discount;
}
public Double getDiscountTotal() {
return discountTotal;
}
public void setDiscountTotal(Double discountTotal) {
this.discountTotal = discountTotal;
}
public Double getReceivable() {
return receivable;
}
public void setReceivable(Double receivable) {
this.receivable = receivable;
}
public Double getMaling() {
return maling;
}
public void setMaling(Double maling) {
this.maling = maling;
}
public Double getPaid() {
return paid;
}
public void setPaid(Double paid) {
this.paid = paid;
}
public String getNoOrg() {
return noOrg;
}
public void setNoOrg(String noOrg) {
this.noOrg = noOrg;
}
public String getBackCause() {
return backCause;
}
public void setBackCause(String backCause) {
this.backCause = backCause;
}
public String getSeqNo() {
return seqNo;
}
public void setSeqNo(String seqNo) {
this.seqNo = seqNo;
}
public String getWeather() {
return weather;
}
public void setWeather(String weather) {
this.weather = weather;
}
public String getWeeker() {
return weeker;
}
public void setWeeker(String weeker) {
this.weeker = weeker;
}
public String getExt2() {
return ext2;
}
public void setExt2(String ext2) {
this.ext2 = ext2;
}
public List<ProgramStoreBusinessTicketInfoEntity> getTicketInfo() {
return ticketInfo;
}
public void setTicketInfo(List<ProgramStoreBusinessTicketInfoEntity> ticketInfo) {
this.ticketInfo = ticketInfo;
}
public List<ProgramStoreOrderProductEntity> getOrderProduct() {
return orderProduct;
}
public void setOrderProduct(List<ProgramStoreOrderProductEntity> orderProduct) {
this.orderProduct = orderProduct;
}
public ProgramStoreBusinessTicketDeliverEntity getTicketDeliver() {
return ticketDeliver;
}
public void setTicketDeliver(ProgramStoreBusinessTicketDeliverEntity ticketDeliver) {
this.ticketDeliver = ticketDeliver;
}
}

@ -0,0 +1,68 @@
package com.jwsaas.api.entity.program;
import java.io.Serializable;
import java.util.Date;
import com.alibaba.fastjson.JSONObject;
public class ProgramStoreBusinessTicketInfoEntity implements Serializable {
private static final long serialVersionUID = 6648200477753958681L;
private String clientId;//前台系统ID
private Integer type;//优惠类型
private String info;//优惠说明
private Double discountMoney;//优惠金额
public ProgramStoreBusinessTicketInfoEntity() {
}
public ProgramStoreBusinessTicketInfoEntity(JSONObject json) {
if (json.containsKey("id"))
clientId = json.getString("id");// 前台系统ID
if (json.containsKey("type"))
type = json.getInteger("type");// 优惠类型
if (json.containsKey("info"))
info = json.getString("info");// 优惠说明
if (json.containsKey("discountMoney"))
discountMoney = json.getDouble("discountMoney");// 优惠金额
}
public String getClientId() {
return clientId;
}
public void setClientId(String clientId) {
this.clientId = clientId;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getInfo() {
return info;
}
public void setInfo(String info) {
this.info = info;
}
public Double getDiscountMoney() {
return discountMoney;
}
public void setDiscountMoney(Double discountMoney) {
this.discountMoney = discountMoney;
}
}

@ -0,0 +1,481 @@
package com.jwsaas.api.entity.program;
import java.io.Serializable;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
public class ProgramStoreBusinessTicketSycnEntity implements Serializable {
private static final long serialVersionUID = 1085851564382180511L;
private String clientId;// 前台系统ID
private String memberId;// 会员ID
private String openId;// 会员openId
private Integer sourceType;// 来源类型
private String touxiang;// 头像
private String memberName;// 会员姓名
private String no;// 单据编号
private String mobile;// 手机号
private String storeId;// 门店ID
private String storeNo;// 门店编号
private String storeName;// 门店名称
private Date saleDate;// 销售时间
private String tableNo;// 餐桌号
private String tableName;// 桌台名称
private Integer people;// 人数
private Integer busMode;// 营业模式
private String reserveTime;// 预定时间
private Double deliverFee;// 配送费
private Double packageFee;// 餐盒费
private Double amount;// 消费金额
private Double discount;// 优惠率
private Double discountTotal;// 优惠额
private Double receivable;// 应收金额
private Double maling;// 抹零金额
private Double paid;// 实收金额
private String noOrg;// 原单号
private String backCause;// 退单原因
private String seqNo;// 当日流水号
private String weather;// 天气
private String weeker;// 星期
private String ext2;// 扩展信息2
private List<ProgramStoreBusinessTicketInfoEntity> ticketInfo;// 主单优惠信息
private List<ProgramStoreOrderProductEntity> orderProduct;// 门店产品销售记录
private ProgramStoreBusinessTicketDeliverEntity ticketDeliver;// 门店配送信息
private List<ProgramStorePayEntity> orderPay;// 产品支付信息
public ProgramStoreBusinessTicketSycnEntity() {
}
public ProgramStoreBusinessTicketSycnEntity(JSONObject json) {
if (json.containsKey("id"))
clientId = json.getString("id");// 前台系统ID
if (json.containsKey("memberId"))
memberId = json.getString("memberId");// 会员ID
if (json.containsKey("openId"))
openId = json.getString("openId");// 会员openId
if (json.containsKey("sourceType"))
sourceType = json.getInteger("sourceType");// 订单来源
if (json.containsKey("touxiang"))
touxiang = json.getString("touxiang");// 会员头像
if (json.containsKey("memberName"))
memberName = json.getString("memberName");// 会员名称
if (json.containsKey("no"))
no = json.getString("no");// 订单编号
if (json.containsKey("mobile"))
mobile = json.getString("mobile");// 会员手机号
if (json.containsKey("storeId"))
storeId = json.getString("storeId");// 门店ID
if (json.containsKey("storeNo"))
storeNo = json.getString("storeNo");// 门店编号
if (json.containsKey("storeName"))
storeName = json.getString("storeName");// 门店名称
if (json.containsKey("saleDate")) {
try {
saleDate = json.getDate("saleDate");// 销售时间
} catch (Exception e) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
// 将字符串形式的时间转化为Date类型的时间
try {
Date date = sdf.parse("2000-01-01 00:00:00");
saleDate = date;
} catch (ParseException e1) {
e1.printStackTrace();
}
}
}
if (json.containsKey("tableNo"))
tableNo = json.getString("tableNo");// 餐桌号
if (json.containsKey("tableName"))
tableName = json.getString("tableName");// 餐桌号
if (json.containsKey("people"))
people = json.getInteger("people");// 人数
if (json.containsKey("busMode"))
busMode = json.getInteger("busMode");// 营业模式
if (json.containsKey("reserveTime"))
reserveTime = json.getString("reserveTime");// 预定时间
if (json.containsKey("deliverFee"))
deliverFee = json.getDouble("deliverFee");// 配送费
if (json.containsKey("packageFee"))
packageFee = json.getDouble("packageFee");// 餐盒费
if (json.containsKey("amount"))
amount = json.getDouble("amount");// 消费金额
if (json.containsKey("discount"))
discount = json.getDouble("discount");// 优惠率
if (json.containsKey("discountTotal"))
discountTotal = json.getDouble("discountTotal");// 优惠额
if (json.containsKey("receivable"))
receivable = json.getDouble("receivable");// 应收金额
if (json.containsKey("maling"))
maling = json.getDouble("maling");// 抹零金额
if (json.containsKey("paid"))
paid = json.getDouble("paid");// 抹零金额
if (json.containsKey("noOrg"))
noOrg = json.getString("noOrg");// 原单号
if (json.containsKey("backCause"))
backCause = json.getString("backCause");// 退单原因
if (json.containsKey("weather"))
weather = json.getString("weather");// 天气
if (json.containsKey("seqNo"))
seqNo = json.getString("seqNo");// 取餐号
if (json.containsKey("weeker"))
weeker = json.getString("weeker");// 星期
if (json.containsKey("ext2"))
ext2 = json.getString("ext2");// 订单备注
if (json.containsKey("ticket_info")) {
JSONArray ticket_info = json.getJSONArray("ticket_info");
ticketInfo = new ArrayList<>();
for (int i = 0; i < ticket_info.size(); i++) {
JSONObject infoObject = ticket_info.getJSONObject(i);
ProgramStoreBusinessTicketInfoEntity entity = new ProgramStoreBusinessTicketInfoEntity(infoObject);
ticketInfo.add(entity);
}
}
if (json.containsKey("order_product")) {
JSONArray order_product = json.getJSONArray("order_product");
orderProduct = new ArrayList<>();
for (int i = 0; i < order_product.size(); i++) {
JSONObject productObject = order_product.getJSONObject(i);
ProgramStoreOrderProductEntity entity = new ProgramStoreOrderProductEntity(productObject);
orderProduct.add(entity);
}
}
if (json.containsKey("ticket_deliver")) {
JSONObject ticket_deliver = json.getJSONObject("ticket_deliver");
ticketDeliver = new ProgramStoreBusinessTicketDeliverEntity(ticket_deliver);
}
if (json.containsKey("order_pay")) {
JSONArray order_pay = json.getJSONArray("order_pay");
orderPay = new ArrayList<>();
for (int i = 0; i < order_pay.size(); i++) {
JSONObject productObject = order_pay.getJSONObject(i);
ProgramStorePayEntity entity = new ProgramStorePayEntity(productObject);
orderPay.add(entity);
}
}
}
public String getClientId() {
return clientId;
}
public void setClientId(String clientId) {
this.clientId = clientId;
}
public String getMemberId() {
return memberId;
}
public void setMemberId(String memberId) {
this.memberId = memberId;
}
public String getOpenId() {
return openId;
}
public void setOpenId(String openId) {
this.openId = openId;
}
public Integer getSourceType() {
return sourceType;
}
public void setSourceType(Integer sourceType) {
this.sourceType = sourceType;
}
public String getTouxiang() {
return touxiang;
}
public void setTouxiang(String touxiang) {
this.touxiang = touxiang;
}
public String getMemberName() {
return memberName;
}
public void setMemberName(String memberName) {
this.memberName = memberName;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getNo() {
return no;
}
public void setNo(String no) {
this.no = no;
}
public String getStoreId() {
return storeId;
}
public void setStoreId(String storeId) {
this.storeId = storeId;
}
public String getStoreNo() {
return storeNo;
}
public void setStoreNo(String storeNo) {
this.storeNo = storeNo;
}
public String getStoreName() {
return storeName;
}
public void setStoreName(String storeName) {
this.storeName = storeName;
}
public Date getSaleDate() {
return saleDate;
}
public void setSaleDate(Date saleDate) {
this.saleDate = saleDate;
}
public String getTableNo() {
return tableNo;
}
public void setTableNo(String tableNo) {
this.tableNo = tableNo;
}
public String getTableName() {
return tableName;
}
public void setTableName(String tableName) {
this.tableName = tableName;
}
public Integer getPeople() {
return people;
}
public void setPeople(Integer people) {
this.people = people;
}
public Integer getBusMode() {
return busMode;
}
public void setBusMode(Integer busMode) {
this.busMode = busMode;
}
public String getReserveTime() {
return reserveTime;
}
public void setReserveTime(String reserveTime) {
this.reserveTime = reserveTime;
}
public Double getDeliverFee() {
return deliverFee;
}
public void setDeliverFee(Double deliverFee) {
this.deliverFee = deliverFee;
}
public Double getPackageFee() {
return packageFee;
}
public void setPackageFee(Double packageFee) {
this.packageFee = packageFee;
}
public Double getAmount() {
return amount;
}
public void setAmount(Double amount) {
this.amount = amount;
}
public Double getDiscount() {
return discount;
}
public void setDiscount(Double discount) {
this.discount = discount;
}
public Double getDiscountTotal() {
return discountTotal;
}
public void setDiscountTotal(Double discountTotal) {
this.discountTotal = discountTotal;
}
public Double getReceivable() {
return receivable;
}
public void setReceivable(Double receivable) {
this.receivable = receivable;
}
public Double getMaling() {
return maling;
}
public void setMaling(Double maling) {
this.maling = maling;
}
public Double getPaid() {
return paid;
}
public void setPaid(Double paid) {
this.paid = paid;
}
public String getNoOrg() {
return noOrg;
}
public void setNoOrg(String noOrg) {
this.noOrg = noOrg;
}
public String getBackCause() {
return backCause;
}
public void setBackCause(String backCause) {
this.backCause = backCause;
}
public String getSeqNo() {
return seqNo;
}
public void setSeqNo(String seqNo) {
this.seqNo = seqNo;
}
public String getWeather() {
return weather;
}
public void setWeather(String weather) {
this.weather = weather;
}
public String getWeeker() {
return weeker;
}
public void setWeeker(String weeker) {
this.weeker = weeker;
}
public String getExt2() {
return ext2;
}
public void setExt2(String ext2) {
this.ext2 = ext2;
}
public List<ProgramStoreBusinessTicketInfoEntity> getTicketInfo() {
return ticketInfo;
}
public void setTicketInfo(List<ProgramStoreBusinessTicketInfoEntity> ticketInfo) {
this.ticketInfo = ticketInfo;
}
public List<ProgramStoreOrderProductEntity> getOrderProduct() {
return orderProduct;
}
public void setOrderProduct(List<ProgramStoreOrderProductEntity> orderProduct) {
this.orderProduct = orderProduct;
}
public ProgramStoreBusinessTicketDeliverEntity getTicketDeliver() {
return ticketDeliver;
}
public void setTicketDeliver(ProgramStoreBusinessTicketDeliverEntity ticketDeliver) {
this.ticketDeliver = ticketDeliver;
}
public List<ProgramStorePayEntity> getOrderPay() {
return orderPay;
}
public void setOrderPay(List<ProgramStorePayEntity> orderPay) {
this.orderPay = orderPay;
}
}

@ -0,0 +1,471 @@
package com.jwsaas.api.entity.program;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
public class ProgramStoreOrderProductEntity implements Serializable {
private static final long serialVersionUID = -3692629944440206569L;
private String clientId;//前台系统ID
private String parentId;//父记录ID
private String productId;//产品ID
private String productNo;//产品编号
private String productName;//产品名称
private String productUnitId;//产品单位
private String productUnitName;//产品单位名
private String productImageUrl;//商品图片
private String seriesId;//大类ID
private String seriesName;//大类名称
private String typePath;//类别路径
private String typeId;//类别ID
private String typeName;//类别名
private String specId;//规格ID
private String specName;//规格名称
private Double count;//数量
private Double rcount;//退菜数量
private Double price;//销售价格
private Double priceOrg;//产品原价
private Double discountPrice;//折后价格
private Integer isSuit;//是否套菜
private String suitId;//套菜ID
private Date saleDate;//销售时间
private Double amount;//消费金额
private Double discount;//优惠率
private Double discountTotal;//优惠额
private Double receivable;//应收金额
private Double addPriceTotal;//加价金额
private Double discountAddTotal;//加价优惠金额
private Double amountAddTotal;//加价应收金额
private Double amountTotal;//消费总额
private Double receivableTotal;//应收总额
private Double packageFee;//餐盒费
private Integer lineNo;//行号
private List<ProgramStoreOrderProductInfoEntity> productInfo;// 菜品销售记录优惠明细
private List<ProgramStoreOrderProductMakeEntity> productMake;// 销售单做法
public ProgramStoreOrderProductEntity() {
}
public ProgramStoreOrderProductEntity(JSONObject json) {
if (json.containsKey("id"))
clientId = json.getString("id");// 前台系统ID
if (json.containsKey("parentId"))
parentId = json.getString("parentId");// 父记录ID
if (json.containsKey("productId"))
productId = json.getString("productId");// 菜品ID
if (json.containsKey("productNo"))
productNo = json.getString("productNo");// 菜品编号
if (json.containsKey("productName"))
productName = json.getString("productName");// 菜品名称
if (json.containsKey("productUnitId"))
productUnitId = json.getString("productUnitId");// 菜品单位
if (json.containsKey("productUnitName"))
productUnitName = json.getString("productUnitName");// 菜品单位名
if (json.containsKey("productImageUrl"))
productImageUrl = json.getString("productImageUrl");// 菜品单位名
if (json.containsKey("seriesId"))
seriesId = json.getString("seriesId");// 菜品大类ID
if (json.containsKey("seriesName"))
seriesName = json.getString("seriesName");// 菜品大类名称
if (json.containsKey("typePath"))
typePath = json.getString("typePath");// 菜品大类路径
if (json.containsKey("typeId"))
typeId = json.getString("typeId");// 类别ID
if (json.containsKey("typeName"))
typeName = json.getString("typeName");// 类别名
if (json.containsKey("specId"))
specId = json.getString("specId");// 规格ID
if (json.containsKey("specName"))
specName = json.getString("specName");// 规格名称
if (json.containsKey("count"))
count = json.getDouble("count");// 数量
if (json.containsKey("rcount"))
rcount = json.getDouble("rcount");// 退菜数量
if (json.containsKey("price"))
price = json.getDouble("price");// 销售价格
if (json.containsKey("discountPrice"))
discountPrice = json.getDouble("discountPrice");// 折后价格
if (json.containsKey("priceOrg"))
priceOrg = json.getDouble("priceOrg");// 菜品原价
if (json.containsKey("isSuit"))
isSuit = json.getInteger("isSuit");// 是否套菜
if (json.containsKey("suitId"))
suitId = json.getString("suitId");// 套菜ID
if (json.containsKey("saleDate"))
saleDate = json.getDate("saleDate");// 销售时间
if (json.containsKey("amount"))
amount = json.getDouble("amount");// 消费金额
if (json.containsKey("discount"))
discount = json.getDouble("discount");// 优惠率
if (json.containsKey("discountTotal"))
discountTotal = json.getDouble("discountTotal");// 优惠额
if (json.containsKey("receivable"))
receivable = json.getDouble("receivable");// 应收金额
if (json.containsKey("addPriceTotal"))
addPriceTotal = json.getDouble("addPriceTotal");// 加价总额
if (json.containsKey("discountAddTotal"))
discountAddTotal = json.getDouble("discountAddTotal");// 加价优惠金额
if (json.containsKey("amountAddTotal"))
amountAddTotal = json.getDouble("amountAddTotal");// 加价应收金额
if (json.containsKey("amountTotal"))
amountTotal = json.getDouble("amountTotal");// 消费总额
if (json.containsKey("receivableTotal"))
receivableTotal = json.getDouble("receivableTotal");// 应收总额
if (json.containsKey("lineNo"))
lineNo = json.getInteger("lineNo");// 行号
if (json.containsKey("packageFee"))
packageFee = json.getDouble("packageFee");// 餐盒费
if (json.containsKey("product_info")) {
JSONArray product_info = json.getJSONArray("product_info");
productInfo = new ArrayList<>();
for (int i = 0; i < product_info.size(); i++) {
JSONObject infoObject = product_info.getJSONObject(i);
ProgramStoreOrderProductInfoEntity entity = new ProgramStoreOrderProductInfoEntity(infoObject);
productInfo.add(entity);
}
}
if (json.containsKey("product_make")) {
JSONArray product_make = json.getJSONArray("product_make");
productMake = new ArrayList<>();
for (int i = 0; i < product_make.size(); i++) {
JSONObject makeObject = product_make.getJSONObject(i);
ProgramStoreOrderProductMakeEntity entity = new ProgramStoreOrderProductMakeEntity(makeObject);
productMake.add(entity);
}
}
}
public String getClientId() {
return clientId;
}
public void setClientId(String clientId) {
this.clientId = clientId;
}
public String getParentId() {
return parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
public String getProductId() {
return productId;
}
public void setProductId(String productId) {
this.productId = productId;
}
public String getProductNo() {
return productNo;
}
public void setProductNo(String productNo) {
this.productNo = productNo;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getProductUnitId() {
return productUnitId;
}
public void setProductUnitId(String productUnitId) {
this.productUnitId = productUnitId;
}
public String getProductUnitName() {
return productUnitName;
}
public void setProductUnitName(String productUnitName) {
this.productUnitName = productUnitName;
}
public String getProductImageUrl() {
return productImageUrl;
}
public void setProductImageUrl(String productImageUrl) {
this.productImageUrl = productImageUrl;
}
public String getSeriesId() {
return seriesId;
}
public void setSeriesId(String seriesId) {
this.seriesId = seriesId;
}
public String getSeriesName() {
return seriesName;
}
public void setSeriesName(String seriesName) {
this.seriesName = seriesName;
}
public String getTypePath() {
return typePath;
}
public void setTypePath(String typePath) {
this.typePath = typePath;
}
public String getTypeId() {
return typeId;
}
public void setTypeId(String typeId) {
this.typeId = typeId;
}
public String getTypeName() {
return typeName;
}
public void setTypeName(String typeName) {
this.typeName = typeName;
}
public String getSpecId() {
return specId;
}
public void setSpecId(String specId) {
this.specId = specId;
}
public String getSpecName() {
return specName;
}
public void setSpecName(String specName) {
this.specName = specName;
}
public Double getCount() {
return count;
}
public void setCount(Double count) {
this.count = count;
}
public Double getRcount() {
return rcount;
}
public void setRcount(Double rcount) {
this.rcount = rcount;
}
public Double getPrice() {
return price;
}
public void setPrice(Double price) {
this.price = price;
}
public Double getPriceOrg() {
return priceOrg;
}
public void setPriceOrg(Double priceOrg) {
this.priceOrg = priceOrg;
}
public Double getDiscountPrice() {
return discountPrice;
}
public void setDiscountPrice(Double discountPrice) {
this.discountPrice = discountPrice;
}
public Integer getIsSuit() {
return isSuit;
}
public void setIsSuit(Integer isSuit) {
this.isSuit = isSuit;
}
public String getSuitId() {
return suitId;
}
public void setSuitId(String suitId) {
this.suitId = suitId;
}
public Date getSaleDate() {
return saleDate;
}
public void setSaleDate(Date saleDate) {
this.saleDate = saleDate;
}
public Double getAmount() {
return amount;
}
public void setAmount(Double amount) {
this.amount = amount;
}
public Double getDiscount() {
return discount;
}
public void setDiscount(Double discount) {
this.discount = discount;
}
public Double getDiscountTotal() {
return discountTotal;
}
public void setDiscountTotal(Double discountTotal) {
this.discountTotal = discountTotal;
}
public Double getReceivable() {
return receivable;
}
public void setReceivable(Double receivable) {
this.receivable = receivable;
}
public Double getAddPriceTotal() {
return addPriceTotal;
}
public void setAddPriceTotal(Double addPriceTotal) {
this.addPriceTotal = addPriceTotal;
}
public Double getDiscountAddTotal() {
return discountAddTotal;
}
public void setDiscountAddTotal(Double discountAddTotal) {
this.discountAddTotal = discountAddTotal;
}
public Double getAmountAddTotal() {
return amountAddTotal;
}
public void setAmountAddTotal(Double amountAddTotal) {
this.amountAddTotal = amountAddTotal;
}
public Double getAmountTotal() {
return amountTotal;
}
public void setAmountTotal(Double amountTotal) {
this.amountTotal = amountTotal;
}
public Double getReceivableTotal() {
return receivableTotal;
}
public void setReceivableTotal(Double receivableTotal) {
this.receivableTotal = receivableTotal;
}
public Double getPackageFee() {
return packageFee;
}
public void setPackageFee(Double packageFee) {
this.packageFee = packageFee;
}
public Integer getLineNo() {
return lineNo;
}
public void setLineNo(Integer lineNo) {
this.lineNo = lineNo;
}
public List<ProgramStoreOrderProductInfoEntity> getProductInfo() {
return productInfo;
}
public void setProductInfo(List<ProgramStoreOrderProductInfoEntity> productInfo) {
this.productInfo = productInfo;
}
public List<ProgramStoreOrderProductMakeEntity> getProductMake() {
return productMake;
}
public void setProductMake(List<ProgramStoreOrderProductMakeEntity> productMake) {
this.productMake = productMake;
}
}

@ -0,0 +1,80 @@
package com.jwsaas.api.entity.program;
import java.io.Serializable;
import java.util.Date;
import com.alibaba.fastjson.JSONObject;
public class ProgramStoreOrderProductInfoEntity implements Serializable {
private static final long serialVersionUID = 423665380801647033L;
private String clientId;//前台系统ID
private String orderItemId;//订单明细记录ID
private Integer type;//优惠类型
private String info;//优惠说明
private Double discountMoney;//优惠金额
public ProgramStoreOrderProductInfoEntity() {
}
public ProgramStoreOrderProductInfoEntity(JSONObject json) {
if (json.containsKey("id"))
clientId = json.getString("id");// 前台系统ID
if (json.containsKey("orderItemId"))
orderItemId = json.getString("orderItemId");// 订单明细记录ID
if (json.containsKey("type"))
type = json.getInteger("type");// 优惠类型
if (json.containsKey("info"))
info = json.getString("info");// 优惠说明
if (json.containsKey("discountMoney"))
discountMoney = json.getDouble("discountMoney");// 优惠金额
}
public String getClientId() {
return clientId;
}
public void setClientId(String clientId) {
this.clientId = clientId;
}
public String getOrderItemId() {
return orderItemId;
}
public void setOrderItemId(String orderItemId) {
this.orderItemId = orderItemId;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getInfo() {
return info;
}
public void setInfo(String info) {
this.info = info;
}
public Double getDiscountMoney() {
return discountMoney;
}
public void setDiscountMoney(Double discountMoney) {
this.discountMoney = discountMoney;
}
}

@ -0,0 +1,174 @@
package com.jwsaas.api.entity.program;
import java.io.Serializable;
import com.alibaba.fastjson.JSONObject;
public class ProgramStoreOrderProductMakeEntity implements Serializable {
private static final long serialVersionUID = 591519802105870207L;
private String clientId;// 前台系统ID
private String orderItemId;// 订单明细记录ID
private String makeId;// 做法ID
private String makeName;// 做法名称
private Double addPrice;// 做法加价
private Double discountPrice;// 做法折后加价
private Double count;// 做法数量
private Double rcount;// 做法退数量
private Double addTotal;// 加价总额
private Double discountAddTotal;// 折后总额
private Double discount;// 折扣率
private Integer qtyFlag;// 做法管理数量标识
private Integer hand;// 手写做法标识
public ProgramStoreOrderProductMakeEntity() {
}
public ProgramStoreOrderProductMakeEntity(JSONObject json) {
if (json.containsKey("id"))
clientId = json.getString("id");// 前台系统ID
if (json.containsKey("orderItemId"))
orderItemId = json.getString("orderItemId");// 订单明细记录ID
if (json.containsKey("makeId"))
makeId = json.getString("makeId");// 做法ID
if (json.containsKey("makeName"))
makeName = json.getString("makeName");// 做法名称
if (json.containsKey("addPrice"))
addPrice = json.getDouble("addPrice");// 做法加价
if (json.containsKey("discountPrice"))
discountPrice = json.getDouble("discountPrice");// 做法折后加价
if (json.containsKey("count"))
count = json.getDouble("count");// 做法数量
if (json.containsKey("rcount"))
rcount = json.getDouble("rcount");// 做法退数量
if (json.containsKey("addTotal"))
addTotal = json.getDouble("addTotal");// 加价总额
if (json.containsKey("discountAddTotal"))
discountAddTotal = json.getDouble("discountAddTotal");// 折后总额
if (json.containsKey("discount"))
discount = json.getDouble("discount");// 折扣率
if (json.containsKey("qtyFlag"))
qtyFlag = json.getInteger("qtyFlag");// 做法管理数量标识
if (json.containsKey("hand"))
hand = json.getInteger("hand");// 手写做法标识
}
public String getClientId() {
return clientId;
}
public void setClientId(String clientId) {
this.clientId = clientId;
}
public String getOrderItemId() {
return orderItemId;
}
public void setOrderItemId(String orderItemId) {
this.orderItemId = orderItemId;
}
public String getMakeId() {
return makeId;
}
public void setMakeId(String makeId) {
this.makeId = makeId;
}
public String getMakeName() {
return makeName;
}
public void setMakeName(String makeName) {
this.makeName = makeName;
}
public Double getAddPrice() {
return addPrice;
}
public void setAddPrice(Double addPrice) {
this.addPrice = addPrice;
}
public Double getDiscountPrice() {
return discountPrice;
}
public void setDiscountPrice(Double discountPrice) {
this.discountPrice = discountPrice;
}
public Double getCount() {
return count;
}
public void setCount(Double count) {
this.count = count;
}
public Double getRcount() {
return rcount;
}
public void setRcount(Double rcount) {
this.rcount = rcount;
}
public Double getAddTotal() {
return addTotal;
}
public void setAddTotal(Double addTotal) {
this.addTotal = addTotal;
}
public Double getDiscountAddTotal() {
return discountAddTotal;
}
public void setDiscountAddTotal(Double discountAddTotal) {
this.discountAddTotal = discountAddTotal;
}
public Double getDiscount() {
return discount;
}
public void setDiscount(Double discount) {
this.discount = discount;
}
public Integer getQtyFlag() {
return qtyFlag;
}
public void setQtyFlag(Integer qtyFlag) {
this.qtyFlag = qtyFlag;
}
public Integer getHand() {
return hand;
}
public void setHand(Integer hand) {
this.hand = hand;
}
}

@ -0,0 +1,262 @@
package com.jwsaas.api.entity.program;
import java.io.Serializable;
import java.util.Date;
import com.alibaba.fastjson.JSONObject;
public class ProgramStorePayEntity implements Serializable {
private static final long serialVersionUID = 6571275430103880876L;
private String clientId;// 前台系统ID
private String payNo;// 付款单号
private String payTypeNo;// 付款方式编号
private String payType;// 付款方式
private Double paid;// 实收金额
private Double rchange;// 找零金额
private Double money;// 已收金额
private Double overAmount;// 溢出金额
private String voucherNo;// 凭证号
private Date payDate;// 付款时间
private String cardno;// 付款卡号
private Double cardYe;// 充值卡支付前余额
private Double cardJf;// 充值卡支付前积分
private Integer incomeFlag;// 是否实收
private Integer otherRateType;// 第三方扣费类型
private Double otherRateValue;// 第三方扣费值
private Double otherRate;// 第三方扣费
private Integer payChannel;// 支付渠道
private String memo;// 备注
public ProgramStorePayEntity() {
}
public ProgramStorePayEntity(JSONObject json) {
if (json.containsKey("id"))
clientId = json.getString("id");// 前台系统ID
if (json.containsKey("payNo"))
payNo = json.getString("payNo");// 付款单号
if (json.containsKey("payTypeNo"))
payTypeNo = json.getString("payTypeNo");// 付款方式编号
if (json.containsKey("payType"))
payType = json.getString("payType");// 付款方式
if (json.containsKey("paid"))
paid = json.getDouble("paid");// 实收金额
if (json.containsKey("rchange"))
rchange = json.getDouble("rchange");// 找零金额
if (json.containsKey("money"))
money = json.getDouble("money");// 已收金额
if (json.containsKey("overAmount"))
overAmount = json.getDouble("overAmount");// 溢出金额
if (json.containsKey("voucherNo"))
voucherNo = json.getString("voucherNo");// 凭证号
if (json.containsKey("payDate"))
payDate = json.getDate("payDate");// 付款时间
if (json.containsKey("cardno"))
cardno = json.getString("cardno");// 付款卡号
if (json.containsKey("cardYe"))
cardYe = json.getDouble("cardYe");// 充值卡支付前余额
if (json.containsKey("cardJf"))
cardJf = json.getDouble("cardJf");// 充值卡支付前积分
if (json.containsKey("incomeFlag")) {
incomeFlag = json.getInteger("incomeFlag");// 充值卡支付前积分
} else {
incomeFlag = 0;
}
if (json.containsKey("otherRateType")) {
otherRateType = json.getInteger("otherRateType");// 第三方扣费类型
} else {
otherRateType = 0;
}
if (json.containsKey("otherRateValue")) {
otherRateValue = json.getDouble("otherRateValue");// 第三方扣费值
} else {
otherRateValue = 0.00;
}
if (json.containsKey("otherRate")) {
otherRate = json.getDouble("otherRate");// 第三方扣费
} else {
otherRate = 0.00;
}
if (json.containsKey("payChannel")) {
payChannel = json.getInteger("payChannel");// 前台支付渠道
} else {
payChannel = -1;
}
if (json.containsKey("memo"))
memo = json.getString("memo");// 备注
}
public String getClientId() {
return clientId;
}
public void setClientId(String clientId) {
this.clientId = clientId;
}
public String getPayNo() {
return payNo;
}
public void setPayNo(String payNo) {
this.payNo = payNo;
}
public String getPayTypeNo() {
return payTypeNo;
}
public void setPayTypeNo(String payTypeNo) {
this.payTypeNo = payTypeNo;
}
public String getPayType() {
return payType;
}
public void setPayType(String payType) {
this.payType = payType;
}
public Double getPaid() {
return paid;
}
public void setPaid(Double paid) {
this.paid = paid;
}
public Double getRchange() {
return rchange;
}
public void setRchange(Double rchange) {
this.rchange = rchange;
}
public Double getMoney() {
return money;
}
public void setMoney(Double money) {
this.money = money;
}
public Double getOverAmount() {
return overAmount;
}
public void setOverAmount(Double overAmount) {
this.overAmount = overAmount;
}
public String getVoucherNo() {
return voucherNo;
}
public void setVoucherNo(String voucherNo) {
this.voucherNo = voucherNo;
}
public Date getPayDate() {
return payDate;
}
public void setPayDate(Date payDate) {
this.payDate = payDate;
}
public String getCardno() {
return cardno;
}
public void setCardno(String cardno) {
this.cardno = cardno;
}
public Double getCardYe() {
return cardYe;
}
public void setCardYe(Double cardYe) {
this.cardYe = cardYe;
}
public Double getCardJf() {
return cardJf;
}
public void setCardJf(Double cardJf) {
this.cardJf = cardJf;
}
public Integer getIncomeFlag() {
return incomeFlag;
}
public void setIncomeFlag(Integer incomeFlag) {
this.incomeFlag = incomeFlag;
}
public Integer getOtherRateType() {
return otherRateType;
}
public void setOtherRateType(Integer otherRateType) {
this.otherRateType = otherRateType;
}
public Double getOtherRateValue() {
return otherRateValue;
}
public void setOtherRateValue(Double otherRateValue) {
this.otherRateValue = otherRateValue;
}
public Double getOtherRate() {
return otherRate;
}
public void setOtherRate(Double otherRate) {
this.otherRate = otherRate;
}
public Integer getPayChannel() {
return payChannel;
}
public void setPayChannel(Integer payChannel) {
this.payChannel = payChannel;
}
public String getMemo() {
return memo;
}
public void setMemo(String memo) {
this.memo = memo;
}
}

@ -0,0 +1,88 @@
package com.jwsaas.api.entity.storage;
import java.io.Serializable;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY)
public class AskGoodsDetailEntity implements Serializable {
private static final long serialVersionUID = -1011161468394424082L;
private String productId;// 原料Id
private String specId;// 规格Id
private Double amount;// 要货数量(配送单位数量)
private Double price;// 单价(配送价)
private Double money;// 金额
private String description;// 备注说明
public AskGoodsDetailEntity(JSONObject json) {
if (json.containsKey("productId"))
productId = json.getString("productId");// 原料Id
if (json.containsKey("specId"))
specId = json.getString("specId");// 原料Id
if (json.containsKey("amount"))
amount = json.getDouble("amount");// 要货数量(配送单位数量)
if (json.containsKey("price"))
price = json.getDouble("price");// 单价(配送价)
if (json.containsKey("money"))
money = json.getDouble("money");// 金额
if (json.containsKey("description"))
description = json.getString("description");// 备注说明
}
public String getProductId() {
return productId;
}
public void setProductId(String productId) {
this.productId = productId;
}
public String getSpecId() {
return specId;
}
public void setSpecId(String specId) {
this.specId = specId;
}
public Double getAmount() {
return amount;
}
public void setAmount(Double amount) {
this.amount = amount;
}
public Double getPrice() {
return price;
}
public void setPrice(Double price) {
this.price = price;
}
public Double getMoney() {
return money;
}
public void setMoney(Double money) {
this.money = money;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}

@ -0,0 +1,52 @@
package com.jwsaas.api.entity.storage;
import java.io.Serializable;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY)
public class AskGoodsTemplateDetailEntity implements Serializable {
private static final long serialVersionUID = -1011161468394424082L;
private String productId;// 原料Id
private String specId;// 规格Id
private String description;// 备注说明
public AskGoodsTemplateDetailEntity(JSONObject json) {
if (json.containsKey("productId"))
productId = json.getString("productId");// 原料Id
if (json.containsKey("specId"))
specId = json.getString("specId");// 原料Id
if (json.containsKey("description"))
description = json.getString("description");// 备注说明
}
public String getProductId() {
return productId;
}
public void setProductId(String productId) {
this.productId = productId;
}
public String getSpecId() {
return specId;
}
public void setSpecId(String specId) {
this.specId = specId;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}

@ -0,0 +1,85 @@
package com.jwsaas.api.entity.storage;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY)
public class AskGoodsTemplateEntity implements Serializable {
private static final long serialVersionUID = 1531637046832984193L;
private String id;// 模板ID
private String no;// 模板单号
private String name;// 模板名称
private String description;// 备注信息
private List<AskGoodsTemplateDetailEntity> detail;
public AskGoodsTemplateEntity(JSONObject json) {
if (json.containsKey("id"))
id = json.getString("id");// 模板ID
if (json.containsKey("no"))
no = json.getString("no");// 模板单号
if (json.containsKey("name"))
name = json.getString("name");// 模板名称
if (json.containsKey("description"))
description = json.getString("description");//备注信息
if (json.containsKey("detail")) {
JSONArray detailArray = json.getJSONArray("detail");
detail = new ArrayList<>();
for (int i = 0; i < detailArray.size(); i++) {
AskGoodsTemplateDetailEntity entity = new AskGoodsTemplateDetailEntity(detailArray.getJSONObject(i));
detail.add(entity);
}
}
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getNo() {
return no;
}
public void setNo(String no) {
this.no = no;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public List<AskGoodsTemplateDetailEntity> getDetail() {
return detail;
}
public void setDetail(List<AskGoodsTemplateDetailEntity> detail) {
this.detail = detail;
}
}

@ -0,0 +1,157 @@
package com.jwsaas.api.entity.storage;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY)
public class AskGoodsTicketEntity implements Serializable {
private static final long serialVersionUID = 1531637046832984193L;
private String id;// 单据ID
private String no;// 单据编号
private String storeId;// 门店ID
private String description;// 备注信息
private Double productMoney;// 商品总额
private Double dispatchMoney;// 配送费用
private Double totalMoney;// 总金额
private String setMan;// 制单人
private String deliveryMode;// 配送方式
private String deliveryModeDesc;// 配送方式说明
private List<AskGoodsDetailEntity> detail;
public AskGoodsTicketEntity(JSONObject json) {
if (json.containsKey("id"))
id = json.getString("id");// 单据ID
if (json.containsKey("no"))
no = json.getString("no");// 要货单号
if (json.containsKey("storeId"))
storeId = json.getString("storeId");// 门店ID
if (json.containsKey("description"))
description = json.getString("description");//
if (json.containsKey("productMoney"))
productMoney = json.getDouble("productMoney");// 商品总额
if (json.containsKey("dispatchMoney"))
dispatchMoney = json.getDouble("dispatchMoney");// 配送费用
if (json.containsKey("totalMoney"))
totalMoney = json.getDouble("totalMoney");// 总金额
if (json.containsKey("setMan"))
setMan = json.getString("setMan");// 制单人
if (json.containsKey("deliveryMode"))
deliveryMode = json.getString("deliveryMode");// 配送方式
if (json.containsKey("deliveryModeDesc"))
deliveryModeDesc = json.getString("deliveryModeDesc");// 配送方式说明
if (json.containsKey("detail")) {
JSONArray detailArray = json.getJSONArray("detail");
detail = new ArrayList<>();
for (int i = 0; i < detailArray.size(); i++) {
AskGoodsDetailEntity entity = new AskGoodsDetailEntity(detailArray.getJSONObject(i));
detail.add(entity);
}
}
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getNo() {
return no;
}
public void setNo(String no) {
this.no = no;
}
public String getStoreId() {
return storeId;
}
public void setStoreId(String storeId) {
this.storeId = storeId;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Double getProductMoney() {
return productMoney;
}
public void setProductMoney(Double productMoney) {
this.productMoney = productMoney;
}
public Double getDispatchMoney() {
return dispatchMoney;
}
public void setDispatchMoney(Double dispatchMoney) {
this.dispatchMoney = dispatchMoney;
}
public Double getTotalMoney() {
return totalMoney;
}
public void setTotalMoney(Double totalMoney) {
this.totalMoney = totalMoney;
}
public String getSetMan() {
return setMan;
}
public void setSetMan(String setMan) {
this.setMan = setMan;
}
public String getDeliveryMode() {
return deliveryMode;
}
public void setDeliveryMode(String deliveryMode) {
this.deliveryMode = deliveryMode;
}
public String getDeliveryModeDesc() {
return deliveryModeDesc;
}
public void setDeliveryModeDesc(String deliveryModeDesc) {
this.deliveryModeDesc = deliveryModeDesc;
}
public List<AskGoodsDetailEntity> getDetail() {
return detail;
}
public void setDetail(List<AskGoodsDetailEntity> detail) {
this.detail = detail;
}
}

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

Loading…
Cancel
Save