Browse Source

init from phab

xielq 4 years ago
parent
commit
4a8f8177e0
100 changed files with 9290 additions and 0 deletions
  1. 107 0
      README.md
  2. 218 0
      google_checks_7.1.2.xml
  3. 117 0
      pom.xml
  4. 134 0
      warehouse-backend-app/pom.xml
  5. 29 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/BackendApplication.java
  6. 22 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/SpringBootStartApplication.java
  7. 117 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/api/NotificationController.java
  8. 71 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/api/ReplyController.java
  9. 58 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/config/ControllerExceptionHandler.java
  10. 32 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/config/WebMvcConfiguration.java
  11. 119 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/config/interceptor/AuthenticateInterceptor.java
  12. 15 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/dao/ErrorLogDao.java
  13. 13 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/dao/FeeDao.java
  14. 13 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/dao/InvoiceDao.java
  15. 13 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/dao/InvoiceReplyDao.java
  16. 15 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/dao/NormalReplyDao.java
  17. 16 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/dao/PackingDao.java
  18. 13 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/dao/PackingReplyDao.java
  19. 13 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/dao/ProdioMainfestDao.java
  20. 13 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/dao/ProductDao.java
  21. 14 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/dao/ProductMainfestDao.java
  22. 15 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/dao/ShipmentDao.java
  23. 13 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/dao/StockinDao.java
  24. 13 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/dao/TransferDao.java
  25. 133 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/ErrorLog.java
  26. 195 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/Fee.java
  27. 316 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/Invoice.java
  28. 278 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/InvoiceDetail.java
  29. 213 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/InvoiceReply.java
  30. 278 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/InvoiceReplyDetail.java
  31. 281 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/NormalReply.java
  32. 266 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/Packing.java
  33. 237 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/PackingDetail.java
  34. 228 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/PackingReply.java
  35. 386 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/PackingReplyDetail.java
  36. 175 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/ProdioMainfest.java
  37. 205 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/Product.java
  38. 191 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/ProductMainfest.java
  39. 292 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/Shipment.java
  40. 288 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/ShipmentDetail.java
  41. 98 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/Status.java
  42. 174 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/Stockin.java
  43. 238 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/StockinDetail.java
  44. 19 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/SynchState.java
  45. 142 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/Transfer.java
  46. 195 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/TransferDetail.java
  47. 101 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/service/CommonService.java
  48. 109 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/service/ShipmentService.java
  49. 252 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/service/impl/CommonServiceImpl.java
  50. 284 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/service/impl/ShipmentServiceImpl.java
  51. 79 0
      warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/util/SignUtil.java
  52. 13 0
      warehouse-backend-app/src/main/resources/application-dev.yml
  53. 13 0
      warehouse-backend-app/src/main/resources/application-test.yml
  54. 12 0
      warehouse-backend-app/src/main/resources/application.yml
  55. 111 0
      warehouse-common/pom.xml
  56. 21 0
      warehouse-common/src/main/java/com/uas/platform/warehouse/core/JsonConvertException.java
  57. 98 0
      warehouse-common/src/main/java/com/uas/platform/warehouse/core/common/ResultBean.java
  58. 29 0
      warehouse-common/src/main/java/com/uas/platform/warehouse/core/domain/VoucherType.java
  59. 16 0
      warehouse-common/src/main/java/com/uas/platform/warehouse/core/domain/shipment/ShipCommon.java
  60. 16 0
      warehouse-common/src/main/java/com/uas/platform/warehouse/core/domain/stockin/StockInCommon.java
  61. 13 0
      warehouse-common/src/main/java/com/uas/platform/warehouse/core/domain/transfer/TransferCommon.java
  62. 105 0
      warehouse-common/src/main/java/com/uas/platform/warehouse/core/util/JacksonUtils.java
  63. 123 0
      warehouse-home-app/pom.xml
  64. 16 0
      warehouse-home-app/src/main/java/com/uas/platform/warehouse/home/HomeApplication.java
  65. 58 0
      warehouse-home-app/src/main/java/com/uas/platform/warehouse/home/config/ControllerExceptionHandler.java
  66. 0 0
      warehouse-home-app/src/main/resources/application-dev.yml
  67. 0 0
      warehouse-home-app/src/main/resources/application-test.yml
  68. 8 0
      warehouse-home-app/src/main/resources/application.yml
  69. 22 0
      warehouse-home-app/src/main/resources/static/index.html
  70. 141 0
      warehouse-online-app/pom.xml
  71. 35 0
      warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/OnlineApplication.java
  72. 41 0
      warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/api/ApplicationController.java
  73. 20 0
      warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/api/BaseController.java
  74. 136 0
      warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/api/LoginController.java
  75. 34 0
      warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/api/StockInController.java
  76. 58 0
      warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/config/ControllerExceptionHandler.java
  77. 26 0
      warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/dao/AppAuthenticationDao.java
  78. 17 0
      warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/dao/StockInDao.java
  79. 204 0
      warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/entity/AppAuthentication.java
  80. 162 0
      warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/entity/BaseVoucher.java
  81. 172 0
      warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/entity/Stockin.java
  82. 181 0
      warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/entity/StockinDetail.java
  83. 14 0
      warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/profile/Dev.java
  84. 14 0
      warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/profile/Prod.java
  85. 62 0
      warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/profile/SSOConfiguration.java
  86. 14 0
      warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/profile/Test.java
  87. 19 0
      warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/service/ApplicationService.java
  88. 14 0
      warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/service/StockInService.java
  89. 62 0
      warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/service/impl/ApplicationServiceImpl.java
  90. 27 0
      warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/service/impl/StockInServiceImpl.java
  91. 45 0
      warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/util/AppKeyUtil.java
  92. 73 0
      warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/util/ContextUtils.java
  93. 95 0
      warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/util/HttpUtil.java
  94. 10 0
      warehouse-online-app/src/main/resources/application-dev.yml
  95. 10 0
      warehouse-online-app/src/main/resources/application-prod.yml
  96. 10 0
      warehouse-online-app/src/main/resources/application-test.yml
  97. 8 0
      warehouse-online-app/src/main/resources/application.yml
  98. 21 0
      warehouse-online-app/src/main/resources/dev/account.properties
  99. 22 0
      warehouse-online-app/src/main/resources/prod/account.properties
  100. 13 0
      warehouse-online-app/src/main/resources/spring/context.xml

+ 107 - 0
README.md

@@ -0,0 +1,107 @@
+# Warehouse Project
+
+## Get Started
+
+仓储平台通过Http协议对外提供服务,开发者可以使用Http请求进行相应的仓库操作,也可以使用封装的SDK与仓储平台进行数据交互。由于签名算法暂时没有对外开放 jar,推荐使用已封装的SDK作为首选方式。
+
+### Step 1. Apply for app key
+
+仓储平台开发者网站,暂未开通,执行 `git clone ssh://dev@10.10.101.21/source/warehouse.git` 下载项目到本地, 启动项目 `warehouse-online-app` 进行企业用户或仓储提供商的 `app key` 注册,注册成功后并保存生成的 `app key` 和 `secret key`。
+
+### Step 2. Create maven project 
+
+使用IDE创建一个Maven项目,当然也可以使用普通的Java项目,但在生产环境不利于依赖的管理,不推荐手动进行依赖管理和项目构建。
+
+### Step 3. Add sdk dependencies
+
+在使用仓储平台之前,需要下载依赖  warehouse-uas-sdk 和 warehouse-common 两个依赖。
+
+```xml
+<!-- Maven -->
+<dependencies>
+  <dependency>
+    <groupId>com.uas.platform.warehouse</groupId>
+    <artifactId>warehouse-uas-sdk</artifactId>
+    <version>0.1.2-SNAPSHOT</version>
+  </dependency>
+  <dependency>
+    <groupId>com.uas.platform.warehouse</groupId>
+    <artifactId>warehouse-common</artifactId>
+    <version>0.1.2-SNAPSHOT</version>
+  </dependency>
+</dependencies>
+```
+
+### Step 4. Write a sample demo 
+
+创建一个供企业用户使用的客户端,发起发货操作,并获取仓储服务商的发货回传信息。
+
+```java
+// Create a client
+String endpoint = "192.168.253.31:20300";
+String appKey = "0677881a1d5a48dfa3a1e32a7b65e7a5";
+String secretKey = "6E8958941CB53DC48D7B32F4E7DD57C67E54B8FD";
+Warehouse client = new Warehouse(endpoint, appKey, secretKey);
+
+// Create Shipment instance, and set data to this instance
+Shipment shipment = new Shipment();
+// ...
+
+String result = client.shipFromWarehouse("深圳新宁仓", shipment);
+System.out.println("Ship Status: " + result);
+
+List<ShipmentReply> replies = client.gainShipReplyNotice();
+System.out.println("Reply Notice: " + replies);
+```
+
+启动程序,发送出货单通知到仓储提供商,供仓储提供商进行出库操作,并获取仓储提供商已经处理完成的出库回传信息。
+
+## Introduction
+
+仓储平台由 `warehouse-common` 、`warehouse-backend-app` 、`warehouse-uas-sdk` 、 `warehouse-transport` 四部分组成。
+
+- warehouse-common,提供通用的工具类、数据传输对象以及统一的响应数据格式
+- warehouse-backend-app,承担仓储平台提供服务的功能
+- warehouse-uas-sdk,仓储平台服务访问客户端,分别为企业用户和仓储提供商提供仓储操作的方法
+- warehouse-transport, 仓储平台传输层,负责企业用户与平台、平台与仓储提供商之间的数据传输
+
+## Extend
+
+仓储平台的每一条通知数据和回传数据都存储在对应的数据库表一条记录中,通过记录的单据类型字段加以区分。由于传入仓储平台的数据在反序列化时无法使用抽象类进行对象的创建,而用户拉取的数据在序列化时可以将抽象对象正确的序列化,因而,仓储平台的数据上传操作,如企业用户发起通知、仓储提供商上传操作回传信息,都需要指定完整的数据格式,向仓储平台上传数据的操作在扩展仓储平台功能时,需要被实现。
+
+### Step 1. Git clone warehouse project
+
+```shell
+git clone ssh://dev@10.10.101.21/source/warehouse.git
+```
+
+### Step 2. Create Data Transfer Object class
+
+在 `warehouse-common` 项目 `domain` 包下创建一个对应仓储回传的 `package` ,分别创建如下数据传输对象,以出货操作为例:
+
+-  ShipCommon,提供出货通知和出货回传两个数据传输对象公共的方法和常量
+-  ShipmentReply,保存仓储提供商处理收到的出货通知后的回传结果
+
+在 `warehouse-uas-sdk` 项目 `domain` 包下创建一个对应业务单据的实体类以及明细类,创建对象如下:
+
+- Shipment,保存企业用户发起出货通知时所需的数据信息,如单据编号等
+- ShipmentDetail,保存出货通知中明细的信息,可选,根据具体需要决定是否创建
+
+### Step 3. Create persistence entity class
+
+避免业务数据结构的暴露,因此,在 `warehouse-backend-app` 项目中参考上述数据传输对象创建持久化对象,以及 DAO 接口类。持久化对象需要配置数据库映射信息,DAO 如何使用和方法命名规范请参考 spring-data-jpa 文档。
+
+### Step 4. Create business service
+
+创建仓储操作的数据存储业务逻辑,包含企业用户发起通知的数据和仓储提供商回传数据的仓储逻辑。`warehouse-backend-app` 项目下 `service` 包中创建对应业务单据的服务接口类以及实现类,然后在 `NotificationService` 中提供单据处理回传的业务方法实现。
+
+### Step 5. Expose related http interface
+
+`com.uas.platform.warehouse.backend.api.NotificationController` 中创建企业用户发起操作的接口和仓储提供商回传操作结果的接口,并调用相应的业务类执行业务操作。
+
+### Step 6. Encapsulate http request
+
+企业用户和仓储提供商的仓储操作封装在 `Warehouse` 和 `WarehouseProvider` 两个客户端类中,每个仓储操作都要在对应的客户端类中实现数据上传和数据获取的方法。
+
+Author: huxz
+Mail: huxz@usoftchina.com

+ 218 - 0
google_checks_7.1.2.xml

@@ -0,0 +1,218 @@
+<?xml version="1.0"?>
+<!DOCTYPE module PUBLIC
+  "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
+  "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
+
+<!--
+    Checkstyle configuration that checks the Google coding conventions from Google Java Style
+    that can be found at https://google.github.io/styleguide/javaguide.html.
+
+    Checkstyle is very configurable. Be sure to read the documentation at
+    http://checkstyle.sf.net (or in your downloaded distribution).
+
+    To completely disable a check, just comment it out or delete it from the file.
+
+    Authors: Max Vetrenko, Ruslan Diachenko, Roman Ivanov.
+ -->
+
+<module name="Checker">
+  <property name="charset" value="UTF-8"/>
+
+  <property name="severity" value="warning"/>
+
+  <property name="fileExtensions" value="java, properties, xml"/>
+  <!-- Checks for whitespace                               -->
+  <!-- See http://checkstyle.sf.net/config_whitespace.html -->
+  <module name="FileTabCharacter">
+    <property name="eachLine" value="true"/>
+  </module>
+
+  <module name="TreeWalker">
+    <module name="OuterTypeFilename"/>
+    <module name="IllegalTokenText">
+      <property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
+      <property name="format"
+        value="\\u00(08|09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
+      <property name="message" value="Avoid using corresponding octal or Unicode escape."/>
+    </module>
+    <module name="AvoidEscapedUnicodeCharacters">
+      <property name="allowEscapesForControlCharacters" value="true"/>
+      <property name="allowByTailComment" value="true"/>
+      <property name="allowNonPrintableEscapes" value="true"/>
+    </module>
+    <module name="LineLength">
+      <property name="max" value="100"/>
+      <property name="ignorePattern"
+        value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
+    </module>
+    <module name="AvoidStarImport"/>
+    <module name="OneTopLevelClass"/>
+    <module name="NoLineWrap"/>
+    <module name="EmptyBlock">
+      <property name="option" value="TEXT"/>
+      <property name="tokens"
+        value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
+    </module>
+    <module name="NeedBraces"/>
+    <module name="LeftCurly">
+      <property name="maxLineLength" value="100"/>
+    </module>
+    <module name="RightCurly"/>
+    <module name="RightCurly">
+      <property name="option" value="alone"/>
+      <property name="tokens"
+        value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO, STATIC_INIT, INSTANCE_INIT"/>
+    </module>
+    <module name="WhitespaceAround">
+      <property name="allowEmptyConstructors" value="true"/>
+      <property name="allowEmptyMethods" value="true"/>
+      <property name="allowEmptyTypes" value="true"/>
+      <property name="allowEmptyLoops" value="true"/>
+      <message key="ws.notFollowed"
+        value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
+      <message key="ws.notPreceded"
+        value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
+    </module>
+    <module name="OneStatementPerLine"/>
+    <module name="MultipleVariableDeclarations"/>
+    <module name="ArrayTypeStyle"/>
+    <module name="MissingSwitchDefault"/>
+    <module name="FallThrough"/>
+    <module name="UpperEll"/>
+    <module name="ModifierOrder"/>
+    <module name="EmptyLineSeparator">
+      <property name="allowNoEmptyLineBetweenFields" value="true"/>
+    </module>
+    <module name="SeparatorWrap">
+      <property name="tokens" value="DOT"/>
+      <property name="option" value="nl"/>
+    </module>
+    <module name="SeparatorWrap">
+      <property name="tokens" value="COMMA"/>
+      <property name="option" value="EOL"/>
+    </module>
+    <module name="PackageName">
+      <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
+      <message key="name.invalidPattern"
+        value="Package name ''{0}'' must match pattern ''{1}''."/>
+    </module>
+    <module name="TypeName">
+      <message key="name.invalidPattern"
+        value="Type name ''{0}'' must match pattern ''{1}''."/>
+    </module>
+    <module name="MemberName">
+      <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
+      <message key="name.invalidPattern"
+        value="Member name ''{0}'' must match pattern ''{1}''."/>
+    </module>
+    <module name="ParameterName">
+      <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
+      <message key="name.invalidPattern"
+        value="Parameter name ''{0}'' must match pattern ''{1}''."/>
+    </module>
+    <module name="CatchParameterName">
+      <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
+      <message key="name.invalidPattern"
+        value="Catch parameter name ''{0}'' must match pattern ''{1}''."/>
+    </module>
+    <module name="LocalVariableName">
+      <property name="tokens" value="VARIABLE_DEF"/>
+      <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
+      <property name="allowOneCharVarInForLoop" value="true"/>
+      <message key="name.invalidPattern"
+        value="Local variable name ''{0}'' must match pattern ''{1}''."/>
+    </module>
+    <module name="ClassTypeParameterName">
+      <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
+      <message key="name.invalidPattern"
+        value="Class type name ''{0}'' must match pattern ''{1}''."/>
+    </module>
+    <module name="MethodTypeParameterName">
+      <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
+      <message key="name.invalidPattern"
+        value="Method type name ''{0}'' must match pattern ''{1}''."/>
+    </module>
+    <module name="InterfaceTypeParameterName">
+      <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
+      <message key="name.invalidPattern"
+        value="Interface type name ''{0}'' must match pattern ''{1}''."/>
+    </module>
+    <module name="NoFinalizer"/>
+    <module name="GenericWhitespace">
+      <message key="ws.followed"
+        value="GenericWhitespace ''{0}'' is followed by whitespace."/>
+      <message key="ws.preceded"
+        value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
+      <message key="ws.illegalFollow"
+        value="GenericWhitespace ''{0}'' should followed by whitespace."/>
+      <message key="ws.notPreceded"
+        value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
+    </module>
+    <module name="Indentation">
+      <property name="basicOffset" value="2"/>
+      <property name="braceAdjustment" value="0"/>
+      <property name="caseIndent" value="2"/>
+      <property name="throwsIndent" value="4"/>
+      <property name="lineWrappingIndentation" value="4"/>
+      <property name="arrayInitIndent" value="2"/>
+    </module>
+    <module name="AbbreviationAsWordInName">
+      <property name="ignoreFinal" value="false"/>
+      <property name="allowedAbbreviationLength" value="1"/>
+    </module>
+    <module name="OverloadMethodsDeclarationOrder"/>
+    <module name="VariableDeclarationUsageDistance"/>
+    <module name="CustomImportOrder">
+      <property name="specialImportsRegExp" value="com.google"/>
+      <property name="sortImportsInGroupAlphabetically" value="true"/>
+      <property name="customImportOrderRules"
+        value="STATIC###SPECIAL_IMPORTS###THIRD_PARTY_PACKAGE###STANDARD_JAVA_PACKAGE"/>
+    </module>
+    <module name="MethodParamPad"/>
+    <module name="OperatorWrap">
+      <property name="option" value="NL"/>
+      <property name="tokens"
+        value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR "/>
+    </module>
+    <module name="AnnotationLocation">
+      <property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/>
+    </module>
+    <module name="AnnotationLocation">
+      <property name="tokens" value="VARIABLE_DEF"/>
+      <property name="allowSamelineMultipleAnnotations" value="true"/>
+    </module>
+    <module name="NonEmptyAtclauseDescription"/>
+    <module name="JavadocTagContinuationIndentation"/>
+    <module name="SummaryJavadoc">
+      <property name="forbiddenSummaryFragments"
+        value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
+    </module>
+    <module name="JavadocParagraph"/>
+    <module name="AtclauseOrder">
+      <property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
+      <property name="target"
+        value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
+    </module>
+    <module name="JavadocMethod">
+      <property name="scope" value="public"/>
+      <property name="allowMissingParamTags" value="true"/>
+      <property name="allowMissingThrowsTags" value="true"/>
+      <property name="allowMissingReturnTag" value="true"/>
+      <property name="minLineCount" value="2"/>
+      <property name="allowedAnnotations" value="Override, Test"/>
+      <property name="allowThrowsTagsForSubclasses" value="true"/>
+    </module>
+    <module name="MethodName">
+      <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
+      <message key="name.invalidPattern"
+        value="Method name ''{0}'' must match pattern ''{1}''."/>
+    </module>
+    <module name="SingleLineJavadoc">
+      <property name="ignoreInlineTags" value="false"/>
+    </module>
+    <module name="EmptyCatchBlock">
+      <property name="exceptionVariableName" value="expected"/>
+    </module>
+    <module name="CommentsIndentation"/>
+  </module>
+</module>

+ 117 - 0
pom.xml

@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>com.uas.platform.warehouse</groupId>
+  <artifactId>warehouse</artifactId>
+  <version>0.1.2-SNAPSHOT</version>
+  <packaging>pom</packaging>
+  <name>Warehouse Platform</name>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <maven.compiler.source>1.7</maven.compiler.source>
+    <maven.compiler.target>1.7</maven.compiler.target>
+    <skipTests>true</skipTests>
+    <checkstyle.config.location>google_checks_7.1.2.xml</checkstyle.config.location>
+
+    <!-- Project Version -->
+    <warehouse-common.version>0.1.2-SNAPSHOT</warehouse-common.version>
+    <warehouse-transport.version>0.1.2-SNAPSHOT</warehouse-transport.version>
+
+    <!-- Dependencies Version -->
+    <spring-boot.version>1.5.6.RELEASE</spring-boot.version>
+    <commons-logging.version>1.1</commons-logging.version>
+    <jackson.version>2.8.9</jackson.version>
+    <joda-time.version>2.9.9</joda-time.version>
+    <httpclient.version>4.5.3</httpclient.version>
+    <mysql.version>6.0.6</mysql.version>
+    <commons-lang3.version>3.5</commons-lang3.version>
+  </properties>
+
+  <parent>
+    <groupId>org.springframework.boot</groupId>
+    <artifactId>spring-boot-starter-parent</artifactId>
+    <version>1.5.6.RELEASE</version>
+  </parent>
+
+  <modules>
+    <module>warehouse-backend-app</module>
+    <module>warehouse-common</module>
+    <module>warehouse-uas-sdk</module>
+    <module>warehouse-online-app</module>
+    <module>warehouse-transport</module>
+    <module>warehouse-home-app</module>
+  </modules>
+
+  <dependencyManagement>
+    <dependencies>
+      <!-- Custom Lib -->
+      <dependency>
+        <groupId>com.uas.platform.warehouse</groupId>
+        <artifactId>warehouse-common</artifactId>
+        <version>${warehouse-common.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>com.uas.platform.warehouse</groupId>
+        <artifactId>warehouse-transport</artifactId>
+        <version>${warehouse-transport.version}</version>
+      </dependency>
+
+      <!-- Apache Commons -->
+      <dependency>
+        <groupId>org.apache.commons</groupId>
+        <artifactId>commons-lang3</artifactId>
+        <version>${commons-lang3.version}</version>
+      </dependency>
+      <!-- Jackson -->
+      <dependency>
+        <groupId>com.fasterxml.jackson.core</groupId>
+        <artifactId>jackson-databind</artifactId>
+        <version>${jackson.version}</version>
+      </dependency>
+      <!-- Joda Time -->
+      <dependency>
+        <groupId>joda-time</groupId>
+        <artifactId>joda-time</artifactId>
+        <version>${joda-time.version}</version>
+      </dependency>
+      <!-- Apache Http Client -->
+      <dependency>
+        <groupId>org.apache.httpcomponents</groupId>
+        <artifactId>httpclient</artifactId>
+        <version>${httpclient.version}</version>
+      </dependency>
+      <!-- Spring Boot -->
+      <dependency>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-logging</artifactId>
+        <version>${spring-boot.version}</version>
+      </dependency>
+      <!-- Database Drivers -->
+      <dependency>
+        <groupId>mysql</groupId>
+        <artifactId>mysql-connector-java</artifactId>
+        <version>${mysql.version}</version>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+
+  <distributionManagement>
+    <!-- 发布release仓库 -->
+    <repository>
+      <id>platform-release</id>
+      <name>platform-release</name>
+      <url>http://113.105.74.141:8081/artifactory/libs-release-local</url>
+    </repository>
+    <!-- 发布快照版本 -->
+    <snapshotRepository>
+      <id>platform-snapshots</id>
+      <name>platform-snapshots</name>
+      <url>http://113.105.74.141:8081/artifactory/libs-snapshot-local</url>
+    </snapshotRepository>
+  </distributionManagement>
+
+</project>

+ 134 - 0
warehouse-backend-app/pom.xml

@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <artifactId>warehouse-backend-app</artifactId>
+  <packaging>war</packaging>
+
+  <parent>
+    <artifactId>warehouse</artifactId>
+    <groupId>com.uas.platform.warehouse</groupId>
+    <version>0.1.2-SNAPSHOT</version>
+  </parent>
+
+  <dependencies>
+    <!-- Custom Lib -->
+    <dependency>
+      <groupId>com.uas.platform.warehouse</groupId>
+      <artifactId>warehouse-common</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.uas.platform.warehouse</groupId>
+      <artifactId>warehouse-transport</artifactId>
+    </dependency>
+
+    <!-- Apache Commons -->
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-lang3</artifactId>
+    </dependency>
+    <!-- Spring Boot -->
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-starter-web</artifactId>
+      <!-- 移除嵌入式tomcat插件 -->
+     <exclusions>
+        <exclusion>
+          <groupId>org.springframework.boot</groupId>
+          <artifactId>spring-boot-starter-tomcat</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-starter-data-mongodb</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-starter-data-jpa</artifactId>
+    </dependency>
+    <!-- Joda Time -->
+    <dependency>
+      <groupId>joda-time</groupId>
+      <artifactId>joda-time</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>commons-codec</groupId>
+      <artifactId>commons-codec</artifactId>
+    </dependency>
+    <!-- Database Drivers -->
+    <dependency>
+      <groupId>mysql</groupId>
+      <artifactId>mysql-connector-java</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>javax.servlet-api</artifactId>
+      <version>3.1.0</version>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+<!--      <plugin>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-maven-plugin</artifactId>
+      </plugin>-->
+      <!-- Code Quality Check -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <version>2.17</version>
+        <!-- CheckStyle Default Version: 6.11.2 -->
+        <dependencies>
+          <dependency>
+            <groupId>com.puppycrawl.tools</groupId>
+            <artifactId>checkstyle</artifactId>
+            <version>7.1.2</version>
+          </dependency>
+        </dependencies>
+        <executions>
+          <execution>
+            <id>Validate</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>check</goal>
+            </goals>
+            <configuration>
+              <encoding>UTF-8</encoding>
+              <failsOnError>true</failsOnError>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+        <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-compiler-plugin</artifactId>
+            <configuration>
+                <source>1.8</source>
+                <target>1.8</target>
+            </configuration>
+        </plugin>
+    </plugins>
+  </build>
+
+  <distributionManagement>
+    <!-- 发布release仓库 -->
+    <repository>
+      <id>platform-release</id>
+      <name>platform-release</name>
+      <url>http://113.105.74.141:8081/artifactory/libs-release-local</url>
+    </repository>
+    <!-- 发布快照版本 -->
+    <snapshotRepository>
+      <id>platform-snapshots</id>
+      <name>platform-snapshots</name>
+      <url>http://113.105.74.141:8081/artifactory/libs-snapshot-local</url>
+    </snapshotRepository>
+  </distributionManagement>
+
+</project>

+ 29 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/BackendApplication.java

@@ -0,0 +1,29 @@
+package com.uas.platform.warehouse.backend;
+
+import org.springframework.boot.Banner.Mode;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.scheduling.annotation.EnableScheduling;
+
+/**
+ * Configuration for bootstrapping.
+ *
+ * @author huxz
+ */
+@SpringBootApplication
+@EnableScheduling
+public class BackendApplication {
+
+  /**
+   * Application entry.
+   *
+   * @param args  command line parameters
+   */
+  public static void main(String[] args) {
+    new SpringApplicationBuilder(BackendApplication.class)
+        .bannerMode(Mode.OFF)
+        .web(true)
+        .run(args);
+  }
+
+}

+ 22 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/SpringBootStartApplication.java

@@ -0,0 +1,22 @@
+package com.uas.platform.warehouse.backend;
+
+/**
+ * Created by luhg on 2017/11/15.
+ * tomcat启动
+ */
+
+import javafx.application.Application;
+import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.boot.web.support.SpringBootServletInitializer;
+
+/**
+ * 修改启动类,继承 SpringBootServletInitializer 并重写 configure 方法
+ */
+public class SpringBootStartApplication extends SpringBootServletInitializer {
+
+    @Override
+    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
+        // 注意这里要指向原先用main方法执行的Application启动类
+        return builder.sources(BackendApplication.class);
+    }
+}

+ 117 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/api/NotificationController.java

@@ -0,0 +1,117 @@
+package com.uas.platform.warehouse.backend.api;
+
+import com.uas.platform.warehouse.backend.dao.ErrorLogDao;
+import com.uas.platform.warehouse.backend.service.CommonService;
+import com.uas.platform.warehouse.backend.service.ShipmentService;
+import com.uas.platform.warehouse.backend.transport.entity.BaseReply;
+import com.uas.platform.warehouse.backend.transport.entity.PostBack;
+import com.uas.platform.warehouse.backend.transport.service.NotificationService;
+import com.uas.platform.warehouse.backend.transport.service.PullDataService;
+import com.uas.platform.warehouse.core.common.ResultBean;
+import com.uas.platform.warehouse.core.domain.VoucherType;
+import com.uas.platform.warehouse.core.util.JacksonUtils;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.web.PageableDefault;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * Http interface for operating voucher notification.
+ *
+ * @author huxz
+ */
+@RestController
+@RequestMapping(value = "/api")
+public class NotificationController {
+
+  private final ErrorLogDao logDao;
+
+  private final NotificationService notificationService;
+
+  private final ShipmentService shipmentService;
+
+  private final PullDataService pullDataService;
+
+  private final CommonService commonService;
+
+  @Autowired
+  public NotificationController(
+      ErrorLogDao logDao, ShipmentService shipmentService,
+      PullDataService pullDataService,
+      NotificationService notificationService,
+      CommonService commonService) {
+    this.logDao = logDao;
+    this.shipmentService = shipmentService;
+    this.pullDataService = pullDataService;
+    this.notificationService = notificationService;
+    this.commonService = commonService;
+  }
+
+  /**
+   * Common api for post data to b2b
+   * @param datas List json data
+   * @return
+   */
+  @PostMapping(value = "/post", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+  public  ResultBean<Map<String,Object>> postToB2bCommon( @RequestBody List<Map> datas) {
+    String type,data;
+    System.out.println(datas);
+    Map<String,Object> respMap = new HashMap<String,Object>();
+    boolean status = false;
+    for (Map map:datas){
+      if(map.get("type")!=null){
+        type = map.get("type").toString();
+        data = JacksonUtils.toJson(map);
+        if("pull".equals(type)){ //出货单
+          status = commonService.doShipment(data);
+        }else if("asn".equals(type)){ //入库单
+          status = commonService.doStockin(data);
+        }else if("tran".equals(type)){ //调拨单
+          status = commonService.doTransfer(data);
+        }else if("reply".equals(type)){ //物流回复接口
+          status = commonService.doNormalReply(data);
+        }else if("item".equals(type)){ //物料资料
+          status = commonService.doProduct(data);
+        }else if("packing".equals(type)){ //包装单
+          status = commonService.doPacking(data);
+        }else if("packing-reply".equals(type)){ //包装单回复
+          status = commonService.doPackingReply(data);
+        }else if("invoice".equals(type)){ //发票单
+          status = commonService.doInvoice(data);
+        }else if("invoice-reply".equals(type)){//发票单回复
+          status = commonService.doInvoiceReply(data);
+        }else if("mainfest-reply".equals(type)){//出入库报关回复
+          status = commonService.doProdioMainfestReply(data);
+        }else if("prodmainfest-reply".equals(type)){//物料报关回复
+          status = commonService.doProductMainfestReply(data);
+        }else if("fee-reply".equals(type)){//费用回复
+          status = commonService.doFeeReply(data);
+        }
+      }
+    }
+    respMap.put("success",status);
+    return new ResultBean<Map<String,Object>>(respMap);
+  }
+
+  /**
+   * Gain specific post back from warehouse by pagination.
+   *
+   * @param type  voucher type
+   * @param pageInfo  pagination info
+   * @return  response data using unified data format
+   */
+  @GetMapping(value = "/gain-notice-reply", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+  public ResultBean<List<BaseReply>> gainShipReplyNotice(VoucherType type,
+                                                        @PageableDefault(size = 50) Pageable pageInfo) {
+    return new ResultBean<List<BaseReply>>(pullDataService.gainReplyNotice(type, pageInfo));
+  }
+}

+ 71 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/api/ReplyController.java

@@ -0,0 +1,71 @@
+package com.uas.platform.warehouse.backend.api;
+
+import com.uas.platform.warehouse.backend.transport.entity.BaseVoucher;
+import com.uas.platform.warehouse.backend.transport.entity.Status;
+import com.uas.platform.warehouse.backend.transport.service.NotificationService;
+import com.uas.platform.warehouse.backend.transport.service.PullDataService;
+import com.uas.platform.warehouse.core.common.ResultBean;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.uas.platform.warehouse.core.util.JacksonUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.web.PageableDefault;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * Http interface for operating post back(reply).
+ *
+ * @author huxz
+ */
+@RestController
+@RequestMapping(value = "/api")
+public class ReplyController {
+
+  private final NotificationService notificationService;
+
+  private final PullDataService pullDataService;
+
+  @Autowired
+  public ReplyController(
+      NotificationService notificationService,
+      PullDataService pullDataService) {
+    this.notificationService = notificationService;
+    this.pullDataService = pullDataService;
+  }
+
+  /**
+   * Gain specific notification from enterprise customer by pagination.
+   *
+   * @param pageInfo  pagination info
+   * @return  response data using unified data format
+   */
+  @GetMapping(value = "/gain-notice", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+  public ResultBean<List<BaseVoucher>> gainNotificationFromEnterprise(
+      @PageableDefault(size = 50) Pageable pageInfo) {
+    return new ResultBean<List<BaseVoucher>>(pullDataService.gainNotificationFromEnterprise(pageInfo));
+  }
+
+  /**
+   * 更新状态
+   */
+  @PostMapping(value = "/update-status", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+  public ResultBean<Map<String,Object>> updateStatus(@RequestBody List<Map> datas){
+      Status status;
+      boolean flag = true;
+      Map<String,Object> respMap = new HashMap<String,Object>();
+      System.out.println(datas);
+      for (Map map : datas){
+          status = JacksonUtils.fromJson(JacksonUtils.toJson(map),Status.class);
+          if(!pullDataService.updateStatus(status)){
+              flag = false;
+          }
+      }
+      respMap.put("success",flag);
+      return new ResultBean<Map<String,Object>>(respMap);
+  }
+}

+ 58 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/config/ControllerExceptionHandler.java

@@ -0,0 +1,58 @@
+package com.uas.platform.warehouse.backend.config;
+
+import com.uas.platform.warehouse.core.common.ResultBean;
+import java.io.IOException;
+import org.apache.log4j.Logger;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.http.converter.HttpMessageConverter;
+import org.springframework.http.converter.HttpMessageNotReadableException;
+import org.springframework.web.bind.annotation.ControllerAdvice;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.context.request.WebRequest;
+import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;
+
+/**
+ * Use @ControllerAdvice annotation to handler exceptions.
+ *
+ * <p>Tip: ResponseEntityExceptionHandler, write to the response with a {@link HttpMessageConverter
+ * message converter}</p>
+ *
+ * @author huxz
+ */
+@ControllerAdvice(annotations = {RestController.class})
+public class ControllerExceptionHandler extends ResponseEntityExceptionHandler {
+
+  private static final Logger logger = Logger.getLogger(ControllerExceptionHandler.class);
+
+  private static final String MESSAGE_BAD_REQUEST =
+      HttpStatus.BAD_REQUEST.value() + " " + HttpStatus.BAD_REQUEST.getReasonPhrase();
+
+  /**
+   * Handler IOException and RuntimeException.
+   *
+   * @param ex  exception info
+   * @return response entity
+   */
+  @ExceptionHandler(value = {IOException.class, RuntimeException.class})
+  @ResponseBody
+  public ResponseEntity<?> handlerCommonExceptions(Throwable ex) {
+    logger.error("System Error occurs", ex);
+    HttpHeaders headers = new HttpHeaders();
+    headers.add("Content-Type", MediaType.APPLICATION_JSON_UTF8_VALUE);
+    return new ResponseEntity<>(new ResultBean<>(ex), headers, HttpStatus.INTERNAL_SERVER_ERROR);
+  }
+
+  @Override
+  protected ResponseEntity<Object> handleHttpMessageNotReadable(HttpMessageNotReadableException ex,
+      HttpHeaders headers, HttpStatus status, WebRequest request) {
+    logger.error(MESSAGE_BAD_REQUEST, ex);
+
+    headers.add("Content-Type", MediaType.APPLICATION_JSON_UTF8_VALUE);
+    return handleExceptionInternal(ex, new ResultBean<>(ex), headers, status, request);
+  }
+}

+ 32 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/config/WebMvcConfiguration.java

@@ -0,0 +1,32 @@
+package com.uas.platform.warehouse.backend.config;
+
+import com.uas.platform.warehouse.backend.config.interceptor.AuthenticateInterceptor;
+import com.uas.platform.warehouse.backend.transport.auth.service.AppAuthenticationService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
+
+/**
+ * Web mvc configuration.
+ *
+ * @author huxz
+ */
+@Configuration
+public class WebMvcConfiguration extends WebMvcConfigurerAdapter {
+
+  private final AppAuthenticationService appAuthenticationService;
+
+  @Autowired
+  public WebMvcConfiguration(
+      AppAuthenticationService appAuthenticationService) {
+    this.appAuthenticationService = appAuthenticationService;
+  }
+
+  @Override
+  public void addInterceptors(InterceptorRegistry registry) {
+    registry.addInterceptor(new AuthenticateInterceptor(appAuthenticationService))
+        .addPathPatterns("/api/**");
+    super.addInterceptors(registry);
+  }
+}

+ 119 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/config/interceptor/AuthenticateInterceptor.java

@@ -0,0 +1,119 @@
+package com.uas.platform.warehouse.backend.config.interceptor;
+
+import com.uas.platform.warehouse.backend.transport.auth.entity.AppAuthentication;
+import com.uas.platform.warehouse.backend.transport.auth.service.AppAuthenticationService;
+import com.uas.platform.warehouse.backend.transport.util.AuthenticationUtil;
+import com.uas.platform.warehouse.backend.util.SignUtil;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.apache.commons.lang3.Validate;
+import org.apache.log4j.Logger;
+import org.joda.time.DateTime;
+import org.springframework.util.StringUtils;
+import org.springframework.web.servlet.HandlerInterceptor;
+import org.springframework.web.servlet.ModelAndView;
+
+/**
+ * Interceptor that validates request's availability.
+ *
+ * @author huxz
+ */
+public class AuthenticateInterceptor implements HandlerInterceptor {
+
+  private static final Logger logger = Logger.getLogger(
+      AuthenticateInterceptor.class);
+
+  /**
+   * Determine whether request time is failure.
+   */
+  private static final int FAILURE_INTERVAL = 5;
+
+  private final AppAuthenticationService appAuthenticationService;
+
+  public AuthenticateInterceptor(
+      AppAuthenticationService appAuthenticationService) {
+    this.appAuthenticationService = appAuthenticationService;
+  }
+
+  @Override
+  public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
+      throws Exception {
+    if (logger.isDebugEnabled()) {
+      logger.debug("Authenticate interceptor is triggered");
+    }
+
+    final String appKey = request.getParameter("appKey");
+    final String timestamp = request.getParameter("timestamp");
+    final String sign = request.getParameter("sign");
+
+    Validate.notBlank(appKey, "App Key不能为空");
+    Validate.notBlank(timestamp, "时间戳不能为空");
+    Validate.notBlank(sign, "签名字符串不能为空");
+
+    // 验证AppKey是否存在,并查询SecretKey
+    String secretKey;
+    AppAuthentication appAuthentication = appAuthenticationService
+        .loadAuthenticationByAppKey(appKey);
+    if (appAuthentication == null || StringUtils.isEmpty(appAuthentication.getAppKey())
+        || !appAuthentication.isEnabled()) {
+      throw new RuntimeException("App Key无效");
+    } else {
+      if (logger.isDebugEnabled()) {
+        logger.debug(appAuthentication);
+      }
+      secretKey = appAuthentication.getSecretKey();
+      if (secretKey == null || secretKey.length() == 0) {
+        throw new RuntimeException("Secret Key无效");
+      }
+    }
+
+    // 验证时间戳的有效性,避免同一个请求多次使用
+    DateTime systemTime = new DateTime();
+    DateTime requestTime = new DateTime(Long.valueOf(timestamp).longValue());
+    if (logger.isDebugEnabled()) {
+      String pattern = "yyyy-MM-dd HH:mm:ss.SSSZ";
+      logger.debug(String.format("SystemTime: %s\n\tRequestTime: %s", systemTime.toString(pattern),
+          requestTime.toString(pattern)));
+    }
+
+    if (systemTime.isAfter(requestTime.plusMinutes(FAILURE_INTERVAL))) {
+      throw new RuntimeException("无效时间戳");
+    }
+
+    // 验证签名是否正确
+/*    Map<String, String> params = new HashMap<>(16);
+    Enumeration<String> parameterNames = request.getParameterNames();
+    while (parameterNames.hasMoreElements()) {
+      String key = parameterNames.nextElement();
+      if (!"appKey".equals(key) && !"sign".equals(key)) {
+        params.put(key, request.getParameter(key));
+      }
+    }*/
+    String validateSign = SignUtil.createMD5Sign(appKey, secretKey, timestamp);
+    System.out.println(validateSign);
+    if (!sign.equals(validateSign)) {
+      throw new RuntimeException("签名不一致");
+    }
+
+    // Save appAuthentication to LocalThread, avoid user to use other enterprise' uu
+    AuthenticationUtil.setAuthentication(appAuthentication);
+
+    return true;
+  }
+
+  @Override
+  public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,
+      ModelAndView modelAndView) throws Exception {
+    // Clear app authentication info
+    AuthenticationUtil.removeAuthentication();
+  }
+
+  @Override
+  public void afterCompletion(HttpServletRequest request, HttpServletResponse response,
+      Object handler, Exception ex) throws Exception {
+
+  }
+}

+ 15 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/dao/ErrorLogDao.java

@@ -0,0 +1,15 @@
+package com.uas.platform.warehouse.backend.dao;
+
+import com.uas.platform.warehouse.backend.entity.ErrorLog;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+/**
+ * Abstract interface for operating stock-in voucher.
+ *
+ * @author huxz
+ */
+@Repository
+public interface ErrorLogDao extends JpaRepository<ErrorLog, Long> {
+
+}

+ 13 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/dao/FeeDao.java

@@ -0,0 +1,13 @@
+package com.uas.platform.warehouse.backend.dao;
+
+import com.uas.platform.warehouse.backend.entity.Fee;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+/**
+ * @Author liujw
+ * @Date 2017/12/18 9:35
+ */
+@Repository
+public interface FeeDao extends JpaRepository<Fee, Long> {
+}

+ 13 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/dao/InvoiceDao.java

@@ -0,0 +1,13 @@
+package com.uas.platform.warehouse.backend.dao;
+
+import com.uas.platform.warehouse.backend.entity.Invoice;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+/**
+ * Created by luhg on 2017/11/28.
+ * @author luhg
+ */
+@Repository
+public interface InvoiceDao extends JpaRepository<Invoice, Long> {
+}

+ 13 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/dao/InvoiceReplyDao.java

@@ -0,0 +1,13 @@
+package com.uas.platform.warehouse.backend.dao;
+
+import com.uas.platform.warehouse.backend.entity.InvoiceReply;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+/**
+ * Created by luhg on 2017/11/29.
+ * @author luhg
+ */
+@Repository
+public interface InvoiceReplyDao extends JpaRepository<InvoiceReply, Long> {
+}

+ 15 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/dao/NormalReplyDao.java

@@ -0,0 +1,15 @@
+package com.uas.platform.warehouse.backend.dao;
+
+import com.uas.platform.warehouse.backend.entity.NormalReply;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+/**
+ * Abstract interface for operating normal reply.
+ *
+ * @author luhg
+ */
+@Repository
+public interface NormalReplyDao extends JpaRepository<NormalReply, Long> {
+
+}

+ 16 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/dao/PackingDao.java

@@ -0,0 +1,16 @@
+package com.uas.platform.warehouse.backend.dao;
+
+import com.uas.platform.warehouse.backend.entity.Packing;
+import com.uas.platform.warehouse.backend.entity.Shipment;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+/**
+ * Abstract interface for operating stock-in voucher.
+ *
+ * @author luhg
+ */
+@Repository
+public interface PackingDao extends JpaRepository<Packing, Long> {
+
+}

+ 13 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/dao/PackingReplyDao.java

@@ -0,0 +1,13 @@
+package com.uas.platform.warehouse.backend.dao;
+
+import com.uas.platform.warehouse.backend.entity.PackingReply;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+/**
+ * Created by luhg on 2017/11/24.
+ * @author luhg
+ */
+@Repository
+public interface PackingReplyDao extends JpaRepository<PackingReply, Long> {
+}

+ 13 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/dao/ProdioMainfestDao.java

@@ -0,0 +1,13 @@
+package com.uas.platform.warehouse.backend.dao;
+
+import com.uas.platform.warehouse.backend.entity.ProdioMainfest;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+/**
+ * @Author liujw
+ * @Date 2017/12/13 15:03
+ */
+@Repository
+public interface ProdioMainfestDao extends JpaRepository<ProdioMainfest, Long> {
+}

+ 13 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/dao/ProductDao.java

@@ -0,0 +1,13 @@
+package com.uas.platform.warehouse.backend.dao;
+
+import com.uas.platform.warehouse.backend.entity.Product;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+/**
+ * Created by luhg on 2017/11/4.
+ * @author luhg
+ */
+@Repository
+public interface ProductDao extends JpaRepository<Product, Long> {
+}

+ 14 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/dao/ProductMainfestDao.java

@@ -0,0 +1,14 @@
+package com.uas.platform.warehouse.backend.dao;
+
+
+import com.uas.platform.warehouse.backend.entity.ProductMainfest;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+/**
+ * @Author liujw
+ * @Date 2017/12/13 17:06
+ */
+@Repository
+public interface ProductMainfestDao extends JpaRepository<ProductMainfest, Long> {
+}

+ 15 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/dao/ShipmentDao.java

@@ -0,0 +1,15 @@
+package com.uas.platform.warehouse.backend.dao;
+
+import com.uas.platform.warehouse.backend.entity.Shipment;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+/**
+ * Abstract interface for operating stock-in voucher.
+ *
+ * @author huxz
+ */
+@Repository
+public interface ShipmentDao extends JpaRepository<Shipment, Long> {
+
+}

+ 13 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/dao/StockinDao.java

@@ -0,0 +1,13 @@
+package com.uas.platform.warehouse.backend.dao;
+
+import com.uas.platform.warehouse.backend.entity.Stockin;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+/**
+ * Created by luhg on 2017/11/1.
+ * Abstract interface for operating stockin voucher.
+ */
+@Repository
+public interface StockinDao  extends JpaRepository<Stockin, Long> {
+}

+ 13 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/dao/TransferDao.java

@@ -0,0 +1,13 @@
+package com.uas.platform.warehouse.backend.dao;
+
+import com.uas.platform.warehouse.backend.entity.Transfer;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+/**
+ * Created by luhg on 2017/11/3.
+ * Abstract interface for operating transfer voucher.
+ */
+@Repository
+public interface TransferDao  extends JpaRepository<Transfer, Long> {
+}

+ 133 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/ErrorLog.java

@@ -0,0 +1,133 @@
+package com.uas.platform.warehouse.backend.entity;
+
+import java.util.Date;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * 记录异常单据或回传信息.
+ *
+ * @author huxz
+ */
+@Entity
+@Table(name = "error_log")
+public class ErrorLog {
+
+  @Id
+  @GeneratedValue
+  @Column(name = "id")
+  private Long id;
+
+  /**
+   * 创建时间.
+   */
+  @Column(name = "create_time")
+  private Date createTime;
+
+  /**
+   * 发送方企业UU.
+   */
+  @Column(name = "sender_uu")
+  private String senderUu;
+
+  /**
+   * 接收方企业UU.
+   */
+  @Column(name = "receiver_uu")
+  private String receiverUu;
+
+  /**
+   * 日志类型.
+   */
+  @Column(name = "log_type")
+  @Enumerated(EnumType.STRING)
+  private LogType type;
+
+  /**
+   * 异常数据.
+   */
+  @Column(name = "error_data", columnDefinition = "TEXT")
+  private String data;
+
+  /**
+   * 异常原因.
+   */
+  @Column(name = "reason", columnDefinition = "TEXT")
+  private String reason;
+
+  public ErrorLog() {
+  }
+
+  public Long getId() {
+    return id;
+  }
+
+  public void setId(Long id) {
+    this.id = id;
+  }
+
+  public Date getCreateTime() {
+    return createTime;
+  }
+
+  public void setCreateTime(Date createTime) {
+    this.createTime = createTime;
+  }
+
+  public String getSenderUu() {
+    return senderUu;
+  }
+
+  public void setSenderUu(String senderUu) {
+    this.senderUu = senderUu;
+  }
+
+  public String getReceiverUu() {
+    return receiverUu;
+  }
+
+  public void setReceiverUu(String receiverUu) {
+    this.receiverUu = receiverUu;
+  }
+
+  public LogType getType() {
+    return type;
+  }
+
+  public void setType(LogType type) {
+    this.type = type;
+  }
+
+  public String getData() {
+    return data;
+  }
+
+  public void setData(String data) {
+    this.data = data;
+  }
+
+  public String getReason() {
+    return reason;
+  }
+
+  public void setReason(String reason) {
+    this.reason = reason;
+  }
+
+  public enum LogType {
+    /**
+     * 非法单据信息.
+     */
+    INVALID_VOUCHER,
+
+    /**
+     * 非法回传信息.
+     */
+    INVALID_REPLY
+  }
+}

+ 195 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/Fee.java

@@ -0,0 +1,195 @@
+package com.uas.platform.warehouse.backend.entity;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.uas.platform.warehouse.backend.transport.entity.BaseReply;
+import org.joda.time.LocalDateTime;
+
+import javax.persistence.*;
+import java.util.Date;
+
+/**
+ * @Author liujw
+ * @Date 2017/12/15 14:00
+ */
+@Entity
+@Table(name = "fee")
+@JsonInclude(JsonInclude.Include.NON_EMPTY)
+public class Fee extends BaseReply {
+    @Id
+    @GeneratedValue
+    @Column(name = "id")
+    @JsonIgnore
+    private long id;
+
+    /**
+     *出入库单单据编号
+     */
+    @Column(name = "code")
+    private String code;
+
+    /**
+     * 费用产生时间
+     */
+    @Column(name = "fee_gentime")
+    private Date feeGentime;
+
+    /**
+     * 费用名称
+     */
+    @Column(name = "fee_name")
+    private String feeName;
+
+    /**
+     *费用金额
+     */
+    @Column(name = "fee_amount")
+    private double feeAmount;
+
+    /**
+     * 币别
+     */
+    @Column(name = "fee_currency")
+    private String feeCurrency;
+
+    /**
+     *备注信息
+     */
+    @Column(name = "remark")
+    private String remark;
+
+    /**
+     * 时间
+     */
+    @Column(name = "date_")
+    @JsonIgnore
+    private Date date_= LocalDateTime.now().toDate();
+
+    /**
+     * 数据类型
+     */
+    @Column(name = "type")
+    private String type;
+
+    /**
+     * 接收方UU.
+     */
+    @Column(name = "receiver_uu")
+    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
+    private String receiverUU;
+
+    /**
+     * 发送方UU.
+     */
+    @Column(name = "sender_uu")
+    private String senderUU;
+
+    /**
+     * 企业名称.
+
+     */
+    @Column(name = "en_name")
+    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
+    private String enterprise;
+
+    @Override
+    public String getReceiverUU() {
+        return receiverUU;
+    }
+
+    public void setReceiverUU(String receiverUU) {
+        this.receiverUU = receiverUU;
+    }
+
+    public String getSenderUU() {
+        return senderUU;
+    }
+
+    public void setSenderUU(String senderUU) {
+        this.senderUU = senderUU;
+    }
+
+    public String getEnterprise() {
+        return enterprise;
+    }
+
+    public void setEnterprise(String enterprise) {
+        this.enterprise = enterprise;
+    }
+
+
+
+    @Override
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public Date getDate_() {
+        return date_;
+    }
+
+    public void setDate_(Date date_) {
+        this.date_ = date_;
+    }
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public Date getFeeGentime() {
+        return feeGentime;
+    }
+
+    public void setFeeGentime(Date feeGentime) {
+        this.feeGentime = feeGentime;
+    }
+
+    public String getFeeName() {
+        return feeName;
+    }
+
+    public void setFeeName(String feeName) {
+        this.feeName = feeName;
+    }
+
+    public double getFeeAmount() {
+        return feeAmount;
+    }
+
+    public void setFeeAmount(double feeAmount) {
+        this.feeAmount = feeAmount;
+    }
+
+    public String getFeeCurrency() {
+        return feeCurrency;
+    }
+
+    public void setFeeCurrency(String feeCurrency) {
+        this.feeCurrency = feeCurrency;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+}

+ 316 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/Invoice.java

@@ -0,0 +1,316 @@
+package com.uas.platform.warehouse.backend.entity;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.uas.platform.warehouse.backend.transport.entity.BaseVoucher;
+
+import javax.persistence.*;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Created by luhg on 2017/11/28.
+ * 发票.
+ */
+@Entity
+@Table(name = "invoice")
+@JsonInclude(JsonInclude.Include.NON_EMPTY)
+public class Invoice  extends BaseVoucher {
+    @Id
+    @GeneratedValue
+    @Column(name = "id")
+    @JsonIgnore
+    private long id;
+
+    /**
+     * 单号
+     */
+    @Column(name = "invoice_no")
+    private String invoiceNo;
+
+    /**
+     * 发票日期
+     */
+    @Column(name = "invoice_date")
+    private Date invoiceDate;
+
+    /**
+     * 客户名称
+     */
+    @Column(name = "cust_name")
+    private String custName;
+
+    /**
+     * 客户编号
+     */
+    @Column(name = "cust_code")
+    private String custCode;
+
+    /**
+     * 客户UU
+     */
+    @Column(name = "cust_uu")
+    private String custUU;
+
+    /**
+     * 录入人
+     */
+    @Column(name = "operator")
+    private String operator;
+
+    /**
+     * 录入人UU
+     */
+    @Column(name = "operator_uu")
+    private String operatorUU;
+
+    /**
+     * 送货地址
+     */
+    @Column(name = "cust_address", columnDefinition = "TEXT")
+    private String custAddress;
+
+    /**
+     * 客户联系人
+     */
+    @Column(name = "cust_contact")
+    private String custContact;
+
+    /**
+     * 客户电话
+     */
+    @Column(name = "cust_tel")
+    private String custTel;
+
+    /**
+     * 客户传真
+     */
+    @Column(name = "cust_fax")
+    private String custFax;
+
+    /**
+     * 部门
+     */
+    @Column(name = "depart")
+    private String depart;
+
+    /**
+     * 营业员
+     */
+    @Column(name = "seller")
+    private String seller;
+
+    /**
+     * 付款条款
+     */
+    @Column(name = "payment")
+    private String payment;
+
+    /**
+     * 发票要求
+     */
+    @Column(name = "invoice_remark", columnDefinition = "TEXT")
+    private String invoiceRemark;
+
+    /**
+     * 备注
+     */
+    @Column(name = "remark", columnDefinition = "TEXT")
+    private String remark;
+
+    /**
+     * 抬头单位客户名称
+     */
+    @Column(name = "head_name")
+    private String headName;
+
+    /**
+     * 抬头单位联系人
+     */
+    @Column(name = "head_contact", columnDefinition = "TEXT")
+    private String headContact;
+
+    /**
+     * 抬头单位备注
+     */
+    @Column(name = "head_remark", columnDefinition = "TEXT")
+    private String headRemark;
+
+    /**
+     * 发票明细.
+     */
+    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
+    @JoinColumn(name = "invoice_id")
+    private List<InvoiceDetail> details;
+
+    public Invoice() {
+    }
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public String getInvoiceNo() {
+        return invoiceNo;
+    }
+
+    public void setInvoiceNo(String invoiceNo) {
+        this.invoiceNo = invoiceNo;
+    }
+
+    public Date getInvoiceDate() {
+        return invoiceDate;
+    }
+
+    public void setInvoiceDate(Date invoiceDate) {
+        this.invoiceDate = invoiceDate;
+    }
+
+    public String getCustName() {
+        return custName;
+    }
+
+    public void setCustName(String custName) {
+        this.custName = custName;
+    }
+
+    public String getCustCode() {
+        return custCode;
+    }
+
+    public void setCustCode(String custCode) {
+        this.custCode = custCode;
+    }
+
+    public String getCustUU() {
+        return custUU;
+    }
+
+    public void setCustUU(String custUU) {
+        this.custUU = custUU;
+    }
+
+    public String getOperator() {
+        return operator;
+    }
+
+    public void setOperator(String operator) {
+        this.operator = operator;
+    }
+
+    public String getOperatorUU() {
+        return operatorUU;
+    }
+
+    public void setOperatorUU(String operatorUU) {
+        this.operatorUU = operatorUU;
+    }
+
+    public String getCustAddress() {
+        return custAddress;
+    }
+
+    public void setCustAddress(String custAddress) {
+        this.custAddress = custAddress;
+    }
+
+    public String getCustContact() {
+        return custContact;
+    }
+
+    public void setCustContact(String custContact) {
+        this.custContact = custContact;
+    }
+
+    public String getCustTel() {
+        return custTel;
+    }
+
+    public void setCustTel(String custTel) {
+        this.custTel = custTel;
+    }
+
+    public String getCustFax() {
+        return custFax;
+    }
+
+    public void setCustFax(String custFax) {
+        this.custFax = custFax;
+    }
+
+    public String getDepart() {
+        return depart;
+    }
+
+    public void setDepart(String depart) {
+        this.depart = depart;
+    }
+
+    public String getSeller() {
+        return seller;
+    }
+
+    public void setSeller(String seller) {
+        this.seller = seller;
+    }
+
+    public String getPayment() {
+        return payment;
+    }
+
+    public void setPayment(String payment) {
+        this.payment = payment;
+    }
+
+    public String getInvoiceRemark() {
+        return invoiceRemark;
+    }
+
+    public void setInvoiceRemark(String invoiceRemark) {
+        this.invoiceRemark = invoiceRemark;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public List<InvoiceDetail> getDetails() {
+        return details;
+    }
+
+    public void setDetails(List<InvoiceDetail> details) {
+        this.details = details;
+    }
+
+    public String getHeadName() {
+        return headName;
+    }
+
+    public void setHeadName(String headName) {
+        this.headName = headName;
+    }
+
+    public String getHeadContact() {
+        return headContact;
+    }
+
+    public void setHeadContact(String headContact) {
+        this.headContact = headContact;
+    }
+
+    public String getHeadRemark() {
+        return headRemark;
+    }
+
+    public void setHeadRemark(String headRemark) {
+        this.headRemark = headRemark;
+    }
+}

+ 278 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/InvoiceDetail.java

@@ -0,0 +1,278 @@
+package com.uas.platform.warehouse.backend.entity;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.uas.platform.warehouse.core.util.JacksonUtils;
+import org.joda.time.LocalDateTime;
+
+import javax.persistence.*;
+import java.util.Date;
+
+/**
+ * Created by luhg on 2017/11/28.
+ * 包装单明细.
+ */
+@Entity
+@Table(name = "invoice_detail")
+@JsonInclude(JsonInclude.Include.NON_EMPTY)
+public class InvoiceDetail {
+    @Id
+    @GeneratedValue
+    @Column(name = "id")
+    @JsonIgnore
+    private long id;
+    /**
+     * 发票号.
+     */
+    @Column(name = "invoice_no")
+    private String invoiceNo;
+
+    /**
+     * 行号.
+     */
+    @Column(name = "invoice_line_no")
+    private String invoiceLineNo;
+
+    /**
+     * 物料号
+     */
+    @Column(name = "pn")
+    private String pn;
+
+    /**
+     * 物料名称
+     */
+    @Column(name = "item_name")
+    private String itemName;
+
+    /**
+     * 物料规格
+     */
+    @Column(name = "spec")
+    private String spec;
+
+    /**
+     * 客户PO号
+     */
+    @Column(name = "cust_po")
+    private String custPo;
+
+    /**
+     * 客户物料号
+     */
+    @Column(name = "cust_pn")
+    private String custPn;
+
+    /**
+     * 单价
+     */
+    @Column(name = "price")
+    private double price;
+
+    /**
+     * 品牌
+     */
+    @Column(name = "brand")
+    private String brand;
+
+    /**
+     * 数量
+     */
+    @Column(name = "qty")
+    private double qty;
+
+    /**
+     * 金额
+     */
+    @Column(name = "total")
+    private double total;
+
+    /**
+     * 明细备注
+     */
+    @Column(name = "detail_remark",columnDefinition = "TEXT")
+    private String detailRemark;
+
+    /**
+     * 产地
+     */
+    @Column(name = "madein")
+    private String madein;
+
+    /**
+     * 备用字段1.
+     */
+    @Column(name = "attribute1",columnDefinition = "TEXT")
+    private String attribute1;
+
+    /**
+     * 备用字段2.
+     */
+    @Column(name = "attribute2",columnDefinition = "TEXT")
+    private String attribute2;
+
+    /**
+     * 备用字段3.
+     */
+    @Column(name = "attribute3",columnDefinition = "TEXT")
+    private String attribute3;
+
+    /**
+     * 操作时间
+     */
+    @Column(name = "operate_time")
+    @JsonIgnore
+    private Date operateTime = LocalDateTime.now().toDate();
+
+    @Override
+    public String toString() {
+        return JacksonUtils.toJson(this);
+    }
+
+    public InvoiceDetail(){
+    }
+
+    public String getInvoiceNo() {
+        return invoiceNo;
+    }
+
+    public void setInvoiceNo(String invoiceNo) {
+        this.invoiceNo = invoiceNo;
+    }
+
+    public String getInvoiceLineNo() {
+        return invoiceLineNo;
+    }
+
+    public void setInvoiceLineNo(String invoiceLineNo) {
+        this.invoiceLineNo = invoiceLineNo;
+    }
+
+    public String getPn() {
+        return pn;
+    }
+
+    public void setPn(String pn) {
+        this.pn = pn;
+    }
+
+    public String getItemName() {
+        return itemName;
+    }
+
+    public void setItemName(String itemName) {
+        this.itemName = itemName;
+    }
+
+    public String getSpec() {
+        return spec;
+    }
+
+    public void setSpec(String spec) {
+        this.spec = spec;
+    }
+
+    public String getCustPo() {
+        return custPo;
+    }
+
+    public void setCustPo(String custPo) {
+        this.custPo = custPo;
+    }
+
+    public String getCustPn() {
+        return custPn;
+    }
+
+    public void setCustPn(String custPn) {
+        this.custPn = custPn;
+    }
+
+    public String getBrand() {
+        return brand;
+    }
+
+    public void setBrand(String brand) {
+        this.brand = brand;
+    }
+
+    public double getQty() {
+        return qty;
+    }
+
+    public void setQty(double qty) {
+        this.qty = qty;
+    }
+
+    public double getTotal() {
+        return total;
+    }
+
+    public void setTotal(double total) {
+        this.total = total;
+    }
+
+    public String getDetailRemark() {
+        return detailRemark;
+    }
+
+    public void setDetailRemark(String detailRemark) {
+        this.detailRemark = detailRemark;
+    }
+
+    public String getAttribute1() {
+        return attribute1;
+    }
+
+    public void setAttribute1(String attribute1) {
+        this.attribute1 = attribute1;
+    }
+
+    public String getAttribute2() {
+        return attribute2;
+    }
+
+    public void setAttribute2(String attribute2) {
+        this.attribute2 = attribute2;
+    }
+
+    public String getAttribute3() {
+        return attribute3;
+    }
+
+    public void setAttribute3(String attribute3) {
+        this.attribute3 = attribute3;
+    }
+
+    public Date getOperateTime() {
+        return operateTime;
+    }
+
+    public void setOperateTime(Date operateTime) {
+        this.operateTime = operateTime;
+    }
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public String getMadein() {
+        return madein;
+    }
+
+    public void setMadein(String madein) {
+        this.madein = madein;
+    }
+
+    public double getPrice() {
+        return price;
+    }
+
+    public void setPrice(double price) {
+        this.price = price;
+    }
+}

+ 213 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/InvoiceReply.java

@@ -0,0 +1,213 @@
+package com.uas.platform.warehouse.backend.entity;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.uas.platform.warehouse.backend.transport.entity.BaseReply;
+import org.joda.time.LocalDateTime;
+
+import javax.persistence.*;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Created by luhg on 2017/11/28.
+ * 发票回传
+ */
+@Entity
+@Table(name = "invoice_reply")
+@JsonInclude(JsonInclude.Include.NON_EMPTY)
+public class InvoiceReply extends BaseReply {
+    @Id
+    @GeneratedValue
+    @Column(name = "id")
+    @JsonIgnore
+    private long id;
+
+    /**
+     * 单号
+     */
+    @Column(name = "invoice_no")
+    private String invoiceNo;
+
+    /**
+     * 数据类型.
+     */
+    @Column(name = "type")
+    private String type;
+
+    /**
+     * 所属企业UU.
+     */
+    @Column(name = "en_uu")
+    @JsonIgnore
+    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
+    private String enUu;
+
+    /**
+     * warehouse name
+     */
+    @Column(name = "wh_name")
+    private String whName;
+
+    /**
+     * 接收方UU
+     */
+    @Column(name = "receiverUU")
+    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
+    private String receiverUU;
+
+    /**
+     * 发送方UU
+     */
+    @Column(name = "senderUU")
+    private String senderUU;
+
+    /**
+     * 企业名称
+     */
+    @Column(name = "enterprise")
+    private String enterprise;
+
+    /**
+     * 操作时间
+     */
+    @Column(name = "operate_time")
+    @JsonIgnore
+    private Date operateTime = LocalDateTime.now().toDate();
+
+
+    /**
+     * 备用字段1.
+     */
+    @Column(name = "attribute1",columnDefinition = "TEXT")
+    private String attribute1;
+
+    /**
+     * 备用字段2.
+     */
+    @Column(name = "attribute2",columnDefinition = "TEXT")
+    private String attribute2;
+
+    /**
+     * 备用字段3.
+     */
+    @Column(name = "attribute3",columnDefinition = "TEXT")
+    private String attribute3;
+
+    /**
+     * 明细.
+     */
+    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
+    @JoinColumn(name = "invoice_reply_id")
+    private List<InvoiceReplyDetail> details;
+
+    public InvoiceReply(){
+    }
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public String getInvoiceNo() {
+        return invoiceNo;
+    }
+
+    public void setInvoiceNo(String invoiceNo) {
+        this.invoiceNo = invoiceNo;
+    }
+
+    @Override
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getEnUu() {
+        return enUu;
+    }
+
+    public void setEnUu(String enUu) {
+        this.enUu = enUu;
+    }
+
+    public String getWhName() {
+        return whName;
+    }
+
+    public void setWhName(String whName) {
+        this.whName = whName;
+    }
+
+    @Override
+    public String getReceiverUU() {
+        return receiverUU;
+    }
+
+    public void setReceiverUU(String receiverUU) {
+        this.receiverUU = receiverUU;
+    }
+
+    public String getSenderUU() {
+        return senderUU;
+    }
+
+    public void setSenderUU(String senderUU) {
+        this.senderUU = senderUU;
+    }
+
+    public String getEnterprise() {
+        return enterprise;
+    }
+
+    public void setEnterprise(String enterprise) {
+        this.enterprise = enterprise;
+    }
+
+    public Date getOperateTime() {
+        return operateTime;
+    }
+
+    public void setOperateTime(Date operateTime) {
+        this.operateTime = operateTime;
+    }
+
+    public String getAttribute1() {
+        return attribute1;
+    }
+
+    public void setAttribute1(String attribute1) {
+        this.attribute1 = attribute1;
+    }
+
+    public String getAttribute2() {
+        return attribute2;
+    }
+
+    public void setAttribute2(String attribute2) {
+        this.attribute2 = attribute2;
+    }
+
+    public String getAttribute3() {
+        return attribute3;
+    }
+
+    public void setAttribute3(String attribute3) {
+        this.attribute3 = attribute3;
+    }
+
+    public List<InvoiceReplyDetail> getDetails() {
+        return details;
+    }
+
+    public void setDetails(List<InvoiceReplyDetail> details) {
+        this.details = details;
+    }
+}

+ 278 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/InvoiceReplyDetail.java

@@ -0,0 +1,278 @@
+package com.uas.platform.warehouse.backend.entity;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.uas.platform.warehouse.core.util.JacksonUtils;
+import org.joda.time.LocalDateTime;
+
+import javax.persistence.*;
+import java.util.Date;
+
+/**
+ * Created by luhg on 2017/11/29.
+ * 发票明细回传
+ */
+@Entity
+@Table(name = "invoice_reply_detail")
+@JsonInclude(JsonInclude.Include.NON_EMPTY)
+public class InvoiceReplyDetail {
+    @Id
+    @GeneratedValue
+    @Column(name = "id")
+    @JsonIgnore
+    private Long id;
+
+    /**
+     * 发票号.
+     */
+    @Column(name = "invoice_no")
+    private String invoiceNo;
+
+    /**
+     * 行号.
+     */
+    @Column(name = "invoice_line_no")
+    private String invoiceLineNo;
+    /**
+     * 物料号
+     */
+    @Column(name = "pn")
+    private String pn;
+
+    /**
+     * 物料名称
+     */
+    @Column(name = "item_name")
+    private String itemName;
+
+    /**
+     * 物料规格
+     */
+    @Column(name = "spec")
+    private String spec;
+
+    /**
+     * 客户PO号
+     */
+    @Column(name = "cust_po")
+    private String custPo;
+
+    /**
+     * 客户物料号
+     */
+    @Column(name = "cust_pn")
+    private String custPn;
+
+    /**
+     * 品牌
+     */
+    @Column(name = "brand")
+    private String brand;
+
+    /**
+     * 数量
+     */
+    @Column(name = "qty")
+    private double qty;
+
+    /**
+     * 单价
+     */
+    @Column(name = "price")
+    private double price;
+
+    /**
+     * 金额
+     */
+    @Column(name = "total")
+    private double total;
+
+    /**
+     * 明细备注
+     */
+    @Column(name = "detail_remark",columnDefinition = "TEXT")
+    private String detailRemark;
+
+    /**
+     * 产地
+     */
+    @Column(name = "madein")
+    private String madein;
+
+    /**
+     * 备用字段1.
+     */
+    @Column(name = "attribute1",columnDefinition = "TEXT")
+    private String attribute1;
+
+    /**
+     * 备用字段2.
+     */
+    @Column(name = "attribute2",columnDefinition = "TEXT")
+    private String attribute2;
+
+    /**
+     * 备用字段3.
+     */
+    @Column(name = "attribute3",columnDefinition = "TEXT")
+    private String attribute3;
+
+    /**
+     * 操作时间
+     */
+    @Column(name = "operate_time")
+    @JsonIgnore
+    private Date operateTime = LocalDateTime.now().toDate();
+
+    @Override
+    public String toString() {
+        return JacksonUtils.toJson(this);
+    }
+
+    public InvoiceReplyDetail(){
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getInvoiceNo() {
+        return invoiceNo;
+    }
+
+    public void setInvoiceNo(String invoiceNo) {
+        this.invoiceNo = invoiceNo;
+    }
+
+    public String getInvoiceLineNo() {
+        return invoiceLineNo;
+    }
+
+    public void setInvoiceLineNo(String invoiceLineNo) {
+        this.invoiceLineNo = invoiceLineNo;
+    }
+
+    public String getPn() {
+        return pn;
+    }
+
+    public void setPn(String pn) {
+        this.pn = pn;
+    }
+
+    public String getItemName() {
+        return itemName;
+    }
+
+    public void setItemName(String itemName) {
+        this.itemName = itemName;
+    }
+
+    public String getSpec() {
+        return spec;
+    }
+
+    public void setSpec(String spec) {
+        this.spec = spec;
+    }
+
+    public String getCustPo() {
+        return custPo;
+    }
+
+    public void setCustPo(String custPo) {
+        this.custPo = custPo;
+    }
+
+    public String getCustPn() {
+        return custPn;
+    }
+
+    public void setCustPn(String custPn) {
+        this.custPn = custPn;
+    }
+
+    public String getBrand() {
+        return brand;
+    }
+
+    public void setBrand(String brand) {
+        this.brand = brand;
+    }
+
+    public double getQty() {
+        return qty;
+    }
+
+    public void setQty(double qty) {
+        this.qty = qty;
+    }
+
+    public double getTotal() {
+        return total;
+    }
+
+    public void setTotal(double total) {
+        this.total = total;
+    }
+
+    public String getDetailRemark() {
+        return detailRemark;
+    }
+
+    public void setDetailRemark(String detailRemark) {
+        this.detailRemark = detailRemark;
+    }
+
+    public String getMadein() {
+        return madein;
+    }
+
+    public void setMadein(String madein) {
+        this.madein = madein;
+    }
+
+    public String getAttribute1() {
+        return attribute1;
+    }
+
+    public void setAttribute1(String attribute1) {
+        this.attribute1 = attribute1;
+    }
+
+    public String getAttribute2() {
+        return attribute2;
+    }
+
+    public void setAttribute2(String attribute2) {
+        this.attribute2 = attribute2;
+    }
+
+    public String getAttribute3() {
+        return attribute3;
+    }
+
+    public void setAttribute3(String attribute3) {
+        this.attribute3 = attribute3;
+    }
+
+    public Date getOperateTime() {
+        return operateTime;
+    }
+
+    public void setOperateTime(Date operateTime) {
+        this.operateTime = operateTime;
+    }
+
+    public double getPrice() {
+        return price;
+    }
+
+    public void setPrice(double price) {
+        this.price = price;
+    }
+}

+ 281 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/NormalReply.java

@@ -0,0 +1,281 @@
+package com.uas.platform.warehouse.backend.entity;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.uas.platform.warehouse.backend.transport.entity.BaseReply;
+import com.uas.platform.warehouse.core.domain.VoucherType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import java.util.Date;
+
+/**
+ * 用于通用的出入库单据回复.
+ *
+ * @author huxz
+ */
+@Entity
+@Table(name = "normal_reply")
+@JsonInclude(Include.NON_EMPTY)
+public class NormalReply extends BaseReply {
+
+  private static final long serialVersionUID = 772065983331719579L;
+
+  @Id
+  @GeneratedValue
+  @Column(name = "id")
+  @JsonIgnore
+  private Long id;
+
+  /**
+   * 单号.
+   */
+  @Column(name = "voucher_no")
+  private String no;
+
+  /**
+   * 回复状态.
+   */
+  @Column(name = "resp_state")
+  private NormalReply.RespState state;
+
+  /**
+   * 备注.
+   */
+  @Column(name = "remark",columnDefinition = "TEXT")
+  private String remark;
+
+  /**
+   * 单据类型.
+   */
+  @Column(name = "doc_type")
+  private String docType;
+
+  /**
+   * 数据类型.
+   */
+  @Column(name = "type")
+  private String type;
+
+  /**
+   * 仓储操作人.
+   */
+  @Column(name = "operator")
+  private String operator;
+
+  /**
+   * 接收方UU.
+   */
+  @Column(name = "receiver_uu")
+  @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
+  private String receiverUU;
+
+  /**
+   * 发送方UU.
+   */
+  @Column(name = "sender_uu")
+  private String senderUU;
+
+  /**
+   * 企业名称.
+   */
+  @Column(name = "en_name")
+  @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
+  private String enterprise;
+
+  /**
+   * 备用字段1.
+   */
+  @Column(name = "attribute1",columnDefinition = "TEXT")
+  private String attribute1;
+
+  /**
+   * 备用字段2.
+   */
+  @Column(name = "attribute2",columnDefinition = "TEXT")
+  private String attribute2;
+
+  /**
+   * 备用字段3.
+   */
+  @Column(name = "attribute3",columnDefinition = "TEXT")
+  private String attribute3;
+
+  /**
+   *物流时间
+   */
+  @Column(name = "logisticstime")
+  private Date logisticstime;
+  /**
+   * 物流地址
+   */
+  @Column(name = "logisticsaddr")
+  private String logisticsaddr;
+  /**
+   * 物流备注
+   */
+  @Column(name = "logisticsremark")
+  private String logisticsremark;
+
+  public String getLogisticsremark() {
+    return logisticsremark;
+  }
+
+  public void setLogisticsremark(String logisticsremark) {
+    this.logisticsremark = logisticsremark;
+  }
+
+  public Long getId() {
+    return id;
+  }
+
+  public void setId(Long id) {
+    this.id = id;
+  }
+
+  public String getNo() {
+    return no;
+  }
+
+  public void setNo(String no) {
+    this.no = no;
+  }
+
+  public RespState getState() {
+    return state;
+  }
+
+  public void setState(RespState state) {
+    this.state = state;
+  }
+
+  public String getDocType() {
+    return docType;
+  }
+
+  public void setDocType(String docType) {
+    this.docType = docType;
+  }
+
+  public String getOperator() {
+    return operator;
+  }
+
+  public void setOperator(String operator) {
+    this.operator = operator;
+  }
+
+  public Date getLogisticstime() {
+    return logisticstime;
+  }
+
+  public void setLogisticstime(Date logisticstime) {
+    this.logisticstime = logisticstime;
+  }
+
+  public String getLogisticsaddr() {
+    return logisticsaddr;
+  }
+
+  public void setLogisticsaddr(String logisticsaddr) {
+    this.logisticsaddr = logisticsaddr;
+  }
+
+  @Override
+
+  public String getReceiverUU() {
+    return receiverUU;
+  }
+
+  public void setReceiverUU(String receiverUU) {
+    this.receiverUU = receiverUU;
+  }
+
+  public String getSenderUU() {
+    return senderUU;
+  }
+
+  public void setSenderUU(String senderUU) {
+    this.senderUU = senderUU;
+  }
+
+  public String getEnterprise() {
+    return enterprise;
+  }
+
+  public void setEnterprise(String enterprise) {
+    this.enterprise = enterprise;
+  }
+
+  public String getType() {
+    return type;
+  }
+
+  public void setType(String type) {
+    this.type = type;
+  }
+
+  public String getAttribute1() {
+    return attribute1;
+  }
+
+  public void setAttribute1(String attribute1) {
+    this.attribute1 = attribute1;
+  }
+
+  public String getAttribute2() {
+    return attribute2;
+  }
+
+  public void setAttribute2(String attribute2) {
+    this.attribute2 = attribute2;
+  }
+
+  public String getAttribute3() {
+    return attribute3;
+  }
+
+  public void setAttribute3(String attribute3) {
+    this.attribute3 = attribute3;
+  }
+
+  public String getRemark() {
+    return remark;
+  }
+
+  public void setRemark(String remark) {
+    this.remark = remark;
+  }
+
+  /**
+   * 出货回传回复类型.
+   */
+  public enum RespState {
+    /**
+     * 表示已收到
+     */
+    GET,
+    /**
+     * 表示已接单
+     */
+    RECEIVE,
+    /**
+     * 表示已到港
+     */
+    OUT,
+    /**
+     * 表示出货成功状态.
+     */
+    OK,
+    /**
+     * 表示出货失败状态.
+     */
+    NG
+  }
+}

+ 266 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/Packing.java

@@ -0,0 +1,266 @@
+package com.uas.platform.warehouse.backend.entity;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.uas.platform.warehouse.backend.transport.entity.BaseVoucher;
+import com.uas.platform.warehouse.core.util.JacksonUtils;
+
+import javax.persistence.*;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Created by luhg on 2017/11/22.
+ * 装箱单.
+ */
+@Entity
+@Table(name = "packing")
+@JsonInclude(JsonInclude.Include.NON_EMPTY)
+public class Packing  extends BaseVoucher {
+    @Id
+    @GeneratedValue
+    @Column(name = "id")
+    @JsonIgnore
+    private long id;
+
+    /**
+     * 单号
+     */
+    @Column(name = "packing_no")
+    private String packingNo;
+
+    /**
+     * 客户名称
+     */
+    @Column(name = "cust_name")
+    private String custName;
+
+    /**
+     * 客户编号
+     */
+    @Column(name = "cust_code")
+    private String custCode;
+
+    /**
+     * 客户UU
+     */
+    @Column(name = "cust_uu")
+    private String custUU;
+
+    /**
+     * 录入人
+     */
+    @Column(name = "operator")
+    private String operator;
+
+    /**
+     * 录入人UU
+     */
+    @Column(name = "operator_uu")
+    private String operatorUU;
+
+    /**
+     * 送货地址
+     */
+    @Column(name = "cust_address",columnDefinition = "TEXT")
+    private String custAddress;
+
+    /**
+     * 客户联系人
+     */
+    @Column(name = "cust_contact",columnDefinition = "TEXT")
+    private String custContact;
+
+    /**
+     * 客户电话
+     */
+    @Column(name = "cust_tel")
+    private String custTel;
+
+    /**
+     * 客户传真
+     */
+    @Column(name = "cust_fax")
+    private String custFax;
+
+    /**
+     * 部门
+     */
+    @Column(name = "depart")
+    private String depart;
+
+    /**
+     * 营业员
+     */
+    @Column(name = "seller")
+    private String seller;
+
+    /**
+     * 包装单日期
+     */
+    @Column(name = "packing_date")
+    private Date packingDate;
+
+    /**
+     * 装箱要求
+     */
+    @Column(name = "packing_remark",columnDefinition = "TEXT")
+    private String packingRemark;
+
+    /**
+     * 备注
+     */
+    @Column(name = "remark",columnDefinition = "TEXT")
+    private String remark;
+
+    /**
+     * 包装单明细.
+     */
+    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
+    @JoinColumn(name = "packing_id")
+    private List<PackingDetail> details;
+
+    public Packing() {
+    }
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public String getPackingNo() {
+        return packingNo;
+    }
+
+    public void setPackingNo(String packingNo) {
+        this.packingNo = packingNo;
+    }
+
+    public String getCustName() {
+        return custName;
+    }
+
+    public void setCustName(String custName) {
+        this.custName = custName;
+    }
+
+    public String getCustCode() {
+        return custCode;
+    }
+
+    public void setCustCode(String custCode) {
+        this.custCode = custCode;
+    }
+
+    public String getCustUU() {
+        return custUU;
+    }
+
+    public void setCustUU(String custUU) {
+        this.custUU = custUU;
+    }
+
+    public String getOperator() {
+        return operator;
+    }
+
+    public void setOperator(String operator) {
+        this.operator = operator;
+    }
+
+    public String getOperatorUU() {
+        return operatorUU;
+    }
+
+    public void setOperatorUU(String operatorUU) {
+        this.operatorUU = operatorUU;
+    }
+
+    public String getCustAddress() {
+        return custAddress;
+    }
+
+    public void setCustAddress(String custAddress) {
+        this.custAddress = custAddress;
+    }
+
+    public String getCustContact() {
+        return custContact;
+    }
+
+    public void setCustContact(String custContact) {
+        this.custContact = custContact;
+    }
+
+    public String getCustTel() {
+        return custTel;
+    }
+
+    public void setCustTel(String custTel) {
+        this.custTel = custTel;
+    }
+
+    public String getCustFax() {
+        return custFax;
+    }
+
+    public void setCustFax(String custFax) {
+        this.custFax = custFax;
+    }
+
+    public String getDepart() {
+        return depart;
+    }
+
+    public void setDepart(String depart) {
+        this.depart = depart;
+    }
+
+    public String getSeller() {
+        return seller;
+    }
+
+    public void setSeller(String seller) {
+        this.seller = seller;
+    }
+
+    public Date getPackingDate() {
+        return packingDate;
+    }
+
+    public void setPackingDate(Date packingDate) {
+        this.packingDate = packingDate;
+    }
+
+    public String getPackingRemark() {
+        return packingRemark;
+    }
+
+    public void setPackingRemark(String packingRemark) {
+        this.packingRemark = packingRemark;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public List<PackingDetail> getDetails() {
+        return details;
+    }
+
+    public void setDetails(List<PackingDetail> details) {
+        this.details = details;
+    }
+
+    @Override
+    public String toString() {
+        return JacksonUtils.toJson(this);
+    }
+}

+ 237 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/PackingDetail.java

@@ -0,0 +1,237 @@
+package com.uas.platform.warehouse.backend.entity;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.uas.platform.warehouse.core.util.JacksonUtils;
+import org.joda.time.LocalDateTime;
+
+import javax.persistence.*;
+import java.util.Date;
+
+/**
+ * Created by luhg on 2017/11/23.
+ * 包装单明细.
+ */
+@Entity
+@Table(name = "packing_detail")
+@JsonInclude(JsonInclude.Include.NON_EMPTY)
+public class PackingDetail {
+    @Id
+    @GeneratedValue
+    @Column(name = "id")
+    @JsonIgnore
+    private Long id;
+
+    /**
+     * 包装单号.
+     */
+    @Column(name = "packing_no")
+    private String packingNo;
+
+    /**
+     * 包装单行号.
+     */
+    @Column(name = "packing_line_no")
+    private String packingLineNo;
+
+    /**
+     * 物料号
+     */
+    @Column(name = "pn")
+    private String pn;
+
+    /**
+     * 客户PO号
+     */
+    @Column(name = "cust_po")
+    private String custPo;
+
+    /**
+     * 客户物料号
+     */
+    @Column(name = "cust_pn")
+    private String custPn;
+
+    /**
+     * 客户型号
+     */
+    @Column(name = "cust_mode")
+    private String custProdSpec;
+
+    /**
+     * 合同号
+     */
+    @Column(name = "contract")
+    private String contract;
+
+    /**
+     * 销售单价
+     */
+    @Column(name = "saleprice")
+    private double salePrice;
+
+    /**
+     * 物料规格
+     */
+    @Column(name = "spec")
+    private String spec;
+
+    /**
+     * 物料名称
+     */
+    @Column(name = "item_name")
+    private String itemName;
+
+    /**
+     * 备用字段1.
+     */
+    @Column(name = "attribute1",columnDefinition = "TEXT")
+    private String attribute1;
+
+    /**
+     * 备用字段2.
+     */
+    @Column(name = "attribute2",columnDefinition = "TEXT")
+    private String attribute2;
+
+    /**
+     * 备用字段3.
+     */
+    @Column(name = "attribute3",columnDefinition = "TEXT")
+    private String attribute3;
+
+    /**
+     * 操作时间
+     */
+    @Column(name = "operate_time")
+    @JsonIgnore
+    private Date operateTime = LocalDateTime.now().toDate();
+
+    public PackingDetail() {
+    }
+
+    @Override
+    public String toString() {
+        return JacksonUtils.toJson(this);
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getPackingNo() {
+        return packingNo;
+    }
+
+    public void setPackingNo(String packingNo) {
+        this.packingNo = packingNo;
+    }
+
+    public String getPackingLineNo() {
+        return packingLineNo;
+    }
+
+    public void setPackingLineNo(String packingLineNo) {
+        this.packingLineNo = packingLineNo;
+    }
+
+    public String getPn() {
+        return pn;
+    }
+
+    public void setPn(String pn) {
+        this.pn = pn;
+    }
+
+    public String getCustPo() {
+        return custPo;
+    }
+
+    public void setCustPo(String custPo) {
+        this.custPo = custPo;
+    }
+
+    public String getCustPn() {
+        return custPn;
+    }
+
+    public void setCustPn(String custPn) {
+        this.custPn = custPn;
+    }
+
+    public String getCustProdSpec() {
+        return custProdSpec;
+    }
+
+    public void setCustProdSpec(String custProdSpec) {
+        this.custProdSpec = custProdSpec;
+    }
+
+    public String getContract() {
+        return contract;
+    }
+
+    public void setContract(String contract) {
+        this.contract = contract;
+    }
+
+    public double getSalePrice() {
+        return salePrice;
+    }
+
+    public void setSalePrice(double salePrice) {
+        this.salePrice = salePrice;
+    }
+
+    public String getSpec() {
+        return spec;
+    }
+
+    public void setSpec(String spec) {
+        this.spec = spec;
+    }
+
+    public String getItemName() {
+        return itemName;
+    }
+
+    public void setItemName(String itemName) {
+        this.itemName = itemName;
+    }
+
+    public String getAttribute1() {
+        return attribute1;
+    }
+
+    public void setAttribute1(String attribute1) {
+        this.attribute1 = attribute1;
+    }
+
+    public String getAttribute2() {
+        return attribute2;
+    }
+
+    public void setAttribute2(String attribute2) {
+        this.attribute2 = attribute2;
+    }
+
+    public String getAttribute3() {
+        return attribute3;
+    }
+
+    public void setAttribute3(String attribute3) {
+        this.attribute3 = attribute3;
+    }
+
+    public Date getOperateTime() {
+        return operateTime;
+    }
+
+    public void setOperateTime(Date operateTime) {
+        this.operateTime = operateTime;
+    }
+}

+ 228 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/PackingReply.java

@@ -0,0 +1,228 @@
+package com.uas.platform.warehouse.backend.entity;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.uas.platform.warehouse.backend.transport.entity.BaseReply;
+import com.uas.platform.warehouse.backend.transport.entity.BaseVoucher;
+import com.uas.platform.warehouse.core.domain.VoucherType;
+import org.joda.time.LocalDateTime;
+
+import javax.persistence.*;
+import java.util.Date;
+import java.util.List;
+
+
+/**
+ * Created by luhg on 2017/11/24.
+ * 包装单回复.
+ */
+@Entity
+@Table(name = "packing_reply")
+@JsonInclude(JsonInclude.Include.NON_EMPTY)
+public class PackingReply  extends BaseReply {
+    @Id
+    @GeneratedValue
+    @Column(name = "id")
+    @JsonIgnore
+    private long id;
+
+    /**
+     * 单号
+     */
+    @Column(name = "packing_no")
+    private String packingNo;
+
+    /**
+     * 数据类型.
+     */
+    @Column(name = "type")
+    private String type;
+
+    /**
+     * 所属企业UU.
+     */
+    @Column(name = "en_uu")
+    @JsonIgnore
+    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
+    private String enUu;
+
+    /**
+     * warehouse name
+     */
+    @Column(name = "wh_name")
+    private String whName;
+
+    /**
+     * 接收方UU
+     */
+    @Column(name = "receiverUU")
+    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
+    private String receiverUU;
+
+    /**
+     * 发送方UU
+     */
+    @Column(name = "senderUU")
+    private String senderUU;
+
+    /**
+     * 企业名称
+     */
+    @Column(name = "enterprise")
+    private String enterprise;
+
+    /**
+     * 操作人
+     */
+    @Column(name = "operator")
+    private String operator;
+
+    /**
+     * 操作时间
+     */
+    @Column(name = "operate_time")
+    @JsonIgnore
+    private Date operateTime = LocalDateTime.now().toDate();
+
+
+    /**
+     * 备用字段1.
+     */
+    @Column(name = "attribute1",columnDefinition = "TEXT")
+    private String attribute1;
+
+    /**
+     * 备用字段2.
+     */
+    @Column(name = "attribute2",columnDefinition = "TEXT")
+    private String attribute2;
+
+    /**
+     * 备用字段3.
+     */
+    @Column(name = "attribute3",columnDefinition = "TEXT")
+    private String attribute3;
+
+    /**
+     * 明细.
+     */
+    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
+    @JoinColumn(name = "packing_reply_id")
+    private List<PackingReplyDetail> details;
+
+    public PackingReply() {
+    }
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public String getPackingNo() {
+        return packingNo;
+    }
+
+    public void setPackingNo(String packingNo) {
+        this.packingNo = packingNo;
+    }
+
+    public List<PackingReplyDetail> getDetails() {
+        return details;
+    }
+
+    public void setDetails(List<PackingReplyDetail> details) {
+        this.details = details;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getEnUu() {
+        return enUu;
+    }
+
+    public void setEnUu(String enUu) {
+        this.enUu = enUu;
+    }
+
+    public String getWhName() {
+        return whName;
+    }
+
+    public void setWhName(String whName) {
+        this.whName = whName;
+    }
+
+    public String getReceiverUU() {
+        return receiverUU;
+    }
+
+    public void setReceiverUU(String receiverUU) {
+        this.receiverUU = receiverUU;
+    }
+
+    public String getSenderUU() {
+        return senderUU;
+    }
+
+    public void setSenderUU(String senderUU) {
+        this.senderUU = senderUU;
+    }
+
+    public String getEnterprise() {
+        return enterprise;
+    }
+
+    public void setEnterprise(String enterprise) {
+        this.enterprise = enterprise;
+    }
+
+    public Date getOperateTime() {
+        return operateTime;
+    }
+
+    public void setOperateTime(Date operateTime) {
+        this.operateTime = operateTime;
+    }
+
+    public String getAttribute1() {
+        return attribute1;
+    }
+
+    public void setAttribute1(String attribute1) {
+        this.attribute1 = attribute1;
+    }
+
+    public String getAttribute2() {
+        return attribute2;
+    }
+
+    public void setAttribute2(String attribute2) {
+        this.attribute2 = attribute2;
+    }
+
+    public String getAttribute3() {
+        return attribute3;
+    }
+
+    public void setAttribute3(String attribute3) {
+        this.attribute3 = attribute3;
+    }
+
+    public String getOperator() {
+        return operator;
+    }
+
+    public void setOperator(String operator) {
+        this.operator = operator;
+    }
+}

+ 386 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/PackingReplyDetail.java

@@ -0,0 +1,386 @@
+package com.uas.platform.warehouse.backend.entity;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import org.joda.time.LocalDateTime;
+
+import javax.persistence.*;
+import java.util.Date;
+
+/**
+ * Created by luhg on 2017/11/24.
+ * 包装单回复明细.
+ */
+@Entity
+@Table(name = "packing_reply_detail")
+@JsonInclude(JsonInclude.Include.NON_EMPTY)
+public class PackingReplyDetail {
+    @Id
+    @GeneratedValue
+    @Column(name = "id")
+    @JsonIgnore
+    private Long id;
+
+    /**
+     * 包装单号.
+     */
+    @Column(name = "packing_no")
+    private String packingNo;
+
+    /**
+     * 包装单行号.
+     */
+    @Column(name = "packing_line_no")
+    private String packingLineNo;
+
+    /**
+     * 物料号
+     */
+    @Column(name = "pn")
+    private String pn;
+
+    /**
+     * 客户PO号
+     */
+    @Column(name = "cust_po")
+    private String custPo;
+
+    /**
+     * 客户物料号
+     */
+    @Column(name = "cust_pn")
+    private String custPn;
+
+    /**
+     * 客户型号
+     */
+    @Column(name = "cust_mode")
+    private String custProdSpec;
+
+    /**
+     * 合同号
+     */
+    @Column(name = "contract")
+    private String contract;
+
+    /**
+     * 销售单价
+     */
+    @Column(name = "saleprice")
+    private double salePrice;
+
+    /**
+     * 数量
+     */
+    @Column(name = "qty")
+    private long qty;
+
+    /**
+     * 物料规格
+     */
+    @Column(name = "spec")
+    private String spec;
+
+    /**
+     * 物料名称
+     */
+    @Column(name = "item_name")
+    private String itemName;
+
+    /**
+     * 箱号
+     */
+    @Column(name = "carton_no")
+    private String cartonNo;
+
+    /**
+     * 件数
+     */
+    @Column(name = "pieces")
+    private String pieces;
+
+    /**
+     * 长
+     */
+    @Column(name = "length")
+    private String length;
+
+    /**
+     * 宽
+     */
+    @Column(name = "width")
+    private String width;
+
+    /**
+     * 高
+     */
+    @Column(name = "height")
+    private String height;
+
+    /**
+     * 毛重
+     */
+    @Column(name = "gw")
+    private String gw;
+
+    /**
+     * 净重
+     */
+    @Column(name = "nw")
+    private String nw;
+
+
+    /**
+     * 产地
+     */
+    @Column(name = "origin")
+    private String origin;
+
+    /**
+     * lot no
+     */
+    @Column(name = "lotno",columnDefinition = "TEXT")
+    private String lotNo;
+
+    /**
+     * dc
+     */
+    @Column(name = "datecode",columnDefinition = "TEXT")
+    private String dateCode;
+
+    /**
+     * 备用字段1.
+     */
+    @Column(name = "attribute1",columnDefinition = "TEXT")
+    private String attribute1;
+
+    /**
+     * 备用字段2.
+     */
+    @Column(name = "attribute2",columnDefinition = "TEXT")
+    private String attribute2;
+
+    /**
+     * 备用字段3.
+     */
+    @Column(name = "attribute3",columnDefinition = "TEXT")
+    private String attribute3;
+
+    /**
+     * 操作时间
+     */
+    @Column(name = "operate_time")
+    @JsonIgnore
+    private Date operateTime = LocalDateTime.now().toDate();
+
+    public PackingReplyDetail() {
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getPackingNo() {
+        return packingNo;
+    }
+
+    public void setPackingNo(String packingNo) {
+        this.packingNo = packingNo;
+    }
+
+    public String getPackingLineNo() {
+        return packingLineNo;
+    }
+
+    public void setPackingLineNo(String packingLineNo) {
+        this.packingLineNo = packingLineNo;
+    }
+
+    public String getPn() {
+        return pn;
+    }
+
+    public void setPn(String pn) {
+        this.pn = pn;
+    }
+
+    public String getCustPo() {
+        return custPo;
+    }
+
+    public void setCustPo(String custPo) {
+        this.custPo = custPo;
+    }
+
+    public String getCustPn() {
+        return custPn;
+    }
+
+    public void setCustPn(String custPn) {
+        this.custPn = custPn;
+    }
+
+    public String getCustProdSpec() {
+        return custProdSpec;
+    }
+
+    public void setCustProdSpec(String custProdSpec) {
+        this.custProdSpec = custProdSpec;
+    }
+
+    public String getContract() {
+        return contract;
+    }
+
+    public void setContract(String contract) {
+        this.contract = contract;
+    }
+
+    public double getSalePrice() {
+        return salePrice;
+    }
+
+    public void setSalePrice(double salePrice) {
+        this.salePrice = salePrice;
+    }
+
+    public String getSpec() {
+        return spec;
+    }
+
+    public void setSpec(String spec) {
+        this.spec = spec;
+    }
+
+    public String getItemName() {
+        return itemName;
+    }
+
+    public void setItemName(String itemName) {
+        this.itemName = itemName;
+    }
+
+    public String getCartonNo() {
+        return cartonNo;
+    }
+
+    public void setCartonNo(String cartonNo) {
+        this.cartonNo = cartonNo;
+    }
+
+    public String getPieces() {
+        return pieces;
+    }
+
+    public void setPieces(String pieces) {
+        this.pieces = pieces;
+    }
+
+    public String getLength() {
+        return length;
+    }
+
+    public void setLength(String length) {
+        this.length = length;
+    }
+
+    public String getWidth() {
+        return width;
+    }
+
+    public void setWidth(String width) {
+        this.width = width;
+    }
+
+    public String getHeight() {
+        return height;
+    }
+
+    public void setHeight(String height) {
+        this.height = height;
+    }
+
+    public String getGw() {
+        return gw;
+    }
+
+    public void setGw(String gw) {
+        this.gw = gw;
+    }
+
+    public String getNw() {
+        return nw;
+    }
+
+    public void setNw(String nw) {
+        this.nw = nw;
+    }
+
+    public String getOrigin() {
+        return origin;
+    }
+
+    public void setOrigin(String origin) {
+        this.origin = origin;
+    }
+
+    public long getQty() {
+        return qty;
+    }
+
+    public void setQty(long qty) {
+        this.qty = qty;
+    }
+
+    public String getLotNo() {
+        return lotNo;
+    }
+
+    public void setLotNo(String lotNo) {
+        this.lotNo = lotNo;
+    }
+
+    public String getDateCode() {
+        return dateCode;
+    }
+
+    public void setDateCode(String dateCode) {
+        this.dateCode = dateCode;
+    }
+
+    public String getAttribute1() {
+        return attribute1;
+    }
+
+    public void setAttribute1(String attribute1) {
+        this.attribute1 = attribute1;
+    }
+
+    public String getAttribute2() {
+        return attribute2;
+    }
+
+    public void setAttribute2(String attribute2) {
+        this.attribute2 = attribute2;
+    }
+
+    public String getAttribute3() {
+        return attribute3;
+    }
+
+    public void setAttribute3(String attribute3) {
+        this.attribute3 = attribute3;
+    }
+
+    public Date getOperateTime() {
+        return operateTime;
+    }
+
+    public void setOperateTime(Date operateTime) {
+        this.operateTime = operateTime;
+    }
+}

+ 175 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/ProdioMainfest.java

@@ -0,0 +1,175 @@
+package com.uas.platform.warehouse.backend.entity;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.uas.platform.warehouse.backend.transport.entity.BaseReply;
+
+import javax.persistence.*;
+import java.util.Date;
+
+/**
+ * 出入库报关单实体
+ * @Author liujw
+ * @Date 2017/12/13 14:21
+ */
+    @Entity
+    @Table(name = "mainfest")
+    @JsonInclude(JsonInclude.Include.NON_EMPTY)
+public class ProdioMainfest extends BaseReply {
+
+    @Id
+    @GeneratedValue
+    @Column(name = "id")
+    @JsonIgnore
+    private long id;
+    /**
+     * 出入库单单据编号
+     */
+    @Column(name = "code")
+    private String code;
+
+    /**
+     * 数据类型.
+     */
+    @Column(name = "type")
+    private String type;
+
+    /**
+     * 报关时间
+     */
+    @Column(name = "customstime")
+    private Date customsTime;
+
+    /**
+     * 报关状态
+     */
+    @Column(name = "customsstatus")
+    private String customsStatus;
+
+    /**
+     * 备注信息
+     */
+    @Column(name = "remark",columnDefinition = "TEXT")
+    private String remark;
+
+    @Column(name = "date_")
+    private Date date;
+
+    /**
+     * 接收方UU.
+     */
+    @Column(name = "receiver_uu")
+    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
+    private String receiverUU;
+
+    /**
+     * 发送方UU.
+     */
+    @Column(name = "sender_uu")
+    private String senderUU;
+
+    /**
+     * 企业名称.
+     */
+    @Column(name = "en_name")
+    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
+    private String enterprise;
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    @Override
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public Date getCustomsTime() {
+        return customsTime;
+    }
+
+    public void setCustomsTime(Date customsTime) {
+        this.customsTime = customsTime;
+    }
+
+    public String getCustomsStatus() {
+        return customsStatus;
+    }
+
+    public void setCustomsStatus(String customsStatus) {
+        this.customsStatus = customsStatus;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public Date getDate() {
+        return date;
+    }
+
+    public void setDate(Date date) {
+        this.date = date;
+    }
+
+    @Override
+    public String getReceiverUU() {
+        return receiverUU;
+    }
+
+    public void setReceiverUU(String receiverUU) {
+        this.receiverUU = receiverUU;
+    }
+
+    public String getSenderUU() {
+        return senderUU;
+    }
+
+    public void setSenderUU(String senderUU) {
+        this.senderUU = senderUU;
+    }
+
+    public String getEnterprise() {
+        return enterprise;
+    }
+
+    public void setEnterprise(String enterprise) {
+        this.enterprise = enterprise;
+    }
+
+    /**
+     * 出入库报关状态
+     */
+    public enum mainfestState{
+        /**
+         * 已申报
+         */
+        REPORTED,
+        /**
+         * 已放行
+         */
+        PASSED
+    }
+
+}

+ 205 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/Product.java

@@ -0,0 +1,205 @@
+package com.uas.platform.warehouse.backend.entity;
+
+/**
+ * Created by luhg on 2017/11/4.
+ * 物料资料
+ */
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.uas.platform.warehouse.backend.transport.entity.BaseVoucher;
+import org.joda.time.LocalDateTime;
+
+import javax.persistence.*;
+import java.util.Date;
+
+@Entity
+@Table(name = "product")
+@JsonInclude(JsonInclude.Include.NON_EMPTY)
+public class Product extends BaseVoucher {
+    @Id
+    @GeneratedValue
+    @Column(name = "id")
+    @JsonIgnore
+    private long id;
+
+    /**
+     * 料号
+     */
+    @Column(name = "pn")
+    private String pn;
+
+    /**
+     * 物料规格
+     */
+    @Column(name = "spec")
+    private String spec;
+
+    /**
+     * 原厂型号
+     */
+    @Column(name = "original_spec")
+    private String originalSpec;
+
+    /**
+     * 最小包装
+     */
+    @Column(name = "moq")
+    private long moq;
+
+    /**
+     * 物料种类
+     */
+    @Column(name = "matkl")
+    private String matkl;
+
+    /**
+     * 物料描述
+     */
+    @Column(name = "matkx")
+    private String matkx;
+
+    /**
+     * 品牌
+     */
+    @Column(name = "brand")
+    private String brand;
+
+    /**
+     * 净重
+     */
+    @Column(name = "outerboxnw")
+    private double outerboxnw;
+
+    /**
+     * 单位
+     */
+    @Column(name = "uom")
+    private String uom;
+
+    /**
+     * 采购员编号
+     */
+    @Column(name = "buyer_code")
+    private String buyerCode;
+
+    /**
+     * 采购员姓名
+     */
+    @Column(name = "buyer_name")
+    private String buyerName;
+
+    /**
+     * 备注.
+     */
+    @Column(name = "remark",columnDefinition = "TEXT")
+    private String remark;
+
+    public Product() {
+    }
+
+    public String getOriginalSpec() {
+        return originalSpec;
+    }
+
+    public void setOriginalSpec(String originalSpec) {
+        this.originalSpec = originalSpec;
+    }
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public String getPn() {
+        return pn;
+    }
+
+    public void setPn(String pn) {
+        this.pn = pn;
+    }
+
+    public String getSpec() {
+        return spec;
+    }
+
+    public void setSpec(String spec) {
+        this.spec = spec;
+    }
+
+    public long getMoq() {
+        return moq;
+    }
+
+    public void setMoq(long moq) {
+        this.moq = moq;
+    }
+
+    public String getMatkl() {
+        return matkl;
+    }
+
+    public void setMatkl(String matkl) {
+        this.matkl = matkl;
+    }
+
+    public String getMatkx() {
+        return matkx;
+    }
+
+    public void setMatkx(String matkx) {
+        this.matkx = matkx;
+    }
+
+    public String getBrand() {
+        return brand;
+    }
+
+    public void setBrand(String brand) {
+        this.brand = brand;
+    }
+
+    public double getOuterboxnw() {
+        return outerboxnw;
+    }
+
+    public void setOuterboxnw(double outerboxnw) {
+        this.outerboxnw = outerboxnw;
+    }
+
+    public String getUom() {
+        return uom;
+    }
+
+    public void setUom(String uom) {
+        this.uom = uom;
+    }
+
+    public String getBuyerCode() {
+        return buyerCode;
+    }
+
+    public void setBuyerCode(String buyerCode) {
+        this.buyerCode = buyerCode;
+    }
+
+    public String getBuyerName() {
+        return buyerName;
+    }
+
+    public void setBuyerName(String buyerName) {
+        this.buyerName = buyerName;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+}

+ 191 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/ProductMainfest.java

@@ -0,0 +1,191 @@
+package com.uas.platform.warehouse.backend.entity;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.uas.platform.warehouse.backend.transport.entity.BaseReply;
+
+import javax.persistence.*;
+
+/**
+ * 物料报关信息
+ * @Author liujw
+ * @Date 2017/12/13 16:50
+ */
+@Entity
+@Table(name = "mainfest")
+@JsonInclude(JsonInclude.Include.NON_EMPTY)
+public class ProductMainfest extends BaseReply {
+
+    @Id
+    @GeneratedValue
+    @Column(name = "id")
+    @JsonIgnore
+    private long id;
+
+    /**
+     *物料编号
+     */
+    @Column(name = "code")
+    private String code;
+
+    /**
+     *海关编码
+     */
+    @Column(name = "custocode")
+    private String custoCode;
+
+    /**
+     * 申报要素
+     */
+    @Column(name = "customselement")
+    private String customsElement;
+
+    /**
+     * 原产国
+     */
+    @Column(name = "origincountry")
+    private String originCountry;
+
+    /**
+     * 币别
+     */
+    @Column(name = "currency")
+    private String currency;
+
+    /**
+     *征免
+     */
+    @Column(name = "customsexemption")
+    private String customsExemption;
+
+    /**
+     * 备注信息
+     */
+    @Column(name = "remark")
+    private String remark;
+
+    /**
+     * 数据类型.
+     */
+    @Column(name = "type")
+    private String type;
+
+    /**
+     * 接收方UU.
+     */
+    @Column(name = "receiver_uu")
+    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
+    private String receiverUU;
+
+    /**
+     * 发送方UU.
+     */
+    @Column(name = "sender_uu")
+    private String senderUU;
+
+    /**
+     * 企业名称.
+     */
+    @Column(name = "en_name")
+    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
+    private String enterprise;
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getCustoCode() {
+        return custoCode;
+    }
+
+    public void setCustoCode(String custoCode) {
+        this.custoCode = custoCode;
+    }
+
+    public String getCustomsElement() {
+        return customsElement;
+    }
+
+    public void setCustomsElement(String customsElement) {
+        this.customsElement = customsElement;
+    }
+
+    public String getOriginCountry() {
+        return originCountry;
+    }
+
+    public void setOriginCountry(String originCountry) {
+        this.originCountry = originCountry;
+    }
+
+    public String getCurrency() {
+        return currency;
+    }
+
+    public void setCurrency(String currency) {
+        this.currency = currency;
+    }
+
+    public String getCustomsExemption() {
+        return customsExemption;
+    }
+
+    public void setCustomsexEmption(String customsExemption) {
+        this.customsExemption = customsExemption;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    @Override
+    public String getReceiverUU() {
+        return receiverUU;
+    }
+
+    public void setReceiverUU(String receiverUU) {
+        this.receiverUU = receiverUU;
+    }
+
+    public String getSenderUU() {
+        return senderUU;
+    }
+
+    public void setSenderUU(String senderUU) {
+        this.senderUU = senderUU;
+    }
+
+    public String getEnterprise() {
+        return enterprise;
+    }
+
+    public void setEnterprise(String enterprise) {
+        this.enterprise = enterprise;
+    }
+}

+ 292 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/Shipment.java

@@ -0,0 +1,292 @@
+package com.uas.platform.warehouse.backend.entity;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import com.uas.platform.warehouse.backend.transport.entity.BaseVoucher;
+import com.uas.platform.warehouse.core.util.JacksonUtils;
+import java.util.Date;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+
+/**
+ * 出货单信息.
+ *
+ * @author huxz
+ */
+@Entity
+@Table(name = "shipment")
+@JsonInclude(Include.NON_EMPTY)
+public class Shipment extends BaseVoucher {
+
+  @Id
+  @GeneratedValue
+  @Column(name = "id")
+  @JsonIgnore
+  private long id;
+
+  /**
+   * 仓库地址
+   */
+  @Column(name = "location")
+  private String location;
+
+  /**
+   * 出货单号.
+   */
+  @Column(name = "pull_no")
+  private String pullNo;
+
+  /**
+   * 出货类型.
+   */
+  @Column(name = "pull_type")
+  private String pullType;
+
+  /**
+   * 预出货日期.
+   */
+  @Column(name = "predate")
+  private Date predate;
+
+  /**
+   * 客户编号.
+   */
+  @Column(name = "cust_code")
+  private String custCode;
+
+  /**
+   * 客户UU
+   */
+  @Column(name = "cust_uu")
+  private String custUU;
+
+  /**
+   * 收货地址.
+   */
+  @Column(name = "address")
+  private String address;
+
+  /**
+   * 联系人电话.
+   */
+  @Column(name = "phone")
+  private String phone;
+
+    /**
+   * 包装单号.
+   */
+  @Column(name = "packing_no")
+  private String packingNo;
+
+  /**
+   * 联系人地址.
+   */
+  @Column(name = "contact")
+  private String contact;
+
+  /**
+   * 装箱单要求.
+   */
+  @Column(name = "pack_request",columnDefinition = "TEXT")
+  private String packRequest;
+
+  /**
+   * 发票要求.
+   */
+  @Column(name = "invoice_request",columnDefinition = "TEXT")
+  private String invoiceRequest;
+
+  /**
+   * 发货说明.
+   */
+  @Column(name = "delivery_note",columnDefinition = "TEXT")
+  private String deliveryNote;
+
+  /**
+   * 备注.
+   */
+  @Column(name = "remark",columnDefinition = "TEXT")
+  private String remark;
+
+  /**
+   * 录入人.
+   */
+  @Column(name = "operator")
+  private String operator;
+
+  /**
+   * 发票号.
+   */
+  @Column(name = "invoice_no")
+  private String invoiceNo;
+
+
+
+  /**
+   * 出货单明细.
+   */
+  @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
+  @JoinColumn(name = "shipment_id")
+  private List<ShipmentDetail> details;
+
+  public Shipment() {   }
+
+  public String getPhone() {
+    return phone;
+  }
+
+  public void setPhone(String phone) {
+    this.phone = phone;
+  }
+
+  public String getPackingNo() {
+    return packingNo;
+  }
+
+  public void setPackingNo(String packingNo) {
+    this.packingNo = packingNo;
+  }
+
+  public long getId() {
+    return id;
+  }
+
+  public void setId(long id) {
+    this.id = id;
+  }
+
+  public String getPullNo() {
+    return pullNo;
+  }
+
+  public void setPullNo(String pullNo) {
+    this.pullNo = pullNo;
+  }
+
+  public String getPullType() {
+    return pullType;
+  }
+
+  public void setPullType(String pullType) {
+    this.pullType = pullType;
+  }
+
+  public Date getPredate() {
+    return predate;
+  }
+
+  public void setPredate(Date predate) {
+    this.predate = predate;
+  }
+
+  public String getCustCode() {
+    return custCode;
+  }
+
+  public void setCustCode(String custCode) {
+    this.custCode = custCode;
+  }
+
+  public String getAddress() {
+    return address;
+  }
+
+  public void setAddress(String address) {
+    this.address = address;
+  }
+
+  public String getContact() {
+    return contact;
+  }
+
+  public void setContact(String contact) {
+    this.contact = contact;
+  }
+
+  public String getPackRequest() {
+    return packRequest;
+  }
+
+  public void setPackRequest(String packRequest) {
+    this.packRequest = packRequest;
+  }
+
+  public String getInvoiceRequest() {
+    return invoiceRequest;
+  }
+
+  public void setInvoiceRequest(String invoiceRequest) {
+    this.invoiceRequest = invoiceRequest;
+  }
+
+  public String getDeliveryNote() {
+    return deliveryNote;
+  }
+
+  public void setDeliveryNote(String deliveryNote) {
+    this.deliveryNote = deliveryNote;
+  }
+
+  public String getRemark() {
+    return remark;
+  }
+
+  public void setRemark(String remark) {
+    this.remark = remark;
+  }
+
+  public String getOperator() {
+    return operator;
+  }
+
+  public void setOperator(String operator) {
+    this.operator = operator;
+  }
+
+  public String getInvoiceNo() {
+    return invoiceNo;
+  }
+
+  public void setInvoiceNo(String invoiceNo) {
+    this.invoiceNo = invoiceNo;
+  }
+
+
+  public String getLocation() {
+    return location;
+  }
+
+  public void setLocation(String location) {
+    this.location = location;
+  }
+
+  public String getCustUU() {
+    return custUU;
+  }
+
+  public void setCustUU(String custUU) {
+    this.custUU = custUU;
+  }
+
+  @Override
+  public String toString() {
+    return JacksonUtils.toJson(this);
+  }
+
+  public List<ShipmentDetail> getDetails() {
+    return details;
+  }
+
+  public void setDetails(List<ShipmentDetail> details) {
+    this.details = details;
+  }
+}

+ 288 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/ShipmentDetail.java

@@ -0,0 +1,288 @@
+package com.uas.platform.warehouse.backend.entity;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import com.uas.platform.warehouse.core.util.JacksonUtils;
+import org.joda.time.LocalDateTime;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import java.util.Date;
+
+/**
+ * 出货单明细,用于出货通知.
+ *
+ * @author huxz
+ */
+@Entity
+@Table(name = "shipment_detail")
+@JsonInclude(Include.NON_EMPTY)
+public class ShipmentDetail {
+
+  @Id
+  @GeneratedValue
+  @Column(name = "id")
+  @JsonIgnore
+  private Long id;
+
+  /**
+   * 出货单号.
+   */
+  @Column(name = "pull_no")
+  private String pullNo;
+
+  /**
+   * 出货单行号.
+   */
+  @Column(name = "pull_line_no")
+  private String pullLineNo;
+
+  /**
+   * 物料号.
+   */
+  @Column(name = "prod_code")
+  private String pn;
+
+  /**
+   * 出货数量.
+   */
+  @Column(name = "out_qty")
+  private int qty;
+
+  /**
+   * 批次号.
+   */
+  @Column(name = "batchCode")
+  private String batchCode;
+
+  /**
+   * 客户物料号.
+   */
+  @Column(name = "cust_prod_code")
+  private String custPn;
+
+
+  /**
+   * 客户PO号.
+   */
+  @Column(name = "po_code")
+  private String poCode;
+
+  /**
+   * 客户型号.
+   */
+  @Column(name = "cust_prod_spec")
+  private String custProdSpec;
+
+  /**
+   * 销售单价.
+   */
+  @Column(name = "sale_price")
+  private Double salePrice;
+
+  /**
+   * 物料规格.
+   */
+  @Column(name = "spec")
+  private String spec;
+
+  /**
+   * 采购币别.
+   */
+  @Column(name = "pur_currency")
+  private String purCurrency;
+
+  /**
+   * 备用字段1.最小包装
+   */
+  @Column(name = "attribute1",columnDefinition = "TEXT")
+  private String attribute1;
+
+  /**
+   * 备用字段2.物料种类
+   */
+  @Column(name = "attribute2",columnDefinition = "TEXT")
+  private String attribute2;
+
+  /**
+   * 备用字段3.物料品牌
+   */
+  @Column(name = "attribute3",columnDefinition = "TEXT")
+  private String attribute3;
+
+  /**
+   * 备用字段4.单位
+   */
+  @Column(name = "attribute4",columnDefinition = "TEXT")
+  private String attribute4;
+
+  /**
+   * 备用字段5.原厂型号
+   */
+  @Column(name = "attribute5",columnDefinition = "TEXT")
+  private String attribute5;
+
+  /**
+   * 操作时间
+   */
+  @Column(name = "operate_time")
+  @JsonIgnore
+  private Date operateTime = LocalDateTime.now().toDate();
+
+  public ShipmentDetail() {
+  }
+
+  public Long getId() {
+    return id;
+  }
+
+  public void setId(Long id) {
+    this.id = id;
+  }
+
+  public String getPullLineNo() {
+    return pullLineNo;
+  }
+
+  public void setPullLineNo(String pullLineNo) {
+    this.pullLineNo = pullLineNo;
+  }
+
+  public String getPn() {
+    return pn;
+  }
+
+  public void setPn(String pn) {
+    this.pn = pn;
+  }
+
+  public int getQty() {
+    return qty;
+  }
+
+  public void setQty(int qty) {
+    this.qty = qty;
+  }
+
+  public String getBatchCode() {
+    return batchCode;
+  }
+
+  public void setBatchCode(String batchCode) {
+    this.batchCode = batchCode;
+  }
+
+  public String getCustPn() {
+    return custPn;
+  }
+
+  public void setCustPn(String custPn) {
+    this.custPn = custPn;
+  }
+
+  public String getPoCode() {
+    return poCode;
+  }
+
+  public void setPoCode(String poCode) {
+    this.poCode = poCode;
+  }
+
+  public String getCustProdSpec() {
+    return custProdSpec;
+  }
+
+  public void setCustProdSpec(String custProdSpec) {
+    this.custProdSpec = custProdSpec;
+  }
+
+  public Double getSalePrice() {
+    return salePrice;
+  }
+
+  public void setSalePrice(Double salePrice) {
+    this.salePrice = salePrice;
+  }
+
+  public String getSpec() {
+    return spec;
+  }
+
+  public void setSpec(String spec) {
+    this.spec = spec;
+  }
+
+  public String getPullNo() {
+    return pullNo;
+  }
+
+  public void setPullNo(String pullNo) {
+    this.pullNo = pullNo;
+  }
+
+  public String getAttribute1() {
+    return attribute1;
+  }
+
+  public void setAttribute1(String attribute1) {
+    this.attribute1 = attribute1;
+  }
+
+  public String getAttribute2() {
+    return attribute2;
+  }
+
+  public void setAttribute2(String attribute2) {
+    this.attribute2 = attribute2;
+  }
+
+  public String getAttribute3() {
+    return attribute3;
+  }
+
+  public void setAttribute3(String attribute3) {
+    this.attribute3 = attribute3;
+  }
+
+  public String getAttribute4() {
+    return attribute4;
+  }
+
+  public void setAttribute4(String attribute4) {
+    this.attribute4 = attribute4;
+  }
+
+  public String getAttribute5() {
+    return attribute5;
+  }
+
+  public void setAttribute5(String attribute5) {
+    this.attribute5 = attribute5;
+  }
+
+  @Override
+
+  public String toString() {
+    return JacksonUtils.toJson(this);
+  }
+
+  public String getPurCurrency() {
+    return purCurrency;
+  }
+
+  public void setPurCurrency(String purCurrency) {
+    this.purCurrency = purCurrency;
+  }
+
+  public Date getOperateTime() {
+    return operateTime;
+  }
+
+  public void setOperateTime(Date operateTime) {
+    this.operateTime = operateTime;
+  }
+}

+ 98 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/Status.java

@@ -0,0 +1,98 @@
+package com.uas.platform.warehouse.backend.entity;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import org.joda.time.LocalDateTime;
+
+import javax.persistence.*;
+import java.util.Date;
+
+/**
+ * Author liujw
+ * Date 2018/1/8 19:13
+ */
+@Entity
+@Table(name = "status")
+@JsonInclude(JsonInclude.Include.NON_EMPTY)
+public class Status {
+    @Id
+    @GeneratedValue
+    @Column(name = "id")
+    @JsonIgnore
+    private long id;
+    /**
+     * 单据ID
+     */
+    @Column(name = "bill_id")
+    private String billId;
+
+    /**
+     * 状态
+     */
+    @Column(name = "bill_status")
+    private BillStatus billStatus;
+
+    /**
+     * 回复时间
+     */
+    @Column(name = "reply_time")
+    private Date replyTime = LocalDateTime.now().toDate();
+
+    /**
+     * 备注
+     */
+    @Column(name="remark")
+    private String remark;
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public String getBillId() {
+        return billId;
+    }
+
+    public void setBillId(String billId) {
+        this.billId = billId;
+    }
+
+    public BillStatus getBillStatus() {
+        return billStatus;
+    }
+
+    public void setBillStatus(BillStatus billStatus) {
+        this.billStatus = billStatus;
+    }
+
+    public Date getReplyTime() {
+        return replyTime;
+    }
+
+    public void setReplyTime(Date replyTime) {
+        this.replyTime = replyTime;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public enum BillStatus{
+    /**
+     * 已获取
+     */
+    OK,
+
+    /**
+     * 未获取成功
+     */
+    ERROR
+    }
+}

+ 174 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/Stockin.java

@@ -0,0 +1,174 @@
+package com.uas.platform.warehouse.backend.entity;
+
+/**
+ * Created by luhg on 2017/11/1.
+ */
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.uas.platform.warehouse.backend.transport.entity.BaseVoucher;
+import com.uas.platform.warehouse.core.util.JacksonUtils;
+import org.joda.time.LocalDateTime;
+
+import javax.persistence.*;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 入库单信息.
+ *
+ * @author huxz
+ */
+@Entity
+@Table(name = "stockin")
+@JsonInclude(JsonInclude.Include.NON_EMPTY)
+public class Stockin  extends BaseVoucher {
+    @Id
+    @GeneratedValue
+    @Column(name = "id")
+    @JsonIgnore
+    private long id;
+
+    /**
+     * 入库库位.
+     */
+    @Column(name = "location")
+    private String location;
+
+    /**
+     * 入库单号.
+     */
+    @Column(name = "asn_no")
+    private String asnNo;
+
+    /**
+     * 入库类型.
+     */
+    @Column(name = "asn_type")
+    private String asnType;
+
+    /**
+     * 日期.
+     */
+    @Column(name = "predate")
+    private Date predate;
+
+    /**
+     * 币别.
+     */
+    @Column(name = "currency")
+    private String cur;
+
+    /**
+     * 录入人.
+     */
+    @Column(name = "operator")
+    private String operator;
+
+    /**
+     * 录入人.
+     */
+    @Column(name = "operator_uu")
+    private String operatorUU;
+
+    /**
+     * 备注.
+     */
+    @Column(name = "remark",columnDefinition = "TEXT")
+    private String remark;
+
+    /**
+     * 入库单明细.
+     */
+    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
+    @JoinColumn(name = "stockin_id")
+    private List<StockinDetail> details;
+
+    public Stockin() {
+    }
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public String getLocation() {
+        return location;
+    }
+
+    public void setLocation(String location) {
+        this.location = location;
+    }
+
+    public String getAsnNo() {
+        return asnNo;
+    }
+
+    public void setAsnNo(String asnNo) {
+        this.asnNo = asnNo;
+    }
+
+    public String getAsnType() {
+        return asnType;
+    }
+
+    public void setAsnType(String asnType) {
+        this.asnType = asnType;
+    }
+
+    public Date getPredate() {
+        return predate;
+    }
+
+    public void setPredate(Date predate) {
+        this.predate = predate;
+    }
+
+    public String getCur() {
+        return cur;
+    }
+
+    public void setCur(String cur) {
+        this.cur = cur;
+    }
+
+    public String getOperator() {
+        return operator;
+    }
+
+    public void setOperator(String operator) {
+        this.operator = operator;
+    }
+
+    public String getOperatorUU() {
+        return operatorUU;
+    }
+
+    public void setOperatorUU(String operatorUU) {
+        this.operatorUU = operatorUU;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public List<StockinDetail> getDetails() {
+        return details;
+    }
+
+    public void setDetails(List<StockinDetail> details) {
+        this.details = details;
+    }
+
+    @Override
+    public String toString() {
+        return JacksonUtils.toJson(this);
+    }
+}

+ 238 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/StockinDetail.java

@@ -0,0 +1,238 @@
+package com.uas.platform.warehouse.backend.entity;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.uas.platform.warehouse.core.util.JacksonUtils;
+import org.joda.time.LocalDateTime;
+
+import javax.persistence.*;
+import java.util.Date;
+
+/**
+ * 入库单明细
+ * Created by luhg on 2017/11/1.
+ */
+@Entity
+@Table(name = "stockin_detail")
+@JsonInclude(JsonInclude.Include.NON_EMPTY)
+public class StockinDetail {
+    @Id
+    @GeneratedValue
+    @Column(name = "id")
+    @JsonIgnore
+    private Long id;
+
+    /**
+     * 入库单号.
+     */
+    @Column(name = "asn_no")
+    private String asnNo;
+
+    /**
+     * 入库单行号.
+     */
+    @Column(name = "asn_line_no")
+    private String asnLineNo;
+
+    /**
+     * 物料号.
+     */
+    @Column(name = "pn")
+    private String pn;
+
+    /**
+     * 入库数量.
+     */
+    @Column(name = "in_qty")
+    private int qty;
+
+    /**
+     * 单价.
+     */
+    @Column(name = "unit_price")
+    private double unitPrice;
+
+    /**
+     * 批号.
+     */
+    @Column(name = "batchcode")
+    private String batchCode;
+
+
+    /**
+     * 备用字段1.spec
+     */
+    @Column(name = "attribute1",columnDefinition = "TEXT")
+    private String attribute1;
+
+    /**
+     * 备用字段2.moq
+     */
+    @Column(name = "attribute2",columnDefinition = "TEXT")
+    private String attribute2;
+
+    /**
+     * 备用字段3.matkl
+     */
+    @Column(name = "attribute3",columnDefinition = "TEXT")
+    private String attribute3;
+
+    /**
+     * 备用字段4.barnd
+     */
+    @Column(name = "attribute4",columnDefinition = "TEXT")
+    private String attribute4;
+
+    /**
+     * 备用字段5.uom
+     */
+    @Column(name = "attribute5",columnDefinition = "TEXT")
+    private String attribute5;
+
+    /**
+     * 备用字段6.originalSpec
+     */
+    @Column(name = "attribute6",columnDefinition = "TEXT")
+    private String attribute6;
+
+    /**
+     * 备用字段7.
+     */
+    @Column(name = "attribute7",columnDefinition = "TEXT")
+    private String attribute7;
+
+    /**
+     * 操作时间
+     */
+    @Column(name = "operate_time")
+    @JsonIgnore
+    private Date operateTime = LocalDateTime.now().toDate();
+
+    public StockinDetail() {
+    }
+
+    public String getAttribute4() {
+        return attribute4;
+    }
+
+    public void setAttribute4(String attribute4) {
+        this.attribute4 = attribute4;
+    }
+
+    public String getAttribute5() {
+        return attribute5;
+    }
+
+    public void setAttribute5(String attribute5) {
+        this.attribute5 = attribute5;
+    }
+
+    public String getAttribute6() {
+        return attribute6;
+    }
+
+    public void setAttribute6(String attribute6) {
+        this.attribute6 = attribute6;
+    }
+
+    public String getAttribute7() {
+        return attribute7;
+    }
+
+    public void setAttribute7(String attribute7) {
+        this.attribute7 = attribute7;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getAsnNo() {
+        return asnNo;
+    }
+
+    public void setAsnNo(String asnNo) {
+        this.asnNo = asnNo;
+    }
+
+    public String getAsnLineNo() {
+        return asnLineNo;
+    }
+
+    public void setAsnLineNo(String asnLineNo) {
+        this.asnLineNo = asnLineNo;
+    }
+
+    public String getPn() {
+        return pn;
+    }
+
+    public void setPn(String pn) {
+        this.pn = pn;
+    }
+
+    public int getQty() {
+        return qty;
+    }
+
+    public void setQty(int qty) {
+        this.qty = qty;
+    }
+
+    public double getUnitPrice() {
+        return unitPrice;
+    }
+
+    public void setUnitPrice(double unitPrice) {
+        this.unitPrice = unitPrice;
+    }
+
+    public String getBatchCode() {
+        return batchCode;
+    }
+
+    public void setBatchCode(String batchCode) {
+        this.batchCode = batchCode;
+    }
+
+    public String getAttribute1() {
+        return attribute1;
+    }
+
+    public void setAttribute1(String attribute1) {
+        this.attribute1 = attribute1;
+    }
+
+    public String getAttribute2() {
+        return attribute2;
+    }
+
+    public void setAttribute2(String attribute2) {
+        this.attribute2 = attribute2;
+    }
+
+    public String getAttribute3() {
+        return attribute3;
+    }
+
+    public void setAttribute3(String attribute3) {
+        this.attribute3 = attribute3;
+    }
+
+    @Override
+    public String toString() {
+        return JacksonUtils.toJson(this);
+    }
+
+    public Date getOperateTime() {
+        return operateTime;
+    }
+
+    public void setOperateTime(Date operateTime) {
+        this.operateTime = operateTime;
+    }
+}

+ 19 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/SynchState.java

@@ -0,0 +1,19 @@
+package com.uas.platform.warehouse.backend.entity;
+
+/**
+ * Represent whether voucher synchronizes to mongodb.
+ *
+ * @author huxz
+ */
+public enum SynchState {
+
+  /**
+   * Voucher not in mongodb.
+   */
+  TO_BE_SYNCH,
+
+  /**
+   * Voucher has been synchronized to mongodb.
+   */
+  SYNCHED
+}

+ 142 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/Transfer.java

@@ -0,0 +1,142 @@
+package com.uas.platform.warehouse.backend.entity;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.uas.platform.warehouse.backend.transport.entity.BaseVoucher;
+import com.uas.platform.warehouse.core.util.JacksonUtils;
+import org.joda.time.LocalDateTime;
+
+import javax.persistence.*;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Created by luhg on 2017/11/3.
+ *  调拨单
+ */
+@Entity
+@Table(name = "transfer")
+@JsonInclude(JsonInclude.Include.NON_EMPTY)
+public class Transfer  extends BaseVoucher {
+    @Id
+    @GeneratedValue
+    @Column(name = "id")
+    @JsonIgnore
+    private long id;
+
+    /**
+     * 调拨单号.
+     */
+    @Column(name = "tran_no")
+    private String tranNo;
+
+    /**
+     * 调拨类型.
+     */
+    @Column(name = "tran_type")
+    private String tranType;
+
+    /**
+     * 日期.
+     */
+    @Column(name = "predate")
+    private Date predate;
+
+    /**
+     * 录入人.
+     */
+    @Column(name = "operator")
+    private String operator;
+
+    /**
+     * 录入人UU.
+     */
+    @Column(name = "operator_uu")
+    private String operatorUU;
+
+
+    /**
+     * 备注.
+     */
+    @Column(name = "remark",columnDefinition = "TEXT")
+    private String remark;
+
+    /**
+     * 调拨单明细.
+     */
+    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
+    @JoinColumn(name = "transfer_id")
+    private List<TransferDetail> details;
+
+    public Transfer() {
+    }
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public String getTranNo() {
+        return tranNo;
+    }
+
+    public void setTranNo(String tranNo) {
+        this.tranNo = tranNo;
+    }
+
+    public String getTranType() {
+        return tranType;
+    }
+
+    public void setTranType(String tranType) {
+        this.tranType = tranType;
+    }
+
+    public Date getPredate() {
+        return predate;
+    }
+
+    public void setPredate(Date predate) {
+        this.predate = predate;
+    }
+
+    public String getOperator() {
+        return operator;
+    }
+
+    public void setOperator(String operator) {
+        this.operator = operator;
+    }
+
+    public String getOperatorUU() {
+        return operatorUU;
+    }
+
+    public void setOperatorUU(String operatorUU) {
+        this.operatorUU = operatorUU;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public List<TransferDetail> getDetails() {
+        return details;
+    }
+
+    public void setDetails(List<TransferDetail> details) {
+        this.details = details;
+    }
+
+    @Override
+    public String toString() {
+        return JacksonUtils.toJson(this);
+    }
+}

+ 195 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/entity/TransferDetail.java

@@ -0,0 +1,195 @@
+package com.uas.platform.warehouse.backend.entity;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.uas.platform.warehouse.core.util.JacksonUtils;
+import org.joda.time.LocalDateTime;
+
+import javax.persistence.*;
+import java.util.Date;
+
+/**
+ * Created by luhg on 2017/11/3.
+ * 调拨单明细
+ */
+@Entity
+@Table(name = "transfer_detail")
+@JsonInclude(JsonInclude.Include.NON_EMPTY)
+public class TransferDetail {
+    @Id
+    @GeneratedValue
+    @Column(name = "id")
+    @JsonIgnore
+    private Long id;
+
+    /**
+     * 调拨单号.
+     */
+    @Column(name = "tran_no")
+    private String tranNo;
+
+    /**
+     * 调拨单行号.
+     */
+    @Column(name = "tran_line_no")
+    private String tranLineNo;
+
+    /**
+     * 调拨数量.
+     */
+    @Column(name="qty")
+    private long qty;
+
+    /**
+     * 料号
+     */
+    @Column(name="pn")
+    private String pn;
+
+    /**
+     * 起始库位.
+     */
+    @Column(name="from_location")
+    private String fromLocation;
+
+    /**
+     * 目标库位
+     */
+    @Column(name="to_location")
+    private String toLocation;
+
+    /**
+     * 批号.
+     */
+    @Column(name = "batchcode")
+    private String batchCode;
+
+    /**
+     * 备用字段1.
+     */
+    @Column(name = "attribute1",columnDefinition = "TEXT")
+    private String attribute1;
+
+    /**
+     * 备用字段2.
+     */
+    @Column(name = "attribute2",columnDefinition = "TEXT")
+    private String attribute2;
+
+    /**
+     * 备用字段3.
+     */
+    @Column(name = "attribute3",columnDefinition = "TEXT")
+    private String attribute3;
+
+    /**
+     * 操作时间
+     */
+    @Column(name = "operate_time")
+    @JsonIgnore
+    private Date operateTime = LocalDateTime.now().toDate();
+
+    public TransferDetail() {
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getTranNo() {
+        return tranNo;
+    }
+
+    public void setTranNo(String tranNo) {
+        this.tranNo = tranNo;
+    }
+
+    public String getTranLineNo() {
+        return tranLineNo;
+    }
+
+    public void setTranLineNo(String tranLineNo) {
+        this.tranLineNo = tranLineNo;
+    }
+
+    public long getQty() {
+        return qty;
+    }
+
+    public void setQty(long qty) {
+        this.qty = qty;
+    }
+
+    public String getPn() {
+        return pn;
+    }
+
+    public void setPn(String pn) {
+        this.pn = pn;
+    }
+
+    public String getFromLocation() {
+        return fromLocation;
+    }
+
+    public void setFromLocation(String fromLocation) {
+        this.fromLocation = fromLocation;
+    }
+
+    public String getToLocation() {
+        return toLocation;
+    }
+
+    public void setToLocation(String toLocation) {
+        this.toLocation = toLocation;
+    }
+
+    public String getBatchCode() {
+        return batchCode;
+    }
+
+    public void setBatchCode(String batchCode) {
+        this.batchCode = batchCode;
+    }
+
+    public String getAttribute1() {
+        return attribute1;
+    }
+
+    public void setAttribute1(String attribute1) {
+        this.attribute1 = attribute1;
+    }
+
+    public String getAttribute2() {
+        return attribute2;
+    }
+
+    public void setAttribute2(String attribute2) {
+        this.attribute2 = attribute2;
+    }
+
+    public String getAttribute3() {
+        return attribute3;
+    }
+
+    public void setAttribute3(String attribute3) {
+        this.attribute3 = attribute3;
+    }
+
+    @Override
+    public String toString() {
+        return JacksonUtils.toJson(this);
+    }
+
+    public Date getOperateTime() {
+        return operateTime;
+    }
+
+    public void setOperateTime(Date operateTime) {
+        this.operateTime = operateTime;
+    }
+}

+ 101 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/service/CommonService.java

@@ -0,0 +1,101 @@
+package com.uas.platform.warehouse.backend.service;
+
+import com.uas.platform.warehouse.backend.entity.ErrorLog;
+
+/**
+ * Created by luhg on 2017/11/8.
+ */
+public interface CommonService {
+    /**
+     * 物料资料.
+     * @param data
+     * @return
+     */
+    boolean doProduct(String data);
+
+    /**
+     * 异常信息处理.
+     * @param type
+     * @param receiverUu
+     * @param data
+     * @param message
+     */
+    void saveErrorLogInfo(ErrorLog.LogType type, String receiverUu, String data, String message);
+
+    /**
+     * 调拨单处理.
+     * @param data
+     * @return
+     */
+    boolean doTransfer(String data);
+
+    /**
+     * 回复信息处理.
+     * @param data
+     * @return
+     */
+    boolean doNormalReply(String data);
+
+    /**
+     * 出货单处理.
+     * @param data
+     * @return
+     */
+    boolean doShipment(String data);
+
+    /**
+     * 入库单处理.
+     * @param data
+     * @return
+     */
+    boolean doStockin(String data);
+
+    /**
+     * 包装单处理.
+     * @param data
+     * @return
+     */
+    boolean doPacking(String data);
+
+    /**
+     * 发票处理.
+     * @param data
+     * @return
+     */
+    boolean doInvoice(String data);
+
+    /**
+     * 包装单回复处理.
+     * @param data
+     * @return
+     */
+    boolean doPackingReply(String data);
+
+    /**
+     * 发票回复处理.
+     * @param data
+     * @return
+     */
+    boolean doInvoiceReply(String data);
+
+    /**
+     * 出入库报关回复处理.
+     * @param data
+     * @return
+     */
+    boolean doProdioMainfestReply(String data);
+
+    /**
+     * 物料报关处理.
+     * @param data
+     * @return
+     */
+    boolean doProductMainfestReply(String data);
+
+    /**
+     * 费用回传处理.
+     * @param data
+     * @return
+     */
+    boolean doFeeReply(String data);
+}

+ 109 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/service/ShipmentService.java

@@ -0,0 +1,109 @@
+package com.uas.platform.warehouse.backend.service;
+
+import com.uas.platform.warehouse.backend.entity.*;
+import com.uas.platform.warehouse.backend.transport.entity.TransferStatus;
+
+/**
+ * Abstract interface for stock-in business.
+ *
+ * @author huxz
+ */
+public interface ShipmentService {
+
+  /**
+   * Ship from warehouse, Only for api calling.
+   *
+   * @param shipment  shipment voucher data
+   * @return  shipment info
+   */
+  boolean shipFromWarehouseForApi(Shipment shipment);
+
+  /**
+   * Stockin from warehouse, Only for api calling.
+   *
+   * @param stockin  stockin voucher data
+   * @return  stockin info
+   */
+  boolean stockinFromWarehouseForApi(Stockin stockin);
+
+  /**
+   * Transfer from warehouse, Only for api calling.
+   *
+   * @param transfer  stockin voucher data
+   * @return  stockin info
+   */
+  boolean transferFromWarehouseForApi(Transfer transfer);
+
+  /**
+   * Product from enterprise, Only for api calling.
+   *
+   * @param product  stockin voucher data
+   * @return  stockin info
+   */
+  boolean productFromEnterpriseForApi(Product product);
+
+  /**
+   * Reply from warehouse provider, Only for api calling.
+   *
+   * @param reply normal reply
+   * @return  status of operation
+   */
+  boolean replyFromWarehouse(NormalReply reply);
+
+  /**
+   * Packing from warehouse, Only for api calling.
+   *
+   * @param packing  shipment voucher data
+   * @return  shipment info
+   */
+  boolean packingFromWarehouseForApi(Packing packing);
+
+  /**
+   * Invoice from warehouse, Only for api calling.
+   *
+   * @param invoice  shipment voucher data
+   * @return  shipment info
+   */
+  boolean invoiceFromWarehouseForApi(Invoice invoice);
+
+  /**
+   * Reply packing from warehouse provider, Only for api calling.
+   *
+   * @param packingReply normal reply
+   * @return  status of operation
+   */
+  boolean replyPackingFromWarehouse(PackingReply packingReply);
+
+  /**
+   * Reply invoice from warehouse provider, Only for api calling.
+   *
+   * @param invoiceReply invoice-reply
+   * @return  status of operation
+   */
+  boolean replyInvoiceFromWarehouse(InvoiceReply invoiceReply);
+
+  /**
+   * Reply mainfest from warehouse provider, Only for api calling.
+   *
+   * @param prodiomainfest prodiomainfest-reply
+   * @return  reply of prodiomainfest
+   */
+  boolean replyProdioMainfestFromWarehouse(ProdioMainfest prodiomainfest);
+
+  /**
+   * Reply mainfest from warehouse provider, Only for api calling.
+   *
+   * @param productMainfest productMainfest-reply
+   * @return  reply of productMainfest
+   */
+  boolean replyProductMainfestFromWarehouse(ProductMainfest productMainfest);
+
+  /**
+   * Reply fee from warehouse provider, Only for api calling.
+   *
+   * @param fee fee-reply
+   * @return  reply of fee
+   */
+  boolean replyFeeFromWarehouse(Fee fee);
+
+}

+ 252 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/service/impl/CommonServiceImpl.java

@@ -0,0 +1,252 @@
+package com.uas.platform.warehouse.backend.service.impl;
+
+import com.uas.platform.warehouse.backend.dao.ErrorLogDao;
+import com.uas.platform.warehouse.backend.entity.*;
+import com.uas.platform.warehouse.backend.service.CommonService;
+import com.uas.platform.warehouse.backend.service.ShipmentService;
+import com.uas.platform.warehouse.backend.transport.auth.entity.AppAuthentication;
+import com.uas.platform.warehouse.backend.transport.service.NotificationService;
+import com.uas.platform.warehouse.backend.transport.service.PullDataService;
+import com.uas.platform.warehouse.backend.transport.util.AuthenticationUtil;
+import com.uas.platform.warehouse.core.util.JacksonUtils;
+import org.joda.time.DateTime;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * Created by luhg on 2017/11/8.
+ * 处理单据信息及回传信息.
+ */
+@Service
+public class CommonServiceImpl implements CommonService{
+    private final ErrorLogDao logDao;
+
+    private final NotificationService notificationService;
+
+    private final ShipmentService shipmentService;
+
+    private final PullDataService pullDataService;
+
+    @Autowired
+    public CommonServiceImpl(
+            ErrorLogDao logDao, ShipmentService shipmentService,
+            PullDataService pullDataService,
+            NotificationService notificationService) {
+        this.logDao = logDao;
+        this.shipmentService = shipmentService;
+        this.pullDataService = pullDataService;
+        this.notificationService = notificationService;
+    }
+
+    /**
+     * 物料资料处理.
+     * @param data
+     * @return
+     */
+    public boolean doProduct(String data){
+        boolean status = false;
+        Product product = JacksonUtils.fromJson(data,Product.class);
+        try {
+            status = shipmentService.productFromEnterpriseForApi(product);
+        } catch (RuntimeException e) {
+            saveErrorLogInfo(ErrorLog.LogType.INVALID_VOUCHER, product.getReceiverUU(), data, e.getMessage());
+        }
+        return status;
+    }
+
+    /**
+     * 保存错误信息.
+     * @param type
+     * @param receiverUu
+     * @param data
+     * @param message
+     */
+    public void saveErrorLogInfo(ErrorLog.LogType type, String receiverUu, String data, String message) {
+        ErrorLog log = new ErrorLog();
+        log.setCreateTime(DateTime.now().toDate());
+        log.setType(type);
+        AppAuthentication authentication = AuthenticationUtil.getAuthentication();
+        log.setSenderUu(authentication.getEnUu());
+        log.setReceiverUu(receiverUu);
+        log.setData(data);
+        log.setReason(message);
+
+        System.out.println("data" + data);
+        System.out.println("message" + message);
+
+        logDao.save(log);
+    }
+
+    /**
+     * 处理调拨单.
+     * @param data
+     * @return
+     */
+    public boolean doTransfer(String data){
+        boolean status = false;
+        Transfer transfer = JacksonUtils.fromJson(data,Transfer.class);
+        try {
+            status = shipmentService.transferFromWarehouseForApi(transfer);
+        } catch (RuntimeException e) {
+            saveErrorLogInfo(ErrorLog.LogType.INVALID_VOUCHER, transfer.getReceiverUU(), data, e.getMessage());
+        }
+
+        return status;
+    }
+
+    /**
+     * 处理仓储服务商回复信息.
+     * @param data
+     * @return
+     */
+    public boolean doNormalReply(String data){
+        NormalReply reply = JacksonUtils.fromJson(data, NormalReply.class);
+        try {
+            return shipmentService.replyFromWarehouse(reply);
+        } catch (RuntimeException e) {
+            saveErrorLogInfo(ErrorLog.LogType.INVALID_REPLY, reply.getReceiverUU(), data, e.getMessage());
+        }
+        return false;
+    }
+
+    /**
+     * 处理出货单.
+     * @param data
+     * @return
+     */
+    public boolean doShipment(String data){
+        boolean status = false;
+        Shipment shipment = JacksonUtils.fromJson(data,Shipment.class);
+        try {
+            status = shipmentService.shipFromWarehouseForApi(shipment);
+        } catch (RuntimeException e) {
+            e.printStackTrace();
+            saveErrorLogInfo(ErrorLog.LogType.INVALID_VOUCHER, shipment.getReceiverUU(), data, e.getMessage());
+        }
+        return status;
+    }
+
+    /**
+     * 处理入库单.
+     * @param data
+     * @return
+     */
+    public boolean doStockin(String data){
+        boolean status = false;
+        Stockin stockin = JacksonUtils.fromJson(data,Stockin.class);
+        try {
+            status = shipmentService.stockinFromWarehouseForApi(stockin);
+        } catch (RuntimeException e) {
+            saveErrorLogInfo(ErrorLog.LogType.INVALID_VOUCHER, stockin.getReceiverUU(), data, e.getMessage());
+        }
+        return status;
+    }
+
+    /**
+     * 处理包装单.
+     * @param data
+     * @return
+     */
+    public boolean doPacking(String data){
+        boolean status = false;
+        Packing packing = JacksonUtils.fromJson(data,Packing.class);
+        try {
+            status = shipmentService.packingFromWarehouseForApi(packing);
+        } catch (RuntimeException e) {
+            saveErrorLogInfo(ErrorLog.LogType.INVALID_VOUCHER, packing.getReceiverUU(), data, e.getMessage());
+        }
+        return status;
+    }
+
+    /**
+     * 处理发票.
+     * @param data
+     * @return
+     */
+    public boolean doInvoice(String data){
+        boolean status = false;
+        Invoice invoice = JacksonUtils.fromJson(data,Invoice.class);
+        try {
+            status = shipmentService.invoiceFromWarehouseForApi(invoice);
+        } catch (RuntimeException e) {
+            e.printStackTrace();
+            saveErrorLogInfo(ErrorLog.LogType.INVALID_VOUCHER, invoice.getReceiverUU(), data, e.getMessage());
+        }
+        return status;
+    }
+
+    /**
+     * 处理包装单回复.
+     * @param data
+     * @return
+     */
+    public boolean doPackingReply(String data){
+        PackingReply packingReply = JacksonUtils.fromJson(data,PackingReply.class);
+        try {
+            return shipmentService.replyPackingFromWarehouse(packingReply);
+        } catch (RuntimeException e) {
+            saveErrorLogInfo(ErrorLog.LogType.INVALID_REPLY, packingReply.getReceiverUU(), data, e.getMessage());
+        }
+        return false;
+    }
+
+    /**
+     * 处理发票回复.
+     * @param data
+     * @return
+     */
+    public boolean doInvoiceReply(String data) {
+        InvoiceReply invoiceReply = JacksonUtils.fromJson(data, InvoiceReply.class);
+        try {
+            return shipmentService.replyInvoiceFromWarehouse(invoiceReply);
+        } catch (RuntimeException e) {
+            saveErrorLogInfo(ErrorLog.LogType.INVALID_REPLY, invoiceReply.getReceiverUU(), data, e.getMessage());
+        }
+        return false;
+    }
+
+        /**
+         * 处理出入库报关回复.
+         * @param data
+         * @return
+         */
+    public boolean doProdioMainfestReply(String data){
+        ProdioMainfest mainfest = JacksonUtils.fromJson(data,ProdioMainfest.class);
+        try {
+            return shipmentService.replyProdioMainfestFromWarehouse(mainfest);
+        } catch (RuntimeException e) {
+            saveErrorLogInfo(ErrorLog.LogType.INVALID_REPLY, mainfest.getReceiverUU(), data, e.getMessage());
+        }
+        return false;
+    }
+
+    /**
+     * 处理物料报关回复.
+     * @param data
+     * @return
+     */
+    public boolean doProductMainfestReply(String data){
+        ProductMainfest mainfest = JacksonUtils.fromJson(data,ProductMainfest.class);
+        try {
+            return shipmentService.replyProductMainfestFromWarehouse(mainfest);
+        } catch (RuntimeException e) {
+            saveErrorLogInfo(ErrorLog.LogType.INVALID_REPLY, mainfest.getReceiverUU(), data, e.getMessage());
+        }
+        return false;
+    }
+
+    /**
+     * 处理费用回复.
+     * @param data
+     * @return
+     */
+    public boolean doFeeReply(String data){
+        Fee fee = JacksonUtils.fromJson(data,Fee.class);
+        try {
+            return shipmentService.replyFeeFromWarehouse(fee);
+        } catch (RuntimeException e) {
+            saveErrorLogInfo(ErrorLog.LogType.INVALID_REPLY, fee.getReceiverUU(), data, e.getMessage());
+        }
+        return false;
+    }
+}

+ 284 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/service/impl/ShipmentServiceImpl.java

@@ -0,0 +1,284 @@
+package com.uas.platform.warehouse.backend.service.impl;
+
+import com.uas.platform.warehouse.backend.dao.*;
+import com.uas.platform.warehouse.backend.entity.*;
+import com.uas.platform.warehouse.backend.service.ShipmentService;
+import com.uas.platform.warehouse.backend.transport.auth.entity.AppAuthentication;
+import com.uas.platform.warehouse.backend.transport.auth.entity.AppAuthentication.IdentificationType;
+import com.uas.platform.warehouse.backend.transport.entity.BaseVoucher;
+import com.uas.platform.warehouse.backend.transport.entity.Notification;
+import com.uas.platform.warehouse.backend.transport.entity.TransferStatus;
+import com.uas.platform.warehouse.backend.transport.service.NotificationService;
+import com.uas.platform.warehouse.backend.transport.util.AuthenticationUtil;
+import com.uas.platform.warehouse.core.domain.VoucherType;
+import org.apache.commons.lang3.Validate;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * Java Bean implementation of {@code StockInService}.
+ *
+ * @author huxz
+ */
+@Service
+public class ShipmentServiceImpl implements ShipmentService {
+  private final StockinDao stockinDao;
+  private final ShipmentDao shipmentDao;
+  private final TransferDao transferDao;
+  private final ProductDao productDao;
+  private final PackingDao packingDao;
+  private final InvoiceDao invoiceDao;
+  private final NormalReplyDao normalReplyDao;
+  private final PackingReplyDao packingReplyDao;
+  private final InvoiceReplyDao invoiceReplyDao;
+  private final NotificationService notificationService;
+  private final ProdioMainfestDao prodioMainfestDao;
+  private final ProductMainfestDao productMainfestDao;
+  private final FeeDao feeDao;
+
+  @Autowired
+  public ShipmentServiceImpl(ShipmentDao shipmentDao,
+      StockinDao stockinDao,
+      TransferDao transferDao,
+      ProductDao productDao,
+      PackingDao packingDao,
+      NormalReplyDao normalReplyDao,
+      PackingReplyDao packingReplyDao,
+      InvoiceDao invoiceDao,
+      InvoiceReplyDao invoiceReplyDao,
+      ProdioMainfestDao prodioMainfestDao,
+      ProductMainfestDao productMainfestDao,
+      FeeDao feeDao,
+      NotificationService notificationService) {
+    this.stockinDao = stockinDao;
+    this.shipmentDao = shipmentDao;
+    this.transferDao = transferDao;
+    this.productDao = productDao;
+    this.packingDao = packingDao;
+    this.invoiceDao = invoiceDao;
+    this.normalReplyDao = normalReplyDao;
+    this.packingReplyDao = packingReplyDao;
+    this.invoiceReplyDao = invoiceReplyDao;
+    this.prodioMainfestDao = prodioMainfestDao;
+    this.productMainfestDao = productMainfestDao;
+    this.notificationService = notificationService;
+    this.feeDao = feeDao;
+  }
+
+  @Override
+  @Transactional(rollbackFor = RuntimeException.class)
+  public boolean shipFromWarehouseForApi(Shipment shipment) {
+    //Validate.notBlank(whName, "仓库名称不能为空");
+    Validate.notNull(shipment, "出货单不能为空");
+
+    AppAuthentication authentication = AuthenticationUtil.getAuthentication();
+    checkAppKey(authentication);
+
+    shipment.setEnUu(authentication.getEnUu());
+
+    shipmentDao.save(shipment);
+
+    return saveDataToMongo(shipment);
+  }
+
+  @Override
+  public boolean stockinFromWarehouseForApi(Stockin stockin) {
+    Validate.notNull(stockin, "入库单不能为空");
+
+    AppAuthentication authentication = AuthenticationUtil.getAuthentication();
+    checkAppKey(authentication);
+
+    stockin.setEnUu(authentication.getEnUu());
+
+    stockinDao.save(stockin);
+
+    return saveDataToMongo(stockin);
+  }
+
+  @Override
+  public boolean transferFromWarehouseForApi(Transfer transfer) {
+    //Validate.notBlank(whName, "仓库名称不能为空");
+    Validate.notNull(transfer, "调拨单不能为空");
+
+    AppAuthentication authentication = AuthenticationUtil.getAuthentication();
+    checkAppKey(authentication);
+
+    transfer.setEnUu(authentication.getEnUu());
+
+    transferDao.save(transfer);
+
+    return saveDataToMongo(transfer);
+  }
+
+  @Override
+  public boolean productFromEnterpriseForApi(Product product) {
+    //Validate.notBlank(whName, "仓库名称不能为空");
+    Validate.notNull(product, "物料资料不能为空");
+
+    AppAuthentication authentication = AuthenticationUtil.getAuthentication();
+    checkAppKey(authentication);
+
+    product.setEnUu(authentication.getEnUu());
+
+    productDao.save(product);
+
+    return saveDataToMongo(product);
+  }
+
+  /**
+   * Save data of voucher to mongo when enterprise customer upload data.
+   *
+   * @param voucher voucher info
+   * @return status of transferring voucher
+   */
+  private boolean saveDataToMongo(BaseVoucher voucher) {
+    Validate.notNull(voucher.getType(), "单据类型不能为空");
+
+    Notification notification = new Notification();
+    // Set enterprise info
+    notification.setEnUu(voucher.getEnUu());
+    // Set warehouse provider info
+    notification.setWhEnUu(voucher.getReceiverUU());
+    //notification.setWhName(voucher.getWhName());
+    notification.setVoucher(voucher);
+    notification.setType(voucher.getType());
+
+    notificationService.saveVoucherDataToMongo(notification);
+    //return notification.getStatus();
+    return true;
+  }
+
+  @Override
+  @Transactional(rollbackFor = RuntimeException.class)
+  public boolean replyFromWarehouse(NormalReply reply) {
+    Validate.notNull(reply, "回传信息不能为空");
+
+    AppAuthentication authentication = AuthenticationUtil.getAuthentication();
+    if (authentication == null || IdentificationType.WAREHOUSE_PROVIDER != authentication.getType()) {
+      throw new IllegalStateException("App Key无效");
+    }
+
+    reply.setSenderUU(authentication.getEnUu());
+
+    normalReplyDao.save(reply);
+
+    notificationService.replyFromWarehouse(reply);
+    return true;
+  }
+
+  @Override
+  public boolean packingFromWarehouseForApi(Packing packing) {
+    //Validate.notBlank(whName, "仓库名称不能为空");
+    Validate.notNull(packing, "包装单不能为空");
+
+    AppAuthentication authentication = AuthenticationUtil.getAuthentication();
+    checkAppKey(authentication);
+
+    packing.setEnUu(authentication.getEnUu());
+
+    packingDao.save(packing);
+
+    return saveDataToMongo(packing);
+  }
+
+  @Override
+  public boolean invoiceFromWarehouseForApi(Invoice invoice) {
+    Validate.notNull(invoice, "发票不能为空");
+
+    AppAuthentication authentication = AuthenticationUtil.getAuthentication();
+    checkAppKey(authentication);
+
+    invoice.setEnUu(authentication.getEnUu());
+
+    invoiceDao.save(invoice);
+
+    return saveDataToMongo(invoice);
+  }
+
+  @Override
+  public boolean replyPackingFromWarehouse(PackingReply packingReply) {
+    Validate.notNull(packingReply, "回传信息不能为空");
+    AppAuthentication authentication = AuthenticationUtil.getAuthentication();
+    if (authentication == null) {
+      throw new IllegalStateException("App Key无效");
+    }
+
+    packingReply.setSenderUU(authentication.getEnUu());
+
+    packingReplyDao.save(packingReply);
+
+    notificationService.replyFromWarehouse(packingReply);
+    return true;
+  }
+
+  @Override
+  public boolean replyInvoiceFromWarehouse(InvoiceReply invoiceReply) {
+    Validate.notNull(invoiceReply, "回传信息不能为空");
+    AppAuthentication authentication = AuthenticationUtil.getAuthentication();
+    if (authentication == null) {
+      throw new IllegalStateException("App Key无效");
+    }
+    invoiceReply.setSenderUU(authentication.getEnUu());
+
+    invoiceReplyDao.save(invoiceReply);
+
+    notificationService.replyFromWarehouse(invoiceReply);
+    return true;
+  }
+
+  @Override
+  public boolean replyProdioMainfestFromWarehouse(ProdioMainfest mainfest) {
+    Validate.notNull(mainfest, "回传信息不能为空");
+    AppAuthentication authentication = AuthenticationUtil.getAuthentication();
+    if (authentication == null) {
+      throw new IllegalStateException("App Key无效");
+    }
+    mainfest.setSenderUU(authentication.getEnUu());
+
+    prodioMainfestDao.save(mainfest);
+
+    notificationService.replyFromWarehouse(mainfest);
+    return true;
+  }
+
+  @Override
+  public boolean replyProductMainfestFromWarehouse(ProductMainfest mainfest) {
+    Validate.notNull(mainfest, "回传信息不能为空");
+    AppAuthentication authentication = AuthenticationUtil.getAuthentication();
+    if (authentication == null) {
+      throw new IllegalStateException("App Key无效");
+    }
+    mainfest.setSenderUU(authentication.getEnUu());
+
+    productMainfestDao.save(mainfest);
+
+    notificationService.replyFromWarehouse(mainfest);
+    return true;
+  }
+
+  @Override
+  public boolean replyFeeFromWarehouse(Fee fee) {
+    Validate.notNull(fee, "回传信息不能为空");
+    AppAuthentication authentication = AuthenticationUtil.getAuthentication();
+    if (authentication == null) {
+      throw new IllegalStateException("App Key无效");
+    }
+    fee.setSenderUU(authentication.getEnUu());
+
+    feeDao.save(fee);
+
+    notificationService.replyFromWarehouse(fee);
+    return true;
+  }
+
+  /**
+   * CheckAppKey valid.
+   * @param authentication
+   */
+  private void checkAppKey(AppAuthentication authentication){
+    if (authentication == null || IdentificationType.ENTERPRISE_USER != authentication.getType()) {
+      throw new IllegalStateException("App Key无效");
+    }
+  }
+}

+ 79 - 0
warehouse-backend-app/src/main/java/com/uas/platform/warehouse/backend/util/SignUtil.java

@@ -0,0 +1,79 @@
+package com.uas.platform.warehouse.backend.util;
+
+import java.math.BigInteger;
+import java.security.MessageDigest;
+import java.util.Arrays;
+import java.util.Map;
+import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.commons.lang3.Validate;
+import org.apache.log4j.Logger;
+
+/**
+ * Api 接口参数签名工具类,负责进行请求参数的签名信息的生成.
+ *
+ * @author huxz
+ */
+public class SignUtil {
+
+  private static final Logger logger = Logger.getLogger(SignUtil.class);
+
+  /**
+   * 根据Appkey和SecretKey生成签名字符串.
+   *
+   * @param appKey 申请接口时生成的key,标识用户
+   * @param secretKey 根据AppKey生成的私钥
+   * @param params 请求参数,包含时间戳和随机数
+   * @return 签名字符串
+   */
+  public static String createSign(String appKey, String secretKey, Map<String, String> params) {
+    Validate.notBlank(appKey, "App key不能为空");
+    Validate.notBlank(secretKey, "Secret Key 不能为空");
+    Validate.notNull(params, "请求参数不能为空");
+
+    // 对参数名进行字典排序
+    String[] keyArray = params.keySet().toArray(new String[0]);
+    Arrays.sort(keyArray);
+
+    if (logger.isDebugEnabled()) {
+      logger.info("Sorted key: " + Arrays.toString(keyArray));
+    }
+
+    // 拼接有序的参数名-值串
+    StringBuilder stringBuilder = new StringBuilder();
+    stringBuilder.append(appKey);
+    for (String key : keyArray) {
+      stringBuilder.append(key).append(params.get(key));
+    }
+    stringBuilder.append(secretKey);
+    String codes = stringBuilder.toString();
+
+    return DigestUtils.sha1Hex(codes).toUpperCase();
+  }
+
+  /**
+   * 根据Appkey和SecretKey生成MD5签名字符串.
+   *
+   * @param appKey 申请接口时生成的key,标识用户
+   * @param secretKey 根据AppKey生成的私钥
+   * @param timestamp 时间戳
+   * @return 签名字符串
+   */
+  public static String createMD5Sign(String appKey, String secretKey, String timestamp) {
+    Validate.notBlank(appKey, "App key不能为空");
+    Validate.notBlank(secretKey, "Secret Key 不能为空");
+    Validate.notNull(timestamp, "时间戳不能为空");
+
+     return getMD5(appKey + timestamp + secretKey );
+  }
+
+  //!!注意:不足32位要补0
+  private static String getMD5(String str) {
+    try {
+      MessageDigest md = MessageDigest.getInstance("MD5");
+      md.update(str.getBytes());
+      return new BigInteger(1, md.digest()).toString(16);
+    } catch (Exception e) {
+      throw new RuntimeException("MD5加密出现错误");
+    }
+  }
+}

+ 13 - 0
warehouse-backend-app/src/main/resources/application-dev.yml

@@ -0,0 +1,13 @@
+spring:
+  data:
+    mongodb:
+      uri: mongodb://127.0.0.1:27017/warehouse
+  datasource:
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    url: jdbc:mysql://localhost:3306/warehouse?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8
+    username: root
+    password: 123456
+  jpa:
+    database: mysql
+    hibernate:
+      ddl-auto: update

+ 13 - 0
warehouse-backend-app/src/main/resources/application-test.yml

@@ -0,0 +1,13 @@
+spring:
+  data:
+    mongodb:
+      uri: mongodb://192.168.253.12:27017/warehouse
+  datasource:
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    url: jdbc:mysql://192.168.253.12:3306/warehouse?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8
+    username: root
+    password: select111***
+  jpa:
+    database: mysql
+    hibernate:
+      ddl-auto: update

+ 12 - 0
warehouse-backend-app/src/main/resources/application.yml

@@ -0,0 +1,12 @@
+server:
+  port: 20320
+
+spring:
+  application:
+    name: warehouse-backend-app
+  profiles:
+    active: test
+
+logging:
+  level:
+    com.uas.platform.warehouse: debug

+ 111 - 0
warehouse-common/pom.xml

@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <artifactId>warehouse-common</artifactId>
+  <packaging>jar</packaging>
+
+  <parent>
+    <artifactId>warehouse</artifactId>
+    <groupId>com.uas.platform.warehouse</groupId>
+    <version>0.1.2-SNAPSHOT</version>
+  </parent>
+
+  <dependencies>
+    <!-- Jackson -->
+    <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-databind</artifactId>
+    </dependency>
+    <!-- Spring Boot logging -->
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-starter-logging</artifactId>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <!-- Code Quality Check -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <version>2.17</version>
+        <!-- CheckStyle Default Version: 6.11.2 -->
+        <dependencies>
+          <dependency>
+            <groupId>com.puppycrawl.tools</groupId>
+            <artifactId>checkstyle</artifactId>
+            <version>7.1.2</version>
+          </dependency>
+        </dependencies>
+        <executions>
+          <execution>
+            <id>Validate</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>check</goal>
+            </goals>
+            <configuration>
+              <encoding>UTF-8</encoding>
+              <failsOnError>true</failsOnError>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-source-plugin</artifactId>
+        <version>3.0.1</version>
+        <executions>
+          <execution>
+            <id>AttachSources</id>
+            <phase>package</phase>
+            <goals>
+              <goal>jar-no-fork</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-javadoc-plugin</artifactId>
+        <version>2.10.4</version>
+        <configuration>
+          <show>private</show>
+          <nohelp>true</nohelp>
+          <aggregate>true</aggregate>
+          <encoding>UTF-8</encoding>
+          <docencoding>UTF-8</docencoding>
+        </configuration>
+        <executions>
+          <execution>
+            <id>AttachDoc</id>
+            <phase>package</phase>
+            <goals>
+              <goal>jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+  <distributionManagement>
+    <!-- 发布release仓库 -->
+    <repository>
+      <id>platform-release</id>
+      <name>platform-release</name>
+      <url>http://113.105.74.141:8081/artifactory/libs-release-local</url>
+    </repository>
+    <!-- 发布快照版本 -->
+    <snapshotRepository>
+      <id>platform-snapshots</id>
+      <name>platform-snapshots</name>
+      <url>http://113.105.74.141:8081/artifactory/libs-snapshot-local</url>
+    </snapshotRepository>
+  </distributionManagement>
+
+</project>

+ 21 - 0
warehouse-common/src/main/java/com/uas/platform/warehouse/core/JsonConvertException.java

@@ -0,0 +1,21 @@
+package com.uas.platform.warehouse.core;
+
+/**
+ * Throw exceptions when convert json failed.
+ *
+ * @author huxz
+ */
+public class JsonConvertException extends RuntimeException {
+
+  public JsonConvertException(String message) {
+    super(message);
+  }
+
+  public JsonConvertException(String message, Throwable cause) {
+    super(message, cause);
+  }
+
+  public JsonConvertException(Throwable cause) {
+    super(cause);
+  }
+}

+ 98 - 0
warehouse-common/src/main/java/com/uas/platform/warehouse/core/common/ResultBean.java

@@ -0,0 +1,98 @@
+package com.uas.platform.warehouse.core.common;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import java.io.Serializable;
+
+/**
+ * Unified Response Date format.
+ *
+ * @param <T>
+ *   the type of response data
+ * @author huxz
+ */
+@SuppressWarnings("unused")
+@JsonInclude(Include.NON_NULL)
+public class ResultBean<T> implements Serializable {
+
+  private static final long serialVersionUID = -8666185459443067060L;
+
+  private Boolean success;
+
+  private T data;
+
+  private ErrorCode code;
+
+  private String message;
+
+  enum ErrorCode {
+
+    /**
+     * Request occurs errors.
+     */
+    FAIL,
+
+    /**
+     * Request has no permission.
+     */
+    NO_PERMISSION
+  }
+
+  public ResultBean() {
+  }
+
+  public ResultBean(T data) {
+    this.success = true;
+    this.data = data;
+  }
+
+  /**
+   * response result when error occurs.
+   *
+   * @param e   exception info
+   */
+  public ResultBean(Throwable e) {
+    this.success = false;
+    this.message = e.toString();
+
+    // Set default code
+    this.code = ErrorCode.FAIL;
+  }
+
+  public Boolean getSuccess() {
+    return success;
+  }
+
+  public void setSuccess(Boolean success) {
+    this.success = success;
+  }
+
+  public T getData() {
+    return data;
+  }
+
+  public void setData(T data) {
+    this.data = data;
+  }
+
+  public ErrorCode getCode() {
+    return code;
+  }
+
+  public void setCode(ErrorCode code) {
+    this.code = code;
+  }
+
+  public String getMessage() {
+    return message;
+  }
+
+  public void setMessage(String message) {
+    this.message = message;
+  }
+
+  @Override
+  public String toString(){
+    return "{sucess:"+this.success+"}";
+  }
+}

+ 29 - 0
warehouse-common/src/main/java/com/uas/platform/warehouse/core/domain/VoucherType.java

@@ -0,0 +1,29 @@
+package com.uas.platform.warehouse.core.domain;
+
+/**
+ * 单据类型,用于表示单据通知和单据回传所对应单据的类型,如出货单、入库单.
+ *
+ * @author huxz
+ */
+public enum VoucherType {
+
+  /**
+   * 出货单类型.
+   */
+  STOCK_OUT,
+
+  /**
+   * 入库单类型.
+   */
+  STOCK_IN,
+
+  /**
+   * 调拨单类型
+   */
+  STOCK_TRANSFER,
+
+  /**
+   * 物料资料
+   */
+  STOCK_ITEM
+}

+ 16 - 0
warehouse-common/src/main/java/com/uas/platform/warehouse/core/domain/shipment/ShipCommon.java

@@ -0,0 +1,16 @@
+package com.uas.platform.warehouse.core.domain.shipment;
+
+import com.uas.platform.warehouse.core.domain.VoucherType;
+
+/**
+ * 抽象接口,提供出货以及出货回传操作通用的方法和常量.
+ *
+ * @author huxz
+ */
+public interface ShipCommon {
+
+  /**
+   * 静态常量,用于记录当前通知或回传信息所对应的单据类型,必要常量.
+   */
+  VoucherType CURRENT_VOUCHER_TYPE = VoucherType.STOCK_OUT;
+}

+ 16 - 0
warehouse-common/src/main/java/com/uas/platform/warehouse/core/domain/stockin/StockInCommon.java

@@ -0,0 +1,16 @@
+package com.uas.platform.warehouse.core.domain.stockin;
+
+import com.uas.platform.warehouse.core.domain.VoucherType;
+
+/**
+ * 抽象接口,提供入库以及入库回传操作通用的方法和常量.
+ *
+ * @author huxz
+ */
+public interface StockInCommon {
+
+  /**
+   * 静态常量,用于记录当前通知或回传信息所对应的单据类型,必要常量.
+   */
+  VoucherType CURRENT_VOUCHER_TYPE = VoucherType.STOCK_IN;
+}

+ 13 - 0
warehouse-common/src/main/java/com/uas/platform/warehouse/core/domain/transfer/TransferCommon.java

@@ -0,0 +1,13 @@
+package com.uas.platform.warehouse.core.domain.transfer;
+
+import com.uas.platform.warehouse.core.domain.VoucherType;
+
+/**
+ * Created by luhg on 2017/11/3.
+ */
+public interface TransferCommon {
+    /**
+     * 静态常量,用于记录当前通知或回传信息所对应的单据类型,必要常量.
+     */
+    VoucherType CURRENT_VOUCHER_TYPE = VoucherType.STOCK_TRANSFER;
+}

+ 105 - 0
warehouse-common/src/main/java/com/uas/platform/warehouse/core/util/JacksonUtils.java

@@ -0,0 +1,105 @@
+package com.uas.platform.warehouse.core.util;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JavaType;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.uas.platform.warehouse.core.JsonConvertException;
+import java.io.IOException;
+import java.io.Reader;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Jackson Util class.
+ *
+ * @author huxz
+ */
+@SuppressWarnings("unused")
+public final class JacksonUtils {
+
+  private static final Log logger = LogFactory.getLog(JacksonUtils.class);
+
+  private static final String EMPTY_JSON = "{}";
+
+  private static final String EMPTY_ARRAY = "[]";
+
+  private static ObjectMapper objectMapper;
+
+  /**
+   * 把JSON文本parse为JavaBean.
+   */
+  public static <T> T fromJson(String text, Class<T> clazz) {
+    if (objectMapper == null) {
+      objectMapper = new ObjectMapper();
+    }
+
+    try {
+      return objectMapper.readValue(text, clazz);
+    } catch (IOException e) {
+      throw new JsonConvertException("转换Java对象失败", e);
+    }
+  }
+
+  /**
+   * Parse Json InputStream to Java Bean.
+   *
+   * @param reader Json InputStream
+   * @param clazz Java Bean class
+   */
+  public static <T> T fromJson(Reader reader, Class<T> clazz) {
+    if (reader == null) {
+      throw new IllegalArgumentException("InputStream must be not Null");
+    }
+
+    if (objectMapper == null) {
+      objectMapper = new ObjectMapper();
+    }
+
+    try {
+      return objectMapper.readValue(reader, clazz);
+    } catch (IOException e) {
+      throw new JsonConvertException("转换Java对象失败", e);
+    }
+  }
+
+  /**
+   * 把JSON文本parse成JavaBean集合.
+   */
+  public static <T> List<T> fromJsonArray(String text, Class<T> clazz) {
+    if (objectMapper == null) {
+      objectMapper = new ObjectMapper();
+    }
+    JavaType javaType = objectMapper.getTypeFactory()
+        .constructParametricType(ArrayList.class, clazz);
+
+    try {
+      if (EMPTY_ARRAY.equals(text)) {
+        return Collections.emptyList();
+      }
+
+      return objectMapper.readValue(text, javaType);
+    } catch (IOException e) {
+      e.printStackTrace();
+      throw new JsonConvertException("转换Java List失败", e);
+    }
+  }
+
+  /**
+   * 将JavaBean序列化为JSON文本.
+   */
+  public static String toJson(Object object) {
+    if (objectMapper == null) {
+      objectMapper = new ObjectMapper();
+    }
+
+    try {
+      return objectMapper.writeValueAsString(object);
+    } catch (JsonProcessingException e) {
+      throw new JsonConvertException("序列化成Json失败", e);
+    }
+  }
+
+}

+ 123 - 0
warehouse-home-app/pom.xml

@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <artifactId>warehouse-home-app</artifactId>
+  <packaging>jar</packaging>
+
+  <parent>
+    <artifactId>warehouse</artifactId>
+    <groupId>com.uas.platform.warehouse</groupId>
+    <version>0.1.2-SNAPSHOT</version>
+  </parent>
+
+  <dependencies>
+    <!-- Custom Lib -->
+    <dependency>
+      <groupId>com.uas.platform.warehouse</groupId>
+      <artifactId>warehouse-common</artifactId>
+    </dependency>
+    <!-- Spring Boot -->
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-starter-web</artifactId>
+    </dependency>
+    <!--<dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-starter-data-jpa</artifactId>
+    </dependency>-->
+    <!-- Joda Time -->
+    <dependency>
+      <groupId>joda-time</groupId>
+      <artifactId>joda-time</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>commons-codec</groupId>
+      <artifactId>commons-codec</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-lang3</artifactId>
+    </dependency>
+    <!-- Database Drivers -->
+    <!--<dependency>
+      <groupId>mysql</groupId>
+      <artifactId>mysql-connector-java</artifactId>
+    </dependency>-->
+    <!-- WebJar -->
+    <dependency>
+      <groupId>org.webjars</groupId>
+      <artifactId>webjars-locator</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.webjars</groupId>
+      <artifactId>jquery</artifactId>
+      <version>2.1.1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.webjars</groupId>
+      <artifactId>angularjs</artifactId>
+      <version>1.4.3</version>
+    </dependency>
+    <dependency>
+      <groupId>org.webjars</groupId>
+      <artifactId>bootstrap</artifactId>
+      <version>3.2.0</version>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-maven-plugin</artifactId>
+      </plugin>
+      <!-- Code Quality Check -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <version>2.17</version>
+        <!-- CheckStyle Default Version: 6.11.2 -->
+        <dependencies>
+          <dependency>
+            <groupId>com.puppycrawl.tools</groupId>
+            <artifactId>checkstyle</artifactId>
+            <version>7.1.2</version>
+          </dependency>
+        </dependencies>
+        <executions>
+          <execution>
+            <id>Validate</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>check</goal>
+            </goals>
+            <configuration>
+              <encoding>UTF-8</encoding>
+              <failsOnError>true</failsOnError>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+  <distributionManagement>
+    <!-- 发布release仓库 -->
+    <repository>
+      <id>platform-release</id>
+      <name>platform-release</name>
+      <url>http://113.105.74.141:8081/artifactory/libs-release-local</url>
+    </repository>
+    <!-- 发布快照版本 -->
+    <snapshotRepository>
+      <id>platform-snapshots</id>
+      <name>platform-snapshots</name>
+      <url>http://113.105.74.141:8081/artifactory/libs-snapshot-local</url>
+    </snapshotRepository>
+  </distributionManagement>
+
+
+</project>

+ 16 - 0
warehouse-home-app/src/main/java/com/uas/platform/warehouse/home/HomeApplication.java

@@ -0,0 +1,16 @@
+package com.uas.platform.warehouse.home;
+
+import org.springframework.boot.Banner.Mode;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.builder.SpringApplicationBuilder;
+
+@SpringBootApplication
+public class HomeApplication {
+
+  public static void main(String[] args) {
+    new SpringApplicationBuilder(HomeApplication.class)
+        .bannerMode(Mode.OFF)
+        .web(true)
+        .run(args);
+  }
+}

+ 58 - 0
warehouse-home-app/src/main/java/com/uas/platform/warehouse/home/config/ControllerExceptionHandler.java

@@ -0,0 +1,58 @@
+package com.uas.platform.warehouse.home.config;
+
+import com.uas.platform.warehouse.core.common.ResultBean;
+import java.io.IOException;
+import org.apache.log4j.Logger;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.http.converter.HttpMessageConverter;
+import org.springframework.http.converter.HttpMessageNotReadableException;
+import org.springframework.web.bind.annotation.ControllerAdvice;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.context.request.WebRequest;
+import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;
+
+/**
+ * Use @ControllerAdvice annotation to handler exceptions.
+ *
+ * <p>Tip: ResponseEntityExceptionHandler, write to the response with a {@link HttpMessageConverter
+ * message converter}</p>
+ *
+ * @author huxz
+ */
+@ControllerAdvice(annotations = {RestController.class})
+public class ControllerExceptionHandler extends ResponseEntityExceptionHandler {
+
+  private static final Logger logger = Logger.getLogger(ControllerExceptionHandler.class);
+
+  private static final String MESSAGE_BAD_REQUEST =
+      HttpStatus.BAD_REQUEST.value() + " " + HttpStatus.BAD_REQUEST.getReasonPhrase();
+
+  /**
+   * Handler IOException and RuntimeException.
+   *
+   * @param ex  exception info
+   * @return response entity
+   */
+  @ExceptionHandler(value = {IOException.class, RuntimeException.class})
+  @ResponseBody
+  public ResponseEntity<?> handlerCommonExceptions(Throwable ex) {
+    logger.error("System Error occurs", ex);
+    HttpHeaders headers = new HttpHeaders();
+    headers.add("Content-Type", MediaType.APPLICATION_JSON_UTF8_VALUE);
+    return new ResponseEntity<>(new ResultBean<>(ex), headers, HttpStatus.INTERNAL_SERVER_ERROR);
+  }
+
+  @Override
+  protected ResponseEntity<Object> handleHttpMessageNotReadable(HttpMessageNotReadableException ex,
+      HttpHeaders headers, HttpStatus status, WebRequest request) {
+    logger.error(MESSAGE_BAD_REQUEST, ex);
+
+    headers.add("Content-Type", MediaType.APPLICATION_JSON_UTF8_VALUE);
+    return handleExceptionInternal(ex, new ResultBean<>(ex), headers, status, request);
+  }
+}

+ 0 - 0
warehouse-home-app/src/main/resources/application-dev.yml


+ 0 - 0
warehouse-home-app/src/main/resources/application-test.yml


+ 8 - 0
warehouse-home-app/src/main/resources/application.yml

@@ -0,0 +1,8 @@
+server:
+  port: 20320
+
+spring:
+  application:
+    name: warehouse-home-app
+  profiles:
+    active: test

+ 22 - 0
warehouse-home-app/src/main/resources/static/index.html

@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8"/>
+  <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
+  <title>Home(Dashboard)</title>
+  <meta name="description" content=""/>
+  <meta name="viewport" content="width=device-width"/>
+  <base href="/"/>
+  <link rel="stylesheet" type="text/css"
+        href="/webjars/bootstrap/css/bootstrap.min.css"/>
+</head>
+<body>
+<div class="container">
+  首页
+</div>
+
+<script type="text/javascript" src="/webjars/jquery/jquery.min.js"></script>
+<script type="text/javascript" src="/webjars/bootstrap/js/bootstrap.min.js"></script>
+<script type="text/javascript" src="/webjars/angularjs/angular.min.js"></script>
+</body>
+</html>

+ 141 - 0
warehouse-online-app/pom.xml

@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <artifactId>warehouse-online-app</artifactId>
+  <packaging>jar</packaging>
+
+  <parent>
+    <artifactId>warehouse</artifactId>
+    <groupId>com.uas.platform.warehouse</groupId>
+    <version>0.1.2-SNAPSHOT</version>
+  </parent>
+
+  <dependencies>
+    <!-- Custom Lib -->
+    <dependency>
+      <groupId>com.uas.platform.warehouse</groupId>
+      <artifactId>warehouse-common</artifactId>
+    </dependency>
+    <!-- Spring Boot -->
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-starter-web</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-starter-data-jpa</artifactId>
+    </dependency>
+    <!-- Joda Time -->
+    <dependency>
+      <groupId>joda-time</groupId>
+      <artifactId>joda-time</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>commons-codec</groupId>
+      <artifactId>commons-codec</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-lang3</artifactId>
+    </dependency>
+    <!-- Database Drivers -->
+    <dependency>
+      <groupId>mysql</groupId>
+      <artifactId>mysql-connector-java</artifactId>
+    </dependency>
+    <!-- WebJar -->
+    <dependency>
+      <groupId>org.webjars</groupId>
+      <artifactId>webjars-locator</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.webjars</groupId>
+      <artifactId>jquery</artifactId>
+      <version>2.1.1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.webjars</groupId>
+      <artifactId>angularjs</artifactId>
+      <version>1.4.3</version>
+    </dependency>
+    <dependency>
+      <groupId>org.webjars</groupId>
+      <artifactId>bootstrap</artifactId>
+      <version>3.2.0</version>
+    </dependency>
+      <dependency>
+          <groupId>junit</groupId>
+          <artifactId>junit</artifactId>
+      </dependency>
+      <dependency>
+          <groupId>org.apache.httpcomponents</groupId>
+          <artifactId>httpclient</artifactId>
+      </dependency>
+    <dependency>
+      <groupId>com.uas.platform.warehouse</groupId>
+      <artifactId>warehouse-uas-sdk</artifactId>
+      <version>0.1.2-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>com.uas.account</groupId>
+      <artifactId>account-common</artifactId>
+      <version>0.0.1-SNAPSHOT</version>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-maven-plugin</artifactId>
+      </plugin>
+      <!-- Code Quality Check -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <version>2.17</version>
+        <!-- CheckStyle Default Version: 6.11.2 -->
+        <dependencies>
+          <dependency>
+            <groupId>com.puppycrawl.tools</groupId>
+            <artifactId>checkstyle</artifactId>
+            <version>7.1.2</version>
+          </dependency>
+        </dependencies>
+        <executions>
+          <execution>
+            <id>Validate</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>check</goal>
+            </goals>
+            <configuration>
+              <encoding>UTF-8</encoding>
+              <failsOnError>true</failsOnError>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+  <distributionManagement>
+    <!-- 发布release仓库 -->
+    <repository>
+      <id>platform-release</id>
+      <name>platform-release</name>
+      <url>http://113.105.74.141:8081/artifactory/libs-release-local</url>
+    </repository>
+    <!-- 发布快照版本 -->
+    <snapshotRepository>
+      <id>platform-snapshots</id>
+      <name>platform-snapshots</name>
+      <url>http://113.105.74.141:8081/artifactory/libs-snapshot-local</url>
+    </snapshotRepository>
+  </distributionManagement>
+
+
+</project>

+ 35 - 0
warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/OnlineApplication.java

@@ -0,0 +1,35 @@
+package com.uas.platform.warehouse.online;
+
+import com.uas.platform.warehouse.online.util.ContextUtils;
+import org.springframework.boot.Banner.Mode;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.boot.context.event.ApplicationPreparedEvent;
+import org.springframework.context.ApplicationListener;
+
+/**
+ * Online application entry.
+ *
+ * @author huxz
+ */
+@SpringBootApplication
+public class OnlineApplication {
+
+  /**
+   * program entry.
+   *
+   * @param args  Command Line Arguments
+   */
+  public static void main(String[] args) {
+    new SpringApplicationBuilder(OnlineApplication.class)
+            .bannerMode(Mode.OFF)
+            .web(true)
+            .listeners(new ApplicationListener<ApplicationPreparedEvent>() {
+              @Override
+              public void onApplicationEvent(ApplicationPreparedEvent event) {
+                ContextUtils.setApplicationContext(event.getApplicationContext());
+              }
+            })
+            .run(args);
+  }
+}

+ 41 - 0
warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/api/ApplicationController.java

@@ -0,0 +1,41 @@
+package com.uas.platform.warehouse.online.api;
+
+import com.uas.platform.warehouse.core.common.ResultBean;
+import com.uas.platform.warehouse.online.entity.AppAuthentication;
+import com.uas.platform.warehouse.online.service.ApplicationService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * Http interface for applying for app key.
+ *
+ * @author huxz
+ */
+@RestController
+@RequestMapping(path = "/api/warehouse/application")
+public class ApplicationController {
+
+  private final ApplicationService applicationService;
+
+  @Autowired
+  public ApplicationController(
+      ApplicationService applicationService) {
+    this.applicationService = applicationService;
+  }
+
+  /**
+   * Create app authentication record when admin agrees.
+   *
+   * @param authentication  app authentication info
+   * @return  response result
+   */
+  @PostMapping(path = "//authentication", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+  public ResultBean<AppAuthentication> createAuthenticationWhenAgree(
+      @RequestBody AppAuthentication authentication) {
+    return new ResultBean<>(applicationService.createAuthenticationWhenAgree(authentication));
+  }
+}

+ 20 - 0
warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/api/BaseController.java

@@ -0,0 +1,20 @@
+package com.uas.platform.warehouse.online.api;
+
+import org.apache.catalina.servlet4preview.http.HttpServletRequest;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ *
+ * @author wangmh
+ * @date 2017/11/16
+ */
+public class BaseController {
+
+    @Autowired
+    protected HttpServletRequest request;
+
+    @Autowired
+    protected HttpServletResponse response;
+}

+ 136 - 0
warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/api/LoginController.java

@@ -0,0 +1,136 @@
+package com.uas.platform.warehouse.online.api;
+
+import com.alibaba.fastjson.JSON;
+import com.uas.platform.warehouse.online.dao.AppAuthenticationDao;
+import com.uas.platform.warehouse.online.entity.AppAuthentication;
+import com.uas.platform.warehouse.online.util.AppKeyUtil;
+import com.uas.platform.warehouse.online.util.HttpUtil;
+import com.uas.sso.AuthToken;
+import com.uas.sso.SSOConfig;
+import com.uas.sso.SSOHelper;
+import com.uas.sso.SSOToken;
+import org.apache.catalina.servlet4preview.http.HttpServletRequest;
+import org.apache.log4j.Logger;
+import org.joda.time.DateTime;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.ui.ModelMap;
+import org.springframework.util.StringUtils;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
+
+/**
+ * Created by luhg on 2017/11/10.
+ * User login.
+ */
+@RestController
+public class LoginController{
+    private static final Logger logger = Logger.getLogger(HttpUtil.class);
+
+    @Autowired
+    private  AppAuthenticationDao authenticationDao;
+
+    @Autowired
+    private HttpServletRequest request;
+    /**
+     * 登录接口
+     * @param type 登录类型
+     *             user:用户
+     *             provider:供应商
+     * @return 返回登录代理页面
+     */
+    @RequestMapping(value = "/login/{type}", method = RequestMethod.GET)
+    @ResponseBody
+    public ModelAndView login(@PathVariable String type) {
+        request.getSession().setAttribute("type", type);
+        return new ModelAndView("/views/proxyLogin.html");
+    }
+
+    /**
+     * 在跨域确认账户中心登录之后调用接口,写入登录cookie
+     * @param replyTxt 由账户中心返回的数据
+     * @return 设置cookie是否成功
+     */
+    @RequestMapping(value = "/login/crossAfter", method = RequestMethod.POST)
+    @ResponseBody
+    public ModelMap getAuthenticationByUUAndType(HttpServletResponse response, String replyTxt){
+        if (!StringUtils.isEmpty(replyTxt)) {
+            SSOConfig config = SSOHelper.getSSOService().getConfig();
+            AuthToken token = SSOHelper.ok(request, response, replyTxt, config.getClientPublicKey(), config.getCenterPublicKey());
+            if (token != null) {
+                SSOToken tk = new SSOToken();
+                tk.setUid(token.getUid());
+                tk.setTime(token.getTime());
+                String type = String.valueOf(request.getSession().getAttribute("type"));
+                AppAuthentication appAuthentication = getAuthenticationByToken(token, type);
+                if (appAuthentication == null) {
+                    return new ModelMap("error", true);
+                }
+                tk.setData(JSON.toJSONString(appAuthentication));
+                SSOHelper.setSSOCookie(request, response, tk, true);
+            }
+        }
+        return new ModelMap("success", true);
+    }
+
+    /**
+     * 根据token获得验证
+     * @param token
+     * @param type
+     * @return
+     */
+    private AppAuthentication getAuthenticationByToken(AuthToken token, String type) {
+        AppAuthentication appAuthentication = null;
+        if (token.getData() != null) {
+            com.uas.account.entity.UserView tokenUser = JSON.parseObject(token.getData(), com.uas.account.entity.UserView.class);
+            appAuthentication = authenticationDao.findByEnUu(tokenUser.getSpaceDialectUID());
+            if(appAuthentication==null){
+                appAuthentication = new AppAuthentication();
+                String appKey = AppKeyUtil.createAppKey();
+                String secretKey = AppKeyUtil.createSecretKey(appKey);
+                appAuthentication.setEnUu(tokenUser.getSpaceDialectUID());
+                appAuthentication.setEnName(tokenUser.getSpaceName());
+                appAuthentication.setAppKey(appKey);
+                appAuthentication.setSecretKey(secretKey);
+                appAuthentication.setCreateTime(DateTime.now().toDate());
+                appAuthentication.setType(AppAuthentication.IdentificationType.getIdentificationType(type));
+                authenticationDao.save(appAuthentication);
+                logger.info("创建新用户:"+"企业名称="+tokenUser.getSpaceName()+"&appKey="+appKey+
+                        "&secretKey="+secretKey+"&type="+AppAuthentication.IdentificationType.getIdentificationType(type));
+            }
+        }
+        return appAuthentication;
+    }
+
+    /**
+     * 获取跨域登录的参数
+     *
+     * @return
+     * @throws IOException
+     */
+    @RequestMapping(value = "/login/crossBefore", method = RequestMethod.GET)
+    @ResponseBody
+    public ModelMap getCrossLoginData(HttpServletRequest request, HttpServletResponse response) throws IOException {
+        ModelMap model = new ModelMap();
+        SSOConfig config = SSOHelper.getSSOService().getConfig();
+        // 业务系统私钥签名 authToken 自动设置临时会话 cookie 授权后自动销毁
+        AuthToken at = SSOHelper.askCiphertext(request, response, config.getClientPrivateKey());
+        // askUrl 询问 sso 是否登录地址
+        model.addAttribute("askUrl", config.getCrossAskUrl());
+        // askTxt 询问 token 密文
+        model.addAttribute("askData", at.encryptAuthToken());
+        return model;
+    }
+
+    /**
+     * 判断是否登录
+     * @return
+     */
+    @RequestMapping("/isLogin")
+    public ModelMap isLogin() {
+        SSOToken token = SSOHelper.getToken(request);
+        return new ModelMap("isLogin", token!=null);
+    }
+}

+ 34 - 0
warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/api/StockInController.java

@@ -0,0 +1,34 @@
+package com.uas.platform.warehouse.online.api;
+
+import com.uas.platform.warehouse.online.entity.Stockin;
+import com.uas.platform.warehouse.online.entity.StockinDetail;
+import com.uas.platform.warehouse.online.service.StockInService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ *
+ * @author wangmh
+ * @date 2017/12/1
+ */
+@RestController
+@RequestMapping("/api/stockIn")
+public class StockInController {
+
+    @Autowired
+    private StockInService stockInService;
+
+    @RequestMapping(value = "/info/{asnNo}", method = RequestMethod.GET)
+    @ResponseBody
+    public List<StockinDetail> getStockIn(@PathVariable String asnNo) {
+        List<Stockin> stokins = stockInService.findStockIn(asnNo);
+        List<StockinDetail> stockinDetails = new ArrayList<>();
+        for (Stockin stokin : stokins) {
+            stockinDetails.addAll(stokin.getDetails());
+        }
+        return stockinDetails;
+    }
+}

+ 58 - 0
warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/config/ControllerExceptionHandler.java

@@ -0,0 +1,58 @@
+package com.uas.platform.warehouse.online.config;
+
+import com.uas.platform.warehouse.core.common.ResultBean;
+import java.io.IOException;
+import org.apache.log4j.Logger;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.http.converter.HttpMessageConverter;
+import org.springframework.http.converter.HttpMessageNotReadableException;
+import org.springframework.web.bind.annotation.ControllerAdvice;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.context.request.WebRequest;
+import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;
+
+/**
+ * Use @ControllerAdvice annotation to handler exceptions.
+ *
+ * <p>Tip: ResponseEntityExceptionHandler, write to the response with a {@link HttpMessageConverter
+ * message converter}</p>
+ *
+ * @author huxz
+ */
+@ControllerAdvice(annotations = {RestController.class})
+public class ControllerExceptionHandler extends ResponseEntityExceptionHandler {
+
+  private static final Logger logger = Logger.getLogger(ControllerExceptionHandler.class);
+
+  private static final String MESSAGE_BAD_REQUEST =
+      HttpStatus.BAD_REQUEST.value() + " " + HttpStatus.BAD_REQUEST.getReasonPhrase();
+
+  /**
+   * Handler IOException and RuntimeException.
+   *
+   * @param ex  exception info
+   * @return response entity
+   */
+  @ExceptionHandler(value = {IOException.class, RuntimeException.class})
+  @ResponseBody
+  public ResponseEntity<?> handlerCommonExceptions(Throwable ex) {
+    logger.error("System Error occurs", ex);
+    HttpHeaders headers = new HttpHeaders();
+    headers.add("Content-Type", MediaType.APPLICATION_JSON_UTF8_VALUE);
+    return new ResponseEntity<>(new ResultBean<>(ex), headers, HttpStatus.INTERNAL_SERVER_ERROR);
+  }
+
+  @Override
+  protected ResponseEntity<Object> handleHttpMessageNotReadable(HttpMessageNotReadableException ex,
+      HttpHeaders headers, HttpStatus status, WebRequest request) {
+    logger.error(MESSAGE_BAD_REQUEST, ex);
+
+    headers.add("Content-Type", MediaType.APPLICATION_JSON_UTF8_VALUE);
+    return handleExceptionInternal(ex, new ResultBean<>(ex), headers, status, request);
+  }
+}

+ 26 - 0
warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/dao/AppAuthenticationDao.java

@@ -0,0 +1,26 @@
+package com.uas.platform.warehouse.online.dao;
+
+import com.uas.platform.warehouse.online.entity.AppAuthentication;
+import com.uas.platform.warehouse.online.entity.AppAuthentication.IdentificationType;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+/**
+ * Abstract interface for app authentication operations.
+ *
+ * @author huxz
+ */
+@Repository
+public interface AppAuthenticationDao extends JpaRepository<AppAuthentication, Long> {
+
+  /**
+   * Find app authentication by enterprise UU and id type.
+   *
+   * @param enUu  enterprise uu
+   * @param type  id type
+   * @return  app authentication if exists
+   */
+  AppAuthentication findByEnUuAndType(String enUu, IdentificationType type);
+
+  AppAuthentication findByEnUu(String enUu);
+}

+ 17 - 0
warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/dao/StockInDao.java

@@ -0,0 +1,17 @@
+package com.uas.platform.warehouse.online.dao;
+
+import com.uas.platform.warehouse.online.entity.Stockin;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * Created by uas on 2017/12/1.
+ */
+@Repository
+public interface StockInDao extends JpaRepository<Stockin, Long> {
+
+    List<Stockin> findByAsnNo(String asnNo);
+}

+ 204 - 0
warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/entity/AppAuthentication.java

@@ -0,0 +1,204 @@
+package com.uas.platform.warehouse.online.entity;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import com.uas.platform.warehouse.core.util.JacksonUtils;
+import java.io.Serializable;
+import java.util.Date;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.Table;
+
+/**
+ * The type contains app key and secret key.
+ *
+ * @author huxz
+ */
+@Entity
+@Table(name = "app_key_manage", indexes = {
+    @Index(name = "unique_identification", columnList = "en_uu, identify_type", unique = true),
+    @Index(name = "index_app_key", columnList = "app_key", unique = true)})
+@JsonInclude(Include.NON_EMPTY)
+public class AppAuthentication implements Serializable {
+
+  private static final long serialVersionUID = -8727089238707403295L;
+
+  /**
+   * primary key.
+   */
+  @Id
+  @GeneratedValue
+  @Column(name = "id")
+  private Long id;
+
+  /**
+   * uu number of enterprise.
+   */
+  @Column(name = "en_uu")
+  private String enUu;
+
+  /**
+   * the name of enterprise, required if type set to ENTERPRISE_USER.
+   */
+  @Column(name = "en_name")
+  private String enName;
+
+  /**
+   * the name of warehouse, required if type set to WAREHOUSE_PROVIDER.
+   */
+  @Column(name = "wh_name")
+  private String whName;
+
+  /**
+   * identifier of the app.
+   */
+  @Column(name = "app_key")
+  private String appKey;
+
+  /**
+   * secret key.
+   */
+  @Column(name = "secret_key")
+  private String secretKey;
+
+  /**
+   * Represent type of user identification.
+   */
+  @Enumerated(value = EnumType.STRING)
+  @Column(name = "identify_type")
+  private IdentificationType type;
+
+  /**
+   * time when the key is created.
+   */
+  @Column(name = "create_time")
+  private Date createTime;
+
+  /**
+   * Whether the key is usable.
+   */
+  @Column(name = "enabled")
+  private boolean enabled = true;
+
+  /**
+   * Remark of a authentication.
+   */
+  @Column(name = "remark")
+  private String remark;
+
+  public AppAuthentication() {
+  }
+
+  public Long getId() {
+    return id;
+  }
+
+  public void setId(Long id) {
+    this.id = id;
+  }
+
+  public String getEnUu() {
+    return enUu;
+  }
+
+  public void setEnUu(String enUu) {
+    this.enUu = enUu;
+  }
+
+  public String getEnName() {
+    return enName;
+  }
+
+  public void setEnName(String enName) {
+    this.enName = enName;
+  }
+
+  public String getWhName() {
+    return whName;
+  }
+
+  public void setWhName(String whName) {
+    this.whName = whName;
+  }
+
+  public String getAppKey() {
+    return appKey;
+  }
+
+  public void setAppKey(String appKey) {
+    this.appKey = appKey;
+  }
+
+  public String getSecretKey() {
+    return secretKey;
+  }
+
+  public void setSecretKey(String secretKey) {
+    this.secretKey = secretKey;
+  }
+
+  public IdentificationType getType() {
+    return type;
+  }
+
+  public void setType(IdentificationType type) {
+    this.type = type;
+  }
+
+  public Date getCreateTime() {
+    return createTime;
+  }
+
+  public void setCreateTime(Date createTime) {
+    this.createTime = createTime;
+  }
+
+  public boolean isEnabled() {
+    return enabled;
+  }
+
+  public void setEnabled(boolean enabled) {
+    this.enabled = enabled;
+  }
+
+  public String getRemark() {
+    return remark;
+  }
+
+  public void setRemark(String remark) {
+    this.remark = remark;
+  }
+
+  @Override
+  public String toString() {
+    return JacksonUtils.toJson(this);
+  }
+
+  public enum IdentificationType {
+    /**
+     * Represent enterprise user.
+     */
+    ENTERPRISE_USER,
+
+    /**
+     * Represent warehouse provider.
+     */
+    WAREHOUSE_PROVIDER;
+
+    public static IdentificationType getIdentificationType(String type) {
+      switch (type) {
+        case "user":
+          return ENTERPRISE_USER;
+        case "provider":
+          return WAREHOUSE_PROVIDER;
+        default:
+          throw new RuntimeException("用户类型未找到!");
+      }
+    }
+  }
+}

+ 162 - 0
warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/entity/BaseVoucher.java

@@ -0,0 +1,162 @@
+package com.uas.platform.warehouse.online.entity;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import org.joda.time.LocalDateTime;
+
+import javax.persistence.Column;
+import javax.persistence.MappedSuperclass;
+import java.util.Date;
+
+/**
+ * Java Bean for common voucher info.
+ *
+ * @author huxz
+ */
+@MappedSuperclass
+public class BaseVoucher {
+  /**
+   * 数据类型.
+   */
+  @Column(name = "type")
+  private String type;
+
+  /**
+   * 所属企业UU.
+   */
+  @Column(name = "en_uu")
+  @JsonIgnore
+  @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
+  private String enUu;
+
+  /**
+   * 出货库位.
+   */
+  @Column(name = "wh_name")
+  private String whName;
+
+  /**
+   * 接收方UU
+   */
+  @Column(name = "receiverUU")
+  @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
+  private String receiverUU;
+
+  /**
+   * 发送方UU
+   */
+  @Column(name = "senderUU")
+  private String senderUU;
+
+  /**
+   * 企业名称
+   */
+  @Column(name = "enterprise")
+  private String enterprise;
+
+  /**
+   * 操作时间
+   */
+  @Column(name = "operate_time")
+  @JsonIgnore
+  private Date operateTime = LocalDateTime.now().toDate();
+
+
+  /**
+   * 备用字段1.
+   */
+  @Column(name = "attribute1", columnDefinition = "TEXT")
+  private String attribute1;
+
+  /**
+   * 备用字段2.
+   */
+  @Column(name = "attribute2", columnDefinition = "TEXT")
+  private String attribute2;
+
+  /**
+   * 备用字段3.
+   */
+  @Column(name = "attribute3")
+  private String attribute3;
+
+  public void setReceiverUU(String receiverUU) {
+    this.receiverUU = receiverUU;
+  }
+
+  public String getReceiverUU() {
+    return receiverUU;
+  }
+
+  public String getSenderUU() {
+    return senderUU;
+  }
+
+  public void setSenderUU(String senderUU) {
+    this.senderUU = senderUU;
+  }
+
+  public String getEnterprise() {
+    return enterprise;
+  }
+
+  public void setEnterprise(String enterprise) {
+    this.enterprise = enterprise;
+  }
+
+  public Date getOperateTime() {
+    return operateTime;
+  }
+
+  public void setOperateTime(Date operateTime) {
+    this.operateTime = operateTime;
+  }
+
+  public String getEnUu() {
+    return enUu;
+  }
+
+  public void setEnUu(String enUu) {
+    this.enUu = enUu;
+  }
+
+  public String getWhName() {
+    return whName;
+  }
+
+  public void setWhName(String whName) {
+    this.whName = whName;
+  }
+
+  public String getType() {
+    return type;
+  }
+
+  public void setType(String type) {
+    this.type = type;
+  }
+
+  public String getAttribute1() {
+    return attribute1;
+  }
+
+  public void setAttribute1(String attribute1) {
+    this.attribute1 = attribute1;
+  }
+
+  public String getAttribute2() {
+    return attribute2;
+  }
+
+  public void setAttribute2(String attribute2) {
+    this.attribute2 = attribute2;
+  }
+
+  public String getAttribute3() {
+    return attribute3;
+  }
+
+  public void setAttribute3(String attribute3) {
+    this.attribute3 = attribute3;
+  }
+}

+ 172 - 0
warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/entity/Stockin.java

@@ -0,0 +1,172 @@
+package com.uas.platform.warehouse.online.entity;
+
+/**
+ * Created by luhg on 2017/11/1.
+ */
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.uas.platform.warehouse.core.util.JacksonUtils;
+
+import javax.persistence.*;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 入库单信息.
+ *
+ * @author huxz
+ */
+@Entity
+@Table(name = "stockin")
+@JsonInclude(JsonInclude.Include.NON_EMPTY)
+public class Stockin  extends BaseVoucher {
+    @Id
+    @GeneratedValue
+    @Column(name = "id")
+    @JsonIgnore
+    private long id;
+
+    /**
+     * 入库库位.
+     */
+    @Column(name = "location")
+    private String location;
+
+    /**
+     * 入库单号.
+     */
+    @Column(name = "asn_no")
+    private String asnNo;
+
+    /**
+     * 入库类型.
+     */
+    @Column(name = "asn_type")
+    private String asnType;
+
+    /**
+     * 日期.
+     */
+    @Column(name = "predate")
+    private Date predate;
+
+    /**
+     * 币别.
+     */
+    @Column(name = "currency")
+    private String cur;
+
+    /**
+     * 录入人.
+     */
+    @Column(name = "operator")
+    private String operator;
+
+    /**
+     * 录入人.
+     */
+    @Column(name = "operator_uu")
+    private String operatorUU;
+
+    /**
+     * 备注.
+     */
+    @Column(name = "remark",columnDefinition = "TEXT")
+    private String remark;
+
+    /**
+     * 入库单明细.
+     */
+    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
+    @JoinColumn(name = "stockin_id")
+    private List<StockinDetail> details;
+
+    public Stockin() {
+    }
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public String getLocation() {
+        return location;
+    }
+
+    public void setLocation(String location) {
+        this.location = location;
+    }
+
+    public String getAsnNo() {
+        return asnNo;
+    }
+
+    public void setAsnNo(String asnNo) {
+        this.asnNo = asnNo;
+    }
+
+    public String getAsnType() {
+        return asnType;
+    }
+
+    public void setAsnType(String asnType) {
+        this.asnType = asnType;
+    }
+
+    public Date getPredate() {
+        return predate;
+    }
+
+    public void setPredate(Date predate) {
+        this.predate = predate;
+    }
+
+    public String getCur() {
+        return cur;
+    }
+
+    public void setCur(String cur) {
+        this.cur = cur;
+    }
+
+    public String getOperator() {
+        return operator;
+    }
+
+    public void setOperator(String operator) {
+        this.operator = operator;
+    }
+
+    public String getOperatorUU() {
+        return operatorUU;
+    }
+
+    public void setOperatorUU(String operatorUU) {
+        this.operatorUU = operatorUU;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public List<StockinDetail> getDetails() {
+        return details;
+    }
+
+    public void setDetails(List<StockinDetail> details) {
+        this.details = details;
+    }
+
+    @Override
+    public String toString() {
+        return JacksonUtils.toJson(this);
+    }
+}

+ 181 - 0
warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/entity/StockinDetail.java

@@ -0,0 +1,181 @@
+package com.uas.platform.warehouse.online.entity;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.uas.platform.warehouse.core.util.JacksonUtils;
+import org.joda.time.LocalDateTime;
+
+import javax.persistence.*;
+import java.util.Date;
+
+/**
+ * 入库单明细
+ * Created by luhg on 2017/11/1.
+ */
+@Entity
+@Table(name = "stockin_detail")
+@JsonInclude(JsonInclude.Include.NON_EMPTY)
+public class StockinDetail {
+    @Id
+    @GeneratedValue
+    @Column(name = "id")
+    @JsonIgnore
+    private Long id;
+
+    /**
+     * 入库单号.
+     */
+    @Column(name = "asn_no")
+    private String asnNo;
+
+    /**
+     * 入库单行号.
+     */
+    @Column(name = "asn_line_no")
+    private String asnLineNo;
+
+    /**
+     * 物料号.
+     */
+    @Column(name = "pn")
+    private String pn;
+
+    /**
+     * 入库数量.
+     */
+    @Column(name = "in_qty")
+    private int qty;
+
+    /**
+     * 单价.
+     */
+    @Column(name = "unitprice")
+    private double unitprice;
+
+    /**
+     * 批号.
+     */
+    @Column(name = "batchcode")
+    private String batchCode;
+
+    /**
+     * 备用字段1.
+     */
+    @Column(name = "attribute1",columnDefinition = "TEXT")
+    private String attribute1;
+
+    /**
+     * 备用字段2.
+     */
+    @Column(name = "attribute2",columnDefinition = "TEXT")
+    private String attribute2;
+
+    /**
+     * 备用字段3.
+     */
+    @Column(name = "attribute3",columnDefinition = "TEXT")
+    private String attribute3;
+
+    /**
+     * 操作时间
+     */
+    @Column(name = "operate_time")
+    @JsonIgnore
+    private Date operateTime = LocalDateTime.now().toDate();
+
+    public StockinDetail() {
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getAsnNo() {
+        return asnNo;
+    }
+
+    public void setAsnNo(String asnNo) {
+        this.asnNo = asnNo;
+    }
+
+    public String getAsnLineNo() {
+        return asnLineNo;
+    }
+
+    public void setAsnLineNo(String asnLineNo) {
+        this.asnLineNo = asnLineNo;
+    }
+
+    public String getPn() {
+        return pn;
+    }
+
+    public void setPn(String pn) {
+        this.pn = pn;
+    }
+
+    public int getQty() {
+        return qty;
+    }
+
+    public void setQty(int qty) {
+        this.qty = qty;
+    }
+
+    public double getUnitprice() {
+        return unitprice;
+    }
+
+    public void setUnitprice(double unitprice) {
+        this.unitprice = unitprice;
+    }
+
+    public String getBatchCode() {
+        return batchCode;
+    }
+
+    public void setBatchCode(String batchCode) {
+        this.batchCode = batchCode;
+    }
+
+    public String getAttribute1() {
+        return attribute1;
+    }
+
+    public void setAttribute1(String attribute1) {
+        this.attribute1 = attribute1;
+    }
+
+    public String getAttribute2() {
+        return attribute2;
+    }
+
+    public void setAttribute2(String attribute2) {
+        this.attribute2 = attribute2;
+    }
+
+    public String getAttribute3() {
+        return attribute3;
+    }
+
+    public void setAttribute3(String attribute3) {
+        this.attribute3 = attribute3;
+    }
+
+    @Override
+    public String toString() {
+        return JacksonUtils.toJson(this);
+    }
+
+    public Date getOperateTime() {
+        return operateTime;
+    }
+
+    public void setOperateTime(Date operateTime) {
+        this.operateTime = operateTime;
+    }
+}

+ 14 - 0
warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/profile/Dev.java

@@ -0,0 +1,14 @@
+package com.uas.platform.warehouse.online.profile;
+
+import org.springframework.context.annotation.Profile;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target({ ElementType.TYPE, ElementType.METHOD })
+@Retention(RetentionPolicy.RUNTIME)
+@Profile("dev")
+public @interface Dev {
+}

+ 14 - 0
warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/profile/Prod.java

@@ -0,0 +1,14 @@
+package com.uas.platform.warehouse.online.profile;
+
+import org.springframework.context.annotation.Profile;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target({ ElementType.TYPE, ElementType.METHOD })
+@Retention(RetentionPolicy.RUNTIME)
+@Profile("prod")
+public @interface Prod {
+}

+ 62 - 0
warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/profile/SSOConfiguration.java

@@ -0,0 +1,62 @@
+package com.uas.platform.warehouse.online.profile;
+
+import com.uas.account.web.AccountConfigurer;
+import com.uas.platform.warehouse.online.OnlineApplication;
+import com.uas.platform.warehouse.online.util.ContextUtils;
+import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
+
+
+/**
+ * SSOconfig 配置
+ *
+ * @author hejq
+ */
+@Configuration
+public class SSOConfiguration extends WebMvcConfigurerAdapter {
+
+
+    @Override
+    public void addInterceptors(InterceptorRegistry registry) {
+//        /**
+//         * 拦截器配置
+//         */
+//        registry.addInterceptor(new SSOInterceptor()).addPathPatterns("/**").
+//                excludePathPatterns("/WEB-INF/**","/**/static/**", "/login/**", "/logout/**");
+    }
+
+    @Bean
+    @Dev
+    public AccountConfigurer devAccountConfigurer() {
+        return accountConfigurer("dev");
+    }
+
+    @Bean
+    @Test
+    public AccountConfigurer testAccountConfigurer() {
+        return accountConfigurer("test");
+    }
+
+    @Bean
+    @Prod
+    public AccountConfigurer prodAccountConfigurer() {
+        return accountConfigurer("prod");
+    }
+
+    /**
+     * 获取当前环境下的配置
+     *
+     * @param profile
+     * @return
+     */
+    private AccountConfigurer accountConfigurer(String profile) {
+        AccountConfigurer accountConfigurer = new AccountConfigurer("classpath:" + profile + "/account.properties");
+        accountConfigurer.setApplicationContext(ContextUtils.getApplicationContext());
+        accountConfigurer.init();
+        return accountConfigurer;
+    }
+
+}

+ 14 - 0
warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/profile/Test.java

@@ -0,0 +1,14 @@
+package com.uas.platform.warehouse.online.profile;
+
+import org.springframework.context.annotation.Profile;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target({ ElementType.TYPE, ElementType.METHOD })
+@Retention(RetentionPolicy.RUNTIME)
+@Profile("test")
+public @interface Test {
+}

+ 19 - 0
warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/service/ApplicationService.java

@@ -0,0 +1,19 @@
+package com.uas.platform.warehouse.online.service;
+
+import com.uas.platform.warehouse.online.entity.AppAuthentication;
+
+/**
+ * Abstract interface for applying for app key.
+ *
+ * @author huxz
+ */
+public interface ApplicationService {
+
+  /**
+   * Create app authentication record when admin agrees.
+   *
+   * @param authentication  app authentication info
+   * @return  authentication when saved
+   */
+  AppAuthentication createAuthenticationWhenAgree(AppAuthentication authentication);
+}

+ 14 - 0
warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/service/StockInService.java

@@ -0,0 +1,14 @@
+package com.uas.platform.warehouse.online.service;
+
+
+import com.uas.platform.warehouse.online.entity.Stockin;
+
+import java.util.List;
+
+/**
+ * Created by uas on 2017/12/1.
+ */
+public interface StockInService {
+
+    List<Stockin> findStockIn(String asnNo);
+}

+ 62 - 0
warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/service/impl/ApplicationServiceImpl.java

@@ -0,0 +1,62 @@
+package com.uas.platform.warehouse.online.service.impl;
+
+import com.uas.platform.warehouse.online.dao.AppAuthenticationDao;
+import com.uas.platform.warehouse.online.entity.AppAuthentication;
+import com.uas.platform.warehouse.online.entity.AppAuthentication.IdentificationType;
+import com.uas.platform.warehouse.online.service.ApplicationService;
+import com.uas.platform.warehouse.online.util.AppKeyUtil;
+import org.apache.commons.lang3.Validate;
+import org.joda.time.DateTime;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * Java Bean implementations of interface {@code ApplicationService.
+ *
+ * @author huxz
+ */
+@Service
+public class ApplicationServiceImpl implements ApplicationService {
+
+  private final AppAuthenticationDao authenticationDao;
+
+  @Autowired
+  public ApplicationServiceImpl(
+      AppAuthenticationDao authenticationDao) {
+    this.authenticationDao = authenticationDao;
+  }
+
+  @Override
+  public AppAuthentication createAuthenticationWhenAgree(AppAuthentication authentication) {
+    String type = "当前企业用户";
+
+    Validate.notNull(authentication, "仓储接口认证信息不能为空");
+    Validate.notBlank(authentication.getEnUu(), "用户的企业UU不能为空");
+    Validate.notNull(authentication.getType(), "用户申请接口类型不能为空");
+    if (IdentificationType.ENTERPRISE_USER.equals(authentication.getType())) {
+      Validate.notBlank(authentication.getEnName(), "用户的企业名称不能为空");
+    } else if (IdentificationType.WAREHOUSE_PROVIDER.equals(authentication.getType())) {
+      Validate.notBlank(authentication.getWhName(), "仓储名称不能为空");
+      type = "当前仓储提供商";
+    } else {
+      throw new IllegalArgumentException(String.format("接口类型 %s 不存在",
+          authentication.getType()));
+    }
+
+    AppAuthentication appAuthentication = authenticationDao
+        .findByEnUuAndType(authentication.getEnUu(), authentication.getType());
+    if (appAuthentication != null) {
+      throw new IllegalStateException(type + "已经申请开发者秘钥");
+    }
+
+    String appKey = AppKeyUtil.createAppKey();
+    String secretKey = AppKeyUtil.createSecretKey(appKey);
+    authentication.setAppKey(appKey);
+    authentication.setSecretKey(secretKey);
+    authentication.setCreateTime(DateTime.now().toDate());
+
+    authentication.setRemark("test");
+
+    return authenticationDao.save(authentication);
+  }
+}

+ 27 - 0
warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/service/impl/StockInServiceImpl.java

@@ -0,0 +1,27 @@
+package com.uas.platform.warehouse.online.service.impl;
+
+import com.uas.platform.warehouse.online.dao.StockInDao;
+import com.uas.platform.warehouse.online.entity.Stockin;
+import com.uas.platform.warehouse.online.service.StockInService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+/**
+ *
+ * @author wangmh
+ * @date 2017/12/1
+ */
+@Service
+public class StockInServiceImpl implements StockInService {
+
+    @Autowired
+    public StockInDao stockInDao;
+
+    @Override
+    public List<Stockin> findStockIn(String asnNo) {
+        return stockInDao.findByAsnNo(asnNo);
+    }
+}

+ 45 - 0
warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/util/AppKeyUtil.java

@@ -0,0 +1,45 @@
+package com.uas.platform.warehouse.online.util;
+
+import java.util.Random;
+import java.util.UUID;
+
+/**
+ * 用于生成Api accessKey和 secretKey.
+ *
+ * @author huxz
+ */
+public class AppKeyUtil {
+
+  private static String createUuid() {
+    String uuid = UUID.randomUUID().toString();
+    return uuid.replaceAll("-", "");
+  }
+
+  /**
+   * Create app key, using uuid.
+   */
+  public static String createAppKey() {
+    return createUuid().toLowerCase();
+  }
+
+  /**
+   * Create secret key based on app key.
+   *
+   * @param appKey key represents app visitor
+   */
+  public static String createSecretKey(String appKey) {
+    if (appKey == null || "".equals(appKey)) {
+      throw new IllegalArgumentException("App Key can't be empty");
+    }
+
+    int randomNum = 8;
+    StringBuilder builder = new StringBuilder(createUuid());
+    for (int i = 0; i < randomNum; i++) {
+      Random random = new Random();
+      int index = random.nextInt(appKey.length());
+
+      builder.insert(index, appKey.substring(index, index + 1));
+    }
+    return builder.toString().toUpperCase();
+  }
+}

+ 73 - 0
warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/util/ContextUtils.java

@@ -0,0 +1,73 @@
+package com.uas.platform.warehouse.online.util;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationEvent;
+
+/**
+ * spring容器上下文对象
+ * 
+ * @author yingp
+ *
+ */
+public class ContextUtils {
+	private static ApplicationContext applicationContext;
+
+	private static Logger logger = LoggerFactory.getLogger(ContextUtils.class);
+
+	public static void setApplicationContext(ApplicationContext applicationContext) {
+		synchronized (ContextUtils.class) {
+			logger.debug("setApplicationContext, notifyAll");
+			ContextUtils.applicationContext = applicationContext;
+			ContextUtils.class.notifyAll();
+		}
+	}
+
+	public static ApplicationContext getApplicationContext() {
+		synchronized (ContextUtils.class) {
+			while (applicationContext == null) {
+				try {
+					logger.debug("getApplicationContext, wait...");
+					ContextUtils.class.wait(60000);
+					if (applicationContext == null) {
+						logger.warn("Have been waiting for ApplicationContext to be set for 1 minute", new Exception());
+					}
+				} catch (InterruptedException ex) {
+					logger.debug("getApplicationContext, wait interrupted");
+				}
+			}
+			return applicationContext;
+		}
+	}
+
+	/**
+	 * 获取bean
+	 * 
+	 * @param name
+	 * @return
+	 */
+	public static Object getBean(String name) {
+		return getApplicationContext().getBean(name);
+	}
+
+	/**
+	 * 获取bean
+	 * 
+	 * @param cls
+	 * @return
+	 */
+	public static <T> T getBean(Class<T> cls) {
+		return getApplicationContext().getBean(cls);
+	}
+
+	/**
+	 * 触发事件
+	 * 
+	 * @param event
+	 */
+	public static void publishEvent(ApplicationEvent event) {
+		getApplicationContext().publishEvent(event);
+	}
+
+}

+ 95 - 0
warehouse-online-app/src/main/java/com/uas/platform/warehouse/online/util/HttpUtil.java

@@ -0,0 +1,95 @@
+package com.uas.platform.warehouse.online.util;
+
+import org.apache.http.HttpResponse;
+import org.apache.http.StatusLine;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.HttpResponseException;
+import org.apache.http.client.ResponseHandler;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.entity.ContentType;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.log4j.Logger;
+
+import java.io.*;
+import java.net.URI;
+import java.nio.charset.Charset;
+
+/**
+ * 使用HttpComponents 实现 http client.
+ *
+ * @author huxz
+ */
+public class HttpUtil {
+
+  private static final Logger logger = Logger.getLogger(HttpUtil.class);
+
+  /**
+   * Send GET request to http server.
+   *
+   * @param uri request uri
+   * @return response result of http
+   */
+/*  public static String getMethod(URI uri) throws IOException {
+    CloseableHttpClient httpClient = HttpClients.createDefault();
+    HttpGet httpGet = new HttpGet(uri);
+
+    return httpClient.execute(httpGet, RESPONSE_HANDLER_STRING);
+  }*/
+
+  /*public static final ResponseHandler<String> RESPONSE_HANDLER_STRING = new ResponseHandler<String>() {
+
+    @Override
+    public String handleResponse(final HttpResponse response) throws IOException {
+      StatusLine line = response.getStatusLine();
+      org.apache.http.HttpEntity entity = response.getEntity();
+
+      if (line.getStatusCode() >= 300) {
+        if (logger.isDebugEnabled()) {
+          logger.debug("Response status code: " + line.getStatusCode());
+        }
+
+        String errorMessage = Integer.toString(line.getStatusCode());
+        if (entity != null) {
+          InputStream content = entity.getContent();
+          try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) {
+            byte[] buffer = new byte[1024];
+            int len;
+
+            while ((len = content.read(buffer)) >= 0) {
+              outputStream.write(buffer, 0, len);
+            }
+            outputStream.flush();
+            errorMessage = outputStream.toString("UTF-8");
+          }
+        }
+
+        if (logger.isDebugEnabled()) {
+          logger.debug("Error Message: " + errorMessage);
+        }
+        throw new HttpResponseException(line.getStatusCode(), errorMessage);
+      }
+
+      if (entity == null) {
+        throw new ClientProtocolException("Response contains no content");
+      }
+
+      ContentType contentType = ContentType.getOrDefault(entity);
+      Charset charset = contentType.getCharset();
+      System.out.println("content:"+entity.getContent());
+      Reader reader = new InputStreamReader(entity.getContent(), charset);
+      System.out.println("reader:" + reader);
+      BufferedReader r = new BufferedReader(reader);
+      StringBuilder b = new StringBuilder();
+      String linea;
+      while((linea=r.readLine())!=null) {
+        b.append(linea);
+        b.append("\r\n");
+      }
+      b.toString();
+      System.out.println(b);
+      //return JacksonUtils.fromJson(reader, String.class).toString();
+      return b.toString();
+    }
+  };*/
+}

+ 10 - 0
warehouse-online-app/src/main/resources/application-dev.yml

@@ -0,0 +1,10 @@
+spring:
+  datasource:
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    username: root
+    password: 123456
+    url: jdbc:mysql://localhost:3306/warehouse?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8
+  jpa:
+    database: mysql
+    hibernate:
+      ddl-auto: update

+ 10 - 0
warehouse-online-app/src/main/resources/application-prod.yml

@@ -0,0 +1,10 @@
+spring:
+  datasource:
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    username: root
+    password: select111***
+    url: jdbc:mysql://192.168.253.12:3306/warehouse?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8
+  jpa:
+    database: mysql
+    hibernate:
+      ddl-auto: update

+ 10 - 0
warehouse-online-app/src/main/resources/application-test.yml

@@ -0,0 +1,10 @@
+spring:
+  datasource:
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    username: root
+    password: select111***
+    url: jdbc:mysql://192.168.253.12:3306/warehouse?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8
+  jpa:
+    database: mysql
+    hibernate:
+      ddl-auto: update

+ 8 - 0
warehouse-online-app/src/main/resources/application.yml

@@ -0,0 +1,8 @@
+server:
+  port: 20320
+
+spring:
+  application:
+    name: warehouse-online-app
+  profiles:
+    active: test

+ 21 - 0
warehouse-online-app/src/main/resources/dev/account.properties

@@ -0,0 +1,21 @@
+### account center config, 
+account.us.save.url=http://10.10.100.133/api/userspace
+account.user.save.url=http://10.10.100.133/api/user
+account.user.getPartners.url = http://10.10.100.133/api/partners
+account.user.getContactPage.url = http://113.105.74.135:8001/business/groups
+
+### sso config
+sso.app=warehouse
+# token secretkey
+sso.secretkey=0taQcW073Z7G628g5H
+sso.cookie.secure=false
+sso.login.url=http://113.105.74.135:8001/sso/login
+
+#cross domain
+sso.ask.url=http://113.105.74.135:8001/sso/login/ask
+sso.askout.url=http://113.105.74.135:8001/sso/logout/ask
+sso.proxy.uri=login/proxy
+sso.authcookie.secretkey=Z318866alN6gA0piuO
+sso.client.private_key=MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAJa3qfiScPIdpMiE9FwRS7b7naZgeCas3eDsH0rWTf9ThMkFjpU+913vB3krEzUaSsGQl/hwOasoQNdr+/9OW2uw6LR6iUWJhVPVDaDD0frm5SfXIHFdAYb/5XM8rB422x9C8+gDz7dGfjwORl2Xw6TTinavM20w0m6fxYLoxUiJAgMBAAECgYAPzcJs5i4htSoKPKbC4K1nyoqFX6g5pfa+FwRQ/JfBJijOS17gF3Ioz1+hPPsOnmsoUNkem+XwJJBoBlKuOrErOCLZFHSls4C7655K+Ct83D43v9+2YxvTAjw8WNBgelpDRkzD1agyNj/O6u9UzpSxWxdgUwJ4LxnnOzQki2ohYQJBAN8GRQL+aj3zzIlg+ShzpEd+F2O1FevWsi2M8gAkYE1Ano5VdKCqlG9MVojCyb86GmMWCdThu7jxdAbjX7tGVGsCQQCtAH1/+L76RFzQgmNq2TvPkTwIcyunUyJhIDtPucLgj5B6zSkW/+NriLnohaxcgTLUQ7h2FHrfNt79MNMGzXPbAkAtnh2tkBZxF5YFn5U3Jfg7O1pTZa3XMHH/iS3Sw54DDy2fVXFmj52O6mFk1droR10wWUinh4ibOqAN7KIfLzKDAkBlUmcuPxIi40z0tZjiaE42WBov3LwRaIg3GDiEjghLmumEcooBNWcNgOtY+okjOGv7k5oCViZMeweIhELjtgqHAkEAgk3MQtupaIvCBEJsbs71F8sB4AkQ3VeqZC6s/OV336H4ORkXfInnw1YBxFUZ0LcGvSuh5WyvL7YUFxuGah8RGw==
+sso.client.public_key=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCWt6n4knDyHaTIhPRcEUu2+52mYHgmrN3g7B9K1k3/U4TJBY6VPvdd7wd5KxM1GkrBkJf4cDmrKEDXa/v/TltrsOi0eolFiYVT1Q2gw9H65uUn1yBxXQGG/+VzPKweNtsfQvPoA8+3Rn48DkZdl8Ok04p2rzNtMNJun8WC6MVIiQIDAQAB
+sso.center.public_key=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAL2g7CEfuPZtEDy7Iz5AL6iwbHZewWGUBYUWxKnFAwAW4lY8mMavn5Ke5mB25eKj5bvUsB48r8gWTvJNsKRGEw8CAwEAAQ==

+ 22 - 0
warehouse-online-app/src/main/resources/prod/account.properties

@@ -0,0 +1,22 @@
+### account center config, 
+account.us.save.url=http://10.10.100.133:8080/api/userspace
+account.user.save.url=http://10.10.100.133:8080/api/user
+account.user.getPartners.url = http://10.10.100.133:8080/api/partners
+account.user.getContactPage.url=https://account.ubtob.com/business/groups
+
+### sso config
+sso.app=b2b
+# token secretkey
+sso.secretkey=0taQcW073Z7G628g5H
+#sso.cookie.domain=.ubtob.com
+#sso.cookie.secure=false
+sso.login.url=https://account.ubtob.com/sso/login
+
+#cross domain
+sso.ask.url=https://account.ubtob.com/sso/logout/ask
+sso.askout.url=https://account.ubtob.com/sso/logout/ask
+sso.proxy.uri=login/proxy
+sso.authcookie.secretkey=Z318866alN6gA0piuO
+sso.client.private_key=MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAJ8t+/zzUgWEIPjmlfpvaLH/Yu4Ev8c2fl4eoR71QvX1yM5htcMoGaCaF5g9DKivTZJV6sMomDDRryniI7sCnfcNvbgJkPUXEYtYiL+lKjmq2x0ntCFz/2RhVAvcFpD4KHXrzXzawu/WjcfB3txadjV7eZzruFcigqN1odwgjBXRAgMBAAECgYBC7o4HlbSGd0F6B1NHA7ONLOrHVJ3jQUmvf8eWAeEPFTNDfJh2IBVuj3yeWgVJpLTEdHYLa7VaycCSpvEJQJd00a2H2XUV3yLmGj137juRYBT3orbT+BEuUdavIEL/xjiavCfSRa1RU/JmGLzO/Xv+52rp3uZeaitvdbm1fkVpMQJBANAd3NstLjgYCm42UKQuz5GoWhPv5EhrHU7/TGKkojyNT/+1buT5qIjzl935F8pcOMydjpqMVYhhLhLNRf5Gnd0CQQDDzbcXHovB+VDIjFOG+7vjr4bycust2pRag1Y4l29uouCv9KgCQcunKKo1TiRDmY+NL4W9WY0ohHRYFvz4+DqFAkEAwvkXLic3w8mSDArKpeZNBDLqoP7/qXDgdl/rWgbPD1d8eR2rFM1oPVWpE4YH6cdYVynMrbGHeEtC9M5nIn9Z6QJAf1Kt1CLQznnIxiA50HSxYQUqw01nEJIqFhGBZ5tRoqfXY5O8DHusai5PQApoGm0oo65bUR2CZO58mSuZpGwF4QJBAIFAsKle4pR3NzekGSOMjTiHDTPcJ0BaZG00fXbjytTUnHOe0IACvYy3Xs/N1uDUyRMhaZMSFiubOpqVHgYb/Jw=
+sso.client.public_key=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCfLfv881IFhCD45pX6b2ix/2LuBL/HNn5eHqEe9UL19cjOYbXDKBmgmheYPQyor02SVerDKJgw0a8p4iO7Ap33Db24CZD1FxGLWIi/pSo5qtsdJ7Qhc/9kYVQL3BaQ+Ch168182sLv1o3Hwd7cWnY1e3mc67hXIoKjdaHcIIwV0QIDAQAB
+sso.center.public_key=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAL2g7CEfuPZtEDy7Iz5AL6iwbHZewWGUBYUWxKnFAwAW4lY8mMavn5Ke5mB25eKj5bvUsB48r8gWTvJNsKRGEw8CAwEAAQ==

+ 13 - 0
warehouse-online-app/src/main/resources/spring/context.xml

@@ -0,0 +1,13 @@
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
+       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd">
+
+    <context:property-placeholder location="classpath*:${profile}/*.properties" />
+    <!-- 账户中心配置 -->
+    <bean id="accountConfigurer" class="com.uas.account.web.AccountConfigurer"
+          init-method="init">
+        <property name="configPath" value="classpath:dev/account.properties" />
+    </bean>
+</beans>

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